SAGA API: Class List

SAGA API v9.2
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12]
C CSG_Array
C CSG_Array_Int
C CSG_Array_Pointer
C CSG_Array_sLong
C CSG_Buffer
C CSG_Bytes
C CSG_Bytes_Array
C CSG_Category_Statistics
C CSG_Classifier_Supervised
C CSG_Cluster_Analysis
C CSG_Colors
C CSG_Data_Collection
C CSG_Data_Manager
C CSG_Data_Object
C CSG_DateTime
C CSG_Distance_Weighting
C CSG_File
C CSG_File_Zip
►C CSG_Formula
C SSG_Function
C CSG_Grid
C CSG_Grid_Cell_Addressor
C CSG_Grid_Collection
C CSG_Grid_File_Info
C CSG_Grid_OGIS_Converter
C CSG_Grid_Pyramid
C CSG_Grid_Radius
C CSG_Grid_Stack
C CSG_Grid_System
C CSG_Grids
C CSG_Histogram
C CSG_HTTP
►C CSG_Index
C CSG_Index_Compare
C CSG_KDTree
C CSG_KDTree_2D
C CSG_KDTree_3D
C CSG_Lines
C CSG_Matrix
C CSG_MetaData
C CSG_Natural_Breaks
C CSG_Parameter
C CSG_Parameter_Bool
C CSG_Parameter_Choice
C CSG_Parameter_Choices
C CSG_Parameter_Color
C CSG_Parameter_Colors
C CSG_Parameter_Data_Object
C CSG_Parameter_Data_Object_Output
C CSG_Parameter_Data_Type
C CSG_Parameter_Date
C CSG_Parameter_Degree
C CSG_Parameter_Double
C CSG_Parameter_File_Name
C CSG_Parameter_Fixed_Table
C CSG_Parameter_Font
C CSG_Parameter_Grid
C CSG_Parameter_Grid_List
C CSG_Parameter_Grid_System
C CSG_Parameter_Grids
C CSG_Parameter_Grids_List
C CSG_Parameter_Int
C CSG_Parameter_List
C CSG_Parameter_Node
C CSG_Parameter_Parameters
C CSG_Parameter_PointCloud
C CSG_Parameter_PointCloud_List
C CSG_Parameter_Range
C CSG_Parameter_Shapes
C CSG_Parameter_Shapes_List
C CSG_Parameter_String
C CSG_Parameter_Table
C CSG_Parameter_Table_Field
C CSG_Parameter_Table_Fields
C CSG_Parameter_Table_List
C CSG_Parameter_Text
C CSG_Parameter_TIN
C CSG_Parameter_TIN_List
C CSG_Parameter_Value
C CSG_Parameters
C CSG_Parameters_Grid_Target
C CSG_Parameters_Point_Search
C CSG_Parameters_Point_Search_KDTree_2D
C CSG_Point
C CSG_Point_3D
C CSG_Point_4D
C CSG_PointCloud
C CSG_Points
C CSG_Points_3D
C CSG_Points_Int
►C CSG_PriorityQueue
C CSG_PriorityQueueItem
C CSG_Projection
C CSG_Projections
C CSG_PRQuadTree
C CSG_PRQuadTree_Item
C CSG_PRQuadTree_Leaf
C CSG_PRQuadTree_Leaf_List
C CSG_PRQuadTree_Node
C CSG_PRQuadTree_Node_Statistics
C CSG_Random
C CSG_Rect
C CSG_Rect_Int
C CSG_Rects
C CSG_Rects_Int
C CSG_Regression
C CSG_Regression_Multiple
C CSG_Regression_Weighted
C CSG_Shape
C CSG_Shape_Line
C CSG_Shape_Part
C CSG_Shape_Point
C CSG_Shape_Point_Z
C CSG_Shape_Point_ZM
C CSG_Shape_Points
C CSG_Shape_Polygon
C CSG_Shape_Polygon_Part
C CSG_Shapes
C CSG_Shapes_OGIS_Converter
C CSG_Simple_Statistics
C CSG_Spline
C CSG_Stack
C CSG_String
C CSG_String_Tokenizer
C CSG_Strings
C CSG_Table
C CSG_Table_DBase
C CSG_Table_Record
C CSG_Table_Value
C CSG_Table_Value_Binary
C CSG_Table_Value_Date
C CSG_Table_Value_Double
C CSG_Table_Value_Int
C CSG_Table_Value_Long
C CSG_Table_Value_String
C CSG_Test_Distribution
C CSG_Thin_Plate_Spline
C CSG_TimeSpan
►C CSG_TIN
C TTIN_Edge
C TTIN_Triangle
C CSG_TIN_Edge
C CSG_TIN_Node
C CSG_TIN_Triangle
C CSG_Tool
C CSG_Tool_Chain
C CSG_Tool_Chains
C CSG_Tool_Grid
C CSG_Tool_Grid_Interactive
C CSG_Tool_Interactive
C CSG_Tool_Interactive_Base
C CSG_Tool_Library
C CSG_Tool_Library_Interface
C CSG_Tool_Library_Manager
C CSG_Translator
C CSG_Trend
C CSG_Trend_Polynom
C CSG_UI_Parameter
C CSG_Unique_Number_Statistics
C CSG_Unique_String_Statistics
C CSG_Unique_Value_Statistics
C CSG_Vector
C SSG_Point
C SSG_Point_3D
C SSG_Point_4D
C SSG_Point_Int
C SSG_Rect
C SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Array Class Reference

Public Member Functions | List of all members
CSG_Array Class Reference

#include <api_core.h>

Public Member Functions

CSG_Array (void)
~CSG_Array (void)
CSG_Array (const CSG_Array &Array)
void * | Create (const CSG_Array &Array)
CSG_Array (size_t Value_Size, sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
void * | Create (size_t Value_Size, sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
bool | Destroy (void)
CSG_Array & | operator= (const CSG_Array &Array)
bool | Set_Growth (TSG_Array_Growth Growth)
TSG_Array_Growth | Get_Growth (void) const
size_t | Get_Value_Size (void) const
sLong | Get_Size (void) const
size_t | Get_uSize (void) const
void * | Get_Entry (sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and dereference the pointer to get access to the variable itself. More...
void * | operator[] (sLong Index) const
bool | Del_Entry (sLong Index, bool bShrink=true)
void * | Get_Array (void) const
void * | Get_Array (sLong nValues)
bool | Set_Array (sLong nValues, bool bShrink=true)
bool | Set_Array (sLong nValues, void **pArray, bool bShrink=true)
bool | Inc_Array (sLong nValues=1)
bool | Inc_Array (void **pArray)
bool | Dec_Array (bool bShrink=true)
bool | Dec_Array (void **pArray, bool bShrink=true)

Detailed Description

Definition at line 307 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Array() [1/3]

CSG_Array::CSG_Array ( void )

Definition at line 230 of file api_memory.cpp.

◆ ~CSG_Array()

CSG_Array::~CSG_Array ( void )

Definition at line 286 of file api_memory.cpp.

References Destroy().

◆ CSG_Array() [2/3]

CSG_Array::CSG_Array ( const CSG_Array & Array )

Definition at line 241 of file api_memory.cpp.

References Create().

◆ CSG_Array() [3/3]

CSG_Array::CSG_Array | ( | size_t | Value_Size,
 |  | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |

Definition at line 266 of file api_memory.cpp.

References Create().

Member Function Documentation

◆ Create() [1/2]

void * CSG_Array::Create ( const CSG_Array & Array )

Definition at line 250 of file api_memory.cpp.

References Destroy(), and Get_Array().

Referenced by CSG_PointCloud::_On_Construction(), CSG_Table::_On_Construction(), CSG_Simple_Statistics::Create(), CSG_Array_Int::Create(), CSG_Array_Pointer::Create(), CSG_Array_sLong::Create(), CSG_Cluster_Analysis::Create(), CSG_Array(), CSG_Points::CSG_Points(), CSG_Points_3D::CSG_Points_3D(), CSG_Points_Int::CSG_Points_Int(), CSG_Stack::CSG_Stack(), CSG_Vector::CSG_Vector(), and CSG_Tool::Settings_Push().

◆ Create() [2/2]

void * CSG_Array::Create | ( | size_t | Value_Size,
 |  | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |

Definition at line 275 of file api_memory.cpp.

References Destroy(), and Get_Array().

◆ Dec_Array() [1/2]

bool CSG_Array::Dec_Array ( bool bShrink = true )

Definition at line 425 of file api_memory.cpp.

References Set_Array().

Referenced by CSG_Table::_Del_Selection(), CSG_MetaData::Del_Child(), CSG_Vector::Del_Row(), and CSG_Stack::Get_Record_Pop().

◆ Dec_Array() [2/2]

bool CSG_Array::Dec_Array | ( | void ** | pArray,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 430 of file api_memory.cpp.

References Set_Array().

◆ Del_Entry()

bool CSG_Array::Del_Entry | ( | sLong | Index,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 436 of file api_memory.cpp.

References Set_Array().

◆ Destroy()

bool CSG_Array::Destroy ( void )

Definition at line 291 of file api_memory.cpp.

References SG_FREE_SAFE.

Referenced by CSG_Simple_Statistics::Add(), Create(), CSG_MetaData::Del_Children(), CSG_PointCloud::Del_Points(), CSG_Cluster_Analysis::Destroy(), CSG_MetaData::Destroy(), CSG_PRQuadTree::Destroy(), CSG_Simple_Statistics::Invalidate(), CSG_PointCloud::Select(), Set_Array(), CSG_Simple_Statistics::Set_Count(), and ~CSG_Array().

◆ Get_Array() [1/2]

void* CSG_Array::Get_Array ( sLong nValues )
inline

Definition at line 337 of file api_core.h.

◆ Get_Array() [2/2]

void* CSG_Array::Get_Array ( void ) const
inline

Definition at line 336 of file api_core.h.

Referenced by CSG_Table::_Del_Selection(), CSG_Simple_Statistics::Add(), CSG_Simple_Statistics::Add_Value(), CSG_Points::Assign(), CSG_Points_3D::Assign(), CSG_Points_Int::Assign(), Create(), CSG_Array_Int::Create(), CSG_Array_Pointer::Create(), CSG_Array_sLong::Create(), CSG_MetaData::Del_Child(), CSG_MetaData::Destroy(), CSG_Matrix::Get_Determinant(), CSG_Simple_Statistics::Get_Gini(), CSG_Simple_Statistics::Get_Quantile(), CSG_Stack::Get_Record_Pop(), CSG_MetaData::Ins_Child(), CSG_Table::Ins_Record(), CSG_MetaData::Mov_Child(), CSG_Matrix::Set_Inverse(), CSG_Tool::Settings_Pop(), CSG_Tool::Settings_Push(), SG_Matrix_Solve(), CSG_MetaData::to_XML(), and CSG_Tool::~CSG_Tool().

◆ Get_Entry()

void* CSG_Array::Get_Entry ( sLong Index ) const
inline

Returns a pointer to the memory address of the requested variable. You have to type cast and dereference the pointer to get access to the variable itself.

Definition at line 331 of file api_core.h.

Referenced by CSG_Table::_Set_Selection(), CSG_Points::Add(), CSG_Points_3D::Add(), CSG_Points_Int::Add(), CSG_Stack::Get_Record(), CSG_Stack::Get_Record_Pop(), CSG_Stack::Get_Record_Push(), CSG_Table::Get_Selection_Index(), CSG_Table::Inv_Selection(), and CSG_Cluster_Analysis::Set_Feature().

◆ Get_Growth()

TSG_Array_Growth CSG_Array::Get_Growth ( void ) const
inline

Definition at line 324 of file api_core.h.

◆ Get_Size()

sLong CSG_Array::Get_Size ( void ) const
inline

Definition at line 327 of file api_core.h.

Referenced by CSG_Table::_Add_Selection(), CSG_Table::_Del_Selection(), CSG_Simple_Statistics::_Evaluate(), CSG_Table::_Set_Selection(), CSG_Simple_Statistics::Add(), CSG_Points::Add(), CSG_Points_3D::Add(), CSG_Points_Int::Add(), CSG_Points::Assign(), CSG_Points_3D::Assign(), CSG_Points_Int::Assign(), CSG_Simple_Statistics::Get_Gini(), CSG_Simple_Statistics::Get_IndexOfMaximum(), CSG_Simple_Statistics::Get_IndexOfMinimum(), CSG_PRQuadTree::Get_Nearest_Points(), CSG_Simple_Statistics::Get_nValues_Above(), CSG_Simple_Statistics::Get_nValues_Below(), CSG_Simple_Statistics::Get_Quantile(), CSG_Stack::Get_Record_Pop(), CSG_Stack::Get_Record_Push(), CSG_Table::Get_Selection(), CSG_Table::Get_Selection_Count(), CSG_Table::Get_Selection_Index(), CSG_Table::Ins_Record(), CSG_Table::Inv_Selection(), CSG_Tool::Settings_Pop(), CSG_Tool::Settings_Push(), CSG_MetaData::to_XML(), and CSG_Tool::~CSG_Tool().

◆ Get_uSize()

size_t CSG_Array::Get_uSize ( void ) const
inline

Definition at line 328 of file api_core.h.

Referenced by CSG_Stack::Get_Size(), and CSG_Tool::~CSG_Tool().

◆ Get_Value_Size()

size_t CSG_Array::Get_Value_Size ( void ) const
inline

Definition at line 326 of file api_core.h.

Referenced by CSG_Simple_Statistics::Add_Value(), CSG_Points::Assign(), CSG_Points_3D::Assign(), CSG_Points_Int::Assign(), CSG_Stack::Get_Record_Pop(), CSG_Stack::Get_RecordSize(), and CSG_Tool::Settings_Push().

◆ Inc_Array() [1/2]

bool CSG_Array::Inc_Array ( sLong nValues = 1 )

Definition at line 414 of file api_memory.cpp.

References Set_Array().

Referenced by CSG_Table::_Add_Selection(), CSG_Points::Add(), CSG_Points_3D::Add(), CSG_Points_Int::Add(), CSG_Cluster_Analysis::Add_Element(), CSG_Vector::Add_Row(), CSG_Simple_Statistics::Add_Value(), CSG_Stack::Get_Record_Push(), and CSG_MetaData::Ins_Child().

◆ Inc_Array() [2/2]

bool CSG_Array::Inc_Array ( void ** pArray )

Definition at line 419 of file api_memory.cpp.

References Set_Array().

◆ operator=()

CSG_Array& CSG_Array::operator= ( const CSG_Array & Array )
inline

Definition at line 321 of file api_core.h.

◆ operator[]()

void* CSG_Array::operator[] ( sLong Index ) const
inline

Definition at line 332 of file api_core.h.

◆ Set_Array() [1/2]

bool CSG_Array::Set_Array | ( | sLong | nValues,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 310 of file api_memory.cpp.

References Destroy(), SG_ARRAY_GROWTH_0, and SG_Realloc().

Referenced by CSG_Simple_Statistics::Add(), CSG_Vector::Add_Rows(), CSG_Points::Assign(), CSG_Points_3D::Assign(), CSG_Points_Int::Assign(), CSG_Stack::Clear(), CSG_Vector::Create(), Dec_Array(), Del_Entry(), CSG_PointCloud::Del_Points(), CSG_Vector::Del_Rows(), CSG_PointCloud::Del_Selection(), CSG_Table::Del_Selection(), CSG_Stack::Destroy(), CSG_Vector::Destroy(), Inc_Array(), CSG_PointCloud::Inv_Selection(), CSG_Table::Inv_Selection(), Set_Array(), and CSG_Tool::Settings_Pop().

◆ Set_Array() [2/2]

bool CSG_Array::Set_Array | ( | sLong | nValues,
 |  | void ** | pArray,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 399 of file api_memory.cpp.

References Set_Array().

◆ Set_Growth()

bool CSG_Array::Set_Growth ( TSG_Array_Growth Growth )

Definition at line 302 of file api_memory.cpp.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Array Member List

This is the complete list of members for CSG_Array, including all inherited members.

Create(const CSG_Array &Array) | CSG_Array |
Create(size_t Value_Size, sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array |
CSG_Array(void) | CSG_Array |
CSG_Array(const CSG_Array &Array) | CSG_Array |
CSG_Array(size_t Value_Size, sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array |
Dec_Array(bool bShrink=true) | CSG_Array |
Dec_Array(void **pArray, bool bShrink=true) | CSG_Array |
Del_Entry(sLong Index, bool bShrink=true) | CSG_Array |
Destroy(void) | CSG_Array |
Get_Array(void) const | CSG_Array | inline
Get_Array(sLong nValues) | CSG_Array | inline
Get_Entry(sLong Index) const | CSG_Array | inline
Get_Growth(void) const | CSG_Array | inline
Get_Size(void) const | CSG_Array | inline
Get_uSize(void) const | CSG_Array | inline
Get_Value_Size(void) const | CSG_Array | inline
Inc_Array(sLong nValues=1) | CSG_Array |
Inc_Array(void **pArray) | CSG_Array |
operator=(const CSG_Array &Array) | CSG_Array | inline
operator[](sLong Index) const | CSG_Array | inline
Set_Array(sLong nValues, bool bShrink=true) | CSG_Array |
Set_Array(sLong nValues, void **pArray, bool bShrink=true) | CSG_Array |
Set_Growth(TSG_Array_Growth Growth) | CSG_Array |
~CSG_Array(void) | CSG_Array |
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Array_Int Class Reference

Public Member Functions | List of all members
CSG_Array_Int Class Reference

#include <api_core.h>

Public Member Functions

CSG_Array_Int (const CSG_Array_Int &Array)
int * | Create (const CSG_Array_Int &Array)
CSG_Array_Int (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
int * | Create (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
void | Destroy (void)
bool | Set_Growth (TSG_Array_Growth Growth)
TSG_Array_Growth | Get_Growth (void) const
sLong | Get_Size (void) const
size_t | Get_uSize (void) const
int * | Get_Array (void) const
int * | Get_Array (sLong nValues)
bool | Set_Array (sLong nValues, bool bShrink=true)
bool | Inc_Array (sLong nValues=1)
bool | Dec_Array (bool bShrink=true)
bool | Add (int Value)
bool | Add (const CSG_Array_Int &Array)
bool | Set (sLong Index, int Value)
int & | Get (sLong Index)
int | Get (sLong Index) const
bool | Assign (int Value)
CSG_Array_Int & | operator= (const CSG_Array_Int &Array)
CSG_Array_Int & | operator= (int Value)
int & | operator[] (sLong Index)
int | operator[] (sLong Index) const
CSG_Array_Int & | operator+= (int Value)
CSG_Array_Int & | operator+= (const CSG_Array_Int &Array)

Detailed Description

Definition at line 420 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Array_Int() [1/2]

CSG_Array_Int::CSG_Array_Int ( const CSG_Array_Int & Array )
inline

Definition at line 423 of file api_core.h.

◆ CSG_Array_Int() [2/2]

CSG_Array_Int::CSG_Array_Int | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |
inline

Definition at line 426 of file api_core.h.

Member Function Documentation

◆ Add() [1/2]

bool CSG_Array_Int::Add ( const CSG_Array_Int & Array )

Definition at line 580 of file api_memory.cpp.

References Add(), and Get_Size().

◆ Add() [2/2]

bool CSG_Array_Int::Add ( int Value )

Definition at line 567 of file api_memory.cpp.

References Get_Array(), Get_Size(), and Inc_Array().

Referenced by Add(), CSG_Unique_String_Statistics::Add_Value(), and CSG_Unique_Number_Statistics::Add_Value().

◆ Assign()

bool CSG_Array_Int::Assign ( int Value )

Definition at line 594 of file api_memory.cpp.

References Get_Array(), and Get_Size().

◆ Create() [1/2]

int * CSG_Array_Int::Create ( const CSG_Array_Int & Array )

Definition at line 551 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

Referenced by CSG_Cluster_Analysis::Execute(), CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ Create() [2/2]

int * CSG_Array_Int::Create | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |

Definition at line 559 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

◆ Dec_Array()

bool CSG_Array_Int::Dec_Array ( bool bShrink = true )
inline

Definition at line 442 of file api_core.h.

Referenced by CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), and CSG_Parameter_Choices::Select().

◆ Destroy()

void CSG_Array_Int::Destroy ( void )
inline

Definition at line 429 of file api_core.h.

Referenced by CSG_Parameter_Choices::_Set_Value(), CSG_Parameter_Choices::Clr_Selection(), CSG_Unique_Number_Statistics::Create(), CSG_Unique_String_Statistics::Create(), CSG_Table::Del_Index(), CSG_Parameter_Choices::Del_Items(), CSG_Cluster_Analysis::Destroy(), CSG_KDTree::Destroy(), and CSG_Table::Set_Index().

◆ Get() [1/2]

int& CSG_Array_Int::Get ( sLong Index )
inline

Definition at line 447 of file api_core.h.

◆ Get() [2/2]

int CSG_Array_Int::Get ( sLong Index ) const
inline

Definition at line 448 of file api_core.h.

◆ Get_Array() [1/2]

int* CSG_Array_Int::Get_Array ( sLong nValues )
inline

Definition at line 438 of file api_core.h.

◆ Get_Array() [2/2]

int* CSG_Array_Int::Get_Array ( void ) const
inline

Definition at line 437 of file api_core.h.

Referenced by Add(), Assign(), and CSG_Table::Set_Index().

◆ Get_Growth()

TSG_Array_Growth CSG_Array_Int::Get_Growth ( void ) const
inline

Definition at line 432 of file api_core.h.

◆ Get_Size()

sLong CSG_Array_Int::Get_Size ( void ) const
inline

Definition at line 434 of file api_core.h.

Referenced by Add(), Assign(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), and CSG_Table::Set_Index().

◆ Get_uSize()

size_t CSG_Array_Int::Get_uSize ( void ) const
inline

Definition at line 435 of file api_core.h.

Referenced by CSG_Parameter_Choices::_Set_String(), CSG_Parameter_Choices::is_Selected(), and CSG_Parameter_Choices::Select().

◆ Inc_Array()

bool CSG_Array_Int::Inc_Array ( sLong nValues = 1 )
inline

Definition at line 441 of file api_core.h.

Referenced by Add().

◆ operator+=() [1/2]

CSG_Array_Int& CSG_Array_Int::operator+= ( const CSG_Array_Int & Array )
inline

Definition at line 459 of file api_core.h.

◆ operator+=() [2/2]

CSG_Array_Int& CSG_Array_Int::operator+= ( int Value )
inline

Definition at line 458 of file api_core.h.

◆ operator=() [1/2]

CSG_Array_Int& CSG_Array_Int::operator= ( const CSG_Array_Int & Array )
inline

Definition at line 452 of file api_core.h.

◆ operator=() [2/2]

CSG_Array_Int& CSG_Array_Int::operator= ( int Value )
inline

Definition at line 453 of file api_core.h.

◆ operator[]() [1/2]

int& CSG_Array_Int::operator[] ( sLong Index )
inline

Definition at line 455 of file api_core.h.

◆ operator[]() [2/2]

int CSG_Array_Int::operator[] ( sLong Index ) const
inline

Definition at line 456 of file api_core.h.

◆ Set()

bool CSG_Array_Int::Set | ( | sLong | Index,
 |  | int | Value
 | ) |  |
inline

Definition at line 446 of file api_core.h.

◆ Set_Array()

bool CSG_Array_Int::Set_Array | ( | sLong | nValues,
 |  | bool | bShrink = true
 | ) |  |
inline

Definition at line 440 of file api_core.h.

◆ Set_Growth()

bool CSG_Array_Int::Set_Growth ( TSG_Array_Growth Growth )
inline

Definition at line 431 of file api_core.h.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Array_Int Member List

This is the complete list of members for CSG_Array_Int, including all inherited members.

Add(int Value) | CSG_Array_Int |
Add(const CSG_Array_Int &Array) | CSG_Array_Int |
Assign(int Value) | CSG_Array_Int |
Create(const CSG_Array_Int &Array) | CSG_Array_Int |
Create(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_Int |
CSG_Array_Int(const CSG_Array_Int &Array) | CSG_Array_Int | inline
CSG_Array_Int(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_Int | inline
Dec_Array(bool bShrink=true) | CSG_Array_Int | inline
Destroy(void) | CSG_Array_Int | inline
Get(sLong Index) | CSG_Array_Int | inline
Get(sLong Index) const | CSG_Array_Int | inline
Get_Array(void) const | CSG_Array_Int | inline
Get_Array(sLong nValues) | CSG_Array_Int | inline
Get_Growth(void) const | CSG_Array_Int | inline
Get_Size(void) const | CSG_Array_Int | inline
Get_uSize(void) const | CSG_Array_Int | inline
Inc_Array(sLong nValues=1) | CSG_Array_Int | inline
operator+=(int Value) | CSG_Array_Int | inline
operator+=(const CSG_Array_Int &Array) | CSG_Array_Int | inline
operator=(const CSG_Array_Int &Array) | CSG_Array_Int | inline
operator=(int Value) | CSG_Array_Int | inline
operator[](sLong Index) | CSG_Array_Int | inline
operator[](sLong Index) const | CSG_Array_Int | inline
Set(sLong Index, int Value) | CSG_Array_Int | inline
Set_Array(sLong nValues, bool bShrink=true) | CSG_Array_Int | inline
Set_Growth(TSG_Array_Growth Growth) | CSG_Array_Int | inline
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Array_Pointer Class Reference

Public Member Functions | List of all members
CSG_Array_Pointer Class Reference

#include <api_core.h>

Public Member Functions

CSG_Array_Pointer (const CSG_Array_Pointer &Array)
void ** | Create (const CSG_Array_Pointer &Array)
CSG_Array_Pointer (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
void ** | Create (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
void | Destroy (void)
bool | Set_Growth (TSG_Array_Growth Growth)
TSG_Array_Growth | Get_Growth (void) const
sLong | Get_Size (void) const
size_t | Get_uSize (void) const
void ** | Get_Array (void) const
void ** | Get_Array (sLong nValues)
bool | Set_Array (sLong nValues, bool bShrink=true)
bool | Inc_Array (sLong nValues=1)
bool | Dec_Array (bool bShrink=true)
bool | Add (void *Value)
bool | Add (const CSG_Array_Pointer &Array)
bool | Set (sLong Index, void *Value)
void *& | Get (sLong Index)
void * | Get (sLong Index) const
bool | Del (sLong Index)
sLong | Del (void *Value)
CSG_Array_Pointer & | operator= (const CSG_Array_Pointer &Array)
void *& | operator[] (sLong Index)
void * | operator[] (sLong Index) const
CSG_Array_Pointer & | operator+= (void *Value)
CSG_Array_Pointer & | operator+= (const CSG_Array_Pointer &Array)

Detailed Description

Definition at line 367 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Array_Pointer() [1/2]

CSG_Array_Pointer::CSG_Array_Pointer ( const CSG_Array_Pointer & Array )
inline

Definition at line 370 of file api_core.h.

◆ CSG_Array_Pointer() [2/2]

CSG_Array_Pointer::CSG_Array_Pointer | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |
inline

Definition at line 373 of file api_core.h.

Member Function Documentation

◆ Add() [1/2]

bool CSG_Array_Pointer::Add ( const CSG_Array_Pointer & Array )

Definition at line 498 of file api_memory.cpp.

References Add(), and Get_Size().

◆ Add() [2/2]

bool CSG_Array_Pointer::Add ( void * Value )

Definition at line 485 of file api_memory.cpp.

References Get_Array(), Get_Size(), and Inc_Array().

Referenced by Add(), CSG_Parameter_List::Add_Item(), CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Interface::Create_Tool(), and CSG_Parameter_Grid_List::Update_Data().

◆ Create() [1/2]

void ** CSG_Array_Pointer::Create ( const CSG_Array_Pointer & Array )

Definition at line 469 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

Referenced by CSG_Lines::CSG_Lines(), and CSG_Grids::Update_Z_Order().

◆ Create() [2/2]

void ** CSG_Array_Pointer::Create | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |

Definition at line 477 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

◆ Dec_Array()

bool CSG_Array_Pointer::Dec_Array ( bool bShrink = true )
inline

Definition at line 389 of file api_core.h.

Referenced by CSG_Strings::Del(), and Del().

◆ Del() [1/2]

bool CSG_Array_Pointer::Del ( sLong Index )

Definition at line 512 of file api_memory.cpp.

References Dec_Array(), and Get_Size().

Referenced by CSG_Lines::Del(), Del(), CSG_Parameter_List::Del_Item(), and CSG_Tool_Library_Interface::Delete_Tool().

◆ Del() [2/2]

sLong CSG_Array_Pointer::Del ( void * Value )

Definition at line 528 of file api_memory.cpp.

References Del(), and Get_Size().

◆ Destroy()

void CSG_Array_Pointer::Destroy ( void )
inline

Definition at line 376 of file api_core.h.

Referenced by CSG_Tool_Library_Interface::Delete_Tools(), CSG_Strings::Destroy(), and CSG_Tool_Library_Interface::Destroy().

◆ Get() [1/2]

void*& CSG_Array_Pointer::Get ( sLong Index )
inline

Definition at line 394 of file api_core.h.

Referenced by CSG_Tool_Library_Interface::Delete_Tool().

◆ Get() [2/2]

void* CSG_Array_Pointer::Get ( sLong Index ) const
inline

Definition at line 395 of file api_core.h.

◆ Get_Array() [1/2]

void** CSG_Array_Pointer::Get_Array ( sLong nValues )
inline

Definition at line 385 of file api_core.h.

◆ Get_Array() [2/2]

void** CSG_Array_Pointer::Get_Array ( void ) const
inline

Definition at line 384 of file api_core.h.

Referenced by CSG_Parameter_List::_asPointer(), Add(), CSG_Grids::Add_Grid(), CSG_Grids::Del_Grid(), CSG_Grids::Del_Grids(), CSG_Data_Manager::Delete(), CSG_Data_Collection::Delete(), CSG_Grids::Destroy(), CSG_Grids::Set_Grid_Count(), and CSG_Strings::Sort().

◆ Get_Growth()

TSG_Array_Growth CSG_Array_Pointer::Get_Growth ( void ) const
inline

Definition at line 379 of file api_core.h.

◆ Get_Size()

sLong CSG_Array_Pointer::Get_Size ( void ) const
inline

Definition at line 381 of file api_core.h.

Referenced by CSG_Data_Manager::Add(), Add(), CSG_File_Zip::Close(), Del(), CSG_Lines::Del(), CSG_Tool_Library_Interface::Get_Count(), CSG_File_Zip::Get_File(), CSG_Lines::Set_Count(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_uSize()

size_t CSG_Array_Pointer::Get_uSize ( void ) const
inline

Definition at line 382 of file api_core.h.

Referenced by CSG_Grids::Del_Grids(), CSG_Data_Manager::Delete(), CSG_Data_Collection::Delete(), CSG_Tool_Library_Interface::Delete_Tool(), CSG_Tool_Library_Interface::Delete_Tools(), CSG_Grids::Destroy(), and CSG_Tool_Library_Interface::Destroy().

◆ Inc_Array()

bool CSG_Array_Pointer::Inc_Array ( sLong nValues = 1 )
inline

Definition at line 388 of file api_core.h.

Referenced by CSG_Strings::Add(), CSG_Data_Collection::Add(), CSG_Data_Manager::Add(), Add(), and CSG_Strings::Ins().

◆ operator+=() [1/2]

CSG_Array_Pointer& CSG_Array_Pointer::operator+= ( const CSG_Array_Pointer & Array )
inline

Definition at line 405 of file api_core.h.

◆ operator+=() [2/2]

CSG_Array_Pointer& CSG_Array_Pointer::operator+= ( void * Value )
inline

Definition at line 404 of file api_core.h.

◆ operator=()

CSG_Array_Pointer& CSG_Array_Pointer::operator= ( const CSG_Array_Pointer & Array )
inline

Definition at line 399 of file api_core.h.

◆ operator[]() [1/2]

void*& CSG_Array_Pointer::operator[] ( sLong Index )
inline

Definition at line 401 of file api_core.h.

◆ operator[]() [2/2]

void* CSG_Array_Pointer::operator[] ( sLong Index ) const
inline

Definition at line 402 of file api_core.h.

◆ Set()

bool CSG_Array_Pointer::Set | ( | sLong | Index,
 |  | void * | Value
 | ) |  |
inline

Definition at line 393 of file api_core.h.

◆ Set_Array()

bool CSG_Array_Pointer::Set_Array | ( | sLong | nValues,
 |  | bool | bShrink = true
 | ) |  |
inline

Definition at line 387 of file api_core.h.

Referenced by CSG_File_Zip::Close(), CSG_Parameter_List::Del_Items(), CSG_Data_Manager::Delete(), CSG_Data_Collection::Delete(), CSG_Lines::Set_Count(), and CSG_Parameter_Grid_List::Update_Data().

◆ Set_Growth()

bool CSG_Array_Pointer::Set_Growth ( TSG_Array_Growth Growth )
inline

Definition at line 378 of file api_core.h.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Array_Pointer Member List

This is the complete list of members for CSG_Array_Pointer, including all inherited members.

Add(void *Value) | CSG_Array_Pointer |
Add(const CSG_Array_Pointer &Array) | CSG_Array_Pointer |
Create(const CSG_Array_Pointer &Array) | CSG_Array_Pointer |
Create(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_Pointer |
CSG_Array_Pointer(const CSG_Array_Pointer &Array) | CSG_Array_Pointer | inline
CSG_Array_Pointer(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_Pointer | inline
Dec_Array(bool bShrink=true) | CSG_Array_Pointer | inline
Del(sLong Index) | CSG_Array_Pointer |
Del(void *Value) | CSG_Array_Pointer |
Destroy(void) | CSG_Array_Pointer | inline
Get(sLong Index) | CSG_Array_Pointer | inline
Get(sLong Index) const | CSG_Array_Pointer | inline
Get_Array(void) const | CSG_Array_Pointer | inline
Get_Array(sLong nValues) | CSG_Array_Pointer | inline
Get_Growth(void) const | CSG_Array_Pointer | inline
Get_Size(void) const | CSG_Array_Pointer | inline
Get_uSize(void) const | CSG_Array_Pointer | inline
Inc_Array(sLong nValues=1) | CSG_Array_Pointer | inline
operator+=(void *Value) | CSG_Array_Pointer | inline
operator+=(const CSG_Array_Pointer &Array) | CSG_Array_Pointer | inline
operator=(const CSG_Array_Pointer &Array) | CSG_Array_Pointer | inline
operator[](sLong Index) | CSG_Array_Pointer | inline
operator[](sLong Index) const | CSG_Array_Pointer | inline
Set(sLong Index, void *Value) | CSG_Array_Pointer | inline
Set_Array(sLong nValues, bool bShrink=true) | CSG_Array_Pointer | inline
Set_Growth(TSG_Array_Growth Growth) | CSG_Array_Pointer | inline
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Array_sLong Class Reference

Public Member Functions | List of all members
CSG_Array_sLong Class Reference

#include <api_core.h>

Public Member Functions

CSG_Array_sLong (const CSG_Array_sLong &Array)
sLong * | Create (const CSG_Array_sLong &Array)
CSG_Array_sLong (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
sLong * | Create (sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
void | Destroy (void)
bool | Set_Growth (TSG_Array_Growth Growth)
TSG_Array_Growth | Get_Growth (void) const
sLong | Get_Size (void) const
size_t | Get_uSize (void) const
sLong * | Get_Array (void) const
sLong * | Get_Array (sLong nValues)
bool | Set_Array (sLong nValues, bool bShrink=true)
bool | Inc_Array (sLong nValues=1)
bool | Dec_Array (bool bShrink=true)
bool | Add (sLong Value)
bool | Add (const CSG_Array_sLong &Array)
bool | Set (sLong Index, sLong Value)
sLong & | Get (sLong Index)
sLong | Get (sLong Index) const
bool | Assign (sLong Value)
CSG_Array_sLong & | operator= (const CSG_Array_sLong &Array)
CSG_Array_sLong & | operator= (sLong Value)
sLong & | operator[] (sLong Index)
sLong | operator[] (sLong Index) const
CSG_Array_sLong & | operator+= (sLong Value)
CSG_Array_sLong & | operator+= (const CSG_Array_sLong &Array)

Detailed Description

Definition at line 474 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Array_sLong() [1/2]

CSG_Array_sLong::CSG_Array_sLong ( const CSG_Array_sLong & Array )
inline

Definition at line 477 of file api_core.h.

◆ CSG_Array_sLong() [2/2]

CSG_Array_sLong::CSG_Array_sLong | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |
inline

Definition at line 480 of file api_core.h.

Member Function Documentation

◆ Add() [1/2]

bool CSG_Array_sLong::Add ( const CSG_Array_sLong & Array )

Definition at line 641 of file api_memory.cpp.

References Add(), and Get_Size().

◆ Add() [2/2]

bool CSG_Array_sLong::Add ( sLong Value )

Definition at line 628 of file api_memory.cpp.

References Get_Array(), Get_Size(), and Inc_Array().

Referenced by Add().

◆ Assign()

bool CSG_Array_sLong::Assign ( sLong Value )

Definition at line 655 of file api_memory.cpp.

References Get_Array(), and Get_Size().

◆ Create() [1/2]

sLong * CSG_Array_sLong::Create ( const CSG_Array_sLong & Array )

Definition at line 612 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

◆ Create() [2/2]

sLong * CSG_Array_sLong::Create | ( | sLong | nValues = 0,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0
 | ) |  |

Definition at line 620 of file api_memory.cpp.

References CSG_Array::Create(), and CSG_Array::Get_Array().

◆ Dec_Array()

bool CSG_Array_sLong::Dec_Array ( bool bShrink = true )
inline

Definition at line 496 of file api_core.h.

◆ Destroy()

void CSG_Array_sLong::Destroy ( void )
inline

Definition at line 483 of file api_core.h.

◆ Get() [1/2]

sLong& CSG_Array_sLong::Get ( sLong Index )
inline

Definition at line 501 of file api_core.h.

◆ Get() [2/2]

sLong CSG_Array_sLong::Get ( sLong Index ) const
inline

Definition at line 502 of file api_core.h.

◆ Get_Array() [1/2]

sLong* CSG_Array_sLong::Get_Array ( sLong nValues )
inline

Definition at line 492 of file api_core.h.

◆ Get_Array() [2/2]

sLong* CSG_Array_sLong::Get_Array ( void ) const
inline

Definition at line 491 of file api_core.h.

Referenced by Add(), and Assign().

◆ Get_Growth()

TSG_Array_Growth CSG_Array_sLong::Get_Growth ( void ) const
inline

Definition at line 486 of file api_core.h.

◆ Get_Size()

sLong CSG_Array_sLong::Get_Size ( void ) const
inline

Definition at line 488 of file api_core.h.

Referenced by Add(), and Assign().

◆ Get_uSize()

size_t CSG_Array_sLong::Get_uSize ( void ) const
inline

Definition at line 489 of file api_core.h.

◆ Inc_Array()

bool CSG_Array_sLong::Inc_Array ( sLong nValues = 1 )
inline

Definition at line 495 of file api_core.h.

Referenced by Add().

◆ operator+=() [1/2]

CSG_Array_sLong& CSG_Array_sLong::operator+= ( const CSG_Array_sLong & Array )
inline

Definition at line 513 of file api_core.h.

◆ operator+=() [2/2]

CSG_Array_sLong& CSG_Array_sLong::operator+= ( sLong Value )
inline

Definition at line 512 of file api_core.h.

◆ operator=() [1/2]

CSG_Array_sLong& CSG_Array_sLong::operator= ( const CSG_Array_sLong & Array )
inline

Definition at line 506 of file api_core.h.

◆ operator=() [2/2]

CSG_Array_sLong& CSG_Array_sLong::operator= ( sLong Value )
inline

Definition at line 507 of file api_core.h.

◆ operator[]() [1/2]

sLong& CSG_Array_sLong::operator[] ( sLong Index )
inline

Definition at line 509 of file api_core.h.

◆ operator[]() [2/2]

sLong CSG_Array_sLong::operator[] ( sLong Index ) const
inline

Definition at line 510 of file api_core.h.

◆ Set()

bool CSG_Array_sLong::Set | ( | sLong | Index,
 |  | sLong | Value
 | ) |  |
inline

Definition at line 500 of file api_core.h.

◆ Set_Array()

bool CSG_Array_sLong::Set_Array | ( | sLong | nValues,
 |  | bool | bShrink = true
 | ) |  |
inline

Definition at line 494 of file api_core.h.

◆ Set_Growth()

bool CSG_Array_sLong::Set_Growth ( TSG_Array_Growth Growth )
inline

Definition at line 485 of file api_core.h.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Array_sLong Member List

This is the complete list of members for CSG_Array_sLong, including all inherited members.

Add(sLong Value) | CSG_Array_sLong |
Add(const CSG_Array_sLong &Array) | CSG_Array_sLong |
Assign(sLong Value) | CSG_Array_sLong |
Create(const CSG_Array_sLong &Array) | CSG_Array_sLong |
Create(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_sLong |
CSG_Array_sLong(const CSG_Array_sLong &Array) | CSG_Array_sLong | inline
CSG_Array_sLong(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0) | CSG_Array_sLong | inline
Dec_Array(bool bShrink=true) | CSG_Array_sLong | inline
Destroy(void) | CSG_Array_sLong | inline
Get(sLong Index) | CSG_Array_sLong | inline
Get(sLong Index) const | CSG_Array_sLong | inline
Get_Array(void) const | CSG_Array_sLong | inline
Get_Array(sLong nValues) | CSG_Array_sLong | inline
Get_Growth(void) const | CSG_Array_sLong | inline
Get_Size(void) const | CSG_Array_sLong | inline
Get_uSize(void) const | CSG_Array_sLong | inline
Inc_Array(sLong nValues=1) | CSG_Array_sLong | inline
operator+=(sLong Value) | CSG_Array_sLong | inline
operator+=(const CSG_Array_sLong &Array) | CSG_Array_sLong | inline
operator=(const CSG_Array_sLong &Array) | CSG_Array_sLong | inline
operator=(sLong Value) | CSG_Array_sLong | inline
operator[](sLong Index) | CSG_Array_sLong | inline
operator[](sLong Index) const | CSG_Array_sLong | inline
Set(sLong Index, sLong Value) | CSG_Array_sLong | inline
Set_Array(sLong nValues, bool bShrink=true) | CSG_Array_sLong | inline
Set_Growth(TSG_Array_Growth Growth) | CSG_Array_sLong | inline
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Buffer Class Reference

Public Member Functions | List of all members
CSG_Buffer Class Reference

#include <api_core.h>

Public Member Functions

CSG_Buffer (void)
bool | Create (void)
CSG_Buffer (const CSG_Buffer &Buffer)
bool | Create (const CSG_Buffer &Buffer)
CSG_Buffer (size_t Size)
bool | Create (size_t Size)
virtual | ~CSG_Buffer (void)
void | Destroy (void)
bool | Set_Size (size_t Size, bool bShrink=true)
bool | Inc_Size (size_t Size)
size_t | Get_Size (void) const
bool | Set_Data (const char *Data, size_t Size, bool bShrink=true)
char * | Get_Data (int Offset=0) const
CSG_Buffer & | operator= (const CSG_Buffer &Buffer)
char & | operator[] (int Position)
char | operator[] (int Position) const
void | Add_Value (char Value, bool bBigEndian=false)
void | Add_Value (short Value, bool bBigEndian=false)
void | Add_Value (int Value, bool bBigEndian=false)
void | Add_Value (float Value, bool bBigEndian=false)
void | Add_Value (double Value, bool bBigEndian=false)
CSG_Buffer & | operator+= (char Value)
CSG_Buffer & | operator+= (short Value)
CSG_Buffer & | operator+= (int Value)
CSG_Buffer & | operator+= (float Value)
CSG_Buffer & | operator+= (double Value)
void | Set_Value (int Offset, char Value, bool bBigEndian=false)
void | Set_Value (int Offset, short Value, bool bBigEndian=false)
void | Set_Value (int Offset, int Value, bool bBigEndian=false)
void | Set_Value (int Offset, float Value, bool bBigEndian=false)
void | Set_Value (int Offset, double Value, bool bBigEndian=false)
short | asShort (int Offset, bool bBigEndian=false) const
int | asInt (int Offset, bool bBigEndian=false) const
float | asFloat (int Offset, bool bBigEndian=false) const
double | asDouble (int Offset, bool bBigEndian=false) const

Detailed Description

Definition at line 223 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Buffer() [1/3]

CSG_Buffer::CSG_Buffer ( void )

Definition at line 673 of file api_memory.cpp.

◆ CSG_Buffer() [2/3]

CSG_Buffer::CSG_Buffer ( const CSG_Buffer & Buffer )

Definition at line 687 of file api_memory.cpp.

References Create().

◆ CSG_Buffer() [3/3]

CSG_Buffer::CSG_Buffer ( size_t Size )

Definition at line 701 of file api_memory.cpp.

References Create().

◆ ~CSG_Buffer()

CSG_Buffer::~CSG_Buffer ( void )
virtual

Definition at line 715 of file api_memory.cpp.

References Destroy().

Member Function Documentation

◆ Add_Value() [1/5]

void CSG_Buffer::Add_Value | ( | char | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 250 of file api_core.h.

◆ Add_Value() [2/5]

void CSG_Buffer::Add_Value | ( | double | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 254 of file api_core.h.

◆ Add_Value() [3/5]

void CSG_Buffer::Add_Value | ( | float | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 253 of file api_core.h.

◆ Add_Value() [4/5]

void CSG_Buffer::Add_Value | ( | int | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 252 of file api_core.h.

◆ Add_Value() [5/5]

void CSG_Buffer::Add_Value | ( | short | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 251 of file api_core.h.

◆ asDouble()

double CSG_Buffer::asDouble | ( | int | Offset,
 |  | bool | bBigEndian = false
 | ) |  | const
 inline

Definition at line 271 of file api_core.h.

References SG_Swap_Bytes().

◆ asFloat()

float CSG_Buffer::asFloat | ( | int | Offset,
 |  | bool | bBigEndian = false
 | ) |  | const
 inline

Definition at line 270 of file api_core.h.

References SG_Swap_Bytes().

◆ asInt()

int CSG_Buffer::asInt | ( | int | Offset,
 |  | bool | bBigEndian = false
 | ) |  | const
 inline

Definition at line 269 of file api_core.h.

References SG_Swap_Bytes().

◆ asShort()

short CSG_Buffer::asShort | ( | int | Offset,
 |  | bool | bBigEndian = false
 | ) |  | const
 inline

Definition at line 268 of file api_core.h.

References SG_Swap_Bytes().

◆ Create() [1/3]

bool CSG_Buffer::Create ( const CSG_Buffer & Buffer )

Definition at line 695 of file api_memory.cpp.

References Set_Data().

◆ Create() [2/3]

bool CSG_Buffer::Create ( size_t Size )

Definition at line 709 of file api_memory.cpp.

References Set_Size().

◆ Create() [3/3]

bool CSG_Buffer::Create ( void )

Definition at line 679 of file api_memory.cpp.

References Destroy().

Referenced by CSG_Buffer().

◆ Destroy()

void CSG_Buffer::Destroy ( void )

Definition at line 720 of file api_memory.cpp.

References SG_Free().

Referenced by Create(), Set_Size(), and ~CSG_Buffer().

◆ Get_Data()

char* CSG_Buffer::Get_Data ( int Offset = 0 ) const
inline

Definition at line 244 of file api_core.h.

Referenced by CSG_File::Read(), CSG_Table_DBase::Set_Value(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), CSG_String::to_UTF8(), and CSG_File::Write().

◆ Get_Size()

size_t CSG_Buffer::Get_Size ( void ) const
inline

Definition at line 241 of file api_core.h.

Referenced by CSG_Table_DBase::Set_Value(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), CSG_String::to_UTF8(), and CSG_File::Write().

◆ Inc_Size()

bool CSG_Buffer::Inc_Size ( size_t Size )
inline

Definition at line 240 of file api_core.h.

◆ operator+=() [1/5]

CSG_Buffer& CSG_Buffer::operator+= ( char Value )
inline

Definition at line 256 of file api_core.h.

◆ operator+=() [2/5]

CSG_Buffer& CSG_Buffer::operator+= ( double Value )
inline

Definition at line 260 of file api_core.h.

◆ operator+=() [3/5]

CSG_Buffer& CSG_Buffer::operator+= ( float Value )
inline

Definition at line 259 of file api_core.h.

◆ operator+=() [4/5]

CSG_Buffer& CSG_Buffer::operator+= ( int Value )
inline

Definition at line 258 of file api_core.h.

◆ operator+=() [5/5]

CSG_Buffer& CSG_Buffer::operator+= ( short Value )
inline

Definition at line 257 of file api_core.h.

◆ operator=()

CSG_Buffer& CSG_Buffer::operator= ( const CSG_Buffer & Buffer )
inline

Definition at line 246 of file api_core.h.

◆ operator[]() [1/2]

char& CSG_Buffer::operator[] ( int Position )
inline

Definition at line 247 of file api_core.h.

◆ operator[]() [2/2]

char CSG_Buffer::operator[] ( int Position ) const
inline

Definition at line 248 of file api_core.h.

◆ Set_Data()

bool CSG_Buffer::Set_Data | ( | const char * | Data,
 |  | size_t | Size,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 755 of file api_memory.cpp.

References Set_Size().

Referenced by Create(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), and CSG_String::to_UTF8().

◆ Set_Size()

bool CSG_Buffer::Set_Size | ( | size_t | Size,
 |  | bool | bShrink = true
 | ) |  |

Definition at line 732 of file api_memory.cpp.

References Destroy(), and SG_Realloc().

Referenced by Create(), and Set_Data().

◆ Set_Value() [1/5]

void CSG_Buffer::Set_Value | ( | int | Offset,
 |  | char | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 262 of file api_core.h.

◆ Set_Value() [2/5]

void CSG_Buffer::Set_Value | ( | int | Offset,
 |  | double | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 266 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [3/5]

void CSG_Buffer::Set_Value | ( | int | Offset,
 |  | float | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 265 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [4/5]

void CSG_Buffer::Set_Value | ( | int | Offset,
 |  | int | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 264 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [5/5]

void CSG_Buffer::Set_Value | ( | int | Offset,
 |  | short | Value,
 |  | bool | bBigEndian = false
 | ) |  |
inline

Definition at line 263 of file api_core.h.

References SG_Swap_Bytes().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Buffer Member List

This is the complete list of members for CSG_Buffer, including all inherited members.

Add_Value(char Value, bool bBigEndian=false) | CSG_Buffer | inline
Add_Value(short Value, bool bBigEndian=false) | CSG_Buffer | inline
Add_Value(int Value, bool bBigEndian=false) | CSG_Buffer | inline
Add_Value(float Value, bool bBigEndian=false) | CSG_Buffer | inline
Add_Value(double Value, bool bBigEndian=false) | CSG_Buffer | inline
asDouble(int Offset, bool bBigEndian=false) const | CSG_Buffer | inline
asFloat(int Offset, bool bBigEndian=false) const | CSG_Buffer | inline
asInt(int Offset, bool bBigEndian=false) const | CSG_Buffer | inline
asShort(int Offset, bool bBigEndian=false) const | CSG_Buffer | inline
Create(void) | CSG_Buffer |
Create(const CSG_Buffer &Buffer) | CSG_Buffer |
Create(size_t Size) | CSG_Buffer |
CSG_Buffer(void) | CSG_Buffer |
CSG_Buffer(const CSG_Buffer &Buffer) | CSG_Buffer |
CSG_Buffer(size_t Size) | CSG_Buffer |
Destroy(void) | CSG_Buffer |
Get_Data(int Offset=0) const | CSG_Buffer | inline
Get_Size(void) const | CSG_Buffer | inline
Inc_Size(size_t Size) | CSG_Buffer | inline
operator+=(char Value) | CSG_Buffer | inline
operator+=(short Value) | CSG_Buffer | inline
operator+=(int Value) | CSG_Buffer | inline
operator+=(float Value) | CSG_Buffer | inline
operator+=(double Value) | CSG_Buffer | inline
operator=(const CSG_Buffer &Buffer) | CSG_Buffer | inline
operator[](int Position) | CSG_Buffer | inline
operator[](int Position) const | CSG_Buffer | inline
Set_Data(const char *Data, size_t Size, bool bShrink=true) | CSG_Buffer |
Set_Size(size_t Size, bool bShrink=true) | CSG_Buffer |
Set_Value(int Offset, char Value, bool bBigEndian=false) | CSG_Buffer | inline
Set_Value(int Offset, short Value, bool bBigEndian=false) | CSG_Buffer | inline
Set_Value(int Offset, int Value, bool bBigEndian=false) | CSG_Buffer | inline
Set_Value(int Offset, float Value, bool bBigEndian=false) | CSG_Buffer | inline
Set_Value(int Offset, double Value, bool bBigEndian=false) | CSG_Buffer | inline
~CSG_Buffer(void) | CSG_Buffer | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Bytes Class Reference

Public Member Functions | List of all members
CSG_Bytes Class Reference

#include <api_core.h>

Public Member Functions

CSG_Bytes (void)
bool | Create (void)
CSG_Bytes (const CSG_Bytes &Bytes)
bool | Create (const CSG_Bytes &Bytes)
CSG_Bytes (const BYTE *Bytes, int nBytes)
bool | Create (const BYTE *Bytes, int nBytes)
virtual | ~CSG_Bytes (void)
bool | Destroy (void)
bool | Clear (void)
void | Rewind (void)
bool | is_EOF (void)
int | Get_Count (void) const
BYTE * | Get_Bytes (void) const
CSG_Bytes | Get_Bytes (int i) const
CSG_Bytes | operator+ (int i) const
BYTE | Get_Byte (int i) const
BYTE | operator[] (int i) const
bool | Assign (const CSG_Bytes &Bytes)
CSG_Bytes & | operator= (const CSG_Bytes &Bytes)
bool | Add (const CSG_Bytes &Bytes)
CSG_Bytes & | operator+= (const CSG_Bytes &Bytes)
bool | Add (void *Bytes, int nBytes, bool bSwapBytes)
bool | Add (BYTE Value)
CSG_Bytes & | operator+= (BYTE Value)
bool | Add (char Value)
CSG_Bytes & | operator+= (char Value)
bool | Add (short Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (short Value)
bool | Add (WORD Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (WORD Value)
bool | Add (int Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (int Value)
bool | Add (DWORD Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (DWORD Value)
bool | Add (float Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (float Value)
bool | Add (double Value, bool bSwapBytes=false)
CSG_Bytes & | operator+= (double Value)
BYTE | asByte (int i) const
char | asChar (int i) const
short | asShort (int i, bool bSwapBytes=false) const
WORD | asWord (int i, bool bSwapBytes=false) const
int | asInt (int i, bool bSwapBytes=false) const
DWORD | asDWord (int i, bool bSwapBytes=false) const
float | asFloat (int i, bool bSwapBytes=false) const
double | asDouble (int i, bool bSwapBytes=false) const
BYTE | Read_Byte (void)
char | Read_Char (void)
short | Read_Short (bool bSwapBytes=false)
WORD | Read_Word (bool bSwapBytes=false)
int | Read_Int (bool bSwapBytes=false)
DWORD | Read_DWord (bool bSwapBytes=false)
float | Read_Float (bool bSwapBytes=false)
double | Read_Double (bool bSwapBytes=false)
CSG_String | toHexString (void) const
bool | fromHexString (const CSG_String &HexString)

Detailed Description

Definition at line 803 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Bytes() [1/3]

CSG_Bytes::CSG_Bytes ( void )

Definition at line 775 of file api_memory.cpp.

◆ CSG_Bytes() [2/3]

CSG_Bytes::CSG_Bytes ( const CSG_Bytes & Bytes )

Definition at line 790 of file api_memory.cpp.

References Create().

◆ CSG_Bytes() [3/3]

CSG_Bytes::CSG_Bytes | ( | const BYTE * | Bytes,
 |  | int | nBytes
 | ) |  |

Definition at line 806 of file api_memory.cpp.

References Create().

◆ ~CSG_Bytes()

CSG_Bytes::~CSG_Bytes ( void )
virtual

Definition at line 824 of file api_memory.cpp.

References Destroy().

Member Function Documentation

◆ Add() [1/10]

bool CSG_Bytes::Add ( BYTE Value )
inline

Definition at line 840 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [2/10]

bool CSG_Bytes::Add ( char Value )
inline

Definition at line 842 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [3/10]

bool CSG_Bytes::Add ( const CSG_Bytes & Bytes )

Definition at line 905 of file api_memory.cpp.

Referenced by Create(), and fromHexString().

◆ Add() [4/10]

bool CSG_Bytes::Add | ( | double | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 854 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [5/10]

bool CSG_Bytes::Add | ( | DWORD | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 850 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [6/10]

bool CSG_Bytes::Add | ( | float | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 852 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [7/10]

bool CSG_Bytes::Add | ( | int | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 848 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [8/10]

bool CSG_Bytes::Add | ( | short | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 844 of file api_core.h.

References Add().

Referenced by Add().

◆ Add() [9/10]

bool CSG_Bytes::Add | ( | void * | Bytes,
 |  | int | nBytes,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 911 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ Add() [10/10]

bool CSG_Bytes::Add | ( | WORD | Value,
 |  | bool | bSwapBytes = false
 | ) |  |
inline

Definition at line 846 of file api_core.h.

References Add().

Referenced by Add().

◆ asByte()

BYTE CSG_Bytes::asByte ( int i ) const
inline

Definition at line 857 of file api_core.h.

◆ asChar()

char CSG_Bytes::asChar ( int i ) const
inline

Definition at line 858 of file api_core.h.

◆ asDouble()

double CSG_Bytes::asDouble | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 864 of file api_core.h.

References SG_Swap_Bytes().

◆ asDWord()

DWORD CSG_Bytes::asDWord | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 862 of file api_core.h.

References SG_Swap_Bytes().

◆ asFloat()

float CSG_Bytes::asFloat | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 863 of file api_core.h.

References SG_Swap_Bytes().

◆ asInt()

int CSG_Bytes::asInt | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 861 of file api_core.h.

References SG_Swap_Bytes().

◆ asShort()

short CSG_Bytes::asShort | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 859 of file api_core.h.

References SG_Swap_Bytes().

◆ Assign()

bool CSG_Bytes::Assign ( const CSG_Bytes & Bytes )

Definition at line 885 of file api_memory.cpp.

References Destroy().

Referenced by Create().

◆ asWord()

WORD CSG_Bytes::asWord | ( | int | i,
 |  | bool | bSwapBytes = false
 | ) |  | const
 inline

Definition at line 860 of file api_core.h.

References SG_Swap_Bytes().

◆ Clear()

bool CSG_Bytes::Clear ( void )

Definition at line 844 of file api_memory.cpp.

Referenced by CSG_HTTP::Request(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Create() [1/3]

bool CSG_Bytes::Create | ( | const BYTE * | Bytes,
 |  | int | nBytes
 | ) |  |

Definition at line 816 of file api_memory.cpp.

References Add(), and Destroy().

◆ Create() [2/3]

bool CSG_Bytes::Create ( const CSG_Bytes & Bytes )

Definition at line 800 of file api_memory.cpp.

References Assign().

◆ Create() [3/3]

bool CSG_Bytes::Create ( void )

Definition at line 784 of file api_memory.cpp.

References Destroy().

Referenced by CSG_Bytes(), and CSG_Table_Value_Binary::Set_Value().

◆ Destroy()

bool CSG_Bytes::Destroy ( void )

Definition at line 829 of file api_memory.cpp.

References SG_Free().

Referenced by Assign(), Create(), fromHexString(), CSG_Table_Record::Set_NoData(), CSG_Table_Value_Binary::Set_NoData(), CSG_Shapes_OGIS_Converter::to_WKBinary(), and ~CSG_Bytes().

◆ fromHexString()

bool CSG_Bytes::fromHexString ( const CSG_String & HexString )

Definition at line 979 of file api_memory.cpp.

References Add(), CSG_String::c_str(), Destroy(), CSG_String::Length(), SG_Char, and SG_Hex_to_Byte().

◆ Get_Byte()

BYTE CSG_Bytes::Get_Byte ( int i ) const
inline

Definition at line 829 of file api_core.h.

◆ Get_Bytes() [1/2]

CSG_Bytes CSG_Bytes::Get_Bytes ( int i ) const
inline

Definition at line 826 of file api_core.h.

◆ Get_Bytes() [2/2]

BYTE* CSG_Bytes::Get_Bytes ( void ) const
inline

Definition at line 824 of file api_core.h.

Referenced by CSG_Table_Value_Binary::asString(), CSG_Table_Value_String::Set_Value(), CSG_Table_Value_Date::Set_Value(), CSG_Table_Value_Int::Set_Value(), CSG_Table_Value_Long::Set_Value(), and CSG_Table_Value_Double::Set_Value().

◆ Get_Count()

int CSG_Bytes::Get_Count ( void ) const
inline

Definition at line 823 of file api_core.h.

Referenced by CSG_Table_Value_Binary::asInt(), CSG_Table_Value_Binary::asLong(), CSG_Shapes_OGIS_Converter::from_WKBinary(), and CSG_Table_Value_Binary::is_NoData().

◆ is_EOF()

bool CSG_Bytes::is_EOF ( void )
inline

Definition at line 821 of file api_core.h.

◆ operator+()

CSG_Bytes CSG_Bytes::operator+ ( int i ) const
inline

Definition at line 827 of file api_core.h.

◆ operator+=() [1/9]

CSG_Bytes& CSG_Bytes::operator+= ( BYTE Value )
inline

Definition at line 841 of file api_core.h.

◆ operator+=() [2/9]

CSG_Bytes& CSG_Bytes::operator+= ( char Value )
inline

Definition at line 843 of file api_core.h.

◆ operator+=() [3/9]

CSG_Bytes& CSG_Bytes::operator+= ( const CSG_Bytes & Bytes )
inline

Definition at line 836 of file api_core.h.

◆ operator+=() [4/9]

CSG_Bytes& CSG_Bytes::operator+= ( double Value )
inline

Definition at line 855 of file api_core.h.

◆ operator+=() [5/9]

CSG_Bytes& CSG_Bytes::operator+= ( DWORD Value )
inline

Definition at line 851 of file api_core.h.

◆ operator+=() [6/9]

CSG_Bytes& CSG_Bytes::operator+= ( float Value )
inline

Definition at line 853 of file api_core.h.

◆ operator+=() [7/9]

CSG_Bytes& CSG_Bytes::operator+= ( int Value )
inline

Definition at line 849 of file api_core.h.

◆ operator+=() [8/9]

CSG_Bytes& CSG_Bytes::operator+= ( short Value )
inline

Definition at line 845 of file api_core.h.

◆ operator+=() [9/9]

CSG_Bytes& CSG_Bytes::operator+= ( WORD Value )
inline

Definition at line 847 of file api_core.h.

◆ operator=()

CSG_Bytes& CSG_Bytes::operator= ( const CSG_Bytes & Bytes )
inline

Definition at line 833 of file api_core.h.

◆ operator[]()

BYTE CSG_Bytes::operator[] ( int i ) const
inline

Definition at line 830 of file api_core.h.

◆ Read_Byte()

BYTE CSG_Bytes::Read_Byte ( void )
inline

Definition at line 866 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary(), and CSG_Shapes_OGIS_Converter::from_WKBinary().

◆ Read_Char()

char CSG_Bytes::Read_Char ( void )
inline

Definition at line 867 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Read_Double()

double CSG_Bytes::Read_Double ( bool bSwapBytes = false )
inline

Definition at line 873 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Read_DWord()

DWORD CSG_Bytes::Read_DWord ( bool bSwapBytes = false )
inline

Definition at line 871 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary(), and CSG_Shapes_OGIS_Converter::from_WKBinary().

◆ Read_Float()

float CSG_Bytes::Read_Float ( bool bSwapBytes = false )
inline

Definition at line 872 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Read_Int()

int CSG_Bytes::Read_Int ( bool bSwapBytes = false )
inline

Definition at line 870 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Read_Short()

short CSG_Bytes::Read_Short ( bool bSwapBytes = false )
inline

Definition at line 868 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Read_Word()

WORD CSG_Bytes::Read_Word ( bool bSwapBytes = false )
inline

Definition at line 869 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Rewind()

void CSG_Bytes::Rewind ( void )
inline

Definition at line 820 of file api_core.h.

Referenced by CSG_Grid_OGIS_Converter::from_WKBinary(), and CSG_Shapes_OGIS_Converter::from_WKBinary().

◆ toHexString()

CSG_String CSG_Bytes::toHexString ( void ) const

Definition at line 966 of file api_memory.cpp.

References CSG_String::Format(), and SG_T.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Bytes Member List

This is the complete list of members for CSG_Bytes, including all inherited members.

Add(const CSG_Bytes &Bytes) | CSG_Bytes |
Add(void *Bytes, int nBytes, bool bSwapBytes) | CSG_Bytes |
Add(BYTE Value) | CSG_Bytes | inline
Add(char Value) | CSG_Bytes | inline
Add(short Value, bool bSwapBytes=false) | CSG_Bytes | inline
Add(WORD Value, bool bSwapBytes=false) | CSG_Bytes | inline
Add(int Value, bool bSwapBytes=false) | CSG_Bytes | inline
Add(DWORD Value, bool bSwapBytes=false) | CSG_Bytes | inline
Add(float Value, bool bSwapBytes=false) | CSG_Bytes | inline
Add(double Value, bool bSwapBytes=false) | CSG_Bytes | inline
asByte(int i) const | CSG_Bytes | inline
asChar(int i) const | CSG_Bytes | inline
asDouble(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
asDWord(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
asFloat(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
asInt(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
asShort(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
Assign(const CSG_Bytes &Bytes) | CSG_Bytes |
asWord(int i, bool bSwapBytes=false) const | CSG_Bytes | inline
Clear(void) | CSG_Bytes |
Create(void) | CSG_Bytes |
Create(const CSG_Bytes &Bytes) | CSG_Bytes |
Create(const BYTE *Bytes, int nBytes) | CSG_Bytes |
CSG_Bytes(void) | CSG_Bytes |
CSG_Bytes(const CSG_Bytes &Bytes) | CSG_Bytes |
CSG_Bytes(const BYTE *Bytes, int nBytes) | CSG_Bytes |
Destroy(void) | CSG_Bytes |
fromHexString(const CSG_String &HexString) | CSG_Bytes |
Get_Byte(int i) const | CSG_Bytes | inline
Get_Bytes(void) const | CSG_Bytes | inline
Get_Bytes(int i) const | CSG_Bytes | inline
Get_Count(void) const | CSG_Bytes | inline
is_EOF(void) | CSG_Bytes | inline
operator+(int i) const | CSG_Bytes | inline
operator+=(const CSG_Bytes &Bytes) | CSG_Bytes | inline
operator+=(BYTE Value) | CSG_Bytes | inline
operator+=(char Value) | CSG_Bytes | inline
operator+=(short Value) | CSG_Bytes | inline
operator+=(WORD Value) | CSG_Bytes | inline
operator+=(int Value) | CSG_Bytes | inline
operator+=(DWORD Value) | CSG_Bytes | inline
operator+=(float Value) | CSG_Bytes | inline
operator+=(double Value) | CSG_Bytes | inline
operator=(const CSG_Bytes &Bytes) | CSG_Bytes | inline
operator[](int i) const | CSG_Bytes | inline
Read_Byte(void) | CSG_Bytes | inline
Read_Char(void) | CSG_Bytes | inline
Read_Double(bool bSwapBytes=false) | CSG_Bytes | inline
Read_DWord(bool bSwapBytes=false) | CSG_Bytes | inline
Read_Float(bool bSwapBytes=false) | CSG_Bytes | inline
Read_Int(bool bSwapBytes=false) | CSG_Bytes | inline
Read_Short(bool bSwapBytes=false) | CSG_Bytes | inline
Read_Word(bool bSwapBytes=false) | CSG_Bytes | inline
Rewind(void) | CSG_Bytes | inline
toHexString(void) const | CSG_Bytes |
~CSG_Bytes(void) | CSG_Bytes | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Bytes_Array Class Reference

Public Member Functions | List of all members
CSG_Bytes_Array Class Reference

#include <api_core.h>

Public Member Functions

CSG_Bytes_Array (void)
virtual | ~CSG_Bytes_Array (void)
bool | Destroy (void)
int | Get_Count (void) const
CSG_Bytes * | Get_Bytes (int i)
CSG_Bytes & | operator[] (int i)
CSG_Bytes * | Add (void)

Detailed Description

Definition at line 891 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Bytes_Array()

CSG_Bytes_Array::CSG_Bytes_Array ( void )

Definition at line 1001 of file api_memory.cpp.

◆ ~CSG_Bytes_Array()

CSG_Bytes_Array::~CSG_Bytes_Array ( void )
virtual

Definition at line 1009 of file api_memory.cpp.

References Destroy().

Member Function Documentation

◆ Add()

CSG_Bytes * CSG_Bytes_Array::Add ( void )

Definition at line 1035 of file api_memory.cpp.

References SG_Realloc().

◆ Destroy()

bool CSG_Bytes_Array::Destroy ( void )

Definition at line 1015 of file api_memory.cpp.

References SG_Free().

Referenced by ~CSG_Bytes_Array().

◆ Get_Bytes()

CSG_Bytes* CSG_Bytes_Array::Get_Bytes ( int i )
inline

Definition at line 900 of file api_core.h.

◆ Get_Count()

int CSG_Bytes_Array::Get_Count ( void ) const
inline

Definition at line 899 of file api_core.h.

◆ operator[]()

CSG_Bytes& CSG_Bytes_Array::operator[] ( int i )
inline

Definition at line 901 of file api_core.h.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_memory.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Bytes_Array Member List

This is the complete list of members for CSG_Bytes_Array, including all inherited members.

Add(void) | CSG_Bytes_Array |
CSG_Bytes_Array(void) | CSG_Bytes_Array |
Destroy(void) | CSG_Bytes_Array |
Get_Bytes(int i) | CSG_Bytes_Array | inline
Get_Count(void) const | CSG_Bytes_Array | inline
operator[](int i) | CSG_Bytes_Array | inline
~CSG_Bytes_Array(void) | CSG_Bytes_Array | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Category_Statistics Class Reference

Public Member Functions | List of all members
CSG_Category_Statistics Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Category_Statistics (TSG_Data_Type Type=SG_DATATYPE_String)
virtual | ~CSG_Category_Statistics (void)
void | Create (TSG_Data_Type Type=SG_DATATYPE_String)
void | Destroy (void)
TSG_Data_Type | Get_Category_Type (void) const
int | Add_Value (int Value)
int | Add_Value (double Value)
int | Add_Value (const CSG_String &Value)
void | operator+= (int Value)
void | operator+= (double Value)
void | operator+= (const CSG_String &Value)
bool | Sort (void)
int | Get_Count (void) const
int | Get_Count (int iCategory) const
int | asInt (int iCategory) const
double | asDouble (int iCategory) const
CSG_String | asString (int iCategory) const
int | Get_Category (int Value) const
int | Get_Category (double Value) const
int | Get_Category (const CSG_String &Value) const
bool | Get_Category (int iCategory, int &Value, int &Count) const
bool | Get_Category (int iCategory, double &Value, int &Count) const
bool | Get_Category (int iCategory, CSG_String &Value, int &Count) const
int | Get_Majority (void)
bool | Get_Majority (int &Value)
bool | Get_Majority (double &Value)
bool | Get_Majority (CSG_String &Value)
bool | Get_Majority (int &Value, int &Count)
bool | Get_Majority (double &Value, int &Count)
bool | Get_Majority (CSG_String &Value, int &Count)
int | Get_Minority (void)
bool | Get_Minority (int &Value)
bool | Get_Minority (double &Value)
bool | Get_Minority (CSG_String &Value)
bool | Get_Minority (int &Value, int &Count)
bool | Get_Minority (double &Value, int &Count)
bool | Get_Minority (CSG_String &Value, int &Count)

Detailed Description

Definition at line 898 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Category_Statistics()

CSG_Category_Statistics::CSG_Category_Statistics ( TSG_Data_Type Type = SG_DATATYPE_String )

Definition at line 978 of file mat_tools.cpp.

References Create().

◆ ~CSG_Category_Statistics()

CSG_Category_Statistics::~CSG_Category_Statistics ( void )
virtual

Definition at line 986 of file mat_tools.cpp.

Member Function Documentation

◆ Add_Value() [1/3]

int CSG_Category_Statistics::Add_Value ( const CSG_String & Value )

Definition at line 1085 of file mat_tools.cpp.

References CSG_Table::Add_Record(), CSG_Table_Record::Add_Value(), Get_Category(), CSG_Table::Get_Count(), and CSG_Table::Get_Record_byIndex().

◆ Add_Value() [2/3]

int CSG_Category_Statistics::Add_Value ( double Value )

Definition at line 1066 of file mat_tools.cpp.

References CSG_Table::Add_Record(), CSG_Table_Record::Add_Value(), Get_Category(), CSG_Table::Get_Count(), and CSG_Table::Get_Record_byIndex().

◆ Add_Value() [3/3]

int CSG_Category_Statistics::Add_Value ( int Value )

Definition at line 1047 of file mat_tools.cpp.

References CSG_Table::Add_Record(), CSG_Table_Record::Add_Value(), Get_Category(), CSG_Table::Get_Count(), and CSG_Table::Get_Record_byIndex().

◆ asDouble()

double CSG_Category_Statistics::asDouble ( int iCategory ) const

Definition at line 1140 of file mat_tools.cpp.

References CSG_Table_Record::asDouble(), and CSG_Table::Get_Record_byIndex().

◆ asInt()

int CSG_Category_Statistics::asInt ( int iCategory ) const

Definition at line 1132 of file mat_tools.cpp.

References CSG_Table_Record::asInt(), and CSG_Table::Get_Record_byIndex().

Referenced by Get_Majority().

◆ asString()

CSG_String CSG_Category_Statistics::asString ( int iCategory ) const

Definition at line 1148 of file mat_tools.cpp.

References CSG_Table_Record::asString(), CSG_Table::Get_Record_byIndex(), and SG_T.

◆ Create()

void CSG_Category_Statistics::Create ( TSG_Data_Type Type = SG_DATATYPE_String )

Definition at line 992 of file mat_tools.cpp.

References CSG_Table::Add_Field(), CSG_Table::Destroy(), and SG_DATATYPE_ULong.

Referenced by CSG_Category_Statistics().

◆ Destroy()

void CSG_Category_Statistics::Destroy ( void )

Definition at line 1001 of file mat_tools.cpp.

References CSG_Table::Del_Records().

◆ Get_Category() [1/6]

int CSG_Category_Statistics::Get_Category ( const CSG_String & Value ) const

Definition at line 1034 of file mat_tools.cpp.

References CSG_Table::Find_Record(), CSG_Table::Get_Count(), and CSG_Table_Record::Get_Index().

◆ Get_Category() [2/6]

int CSG_Category_Statistics::Get_Category ( double Value ) const

Definition at line 1026 of file mat_tools.cpp.

References CSG_Table::Find_Record(), CSG_Table::Get_Count(), and CSG_Table_Record::Get_Index().

◆ Get_Category() [3/6]

bool CSG_Category_Statistics::Get_Category | ( | int | iCategory,
 |  | CSG_String & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 946 of file mat_tools.h.

◆ Get_Category() [4/6]

bool CSG_Category_Statistics::Get_Category | ( | int | iCategory,
 |  | double & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 938 of file mat_tools.h.

◆ Get_Category() [5/6]

bool CSG_Category_Statistics::Get_Category | ( | int | iCategory,
 |  | int & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 930 of file mat_tools.h.

◆ Get_Category() [6/6]

int CSG_Category_Statistics::Get_Category ( int Value ) const

Definition at line 1018 of file mat_tools.cpp.

References CSG_Table::Find_Record(), CSG_Table::Get_Count(), and CSG_Table_Record::Get_Index().

Referenced by Add_Value().

◆ Get_Category_Type()

TSG_Data_Type CSG_Category_Statistics::Get_Category_Type ( void ) const

Definition at line 1007 of file mat_tools.cpp.

References CSG_Table::Get_Field_Type().

◆ Get_Count() [1/2]

int CSG_Category_Statistics::Get_Count ( int iCategory ) const

Definition at line 1124 of file mat_tools.cpp.

References CSG_Table_Record::asInt(), and CSG_Table::Get_Record_byIndex().

◆ Get_Count() [2/2]

int CSG_Category_Statistics::Get_Count ( void ) const

Definition at line 1117 of file mat_tools.cpp.

References CSG_Table::Get_Count().

◆ Get_Majority() [1/7]

bool CSG_Category_Statistics::Get_Majority ( CSG_String & Value )
inline

Definition at line 957 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [2/7]

bool CSG_Category_Statistics::Get_Majority | ( | CSG_String & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 960 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [3/7]

bool CSG_Category_Statistics::Get_Majority ( double & Value )
inline

Definition at line 956 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [4/7]

bool CSG_Category_Statistics::Get_Majority | ( | double & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 959 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [5/7]

bool CSG_Category_Statistics::Get_Majority ( int & Value )
inline

Definition at line 955 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [6/7]

bool CSG_Category_Statistics::Get_Majority | ( | int & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 958 of file mat_tools.h.

References Get_Majority().

Referenced by Get_Majority().

◆ Get_Majority() [7/7]

int CSG_Category_Statistics::Get_Majority ( void )

Definition at line 1161 of file mat_tools.cpp.

References CSG_Table_Record::asInt(), asInt(), CSG_Table::Get_Count(), and CSG_Table::Get_Record_byIndex().

◆ Get_Minority() [1/7]

bool CSG_Category_Statistics::Get_Minority ( CSG_String & Value )
inline

Definition at line 965 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [2/7]

bool CSG_Category_Statistics::Get_Minority | ( | CSG_String & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 968 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [3/7]

bool CSG_Category_Statistics::Get_Minority ( double & Value )
inline

Definition at line 964 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [4/7]

bool CSG_Category_Statistics::Get_Minority | ( | double & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 967 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [5/7]

bool CSG_Category_Statistics::Get_Minority ( int & Value )
inline

Definition at line 963 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [6/7]

bool CSG_Category_Statistics::Get_Minority | ( | int & | Value,
 |  | int & | Count
 | ) |  |
inline

Definition at line 966 of file mat_tools.h.

References Get_Minority().

Referenced by Get_Minority().

◆ Get_Minority() [7/7]

int CSG_Category_Statistics::Get_Minority ( void )

Definition at line 1183 of file mat_tools.cpp.

References CSG_Table_Record::asInt(), CSG_Table::Get_Count(), and CSG_Table::Get_Record_byIndex().

◆ operator+=() [1/3]

void CSG_Category_Statistics::operator+= ( const CSG_String & Value )
inline

Definition at line 915 of file mat_tools.h.

◆ operator+=() [2/3]

void CSG_Category_Statistics::operator+= ( double Value )
inline

Definition at line 914 of file mat_tools.h.

◆ operator+=() [3/3]

void CSG_Category_Statistics::operator+= ( int Value )
inline

Definition at line 913 of file mat_tools.h.

◆ Sort()

bool CSG_Category_Statistics::Sort ( void )

Definition at line 1105 of file mat_tools.cpp.

References CSG_Table::Set_Index(), and TABLE_INDEX_Ascending.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Category_Statistics Member List

This is the complete list of members for CSG_Category_Statistics, including all inherited members.

Add_Value(int Value) | CSG_Category_Statistics |
Add_Value(double Value) | CSG_Category_Statistics |
Add_Value(const CSG_String &Value) | CSG_Category_Statistics |
asDouble(int iCategory) const | CSG_Category_Statistics |
asInt(int iCategory) const | CSG_Category_Statistics |
asString(int iCategory) const | CSG_Category_Statistics |
Create(TSG_Data_Type Type=SG_DATATYPE_String) | CSG_Category_Statistics |
CSG_Category_Statistics(TSG_Data_Type Type=SG_DATATYPE_String) | CSG_Category_Statistics |
Destroy(void) | CSG_Category_Statistics |
Get_Category(int Value) const | CSG_Category_Statistics |
Get_Category(double Value) const | CSG_Category_Statistics |
Get_Category(const CSG_String &Value) const | CSG_Category_Statistics |
Get_Category(int iCategory, int &Value, int &Count) const | CSG_Category_Statistics | inline
Get_Category(int iCategory, double &Value, int &Count) const | CSG_Category_Statistics | inline
Get_Category(int iCategory, CSG_String &Value, int &Count) const | CSG_Category_Statistics | inline
Get_Category_Type(void) const | CSG_Category_Statistics |
Get_Count(void) const | CSG_Category_Statistics |
Get_Count(int iCategory) const | CSG_Category_Statistics |
Get_Majority(void) | CSG_Category_Statistics |
Get_Majority(int &Value) | CSG_Category_Statistics | inline
Get_Majority(double &Value) | CSG_Category_Statistics | inline
Get_Majority(CSG_String &Value) | CSG_Category_Statistics | inline
Get_Majority(int &Value, int &Count) | CSG_Category_Statistics | inline
Get_Majority(double &Value, int &Count) | CSG_Category_Statistics | inline
Get_Majority(CSG_String &Value, int &Count) | CSG_Category_Statistics | inline
Get_Minority(void) | CSG_Category_Statistics |
Get_Minority(int &Value) | CSG_Category_Statistics | inline
Get_Minority(double &Value) | CSG_Category_Statistics | inline
Get_Minority(CSG_String &Value) | CSG_Category_Statistics | inline
Get_Minority(int &Value, int &Count) | CSG_Category_Statistics | inline
Get_Minority(double &Value, int &Count) | CSG_Category_Statistics | inline
Get_Minority(CSG_String &Value, int &Count) | CSG_Category_Statistics | inline
operator+=(int Value) | CSG_Category_Statistics | inline
operator+=(double Value) | CSG_Category_Statistics | inline
operator+=(const CSG_String &Value) | CSG_Category_Statistics | inline
Sort(void) | CSG_Category_Statistics |
~CSG_Category_Statistics(void) | CSG_Category_Statistics | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Classifier_Supervised Class Reference

Classes | Public Member Functions | Static Public Member Functions | List of all members
CSG_Classifier_Supervised Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Classifier_Supervised (void)
virtual | ~CSG_Classifier_Supervised (void)
void | Create (int nFeatures)
void | Destroy (void)
bool | Load (const CSG_String &File)
bool | Save (const CSG_String &File, const SG_Char *Feature_Info=NULL)
bool | Train_Clr_Samples (void)
bool | Train_Add_Sample (const CSG_String &Class_ID, const CSG_Vector &Features)
bool | Train (bool bClr_Samples=false)
bool | Add_Class (const CSG_String &Class_ID, const CSG_Vector &Mean, const CSG_Vector &Min, const CSG_Vector &Max, const CSG_Matrix &Cov)
CSG_String | Print (void)
int | Get_Feature_Count (void)
int | Get_Class_Count (void)
const CSG_String & | Get_Class_ID (int iClass)
double | Get_Class_Mean (int iClass, int iFeature)
double | Get_Class_Minimum (int iClass, int iFeature)
double | Get_Class_Maximum (int iClass, int iFeature)
int | Get_Class (const CSG_String &Class_ID)
bool | Get_Class (const CSG_Vector &Features, int &Class, double &Quality, int Method)
void | Set_Threshold_Distance (double Value)
double | Get_Threshold_Distance (void)
void | Set_Threshold_Angle (double Value)
double | Get_Threshold_Angle (void)
void | Set_Threshold_Probability (double Value)
double | Get_Threshold_Probability (void)
void | Set_Probability_Relative (bool Value)
bool | Get_Probability_Relative (void)
void | Set_WTA (int Method, bool bOn)
bool | Get_WTA (int Method)

Static Public Member Functions

static CSG_String | Get_Name_of_Method (int Method)
static CSG_String | Get_Name_of_Quality (int Method)

Detailed Description

Definition at line 1206 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Classifier_Supervised()

CSG_Classifier_Supervised::CSG_Classifier_Supervised ( void )

Definition at line 2359 of file mat_tools.cpp.

References SG_CLASSIFY_SUPERVISED_MaximumLikelihood, SG_CLASSIFY_SUPERVISED_MinimumDistance, SG_CLASSIFY_SUPERVISED_SAM, and SG_CLASSIFY_SUPERVISED_WTA.

◆ ~CSG_Classifier_Supervised()

CSG_Classifier_Supervised::~CSG_Classifier_Supervised ( void )
virtual

Definition at line 2381 of file mat_tools.cpp.

References Destroy().

Member Function Documentation

◆ Add_Class()

bool CSG_Classifier_Supervised::Add_Class | ( | const CSG_String & | Class_ID,
 |  | const CSG_Vector & | Mean,
 |  | const CSG_Vector & | Min,
 |  | const CSG_Vector & | Max,
 |  | const CSG_Matrix & | Cov
 | ) |  |

Definition at line 2602 of file mat_tools.cpp.

References CSG_Matrix::Get_Determinant(), CSG_Matrix::Get_Inverse(), CSG_Simple_Statistics::Get_Mean(), CSG_Vector::Get_N(), CSG_Matrix::Get_NCols(), CSG_Matrix::Get_NRows(), and SG_Realloc().

◆ Create()

void CSG_Classifier_Supervised::Create ( int nFeatures )

Definition at line 2387 of file mat_tools.cpp.

References Destroy().

◆ Destroy()

void CSG_Classifier_Supervised::Destroy ( void )

Definition at line 2398 of file mat_tools.cpp.

References CSG_String::Clear(), and SG_FREE_SAFE.

Referenced by Create(), Load(), and ~CSG_Classifier_Supervised().

◆ Get_Class() [1/2]

int CSG_Classifier_Supervised::Get_Class ( const CSG_String & Class_ID )

Definition at line 2775 of file mat_tools.cpp.

References CSG_String::Cmp(), Get_Class_Count(), and Get_Class_ID().

Referenced by Train_Add_Sample().

◆ Get_Class() [2/2]

bool CSG_Classifier_Supervised::Get_Class | ( | const CSG_Vector & | Features,
 |  | int & | Class,
 |  | double & | Quality,
 |  | int | Method
 | ) |  |

Definition at line 2792 of file mat_tools.cpp.

References Get_Feature_Count(), CSG_Vector::Get_N(), SG_CLASSIFY_SUPERVISED_BinaryEncoding, SG_CLASSIFY_SUPERVISED_Mahalonobis, SG_CLASSIFY_SUPERVISED_MaximumLikelihood, SG_CLASSIFY_SUPERVISED_MinimumDistance, SG_CLASSIFY_SUPERVISED_ParallelEpiped, SG_CLASSIFY_SUPERVISED_SAM, SG_CLASSIFY_SUPERVISED_SID, and SG_CLASSIFY_SUPERVISED_WTA.

◆ Get_Class_Count()

int CSG_Classifier_Supervised::Get_Class_Count ( void )
inline

Definition at line 1229 of file mat_tools.h.

Referenced by Get_Class().

◆ Get_Class_ID()

const CSG_String& CSG_Classifier_Supervised::Get_Class_ID ( int iClass )
inline

Definition at line 1231 of file mat_tools.h.

Referenced by Get_Class().

◆ Get_Class_Maximum()

double CSG_Classifier_Supervised::Get_Class_Maximum | ( | int | iClass,
 |  | int | iFeature
 | ) |  |
inline

Definition at line 1234 of file mat_tools.h.

◆ Get_Class_Mean()

double CSG_Classifier_Supervised::Get_Class_Mean | ( | int | iClass,
 |  | int | iFeature
 | ) |  |
inline

Definition at line 1232 of file mat_tools.h.

◆ Get_Class_Minimum()

double CSG_Classifier_Supervised::Get_Class_Minimum | ( | int | iClass,
 |  | int | iFeature
 | ) |  |
inline

Definition at line 1233 of file mat_tools.h.

◆ Get_Feature_Count()

int CSG_Classifier_Supervised::Get_Feature_Count ( void )
inline

Definition at line 1227 of file mat_tools.h.

Referenced by Get_Class().

◆ Get_Name_of_Method()

CSG_String CSG_Classifier_Supervised::Get_Name_of_Method ( int Method )
static

Definition at line 2823 of file mat_tools.cpp.

References _TL, SG_CLASSIFY_SUPERVISED_BinaryEncoding, SG_CLASSIFY_SUPERVISED_Mahalonobis, SG_CLASSIFY_SUPERVISED_MaximumLikelihood, SG_CLASSIFY_SUPERVISED_MinimumDistance, SG_CLASSIFY_SUPERVISED_ParallelEpiped, SG_CLASSIFY_SUPERVISED_SAM, SG_CLASSIFY_SUPERVISED_SID, SG_CLASSIFY_SUPERVISED_SVM, SG_CLASSIFY_SUPERVISED_WTA, and SG_T.

◆ Get_Name_of_Quality()

CSG_String CSG_Classifier_Supervised::Get_Name_of_Quality ( int Method )
static

Definition at line 2842 of file mat_tools.cpp.

References _TL, SG_CLASSIFY_SUPERVISED_BinaryEncoding, SG_CLASSIFY_SUPERVISED_Mahalonobis, SG_CLASSIFY_SUPERVISED_MaximumLikelihood, SG_CLASSIFY_SUPERVISED_MinimumDistance, SG_CLASSIFY_SUPERVISED_ParallelEpiped, SG_CLASSIFY_SUPERVISED_SAM, SG_CLASSIFY_SUPERVISED_SID, SG_CLASSIFY_SUPERVISED_SVM, SG_CLASSIFY_SUPERVISED_WTA, and SG_T.

◆ Get_Probability_Relative()

bool CSG_Classifier_Supervised::Get_Probability_Relative ( void )

Definition at line 2434 of file mat_tools.cpp.

◆ Get_Threshold_Angle()

double CSG_Classifier_Supervised::Get_Threshold_Angle ( void )

Definition at line 2426 of file mat_tools.cpp.

◆ Get_Threshold_Distance()

double CSG_Classifier_Supervised::Get_Threshold_Distance ( void )

Definition at line 2422 of file mat_tools.cpp.

◆ Get_Threshold_Probability()

double CSG_Classifier_Supervised::Get_Threshold_Probability ( void )

Definition at line 2430 of file mat_tools.cpp.

◆ Get_WTA()

bool CSG_Classifier_Supervised::Get_WTA ( int Method )

Definition at line 2445 of file mat_tools.cpp.

References SG_CLASSIFY_SUPERVISED_WTA.

◆ Load()

bool CSG_Classifier_Supervised::Load ( const CSG_String & File )

Definition at line 2459 of file mat_tools.cpp.

References CSG_MetaData::Cmp_Name(), Destroy(), CSG_MetaData::Get_Child(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), CSG_Simple_Statistics::Get_Mean(), CSG_MetaData::Get_Property(), CSG_MetaData::Load(), SG_Compare_Version(), and SG_Realloc().

◆ Print()

CSG_String CSG_Classifier_Supervised::Print ( void )

Definition at line 2566 of file mat_tools.cpp.

References CSG_String::Format(), and SG_Get_String().

◆ Save()

bool CSG_Classifier_Supervised::Save | ( | const CSG_String & | File,
 |  | const SG_Char * | Feature_Info = NULL
 | ) |  |

Definition at line 2519 of file mat_tools.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Add_Property(), CSG_String::is_Empty(), SAGA_VERSION, CSG_MetaData::Save(), and CSG_MetaData::Set_Name().

◆ Set_Probability_Relative()

void CSG_Classifier_Supervised::Set_Probability_Relative ( bool Value )

Definition at line 2433 of file mat_tools.cpp.

◆ Set_Threshold_Angle()

void CSG_Classifier_Supervised::Set_Threshold_Angle ( double Value )

Definition at line 2425 of file mat_tools.cpp.

◆ Set_Threshold_Distance()

void CSG_Classifier_Supervised::Set_Threshold_Distance ( double Value )

Definition at line 2421 of file mat_tools.cpp.

◆ Set_Threshold_Probability()

void CSG_Classifier_Supervised::Set_Threshold_Probability ( double Value )

Definition at line 2429 of file mat_tools.cpp.

◆ Set_WTA()

void CSG_Classifier_Supervised::Set_WTA | ( | int | Method,
 |  | bool | bOn
 | ) |  |

Definition at line 2437 of file mat_tools.cpp.

References SG_CLASSIFY_SUPERVISED_WTA.

◆ Train()

bool CSG_Classifier_Supervised::Train ( bool bClr_Samples = false )

Definition at line 2680 of file mat_tools.cpp.

References Train_Clr_Samples().

◆ Train_Add_Sample()

bool CSG_Classifier_Supervised::Train_Add_Sample | ( | const CSG_String & | Class_ID,
 |  | const CSG_Vector & | Features
 | ) |  |

Definition at line 2652 of file mat_tools.cpp.

References Get_Class(), CSG_Vector::Get_N(), and SG_Realloc().

◆ Train_Clr_Samples()

bool CSG_Classifier_Supervised::Train_Clr_Samples ( void )

Definition at line 2641 of file mat_tools.cpp.

Referenced by Train().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Classifier_Supervised Member List

This is the complete list of members for CSG_Classifier_Supervised, including all inherited members.

Add_Class(const CSG_String &Class_ID, const CSG_Vector &Mean, const CSG_Vector &Min, const CSG_Vector &Max, const CSG_Matrix &Cov) | CSG_Classifier_Supervised |
Create(int nFeatures) | CSG_Classifier_Supervised |
CSG_Classifier_Supervised(void) | CSG_Classifier_Supervised |
Destroy(void) | CSG_Classifier_Supervised |
Get_Class(const CSG_String &Class_ID) | CSG_Classifier_Supervised |
Get_Class(const CSG_Vector &Features, int &Class, double &Quality, int Method) | CSG_Classifier_Supervised |
Get_Class_Count(void) | CSG_Classifier_Supervised | inline
Get_Class_ID(int iClass) | CSG_Classifier_Supervised | inline
Get_Class_Maximum(int iClass, int iFeature) | CSG_Classifier_Supervised | inline
Get_Class_Mean(int iClass, int iFeature) | CSG_Classifier_Supervised | inline
Get_Class_Minimum(int iClass, int iFeature) | CSG_Classifier_Supervised | inline
Get_Feature_Count(void) | CSG_Classifier_Supervised | inline
Get_Name_of_Method(int Method) | CSG_Classifier_Supervised | static
Get_Name_of_Quality(int Method) | CSG_Classifier_Supervised | static
Get_Probability_Relative(void) | CSG_Classifier_Supervised |
Get_Threshold_Angle(void) | CSG_Classifier_Supervised |
Get_Threshold_Distance(void) | CSG_Classifier_Supervised |
Get_Threshold_Probability(void) | CSG_Classifier_Supervised |
Get_WTA(int Method) | CSG_Classifier_Supervised |
Load(const CSG_String &File) | CSG_Classifier_Supervised |
Print(void) | CSG_Classifier_Supervised |
Save(const CSG_String &File, const SG_Char *Feature_Info=NULL) | CSG_Classifier_Supervised |
Set_Probability_Relative(bool Value) | CSG_Classifier_Supervised |
Set_Threshold_Angle(double Value) | CSG_Classifier_Supervised |
Set_Threshold_Distance(double Value) | CSG_Classifier_Supervised |
Set_Threshold_Probability(double Value) | CSG_Classifier_Supervised |
Set_WTA(int Method, bool bOn) | CSG_Classifier_Supervised |
Train(bool bClr_Samples=false) | CSG_Classifier_Supervised |
Train_Add_Sample(const CSG_String &Class_ID, const CSG_Vector &Features) | CSG_Classifier_Supervised |
Train_Clr_Samples(void) | CSG_Classifier_Supervised |
~CSG_Classifier_Supervised(void) | CSG_Classifier_Supervised | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Cluster_Analysis Class Reference

Public Member Functions | List of all members
CSG_Cluster_Analysis Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Cluster_Analysis (void)
virtual | ~CSG_Cluster_Analysis (void)
bool | Create (int nFeatures)
bool | Destroy (void)
bool | Add_Element (void)
bool | Set_Feature (sLong iElement, int iFeature, double Value)
sLong | Get_Cluster (sLong iElement) const
bool | Execute (int Method, int nClusters, int nMaxIterations=0, int Initialization=0)
sLong | Get_nElements (void) const
int | Get_nFeatures (void) const
int | Get_nClusters (void) const
int | Get_Iteration (void) const
double | Get_SP (void) const
int | Get_nMembers (int iCluster) const
double | Get_Variance (int iCluster) const
double | Get_Centroid (int iCluster, int iFeature) const

Detailed Description

Definition at line 1134 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Cluster_Analysis()

CSG_Cluster_Analysis::CSG_Cluster_Analysis ( void )

Definition at line 1981 of file mat_tools.cpp.

◆ ~CSG_Cluster_Analysis()

CSG_Cluster_Analysis::~CSG_Cluster_Analysis ( void )
virtual

Definition at line 1988 of file mat_tools.cpp.

References Destroy().

Member Function Documentation

◆ Add_Element()

bool CSG_Cluster_Analysis::Add_Element ( void )

Definition at line 2025 of file mat_tools.cpp.

References CSG_Array::Inc_Array().

◆ Create()

bool CSG_Cluster_Analysis::Create ( int nFeatures )

Definition at line 2008 of file mat_tools.cpp.

References CSG_Array::Create(), and Destroy().

◆ Destroy()

bool CSG_Cluster_Analysis::Destroy ( void )

Definition at line 1994 of file mat_tools.cpp.

References CSG_Array::Destroy(), CSG_Array_Int::Destroy(), CSG_Vector::Destroy(), and CSG_Matrix::Destroy().

Referenced by Create(), and ~CSG_Cluster_Analysis().

◆ Execute()

bool CSG_Cluster_Analysis::Execute | ( | int | Method,
 |  | int | nClusters,
 |  | int | nMaxIterations = 0,
 |  | int | Initialization = 0
 | ) |  |

Performs the cluster analysis using the features added prior to this step. Method is minimum distance (= default), hill climbing (= 1), or both methods in combination. If nMaxIterations is set to zero, the analysis is iterated until it converges. Initilization is done randomely (= default), periodically (= 1), or skipped (= 2). The latter case allows starting the clustering with user supplied start partitions.

Definition at line 2054 of file mat_tools.cpp.

References CSG_Array_Int::Create(), CSG_Matrix::Create(), CSG_Vector::Create(), Get_nElements(), and CSG_Random::Get_Uniform().

◆ Get_Centroid()

double CSG_Cluster_Analysis::Get_Centroid | ( | int | iCluster,
 |  | int | iFeature
 | ) |  | const
 inline

Definition at line 1160 of file mat_tools.h.

◆ Get_Cluster()

sLong CSG_Cluster_Analysis::Get_Cluster ( sLong iElement ) const
inline

Definition at line 1146 of file mat_tools.h.

◆ Get_Iteration()

int CSG_Cluster_Analysis::Get_Iteration ( void ) const
inline

Definition at line 1154 of file mat_tools.h.

◆ Get_nClusters()

int CSG_Cluster_Analysis::Get_nClusters ( void ) const
inline

Definition at line 1152 of file mat_tools.h.

◆ Get_nElements()

sLong CSG_Cluster_Analysis::Get_nElements ( void ) const
inline

Definition at line 1150 of file mat_tools.h.

Referenced by Execute(), and Set_Feature().

◆ Get_nFeatures()

int CSG_Cluster_Analysis::Get_nFeatures ( void ) const
inline

Definition at line 1151 of file mat_tools.h.

◆ Get_nMembers()

int CSG_Cluster_Analysis::Get_nMembers ( int iCluster ) const
inline

Definition at line 1158 of file mat_tools.h.

◆ Get_SP()

double CSG_Cluster_Analysis::Get_SP ( void ) const
inline

Definition at line 1156 of file mat_tools.h.

◆ Get_Variance()

double CSG_Cluster_Analysis::Get_Variance ( int iCluster ) const
inline

Definition at line 1159 of file mat_tools.h.

◆ Set_Feature()

bool CSG_Cluster_Analysis::Set_Feature | ( | sLong | iElement,
 |  | int | iFeature,
 |  | double | Value
 | ) |  |

Definition at line 2031 of file mat_tools.cpp.

References CSG_Array::Get_Entry(), and Get_nElements().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Cluster_Analysis Member List

This is the complete list of members for CSG_Cluster_Analysis, including all inherited members.

Add_Element(void) | CSG_Cluster_Analysis |
Create(int nFeatures) | CSG_Cluster_Analysis |
CSG_Cluster_Analysis(void) | CSG_Cluster_Analysis |
Destroy(void) | CSG_Cluster_Analysis |
Execute(int Method, int nClusters, int nMaxIterations=0, int Initialization=0) | CSG_Cluster_Analysis |
Get_Centroid(int iCluster, int iFeature) const | CSG_Cluster_Analysis | inline
Get_Cluster(sLong iElement) const | CSG_Cluster_Analysis | inline
Get_Iteration(void) const | CSG_Cluster_Analysis | inline
Get_nClusters(void) const | CSG_Cluster_Analysis | inline
Get_nElements(void) const | CSG_Cluster_Analysis | inline
Get_nFeatures(void) const | CSG_Cluster_Analysis | inline
Get_nMembers(int iCluster) const | CSG_Cluster_Analysis | inline
Get_SP(void) const | CSG_Cluster_Analysis | inline
Get_Variance(int iCluster) const | CSG_Cluster_Analysis | inline
Set_Feature(sLong iElement, int iFeature, double Value) | CSG_Cluster_Analysis |
~CSG_Cluster_Analysis(void) | CSG_Cluster_Analysis | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Colors Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Colors Class Reference

#include <api_core.h>

Public Member Functions

CSG_Colors (void)
bool | Create (void)
CSG_Colors (const CSG_Colors &Colors)
bool | Create (const CSG_Colors &Colors)
CSG_Colors (int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
bool | Create (int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
virtual | ~CSG_Colors (void)
void | Destroy (void)
bool | Set_Count (int nColors)
int | Get_Count (void) const
CSG_Colors & | operator= (const CSG_Colors &Colors)
long & | operator[] (int Index)
bool | Set_Color (int Index, long Color)
bool | Set_Color (int Index, int Red, int Green, int Blue)
bool | Set_Red (int Index, int Value)
bool | Set_Green (int Index, int Value)
bool | Set_Blue (int Index, int Value)
bool | Set_Brightness (int Index, int Value)
long | Get_Color (int Index) const
long | Get_Red (int Index) const
long | Get_Green (int Index) const
long | Get_Blue (int Index) const
long | Get_Brightness (int Index) const
long | Get_Interpolated (double Index) const
bool | Set_Predefined (int Index, bool bRevert=false, int nColors=11)
bool | Set_Palette (int Index, bool bRevert=false, int nColors=11)
bool | Set_Default (int nColors=11)
bool | Set_Ramp (long Color_A, long Color_B)
bool | Set_Ramp (long Color_A, long Color_B, int iColor_A, int iColor_B)
bool | Set_Ramp_Brighness (int Brightness_A, int Brightness_B)
bool | Set_Ramp_Brighness (int Brightness_A, int Brightness_B, int iColor_A, int iColor_B)
bool | Random (void)
bool | Invert (void)
bool | Revert (void)
bool | Greyscale (void)
bool | Assign (const CSG_Colors &Colors)
bool | Assign (CSG_Colors *pSource)
bool | Load (const CSG_String &File_Name)
bool | Save (const CSG_String &File_Name, bool bBinary)
bool | Serialize (CSG_File &Stream, bool bSave, bool bBinary)
bool | to_Text (CSG_String &String)
bool | from_Text (const CSG_String &String)

Static Public Member Functions

static int | Get_Predefined_Count (void)
static CSG_String | Get_Predefined_Name (int Identifier)

Detailed Description

Definition at line 1328 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Colors() [1/3]

CSG_Colors::CSG_Colors ( void )

Definition at line 166 of file api_colors.cpp.

References Create().

◆ CSG_Colors() [2/3]

CSG_Colors::CSG_Colors ( const CSG_Colors & Colors )

Definition at line 175 of file api_colors.cpp.

References Create().

◆ CSG_Colors() [3/3]

CSG_Colors::CSG_Colors | ( | int | nColors,
 |  | int | Palette = SG_COLORS_DEFAULT,
 |  | bool | bRevert = false
 | ) |  |

Definition at line 184 of file api_colors.cpp.

References Create().

◆ ~CSG_Colors()

CSG_Colors::~CSG_Colors ( void )
virtual

Definition at line 193 of file api_colors.cpp.

References Destroy().

Member Function Documentation

◆ Assign() [1/2]

bool CSG_Colors::Assign ( const CSG_Colors & Colors )

Definition at line 1031 of file api_colors.cpp.

References Create().

Referenced by CSG_Parameter_Colors::_Assign(), and CSG_Parameters::Add_Colors().

◆ Assign() [2/2]

bool CSG_Colors::Assign ( CSG_Colors * pSource )

Definition at line 1037 of file api_colors.cpp.

References Create().

◆ Create() [1/3]

bool CSG_Colors::Create ( const CSG_Colors & Colors )

Definition at line 210 of file api_colors.cpp.

References SG_Realloc().

◆ Create() [2/3]

bool CSG_Colors::Create | ( | int | nColors,
 |  | int | Palette = SG_COLORS_DEFAULT,
 |  | bool | bRevert = false
 | ) |  |

Definition at line 226 of file api_colors.cpp.

References Set_Count(), and Set_Palette().

◆ Create() [3/3]

bool CSG_Colors::Create ( void )

Definition at line 204 of file api_colors.cpp.

Referenced by CSG_Parameter_Colors::_Set_Value(), Assign(), CSG_Colors(), and operator=().

◆ Destroy()

void CSG_Colors::Destroy ( void )

Definition at line 241 of file api_colors.cpp.

References SG_Free().

Referenced by ~CSG_Colors().

◆ from_Text()

bool CSG_Colors::from_Text ( const CSG_String & String )

Definition at line 1254 of file api_colors.cpp.

References CSG_String::asInt(), Get_Count(), CSG_String::Length(), CSG_String::Mid(), Set_Color(), and Set_Count().

◆ Get_Blue()

long CSG_Colors::Get_Blue ( int Index ) const
inline

Definition at line 1360 of file api_core.h.

References SG_GET_B.

Referenced by CSG_Parameter_Colors::_Serialize(), Invert(), Serialize(), Set_Brightness(), Set_Green(), Set_Red(), and to_Text().

◆ Get_Brightness()

long CSG_Colors::Get_Brightness ( int Index ) const
inline

Definition at line 1361 of file api_core.h.

Referenced by Greyscale().

◆ Get_Color()

long CSG_Colors::Get_Color ( int Index ) const
inline

Definition at line 1357 of file api_core.h.

Referenced by CSG_Parameter::is_Value_Equal(), and Revert().

◆ Get_Count()

int CSG_Colors::Get_Count ( void ) const
inline

Definition at line 1345 of file api_core.h.

Referenced by CSG_Parameter_Colors::_asInt(), CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Colors::_Set_String(), CSG_Parameter_Colors::_Set_Value(), from_Text(), Greyscale(), Invert(), CSG_Parameter::is_Value_Equal(), Random(), Revert(), Serialize(), Set_Count(), Set_Default(), Set_Ramp(), Set_Ramp_Brighness(), and to_Text().

◆ Get_Green()

long CSG_Colors::Get_Green ( int Index ) const
inline

Definition at line 1359 of file api_core.h.

References SG_GET_G.

Referenced by CSG_Parameter_Colors::_Serialize(), Invert(), Serialize(), Set_Blue(), Set_Brightness(), Set_Red(), and to_Text().

◆ Get_Interpolated()

long CSG_Colors::Get_Interpolated ( double Index ) const
inline

Definition at line 1363 of file api_core.h.

References SG_GET_RGB.

Referenced by Set_Count().

◆ Get_Predefined_Count()

int CSG_Colors::Get_Predefined_Count ( void )
static

Definition at line 429 of file api_colors.cpp.

References SG_COLORS_COUNT.

Referenced by CSG_Parameter_Colors::_Set_Value().

◆ Get_Predefined_Name()

CSG_String CSG_Colors::Get_Predefined_Name ( int Identifier )
static

Definition at line 435 of file api_colors.cpp.

References _TL, SG_COLORS_ASPECT_1, SG_COLORS_ASPECT_2, SG_COLORS_ASPECT_3, SG_COLORS_BLACK_BLUE, SG_COLORS_BLACK_GREEN, SG_COLORS_BLACK_RED, SG_COLORS_BLACK_WHITE, SG_COLORS_DEFAULT, SG_COLORS_DEFAULT_BRIGHT, SG_COLORS_GREEN_BLUE, SG_COLORS_GREEN_GREY_BLUE, SG_COLORS_GREEN_RED, SG_COLORS_GREEN_RED_BLUE, SG_COLORS_NEON, SG_COLORS_PRECIPITATION, SG_COLORS_RAINBOW, SG_COLORS_RED_BLUE, SG_COLORS_RED_BLUE_GREEN, SG_COLORS_RED_GREEN, SG_COLORS_RED_GREEN_BLUE, SG_COLORS_RED_GREY_BLUE, SG_COLORS_RED_GREY_GREEN, SG_COLORS_TOPOGRAPHY, SG_COLORS_TOPOGRAPHY_2, SG_COLORS_TOPOGRAPHY_3, SG_COLORS_WHITE_BLUE, SG_COLORS_WHITE_GREEN, SG_COLORS_WHITE_RED, SG_COLORS_YELLOW_BLUE, SG_COLORS_YELLOW_GREEN, and SG_COLORS_YELLOW_RED.

Referenced by SG_Colors_Get_Name().

◆ Get_Red()

long CSG_Colors::Get_Red ( int Index ) const
inline

Definition at line 1358 of file api_core.h.

References SG_GET_R.

Referenced by CSG_Parameter_Colors::_Serialize(), Invert(), Serialize(), Set_Blue(), Set_Brightness(), Set_Green(), and to_Text().

◆ Greyscale()

bool CSG_Colors::Greyscale ( void )

Definition at line 1005 of file api_colors.cpp.

References Get_Brightness(), Get_Count(), and Set_Color().

◆ Invert()

bool CSG_Colors::Invert ( void )

Definition at line 981 of file api_colors.cpp.

References Get_Blue(), Get_Count(), Get_Green(), Get_Red(), and Set_Color().

◆ Load()

bool CSG_Colors::Load ( const CSG_String & File_Name )

Definition at line 1052 of file api_colors.cpp.

References B, COLORS_SERIAL_VERSION__ASCII, COLORS_SERIAL_VERSION_BINARY, CSG_String::Find(), CSG_File::Length(), CSG_File::Open(), CSG_File::Read(), CSG_File::Seek_Start(), Serialize(), Set_Color(), Set_Count(), SG_FILE_R, SG_Free(), and SG_Malloc().

◆ operator=()

CSG_Colors & CSG_Colors::operator= ( const CSG_Colors & Colors )

Definition at line 1023 of file api_colors.cpp.

References Create().

◆ operator[]()

long& CSG_Colors::operator[] ( int Index )
inline

Definition at line 1348 of file api_core.h.

◆ Random()

bool CSG_Colors::Random ( void )

Definition at line 966 of file api_colors.cpp.

References Get_Count(), and Set_Color().

Referenced by Set_Predefined().

◆ Revert()

bool CSG_Colors::Revert ( void )

Definition at line 992 of file api_colors.cpp.

References Get_Color(), Get_Count(), and Set_Color().

Referenced by Set_Predefined().

◆ Save()

bool CSG_Colors::Save | ( | const CSG_String & | File_Name,
 |  | bool | bBinary
 | ) |  |

Definition at line 1133 of file api_colors.cpp.

References COLORS_SERIAL_VERSION__ASCII, COLORS_SERIAL_VERSION_BINARY, CSG_File::Open(), Serialize(), SG_FILE_W, and CSG_File::Write().

◆ Serialize()

bool CSG_Colors::Serialize | ( | CSG_File & | Stream,
 |  | bool | bSave,
 |  | bool | bBinary
 | ) |  |

Definition at line 1162 of file api_colors.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::asInt(), Get_Blue(), Get_Count(), Get_Green(), Get_Red(), CSG_String::is_Empty(), CSG_File::is_Open(), CSG_File::Printf(), CSG_File::Read(), CSG_File::Read_Line(), Set_Color(), Set_Count(), and CSG_File::Write().

Referenced by Load(), Save(), and CSG_Parameters::Serialize_Compatibility().

◆ Set_Blue()

bool CSG_Colors::Set_Blue | ( | int | Index,
 |  | int | Value
 | ) |  |

Definition at line 336 of file api_colors.cpp.

References Get_Green(), Get_Red(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ Set_Brightness()

bool CSG_Colors::Set_Brightness | ( | int | Index,
 |  | int | Value
 | ) |  |

Definition at line 342 of file api_colors.cpp.

References Get_Blue(), Get_Green(), Get_Red(), and Set_Color().

Referenced by Set_Ramp_Brighness().

◆ Set_Color() [1/2]

bool CSG_Colors::Set_Color | ( | int | Index,
 |  | int | Red,
 |  | int | Green,
 |  | int | Blue
 | ) |  |

Definition at line 318 of file api_colors.cpp.

References Set_Color(), and SG_GET_RGB.

◆ Set_Color() [2/2]

bool CSG_Colors::Set_Color | ( | int | Index,
 |  | long | Color
 | ) |  |

Definition at line 305 of file api_colors.cpp.

Referenced by from_Text(), Greyscale(), Invert(), Load(), Random(), Revert(), Serialize(), Set_Blue(), Set_Brightness(), Set_Color(), Set_Default(), Set_Green(), Set_Predefined(), Set_Ramp(), and Set_Red().

◆ Set_Count()

bool CSG_Colors::Set_Count ( int nColors )

Definition at line 258 of file api_colors.cpp.

References Get_Count(), Get_Interpolated(), Set_Default(), and SG_Realloc().

Referenced by CSG_Parameter_Colors::_Serialize(), Create(), from_Text(), Load(), Serialize(), and Set_Predefined().

◆ Set_Default()

bool CSG_Colors::Set_Default ( int nColors = 11 )

Definition at line 837 of file api_colors.cpp.

References Get_Count(), M_PI, Set_Color(), and SG_Realloc().

Referenced by Set_Count(), and Set_Predefined().

◆ Set_Green()

bool CSG_Colors::Set_Green | ( | int | Index,
 |  | int | Value
 | ) |  |

Definition at line 330 of file api_colors.cpp.

References Get_Blue(), Get_Red(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ Set_Palette()

bool CSG_Colors::Set_Palette | ( | int | Index,
 |  | bool | bRevert = false,
 |  | int | nColors = 11
 | ) |  |
inline

Definition at line 1380 of file api_core.h.

Referenced by Create().

◆ Set_Predefined()

bool CSG_Colors::Set_Predefined | ( | int | Index,
 |  | bool | bRevert = false,
 |  | int | nColors = 11
 | ) |  |

Definition at line 475 of file api_colors.cpp.

References Random(), Revert(), Set_Color(), Set_Count(), Set_Default(), Set_Ramp(), Set_Ramp_Brighness(), SG_COLORS_ASPECT_1, SG_COLORS_ASPECT_2, SG_COLORS_ASPECT_3, SG_COLORS_BLACK_BLUE, SG_COLORS_BLACK_GREEN, SG_COLORS_BLACK_RED, SG_COLORS_BLACK_WHITE, SG_COLORS_COUNT, SG_COLORS_DEFAULT, SG_COLORS_DEFAULT_BRIGHT, SG_COLORS_GREEN_BLUE, SG_COLORS_GREEN_GREY_BLUE, SG_COLORS_GREEN_RED, SG_COLORS_GREEN_RED_BLUE, SG_COLORS_NEON, SG_COLORS_PRECIPITATION, SG_COLORS_RAINBOW, SG_COLORS_RED_BLUE, SG_COLORS_RED_BLUE_GREEN, SG_COLORS_RED_GREEN, SG_COLORS_RED_GREEN_BLUE, SG_COLORS_RED_GREY_BLUE, SG_COLORS_RED_GREY_GREEN, SG_COLORS_TOPOGRAPHY, SG_COLORS_TOPOGRAPHY_2, SG_COLORS_TOPOGRAPHY_3, SG_COLORS_WHITE_BLUE, SG_COLORS_WHITE_GREEN, SG_COLORS_WHITE_RED, SG_COLORS_YELLOW_BLUE, SG_COLORS_YELLOW_GREEN, SG_COLORS_YELLOW_RED, and SG_GET_RGB.

◆ Set_Ramp() [1/2]

bool CSG_Colors::Set_Ramp | ( | long | Color_A,
 |  | long | Color_B
 | ) |  |

Definition at line 862 of file api_colors.cpp.

References Get_Count().

Referenced by Set_Predefined().

◆ Set_Ramp() [2/2]

bool CSG_Colors::Set_Ramp | ( | long | Color_A,
 |  | long | Color_B,
 |  | int | iColor_A,
 |  | int | iColor_B
 | ) |  |

Definition at line 868 of file api_colors.cpp.

References Get_Count(), Set_Color(), SG_GET_B, SG_GET_G, and SG_GET_R.

◆ Set_Ramp_Brighness() [1/2]

bool CSG_Colors::Set_Ramp_Brighness | ( | int | Brightness_A,
 |  | int | Brightness_B
 | ) |  |

Definition at line 917 of file api_colors.cpp.

References Get_Count().

Referenced by Set_Predefined().

◆ Set_Ramp_Brighness() [2/2]

bool CSG_Colors::Set_Ramp_Brighness | ( | int | Brightness_A,
 |  | int | Brightness_B,
 |  | int | iColor_A,
 |  | int | iColor_B
 | ) |  |

Definition at line 923 of file api_colors.cpp.

References Get_Count(), and Set_Brightness().

◆ Set_Red()

bool CSG_Colors::Set_Red | ( | int | Index,
 |  | int | Value
 | ) |  |

Definition at line 324 of file api_colors.cpp.

References Get_Blue(), Get_Green(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ to_Text()

bool CSG_Colors::to_Text ( CSG_String & String )

Definition at line 1236 of file api_colors.cpp.

References CSG_String::Clear(), CSG_String::Format(), Get_Blue(), Get_Count(), Get_Green(), and Get_Red().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_colors.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Colors Member List

This is the complete list of members for CSG_Colors, including all inherited members.

Assign(const CSG_Colors &Colors) | CSG_Colors |
Assign(CSG_Colors *pSource) | CSG_Colors |
Create(void) | CSG_Colors |
Create(const CSG_Colors &Colors) | CSG_Colors |
Create(int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Colors |
CSG_Colors(void) | CSG_Colors |
CSG_Colors(const CSG_Colors &Colors) | CSG_Colors |
CSG_Colors(int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Colors |
Destroy(void) | CSG_Colors |
from_Text(const CSG_String &String) | CSG_Colors |
Get_Blue(int Index) const | CSG_Colors | inline
Get_Brightness(int Index) const | CSG_Colors | inline
Get_Color(int Index) const | CSG_Colors | inline
Get_Count(void) const | CSG_Colors | inline
Get_Green(int Index) const | CSG_Colors | inline
Get_Interpolated(double Index) const | CSG_Colors | inline
Get_Predefined_Count(void) | CSG_Colors | static
Get_Predefined_Name(int Identifier) | CSG_Colors | static
Get_Red(int Index) const | CSG_Colors | inline
Greyscale(void) | CSG_Colors |
Invert(void) | CSG_Colors |
Load(const CSG_String &File_Name) | CSG_Colors |
operator=(const CSG_Colors &Colors) | CSG_Colors |
operator[](int Index) | CSG_Colors | inline
Random(void) | CSG_Colors |
Revert(void) | CSG_Colors |
Save(const CSG_String &File_Name, bool bBinary) | CSG_Colors |
Serialize(CSG_File &Stream, bool bSave, bool bBinary) | CSG_Colors |
Set_Blue(int Index, int Value) | CSG_Colors |
Set_Brightness(int Index, int Value) | CSG_Colors |
Set_Color(int Index, long Color) | CSG_Colors |
Set_Color(int Index, int Red, int Green, int Blue) | CSG_Colors |
Set_Count(int nColors) | CSG_Colors |
Set_Default(int nColors=11) | CSG_Colors |
Set_Green(int Index, int Value) | CSG_Colors |
Set_Palette(int Index, bool bRevert=false, int nColors=11) | CSG_Colors | inline
Set_Predefined(int Index, bool bRevert=false, int nColors=11) | CSG_Colors |
Set_Ramp(long Color_A, long Color_B) | CSG_Colors |
Set_Ramp(long Color_A, long Color_B, int iColor_A, int iColor_B) | CSG_Colors |
Set_Ramp_Brighness(int Brightness_A, int Brightness_B) | CSG_Colors |
Set_Ramp_Brighness(int Brightness_A, int Brightness_B, int iColor_A, int iColor_B) | CSG_Colors |
Set_Red(int Index, int Value) | CSG_Colors |
to_Text(CSG_String &String) | CSG_Colors |
~CSG_Colors(void) | CSG_Colors | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Data_Collection Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Data_Collection Class Reference

#include <data_manager.h>

Inheritance diagram for CSG_Data_Collection:
CSG_Grid_Collection

Public Member Functions

size_t | Count (void) const
CSG_Data_Object * | Get (size_t i) const
CSG_Data_Object * | Get (const CSG_String &File, bool bNative=true) const
virtual bool | Exists (CSG_Data_Object *pObject) const

Protected Member Functions

CSG_Data_Collection (class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type)
virtual | ~CSG_Data_Collection (void)
virtual bool | Add (CSG_Data_Object *pObject)
bool | Delete (CSG_Data_Object *pObject, bool bDetach=false)
bool | Delete (size_t i, bool bDetach=false)
bool | Delete (bool bDetach=false, bool bUnsaved=false)
bool | Delete_All (bool bDetach=false)
bool | Delete_Unsaved (bool bDetach=false)

Protected Attributes

class CSG_Data_Manager * m_pManager
TSG_Data_Object_Type m_Type
CSG_Array_Pointer m_Objects

Friends

class CSG_Data_Manager

Detailed Description

Definition at line 88 of file data_manager.h.

Constructor & Destructor Documentation

◆ CSG_Data_Collection()

CSG_Data_Collection::CSG_Data_Collection | ( | class CSG_Data_Manager * | pManager,
 |  | TSG_Data_Object_Type | Type
 | ) |  |
protected

Definition at line 78 of file data_manager.cpp.

References m_pManager, and m_Type.

◆ ~CSG_Data_Collection()

CSG_Data_Collection::~CSG_Data_Collection ( void )
protectedvirtual

Definition at line 85 of file data_manager.cpp.

References Delete_All().

Member Function Documentation

◆ Add()

bool CSG_Data_Collection::Add ( CSG_Data_Object * pObject )
protectedvirtual

Reimplemented in CSG_Grid_Collection.

Definition at line 119 of file data_manager.cpp.

References Count(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, Exists(), g_Data_Manager, CSG_Array_Pointer::Inc_Array(), m_Objects, m_pManager, SG_UI_DataObject_Add(), and SG_UI_DATAOBJECT_UPDATE.

Referenced by CSG_Grid_Collection::Add(), and CSG_Data_Manager::Add().

◆ Count()

size_t CSG_Data_Collection::Count ( void ) const
inline

Definition at line 94 of file data_manager.h.

Referenced by Add(), CSG_Grid_Collection::Add(), Delete(), CSG_Data_Manager::Delete(), Delete_Unsaved(), Exists(), CSG_Grid_Collection::Exists(), Get(), CSG_Data_Manager::Get_Summary(), and CSG_Grid_Collection::is_Equal().

◆ Delete() [1/3]

bool CSG_Data_Collection::Delete | ( | bool | bDetach = false,
 |  | bool | bUnsaved = false
 | ) |  |
protected

Definition at line 185 of file data_manager.cpp.

References Count(), Delete(), Get(), m_Objects, CSG_Array_Pointer::Set_Array(), and SG_File_Exists().

◆ Delete() [2/3]

bool CSG_Data_Collection::Delete | ( | CSG_Data_Object * | pObject,
 |  | bool | bDetach = false
 | ) |  |
protected

Definition at line 145 of file data_manager.cpp.

References Count(), Get(), CSG_Array_Pointer::Get_Array(), CSG_Array_Pointer::Get_uSize(), m_Objects, and CSG_Array_Pointer::Set_Array().

Referenced by CSG_Data_Manager::Delete(), Delete(), Delete_All(), and Delete_Unsaved().

◆ Delete() [3/3]

bool CSG_Data_Collection::Delete | ( | size_t | i,
 |  | bool | bDetach = false
 | ) |  |
protected

Definition at line 179 of file data_manager.cpp.

References Delete(), and Get().

◆ Delete_All()

bool CSG_Data_Collection::Delete_All ( bool bDetach = false )
protected

Definition at line 214 of file data_manager.cpp.

References Delete().

Referenced by CSG_Data_Manager::Delete(), and ~CSG_Data_Collection().

◆ Delete_Unsaved()

bool CSG_Data_Collection::Delete_Unsaved ( bool bDetach = false )
protected

Definition at line 220 of file data_manager.cpp.

References Count(), Delete(), Get(), and SG_File_Exists().

◆ Exists()

bool CSG_Data_Collection::Exists ( CSG_Data_Object * pObject ) const
virtual

Reimplemented in CSG_Grid_Collection.

Definition at line 105 of file data_manager.cpp.

References Count(), and Get().

Referenced by Add(), and CSG_Data_Manager::Exists().

◆ Get() [1/2]

CSG_Data_Object * CSG_Data_Collection::Get | ( | const CSG_String & | File,
 |  | bool | bNative = true
 | ) |  | const

Definition at line 91 of file data_manager.cpp.

References CSG_String::Cmp(), Count(), and Get().

Referenced by Get().

◆ Get() [2/2]

CSG_Data_Object* CSG_Data_Collection::Get ( size_t i ) const
inline

Definition at line 96 of file data_manager.h.

Referenced by Delete(), Delete_Unsaved(), Exists(), CSG_Grid_Collection::Exists(), CSG_Data_Manager::Find(), Get(), and CSG_Data_Manager::Get_Summary().

Friends And Related Function Documentation

◆ CSG_Data_Manager

friend class CSG_Data_Manager
friend

Definition at line 90 of file data_manager.h.

Member Data Documentation

◆ m_Objects

CSG_Array_Pointer CSG_Data_Collection::m_Objects
protected

Definition at line 120 of file data_manager.h.

Referenced by Add(), and Delete().

◆ m_pManager

class CSG_Data_Manager* CSG_Data_Collection::m_pManager
protected

Definition at line 116 of file data_manager.h.

Referenced by Add(), CSG_Data_Collection(), and CSG_Data_Manager::Delete().

◆ m_Type

TSG_Data_Object_Type CSG_Data_Collection::m_Type
protected

Definition at line 118 of file data_manager.h.

Referenced by CSG_Data_Collection(), and CSG_Data_Manager::Delete().

The documentation for this class was generated from the following files:
  • data_manager.h
  • data_manager.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Data_Collection Member List

This is the complete list of members for CSG_Data_Collection, including all inherited members.

Add(CSG_Data_Object *pObject) | CSG_Data_Collection | protectedvirtual
Count(void) const | CSG_Data_Collection | inline
CSG_Data_Collection(class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type) | CSG_Data_Collection | protected
CSG_Data_Manager class | CSG_Data_Collection | friend
Delete(CSG_Data_Object *pObject, bool bDetach=false) | CSG_Data_Collection | protected
Delete(size_t i, bool bDetach=false) | CSG_Data_Collection | protected
Delete(bool bDetach=false, bool bUnsaved=false) | CSG_Data_Collection | protected
Delete_All(bool bDetach=false) | CSG_Data_Collection | protected
Delete_Unsaved(bool bDetach=false) | CSG_Data_Collection | protected
Exists(CSG_Data_Object *pObject) const | CSG_Data_Collection | virtual
Get(size_t i) const | CSG_Data_Collection | inline
Get(const CSG_String &File, bool bNative=true) const | CSG_Data_Collection |
m_Objects | CSG_Data_Collection | protected
m_pManager | CSG_Data_Collection | protected
m_Type | CSG_Data_Collection | protected
~CSG_Data_Collection(void) | CSG_Data_Collection | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Data_Manager Class Reference

Public Member Functions | List of all members
CSG_Data_Manager Class Reference

#include <data_manager.h>

Public Member Functions

CSG_Data_Manager (void)
virtual | ~CSG_Data_Manager (void)
CSG_Data_Collection * | Get_Table (void) const
CSG_Data_Collection * | asTIN (void) const
CSG_Data_Collection * | Get_Point_Cloud (void) const
CSG_Data_Collection * | Get_Shapes (void) const
size_t | Grid_System_Count (void) const
CSG_Grid_Collection * | Get_Grid_System (size_t i) const
CSG_Grid_Collection * | Get_Grid_System (const CSG_Grid_System &System) const
bool | Add (CSG_Data_Object *pObject)
CSG_Data_Object * | Add (const CSG_String &File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined)
CSG_Data_Object * | Add (const char *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined)
CSG_Data_Object * | Add (const wchar_t *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined)
CSG_Table * | Add_Table (void)
CSG_Table * | Add_Table (const CSG_String &File)
CSG_Table * | Add_Table (const char *File)
CSG_Table * | Add_Table (const wchar_t *File)
CSG_TIN * | Add_TIN (void)
CSG_TIN * | Add_TIN (const CSG_String &File)
CSG_TIN * | Add_TIN (const char *File)
CSG_TIN * | Add_TIN (const wchar_t *File)
CSG_PointCloud * | Add_PointCloud (void)
CSG_PointCloud * | Add_PointCloud (const CSG_String &File)
CSG_PointCloud * | Add_PointCloud (const char *File)
CSG_PointCloud * | Add_PointCloud (const wchar_t *File)
CSG_Shapes * | Add_Shapes (TSG_Shape_Type Type=SHAPE_TYPE_Undefined)
CSG_Shapes * | Add_Shapes (const CSG_String &File)
CSG_Shapes * | Add_Shapes (const char *File)
CSG_Shapes * | Add_Shapes (const wchar_t *File)
CSG_Grid * | Add_Grid (const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined)
CSG_Grid * | Add_Grid (int NX, int NY, double Cellsize=0., double xMin=0., double yMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
CSG_Grid * | Add_Grid (const CSG_String &File)
CSG_Grid * | Add_Grid (const char *File)
CSG_Grid * | Add_Grid (const wchar_t *File)
CSG_Grids * | Add_Grids (const CSG_String &File)
CSG_Grids * | Add_Grids (const char *File)
CSG_Grids * | Add_Grids (const wchar_t *File)
bool | Delete (CSG_Data_Collection *pCollection, bool bDetach=false)
bool | Delete (CSG_Data_Object *pObject, bool bDetach=false)
bool | Delete (const CSG_Grid_System &System, bool bDetach=false)
bool | Delete (bool bDetach=false, bool bUnsaved=false)
bool | Delete_All (bool bDetach=false)
bool | Delete_Unsaved (bool bDetach=false)
bool | Exists (CSG_Data_Object *pObject) const
bool | Exists (const CSG_Grid_System &System) const
CSG_Data_Object * | Find (const CSG_String &File, bool bNative=true) const
CSG_String | Get_Summary (void) const

Detailed Description

Definition at line 163 of file data_manager.h.

Constructor & Destructor Documentation

◆ CSG_Data_Manager()

CSG_Data_Manager::CSG_Data_Manager ( void )

Definition at line 316 of file data_manager.cpp.

References SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ ~CSG_Data_Manager()

CSG_Data_Manager::~CSG_Data_Manager ( void )
virtual

Definition at line 325 of file data_manager.cpp.

References Delete_All().

Member Function Documentation

◆ Add() [1/4]

CSG_Data_Object* CSG_Data_Manager::Add | ( | const char * | File,
 |  | TSG_Data_Object_Type | Type = SG_DATAOBJECT_TYPE_Undefined
 | ) |  |
inline

Definition at line 181 of file data_manager.h.

References Add().

Referenced by Add().

◆ Add() [2/4]

CSG_Data_Object * CSG_Data_Manager::Add | ( | const CSG_String & | File,
 |  | TSG_Data_Object_Type | Type = SG_DATAOBJECT_TYPE_Undefined
 | ) |  |

Definition at line 443 of file data_manager.cpp.

References Add(), CSG_Data_Object::is_Valid(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, SG_DATAOBJECT_TYPE_Undefined, and SG_File_Cmp_Extension().

◆ Add() [3/4]

CSG_Data_Object* CSG_Data_Manager::Add | ( | const wchar_t * | File,
 |  | TSG_Data_Object_Type | Type = SG_DATAOBJECT_TYPE_Undefined
 | ) |  |
inline

Definition at line 182 of file data_manager.h.

References Add().

Referenced by Add().

◆ Add() [4/4]

bool CSG_Data_Manager::Add ( CSG_Data_Object * pObject )

Definition at line 428 of file data_manager.cpp.

References CSG_Data_Collection::Add(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Data_Object::Get_ObjectType(), CSG_Array_Pointer::Get_Size(), CSG_Array_Pointer::Inc_Array(), SG_DATAOBJECT_TYPE_Grid, and SG_DATAOBJECT_TYPE_Grids.

Referenced by CSG_Parameter_Data_Object_Output::_Set_Value(), Add(), Add_Grid(), Add_PointCloud(), Add_Shapes(), Add_Table(), Add_TIN(), and CSG_Tool::DataObject_Add().

◆ Add_Grid() [1/5]

CSG_Grid* CSG_Data_Manager::Add_Grid ( const char * File )
inline

Definition at line 207 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grid.

◆ Add_Grid() [2/5]

CSG_Grid * CSG_Data_Manager::Add_Grid | ( | const CSG_Grid_System & | System,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Definition at line 662 of file data_manager.cpp.

References Add(), and CSG_Grid_System::is_Valid().

Referenced by CSG_Parameters::Add_Grid(), and Add_Grid().

◆ Add_Grid() [3/5]

CSG_Grid* CSG_Data_Manager::Add_Grid ( const CSG_String & File )
inline

Definition at line 206 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grid.

◆ Add_Grid() [4/5]

CSG_Grid* CSG_Data_Manager::Add_Grid ( const wchar_t * File )
inline

Definition at line 208 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grid.

◆ Add_Grid() [5/5]

CSG_Grid * CSG_Data_Manager::Add_Grid | ( | int | NX,
 |  | int | NY,
 |  | double | Cellsize = 0.,
 |  | double | xMin = 0.,
 |  | double | yMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Definition at line 675 of file data_manager.cpp.

References Add_Grid().

◆ Add_Grids() [1/3]

CSG_Grids* CSG_Data_Manager::Add_Grids ( const char * File )
inline

Definition at line 211 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grids.

◆ Add_Grids() [2/3]

CSG_Grids* CSG_Data_Manager::Add_Grids ( const CSG_String & File )
inline

Definition at line 210 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grids.

◆ Add_Grids() [3/3]

CSG_Grids* CSG_Data_Manager::Add_Grids ( const wchar_t * File )
inline

Definition at line 212 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Grids.

◆ Add_PointCloud() [1/4]

CSG_PointCloud* CSG_Data_Manager::Add_PointCloud ( const char * File )
inline

Definition at line 196 of file data_manager.h.

References SG_DATAOBJECT_TYPE_PointCloud.

◆ Add_PointCloud() [2/4]

CSG_PointCloud* CSG_Data_Manager::Add_PointCloud ( const CSG_String & File )
inline

Definition at line 195 of file data_manager.h.

References SG_DATAOBJECT_TYPE_PointCloud.

◆ Add_PointCloud() [3/4]

CSG_PointCloud* CSG_Data_Manager::Add_PointCloud ( const wchar_t * File )
inline

Definition at line 197 of file data_manager.h.

References SG_DATAOBJECT_TYPE_PointCloud.

◆ Add_PointCloud() [4/4]

CSG_PointCloud * CSG_Data_Manager::Add_PointCloud ( void )

Definition at line 636 of file data_manager.cpp.

References Add().

Referenced by CSG_Parameters::Add_PointCloud().

◆ Add_Shapes() [1/4]

CSG_Shapes* CSG_Data_Manager::Add_Shapes ( const char * File )
inline

Definition at line 201 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Shapes.

◆ Add_Shapes() [2/4]

CSG_Shapes* CSG_Data_Manager::Add_Shapes ( const CSG_String & File )
inline

Definition at line 200 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Shapes.

◆ Add_Shapes() [3/4]

CSG_Shapes* CSG_Data_Manager::Add_Shapes ( const wchar_t * File )
inline

Definition at line 202 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Shapes.

◆ Add_Shapes() [4/4]

CSG_Shapes * CSG_Data_Manager::Add_Shapes ( TSG_Shape_Type Type = SHAPE_TYPE_Undefined )

Definition at line 649 of file data_manager.cpp.

References Add().

Referenced by CSG_Parameters::Add_Shapes().

◆ Add_Table() [1/4]

CSG_Table* CSG_Data_Manager::Add_Table ( const char * File )
inline

Definition at line 186 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Table.

◆ Add_Table() [2/4]

CSG_Table* CSG_Data_Manager::Add_Table ( const CSG_String & File )
inline

Definition at line 185 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Table.

◆ Add_Table() [3/4]

CSG_Table* CSG_Data_Manager::Add_Table ( const wchar_t * File )
inline

Definition at line 187 of file data_manager.h.

References SG_DATAOBJECT_TYPE_Table.

◆ Add_Table() [4/4]

CSG_Table * CSG_Data_Manager::Add_Table ( void )

Definition at line 610 of file data_manager.cpp.

References Add().

Referenced by CSG_Parameters::Add_Table().

◆ Add_TIN() [1/4]

CSG_TIN* CSG_Data_Manager::Add_TIN ( const char * File )
inline

Definition at line 191 of file data_manager.h.

References SG_DATAOBJECT_TYPE_TIN.

◆ Add_TIN() [2/4]

CSG_TIN* CSG_Data_Manager::Add_TIN ( const CSG_String & File )
inline

Definition at line 190 of file data_manager.h.

References SG_DATAOBJECT_TYPE_TIN.

◆ Add_TIN() [3/4]

CSG_TIN* CSG_Data_Manager::Add_TIN ( const wchar_t * File )
inline

Definition at line 192 of file data_manager.h.

References SG_DATAOBJECT_TYPE_TIN.

◆ Add_TIN() [4/4]

CSG_TIN * CSG_Data_Manager::Add_TIN ( void )

Definition at line 623 of file data_manager.cpp.

References Add().

Referenced by CSG_Parameters::Add_TIN().

◆ asTIN()

CSG_Data_Collection* CSG_Data_Manager::asTIN ( void ) const
inline

Definition at line 170 of file data_manager.h.

◆ Delete() [1/4]

bool CSG_Data_Manager::Delete | ( | bool | bDetach = false,
 |  | bool | bUnsaved = false
 | ) |  |

Definition at line 760 of file data_manager.cpp.

References CSG_Data_Collection::Delete(), Get_Grid_System(), Grid_System_Count(), and CSG_Array_Pointer::Set_Array().

◆ Delete() [2/4]

bool CSG_Data_Manager::Delete | ( | const CSG_Grid_System & | System,
 |  | bool | bDetach = false
 | ) |  |

Definition at line 754 of file data_manager.cpp.

References Delete(), and Get_Grid_System().

◆ Delete() [3/4]

bool CSG_Data_Manager::Delete | ( | CSG_Data_Collection * | pCollection,
 |  | bool | bDetach = false
 | ) |  |

Definition at line 686 of file data_manager.cpp.

References CSG_Data_Collection::Delete_All(), CSG_Array_Pointer::Get_Array(), CSG_Array_Pointer::Get_uSize(), CSG_Data_Collection::m_pManager, CSG_Data_Collection::m_Type, CSG_Array_Pointer::Set_Array(), and SG_DATAOBJECT_TYPE_Grid.

Referenced by Delete(), Delete_All(), and Delete_Unsaved().

◆ Delete() [4/4]

bool CSG_Data_Manager::Delete | ( | CSG_Data_Object * | pObject,
 |  | bool | bDetach = false
 | ) |  |

Definition at line 736 of file data_manager.cpp.

References CSG_Data_Collection::Count(), Delete(), CSG_Data_Collection::Delete(), CSG_Data_Collection::m_Type, and SG_DATAOBJECT_TYPE_Grid.

◆ Delete_All()

bool CSG_Data_Manager::Delete_All ( bool bDetach = false )

Definition at line 782 of file data_manager.cpp.

References Delete().

Referenced by CSG_Tool::Delete_Manager(), and ~CSG_Data_Manager().

◆ Delete_Unsaved()

bool CSG_Data_Manager::Delete_Unsaved ( bool bDetach = false )

Definition at line 788 of file data_manager.cpp.

References Delete().

◆ Exists() [1/2]

bool CSG_Data_Manager::Exists ( const CSG_Grid_System & System ) const

Definition at line 383 of file data_manager.cpp.

References Get_Grid_System().

◆ Exists() [2/2]

bool CSG_Data_Manager::Exists ( CSG_Data_Object * pObject ) const

Definition at line 389 of file data_manager.cpp.

References CSG_Data_Collection::Exists(), CSG_Grid_Collection::Exists(), Get_Grid_System(), and Grid_System_Count().

Referenced by CSG_Parameter_List::_Assign(), CSG_Parameter_Grid_System::_Set_Value(), and CSG_Parameter::Check().

◆ Find()

CSG_Data_Object * CSG_Data_Manager::Find | ( | const CSG_String & | File,
 |  | bool | bNative = true
 | ) |  | const

Definition at line 405 of file data_manager.cpp.

References CSG_Data_Collection::Get(), Get_Grid_System(), and Grid_System_Count().

Referenced by CSG_Parameter_List::_Serialize().

◆ Get_Grid_System() [1/2]

CSG_Grid_Collection * CSG_Data_Manager::Get_Grid_System ( const CSG_Grid_System & System ) const

Definition at line 367 of file data_manager.cpp.

References Get_Grid_System(), Grid_System_Count(), and CSG_Grid_Collection::is_Equal().

◆ Get_Grid_System() [2/2]

CSG_Grid_Collection* CSG_Data_Manager::Get_Grid_System ( size_t i ) const
inline

Definition at line 175 of file data_manager.h.

Referenced by Delete(), Exists(), Find(), Get_Grid_System(), and Get_Summary().

◆ Get_Point_Cloud()

CSG_Data_Collection* CSG_Data_Manager::Get_Point_Cloud ( void ) const
inline

Definition at line 171 of file data_manager.h.

Referenced by Get_Summary().

◆ Get_Shapes()

CSG_Data_Collection* CSG_Data_Manager::Get_Shapes ( void ) const
inline

Definition at line 172 of file data_manager.h.

Referenced by Get_Summary().

◆ Get_Summary()

CSG_String CSG_Data_Manager::Get_Summary ( void ) const

Definition at line 799 of file data_manager.cpp.

References _TL, CSG_String::c_str(), CSG_Data_Collection::Count(), CSG_String::Format(), CSG_Data_Collection::Get(), CSG_Table::Get_Count(), Get_Grid_System(), CSG_Grid::Get_Memory_Size(), CSG_Grids::Get_Memory_Size(), CSG_Grid_System::Get_Name(), CSG_Data_Object::Get_Name(), CSG_Grids::Get_NZ(), CSG_Data_Object::Get_ObjectType(), Get_Point_Cloud(), Get_Shapes(), Get_Table(), CSG_Grid::Get_Type(), CSG_Grids::Get_Type(), CSG_Shapes::Get_Type(), Grid_System_Count(), CSG_String::is_Empty(), CSG_Grid_Collection::m_System, N_MEGABYTE_BYTES, CSG_String::Prepend(), SG_Data_Type_Get_Name(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ Get_Table()

CSG_Data_Collection* CSG_Data_Manager::Get_Table ( void ) const
inline

Definition at line 169 of file data_manager.h.

Referenced by Get_Summary().

◆ Grid_System_Count()

size_t CSG_Data_Manager::Grid_System_Count ( void ) const
inline

Definition at line 174 of file data_manager.h.

Referenced by Delete(), Exists(), Find(), Get_Grid_System(), and Get_Summary().

The documentation for this class was generated from the following files:
  • data_manager.h
  • data_manager.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Data_Manager Member List

This is the complete list of members for CSG_Data_Manager, including all inherited members.

Add(CSG_Data_Object *pObject) | CSG_Data_Manager |
Add(const CSG_String &File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined) | CSG_Data_Manager |
Add(const char *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined) | CSG_Data_Manager | inline
Add(const wchar_t *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined) | CSG_Data_Manager | inline
Add_Grid(const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Data_Manager |
Add_Grid(int NX, int NY, double Cellsize=0., double xMin=0., double yMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Data_Manager |
Add_Grid(const CSG_String &File) | CSG_Data_Manager | inline
Add_Grid(const char *File) | CSG_Data_Manager | inline
Add_Grid(const wchar_t *File) | CSG_Data_Manager | inline
Add_Grids(const CSG_String &File) | CSG_Data_Manager | inline
Add_Grids(const char *File) | CSG_Data_Manager | inline
Add_Grids(const wchar_t *File) | CSG_Data_Manager | inline
Add_PointCloud(void) | CSG_Data_Manager |
Add_PointCloud(const CSG_String &File) | CSG_Data_Manager | inline
Add_PointCloud(const char *File) | CSG_Data_Manager | inline
Add_PointCloud(const wchar_t *File) | CSG_Data_Manager | inline
Add_Shapes(TSG_Shape_Type Type=SHAPE_TYPE_Undefined) | CSG_Data_Manager |
Add_Shapes(const CSG_String &File) | CSG_Data_Manager | inline
Add_Shapes(const char *File) | CSG_Data_Manager | inline
Add_Shapes(const wchar_t *File) | CSG_Data_Manager | inline
Add_Table(void) | CSG_Data_Manager |
Add_Table(const CSG_String &File) | CSG_Data_Manager | inline
Add_Table(const char *File) | CSG_Data_Manager | inline
Add_Table(const wchar_t *File) | CSG_Data_Manager | inline
Add_TIN(void) | CSG_Data_Manager |
Add_TIN(const CSG_String &File) | CSG_Data_Manager | inline
Add_TIN(const char *File) | CSG_Data_Manager | inline
Add_TIN(const wchar_t *File) | CSG_Data_Manager | inline
asTIN(void) const | CSG_Data_Manager | inline
CSG_Data_Manager(void) | CSG_Data_Manager |
Delete(CSG_Data_Collection *pCollection, bool bDetach=false) | CSG_Data_Manager |
Delete(CSG_Data_Object *pObject, bool bDetach=false) | CSG_Data_Manager |
Delete(const CSG_Grid_System &System, bool bDetach=false) | CSG_Data_Manager |
Delete(bool bDetach=false, bool bUnsaved=false) | CSG_Data_Manager |
Delete_All(bool bDetach=false) | CSG_Data_Manager |
Delete_Unsaved(bool bDetach=false) | CSG_Data_Manager |
Exists(CSG_Data_Object *pObject) const | CSG_Data_Manager |
Exists(const CSG_Grid_System &System) const | CSG_Data_Manager |
Find(const CSG_String &File, bool bNative=true) const | CSG_Data_Manager |
Get_Grid_System(size_t i) const | CSG_Data_Manager | inline
Get_Grid_System(const CSG_Grid_System &System) const | CSG_Data_Manager |
Get_Point_Cloud(void) const | CSG_Data_Manager | inline
Get_Shapes(void) const | CSG_Data_Manager | inline
Get_Summary(void) const | CSG_Data_Manager |
Get_Table(void) const | CSG_Data_Manager | inline
Grid_System_Count(void) const | CSG_Data_Manager | inline
~CSG_Data_Manager(void) | CSG_Data_Manager | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Data_Object Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Data_Object Class Referenceabstract

#include <dataobject.h>

Inheritance diagram for CSG_Data_Object:
CSG_Grid CSG_Grids CSG_Table CSG_Shapes CSG_TIN CSG_PointCloud

Public Member Functions

CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
virtual bool | Destroy (void)
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. More...
virtual bool | is_Valid (void) const =0
virtual bool | Save (const CSG_String &File, int Format=0)=0
virtual bool | Save (const char *File, int Format=0)=0
virtual bool | Save (const wchar_t *File, int Format=0)=0
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
virtual bool | Assign (CSG_Data_Object *pObject)
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual void | Set_Modified (bool bOn=true)
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
virtual const CSG_Rect & | Get_Extent (void)=0
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Protected Member Functions

void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
virtual bool | On_Reload (void)=0
virtual bool | On_Delete (void)=0
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)
virtual bool | On_Update (void)
virtual bool | On_NoData_Changed (void)

Protected Attributes

CSG_Data_Object * m_pOwner

Detailed Description

CSG_Data_Object is the base class for all types of data sets, which are provided by the SAGA API.

See also
CSG_Table
CSG_Shapes
CSG_TIN
CSG_PointCloud
CSG_Grid
CSG_Grids

Definition at line 179 of file dataobject.h.

Constructor & Destructor Documentation

◆ CSG_Data_Object()

CSG_Data_Object::CSG_Data_Object ( void )

Definition at line 185 of file dataobject.cpp.

References CSG_MetaData::Add_Child(), CSG_String::Clear(), gSG_DataObject_Max_Samples, m_pOwner, CSG_MetaData::Set_Name(), SG_META_DATABASE, SG_META_HISTORY, and SG_META_SOURCE.

◆ ~CSG_Data_Object()

CSG_Data_Object::~CSG_Data_Object ( void )
virtual

Definition at line 212 of file dataobject.cpp.

References Destroy().

Member Function Documentation

◆ asGrid()

CSG_Grid * CSG_Data_Object::asGrid ( bool bPolymorph = false ) const

Definition at line 491 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_Grid.

◆ asGrids()

CSG_Grids * CSG_Data_Object::asGrids ( bool bPolymorph = false ) const

Definition at line 502 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_Grids.

Referenced by CSG_Parameter_Data_Object::_Serialize().

◆ asPointCloud()

CSG_PointCloud * CSG_Data_Object::asPointCloud ( bool bPolymorph = false ) const

Definition at line 480 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_PointCloud.

◆ asShapes()

CSG_Shapes * CSG_Data_Object::asShapes ( bool bPolymorph = false ) const

Definition at line 450 of file dataobject.cpp.

References Get_ObjectType(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

◆ Assign()

bool CSG_Data_Object::Assign ( CSG_Data_Object * pObject )
virtual

Reimplemented in CSG_Table, CSG_PointCloud, CSG_TIN, CSG_Shapes, CSG_Grids, and CSG_Grid.

Definition at line 734 of file dataobject.cpp.

◆ asTable()

CSG_Table * CSG_Data_Object::asTable ( bool bPolymorph = false ) const

Definition at line 428 of file dataobject.cpp.

References Get_ObjectType(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ asTIN()

CSG_TIN * CSG_Data_Object::asTIN ( bool bPolymorph = false ) const

Definition at line 469 of file dataobject.cpp.

References Get_ObjectType(), and SG_DATAOBJECT_TYPE_TIN.

◆ Delete()

bool CSG_Data_Object::Delete ( void )

Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success.

Definition at line 378 of file dataobject.cpp.

References CSG_MetaData::Destroy(), Get_ObjectType(), On_Delete(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, SG_File_Delete(), SG_File_Exists(), and SG_File_Set_Extension().

◆ Destroy()

bool CSG_Data_Object::Destroy ( void )
virtual

Reimplemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Definition at line 218 of file dataobject.cpp.

References CSG_String::Clear(), and CSG_MetaData::Destroy().

Referenced by CSG_Grid::Destroy(), CSG_Grids::Destroy(), CSG_PointCloud::Destroy(), CSG_Table::Destroy(), and ~CSG_Data_Object().

◆ Fmt_Name() [1/2]

void CSG_Data_Object::Fmt_Name | ( | const char * | Format,
 |  |  | ...
 | ) |  |

Definition at line 248 of file dataobject.cpp.

References Set_Name().

◆ Fmt_Name() [2/2]

void CSG_Data_Object::Fmt_Name | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |

Definition at line 267 of file dataobject.cpp.

References Set_Name().

◆ Get_Description()

const SG_Char * CSG_Data_Object::Get_Description ( void ) const

Definition at line 301 of file dataobject.cpp.

References CSG_String::is_Empty(), and m_pOwner.

Referenced by CSG_Grid_File_Info::Create(), CSG_Grid::Create(), CSG_Table::Create(), and Save_MetaData().

◆ Get_Extent()

virtual const CSG_Rect& CSG_Data_Object::Get_Extent ( void )
pure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_Grids, and CSG_Grid.

Referenced by CSG_Grid::is_InGrid_byPos(), and CSG_Grids::is_InGrid_byPos().

◆ Get_File_Name()

const SG_Char * CSG_Data_Object::Get_File_Name ( bool bNative = true ) const

Definition at line 331 of file dataobject.cpp.

References CSG_String::c_str(), Get_ObjectType(), m_pOwner, SG_DATAOBJECT_TYPE_Grids, and SG_T.

Referenced by CSG_Parameter_Data_Object::_Serialize(), CSG_Parameter_List::_Serialize(), Load_MetaData(), CSG_Grid::On_Delete(), CSG_Grids::On_Delete(), CSG_PointCloud::On_Delete(), CSG_Shapes::On_Delete(), CSG_Table::On_Delete(), CSG_Grid::On_Reload(), CSG_Grids::On_Reload(), CSG_PointCloud::On_Reload(), CSG_Shapes::On_Reload(), CSG_Table::On_Reload(), CSG_TIN::On_Reload(), CSG_Grid::Set_Cache(), and CSG_Parameters::Set_History().

◆ Get_File_Type()

int CSG_Data_Object::Get_File_Type ( void ) const

Definition at line 350 of file dataobject.cpp.

◆ Get_History() [1/2]

CSG_MetaData& CSG_Data_Object::Get_History ( void )
inline

Definition at line 227 of file dataobject.h.

Referenced by CSG_Shapes::Assign(), CSG_TIN::Assign(), CSG_PointCloud::Assign(), CSG_Grid::Assign(), CSG_TIN::Create(), CSG_Tool::DataObject_Set_History(), Save_History_to_Model(), and CSG_Parameters::Set_History().

◆ Get_History() [2/2]

const CSG_MetaData& CSG_Data_Object::Get_History ( void ) const
inline

Definition at line 228 of file dataobject.h.

◆ Get_Max_Samples()

sLong CSG_Data_Object::Get_Max_Samples ( void ) const
inline

Definition at line 254 of file dataobject.h.

Referenced by CSG_PointCloud::_Stats_Update(), CSG_Table::_Stats_Update(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), CSG_Grid::On_Update(), and CSG_Grids::On_Update().

◆ Get_MetaData()

CSG_MetaData& CSG_Data_Object::Get_MetaData ( void ) const
inline

Definition at line 225 of file dataobject.h.

Referenced by CSG_Table::Assign(), and CSG_Grid::Create().

◆ Get_MetaData_DB()

CSG_MetaData& CSG_Data_Object::Get_MetaData_DB ( void ) const
inline

Definition at line 226 of file dataobject.h.

Referenced by CSG_Grids::Create(), CSG_Table::Load(), and CSG_Table::Save().

◆ Get_Name()

const SG_Char * CSG_Data_Object::Get_Name ( void ) const

Definition at line 290 of file dataobject.cpp.

Referenced by CSG_Parameter_Fixed_Table::_Set_String(), CSG_Parameter_Data_Object::_Set_String(), CSG_Parameter_List::_Set_String(), CSG_Shapes::Assign(), CSG_TIN::Assign(), CSG_PointCloud::Assign(), CSG_Grid_File_Info::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_TIN::Create(), CSG_Tool::DataObject_Set_History(), CSG_Grids::Get_Grid_Name(), CSG_Data_Manager::Get_Summary(), CSG_TIN::Save(), and SG_Create_Shapes().

◆ Get_NoData_Value()

double CSG_Data_Object::Get_NoData_Value ( bool bUpper = false ) const
inline

Definition at line 244 of file dataobject.h.

Referenced by CSG_Grid::Assign_NoData(), CSG_Grid_File_Info::Create(), CSG_Grid::Create(), CSG_Grids::Create(), CSG_Table::Create(), CSG_Grid::Get_Quantile(), CSG_Grids::Get_Quantile(), CSG_Grid::Get_Value(), CSG_Grids::Get_Value(), CSG_PointCloud::Set_NoData(), CSG_Table_Record::Set_NoData(), CSG_Grid::Set_NoData(), CSG_Grids::Set_NoData(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_Data_Object::Get_ObjectType ( void ) const
pure virtual

Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Referenced by CSG_Parameter_Data_Object::_Serialize(), CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Grid_Collection::Add(), CSG_Data_Manager::Add(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), asGrid(), CSG_Parameter::asGrid(), asGrids(), CSG_Parameter::asGrids(), asPointCloud(), CSG_Parameter::asPointCloud(), asShapes(), CSG_Parameter::asShapes(), CSG_Grid::Assign(), CSG_Grids::Assign(), CSG_Shapes::Assign(), CSG_TIN::Assign(), CSG_PointCloud::Assign(), CSG_Table::Assign(), asTable(), CSG_Parameter::asTable(), asTIN(), CSG_Parameter::asTIN(), Delete(), CSG_Grid_Collection::Exists(), Get_File_Name(), CSG_Data_Manager::Get_Summary(), Load_MetaData(), Save_MetaData(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Owner()

CSG_Data_Object* CSG_Data_Object::Get_Owner ( void ) const
inline

Definition at line 222 of file dataobject.h.

Referenced by CSG_Parameter_Data_Object::_Serialize(), CSG_Grids::Del_Grids(), and SG_UI_DataObject_Update().

◆ Get_Projection() [1/2]

CSG_Projection & CSG_Data_Object::Get_Projection ( void )

Definition at line 578 of file dataobject.cpp.

References m_pOwner.

Referenced by CSG_Grids::Add_Grid(), CSG_Shapes::Assign(), CSG_PointCloud::Assign(), CSG_Grid::Assign(), CSG_Grid_File_Info::Create(), CSG_Grids::Create(), CSG_Grid::Create(), CSG_Grid_OGIS_Converter::from_WKBinary(), CSG_PointCloud::Save(), SG_Get_Projected(), SG_Grid_Get_Geographic_Coordinates(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_Projection() [2/2]

const CSG_Projection & CSG_Data_Object::Get_Projection ( void ) const

Definition at line 584 of file dataobject.cpp.

References m_pOwner.

◆ Get_Update_Flag()

bool CSG_Data_Object::Get_Update_Flag ( void )
inlineprotected

Definition at line 274 of file dataobject.h.

Referenced by On_NoData_Changed().

◆ is_File_Native()

bool CSG_Data_Object::is_File_Native ( void ) const
inline

Definition at line 206 of file dataobject.h.

◆ is_Modified()

virtual bool CSG_Data_Object::is_Modified ( void ) const
inlinevirtual

Reimplemented in CSG_Grids.

Definition at line 219 of file dataobject.h.

Referenced by CSG_Grids::is_Modified(), and CSG_Table::Set_Modified().

◆ is_NoData_Value()

bool CSG_Data_Object::is_NoData_Value ( double Value ) const
inline

Definition at line 246 of file dataobject.h.

References SG_is_NaN.

Referenced by CSG_PointCloud::_Stats_Update(), CSG_Histogram::Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), CSG_PointCloud::is_NoData(), CSG_Table_Record::is_NoData(), CSG_Grid::is_NoData(), CSG_Grids::is_NoData(), CSG_Grid::On_Update(), and CSG_Grids::On_Update().

◆ is_Valid()

virtual bool CSG_Data_Object::is_Valid ( void ) const
pure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Referenced by CSG_Data_Manager::Add(), CSG_Grid::Assign(), CSG_Shapes::Assign(), CSG_TIN::Assign(), CSG_PointCloud::Assign(), CSG_Table::Assign(), and CSG_Parameter_Data_Object::is_Valid().

◆ Load_MetaData() [1/2]

bool CSG_Data_Object::Load_MetaData ( const CSG_String & FileName )
protected

Definition at line 595 of file dataobject.cpp.

References Get_ObjectType(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, SG_File_Get_Extension(), SG_FILE_R, and SG_File_Set_Extension().

Referenced by CSG_Table::Load().

◆ Load_MetaData() [2/2]

bool CSG_Data_Object::Load_MetaData ( CSG_File & Stream )
protected

Definition at line 640 of file dataobject.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Assign(), CSG_MetaData::Del_Child(), CSG_MetaData::Destroy(), Get_File_Name(), CSG_MetaData::Load(), CSG_Projection::Load(), Set_Description(), SG_META_DATABASE, SG_META_FILEPATH, SG_META_HISTORY, SG_META_PROJECTION, and SG_META_SOURCE.

◆ On_Delete()

virtual bool CSG_Data_Object::On_Delete ( void )
protectedpure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Referenced by Delete().

◆ On_NoData_Changed()

bool CSG_Data_Object::On_NoData_Changed ( void )
protectedvirtual

Reimplemented in CSG_Table.

Definition at line 542 of file dataobject.cpp.

References Get_Update_Flag(), and Set_Update_Flag().

Referenced by CSG_Table::On_NoData_Changed(), and Set_NoData_Value_Range().

◆ On_Reload()

virtual bool CSG_Data_Object::On_Reload ( void )
protectedpure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Referenced by Reload().

◆ On_Update()

virtual bool CSG_Data_Object::On_Update ( void )
inlineprotectedvirtual

Reimplemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Definition at line 275 of file dataobject.h.

Referenced by CSG_Table::On_Update(), and Update().

◆ Reload()

bool CSG_Data_Object::Reload ( void )

If there is an associated file data can be reloaded with this command.

Definition at line 366 of file dataobject.cpp.

References On_Reload(), and SG_File_Exists().

◆ Save() [1/3]

virtual bool CSG_Data_Object::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
pure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

◆ Save() [2/3]

virtual bool CSG_Data_Object::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
pure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

◆ Save() [3/3]

virtual bool CSG_Data_Object::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
pure virtual

Implemented in CSG_TIN, CSG_Table, CSG_Shapes, CSG_PointCloud, CSG_Grids, and CSG_Grid.

◆ Save_History_to_Model()

bool CSG_Data_Object::Save_History_to_Model ( const CSG_String & File ) const

Definition at line 748 of file dataobject.cpp.

References Get_History(), and CSG_Tool_Chain::Save_History_to_Model().

◆ Save_MetaData() [1/2]

bool CSG_Data_Object::Save_MetaData ( const CSG_String & FileName )
protected

Definition at line 618 of file dataobject.cpp.

References Get_ObjectType(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, SG_File_Set_Extension(), and SG_FILE_W.

Referenced by CSG_Table::Save(), and CSG_PointCloud::Save().

◆ Save_MetaData() [2/2]

bool CSG_Data_Object::Save_MetaData ( CSG_File & Stream )
protected

Definition at line 687 of file dataobject.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Del_Child(), Get_Description(), CSG_Projection::Get_Type(), CSG_MetaData::Save(), CSG_Projection::Save(), CSG_MetaData::Set_Content(), SG_META_FILEPATH, SG_META_PROJECTION, and SG_PROJ_TYPE_CS_Undefined.

◆ Set_Description()

void CSG_Data_Object::Set_Description ( const CSG_String & Description )

Definition at line 296 of file dataobject.cpp.

Referenced by CSG_Grid::Create(), CSG_Table::Create(), and Load_MetaData().

◆ Set_File_Name() [1/2]

void CSG_Data_Object::Set_File_Name ( const CSG_String & FileName )

Definition at line 307 of file dataobject.cpp.

Referenced by CSG_TIN::Create(), CSG_Table::Create(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), and CSG_TIN::Save().

◆ Set_File_Name() [2/2]

void CSG_Data_Object::Set_File_Name | ( | const CSG_String & | FileName,
 |  | bool | bNative
 | ) |  |
protected

Definition at line 313 of file dataobject.cpp.

References CSG_String::Clear(), CSG_String::is_Empty(), and SG_File_Get_Name().

◆ Set_File_Type()

void CSG_Data_Object::Set_File_Type ( int Type )
inlineprotected

Definition at line 263 of file dataobject.h.

Referenced by CSG_Table::Save().

◆ Set_Max_Samples()

bool CSG_Data_Object::Set_Max_Samples ( sLong Max_Samples )
virtual

Reimplemented in CSG_Grids.

Definition at line 558 of file dataobject.cpp.

References Min_Samples, and Update().

Referenced by CSG_Grid::Create(), and CSG_Grids::Set_Max_Samples().

◆ Set_Modified()

virtual void CSG_Data_Object::Set_Modified ( bool bOn = true )
inlinevirtual

Reimplemented in CSG_Table, CSG_PointCloud, CSG_Grids, and CSG_Grid.

Definition at line 218 of file dataobject.h.

Referenced by CSG_Grid::Set_Modified(), CSG_Grids::Set_Modified(), CSG_PointCloud::Set_Modified(), CSG_Table::Set_Modified(), Set_NoData_Value_Range(), and CSG_Grid::Set_Value().

◆ Set_Name()

void CSG_Data_Object::Set_Name ( const CSG_String & Name )

Definition at line 235 of file dataobject.cpp.

References _TL, and CSG_String::is_Empty().

Referenced by CSG_Parameters::Add_FixedTable(), CSG_TIN::Assign(), CSG_PointCloud::Assign(), CSG_Grid::Create(), CSG_Table::Create(), CSG_TIN::Create(), CSG_Shapes::Create(), CSG_Parameter_Fixed_Table::CSG_Parameter_Fixed_Table(), Fmt_Name(), CSG_Grids::Load(), CSG_Table::Load(), and CSG_Grids::Update_Z_Order().

◆ Set_NoData_Value()

bool CSG_Data_Object::Set_NoData_Value ( double Value )
virtual

Definition at line 513 of file dataobject.cpp.

References Set_NoData_Value_Range().

Referenced by CSG_PointCloud::_On_Construction(), and CSG_Grid_OGIS_Converter::from_WKBinary().

◆ Set_NoData_Value_Range()

bool CSG_Data_Object::Set_NoData_Value_Range | ( | double | Lower,
 |  | double | Upper
 | ) |  |
virtual

Reimplemented in CSG_Grids.

Definition at line 519 of file dataobject.cpp.

References On_NoData_Changed(), and Set_Modified().

Referenced by CSG_Grid::Create(), CSG_Table::Create(), Set_NoData_Value(), and CSG_Grids::Set_NoData_Value_Range().

◆ Set_Owner()

void CSG_Data_Object::Set_Owner ( CSG_Data_Object * pOwner )
inline

Definition at line 223 of file dataobject.h.

Referenced by CSG_Grids::Del_Grid(), and CSG_Grids::Del_Grids().

◆ Set_Update_Flag()

void CSG_Data_Object::Set_Update_Flag ( bool bOn = true )
inlineprotected

Definition at line 273 of file dataobject.h.

Referenced by CSG_PointCloud::_On_Construction(), CSG_Table::_On_Construction(), CSG_PointCloud::Add_Point(), CSG_Grid::Assign(), CSG_Shapes::Create(), CSG_TIN::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_PointCloud::Del_Point(), CSG_PointCloud::Del_Points(), CSG_Table::Del_Record(), CSG_PointCloud::Del_Selection(), CSG_Table::Ins_Record(), On_NoData_Changed(), CSG_Table::Save(), CSG_Grid::Set_Modified(), CSG_Grids::Set_Modified(), CSG_Table_Record::Set_NoData(), CSG_Grids::Set_Scaling(), CSG_Grid::Set_Scaling(), and CSG_Table_Record::Set_Value().

◆ Update()

bool CSG_Data_Object::Update ( bool bForce = false )

Definition at line 714 of file dataobject.cpp.

References On_Update().

Referenced by CSG_TIN::Add_Node(), CSG_TIN::Create(), CSG_TIN::Del_Node(), CSG_Grid::Get_Data_Count(), CSG_Grids::Get_Data_Count(), CSG_Shapes::Get_Extent(), CSG_TIN::Get_Extent(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Max(), CSG_Grids::Get_Max(), CSG_Grid::Get_Mean(), CSG_Grids::Get_Mean(), CSG_Grid::Get_Min(), CSG_Grids::Get_Min(), CSG_Shapes::Get_MMax(), CSG_Shapes::Get_MMin(), CSG_Grid::Get_NoData_Count(), CSG_Grids::Get_NoData_Count(), CSG_Grid::Get_Range(), CSG_Grids::Get_Range(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), CSG_Grid::Get_StdDev(), CSG_Grids::Get_StdDev(), CSG_Grid::Get_Variance(), CSG_Grids::Get_Variance(), CSG_Shapes::Get_ZMax(), CSG_Shapes::Get_ZMin(), and Set_Max_Samples().

Member Data Documentation

◆ m_pOwner

CSG_Data_Object* CSG_Data_Object::m_pOwner
protected

Definition at line 259 of file dataobject.h.

Referenced by CSG_Data_Object(), Get_Description(), Get_File_Name(), and Get_Projection().

The documentation for this class was generated from the following files:
  • dataobject.h
  • dataobject.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Data_Object Member List

This is the complete list of members for CSG_Data_Object, including all inherited members.

asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
Assign(CSG_Data_Object *pObject) | CSG_Data_Object | virtual
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
CSG_Data_Object(void) | CSG_Data_Object |
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_Data_Object | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void)=0 | CSG_Data_Object | pure virtual
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Name(void) const | CSG_Data_Object |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_ObjectType(void) const =0 | CSG_Data_Object | pure virtual
Get_Owner(void) const | CSG_Data_Object | inline
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
is_File_Native(void) const | CSG_Data_Object | inline
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Valid(void) const =0 | CSG_Data_Object | pure virtual
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_pOwner | CSG_Data_Object | protected
On_Delete(void)=0 | CSG_Data_Object | protectedpure virtual
On_NoData_Changed(void) | CSG_Data_Object | protectedvirtual
On_Reload(void)=0 | CSG_Data_Object | protectedpure virtual
On_Update(void) | CSG_Data_Object | inlineprotectedvirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format=0)=0 | CSG_Data_Object | pure virtual
Save(const char *File, int Format=0)=0 | CSG_Data_Object | pure virtual
Save(const wchar_t *File, int Format=0)=0 | CSG_Data_Object | pure virtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bOn=true) | CSG_Data_Object | inlinevirtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_DateTime Class Reference

Public Types | Public Member Functions | Static Public Member Functions | List of all members
CSG_DateTime Class Reference

#include <datetime.h>

Public Types

enum Month {
Jan, Feb, Mar, Apr,
May, Jun, Jul, Aug,
Sep, Oct, Nov, Dec,
Inv_Month
}
enum WeekDay {
Sun, Mon, Tue, Wed,
Thu, Fri, Sat, Inv_WeekDay
}
enum | Year { Inv_Year = -32768 }
enum | NameFlags { Name_Full = 0x01, Name_Abbr = 0x02 }
typedef unsigned short | TSG_DateTime

Public Member Functions

CSG_DateTime (void)
CSG_DateTime (const CSG_DateTime &DateTime)
CSG_DateTime (const CSG_String &ISODate)
CSG_DateTime (double JDN)
CSG_DateTime (TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0)
CSG_DateTime (TSG_DateTime Day, Month Month, int Year=Inv_Year, TSG_DateTime Hour=0, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0)
virtual | ~CSG_DateTime (void)
CSG_DateTime & | Set (const CSG_DateTime &DateTime)
CSG_DateTime & | Set (const CSG_String &ISODate)
CSG_DateTime & | Set (double JDN)
CSG_DateTime & | Set (TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0)
CSG_DateTime & | Set (TSG_DateTime Day, Month Month, int Year=Inv_Year, TSG_DateTime Hour=0, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0)
CSG_DateTime & | Set_Millisecond (unsigned short Value)
CSG_DateTime & | Set_Second (unsigned short Value)
CSG_DateTime & | Set_Minute (unsigned short Value)
CSG_DateTime & | Set_Hour (unsigned short Value)
CSG_DateTime & | Set_Hour (double Value)
CSG_DateTime & | Set_Day (unsigned short Value)
CSG_DateTime & | Set_Month (unsigned short Value)
CSG_DateTime & | Set_Year (int Value)
CSG_DateTime & | Set_DayOfYear (unsigned short Value)
CSG_DateTime & | Set_To_Current (void)
CSG_DateTime & | Set_Unix_Time (sLong Seconds)
CSG_DateTime & | Set_Hours_AD (int Hours)
CSG_DateTime & | Reset_Time (void)
CSG_DateTime | From_UTC (bool noDST=false) const
CSG_DateTime | To_UTC (bool noDST=false) const
CSG_DateTime & | Make_UTC (bool noDST=false)
bool | is_DST (void) const
CSG_DateTime | Add (const CSG_TimeSpan &TimeSpan) const
CSG_DateTime & | Add (const CSG_TimeSpan &TimeSpan)
CSG_DateTime | Subtract (const CSG_TimeSpan &TimeSpan) const
CSG_DateTime & | Subtract (const CSG_TimeSpan &TimeSpan)
CSG_TimeSpan | Subtract (const CSG_DateTime &DateTime) const
bool | is_Valid (void) const
sLong | Get_Value (void) const
unsigned short | Get_Millisecond (void) const
unsigned short | Get_Second (void) const
unsigned short | Get_Minute (void) const
unsigned short | Get_Hour (void) const
unsigned short | Get_Day (void) const
Month | Get_Month (void) const
int | Get_Year (void) const
unsigned short | Get_DayOfYear (void) const
WeekDay | Get_WeekDay (void) const
TSG_DateTime | Get_WeekOfMonth (void) const
TSG_DateTime | Get_WeekOfYear (void) const
double | Get_JDN (void) const
double | Get_MJD (void) const
bool | is_EarlierThan (const CSG_DateTime &DateTime) const
bool | is_EqualTo (const CSG_DateTime &DateTime) const
bool | is_LaterThan (const CSG_DateTime &DateTime) const
bool | is_SameDate (const CSG_DateTime &DateTime) const
bool | is_SameTime (const CSG_DateTime &DateTime) const
bool | is_Between (const CSG_DateTime &t1, const CSG_DateTime &t2) const
bool | is_StrictlyBetween (const CSG_DateTime &t1, const CSG_DateTime &t2) const
CSG_DateTime & | operator= (const CSG_DateTime &DateTime)
CSG_DateTime & | operator= (double JDN)
CSG_DateTime & | operator+= (const CSG_TimeSpan &TimeSpan)
CSG_DateTime & | operator-= (const CSG_TimeSpan &TimeSpan)
CSG_DateTime | operator+ (const CSG_TimeSpan &TimeSpan) const
CSG_DateTime | operator- (const CSG_TimeSpan &TimeSpan) const
CSG_TimeSpan | operator- (const CSG_DateTime &DateTime) const
bool | operator< (const CSG_DateTime &DateTime) const
bool | operator<= (const CSG_DateTime &DateTime) const
bool | operator== (const CSG_DateTime &DateTime) const
bool | operator>= (const CSG_DateTime &DateTime) const
bool | operator> (const CSG_DateTime &DateTime) const
CSG_String | Format (const CSG_String &Format="") const
CSG_String | Format_Date (void) const
CSG_String | Format_Time (void) const
CSG_String | Format_ISODate (void) const
CSG_String | Format_ISOTime (void) const
CSG_String | Format_ISOCombined (char sep='T') const
bool | Parse_Date (const CSG_String &date)
bool | Parse_DateTime (const CSG_String &datetime)
bool | Parse_Format (const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef)
bool | Parse_Format (const CSG_String &date, const CSG_String &format)
bool | Parse_Format (const CSG_String &date)
bool | Parse_ISOCombined (const CSG_String &date, char sep='T')
bool | Parse_ISODate (const CSG_String &date)
bool | Parse_ISOTime (const CSG_String &date)

Static Public Member Functions

static TSG_DateTime | Get_Current_Day (void)
static Month | Get_Current_Month (void)
static int | Get_Current_Year (void)
static CSG_String | Get_MonthName (Month month, NameFlags flags=Name_Full)
static CSG_String | Get_EnglishMonthName (Month month, NameFlags flags=Name_Full)
static CSG_String | Get_WeekDayName (WeekDay weekday, NameFlags flags=Name_Full)
static CSG_String | Get_EnglishWeekDayName (WeekDay weekday, NameFlags flags=Name_Full)
static TSG_DateTime | Get_NumberOfDays (int year)
static TSG_DateTime | Get_NumberOfDays (Month month, int year=Inv_Year)
static bool | is_LeapYear (int year=Inv_Year)
static CSG_DateTime | Now (void)
static CSG_String | Get_Month_Choices (void)

Detailed Description

Definition at line 182 of file datetime.h.

Member Typedef Documentation

◆ TSG_DateTime

typedef unsigned short CSG_DateTime::TSG_DateTime

Definition at line 189 of file datetime.h.

Member Enumeration Documentation

◆ Month

enum CSG_DateTime::Month
Enumerator
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Inv_Month

Definition at line 195 of file datetime.h.

◆ NameFlags

enum CSG_DateTime::NameFlags
Enumerator
Name_Full
Name_Abbr

Definition at line 210 of file datetime.h.

◆ WeekDay

enum CSG_DateTime::WeekDay
Enumerator
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Inv_WeekDay

Definition at line 200 of file datetime.h.

◆ Year

enum CSG_DateTime::Year
Enumerator
Inv_Year

Definition at line 205 of file datetime.h.

Constructor & Destructor Documentation

◆ CSG_DateTime() [1/6]

CSG_DateTime::CSG_DateTime ( void )

Definition at line 82 of file datetime.cpp.

Referenced by From_UTC(), and To_UTC().

◆ CSG_DateTime() [2/6]

CSG_DateTime::CSG_DateTime ( const CSG_DateTime & DateTime )

Definition at line 88 of file datetime.cpp.

◆ CSG_DateTime() [3/6]

CSG_DateTime::CSG_DateTime ( const CSG_String & ISODate )

Definition at line 100 of file datetime.cpp.

References Set().

◆ CSG_DateTime() [4/6]

CSG_DateTime::CSG_DateTime ( double JDN )

Definition at line 94 of file datetime.cpp.

◆ CSG_DateTime() [5/6]

CSG_DateTime::CSG_DateTime | ( | TSG_DateTime | Hour,
 |  | TSG_DateTime | Minute = 0,
 |  | TSG_DateTime | Second = 0,
 |  | TSG_DateTime | Millisec = 0
 | ) |  |

Definition at line 108 of file datetime.cpp.

◆ CSG_DateTime() [6/6]

CSG_DateTime::CSG_DateTime | ( | TSG_DateTime | Day,
 |  | Month | Month,
 |  | int | Year = Inv_Year,
 |  | TSG_DateTime | Hour = 0,
 |  | TSG_DateTime | Minute = 0,
 |  | TSG_DateTime | Second = 0,
 |  | TSG_DateTime | Millisec = 0
 | ) |  |

Definition at line 114 of file datetime.cpp.

◆ ~CSG_DateTime()

CSG_DateTime::~CSG_DateTime ( void )
virtual

Definition at line 120 of file datetime.cpp.

Member Function Documentation

◆ Add() [1/2]

CSG_DateTime & CSG_DateTime::Add ( const CSG_TimeSpan & TimeSpan )

Definition at line 331 of file datetime.cpp.

◆ Add() [2/2]

CSG_DateTime CSG_DateTime::Add ( const CSG_TimeSpan & TimeSpan ) const

Definition at line 324 of file datetime.cpp.

References Add().

Referenced by Add(), and CSG_TimeSpan::operator+=().

◆ Format()

CSG_String CSG_DateTime::Format ( const CSG_String & Format = "" ) const

Definition at line 445 of file datetime.cpp.

References CSG_String::c_str().

◆ Format_Date()

CSG_String CSG_DateTime::Format_Date ( void ) const

Definition at line 450 of file datetime.cpp.

◆ Format_ISOCombined()

CSG_String CSG_DateTime::Format_ISOCombined ( char sep = 'T' ) const

Definition at line 470 of file datetime.cpp.

◆ Format_ISODate()

CSG_String CSG_DateTime::Format_ISODate ( void ) const

Definition at line 460 of file datetime.cpp.

Referenced by CSG_Parameter_Date::_Set_String().

◆ Format_ISOTime()

CSG_String CSG_DateTime::Format_ISOTime ( void ) const

Definition at line 465 of file datetime.cpp.

◆ Format_Time()

CSG_String CSG_DateTime::Format_Time ( void ) const

Definition at line 455 of file datetime.cpp.

◆ From_UTC()

CSG_DateTime CSG_DateTime::From_UTC ( bool noDST = false ) const

Definition at line 280 of file datetime.cpp.

References CSG_DateTime().

◆ Get_Current_Day()

CSG_DateTime::TSG_DateTime CSG_DateTime::Get_Current_Day ( void )
static

Definition at line 523 of file datetime.cpp.

References Get_Day(), Now(), and Set_To_Current().

◆ Get_Current_Month()

CSG_DateTime::Month CSG_DateTime::Get_Current_Month ( void )
static

Definition at line 532 of file datetime.cpp.

◆ Get_Current_Year()

int CSG_DateTime::Get_Current_Year ( void )
static

Definition at line 537 of file datetime.cpp.

◆ Get_Day()

unsigned short CSG_DateTime::Get_Day ( void ) const

Definition at line 377 of file datetime.cpp.

Referenced by Get_Current_Day(), and CSG_Table_DBase::Set_Value().

◆ Get_DayOfYear()

unsigned short CSG_DateTime::Get_DayOfYear ( void ) const

Definition at line 390 of file datetime.cpp.

Referenced by SG_Get_Day_Length().

◆ Get_EnglishMonthName()

CSG_String CSG_DateTime::Get_EnglishMonthName | ( | Month | month,
 |  | NameFlags | flags = Name_Full
 | ) |  |
static

Definition at line 548 of file datetime.cpp.

◆ Get_EnglishWeekDayName()

CSG_String CSG_DateTime::Get_EnglishWeekDayName | ( | WeekDay | weekday,
 |  | NameFlags | flags = Name_Full
 | ) |  |
static

Definition at line 558 of file datetime.cpp.

◆ Get_Hour()

unsigned short CSG_DateTime::Get_Hour ( void ) const

Definition at line 376 of file datetime.cpp.

◆ Get_JDN()

double CSG_DateTime::Get_JDN ( void ) const

Definition at line 411 of file datetime.cpp.

Referenced by CSG_Parameter_Date::_asDouble(), CSG_Parameters::Add_Date(), and SG_Get_Sun_Position().

◆ Get_Millisecond()

unsigned short CSG_DateTime::Get_Millisecond ( void ) const

Definition at line 373 of file datetime.cpp.

◆ Get_Minute()

unsigned short CSG_DateTime::Get_Minute ( void ) const

Definition at line 375 of file datetime.cpp.

◆ Get_MJD()

double CSG_DateTime::Get_MJD ( void ) const

Definition at line 416 of file datetime.cpp.

◆ Get_Month()

CSG_DateTime::Month CSG_DateTime::Get_Month ( void ) const

Definition at line 379 of file datetime.cpp.

Referenced by CSG_Table_DBase::Set_Value().

◆ Get_Month_Choices()

CSG_String CSG_DateTime::Get_Month_Choices ( void )
static

Definition at line 656 of file datetime.cpp.

References _TL, and CSG_String::Printf().

◆ Get_MonthName()

CSG_String CSG_DateTime::Get_MonthName | ( | Month | month,
 |  | NameFlags | flags = Name_Full
 | ) |  |
static

Definition at line 543 of file datetime.cpp.

◆ Get_NumberOfDays() [1/2]

CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays ( int year )
static

Definition at line 564 of file datetime.cpp.

◆ Get_NumberOfDays() [2/2]

CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays | ( | Month | month,
 |  | int | year = Inv_Year
 | ) |  |
static

Definition at line 569 of file datetime.cpp.

◆ Get_Second()

unsigned short CSG_DateTime::Get_Second ( void ) const

Definition at line 374 of file datetime.cpp.

◆ Get_Value()

sLong CSG_DateTime::Get_Value ( void ) const

Definition at line 313 of file datetime.cpp.

Referenced by operator<(), operator<=(), operator==(), operator>(), and operator>=().

◆ Get_WeekDay()

CSG_DateTime::WeekDay CSG_DateTime::Get_WeekDay ( void ) const

Definition at line 395 of file datetime.cpp.

◆ Get_WeekDayName()

CSG_String CSG_DateTime::Get_WeekDayName | ( | WeekDay | weekday,
 |  | NameFlags | flags = Name_Full
 | ) |  |
static

Definition at line 553 of file datetime.cpp.

◆ Get_WeekOfMonth()

CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfMonth ( void ) const

Definition at line 400 of file datetime.cpp.

◆ Get_WeekOfYear()

CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfYear ( void ) const

Definition at line 405 of file datetime.cpp.

◆ Get_Year()

int CSG_DateTime::Get_Year ( void ) const

Definition at line 384 of file datetime.cpp.

Referenced by CSG_Table_DBase::Set_Value().

◆ is_Between()

bool CSG_DateTime::is_Between | ( | const CSG_DateTime & | t1,
 |  | const CSG_DateTime & | t2
 | ) |  | const

Definition at line 436 of file datetime.cpp.

◆ is_DST()

bool CSG_DateTime::is_DST ( void ) const

Definition at line 302 of file datetime.cpp.

◆ is_EarlierThan()

bool CSG_DateTime::is_EarlierThan ( const CSG_DateTime & DateTime ) const

Definition at line 427 of file datetime.cpp.

◆ is_EqualTo()

bool CSG_DateTime::is_EqualTo ( const CSG_DateTime & DateTime ) const

Definition at line 428 of file datetime.cpp.

Referenced by CSG_Parameter_Date::_Set_Value().

◆ is_LaterThan()

bool CSG_DateTime::is_LaterThan ( const CSG_DateTime & DateTime ) const

Definition at line 429 of file datetime.cpp.

◆ is_LeapYear()

bool CSG_DateTime::is_LeapYear ( int year = Inv_Year )
static

Definition at line 575 of file datetime.cpp.

◆ is_SameDate()

bool CSG_DateTime::is_SameDate ( const CSG_DateTime & DateTime ) const

Definition at line 432 of file datetime.cpp.

◆ is_SameTime()

bool CSG_DateTime::is_SameTime ( const CSG_DateTime & DateTime ) const

Definition at line 433 of file datetime.cpp.

◆ is_StrictlyBetween()

bool CSG_DateTime::is_StrictlyBetween | ( | const CSG_DateTime & | t1,
 |  | const CSG_DateTime & | t2
 | ) |  | const

Definition at line 437 of file datetime.cpp.

◆ is_Valid()

bool CSG_DateTime::is_Valid ( void ) const

Definition at line 367 of file datetime.cpp.

◆ Make_UTC()

CSG_DateTime & CSG_DateTime::Make_UTC ( bool noDST = false )

Definition at line 294 of file datetime.cpp.

◆ Now()

CSG_DateTime CSG_DateTime::Now ( void )
static

Definition at line 581 of file datetime.cpp.

Referenced by CSG_Parameters::Add_Date(), CSG_Parameter_Date::CSG_Parameter_Date(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), CSG_Tool_Interactive_Base::Execute_Position(), and Get_Current_Day().

◆ operator+()

CSG_DateTime CSG_DateTime::operator+ ( const CSG_TimeSpan & TimeSpan ) const
inline

Definition at line 316 of file datetime.h.

◆ operator+=()

CSG_DateTime& CSG_DateTime::operator+= ( const CSG_TimeSpan & TimeSpan )
inline

Definition at line 313 of file datetime.h.

◆ operator-() [1/2]

CSG_TimeSpan CSG_DateTime::operator- ( const CSG_DateTime & DateTime ) const
inline

Definition at line 319 of file datetime.h.

◆ operator-() [2/2]

CSG_DateTime CSG_DateTime::operator- ( const CSG_TimeSpan & TimeSpan ) const
inline

Definition at line 317 of file datetime.h.

◆ operator-=()

CSG_DateTime& CSG_DateTime::operator-= ( const CSG_TimeSpan & TimeSpan )
inline

Definition at line 314 of file datetime.h.

◆ operator<()

bool CSG_DateTime::operator< ( const CSG_DateTime & DateTime ) const
inline

Definition at line 321 of file datetime.h.

References Get_Value().

◆ operator<=()

bool CSG_DateTime::operator<= ( const CSG_DateTime & DateTime ) const
inline

Definition at line 322 of file datetime.h.

References Get_Value().

◆ operator=() [1/2]

CSG_DateTime& CSG_DateTime::operator= ( const CSG_DateTime & DateTime )
inline

Definition at line 310 of file datetime.h.

◆ operator=() [2/2]

CSG_DateTime& CSG_DateTime::operator= ( double JDN )
inline

Definition at line 311 of file datetime.h.

◆ operator==()

bool CSG_DateTime::operator== ( const CSG_DateTime & DateTime ) const
inline

Definition at line 323 of file datetime.h.

References Get_Value().

◆ operator>()

bool CSG_DateTime::operator> ( const CSG_DateTime & DateTime ) const
inline

Definition at line 325 of file datetime.h.

References Get_Value().

◆ operator>=()

bool CSG_DateTime::operator>= ( const CSG_DateTime & DateTime ) const
inline

Definition at line 324 of file datetime.h.

References Get_Value().

◆ Parse_Date()

bool CSG_DateTime::Parse_Date ( const CSG_String & date )

Definition at line 476 of file datetime.cpp.

References CSG_String::c_str().

Referenced by CSG_Parameter_Date::_Set_Value().

◆ Parse_DateTime()

bool CSG_DateTime::Parse_DateTime ( const CSG_String & datetime )

Definition at line 481 of file datetime.cpp.

References CSG_String::c_str().

◆ Parse_Format() [1/3]

bool CSG_DateTime::Parse_Format ( const CSG_String & date )

Definition at line 496 of file datetime.cpp.

References CSG_String::c_str().

◆ Parse_Format() [2/3]

bool CSG_DateTime::Parse_Format | ( | const CSG_String & | date,
 |  | const CSG_String & | format
 | ) |  |

Definition at line 491 of file datetime.cpp.

References CSG_String::c_str().

◆ Parse_Format() [3/3]

bool CSG_DateTime::Parse_Format | ( | const CSG_String & | date,
 |  | const CSG_String & | format,
 |  | const CSG_DateTime & | dateDef
 | ) |  |

Definition at line 486 of file datetime.cpp.

References CSG_String::c_str().

◆ Parse_ISOCombined()

bool CSG_DateTime::Parse_ISOCombined | ( | const CSG_String & | date,
 |  | char | sep = 'T'
 | ) |  |

Definition at line 502 of file datetime.cpp.

References CSG_String::c_str().

◆ Parse_ISODate()

bool CSG_DateTime::Parse_ISODate ( const CSG_String & date )

Definition at line 507 of file datetime.cpp.

References CSG_String::c_str().

Referenced by CSG_Parameter_Date::_Set_Value().

◆ Parse_ISOTime()

bool CSG_DateTime::Parse_ISOTime ( const CSG_String & date )

Definition at line 512 of file datetime.cpp.

References CSG_String::c_str().

◆ Reset_Time()

CSG_DateTime & CSG_DateTime::Reset_Time ( void )

Definition at line 267 of file datetime.cpp.

◆ Set() [1/5]

CSG_DateTime & CSG_DateTime::Set ( const CSG_DateTime & DateTime )

Definition at line 131 of file datetime.cpp.

Referenced by CSG_Parameter_Date::_Set_Value(), CSG_DateTime(), Set(), Set_Hours_AD(), and Set_Unix_Time().

◆ Set() [2/5]

CSG_DateTime & CSG_DateTime::Set ( const CSG_String & ISODate )

Definition at line 147 of file datetime.cpp.

References CSG_String::asInt(), CSG_String::Left(), CSG_String::Length(), CSG_String::Mid(), CSG_String::Right(), and Set().

◆ Set() [3/5]

CSG_DateTime & CSG_DateTime::Set ( double JDN )

Definition at line 139 of file datetime.cpp.

◆ Set() [4/5]

CSG_DateTime & CSG_DateTime::Set | ( | TSG_DateTime | Day,
 |  | Month | Month,
 |  | int | Year = Inv_Year,
 |  | TSG_DateTime | Hour = 0,
 |  | TSG_DateTime | Minute = 0,
 |  | TSG_DateTime | Second = 0,
 |  | TSG_DateTime | Millisec = 0
 | ) |  |

Definition at line 173 of file datetime.cpp.

◆ Set() [5/5]

CSG_DateTime & CSG_DateTime::Set | ( | TSG_DateTime | Hour,
 |  | TSG_DateTime | Minute = 0,
 |  | TSG_DateTime | Second = 0,
 |  | TSG_DateTime | Millisec = 0
 | ) |  |

Definition at line 165 of file datetime.cpp.

◆ Set_Day()

CSG_DateTime & CSG_DateTime::Set_Day ( unsigned short Value )

Definition at line 227 of file datetime.cpp.

◆ Set_DayOfYear()

CSG_DateTime & CSG_DateTime::Set_DayOfYear ( unsigned short Value )

Definition at line 251 of file datetime.cpp.

◆ Set_Hour() [1/2]

CSG_DateTime & CSG_DateTime::Set_Hour ( double Value )

Definition at line 212 of file datetime.cpp.

◆ Set_Hour() [2/2]

CSG_DateTime & CSG_DateTime::Set_Hour ( unsigned short Value )

Definition at line 205 of file datetime.cpp.

◆ Set_Hours_AD()

CSG_DateTime & CSG_DateTime::Set_Hours_AD ( int Hours )

Definition at line 611 of file datetime.cpp.

References Set().

◆ Set_Millisecond()

CSG_DateTime & CSG_DateTime::Set_Millisecond ( unsigned short Value )

Definition at line 181 of file datetime.cpp.

◆ Set_Minute()

CSG_DateTime & CSG_DateTime::Set_Minute ( unsigned short Value )

Definition at line 197 of file datetime.cpp.

◆ Set_Month()

CSG_DateTime & CSG_DateTime::Set_Month ( unsigned short Value )

Definition at line 235 of file datetime.cpp.

◆ Set_Second()

CSG_DateTime & CSG_DateTime::Set_Second ( unsigned short Value )

Definition at line 189 of file datetime.cpp.

◆ Set_To_Current()

CSG_DateTime & CSG_DateTime::Set_To_Current ( void )

Definition at line 259 of file datetime.cpp.

Referenced by Get_Current_Day().

◆ Set_Unix_Time()

CSG_DateTime & CSG_DateTime::Set_Unix_Time ( sLong Seconds )

Definition at line 594 of file datetime.cpp.

References Set().

◆ Set_Year()

CSG_DateTime & CSG_DateTime::Set_Year ( int Value )

Definition at line 243 of file datetime.cpp.

◆ Subtract() [1/3]

CSG_TimeSpan CSG_DateTime::Subtract ( const CSG_DateTime & DateTime ) const

Definition at line 354 of file datetime.cpp.

◆ Subtract() [2/3]

CSG_DateTime & CSG_DateTime::Subtract ( const CSG_TimeSpan & TimeSpan )

Definition at line 346 of file datetime.cpp.

◆ Subtract() [3/3]

CSG_DateTime CSG_DateTime::Subtract ( const CSG_TimeSpan & TimeSpan ) const

Definition at line 339 of file datetime.cpp.

References Subtract().

Referenced by CSG_TimeSpan::operator-=(), and Subtract().

◆ To_UTC()

CSG_DateTime CSG_DateTime::To_UTC ( bool noDST = false ) const

Definition at line 288 of file datetime.cpp.

References CSG_DateTime().

The documentation for this class was generated from the following files:
  • datetime.h
  • datetime.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_DateTime Member List

This is the complete list of members for CSG_DateTime, including all inherited members.

Add(const CSG_TimeSpan &TimeSpan) const | CSG_DateTime |
Add(const CSG_TimeSpan &TimeSpan) | CSG_DateTime |
Apr enum value | CSG_DateTime |
Aug enum value | CSG_DateTime |
CSG_DateTime(void) | CSG_DateTime |
CSG_DateTime(const CSG_DateTime &DateTime) | CSG_DateTime |
CSG_DateTime(const CSG_String &ISODate) | CSG_DateTime |
CSG_DateTime(double JDN) | CSG_DateTime |
CSG_DateTime(TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) | CSG_DateTime |
CSG_DateTime(TSG_DateTime Day, Month Month, int Year=Inv_Year, TSG_DateTime Hour=0, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) | CSG_DateTime |
Dec enum value | CSG_DateTime |
Feb enum value | CSG_DateTime |
Format(const CSG_String &Format="") const | CSG_DateTime |
Format_Date(void) const | CSG_DateTime |
Format_ISOCombined(char sep='T') const | CSG_DateTime |
Format_ISODate(void) const | CSG_DateTime |
Format_ISOTime(void) const | CSG_DateTime |
Format_Time(void) const | CSG_DateTime |
Fri enum value | CSG_DateTime |
From_UTC(bool noDST=false) const | CSG_DateTime |
Get_Current_Day(void) | CSG_DateTime | static
Get_Current_Month(void) | CSG_DateTime | static
Get_Current_Year(void) | CSG_DateTime | static
Get_Day(void) const | CSG_DateTime |
Get_DayOfYear(void) const | CSG_DateTime |
Get_EnglishMonthName(Month month, NameFlags flags=Name_Full) | CSG_DateTime | static
Get_EnglishWeekDayName(WeekDay weekday, NameFlags flags=Name_Full) | CSG_DateTime | static
Get_Hour(void) const | CSG_DateTime |
Get_JDN(void) const | CSG_DateTime |
Get_Millisecond(void) const | CSG_DateTime |
Get_Minute(void) const | CSG_DateTime |
Get_MJD(void) const | CSG_DateTime |
Get_Month(void) const | CSG_DateTime |
Get_Month_Choices(void) | CSG_DateTime | static
Get_MonthName(Month month, NameFlags flags=Name_Full) | CSG_DateTime | static
Get_NumberOfDays(int year) | CSG_DateTime | static
Get_NumberOfDays(Month month, int year=Inv_Year) | CSG_DateTime | static
Get_Second(void) const | CSG_DateTime |
Get_Value(void) const | CSG_DateTime |
Get_WeekDay(void) const | CSG_DateTime |
Get_WeekDayName(WeekDay weekday, NameFlags flags=Name_Full) | CSG_DateTime | static
Get_WeekOfMonth(void) const | CSG_DateTime |
Get_WeekOfYear(void) const | CSG_DateTime |
Get_Year(void) const | CSG_DateTime |
Inv_Month enum value | CSG_DateTime |
Inv_WeekDay enum value | CSG_DateTime |
Inv_Year enum value | CSG_DateTime |
is_Between(const CSG_DateTime &t1, const CSG_DateTime &t2) const | CSG_DateTime |
is_DST(void) const | CSG_DateTime |
is_EarlierThan(const CSG_DateTime &DateTime) const | CSG_DateTime |
is_EqualTo(const CSG_DateTime &DateTime) const | CSG_DateTime |
is_LaterThan(const CSG_DateTime &DateTime) const | CSG_DateTime |
is_LeapYear(int year=Inv_Year) | CSG_DateTime | static
is_SameDate(const CSG_DateTime &DateTime) const | CSG_DateTime |
is_SameTime(const CSG_DateTime &DateTime) const | CSG_DateTime |
is_StrictlyBetween(const CSG_DateTime &t1, const CSG_DateTime &t2) const | CSG_DateTime |
is_Valid(void) const | CSG_DateTime |
Jan enum value | CSG_DateTime |
Jul enum value | CSG_DateTime |
Jun enum value | CSG_DateTime |
Make_UTC(bool noDST=false) | CSG_DateTime |
Mar enum value | CSG_DateTime |
May enum value | CSG_DateTime |
Mon enum value | CSG_DateTime |
Month enum name | CSG_DateTime |
Name_Abbr enum value | CSG_DateTime |
Name_Full enum value | CSG_DateTime |
NameFlags enum name | CSG_DateTime |
Nov enum value | CSG_DateTime |
Now(void) | CSG_DateTime | static
Oct enum value | CSG_DateTime |
operator+(const CSG_TimeSpan &TimeSpan) const | CSG_DateTime | inline
operator+=(const CSG_TimeSpan &TimeSpan) | CSG_DateTime | inline
operator-(const CSG_TimeSpan &TimeSpan) const | CSG_DateTime | inline
operator-(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
operator-=(const CSG_TimeSpan &TimeSpan) | CSG_DateTime | inline
operator<(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
operator<=(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
operator=(const CSG_DateTime &DateTime) | CSG_DateTime | inline
operator=(double JDN) | CSG_DateTime | inline
operator==(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
operator>(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
operator>=(const CSG_DateTime &DateTime) const | CSG_DateTime | inline
Parse_Date(const CSG_String &date) | CSG_DateTime |
Parse_DateTime(const CSG_String &datetime) | CSG_DateTime |
Parse_Format(const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef) | CSG_DateTime |
Parse_Format(const CSG_String &date, const CSG_String &format) | CSG_DateTime |
Parse_Format(const CSG_String &date) | CSG_DateTime |
Parse_ISOCombined(const CSG_String &date, char sep='T') | CSG_DateTime |
Parse_ISODate(const CSG_String &date) | CSG_DateTime |
Parse_ISOTime(const CSG_String &date) | CSG_DateTime |
Reset_Time(void) | CSG_DateTime |
Sat enum value | CSG_DateTime |
Sep enum value | CSG_DateTime |
Set(const CSG_DateTime &DateTime) | CSG_DateTime |
Set(const CSG_String &ISODate) | CSG_DateTime |
Set(double JDN) | CSG_DateTime |
Set(TSG_DateTime Hour, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) | CSG_DateTime |
Set(TSG_DateTime Day, Month Month, int Year=Inv_Year, TSG_DateTime Hour=0, TSG_DateTime Minute=0, TSG_DateTime Second=0, TSG_DateTime Millisec=0) | CSG_DateTime |
Set_Day(unsigned short Value) | CSG_DateTime |
Set_DayOfYear(unsigned short Value) | CSG_DateTime |
Set_Hour(unsigned short Value) | CSG_DateTime |
Set_Hour(double Value) | CSG_DateTime |
Set_Hours_AD(int Hours) | CSG_DateTime |
Set_Millisecond(unsigned short Value) | CSG_DateTime |
Set_Minute(unsigned short Value) | CSG_DateTime |
Set_Month(unsigned short Value) | CSG_DateTime |
Set_Second(unsigned short Value) | CSG_DateTime |
Set_To_Current(void) | CSG_DateTime |
Set_Unix_Time(sLong Seconds) | CSG_DateTime |
Set_Year(int Value) | CSG_DateTime |
Subtract(const CSG_TimeSpan &TimeSpan) const | CSG_DateTime |
Subtract(const CSG_TimeSpan &TimeSpan) | CSG_DateTime |
Subtract(const CSG_DateTime &DateTime) const | CSG_DateTime |
Sun enum value | CSG_DateTime |
Thu enum value | CSG_DateTime |
To_UTC(bool noDST=false) const | CSG_DateTime |
TSG_DateTime typedef | CSG_DateTime |
Tue enum value | CSG_DateTime |
Wed enum value | CSG_DateTime |
WeekDay enum name | CSG_DateTime |
Year enum name | CSG_DateTime |
~CSG_DateTime(void) | CSG_DateTime | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Distance_Weighting Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Distance_Weighting Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Distance_Weighting (void)
virtual | ~CSG_Distance_Weighting (void)
bool | Create_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
bool | Set_Parameters (class CSG_Parameters &Parameters)
TSG_Distance_Weighting | Get_Weighting (void) const
bool | Set_Weighting (TSG_Distance_Weighting Weighting)
double | Get_IDW_Power (void) const
bool | Set_IDW_Power (double Value)
bool | Get_IDW_Offset (void) const
bool | Set_IDW_Offset (bool bOn=true)
double | Get_BandWidth (void) const
bool | Set_BandWidth (double Value)
double | Get_Weight (double Distance) const

Static Public Member Functions

static bool | Enable_Parameters (class CSG_Parameters &Parameters)
static bool | Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)

Detailed Description

Definition at line 699 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Distance_Weighting()

CSG_Distance_Weighting::CSG_Distance_Weighting ( void )

Definition at line 1349 of file geo_classes.cpp.

References SG_DISTWGHT_None.

◆ ~CSG_Distance_Weighting()

CSG_Distance_Weighting::~CSG_Distance_Weighting ( void )
virtual

Definition at line 1360 of file geo_classes.cpp.

Member Function Documentation

◆ Add_Parameters()

bool CSG_Distance_Weighting::Add_Parameters | ( | class CSG_Parameters & | Parameters,
 |  | const CSG_String & | Parent = "",
 |  | bool | bIDW_Offset = false
 | ) |  |
static

Definition at line 1380 of file geo_classes.cpp.

References _TL, CSG_Parameters::Add_Bool(), CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Double(), and CSG_String::Format().

Referenced by CSG_Grid_Cell_Addressor::Add_Parameters(), and Create_Parameters().

◆ Create_Parameters()

bool CSG_Distance_Weighting::Create_Parameters | ( | class CSG_Parameters & | Parameters,
 |  | const CSG_String & | Parent = "",
 |  | bool | bIDW_Offset = false
 | ) |  |

Definition at line 1364 of file geo_classes.cpp.

References Add_Parameters().

◆ Enable_Parameters()

bool CSG_Distance_Weighting::Enable_Parameters ( class CSG_Parameters & Parameters )
static

Definition at line 1418 of file geo_classes.cpp.

References CSG_Parameters::Set_Enabled().

Referenced by CSG_Grid_Cell_Addressor::Enable_Parameters().

◆ Get_BandWidth()

double CSG_Distance_Weighting::Get_BandWidth ( void ) const
inline

Definition at line 719 of file geo_tools.h.

◆ Get_IDW_Offset()

bool CSG_Distance_Weighting::Get_IDW_Offset ( void ) const
inline

Definition at line 716 of file geo_tools.h.

◆ Get_IDW_Power()

double CSG_Distance_Weighting::Get_IDW_Power ( void ) const
inline

Definition at line 713 of file geo_tools.h.

◆ Get_Weight()

double CSG_Distance_Weighting::Get_Weight ( double Distance ) const
inline

Definition at line 723 of file geo_tools.h.

References SG_DISTWGHT_EXP, SG_DISTWGHT_GAUSS, and SG_DISTWGHT_IDW.

◆ Get_Weighting()

TSG_Distance_Weighting CSG_Distance_Weighting::Get_Weighting ( void ) const
inline

Definition at line 710 of file geo_tools.h.

◆ Set_BandWidth()

bool CSG_Distance_Weighting::Set_BandWidth ( double Value )

Definition at line 1499 of file geo_classes.cpp.

Referenced by Set_Parameters().

◆ Set_IDW_Offset()

bool CSG_Distance_Weighting::Set_IDW_Offset ( bool bOn = true )

Definition at line 1491 of file geo_classes.cpp.

Referenced by Set_Parameters().

◆ Set_IDW_Power()

bool CSG_Distance_Weighting::Set_IDW_Power ( double Value )

Definition at line 1478 of file geo_classes.cpp.

Referenced by Set_Parameters().

◆ Set_Parameters()

bool CSG_Distance_Weighting::Set_Parameters ( class CSG_Parameters & Parameters )

Definition at line 1433 of file geo_classes.cpp.

References Set_BandWidth(), Set_IDW_Offset(), Set_IDW_Power(), Set_Weighting(), SG_DISTWGHT_EXP, SG_DISTWGHT_GAUSS, SG_DISTWGHT_IDW, and SG_DISTWGHT_None.

◆ Set_Weighting()

bool CSG_Distance_Weighting::Set_Weighting ( TSG_Distance_Weighting Weighting )

Definition at line 1470 of file geo_classes.cpp.

Referenced by Set_Parameters().

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Distance_Weighting Member List

This is the complete list of members for CSG_Distance_Weighting, including all inherited members.

Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false) | CSG_Distance_Weighting | static
Create_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false) | CSG_Distance_Weighting |
CSG_Distance_Weighting(void) | CSG_Distance_Weighting |
Enable_Parameters(class CSG_Parameters &Parameters) | CSG_Distance_Weighting | static
Get_BandWidth(void) const | CSG_Distance_Weighting | inline
Get_IDW_Offset(void) const | CSG_Distance_Weighting | inline
Get_IDW_Power(void) const | CSG_Distance_Weighting | inline
Get_Weight(double Distance) const | CSG_Distance_Weighting | inline
Get_Weighting(void) const | CSG_Distance_Weighting | inline
Set_BandWidth(double Value) | CSG_Distance_Weighting |
Set_IDW_Offset(bool bOn=true) | CSG_Distance_Weighting |
Set_IDW_Power(double Value) | CSG_Distance_Weighting |
Set_Parameters(class CSG_Parameters &Parameters) | CSG_Distance_Weighting |
Set_Weighting(TSG_Distance_Weighting Weighting) | CSG_Distance_Weighting |
~CSG_Distance_Weighting(void) | CSG_Distance_Weighting | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_File Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_File Class Reference

#include <api_core.h>

Inheritance diagram for CSG_File:
CSG_File_Zip

Public Member Functions

CSG_File (void)
virtual | ~CSG_File (void)
CSG_File (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool | Open (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool | Close (void)
virtual const CSG_String & | Get_File_Name (void) const
virtual TSG_File_Type | Get_File_Type (void) const
class wxStreamBase * | Get_Stream (void) const
bool | Set_Encoding (int Encoding)
int | Get_Encoding (void) const
bool | is_Open (void) const
bool | is_Reading (void) const
bool | is_Writing (void) const
bool | is_EOF (void) const
sLong | Length (void) const
bool | Seek (sLong Offset, int Origin=SG_FILE_START) const
bool | Seek_Start (void) const
bool | Seek_End (void) const
sLong | Tell (void) const
int | Printf (const char *Format,...)
int | Printf (const wchar_t *Format,...)
size_t | Read (void *Buffer, size_t Size, size_t Count=1) const
size_t | Write (void *Buffer, size_t Size, size_t Count=1) const
size_t | Read (CSG_String &Buffer, size_t Size) const
size_t | Write (const CSG_String &Buffer) const
bool | Read_Line (CSG_String &sLine) const
int | Read_Char (void) const
int | Read_Int (bool bBigEndian=false) const
bool | Write_Int (int Value, bool bBigEndian=false)
double | Read_Double (bool bBigEndian=false) const
bool | Write_Double (double Value, bool bBigEndian=false)
bool | Scan (int &Value) const
bool | Scan (double &Value) const
bool | Scan (CSG_String &Value, SG_Char Separator) const
int | Scan_Int (void) const
double | Scan_Double (void) const
CSG_String | Scan_String (SG_Char Separator) const

Protected Member Functions

void On_Construction (void)

Protected Attributes

int | m_Mode
int | m_Encoding
CSG_String m_FileName
void * | m_pStream
void * | m_pConvert

Detailed Description

Definition at line 1115 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_File() [1/2]

CSG_File::CSG_File ( void )

Definition at line 86 of file api_file.cpp.

References On_Construction().

◆ ~CSG_File()

CSG_File::~CSG_File ( void )
virtual

Definition at line 100 of file api_file.cpp.

References Close().

◆ CSG_File() [2/2]

CSG_File::CSG_File | ( | const CSG_String & | FileName,
 |  | int | Mode = SG_FILE_R,
 |  | bool | bBinary = true,
 |  | int | Encoding = SG_FILE_ENCODING_ANSI
 | ) |  |

Definition at line 92 of file api_file.cpp.

References On_Construction(), and Open().

Member Function Documentation

◆ Close()

bool CSG_File::Close ( void )
virtual

Reimplemented in CSG_File_Zip.

Definition at line 154 of file api_file.cpp.

References m_pStream, m_pStream_Base, Set_Encoding(), and SG_FILE_ENCODING_UNDEFINED.

Referenced by CSG_File_Zip::Close(), Open(), and ~CSG_File().

◆ Get_Encoding()

int CSG_File::Get_Encoding ( void ) const
inline

Definition at line 1133 of file api_core.h.

◆ Get_File_Name()

virtual const CSG_String& CSG_File::Get_File_Name ( void ) const
inlinevirtual

Definition at line 1127 of file api_core.h.

Referenced by CSG_Grid_File_Info::Create(), and CSG_File_Zip::Get_File().

◆ Get_File_Type()

virtual TSG_File_Type CSG_File::Get_File_Type ( void ) const
inlinevirtual

Reimplemented in CSG_File_Zip.

Definition at line 1128 of file api_core.h.

References SG_FILE_TYPE_NORMAL.

◆ Get_Stream()

class wxStreamBase* CSG_File::Get_Stream ( void ) const
inline

Definition at line 1130 of file api_core.h.

Referenced by CSG_MetaData::Load(), and CSG_MetaData::Save().

◆ is_EOF()

bool CSG_File::is_EOF ( void ) const

Definition at line 226 of file api_file.cpp.

References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.

Referenced by CSG_Grid_File_Info::Create(), Read_Line(), and Scan().

◆ is_Open()

bool CSG_File::is_Open ( void ) const
inline

Definition at line 1135 of file api_core.h.

Referenced by CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().

◆ is_Reading()

bool CSG_File::is_Reading ( void ) const
inline

Definition at line 1136 of file api_core.h.

References SG_FILE_W.

Referenced by CSG_Grid_File_Info::Create(), CSG_File_Zip::Get_File(), CSG_File_Zip::Get_File_Name(), CSG_File_Zip::is_Directory(), is_EOF(), CSG_MetaData::Load(), CSG_Projection::Load(), CSG_File_Zip::Open(), Read(), Read_Char(), Read_Line(), and Scan().

◆ is_Writing()

bool CSG_File::is_Writing ( void ) const
inline

Definition at line 1137 of file api_core.h.

References SG_FILE_R.

Referenced by CSG_File_Zip::Add_Directory(), CSG_File_Zip::Add_File(), Printf(), CSG_Grid_File_Info::Save(), CSG_MetaData::Save(), CSG_Projection::Save(), CSG_Grid_File_Info::Save_AUX_XML(), and Write().

◆ Length()

sLong CSG_File::Length ( void ) const

Definition at line 220 of file api_file.cpp.

References m_pStream, and m_pStream_Base.

Referenced by CSG_Colors::Load(), CSG_Projection::Load(), and CSG_MetaData::Load_JSON().

◆ On_Construction()

void CSG_File::On_Construction ( void )
protected

Definition at line 174 of file api_file.cpp.

References m_Encoding, m_pConvert, m_pStream, and SG_FILE_ENCODING_UNDEFINED.

Referenced by CSG_File(), and CSG_File_Zip::CSG_File_Zip().

◆ Open()

bool CSG_File::Open | ( | const CSG_String & | FileName,
 |  | int | Mode = SG_FILE_R,
 |  | bool | bBinary = true,
 |  | int | Encoding = SG_FILE_ENCODING_ANSI
 | ) |  |
virtual

Definition at line 111 of file api_file.cpp.

References CSG_String::c_str(), Close(), m_FileName, m_Mode, m_pStream, m_pStream_Base, Set_Encoding(), SG_File_Exists(), SG_FILE_R, and SG_FILE_W.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_File(), CSG_Tool_Library::Get_Summary(), CSG_Colors::Load(), CSG_MetaData::Load_JSON(), CSG_Colors::Save(), and CSG_Grid_File_Info::Save_AUX_XML().

◆ Printf() [1/2]

int CSG_File::Printf | ( | const char * | Format,
 |  |  | ...
 | ) |  |

Definition at line 271 of file api_file.cpp.

References is_Writing(), and Write().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Table::Serialize(), and CSG_Colors::Serialize().

◆ Printf() [2/2]

int CSG_File::Printf | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |

Definition at line 296 of file api_file.cpp.

References is_Writing(), and Write().

◆ Read() [1/2]

size_t CSG_File::Read | ( | CSG_String & | Buffer,
 |  | size_t | Size
 | ) |  | const

Definition at line 330 of file api_file.cpp.

References CSG_String::Clear(), CSG_Buffer::Get_Data(), is_Reading(), and Read().

◆ Read() [2/2]

size_t CSG_File::Read | ( | void * | Buffer,
 |  | size_t | Size,
 |  | size_t | Count = 1
 | ) |  | const

Definition at line 322 of file api_file.cpp.

References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.

Referenced by CSG_Colors::Load(), CSG_Projection::Load(), CSG_MetaData::Load_JSON(), Read(), Read_Double(), Read_Int(), CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().

◆ Read_Char()

int CSG_File::Read_Char ( void ) const

Definition at line 417 of file api_file.cpp.

References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.

Referenced by Scan().

◆ Read_Double()

double CSG_File::Read_Double ( bool bBigEndian = false ) const

Definition at line 449 of file api_file.cpp.

References Read(), and SG_Swap_Bytes().

◆ Read_Int()

int CSG_File::Read_Int ( bool bBigEndian = false ) const

Definition at line 423 of file api_file.cpp.

References Read(), and SG_Swap_Bytes().

◆ Read_Line()

bool CSG_File::Read_Line ( CSG_String & sLine ) const

Definition at line 379 of file api_file.cpp.

References CSG_String::is_Empty(), is_EOF(), is_Reading(), m_Mode, m_pConvert, m_pStream_I, m_pStream_IO, and SG_FILE_R.

Referenced by CSG_Table::Serialize(), CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().

◆ Scan() [1/3]

bool CSG_File::Scan | ( | CSG_String & | Value,
 |  | SG_Char | Separator
 | ) |  | const

Definition at line 519 of file api_file.cpp.

References CSG_String::Clear(), is_EOF(), is_Reading(), and Read_Char().

◆ Scan() [2/3]

bool CSG_File::Scan ( double & Value ) const

Definition at line 497 of file api_file.cpp.

References CSG_String::asDouble(), is_EOF(), is_Reading(), and Read_Char().

◆ Scan() [3/3]

bool CSG_File::Scan ( int & Value ) const

Definition at line 475 of file api_file.cpp.

References CSG_String::asInt(), is_EOF(), is_Reading(), and Read_Char().

Referenced by Scan_Double(), Scan_Int(), and Scan_String().

◆ Scan_Double()

double CSG_File::Scan_Double ( void ) const

Definition at line 542 of file api_file.cpp.

References Scan().

Referenced by CSG_Parameters::Serialize_Compatibility().

◆ Scan_Int()

int CSG_File::Scan_Int ( void ) const

Definition at line 537 of file api_file.cpp.

References Scan().

Referenced by CSG_Parameters::Serialize_Compatibility().

◆ Scan_String()

CSG_String CSG_File::Scan_String ( SG_Char Separator ) const

Definition at line 547 of file api_file.cpp.

References Scan().

◆ Seek()

bool CSG_File::Seek | ( | sLong | Offset,
 |  | int | Origin = SG_FILE_START
 | ) |  | const

Definition at line 232 of file api_file.cpp.

References m_Mode, m_pStream, m_pStream_I, m_pStream_IO, m_pStream_O, SG_FILE_CURRENT, SG_FILE_END, SG_FILE_R, and SG_FILE_W.

Referenced by Seek_End(), and Seek_Start().

◆ Seek_End()

bool CSG_File::Seek_End ( void ) const

Definition at line 252 of file api_file.cpp.

References Seek().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Seek_Start()

bool CSG_File::Seek_Start ( void ) const

Definition at line 251 of file api_file.cpp.

References Seek().

Referenced by CSG_Colors::Load().

◆ Set_Encoding()

bool CSG_File::Set_Encoding ( int Encoding )

Definition at line 182 of file api_file.cpp.

References m_Encoding, m_pConvert, SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF16BE, SG_FILE_ENCODING_UTF16LE, SG_FILE_ENCODING_UTF32BE, SG_FILE_ENCODING_UTF32LE, SG_FILE_ENCODING_UTF7, and SG_FILE_ENCODING_UTF8.

Referenced by Close(), Open(), and CSG_File_Zip::Open().

◆ Tell()

sLong CSG_File::Tell ( void ) const

Definition at line 255 of file api_file.cpp.

References m_Mode, m_pStream, m_pStream_I, m_pStream_IO, m_pStream_O, SG_FILE_R, and SG_FILE_W.

◆ Write() [1/2]

size_t CSG_File::Write ( const CSG_String & Buffer ) const

Definition at line 362 of file api_file.cpp.

References CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), m_pConvert, CSG_String::to_ASCII(), CSG_String::w_str(), and Write().

◆ Write() [2/2]

size_t CSG_File::Write | ( | void * | Buffer,
 |  | size_t | Size,
 |  | size_t | Count = 1
 | ) |  | const

Definition at line 354 of file api_file.cpp.

References is_Writing(), m_Mode, m_pStream_IO, m_pStream_O, and SG_FILE_W.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library::Get_Summary(), Printf(), CSG_Colors::Save(), CSG_Projection::Save(), CSG_Grid_File_Info::Save_AUX_XML(), CSG_Colors::Serialize(), Write(), Write_Double(), and Write_Int().

◆ Write_Double()

bool CSG_File::Write_Double | ( | double | Value,
 |  | bool | bBigEndian = false
 | ) |  |

Definition at line 464 of file api_file.cpp.

References SG_Swap_Bytes(), and Write().

◆ Write_Int()

bool CSG_File::Write_Int | ( | int | Value,
 |  | bool | bBigEndian = false
 | ) |  |

Definition at line 438 of file api_file.cpp.

References SG_Swap_Bytes(), and Write().

Member Data Documentation

◆ m_Encoding

int CSG_File::m_Encoding
protected

Definition at line 1175 of file api_core.h.

Referenced by On_Construction(), and Set_Encoding().

◆ m_FileName

CSG_String CSG_File::m_FileName
protected

Definition at line 1177 of file api_core.h.

Referenced by CSG_File_Zip::Add_File(), CSG_File_Zip::Get_File(), and Open().

◆ m_Mode

int CSG_File::m_Mode
protected

Definition at line 1175 of file api_core.h.

Referenced by is_EOF(), Open(), CSG_File_Zip::Open(), Read(), Read_Char(), Read_Line(), Seek(), Tell(), and Write().

◆ m_pConvert

void * CSG_File::m_pConvert
protected

Definition at line 1179 of file api_core.h.

Referenced by On_Construction(), Read_Line(), Set_Encoding(), and Write().

◆ m_pStream

void* CSG_File::m_pStream
protected

Definition at line 1179 of file api_core.h.

Referenced by CSG_File_Zip::Add_Directory(), CSG_File_Zip::Add_File(), Close(), CSG_File_Zip::Get_File(), Length(), On_Construction(), Open(), CSG_File_Zip::Open(), Seek(), and Tell().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_file.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_File Member List

This is the complete list of members for CSG_File, including all inherited members.

Close(void) | CSG_File | virtual
CSG_File(void) | CSG_File |
CSG_File(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File |
Get_Encoding(void) const | CSG_File | inline
Get_File_Name(void) const | CSG_File | inlinevirtual
Get_File_Type(void) const | CSG_File | inlinevirtual
Get_Stream(void) const | CSG_File | inline
is_EOF(void) const | CSG_File |
is_Open(void) const | CSG_File | inline
is_Reading(void) const | CSG_File | inline
is_Writing(void) const | CSG_File | inline
Length(void) const | CSG_File |
m_Encoding | CSG_File | protected
m_FileName | CSG_File | protected
m_Mode | CSG_File | protected
m_pConvert | CSG_File | protected
m_pStream | CSG_File | protected
On_Construction(void) | CSG_File | protected
Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File | virtual
Printf(const char *Format,...) | CSG_File |
Printf(const wchar_t *Format,...) | CSG_File |
Read(void *Buffer, size_t Size, size_t Count=1) const | CSG_File |
Read(CSG_String &Buffer, size_t Size) const | CSG_File |
Read_Char(void) const | CSG_File |
Read_Double(bool bBigEndian=false) const | CSG_File |
Read_Int(bool bBigEndian=false) const | CSG_File |
Read_Line(CSG_String &sLine) const | CSG_File |
Scan(int &Value) const | CSG_File |
Scan(double &Value) const | CSG_File |
Scan(CSG_String &Value, SG_Char Separator) const | CSG_File |
Scan_Double(void) const | CSG_File |
Scan_Int(void) const | CSG_File |
Scan_String(SG_Char Separator) const | CSG_File |
Seek(sLong Offset, int Origin=SG_FILE_START) const | CSG_File |
Seek_End(void) const | CSG_File |
Seek_Start(void) const | CSG_File |
Set_Encoding(int Encoding) | CSG_File |
Tell(void) const | CSG_File |
Write(void *Buffer, size_t Size, size_t Count=1) const | CSG_File |
Write(const CSG_String &Buffer) const | CSG_File |
Write_Double(double Value, bool bBigEndian=false) | CSG_File |
Write_Int(int Value, bool bBigEndian=false) | CSG_File |
~CSG_File(void) | CSG_File | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_File_Zip Class Reference

Public Member Functions | Protected Attributes | List of all members
CSG_File_Zip Class Reference

#include <api_core.h>

Inheritance diagram for CSG_File_Zip:
CSG_File

Public Member Functions

CSG_File_Zip (void)
virtual | ~CSG_File_Zip (void)
CSG_File_Zip (const CSG_String &FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool | Open (const CSG_String &FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool | Close (void)
virtual TSG_File_Type | Get_File_Type (void) const
bool | Add_Directory (const CSG_String &Name)
bool | Add_File (const CSG_String &Name, bool bBinary=true)
size_t | Get_File_Count (void)
bool | Get_File (const CSG_String &Name)
bool | Get_File (size_t Index)
virtual CSG_String | Get_File_Name (size_t Index)
bool | is_Directory (size_t Index)
- Public Member Functions inherited from CSG_File
CSG_File (void)
virtual | ~CSG_File (void)
CSG_File (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool | Open (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual const CSG_String & | Get_File_Name (void) const
class wxStreamBase * | Get_Stream (void) const
bool | Set_Encoding (int Encoding)
int | Get_Encoding (void) const
bool | is_Open (void) const
bool | is_Reading (void) const
bool | is_Writing (void) const
bool | is_EOF (void) const
sLong | Length (void) const
bool | Seek (sLong Offset, int Origin=SG_FILE_START) const
bool | Seek_Start (void) const
bool | Seek_End (void) const
sLong | Tell (void) const
int | Printf (const char *Format,...)
int | Printf (const wchar_t *Format,...)
size_t | Read (void *Buffer, size_t Size, size_t Count=1) const
size_t | Write (void *Buffer, size_t Size, size_t Count=1) const
size_t | Read (CSG_String &Buffer, size_t Size) const
size_t | Write (const CSG_String &Buffer) const
bool | Read_Line (CSG_String &sLine) const
int | Read_Char (void) const
int | Read_Int (bool bBigEndian=false) const
bool | Write_Int (int Value, bool bBigEndian=false)
double | Read_Double (bool bBigEndian=false) const
bool | Write_Double (double Value, bool bBigEndian=false)
bool | Scan (int &Value) const
bool | Scan (double &Value) const
bool | Scan (CSG_String &Value, SG_Char Separator) const
int | Scan_Int (void) const
double | Scan_Double (void) const
CSG_String | Scan_String (SG_Char Separator) const

Protected Attributes

CSG_Array_Pointer m_Files
- Protected Attributes inherited from CSG_File
int | m_Mode
int | m_Encoding
CSG_String m_FileName
void * | m_pStream
void * | m_pConvert

Additional Inherited Members

- Protected Member Functions inherited from CSG_File
void On_Construction (void)

Detailed Description

Definition at line 1187 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_File_Zip() [1/2]

CSG_File_Zip::CSG_File_Zip ( void )

Definition at line 560 of file api_file.cpp.

References CSG_File::On_Construction().

◆ ~CSG_File_Zip()

CSG_File_Zip::~CSG_File_Zip ( void )
virtual

Definition at line 574 of file api_file.cpp.

References Close().

◆ CSG_File_Zip() [2/2]

CSG_File_Zip::CSG_File_Zip | ( | const CSG_String & | FileName,
 |  | int | Mode = SG_FILE_R,
 |  | int | Encoding = SG_FILE_ENCODING_ANSI
 | ) |  |

Definition at line 566 of file api_file.cpp.

References CSG_File::On_Construction(), and Open().

Member Function Documentation

◆ Add_Directory()

bool CSG_File_Zip::Add_Directory ( const CSG_String & Name )

Definition at line 633 of file api_file.cpp.

References CSG_String::c_str(), CSG_File::is_Writing(), and CSG_File::m_pStream.

◆ Add_File()

bool CSG_File_Zip::Add_File | ( | const CSG_String & | Name,
 |  | bool | bBinary = true
 | ) |  |

Definition at line 639 of file api_file.cpp.

References CSG_String::c_str(), CSG_File::is_Writing(), CSG_File::m_FileName, and CSG_File::m_pStream.

Referenced by CSG_PointCloud::Save().

◆ Close()

bool CSG_File_Zip::Close ( void )
virtual

Reimplemented from CSG_File.

Definition at line 620 of file api_file.cpp.

References CSG_File::Close(), CSG_Array_Pointer::Get_Size(), m_Files, and CSG_Array_Pointer::Set_Array().

Referenced by Open(), and ~CSG_File_Zip().

◆ Get_File() [1/2]

bool CSG_File_Zip::Get_File ( const CSG_String & Name )

Definition at line 690 of file api_file.cpp.

References CSG_String::c_str(), CSG_Array_Pointer::Get_Size(), CSG_File::is_Reading(), and m_Files.

Referenced by CSG_Grid_File_Info::Create(), and CSG_PointCloud::Get_Header_Content().

◆ Get_File() [2/2]

bool CSG_File_Zip::Get_File ( size_t Index )

Definition at line 674 of file api_file.cpp.

References CSG_File::Get_File_Name(), CSG_File::is_Reading(), CSG_File::m_FileName, m_Files, and CSG_File::m_pStream.

◆ Get_File_Count()

size_t CSG_File_Zip::Get_File_Count ( void )
inline

Definition at line 1204 of file api_core.h.

Referenced by CSG_Grid_File_Info::Create().

◆ Get_File_Name()

CSG_String CSG_File_Zip::Get_File_Name ( size_t Index )
virtual

Definition at line 707 of file api_file.cpp.

References CSG_File::is_Reading(), and m_Files.

Referenced by CSG_Grid_File_Info::Create().

◆ Get_File_Type()

virtual TSG_File_Type CSG_File_Zip::Get_File_Type ( void ) const
inlinevirtual

Reimplemented from CSG_File.

Definition at line 1199 of file api_core.h.

References SG_FILE_TYPE_ZIP.

◆ is_Directory()

bool CSG_File_Zip::is_Directory ( size_t Index )

Definition at line 663 of file api_file.cpp.

References CSG_File::is_Reading(), and m_Files.

◆ Open()

bool CSG_File_Zip::Open | ( | const CSG_String & | FileName,
 |  | int | Mode = SG_FILE_R,
 |  | int | Encoding = SG_FILE_ENCODING_ANSI
 | ) |  |
virtual

Definition at line 580 of file api_file.cpp.

References CSG_String::c_str(), Close(), CSG_File::is_Reading(), m_Files, CSG_File::m_Mode, CSG_File::m_pStream, m_pStream_Base, CSG_File::Set_Encoding(), SG_File_Exists(), SG_FILE_R, and SG_FILE_W.

Referenced by CSG_File_Zip().

Member Data Documentation

◆ m_Files

CSG_Array_Pointer CSG_File_Zip::m_Files
protected

Definition at line 1213 of file api_core.h.

Referenced by Close(), Get_File(), Get_File_Name(), is_Directory(), and Open().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_file.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_File_Zip Member List

This is the complete list of members for CSG_File_Zip, including all inherited members.

Add_Directory(const CSG_String &Name) | CSG_File_Zip |
Add_File(const CSG_String &Name, bool bBinary=true) | CSG_File_Zip |
Close(void) | CSG_File_Zip | virtual
CSG_File(void) | CSG_File |
CSG_File(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File |
CSG_File_Zip(void) | CSG_File_Zip |
CSG_File_Zip(const CSG_String &FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File_Zip |
Get_Encoding(void) const | CSG_File | inline
Get_File(const CSG_String &Name) | CSG_File_Zip |
Get_File(size_t Index) | CSG_File_Zip |
Get_File_Count(void) | CSG_File_Zip | inline
Get_File_Name(size_t Index) | CSG_File_Zip | virtual
CSG_File::Get_File_Name(void) const | CSG_File | inlinevirtual
Get_File_Type(void) const | CSG_File_Zip | inlinevirtual
Get_Stream(void) const | CSG_File | inline
is_Directory(size_t Index) | CSG_File_Zip |
is_EOF(void) const | CSG_File |
is_Open(void) const | CSG_File | inline
is_Reading(void) const | CSG_File | inline
is_Writing(void) const | CSG_File | inline
Length(void) const | CSG_File |
m_Encoding | CSG_File | protected
m_FileName | CSG_File | protected
m_Files | CSG_File_Zip | protected
m_Mode | CSG_File | protected
m_pConvert | CSG_File | protected
m_pStream | CSG_File | protected
On_Construction(void) | CSG_File | protected
Open(const CSG_String &FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File_Zip | virtual
CSG_File::Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) | CSG_File | virtual
Printf(const char *Format,...) | CSG_File |
Printf(const wchar_t *Format,...) | CSG_File |
Read(void *Buffer, size_t Size, size_t Count=1) const | CSG_File |
Read(CSG_String &Buffer, size_t Size) const | CSG_File |
Read_Char(void) const | CSG_File |
Read_Double(bool bBigEndian=false) const | CSG_File |
Read_Int(bool bBigEndian=false) const | CSG_File |
Read_Line(CSG_String &sLine) const | CSG_File |
Scan(int &Value) const | CSG_File |
Scan(double &Value) const | CSG_File |
Scan(CSG_String &Value, SG_Char Separator) const | CSG_File |
Scan_Double(void) const | CSG_File |
Scan_Int(void) const | CSG_File |
Scan_String(SG_Char Separator) const | CSG_File |
Seek(sLong Offset, int Origin=SG_FILE_START) const | CSG_File |
Seek_End(void) const | CSG_File |
Seek_Start(void) const | CSG_File |
Set_Encoding(int Encoding) | CSG_File |
Tell(void) const | CSG_File |
Write(void *Buffer, size_t Size, size_t Count=1) const | CSG_File |
Write(const CSG_String &Buffer) const | CSG_File |
Write_Double(double Value, bool bBigEndian=false) | CSG_File |
Write_Int(int Value, bool bBigEndian=false) | CSG_File |
~CSG_File(void) | CSG_File | virtual
~CSG_File_Zip(void) | CSG_File_Zip | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Formula Class Reference

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
CSG_Formula Class Reference

#include <mat_tools.h>

Classes

struct SSG_Function

Public Types

typedef struct CSG_Formula::SSG_Function TSG_Function

Public Member Functions

CSG_Formula (void)
virtual | ~CSG_Formula (void)
bool | Destroy (void)
bool | Get_Error (CSG_String &Message)
bool | Add_Function (const char *Name, TSG_Formula_Function_1 Function, int nParameters, bool bVarying=false)
bool | Set_Formula (const CSG_String &Formula)
CSG_String | Get_Formula (void) const
void | Set_Variable (char Variable, double Value)
double | Get_Value (void) const
double | Get_Value (double x) const
double | Get_Value (const CSG_Vector &Values) const
double | Get_Value (double *Values, int nValues) const
double | Get_Value (const char *Arguments,...) const
const char * | Get_Used_Variables (void)

Static Public Member Functions

static CSG_String Get_Help_Operators (bool bHTML=true, const CSG_String Additional[][2]=NULL)

Detailed Description

Definition at line 1849 of file mat_tools.h.

Member Typedef Documentation

◆ TSG_Function

typedef struct CSG_Formula::SSG_Function CSG_Formula::TSG_Function

Constructor & Destructor Documentation

◆ CSG_Formula()

CSG_Formula::CSG_Formula ( void )

Definition at line 246 of file mat_formula.cpp.

References CSG_Formula::SSG_Function::bVarying, CSG_Formula::SSG_Function::Function, gSG_Functions, MAX_CTABLE, CSG_Formula::SSG_Function::Name, CSG_Formula::SSG_Function::nParameters, and SG_Calloc().

◆ ~CSG_Formula()

CSG_Formula::~CSG_Formula ( void )
virtual

Definition at line 269 of file mat_formula.cpp.

References Destroy(), and SG_Free().

Member Function Documentation

◆ Add_Function()

bool CSG_Formula::Add_Function | ( | const char * | Name,
 |  | TSG_Formula_Function_1 | Function,
 |  | int | nParameters,
 |  | bool | bVarying = false
 | ) |  |

Definition at line 694 of file mat_formula.cpp.

References _TL, CSG_Formula::SSG_Function::bVarying, CSG_Formula::SSG_Function::Function, MAX_CTABLE, CSG_Formula::SSG_Function::Name, and CSG_Formula::SSG_Function::nParameters.

◆ Destroy()

bool CSG_Formula::Destroy ( void )

Definition at line 277 of file mat_formula.cpp.

References SG_FREE_SAFE.

Referenced by Set_Formula(), and ~CSG_Formula().

◆ Get_Error()

bool CSG_Formula::Get_Error ( CSG_String & Message )

Definition at line 385 of file mat_formula.cpp.

References _TL, CSG_String::Format(), CSG_String::Left(), CSG_String::Length(), and CSG_String::Right().

Referenced by CSG_Trend::Get_Error(), and CSG_Trend::Get_Trend().

◆ Get_Formula()

CSG_String CSG_Formula::Get_Formula ( void ) const
inline

Definition at line 1864 of file mat_tools.h.

Referenced by CSG_Trend::Get_Formula().

◆ Get_Help_Operators()

CSG_String CSG_Formula::Get_Help_Operators | ( | bool | bHTML = true,
 |  | const CSG_String | Additional[][2] = NULL
 | ) |  |
static

Definition at line 295 of file mat_formula.cpp.

References _TL, CSG_String::is_Empty(), and CSG_String::Replace().

◆ Get_Used_Variables()

const char * CSG_Formula::Get_Used_Variables ( void )

Definition at line 663 of file mat_formula.cpp.

References CSG_String::Append(), and CSG_String::Clear().

Referenced by CSG_Trend::Set_Formula().

◆ Get_Value() [1/5]

double CSG_Formula::Get_Value | ( | const char * | Arguments,
 |  |  | ...
 | ) |  | const

Definition at line 502 of file mat_formula.cpp.

◆ Get_Value() [2/5]

double CSG_Formula::Get_Value ( const CSG_Vector & Values ) const

Definition at line 483 of file mat_formula.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_N(), and Get_Value().

◆ Get_Value() [3/5]

double CSG_Formula::Get_Value | ( | double * | Values,
 |  | int | nValues
 | ) |  | const

Definition at line 489 of file mat_formula.cpp.

◆ Get_Value() [4/5]

double CSG_Formula::Get_Value ( double x ) const

Definition at line 471 of file mat_formula.cpp.

◆ Get_Value() [5/5]

double CSG_Formula::Get_Value ( void ) const

Definition at line 465 of file mat_formula.cpp.

Referenced by CSG_Trend::Get_Trend(), and Get_Value().

◆ Set_Formula()

bool CSG_Formula::Set_Formula ( const CSG_String & Formula )

Definition at line 439 of file mat_formula.cpp.

References Destroy(), and CSG_String::Length().

Referenced by CSG_Trend::Set_Formula().

◆ Set_Variable()

void CSG_Formula::Set_Variable | ( | char | Variable,
 |  | double | Value
 | ) |  |

Definition at line 433 of file mat_formula.cpp.

Referenced by CSG_Trend::Get_Trend().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_formula.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Formula Member List

This is the complete list of members for CSG_Formula, including all inherited members.

Add_Function(const char *Name, TSG_Formula_Function_1 Function, int nParameters, bool bVarying=false) | CSG_Formula |
CSG_Formula(void) | CSG_Formula |
Destroy(void) | CSG_Formula |
Get_Error(CSG_String &Message) | CSG_Formula |
Get_Formula(void) const | CSG_Formula | inline
Get_Help_Operators(bool bHTML=true, const CSG_String Additional[][2]=NULL) | CSG_Formula | static
Get_Used_Variables(void) | CSG_Formula |
Get_Value(void) const | CSG_Formula |
Get_Value(double x) const | CSG_Formula |
Get_Value(const CSG_Vector &Values) const | CSG_Formula |
Get_Value(double *Values, int nValues) const | CSG_Formula |
Get_Value(const char *Arguments,...) const | CSG_Formula |
Set_Formula(const CSG_String &Formula) | CSG_Formula |
Set_Variable(char Variable, double Value) | CSG_Formula |
TSG_Function typedef | CSG_Formula |
~CSG_Formula(void) | CSG_Formula | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Formula::SSG_Function Struct Reference

  • CSG_Formula
  • SSG_Function
Public Attributes | List of all members
CSG_Formula::SSG_Function Struct Reference

#include <mat_tools.h>

Public Attributes

const char * | Name
TSG_Formula_Function_1 Function
int | nParameters
bool | bVarying

Detailed Description

Definition at line 1878 of file mat_tools.h.

Member Data Documentation

◆ bVarying

bool CSG_Formula::SSG_Function::bVarying

Definition at line 1886 of file mat_tools.h.

Referenced by CSG_Formula::Add_Function(), and CSG_Formula::CSG_Formula().

◆ Function

TSG_Formula_Function_1 CSG_Formula::SSG_Function::Function

Definition at line 1882 of file mat_tools.h.

Referenced by CSG_Formula::Add_Function(), and CSG_Formula::CSG_Formula().

◆ Name

const char* CSG_Formula::SSG_Function::Name

Definition at line 1880 of file mat_tools.h.

Referenced by CSG_Formula::Add_Function(), and CSG_Formula::CSG_Formula().

◆ nParameters

int CSG_Formula::SSG_Function::nParameters

Definition at line 1884 of file mat_tools.h.

Referenced by CSG_Formula::Add_Function(), and CSG_Formula::CSG_Formula().

The documentation for this struct was generated from the following file:
  • mat_tools.h
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

  • CSG_Formula
  • SSG_Function
CSG_Formula::SSG_Function Member List

This is the complete list of members for CSG_Formula::SSG_Function, including all inherited members.

bVarying | CSG_Formula::SSG_Function
Function | CSG_Formula::SSG_Function
Name | CSG_Formula::SSG_Function
nParameters | CSG_Formula::SSG_Function
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid Class Reference

Public Member Functions | Protected Member Functions | List of all members
CSG_Grid Class Reference

#include <grid.h>

Inheritance diagram for CSG_Grid:
CSG_Data_Object

Public Member Functions

CSG_Grid (void)
CSG_Grid (const CSG_Grid &Grid)
bool | Create (const CSG_Grid &Grid)
CSG_Grid (const CSG_String &File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
bool | Create (const CSG_String &File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
CSG_Grid (const char *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
bool | Create (const char *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
CSG_Grid (const wchar_t *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
bool | Create (const wchar_t *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
CSG_Grid (CSG_Grid *pGrid, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
bool | Create (CSG_Grid *pGrid, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
CSG_Grid (const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
bool | Create (const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
CSG_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize=0.0, double xMin=0.0, double yMin=0.0, bool bCached=false)
bool | Create (TSG_Data_Type Type, int NX, int NY, double Cellsize=0.0, double xMin=0.0, double yMin=0.0, bool bCached=false)
virtual | ~CSG_Grid (void)
virtual bool | Destroy (void)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
virtual bool | Save (const CSG_String &File, int Format=0)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
TSG_Data_Type | Get_Type (void) const
int | Get_nValueBytes (void) const
int | Get_nLineBytes (void) const
void | Set_Unit (const CSG_String &Unit)
const CSG_String & | Get_Unit (void) const
const CSG_Grid_System & | Get_System (void) const
virtual const CSG_Rect & | Get_Extent (void)
int | Get_NX (void) const
int | Get_NY (void) const
sLong | Get_NCells (void) const
double | Get_Cellsize (void) const
double | Get_Cellarea (void) const
const CSG_Rect & | Get_Extent (bool bCells=false) const
double | Get_XMin (bool bCells=false) const
double | Get_XMax (bool bCells=false) const
double | Get_XRange (bool bCells=false) const
double | Get_YMin (bool bCells=false) const
double | Get_YMax (bool bCells=false) const
double | Get_YRange (bool bCells=false) const
void | Set_Scaling (double Scale=1.0, double Offset=0.0)
double | Get_Scaling (void) const
double | Get_Offset (void) const
bool | is_Scaled (void) const
double | Get_Mean (void)
double | Get_Min (void)
double | Get_Max (void)
double | Get_Range (void)
double | Get_StdDev (void)
double | Get_Variance (void)
double | Get_Quantile (double Quantile, bool bFromHistogram=true)
double | Get_Percentile (double Percentile, bool bFromHistogram=true)
const CSG_Simple_Statistics & | Get_Statistics (void)
bool | Get_Statistics (const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues=false) const
const CSG_Histogram & | Get_Histogram (size_t nClasses=0)
bool | Get_Histogram (const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses=0) const
sLong | Get_Data_Count (void)
sLong | Get_NoData_Count (void)
virtual bool | is_Valid (void) const
TSG_Intersection | is_Intersecting (const CSG_Rect &Extent) const
TSG_Intersection | is_Intersecting (const TSG_Rect &Extent) const
TSG_Intersection | is_Intersecting (double xMin, double yMin, double xMax, double yMax) const
bool | is_Compatible (CSG_Grid *pGrid) const
bool | is_Compatible (const CSG_Grid_System &System) const
bool | is_Compatible (int NX, int NY, double Cellsize, double xMin, double yMin) const
bool | is_InGrid (int x, int y, bool bCheckNoData=true) const
bool | is_InGrid_byPos (double x, double y, bool bCheckNoData=true) const
bool | is_InGrid_byPos (const TSG_Point &p, bool bCheckNoData=true) const
sLong | Get_Memory_Size (void) const
double | Get_Memory_Size_MB (void) const
bool | Set_Cache (bool bOn)
bool | is_Cached (void) const
void | Assign_NoData (void)
virtual bool | Assign (double Value=0.0)
virtual bool | Assign (CSG_Data_Object *pObject)
virtual bool | Assign (CSG_Grid *pGrid, TSG_Grid_Resampling Interpolation)
void | Flip (void)
void | Mirror (void)
void | Invert (void)
bool | Normalise (void)
bool | DeNormalise (double Minimum, double Maximum)
bool | Standardise (void)
bool | DeStandardise (double Mean, double StdDev)
int | Get_Gradient_NeighborDir (int x, int y, bool bDown=true, bool bNoEdges=true) const
bool | Get_Gradient (int x, int y, double &Slope, double &Aspect) const
bool | Get_Gradient (double x, double y, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const
bool | Get_Gradient (const TSG_Point &p, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const
virtual void | Set_Modified (bool bModified=true)
bool | Set_Index (bool bOn=true)
sLong | Get_Sorted (sLong Position, bool bDown=true, bool bCheckNoData=true)
bool | Get_Sorted (sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
bool | Get_Sorted (sLong Position, int &x, int &y, bool bDown=true, bool bCheckNoData=true)
virtual bool | is_NoData (int x, int y) const
virtual bool | is_NoData (sLong i) const
virtual void | Set_NoData (int x, int y)
virtual void | Set_NoData (sLong i)
virtual CSG_Grid & | operator= (const CSG_Grid &Grid)
virtual CSG_Grid & | operator= (double Value)
virtual CSG_Grid | operator+ (const CSG_Grid &Grid) const
virtual CSG_Grid | operator+ (double Value) const
virtual CSG_Grid & | operator+= (const CSG_Grid &Grid)
virtual CSG_Grid & | operator+= (double Value)
virtual CSG_Grid & | Add (const CSG_Grid &Grid)
virtual CSG_Grid & | Add (double Value)
virtual CSG_Grid | operator- (const CSG_Grid &Grid) const
virtual CSG_Grid | operator- (double Value) const
virtual CSG_Grid & | operator-= (const CSG_Grid &Grid)
virtual CSG_Grid & | operator-= (double Value)
virtual CSG_Grid & | Subtract (const CSG_Grid &Grid)
virtual CSG_Grid & | Subtract (double Value)
virtual CSG_Grid | operator* (const CSG_Grid &Grid) const
virtual CSG_Grid | operator* (double Value) const
virtual CSG_Grid & | operator*= (const CSG_Grid &Grid)
virtual CSG_Grid & | operator*= (double Value)
virtual CSG_Grid & | Multiply (const CSG_Grid &Grid)
virtual CSG_Grid & | Multiply (double Value)
virtual CSG_Grid | operator/ (const CSG_Grid &Grid) const
virtual CSG_Grid | operator/ (double Value) const
virtual CSG_Grid & | operator/= (const CSG_Grid &Grid)
virtual CSG_Grid & | operator/= (double Value)
virtual CSG_Grid & | Divide (const CSG_Grid &Grid)
virtual CSG_Grid & | Divide (double Value)
virtual double | operator() (int x, int y) const
double | Get_Value (double x, double y, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const
double | Get_Value (const TSG_Point &p, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const
bool | Get_Value (double x, double y, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bNoData=false, bool bByteWise=false) const
bool | Get_Value (const TSG_Point &p, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bNoData=false, bool bByteWise=false) const
virtual BYTE | asByte (int x, int y, bool bScaled=true) const
virtual BYTE | asByte (sLong i, bool bScaled=true) const
virtual char | asChar (int x, int y, bool bScaled=true) const
virtual char | asChar (sLong i, bool bScaled=true) const
virtual short | asShort (int x, int y, bool bScaled=true) const
virtual short | asShort (sLong i, bool bScaled=true) const
virtual int | asInt (int x, int y, bool bScaled=true) const
virtual int | asInt (sLong i, bool bScaled=true) const
virtual sLong | asLong (int x, int y, bool bScaled=true) const
virtual sLong | asLong (sLong i, bool bScaled=true) const
virtual float | asFloat (int x, int y, bool bScaled=true) const
virtual float | asFloat (sLong i, bool bScaled=true) const
virtual double | asDouble (sLong i, bool bScaled=true) const
virtual double | asDouble (int x, int y, bool bScaled=true) const
virtual void | Add_Value (int x, int y, double Value)
virtual void | Add_Value (sLong i, double Value)
virtual void | Mul_Value (int x, int y, double Value)
virtual void | Mul_Value (sLong i, double Value)
virtual void | Set_Value (sLong i, double Value, bool bScaled=true)
virtual void | Set_Value (int x, int y, double Value, bool bScaled=true)
CSG_Vector | Get_Row (int y) const
bool | Set_Row (int y, const CSG_Vector &Values)
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Protected Member Functions

virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)
virtual bool | On_NoData_Changed (void)

Additional Inherited Members

- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Detailed Description

CSG_Grid is the data object created for raster handling.

Definition at line 472 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid() [1/8]

CSG_Grid::CSG_Grid ( void )

Default constructor.

Definition at line 131 of file grid.cpp.

References CSG_Table::_On_Construction().

◆ CSG_Grid() [2/8]

CSG_Grid::CSG_Grid ( const CSG_Grid & Grid )

Copy constructor.

Definition at line 142 of file grid.cpp.

References CSG_Table::_On_Construction(), and Create().

◆ CSG_Grid() [3/8]

CSG_Grid::CSG_Grid | ( | const CSG_String & | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 155 of file grid.cpp.

References CSG_Table::_On_Construction(), and Create().

◆ CSG_Grid() [4/8]

CSG_Grid::CSG_Grid | ( | const char * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Create a grid from file.

Definition at line 153 of file grid.cpp.

◆ CSG_Grid() [5/8]

CSG_Grid::CSG_Grid | ( | const wchar_t * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 154 of file grid.cpp.

◆ CSG_Grid() [6/8]

CSG_Grid::CSG_Grid | ( | CSG_Grid * | pGrid,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Create a grid similar to 'pGrid'.

Definition at line 166 of file grid.cpp.

References CSG_Table::_On_Construction(), and Create().

◆ CSG_Grid() [7/8]

CSG_Grid::CSG_Grid | ( | const CSG_Grid_System & | System,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Create a grid using 'System'.

Definition at line 177 of file grid.cpp.

References CSG_Table::_On_Construction(), and Create().

◆ CSG_Grid() [8/8]

CSG_Grid::CSG_Grid | ( | TSG_Data_Type | Type,
 |  | int | NX,
 |  | int | NY,
 |  | double | Cellsize = 0.0,
 |  | double | xMin = 0.0,
 |  | double | yMin = 0.0,
 |  | bool | bCached = false
 | ) |  |

Create a grid with specified parameters. This constructor initializes the grid's data space with 'NX' x 'NY' cells of the size indicated by 'Type'. If 'DX/DY' are equal or less zero then both will be set to 1.. 'xMin/yMin' specify the coordinates of the lower left corner of the grid.

Definition at line 191 of file grid.cpp.

References CSG_Table::_On_Construction(), and Create().

◆ ~CSG_Grid()

CSG_Grid::~CSG_Grid ( void )
virtual

The destructor.

Definition at line 342 of file grid.cpp.

References Destroy().

Member Function Documentation

◆ Add() [1/2]

CSG_Grid & CSG_Grid::Add ( const CSG_Grid & Grid )
virtual

Definition at line 503 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

Referenced by CSG_Grids::Add().

◆ Add() [2/2]

CSG_Grid & CSG_Grid::Add ( double Value )
virtual

Definition at line 508 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

◆ Add_Value() [1/2]

virtual void CSG_Grid::Add_Value | ( | int | x,
 |  | int | y,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 808 of file grid.h.

◆ Add_Value() [2/2]

virtual void CSG_Grid::Add_Value | ( | sLong | i,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 809 of file grid.h.

◆ asByte() [1/2]

virtual BYTE CSG_Grid::asByte | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 751 of file grid.h.

References SG_ROUND_TO_BYTE.

◆ asByte() [2/2]

virtual BYTE CSG_Grid::asByte | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 752 of file grid.h.

References SG_ROUND_TO_BYTE.

◆ asChar() [1/2]

virtual char CSG_Grid::asChar | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 753 of file grid.h.

References SG_ROUND_TO_CHAR.

◆ asChar() [2/2]

virtual char CSG_Grid::asChar | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 754 of file grid.h.

References SG_ROUND_TO_CHAR.

◆ asDouble() [1/2]

virtual double CSG_Grid::asDouble | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 770 of file grid.h.

References SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

◆ asDouble() [2/2]

virtual double CSG_Grid::asDouble | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 765 of file grid.h.

Referenced by Assign(), CSG_Natural_Breaks::Create(), Create(), CSG_Histogram::Create(), DeNormalise(), DeStandardise(), Flip(), Get_Gradient(), Get_Gradient_NeighborDir(), Get_Histogram(), Get_Quantile(), Get_Row(), Get_Statistics(), Invert(), Mirror(), Normalise(), On_Update(), CSG_Grid_Cell_Addressor::Set_Parameters(), Standardise(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ asFloat() [1/2]

virtual float CSG_Grid::asFloat | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 761 of file grid.h.

◆ asFloat() [2/2]

virtual float CSG_Grid::asFloat | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 762 of file grid.h.

◆ asInt() [1/2]

virtual int CSG_Grid::asInt | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 757 of file grid.h.

References SG_ROUND_TO_INT.

Referenced by CSG_Grid_Cell_Addressor::Enable_Parameters().

◆ asInt() [2/2]

virtual int CSG_Grid::asInt | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 758 of file grid.h.

References SG_ROUND_TO_INT.

◆ asLong() [1/2]

virtual sLong CSG_Grid::asLong | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 759 of file grid.h.

References SG_ROUND_TO_SLONG.

◆ asLong() [2/2]

virtual sLong CSG_Grid::asLong | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 760 of file grid.h.

References SG_ROUND_TO_SLONG.

◆ asShort() [1/2]

virtual short CSG_Grid::asShort | ( | int | x,
 |  | int | y,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 755 of file grid.h.

References SG_ROUND_TO_SHORT.

◆ asShort() [2/2]

virtual short CSG_Grid::asShort | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 756 of file grid.h.

References SG_ROUND_TO_SHORT.

◆ Assign() [1/3]

bool CSG_Grid::Assign ( CSG_Data_Object * pObject )
virtual

Reimplemented from CSG_Data_Object.

Definition at line 122 of file grid_operation.cpp.

References Assign(), Get_ObjectType(), CSG_Data_Object::Get_ObjectType(), GRID_RESAMPLING_Undefined, and CSG_Data_Object::is_Valid().

◆ Assign() [2/3]

bool CSG_Grid::Assign | ( | CSG_Grid * | pGrid,
 |  | TSG_Grid_Resampling | Interpolation
 | ) |  |
virtual

Definition at line 128 of file grid_operation.cpp.

References asDouble(), Get_Cellsize(), Get_Extent(), CSG_Data_Object::Get_History(), Get_NX(), Get_NY(), CSG_Data_Object::Get_Projection(), Get_Unit(), Get_XMin(), Get_YMin(), GRID_RESAMPLING_BicubicSpline, GRID_RESAMPLING_Bilinear, GRID_RESAMPLING_BSpline, GRID_RESAMPLING_Majority, GRID_RESAMPLING_Maximum, GRID_RESAMPLING_Mean_Cells, GRID_RESAMPLING_Mean_Nodes, GRID_RESAMPLING_Minimum, GRID_RESAMPLING_NearestNeighbour, INTERSECTION_None, is_Intersecting(), is_NoData(), CSG_Projection::is_Okay(), is_Valid(), Set_NoData(), Set_Unit(), Set_Value(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().

◆ Assign() [3/3]

bool CSG_Grid::Assign ( double Value = 0.0 )
virtual

Definition at line 77 of file grid_operation.cpp.

References CSG_MetaData::Destroy(), CSG_Data_Object::Get_History(), Get_nLineBytes(), Get_NX(), Get_NY(), CSG_Simple_Statistics::Invalidate(), is_Cached(), is_Valid(), CSG_Data_Object::Set_Update_Flag(), and Set_Value().

Referenced by Assign(), CSG_Grids::Assign(), CSG_Tool_Grid::Lock_Create(), and operator=().

◆ Assign_NoData()

void CSG_Grid::Assign_NoData ( void )

Definition at line 65 of file grid_operation.cpp.

References CSG_Data_Object::Get_NoData_Value(), Get_NX(), Get_NY(), and Set_Value().

Referenced by CSG_Grids::Assign_NoData().

◆ Create() [1/7]

bool CSG_Grid::Create | ( | const char * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 286 of file grid.cpp.

References Create().

◆ Create() [2/7]

bool CSG_Grid::Create ( const CSG_Grid & Grid )

Definition at line 230 of file grid.cpp.

References asDouble(), CSG_MetaData::Create(), CSG_Data_Object::Get_Description(), CSG_Data_Object::Get_MetaData(), CSG_Data_Object::Get_Name(), CSG_Data_Object::Get_NoData_Value(), Get_NX(), Get_NY(), Get_Offset(), Get_Scaling(), Get_System(), Get_Type(), Get_Unit(), CSG_Data_Object::Set_Description(), CSG_Data_Object::Set_Name(), CSG_Data_Object::Set_NoData_Value_Range(), Set_Scaling(), Set_Unit(), and Set_Value().

Referenced by CSG_Grids::Create(), Create(), CSG_Grid(), CSG_Grid_OGIS_Converter::from_WKBinary(), CSG_Parameters_Grid_Target::Get_Grid(), On_Reload(), and SG_Grid_Get_Geographic_Coordinates().

◆ Create() [3/7]

bool CSG_Grid::Create | ( | const CSG_Grid_System & | System,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Definition at line 280 of file grid.cpp.

References Create(), CSG_Grid_System::Get_Cellsize(), CSG_Grid_System::Get_NX(), CSG_Grid_System::Get_NY(), CSG_Grid_System::Get_XMin(), and CSG_Grid_System::Get_YMin().

◆ Create() [4/7]

bool CSG_Grid::Create | ( | const CSG_String & | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 288 of file grid.cpp.

References _TL, CSG_String::c_str(), Destroy(), CSG_String::Format(), Get_NCells(), CSG_Data_Object::Set_Max_Samples(), Set_Modified(), CSG_Data_Object::Set_Update_Flag(), SG_DataObject_Get_Max_Samples(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_Process_Set_Ready().

◆ Create() [5/7]

bool CSG_Grid::Create | ( | const wchar_t * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 287 of file grid.cpp.

References Create().

◆ Create() [6/7]

bool CSG_Grid::Create | ( | CSG_Grid * | pGrid,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Definition at line 257 of file grid.cpp.

References Create(), Get_Cellsize(), CSG_Data_Object::Get_NoData_Value(), Get_NX(), Get_NY(), CSG_Data_Object::Get_Projection(), Get_Type(), Get_XMin(), Get_YMin(), CSG_Data_Object::Set_NoData_Value_Range(), and SG_DATATYPE_Undefined.

◆ Create() [7/7]

bool CSG_Grid::Create | ( | TSG_Data_Type | Type,
 |  | int | NX,
 |  | int | NY,
 |  | double | Cellsize = 0.0,
 |  | double | xMin = 0.0,
 |  | double | yMin = 0.0,
 |  | bool | bCached = false
 | ) |  |

Definition at line 322 of file grid.cpp.

References Destroy().

◆ DeNormalise()

bool CSG_Grid::DeNormalise | ( | double | Minimum,
 |  | double | Maximum
 | ) |  |

Definition at line 825 of file grid_operation.cpp.

References asDouble(), Get_NX(), Get_NY(), is_NoData(), is_Valid(), and Set_Value().

◆ DeStandardise()

bool CSG_Grid::DeStandardise | ( | double | Mean,
 |  | double | StdDev
 | ) |  |

Definition at line 874 of file grid_operation.cpp.

References asDouble(), Get_NX(), Get_NY(), is_NoData(), is_Valid(), and Set_Value().

◆ Destroy()

bool CSG_Grid::Destroy ( void )
virtual

Destroys the data space of CSG_Grid.

Reimplemented from CSG_Data_Object.

Definition at line 350 of file grid.cpp.

References CSG_Grid_System::Assign(), CSG_String::Clear(), CSG_Data_Object::Destroy(), and SG_DATATYPE_Undefined.

Referenced by Create(), CSG_Grids::Destroy(), and ~CSG_Grid().

◆ Divide() [1/2]

CSG_Grid & CSG_Grid::Divide ( const CSG_Grid & Grid )
virtual

Definition at line 608 of file grid_operation.cpp.

References GRID_OPERATION_Division.

Referenced by CSG_Grids::Divide().

◆ Divide() [2/2]

CSG_Grid & CSG_Grid::Divide ( double Value )
virtual

Definition at line 613 of file grid_operation.cpp.

References GRID_OPERATION_Division.

◆ Flip()

void CSG_Grid::Flip ( void )

Definition at line 756 of file grid_operation.cpp.

References asDouble(), Get_NX(), Get_NY(), is_Valid(), and Set_Value().

◆ Get_Cellarea()

double CSG_Grid::Get_Cellarea ( void ) const
inline

Definition at line 540 of file grid.h.

◆ Get_Cellsize()

double CSG_Grid::Get_Cellsize ( void ) const
inline

Definition at line 539 of file grid.h.

Referenced by Assign(), Create(), Get_Gradient(), Get_Value(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_Data_Count()

sLong CSG_Grid::Get_Data_Count ( void )

Definition at line 1050 of file grid.cpp.

References CSG_Simple_Statistics::Get_Count(), and CSG_Data_Object::Update().

Referenced by Get_Quantile().

◆ Get_Extent() [1/2]

const CSG_Rect& CSG_Grid::Get_Extent ( bool bCells = false ) const
inline

Definition at line 542 of file grid.h.

◆ Get_Extent() [2/2]

virtual const CSG_Rect& CSG_Grid::Get_Extent ( void )
inlinevirtual

Implements CSG_Data_Object.

Definition at line 533 of file grid.h.

Referenced by Assign(), and is_Intersecting().

◆ Get_Gradient() [1/3]

bool CSG_Grid::Get_Gradient | ( | const TSG_Point & | p,
 |  | double & | Incline,
 |  | double & | Azimuth,
 |  | TSG_Grid_Resampling | Interpolation
 | ) |  | const

Calculates the gradient for the given world coordinate. Calculation uses the formulas proposed by Zevenbergen & Thorne (1986). Slope and aspect values are calculated in radians. Aspect is zero for the North direction and increases clockwise.

Definition at line 1056 of file grid_operation.cpp.

References Get_Gradient(), SSG_Point::x, and SSG_Point::y.

◆ Get_Gradient() [2/3]

bool CSG_Grid::Get_Gradient | ( | double | x,
 |  | double | y,
 |  | double & | Slope,
 |  | double & | Aspect,
 |  | TSG_Grid_Resampling | Interpolation
 | ) |  | const

Calculates the gradient for the given world coordinate. Calculation uses the formulas proposed by Zevenbergen & Thorne (1986). Slope and aspect values are calulated in radians. Aspect is zero for the North direction and increases clockwise.

Definition at line 1007 of file grid_operation.cpp.

References Get_Cellsize(), Get_Value(), CSG_Grid_System::Get_xFrom(), CSG_Grid_System::Get_xTo(), CSG_Grid_System::Get_yFrom(), CSG_Grid_System::Get_yTo(), M_PI_090, M_PI_180, and M_PI_270.

◆ Get_Gradient() [3/3]

bool CSG_Grid::Get_Gradient | ( | int | x,
 |  | int | y,
 |  | double & | Slope,
 |  | double & | Aspect
 | ) |  | const

Calculates the gradient of a cell interpreting all grid cell values as elevation surface. Calculation uses the formulas proposed by Zevenbergen & Thorne (1986). Slope and aspect values are calculated in radians. Aspect is zero for the North direction and increases clockwise.

Definition at line 958 of file grid_operation.cpp.

References asDouble(), Get_Cellsize(), CSG_Grid_System::Get_xFrom(), CSG_Grid_System::Get_xTo(), CSG_Grid_System::Get_yFrom(), CSG_Grid_System::Get_yTo(), is_InGrid(), M_PI_090, M_PI_180, and M_PI_270.

Referenced by Get_Gradient().

◆ Get_Gradient_NeighborDir()

int CSG_Grid::Get_Gradient_NeighborDir | ( | int | x,
 |  | int | y,
 |  | bool | bDown = true,
 |  | bool | bNoEdges = true
 | ) |  | const

Returns the direction to which the downward gradient is steepest. This implements the Deterministic 8 (D8) algorithm for identifying a single flow direction based on elevation data. Direction is numbered clock-wise beginning with 0 for the North. If no direction can be identified result will be a -1. If 'bDown' is not true the cell that the direction is pointing to might have a higher value than the center cell. If 'bNoEdges' is true a -1 will be returned for all cells that are at the edge of the data area.

Definition at line 916 of file grid_operation.cpp.

References asDouble(), CSG_Grid_System::Get_Length(), CSG_Grid_System::Get_xTo(), CSG_Grid_System::Get_yTo(), and is_InGrid().

◆ Get_Histogram() [1/2]

bool CSG_Grid::Get_Histogram | ( | const CSG_Rect & | rWorld,
 |  | CSG_Histogram & | Histogram,
 |  | size_t | nClasses = 0
 | ) |  | const

Definition at line 1195 of file grid.cpp.

References asDouble(), CSG_Histogram::Create(), CSG_Data_Object::Get_Max_Samples(), CSG_Simple_Statistics::Get_Maximum(), CSG_Simple_Statistics::Get_Minimum(), Get_NX(), Get_NY(), Get_Offset(), Get_Scaling(), Get_Statistics(), Get_System(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Grid_System::Get_xWorld_to_Grid(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), CSG_Grid_System::Get_yWorld_to_Grid(), CSG_Data_Object::is_NoData_Value(), is_Scaled(), SG_GRID_HISTOGRAM_CLASSES_DEFAULT, and CSG_Histogram::Update().

◆ Get_Histogram() [2/2]

const CSG_Histogram & CSG_Grid::Get_Histogram ( size_t nClasses = 0 )

Returns the histogram for the whole data set. It is automatically updated if necessary.

Definition at line 1177 of file grid.cpp.

References CSG_Histogram::Create(), CSG_Histogram::Destroy(), CSG_Histogram::Get_Class_Count(), CSG_Simple_Statistics::Get_Count(), Get_Max(), CSG_Data_Object::Get_Max_Samples(), Get_Min(), CSG_Histogram::Get_Statistics(), SG_GRID_HISTOGRAM_CLASSES_DEFAULT, and CSG_Data_Object::Update().

Referenced by Get_Quantile().

◆ Get_Max()

double CSG_Grid::Get_Max ( void )

Definition at line 1029 of file grid.cpp.

References CSG_Simple_Statistics::Get_Maximum(), and CSG_Data_Object::Update().

Referenced by Get_Histogram(), Get_Quantile(), and Invert().

◆ Get_Mean()

double CSG_Grid::Get_Mean ( void )

Definition at line 1019 of file grid.cpp.

References CSG_Simple_Statistics::Get_Mean(), and CSG_Data_Object::Update().

Referenced by Standardise().

◆ Get_Memory_Size()

sLong CSG_Grid::Get_Memory_Size ( void ) const
inline

Definition at line 601 of file grid.h.

Referenced by CSG_Data_Manager::Get_Summary().

◆ Get_Memory_Size_MB()

double CSG_Grid::Get_Memory_Size_MB ( void ) const
inline

Definition at line 602 of file grid.h.

References N_MEGABYTE_BYTES.

◆ Get_Min()

double CSG_Grid::Get_Min ( void )

Definition at line 1024 of file grid.cpp.

References CSG_Simple_Statistics::Get_Minimum(), and CSG_Data_Object::Update().

Referenced by Get_Histogram(), Get_Quantile(), Invert(), and Normalise().

◆ Get_NCells()

sLong CSG_Grid::Get_NCells ( void ) const
inline

Definition at line 537 of file grid.h.

Referenced by CSG_Natural_Breaks::Create(), Create(), CSG_Histogram::Create(), Get_NoData_Count(), and On_Update().

◆ Get_nLineBytes()

int CSG_Grid::Get_nLineBytes ( void ) const
inline

Definition at line 522 of file grid.h.

Referenced by Assign().

◆ Get_NoData_Count()

sLong CSG_Grid::Get_NoData_Count ( void )

Definition at line 1055 of file grid.cpp.

References CSG_Simple_Statistics::Get_Count(), Get_NCells(), and CSG_Data_Object::Update().

◆ Get_nValueBytes()

int CSG_Grid::Get_nValueBytes ( void ) const
inline

Definition at line 521 of file grid.h.

◆ Get_NX()

int CSG_Grid::Get_NX ( void ) const
inline

Definition at line 535 of file grid.h.

Referenced by Assign(), Assign_NoData(), CSG_Grid_Pyramid::Create(), Create(), DeNormalise(), DeStandardise(), Flip(), CSG_Grid_OGIS_Converter::from_WKBinary(), Get_Histogram(), Get_Row(), Get_Statistics(), Invert(), Mirror(), Normalise(), On_Update(), Set_Row(), Standardise(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_NY()

int CSG_Grid::Get_NY ( void ) const
inline

Definition at line 536 of file grid.h.

Referenced by Assign(), Assign_NoData(), CSG_Grid_Pyramid::Create(), Create(), DeNormalise(), DeStandardise(), Flip(), CSG_Grid_OGIS_Converter::from_WKBinary(), Get_Histogram(), Get_Row(), Get_Statistics(), Invert(), Mirror(), Normalise(), On_Update(), Set_Row(), Standardise(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_Grid::Get_ObjectType ( void ) const
inlinevirtual

Data object type information.

Implements CSG_Data_Object.

Definition at line 514 of file grid.h.

References SG_DATAOBJECT_TYPE_Grid.

Referenced by Assign().

◆ Get_Offset()

double CSG_Grid::Get_Offset ( void ) const

Definition at line 436 of file grid.cpp.

Referenced by CSG_Grid_File_Info::Create(), Create(), Get_Histogram(), Get_Statistics(), and On_Update().

◆ Get_Percentile()

double CSG_Grid::Get_Percentile | ( | double | Percentile,
 |  | bool | bFromHistogram = true
 | ) |  |

Definition at line 1084 of file grid.cpp.

References Get_Quantile().

◆ Get_Quantile()

double CSG_Grid::Get_Quantile | ( | double | Quantile,
 |  | bool | bFromHistogram = true
 | ) |  |

Definition at line 1061 of file grid.cpp.

References asDouble(), Get_Data_Count(), Get_Histogram(), Get_Max(), Get_Min(), CSG_Data_Object::Get_NoData_Value(), and Get_Sorted().

Referenced by Get_Percentile().

◆ Get_Range()

double CSG_Grid::Get_Range ( void )

Definition at line 1034 of file grid.cpp.

References CSG_Simple_Statistics::Get_Range(), and CSG_Data_Object::Update().

Referenced by Invert(), and Normalise().

◆ Get_Row()

CSG_Vector CSG_Grid::Get_Row ( int y ) const

Definition at line 499 of file grid.cpp.

References asDouble(), CSG_Vector::Create(), Get_NX(), and Get_NY().

◆ Get_Scaling()

double CSG_Grid::Get_Scaling ( void ) const

Definition at line 430 of file grid.cpp.

Referenced by CSG_Grid_File_Info::Create(), Create(), Get_Histogram(), Get_Statistics(), and On_Update().

◆ Get_Sorted() [1/3]

sLong CSG_Grid::Get_Sorted | ( | sLong | Position,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 662 of file grid.h.

Referenced by Get_Quantile().

◆ Get_Sorted() [2/3]

bool CSG_Grid::Get_Sorted | ( | sLong | Position,
 |  | int & | x,
 |  | int & | y,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 682 of file grid.h.

◆ Get_Sorted() [3/3]

bool CSG_Grid::Get_Sorted | ( | sLong | Position,
 |  | sLong & | i,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 677 of file grid.h.

◆ Get_Statistics() [1/2]

bool CSG_Grid::Get_Statistics | ( | const CSG_Rect & | rWorld,
 |  | CSG_Simple_Statistics & | Statistics,
 |  | bool | bHoldValues = false
 | ) |  | const

Calculate statistics for the region specified with rWorld. Returns false, if there is no overlapping. Set bHoldValues to true, if you need to obtain quantiles.

Definition at line 1113 of file grid.cpp.

References asDouble(), CSG_Simple_Statistics::Create(), CSG_Simple_Statistics::Get_Count(), CSG_Data_Object::Get_Max_Samples(), Get_NX(), Get_NY(), Get_Offset(), Get_Scaling(), Get_System(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Grid_System::Get_xWorld_to_Grid(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), CSG_Grid_System::Get_yWorld_to_Grid(), CSG_Data_Object::is_NoData_Value(), and is_Scaled().

◆ Get_Statistics() [2/2]

const CSG_Simple_Statistics & CSG_Grid::Get_Statistics ( void )

Returns the statistics for the whole data set. It is automatically updated if necessary. Statistics give no access to parameters like quantiles that need values to be kept internally. Use Get_Quantile() function instead.

Definition at line 1101 of file grid.cpp.

References CSG_Data_Object::Update().

Referenced by Get_Histogram().

◆ Get_StdDev()

double CSG_Grid::Get_StdDev ( void )

Definition at line 1039 of file grid.cpp.

References CSG_Simple_Statistics::Get_StdDev(), and CSG_Data_Object::Update().

Referenced by Standardise().

◆ Get_System()

const CSG_Grid_System& CSG_Grid::Get_System ( void ) const
inline

Definition at line 531 of file grid.h.

Referenced by CSG_Grid_File_Info::Create(), Create(), CSG_Parameters_Grid_Target::Get_Grid(), Get_Histogram(), Get_Statistics(), is_Compatible(), CSG_Grids::is_Compatible(), CSG_Tool_Grid::Lock_Create(), and SG_Grid_Get_Geographic_Coordinates().

◆ Get_Type()

TSG_Data_Type CSG_Grid::Get_Type ( void ) const
inline

Definition at line 519 of file grid.h.

Referenced by CSG_Grid_File_Info::Create(), Create(), CSG_Grid_OGIS_Converter::from_WKBinary(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Data_Manager::Get_Summary(), CSG_Grids::is_Compatible(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_Unit()

const CSG_String& CSG_Grid::Get_Unit ( void ) const
inline

Definition at line 525 of file grid.h.

Referenced by Assign(), CSG_Grid_File_Info::Create(), and Create().

◆ Get_Value() [1/4]

bool CSG_Grid::Get_Value | ( | const TSG_Point & | p,
 |  | double & | Value,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | bool | bNoData = false,
 |  | bool | bByteWise = false
 | ) |  | const

Definition at line 554 of file grid.cpp.

References Get_Value(), SSG_Point::x, and SSG_Point::y.

◆ Get_Value() [2/4]

double CSG_Grid::Get_Value | ( | const TSG_Point & | p,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | bool | bByteWise = false
 | ) |  | const

Definition at line 540 of file grid.cpp.

References CSG_Data_Object::Get_NoData_Value(), Get_Value(), SSG_Point::x, and SSG_Point::y.

◆ Get_Value() [3/4]

bool CSG_Grid::Get_Value | ( | double | x,
 |  | double | y,
 |  | double & | Value,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | bool | bNoData = false,
 |  | bool | bByteWise = false
 | ) |  | const

Definition at line 560 of file grid.cpp.

References CSG_Rect::Contains(), Get_Cellsize(), CSG_Grid_System::Get_Extent(), CSG_Data_Object::Get_NoData_Value(), Get_XMin(), Get_YMin(), GRID_RESAMPLING_BicubicSpline, GRID_RESAMPLING_Bilinear, GRID_RESAMPLING_BSpline, GRID_RESAMPLING_NearestNeighbour, and is_InGrid().

◆ Get_Value() [4/4]

double CSG_Grid::Get_Value | ( | double | x,
 |  | double | y,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | bool | bByteWise = false
 | ) |  | const

Definition at line 547 of file grid.cpp.

References CSG_Data_Object::Get_NoData_Value().

Referenced by Get_Gradient(), and Get_Value().

◆ Get_Variance()

double CSG_Grid::Get_Variance ( void )

Definition at line 1044 of file grid.cpp.

References CSG_Simple_Statistics::Get_Variance(), and CSG_Data_Object::Update().

◆ Get_XMax()

double CSG_Grid::Get_XMax ( bool bCells = false ) const
inline

Definition at line 545 of file grid.h.

◆ Get_XMin()

double CSG_Grid::Get_XMin ( bool bCells = false ) const
inline

Definition at line 544 of file grid.h.

Referenced by Assign(), Create(), Get_Value(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_XRange()

double CSG_Grid::Get_XRange ( bool bCells = false ) const
inline

Definition at line 546 of file grid.h.

◆ Get_YMax()

double CSG_Grid::Get_YMax ( bool bCells = false ) const
inline

Definition at line 549 of file grid.h.

Referenced by CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_YMin()

double CSG_Grid::Get_YMin ( bool bCells = false ) const
inline

Definition at line 548 of file grid.h.

Referenced by Assign(), Create(), and Get_Value().

◆ Get_YRange()

double CSG_Grid::Get_YRange ( bool bCells = false ) const
inline

Definition at line 550 of file grid.h.

◆ Invert()

void CSG_Grid::Invert ( void )

Definition at line 734 of file grid_operation.cpp.

References asDouble(), Get_Max(), Get_Min(), Get_NX(), Get_NY(), Get_Range(), is_NoData(), is_Valid(), and Set_Value().

◆ is_Cached()

bool CSG_Grid::is_Cached ( void ) const
inline

Definition at line 605 of file grid.h.

Referenced by Assign(), is_Valid(), and Set_Cache().

◆ is_Compatible() [1/3]

bool CSG_Grid::is_Compatible ( const CSG_Grid_System & System ) const

Definition at line 481 of file grid.cpp.

◆ is_Compatible() [2/3]

bool CSG_Grid::is_Compatible ( CSG_Grid * pGrid ) const

Definition at line 476 of file grid.cpp.

References Get_System().

Referenced by is_Compatible().

◆ is_Compatible() [3/3]

bool CSG_Grid::is_Compatible | ( | int | NX,
 |  | int | NY,
 |  | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin
 | ) |  | const

Definition at line 486 of file grid.cpp.

References is_Compatible().

◆ is_InGrid()

bool CSG_Grid::is_InGrid | ( | int | x,
 |  | int | y,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 593 of file grid.h.

Referenced by Get_Gradient(), Get_Gradient_NeighborDir(), and Get_Value().

◆ is_InGrid_byPos() [1/2]

bool CSG_Grid::is_InGrid_byPos | ( | const TSG_Point & | p,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 595 of file grid.h.

References is_InGrid_byPos(), SSG_Point::x, and SSG_Point::y.

Referenced by is_InGrid_byPos().

◆ is_InGrid_byPos() [2/2]

bool CSG_Grid::is_InGrid_byPos | ( | double | x,
 |  | double | y,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 594 of file grid.h.

References CSG_Data_Object::Get_Extent().

◆ is_Intersecting() [1/3]

TSG_Intersection CSG_Grid::is_Intersecting ( const CSG_Rect & Extent ) const

Definition at line 460 of file grid.cpp.

References Get_Extent().

Referenced by Assign(), and is_Intersecting().

◆ is_Intersecting() [2/3]

TSG_Intersection CSG_Grid::is_Intersecting ( const TSG_Rect & Extent ) const

Definition at line 465 of file grid.cpp.

References Get_Extent().

◆ is_Intersecting() [3/3]

TSG_Intersection CSG_Grid::is_Intersecting | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  | const

Definition at line 470 of file grid.cpp.

References is_Intersecting().

◆ is_NoData() [1/2]

virtual bool CSG_Grid::is_NoData | ( | int | x,
 |  | int | y
 | ) |  | const
 inlinevirtual

Definition at line 699 of file grid.h.

References CSG_Data_Object::is_NoData_Value().

Referenced by Assign(), CSG_Natural_Breaks::Create(), CSG_Histogram::Create(), DeNormalise(), DeStandardise(), Invert(), Normalise(), Standardise(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ is_NoData() [2/2]

virtual bool CSG_Grid::is_NoData ( sLong i ) const
inlinevirtual

Definition at line 700 of file grid.h.

References CSG_Data_Object::is_NoData_Value().

◆ is_Scaled()

bool CSG_Grid::is_Scaled ( void ) const
inline

Definition at line 559 of file grid.h.

Referenced by Get_Histogram(), Get_Statistics(), and On_Update().

◆ is_Valid()

bool CSG_Grid::is_Valid ( void ) const
virtual

Implements CSG_Data_Object.

Definition at line 449 of file grid.cpp.

References is_Cached(), CSG_Grid_System::is_Valid(), and SG_DATATYPE_Undefined.

Referenced by CSG_Grids::Add_Grid(), Assign(), CSG_Grid_Pyramid::Create(), DeNormalise(), DeStandardise(), Flip(), Invert(), Mirror(), Normalise(), On_Update(), SG_Create_Grid(), SG_Grid_Get_Geographic_Coordinates(), and Standardise().

◆ Mirror()

void CSG_Grid::Mirror ( void )

Definition at line 774 of file grid_operation.cpp.

References asDouble(), Get_NX(), Get_NY(), is_Valid(), and Set_Value().

◆ Mul_Value() [1/2]

virtual void CSG_Grid::Mul_Value | ( | int | x,
 |  | int | y,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 811 of file grid.h.

◆ Mul_Value() [2/2]

virtual void CSG_Grid::Mul_Value | ( | sLong | i,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 812 of file grid.h.

◆ Multiply() [1/2]

CSG_Grid & CSG_Grid::Multiply ( const CSG_Grid & Grid )
virtual

Definition at line 573 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

Referenced by CSG_Grids::Multiply().

◆ Multiply() [2/2]

CSG_Grid & CSG_Grid::Multiply ( double Value )
virtual

Definition at line 578 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

◆ Normalise()

bool CSG_Grid::Normalise ( void )

Definition at line 799 of file grid_operation.cpp.

References asDouble(), Get_Min(), Get_NX(), Get_NY(), Get_Range(), is_NoData(), is_Valid(), and Set_Value().

◆ On_Delete()

bool CSG_Grid::On_Delete ( void )
protectedvirtual

Implements CSG_Data_Object.

Definition at line 80 of file grid_io.cpp.

References CSG_Data_Object::Get_File_Name(), SG_File_Delete(), and SG_File_Set_Extension().

◆ On_Reload()

bool CSG_Grid::On_Reload ( void )
protectedvirtual

Implements CSG_Data_Object.

Definition at line 74 of file grid_io.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_Grid::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Data_Object.

Definition at line 965 of file grid.cpp.

References asDouble(), CSG_Histogram::Destroy(), CSG_Simple_Statistics::Get_Count(), CSG_Data_Object::Get_Max_Samples(), Get_NCells(), Get_NX(), Get_NY(), Get_Offset(), Get_Scaling(), CSG_Simple_Statistics::Invalidate(), CSG_Data_Object::is_NoData_Value(), is_Scaled(), is_Valid(), CSG_Simple_Statistics::Set_Count(), SG_FREE_SAFE, SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().

◆ operator()()

virtual double CSG_Grid::operator() | ( | int | x,
 |  | int | y
 | ) |  | const
 inlinevirtual

Definition at line 740 of file grid.h.

◆ operator*() [1/2]

CSG_Grid CSG_Grid::operator* ( const CSG_Grid & Grid ) const
virtual

Definition at line 549 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

◆ operator*() [2/2]

CSG_Grid CSG_Grid::operator* ( double Value ) const
virtual

Definition at line 556 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

◆ operator*=() [1/2]

CSG_Grid & CSG_Grid::operator*= ( const CSG_Grid & Grid )
virtual

Definition at line 563 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

◆ operator*=() [2/2]

CSG_Grid & CSG_Grid::operator*= ( double Value )
virtual

Definition at line 568 of file grid_operation.cpp.

References GRID_OPERATION_Multiplication.

◆ operator+() [1/2]

CSG_Grid CSG_Grid::operator+ ( const CSG_Grid & Grid ) const
virtual

Definition at line 479 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

◆ operator+() [2/2]

CSG_Grid CSG_Grid::operator+ ( double Value ) const
virtual

Definition at line 486 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

◆ operator+=() [1/2]

CSG_Grid & CSG_Grid::operator+= ( const CSG_Grid & Grid )
virtual

Definition at line 493 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

◆ operator+=() [2/2]

CSG_Grid & CSG_Grid::operator+= ( double Value )
virtual

Definition at line 498 of file grid_operation.cpp.

References GRID_OPERATION_Addition.

◆ operator-() [1/2]

CSG_Grid CSG_Grid::operator- ( const CSG_Grid & Grid ) const
virtual

Definition at line 514 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

◆ operator-() [2/2]

CSG_Grid CSG_Grid::operator- ( double Value ) const
virtual

Definition at line 521 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

◆ operator-=() [1/2]

CSG_Grid & CSG_Grid::operator-= ( const CSG_Grid & Grid )
virtual

Definition at line 528 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

◆ operator-=() [2/2]

CSG_Grid & CSG_Grid::operator-= ( double Value )
virtual

Definition at line 533 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

◆ operator/() [1/2]

CSG_Grid CSG_Grid::operator/ ( const CSG_Grid & Grid ) const
virtual

Definition at line 584 of file grid_operation.cpp.

References GRID_OPERATION_Division.

◆ operator/() [2/2]

CSG_Grid CSG_Grid::operator/ ( double Value ) const
virtual

Definition at line 591 of file grid_operation.cpp.

References GRID_OPERATION_Division.

◆ operator/=() [1/2]

CSG_Grid & CSG_Grid::operator/= ( const CSG_Grid & Grid )
virtual

Definition at line 598 of file grid_operation.cpp.

References GRID_OPERATION_Division.

◆ operator/=() [2/2]

CSG_Grid & CSG_Grid::operator/= ( double Value )
virtual

Definition at line 603 of file grid_operation.cpp.

References GRID_OPERATION_Division.

◆ operator=() [1/2]

CSG_Grid & CSG_Grid::operator= ( const CSG_Grid & Grid )
virtual

Definition at line 464 of file grid_operation.cpp.

References Assign(), and GRID_RESAMPLING_Undefined.

◆ operator=() [2/2]

CSG_Grid & CSG_Grid::operator= ( double Value )
virtual

Definition at line 471 of file grid_operation.cpp.

References Assign().

◆ Save() [1/3]

virtual bool CSG_Grid::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Definition at line 507 of file grid.h.

References Save().

Referenced by Save().

◆ Save() [2/3]

bool CSG_Grid::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Implements CSG_Data_Object.

Definition at line 147 of file grid_io.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF, GRID_FILE_FORMAT_Undefined, gSG_Grid_File_Format_Default, CSG_Data_Object::Set_File_Name(), Set_Modified(), SG_File_Cmp_Extension(), SG_RUN_TOOL, SG_T, SG_TOOL_PARAMETER_SET, SG_TOOL_PARAMLIST_ADD, SG_UI_Msg_Add(), SG_UI_Msg_Lock(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_Process_Set_Ready().

◆ Save() [3/3]

virtual bool CSG_Grid::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Definition at line 508 of file grid.h.

References Save().

Referenced by Save().

◆ Set_Cache()

bool CSG_Grid::Set_Cache ( bool bOn )

Definition at line 257 of file grid_memory.cpp.

References CSG_Data_Object::Get_File_Name(), is_Cached(), and SG_File_Make_Path().

◆ Set_Index()

bool CSG_Grid::Set_Index ( bool bOn = true )
inline

Definition at line 650 of file grid.h.

References SG_FREE_SAFE.

◆ Set_Modified()

virtual void CSG_Grid::Set_Modified ( bool bModified = true )
inlinevirtual

Reimplemented from CSG_Data_Object.

Definition at line 636 of file grid.h.

References CSG_Data_Object::Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by Create(), and Save().

◆ Set_NoData() [1/2]

virtual void CSG_Grid::Set_NoData | ( | int | x,
 |  | int | y
 | ) |  |
inlinevirtual

Definition at line 702 of file grid.h.

References CSG_Data_Object::Get_NoData_Value().

Referenced by Assign().

◆ Set_NoData() [2/2]

virtual void CSG_Grid::Set_NoData ( sLong i )
inlinevirtual

Definition at line 703 of file grid.h.

References CSG_Data_Object::Get_NoData_Value().

◆ Set_Row()

bool CSG_Grid::Set_Row | ( | int | y,
 |  | const CSG_Vector & | Values
 | ) |  |

Definition at line 517 of file grid.cpp.

References CSG_Vector::Get_N(), Get_NX(), Get_NY(), and Set_Value().

◆ Set_Scaling()

void CSG_Grid::Set_Scaling | ( | double | Scale = 1.0,
 |  | double | Offset = 0.0
 | ) |  |

Definition at line 414 of file grid.cpp.

References CSG_Data_Object::Set_Update_Flag().

Referenced by Create(), and CSG_Grids::Set_Scaling().

◆ Set_Unit()

void CSG_Grid::Set_Unit ( const CSG_String & Unit )

Definition at line 408 of file grid.cpp.

Referenced by Assign(), Create(), and CSG_Grids::Set_Unit().

◆ Set_Value() [1/2]

virtual void CSG_Grid::Set_Value | ( | int | x,
 |  | int | y,
 |  | double | Value,
 |  | bool | bScaled = true
 | ) |  |
inlinevirtual

Definition at line 820 of file grid.h.

References CSG_Data_Object::Set_Modified(), SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_ULong, SG_DATATYPE_Word, SG_ROUND_TO_BYTE, SG_ROUND_TO_CHAR, SG_ROUND_TO_DWORD, SG_ROUND_TO_INT, SG_ROUND_TO_SHORT, SG_ROUND_TO_SLONG, SG_ROUND_TO_ULONG, and SG_ROUND_TO_WORD.

◆ Set_Value() [2/2]

virtual void CSG_Grid::Set_Value | ( | sLong | i,
 |  | double | Value,
 |  | bool | bScaled = true
 | ) |  |
inlinevirtual

Definition at line 815 of file grid.h.

Referenced by Assign(), Assign_NoData(), Create(), DeNormalise(), DeStandardise(), Flip(), CSG_Grid_OGIS_Converter::from_WKBinary(), Invert(), Mirror(), Normalise(), Set_Row(), and Standardise().

◆ Standardise()

bool CSG_Grid::Standardise ( void )

Definition at line 848 of file grid_operation.cpp.

References asDouble(), Get_Mean(), Get_NX(), Get_NY(), Get_StdDev(), is_NoData(), is_Valid(), and Set_Value().

◆ Subtract() [1/2]

CSG_Grid & CSG_Grid::Subtract ( const CSG_Grid & Grid )
virtual

Definition at line 538 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

Referenced by CSG_Grids::Subtract().

◆ Subtract() [2/2]

CSG_Grid & CSG_Grid::Subtract ( double Value )
virtual

Definition at line 543 of file grid_operation.cpp.

References GRID_OPERATION_Subtraction.

The documentation for this class was generated from the following files:
  • grid.h
  • grid.cpp
  • grid_io.cpp
  • grid_memory.cpp
  • grid_operation.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid Member List

This is the complete list of members for CSG_Grid, including all inherited members.

Add(const CSG_Grid &Grid) | CSG_Grid | virtual
Add(double Value) | CSG_Grid | virtual
Add_Value(int x, int y, double Value) | CSG_Grid | inlinevirtual
Add_Value(sLong i, double Value) | CSG_Grid | inlinevirtual
asByte(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asByte(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asChar(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asChar(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asDouble(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asDouble(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asFloat(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asFloat(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asInt(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asInt(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asLong(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asLong(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
asShort(int x, int y, bool bScaled=true) const | CSG_Grid | inlinevirtual
asShort(sLong i, bool bScaled=true) const | CSG_Grid | inlinevirtual
Assign(double Value=0.0) | CSG_Grid | virtual
Assign(CSG_Data_Object *pObject) | CSG_Grid | virtual
Assign(CSG_Grid *pGrid, TSG_Grid_Resampling Interpolation) | CSG_Grid | virtual
Assign_NoData(void) | CSG_Grid |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(const CSG_Grid &Grid) | CSG_Grid |
Create(const CSG_String &File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
Create(const char *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
Create(const wchar_t *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
Create(CSG_Grid *pGrid, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false) | CSG_Grid |
Create(const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false) | CSG_Grid |
Create(TSG_Data_Type Type, int NX, int NY, double Cellsize=0.0, double xMin=0.0, double yMin=0.0, bool bCached=false) | CSG_Grid |
CSG_Data_Object(void) | CSG_Data_Object |
CSG_Grid(void) | CSG_Grid |
CSG_Grid(const CSG_Grid &Grid) | CSG_Grid |
CSG_Grid(const CSG_String &File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
CSG_Grid(const char *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
CSG_Grid(const wchar_t *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true) | CSG_Grid |
CSG_Grid(CSG_Grid *pGrid, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false) | CSG_Grid |
CSG_Grid(const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false) | CSG_Grid |
CSG_Grid(TSG_Data_Type Type, int NX, int NY, double Cellsize=0.0, double xMin=0.0, double yMin=0.0, bool bCached=false) | CSG_Grid |
Delete(void) | CSG_Data_Object |
DeNormalise(double Minimum, double Maximum) | CSG_Grid |
DeStandardise(double Mean, double StdDev) | CSG_Grid |
Destroy(void) | CSG_Grid | virtual
Divide(const CSG_Grid &Grid) | CSG_Grid | virtual
Divide(double Value) | CSG_Grid | virtual
Flip(void) | CSG_Grid |
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Cellarea(void) const | CSG_Grid | inline
Get_Cellsize(void) const | CSG_Grid | inline
Get_Data_Count(void) | CSG_Grid |
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void) | CSG_Grid | inlinevirtual
Get_Extent(bool bCells=false) const | CSG_Grid | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_Gradient(int x, int y, double &Slope, double &Aspect) const | CSG_Grid |
Get_Gradient(double x, double y, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const | CSG_Grid |
Get_Gradient(const TSG_Point &p, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const | CSG_Grid |
Get_Gradient_NeighborDir(int x, int y, bool bDown=true, bool bNoEdges=true) const | CSG_Grid |
Get_Histogram(size_t nClasses=0) | CSG_Grid |
Get_Histogram(const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses=0) const | CSG_Grid |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Max(void) | CSG_Grid |
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Mean(void) | CSG_Grid |
Get_Memory_Size(void) const | CSG_Grid | inline
Get_Memory_Size_MB(void) const | CSG_Grid | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Min(void) | CSG_Grid |
Get_Name(void) const | CSG_Data_Object |
Get_NCells(void) const | CSG_Grid | inline
Get_nLineBytes(void) const | CSG_Grid | inline
Get_NoData_Count(void) | CSG_Grid |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_nValueBytes(void) const | CSG_Grid | inline
Get_NX(void) const | CSG_Grid | inline
Get_NY(void) const | CSG_Grid | inline
Get_ObjectType(void) const | CSG_Grid | inlinevirtual
Get_Offset(void) const | CSG_Grid |
Get_Owner(void) const | CSG_Data_Object | inline
Get_Percentile(double Percentile, bool bFromHistogram=true) | CSG_Grid |
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Quantile(double Quantile, bool bFromHistogram=true) | CSG_Grid |
Get_Range(void) | CSG_Grid |
Get_Row(int y) const | CSG_Grid |
Get_Scaling(void) const | CSG_Grid |
Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true) | CSG_Grid | inline
Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true) | CSG_Grid | inline
Get_Sorted(sLong Position, int &x, int &y, bool bDown=true, bool bCheckNoData=true) | CSG_Grid | inline
Get_Statistics(void) | CSG_Grid |
Get_Statistics(const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues=false) const | CSG_Grid |
Get_StdDev(void) | CSG_Grid |
Get_System(void) const | CSG_Grid | inline
Get_Type(void) const | CSG_Grid | inline
Get_Unit(void) const | CSG_Grid | inline
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(double x, double y, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const | CSG_Grid |
Get_Value(const TSG_Point &p, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const | CSG_Grid |
Get_Value(double x, double y, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bNoData=false, bool bByteWise=false) const | CSG_Grid |
Get_Value(const TSG_Point &p, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bNoData=false, bool bByteWise=false) const | CSG_Grid |
Get_Variance(void) | CSG_Grid |
Get_XMax(bool bCells=false) const | CSG_Grid | inline
Get_XMin(bool bCells=false) const | CSG_Grid | inline
Get_XRange(bool bCells=false) const | CSG_Grid | inline
Get_YMax(bool bCells=false) const | CSG_Grid | inline
Get_YMin(bool bCells=false) const | CSG_Grid | inline
Get_YRange(bool bCells=false) const | CSG_Grid | inline
Invert(void) | CSG_Grid |
is_Cached(void) const | CSG_Grid | inline
is_Compatible(CSG_Grid *pGrid) const | CSG_Grid |
is_Compatible(const CSG_Grid_System &System) const | CSG_Grid |
is_Compatible(int NX, int NY, double Cellsize, double xMin, double yMin) const | CSG_Grid |
is_File_Native(void) const | CSG_Data_Object | inline
is_InGrid(int x, int y, bool bCheckNoData=true) const | CSG_Grid | inline
is_InGrid_byPos(double x, double y, bool bCheckNoData=true) const | CSG_Grid | inline
is_InGrid_byPos(const TSG_Point &p, bool bCheckNoData=true) const | CSG_Grid | inline
is_Intersecting(const CSG_Rect &Extent) const | CSG_Grid |
is_Intersecting(const TSG_Rect &Extent) const | CSG_Grid |
is_Intersecting(double xMin, double yMin, double xMax, double yMax) const | CSG_Grid |
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData(int x, int y) const | CSG_Grid | inlinevirtual
is_NoData(sLong i) const | CSG_Grid | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Scaled(void) const | CSG_Grid | inline
is_Valid(void) const | CSG_Grid | virtual
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_pOwner | CSG_Data_Object | protected
Mirror(void) | CSG_Grid |
Mul_Value(int x, int y, double Value) | CSG_Grid | inlinevirtual
Mul_Value(sLong i, double Value) | CSG_Grid | inlinevirtual
Multiply(const CSG_Grid &Grid) | CSG_Grid | virtual
Multiply(double Value) | CSG_Grid | virtual
Normalise(void) | CSG_Grid |
On_Delete(void) | CSG_Grid | protectedvirtual
On_NoData_Changed(void) | CSG_Data_Object | protectedvirtual
On_Reload(void) | CSG_Grid | protectedvirtual
On_Update(void) | CSG_Grid | protectedvirtual
operator()(int x, int y) const | CSG_Grid | inlinevirtual
operator*(const CSG_Grid &Grid) const | CSG_Grid | virtual
operator*(double Value) const | CSG_Grid | virtual
operator*=(const CSG_Grid &Grid) | CSG_Grid | virtual
operator*=(double Value) | CSG_Grid | virtual
operator+(const CSG_Grid &Grid) const | CSG_Grid | virtual
operator+(double Value) const | CSG_Grid | virtual
operator+=(const CSG_Grid &Grid) | CSG_Grid | virtual
operator+=(double Value) | CSG_Grid | virtual
operator-(const CSG_Grid &Grid) const | CSG_Grid | virtual
operator-(double Value) const | CSG_Grid | virtual
operator-=(const CSG_Grid &Grid) | CSG_Grid | virtual
operator-=(double Value) | CSG_Grid | virtual
operator/(const CSG_Grid &Grid) const | CSG_Grid | virtual
operator/(double Value) const | CSG_Grid | virtual
operator/=(const CSG_Grid &Grid) | CSG_Grid | virtual
operator/=(double Value) | CSG_Grid | virtual
operator=(const CSG_Grid &Grid) | CSG_Grid | virtual
operator=(double Value) | CSG_Grid | virtual
Reload(void) | CSG_Data_Object |
Save(const char *File, int Format=0) | CSG_Grid | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_Grid | inlinevirtual
Save(const CSG_String &File, int Format=0) | CSG_Grid | virtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Set_Cache(bool bOn) | CSG_Grid |
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Index(bool bOn=true) | CSG_Grid | inline
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bModified=true) | CSG_Grid | inlinevirtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData(int x, int y) | CSG_Grid | inlinevirtual
Set_NoData(sLong i) | CSG_Grid | inlinevirtual
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Row(int y, const CSG_Vector &Values) | CSG_Grid |
Set_Scaling(double Scale=1.0, double Offset=0.0) | CSG_Grid |
Set_Unit(const CSG_String &Unit) | CSG_Grid |
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(sLong i, double Value, bool bScaled=true) | CSG_Grid | inlinevirtual
Set_Value(int x, int y, double Value, bool bScaled=true) | CSG_Grid | inlinevirtual
Standardise(void) | CSG_Grid |
Subtract(const CSG_Grid &Grid) | CSG_Grid | virtual
Subtract(double Value) | CSG_Grid | virtual
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_Grid(void) | CSG_Grid | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_Cell_Addressor Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Grid_Cell_Addressor Class Reference

#include <grid.h>

Public Member Functions

CSG_Grid_Cell_Addressor (void)
bool | Destroy (void)
bool | Set_Parameters (class CSG_Parameters &Parameters, int Type=0)
bool | Set_Square (class CSG_Parameters &Parameters)
bool | Set_Circle (class CSG_Parameters &Parameters)
bool | Set_Annulus (class CSG_Parameters &Parameters)
bool | Set_Sector (class CSG_Parameters &Parameters)
CSG_Distance_Weighting & | Get_Weighting (void)
bool | is_Square (void) const
bool | is_Circle (void) const
bool | is_Annulus (void) const
bool | is_Sector (void) const
bool | Set_Radius (double Radius, bool bSquare=false)
bool | Set_Square (double Radius)
bool | Set_Circle (double Radius)
bool | Set_Annulus (double Radius_Inner, double Radius_Outer)
bool | Set_Sector (double Radius, double Direction, double Tolerance)
double | Get_Radius (bool bOuter=true) const
double | Get_Radius_Inner (void) const
double | Get_Radius_Outer (void) const
double | Get_Direction (void) const
double | Get_Tolerance (void) const
int | Get_Count (void) const
int | Get_X (int Index, int Offset=0) const
int | Get_Y (int Index, int Offset=0) const
double | Get_Distance (int Index) const
double | Get_Weight (int Index) const
bool | Get_Values (int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset=false) const

Static Public Member Functions

static bool | Enable_Parameters (class CSG_Parameters &Parameters)
static bool | Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent="", int Style=SG_GRIDCELLADDR_PARM_DEFAULT)

Detailed Description

Definition at line 1102 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_Cell_Addressor()

CSG_Grid_Cell_Addressor::CSG_Grid_Cell_Addressor ( void )

Definition at line 326 of file grid_system.cpp.

References CSG_Table::Add_Field(), SG_DATATYPE_Double, and SG_DATATYPE_Int.

Member Function Documentation

◆ Add_Parameters()

bool CSG_Grid_Cell_Addressor::Add_Parameters | ( | class CSG_Parameters & | Parameters,
 |  | const CSG_String & | Parent = "",
 |  | int | Style = SG_GRIDCELLADDR_PARM_DEFAULT
 | ) |  |
static

Definition at line 353 of file grid_system.cpp.

References _TL, CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Double(), CSG_Parameters::Add_Int(), CSG_Distance_Weighting::Add_Parameters(), CSG_String::Format(), Get_Count(), CSG_Parameters::Set_Enabled(), SG_GRIDCELLADDR_PARM_ANNULUS, SG_GRIDCELLADDR_PARM_CIRCLE, SG_GRIDCELLADDR_PARM_MAPUNIT, SG_GRIDCELLADDR_PARM_SECTOR, SG_GRIDCELLADDR_PARM_SIZEDBL, SG_GRIDCELLADDR_PARM_SQUARE, and SG_GRIDCELLADDR_PARM_WEIGHTING.

◆ Destroy()

bool CSG_Grid_Cell_Addressor::Destroy ( void )

Definition at line 335 of file grid_system.cpp.

References CSG_Table::Del_Records().

◆ Enable_Parameters()

bool CSG_Grid_Cell_Addressor::Enable_Parameters ( class CSG_Parameters & Parameters )
static

Definition at line 474 of file grid_system.cpp.

References CSG_Grid::asInt(), CSG_Distance_Weighting::Enable_Parameters(), CSG_Parameters::Set_Enabled(), SG_GRIDCELLADDR_PARM_ANNULUS, and SG_GRIDCELLADDR_PARM_SECTOR.

◆ Get_Count()

int CSG_Grid_Cell_Addressor::Get_Count ( void ) const
inline

Definition at line 1137 of file grid.h.

Referenced by Add_Parameters().

◆ Get_Direction()

double CSG_Grid_Cell_Addressor::Get_Direction ( void ) const
inline

Definition at line 1134 of file grid.h.

◆ Get_Distance()

double CSG_Grid_Cell_Addressor::Get_Distance ( int Index ) const
inline

Definition at line 1140 of file grid.h.

◆ Get_Radius()

double CSG_Grid_Cell_Addressor::Get_Radius ( bool bOuter = true ) const
inline

Definition at line 1131 of file grid.h.

◆ Get_Radius_Inner()

double CSG_Grid_Cell_Addressor::Get_Radius_Inner ( void ) const
inline

Definition at line 1132 of file grid.h.

◆ Get_Radius_Outer()

double CSG_Grid_Cell_Addressor::Get_Radius_Outer ( void ) const
inline

Definition at line 1133 of file grid.h.

◆ Get_Tolerance()

double CSG_Grid_Cell_Addressor::Get_Tolerance ( void ) const
inline

Definition at line 1135 of file grid.h.

◆ Get_Values()

bool CSG_Grid_Cell_Addressor::Get_Values | ( | int | Index,
 |  | int & | x,
 |  | int & | y,
 |  | double & | Distance,
 |  | double & | Weight,
 |  | bool | bOffset = false
 | ) |  | const
 inline

Definition at line 1142 of file grid.h.

References CSG_Table_Record::asDouble(), and CSG_Table_Record::asInt().

◆ Get_Weight()

double CSG_Grid_Cell_Addressor::Get_Weight ( int Index ) const
inline

Definition at line 1141 of file grid.h.

◆ Get_Weighting()

CSG_Distance_Weighting& CSG_Grid_Cell_Addressor::Get_Weighting ( void )
inline

Definition at line 1118 of file grid.h.

◆ Get_X()

int CSG_Grid_Cell_Addressor::Get_X | ( | int | Index,
 |  | int | Offset = 0
 | ) |  | const
 inline

Definition at line 1138 of file grid.h.

◆ Get_Y()

int CSG_Grid_Cell_Addressor::Get_Y | ( | int | Index,
 |  | int | Offset = 0
 | ) |  | const
 inline

Definition at line 1139 of file grid.h.

◆ is_Annulus()

bool CSG_Grid_Cell_Addressor::is_Annulus ( void ) const
inline

Definition at line 1122 of file grid.h.

◆ is_Circle()

bool CSG_Grid_Cell_Addressor::is_Circle ( void ) const
inline

Definition at line 1121 of file grid.h.

◆ is_Sector()

bool CSG_Grid_Cell_Addressor::is_Sector ( void ) const
inline

Definition at line 1123 of file grid.h.

◆ is_Square()

bool CSG_Grid_Cell_Addressor::is_Square ( void ) const
inline

Definition at line 1120 of file grid.h.

◆ Set_Annulus() [1/2]

bool CSG_Grid_Cell_Addressor::Set_Annulus ( class CSG_Parameters & Parameters )

Definition at line 465 of file grid_system.cpp.

References Set_Parameters(), and SG_GRIDCELLADDR_PARM_ANNULUS.

Referenced by Set_Parameters().

◆ Set_Annulus() [2/2]

bool CSG_Grid_Cell_Addressor::Set_Annulus | ( | double | Radius_Inner,
 |  | double | Radius_Outer
 | ) |  |

Definition at line 610 of file grid_system.cpp.

◆ Set_Circle() [1/2]

bool CSG_Grid_Cell_Addressor::Set_Circle ( class CSG_Parameters & Parameters )

Definition at line 464 of file grid_system.cpp.

References Set_Parameters(), and SG_GRIDCELLADDR_PARM_CIRCLE.

Referenced by Set_Radius().

◆ Set_Circle() [2/2]

bool CSG_Grid_Cell_Addressor::Set_Circle ( double Radius )

Definition at line 604 of file grid_system.cpp.

◆ Set_Parameters()

bool CSG_Grid_Cell_Addressor::Set_Parameters | ( | class CSG_Parameters & | Parameters,
 |  | int | Type = 0
 | ) |  |

Definition at line 424 of file grid_system.cpp.

References CSG_Grid::asDouble(), M_DEG_TO_RAD, Set_Annulus(), Set_Radius(), Set_Sector(), SG_GRIDCELLADDR_PARM_ANNULUS, SG_GRIDCELLADDR_PARM_CIRCLE, SG_GRIDCELLADDR_PARM_SECTOR, and SG_GRIDCELLADDR_PARM_SQUARE.

Referenced by Set_Annulus(), Set_Circle(), Set_Sector(), and Set_Square().

◆ Set_Radius()

bool CSG_Grid_Cell_Addressor::Set_Radius | ( | double | Radius,
 |  | bool | bSquare = false
 | ) |  |

Definition at line 592 of file grid_system.cpp.

References Set_Circle(), and Set_Square().

Referenced by Set_Parameters().

◆ Set_Sector() [1/2]

bool CSG_Grid_Cell_Addressor::Set_Sector ( class CSG_Parameters & Parameters )

Definition at line 466 of file grid_system.cpp.

References Set_Parameters(), and SG_GRIDCELLADDR_PARM_SECTOR.

Referenced by Set_Parameters().

◆ Set_Sector() [2/2]

bool CSG_Grid_Cell_Addressor::Set_Sector | ( | double | Radius,
 |  | double | Direction,
 |  | double | Tolerance
 | ) |  |

Definition at line 616 of file grid_system.cpp.

◆ Set_Square() [1/2]

bool CSG_Grid_Cell_Addressor::Set_Square ( class CSG_Parameters & Parameters )

Definition at line 463 of file grid_system.cpp.

References Set_Parameters(), and SG_GRIDCELLADDR_PARM_SQUARE.

Referenced by Set_Radius().

◆ Set_Square() [2/2]

bool CSG_Grid_Cell_Addressor::Set_Square ( double Radius )

Definition at line 598 of file grid_system.cpp.

The documentation for this class was generated from the following files:
  • grid.h
  • grid_system.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_Cell_Addressor Member List

This is the complete list of members for CSG_Grid_Cell_Addressor, including all inherited members.

Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", int Style=SG_GRIDCELLADDR_PARM_DEFAULT) | CSG_Grid_Cell_Addressor | static
CSG_Grid_Cell_Addressor(void) | CSG_Grid_Cell_Addressor |
Destroy(void) | CSG_Grid_Cell_Addressor |
Enable_Parameters(class CSG_Parameters &Parameters) | CSG_Grid_Cell_Addressor | static
Get_Count(void) const | CSG_Grid_Cell_Addressor | inline
Get_Direction(void) const | CSG_Grid_Cell_Addressor | inline
Get_Distance(int Index) const | CSG_Grid_Cell_Addressor | inline
Get_Radius(bool bOuter=true) const | CSG_Grid_Cell_Addressor | inline
Get_Radius_Inner(void) const | CSG_Grid_Cell_Addressor | inline
Get_Radius_Outer(void) const | CSG_Grid_Cell_Addressor | inline
Get_Tolerance(void) const | CSG_Grid_Cell_Addressor | inline
Get_Values(int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset=false) const | CSG_Grid_Cell_Addressor | inline
Get_Weight(int Index) const | CSG_Grid_Cell_Addressor | inline
Get_Weighting(void) | CSG_Grid_Cell_Addressor | inline
Get_X(int Index, int Offset=0) const | CSG_Grid_Cell_Addressor | inline
Get_Y(int Index, int Offset=0) const | CSG_Grid_Cell_Addressor | inline
is_Annulus(void) const | CSG_Grid_Cell_Addressor | inline
is_Circle(void) const | CSG_Grid_Cell_Addressor | inline
is_Sector(void) const | CSG_Grid_Cell_Addressor | inline
is_Square(void) const | CSG_Grid_Cell_Addressor | inline
Set_Annulus(class CSG_Parameters &Parameters) | CSG_Grid_Cell_Addressor |
Set_Annulus(double Radius_Inner, double Radius_Outer) | CSG_Grid_Cell_Addressor |
Set_Circle(class CSG_Parameters &Parameters) | CSG_Grid_Cell_Addressor |
Set_Circle(double Radius) | CSG_Grid_Cell_Addressor |
Set_Parameters(class CSG_Parameters &Parameters, int Type=0) | CSG_Grid_Cell_Addressor |
Set_Radius(double Radius, bool bSquare=false) | CSG_Grid_Cell_Addressor |
Set_Sector(class CSG_Parameters &Parameters) | CSG_Grid_Cell_Addressor |
Set_Sector(double Radius, double Direction, double Tolerance) | CSG_Grid_Cell_Addressor |
Set_Square(class CSG_Parameters &Parameters) | CSG_Grid_Cell_Addressor |
Set_Square(double Radius) | CSG_Grid_Cell_Addressor |
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_Collection Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Grid_Collection Class Reference

#include <data_manager.h>

Inheritance diagram for CSG_Grid_Collection:
CSG_Data_Collection

Public Member Functions

virtual bool | Exists (CSG_Data_Object *pObject) const
const CSG_Grid_System & | Get_System (void) const
bool | is_Equal (const CSG_Grid_System &System) const
- Public Member Functions inherited from CSG_Data_Collection
size_t | Count (void) const
CSG_Data_Object * | Get (size_t i) const
CSG_Data_Object * | Get (const CSG_String &File, bool bNative=true) const

Protected Member Functions

CSG_Grid_Collection (class CSG_Data_Manager *pManager)
virtual bool | Add (CSG_Data_Object *pObject)
- Protected Member Functions inherited from CSG_Data_Collection
CSG_Data_Collection (class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type)
virtual | ~CSG_Data_Collection (void)
bool | Delete (CSG_Data_Object *pObject, bool bDetach=false)
bool | Delete (size_t i, bool bDetach=false)
bool | Delete (bool bDetach=false, bool bUnsaved=false)
bool | Delete_All (bool bDetach=false)
bool | Delete_Unsaved (bool bDetach=false)

Protected Attributes

CSG_Grid_System m_System
- Protected Attributes inherited from CSG_Data_Collection
class CSG_Data_Manager * m_pManager
TSG_Data_Object_Type m_Type
CSG_Array_Pointer m_Objects

Friends

class CSG_Data_Manager

Detailed Description

Definition at line 130 of file data_manager.h.

Constructor & Destructor Documentation

◆ CSG_Grid_Collection()

CSG_Grid_Collection::CSG_Grid_Collection ( class CSG_Data_Manager * pManager )
protected

Definition at line 241 of file data_manager.cpp.

Member Function Documentation

◆ Add()

bool CSG_Grid_Collection::Add ( CSG_Data_Object * pObject )
protectedvirtual

Reimplemented from CSG_Data_Collection.

Definition at line 277 of file data_manager.cpp.

References CSG_Data_Collection::Add(), CSG_Data_Collection::Count(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Data_Object::Get_ObjectType(), CSG_Grid_System::is_Valid(), m_System, SG_DATAOBJECT_TYPE_Grid, and SG_DATAOBJECT_TYPE_Grids.

◆ Exists()

bool CSG_Grid_Collection::Exists ( CSG_Data_Object * pObject ) const
virtual

Reimplemented from CSG_Data_Collection.

Definition at line 246 of file data_manager.cpp.

References CSG_Data_Collection::Count(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Data_Collection::Get(), CSG_Grids::Get_Grid_Ptr(), CSG_Grids::Get_NZ(), CSG_Data_Object::Get_ObjectType(), and SG_DATAOBJECT_TYPE_Grids.

Referenced by CSG_Data_Manager::Exists().

◆ Get_System()

const CSG_Grid_System& CSG_Grid_Collection::Get_System ( void ) const
inline

Definition at line 138 of file data_manager.h.

◆ is_Equal()

bool CSG_Grid_Collection::is_Equal ( const CSG_Grid_System & System ) const
inline

Definition at line 140 of file data_manager.h.

References CSG_Data_Collection::Count().

Referenced by CSG_Data_Manager::Get_Grid_System().

Friends And Related Function Documentation

◆ CSG_Data_Manager

friend class CSG_Data_Manager
friend

Definition at line 132 of file data_manager.h.

Member Data Documentation

◆ m_System

CSG_Grid_System CSG_Grid_Collection::m_System
protected

Definition at line 153 of file data_manager.h.

Referenced by Add(), and CSG_Data_Manager::Get_Summary().

The documentation for this class was generated from the following files:
  • data_manager.h
  • data_manager.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_Collection Member List

This is the complete list of members for CSG_Grid_Collection, including all inherited members.

Add(CSG_Data_Object *pObject) | CSG_Grid_Collection | protectedvirtual
Count(void) const | CSG_Data_Collection | inline
CSG_Data_Collection(class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type) | CSG_Data_Collection | protected
CSG_Data_Manager class | CSG_Grid_Collection | friend
CSG_Grid_Collection(class CSG_Data_Manager *pManager) | CSG_Grid_Collection | protected
Delete(CSG_Data_Object *pObject, bool bDetach=false) | CSG_Data_Collection | protected
Delete(size_t i, bool bDetach=false) | CSG_Data_Collection | protected
Delete(bool bDetach=false, bool bUnsaved=false) | CSG_Data_Collection | protected
Delete_All(bool bDetach=false) | CSG_Data_Collection | protected
Delete_Unsaved(bool bDetach=false) | CSG_Data_Collection | protected
Exists(CSG_Data_Object *pObject) const | CSG_Grid_Collection | virtual
Get(size_t i) const | CSG_Data_Collection | inline
Get(const CSG_String &File, bool bNative=true) const | CSG_Data_Collection |
Get_System(void) const | CSG_Grid_Collection | inline
is_Equal(const CSG_Grid_System &System) const | CSG_Grid_Collection | inline
m_Objects | CSG_Data_Collection | protected
m_pManager | CSG_Data_Collection | protected
m_System | CSG_Grid_Collection | protected
m_Type | CSG_Data_Collection | protected
~CSG_Data_Collection(void) | CSG_Data_Collection | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_File_Info Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CSG_Grid_File_Info Class Reference

#include <grid.h>

Public Member Functions

CSG_Grid_File_Info (void)
CSG_Grid_File_Info (const CSG_Grid_File_Info &Info)
bool | Create (const CSG_Grid_File_Info &Info)
CSG_Grid_File_Info (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_Grid_File_Info (CSG_File &Stream)
bool | Create (CSG_File &Stream)
CSG_Grid_File_Info (const CSG_Grid &Grid)
bool | Create (const CSG_Grid &Grid)
bool | Save (const CSG_String &File, bool bBinary=true)
bool | Save (const CSG_File &Stream, bool bBinary=true)
bool | Save_AUX_XML (const CSG_String &File)
bool | Save_AUX_XML (CSG_File &Stream)

Static Public Member Functions

static bool | Save (const CSG_String &File, const CSG_Grid &Grid, bool bBinary=true)
static bool | Save (const CSG_File &Stream, const CSG_Grid &Grid, bool bBinary=true)

Public Attributes

bool | m_bFlip
bool | m_bSwapBytes
sLong m_Offset
double | m_zScale
double | m_zOffset
double | m_NoData [2]
TSG_Data_Type m_Type
CSG_String m_Name
CSG_String m_Description
CSG_String m_Unit
CSG_String m_Data_File
CSG_Grid_System m_System
CSG_Projection m_Projection

Detailed Description

CSG_Grid is the data object created for raster handling.

Definition at line 407 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_File_Info() [1/5]

CSG_Grid_File_Info::CSG_Grid_File_Info ( void )

Definition at line 1023 of file grid_io.cpp.

◆ CSG_Grid_File_Info() [2/5]

CSG_Grid_File_Info::CSG_Grid_File_Info ( const CSG_Grid_File_Info & Info )

Definition at line 1047 of file grid_io.cpp.

References Create().

◆ CSG_Grid_File_Info() [3/5]

CSG_Grid_File_Info::CSG_Grid_File_Info ( const CSG_String & File )

Definition at line 1099 of file grid_io.cpp.

References Create().

◆ CSG_Grid_File_Info() [4/5]

CSG_Grid_File_Info::CSG_Grid_File_Info ( CSG_File & Stream )

Definition at line 1148 of file grid_io.cpp.

References Create().

◆ CSG_Grid_File_Info() [5/5]

CSG_Grid_File_Info::CSG_Grid_File_Info ( const CSG_Grid & Grid )

Definition at line 1073 of file grid_io.cpp.

References Create().

Member Function Documentation

◆ Create() [1/4]

bool CSG_Grid_File_Info::Create ( const CSG_Grid & Grid )

Definition at line 1078 of file grid_io.cpp.

References CSG_String::Clear(), CSG_Data_Object::Get_Description(), CSG_Data_Object::Get_Name(), CSG_Data_Object::Get_NoData_Value(), CSG_Grid::Get_Offset(), CSG_Data_Object::Get_Projection(), CSG_Grid::Get_Scaling(), CSG_Grid::Get_System(), CSG_Grid::Get_Type(), CSG_Grid::Get_Unit(), m_bFlip, m_bSwapBytes, m_Data_File, m_Description, m_Name, m_NoData, m_Offset, m_Projection, m_System, m_Type, m_Unit, m_zOffset, and m_zScale.

◆ Create() [2/4]

bool CSG_Grid_File_Info::Create ( const CSG_Grid_File_Info & Info )

Definition at line 1052 of file grid_io.cpp.

References m_bFlip, m_bSwapBytes, m_Data_File, m_Description, m_Name, m_NoData, m_Offset, m_Projection, m_System, m_Type, m_Unit, m_zOffset, and m_zScale.

Referenced by Create(), and CSG_Grid_File_Info().

◆ Create() [3/4]

bool CSG_Grid_File_Info::Create ( const CSG_String & File )

Definition at line 1104 of file grid_io.cpp.

References Create(), CSG_File_Zip::Get_File(), CSG_File_Zip::Get_File_Count(), CSG_File_Zip::Get_File_Name(), CSG_File::is_Reading(), SG_File_Cmp_Extension(), SG_File_Get_Name(), and SG_FILE_R.

◆ Create() [4/4]

bool CSG_Grid_File_Info::Create ( CSG_File & Stream )

Definition at line 1153 of file grid_io.cpp.

References CSG_String::AfterFirst(), CSG_String::asDouble(), CSG_String::asInt(), CSG_Grid_System::Assign(), CSG_String::Find(), CSG_File::Get_File_Name(), GRID_FILE_KEY_BYTEORDER_BIG, GRID_FILE_KEY_CELLCOUNT_X, GRID_FILE_KEY_CELLCOUNT_Y, GRID_FILE_KEY_CELLSIZE, GRID_FILE_KEY_DATAFILE_NAME, GRID_FILE_KEY_DATAFILE_OFFSET, GRID_FILE_KEY_DATAFORMAT, GRID_FILE_KEY_DESCRIPTION, GRID_FILE_KEY_NAME, GRID_FILE_KEY_NODATA_VALUE, GRID_FILE_KEY_POSITION_XMIN, GRID_FILE_KEY_POSITION_YMIN, GRID_FILE_KEY_TOPTOBOTTOM, GRID_FILE_KEY_TRUE, GRID_FILE_KEY_UNITNAME, GRID_FILE_KEY_Z_FACTOR, GRID_FILE_KEY_Z_OFFSET, gSG_Data_Type_Identifier, CSG_String::is_Empty(), CSG_File::is_EOF(), CSG_File::is_Reading(), m_bFlip, m_bSwapBytes, m_Data_File, m_Description, m_Name, m_NoData, m_Offset, m_System, m_Type, m_Unit, m_zOffset, m_zScale, SG_DATATYPE_Undefined, SG_File_Get_Path(), and SG_File_Make_Path().

◆ Save() [1/4]

bool CSG_Grid_File_Info::Save | ( | const CSG_File & | Stream,
 |  | bool | bBinary = true
 | ) |  |

Definition at line 1263 of file grid_io.cpp.

References CSG_String::c_str(), CSG_String::Format(), CSG_Grid_System::Get_Cellsize(), CSG_Grid_System::Get_NX(), CSG_Grid_System::Get_NY(), CSG_Grid_System::Get_Precision(), CSG_Grid_System::Get_XMin(), CSG_Grid_System::Get_YMin(), GRID_FILE_KEY_BYTEORDER_BIG, GRID_FILE_KEY_CELLCOUNT_X, GRID_FILE_KEY_CELLCOUNT_Y, GRID_FILE_KEY_CELLSIZE, GRID_FILE_KEY_DATAFILE_OFFSET, GRID_FILE_KEY_DATAFORMAT, GRID_FILE_KEY_DESCRIPTION, GRID_FILE_KEY_FALSE, GRID_FILE_KEY_NAME, GRID_FILE_KEY_NODATA_VALUE, GRID_FILE_KEY_POSITION_XMIN, GRID_FILE_KEY_POSITION_YMIN, GRID_FILE_KEY_TOPTOBOTTOM, GRID_FILE_KEY_TRUE, GRID_FILE_KEY_UNITNAME, GRID_FILE_KEY_Z_FACTOR, GRID_FILE_KEY_Z_OFFSET, GRID_FILE_PRINT, gSG_Data_Type_Identifier, CSG_File::is_Writing(), m_Description, m_Name, m_NoData, m_System, m_Type, m_Unit, m_zOffset, and m_zScale.

◆ Save() [2/4]

bool CSG_Grid_File_Info::Save | ( | const CSG_File & | Stream,
 |  | const CSG_Grid & | Grid,
 |  | bool | bBinary = true
 | ) |  |
static

Definition at line 1304 of file grid_io.cpp.

References Save().

◆ Save() [3/4]

bool CSG_Grid_File_Info::Save | ( | const CSG_String & | File,
 |  | bool | bBinary = true
 | ) |  |

Definition at line 1257 of file grid_io.cpp.

References SG_FILE_W.

Referenced by Save().

◆ Save() [4/4]

bool CSG_Grid_File_Info::Save | ( | const CSG_String & | File,
 |  | const CSG_Grid & | Grid,
 |  | bool | bBinary = true
 | ) |  |
static

Definition at line 1296 of file grid_io.cpp.

References Save().

◆ Save_AUX_XML() [1/2]

bool CSG_Grid_File_Info::Save_AUX_XML ( const CSG_String & File )

Definition at line 1317 of file grid_io.cpp.

References CSG_Projection::is_Okay(), m_Projection, CSG_File::Open(), and SG_FILE_W.

◆ Save_AUX_XML() [2/2]

bool CSG_Grid_File_Info::Save_AUX_XML ( CSG_File & Stream )

Definition at line 1325 of file grid_io.cpp.

References CSG_Projection::Get_WKT(), CSG_Projection::is_Okay(), CSG_File::is_Writing(), m_Projection, and CSG_File::Write().

Member Data Documentation

◆ m_bFlip

bool CSG_Grid_File_Info::m_bFlip

Definition at line 437 of file grid.h.

Referenced by Create().

◆ m_bSwapBytes

bool CSG_Grid_File_Info::m_bSwapBytes

Definition at line 437 of file grid.h.

Referenced by Create().

◆ m_Data_File

CSG_String CSG_Grid_File_Info::m_Data_File

Definition at line 445 of file grid.h.

Referenced by Create().

◆ m_Description

CSG_String CSG_Grid_File_Info::m_Description

Definition at line 445 of file grid.h.

Referenced by Create(), and Save().

◆ m_Name

CSG_String CSG_Grid_File_Info::m_Name

Definition at line 445 of file grid.h.

Referenced by Create(), and Save().

◆ m_NoData

double CSG_Grid_File_Info::m_NoData[2]

Definition at line 441 of file grid.h.

Referenced by Create(), and Save().

◆ m_Offset

sLong CSG_Grid_File_Info::m_Offset

Definition at line 439 of file grid.h.

Referenced by Create().

◆ m_Projection

CSG_Projection CSG_Grid_File_Info::m_Projection

Definition at line 449 of file grid.h.

Referenced by Create(), and Save_AUX_XML().

◆ m_System

CSG_Grid_System CSG_Grid_File_Info::m_System

Definition at line 447 of file grid.h.

Referenced by Create(), and Save().

◆ m_Type

TSG_Data_Type CSG_Grid_File_Info::m_Type

Definition at line 443 of file grid.h.

Referenced by Create(), and Save().

◆ m_Unit

CSG_String CSG_Grid_File_Info::m_Unit

Definition at line 445 of file grid.h.

Referenced by Create(), and Save().

◆ m_zOffset

double CSG_Grid_File_Info::m_zOffset

Definition at line 441 of file grid.h.

Referenced by Create(), and Save().

◆ m_zScale

double CSG_Grid_File_Info::m_zScale

Definition at line 441 of file grid.h.

Referenced by Create(), and Save().

The documentation for this class was generated from the following files:
  • grid.h
  • grid_io.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_File_Info Member List

This is the complete list of members for CSG_Grid_File_Info, including all inherited members.

Create(const CSG_Grid_File_Info &Info) | CSG_Grid_File_Info |
Create(const CSG_String &File) | CSG_Grid_File_Info |
Create(CSG_File &Stream) | CSG_Grid_File_Info |
Create(const CSG_Grid &Grid) | CSG_Grid_File_Info |
CSG_Grid_File_Info(void) | CSG_Grid_File_Info |
CSG_Grid_File_Info(const CSG_Grid_File_Info &Info) | CSG_Grid_File_Info |
CSG_Grid_File_Info(const CSG_String &File) | CSG_Grid_File_Info |
CSG_Grid_File_Info(CSG_File &Stream) | CSG_Grid_File_Info |
CSG_Grid_File_Info(const CSG_Grid &Grid) | CSG_Grid_File_Info |
m_bFlip | CSG_Grid_File_Info |
m_bSwapBytes | CSG_Grid_File_Info |
m_Data_File | CSG_Grid_File_Info |
m_Description | CSG_Grid_File_Info |
m_Name | CSG_Grid_File_Info |
m_NoData | CSG_Grid_File_Info |
m_Offset | CSG_Grid_File_Info |
m_Projection | CSG_Grid_File_Info |
m_System | CSG_Grid_File_Info |
m_Type | CSG_Grid_File_Info |
m_Unit | CSG_Grid_File_Info |
m_zOffset | CSG_Grid_File_Info |
m_zScale | CSG_Grid_File_Info |
Save(const CSG_String &File, bool bBinary=true) | CSG_Grid_File_Info |
Save(const CSG_File &Stream, bool bBinary=true) | CSG_Grid_File_Info |
Save(const CSG_String &File, const CSG_Grid &Grid, bool bBinary=true) | CSG_Grid_File_Info | static
Save(const CSG_File &Stream, const CSG_Grid &Grid, bool bBinary=true) | CSG_Grid_File_Info | static
Save_AUX_XML(const CSG_String &File) | CSG_Grid_File_Info |
Save_AUX_XML(CSG_File &Stream) | CSG_Grid_File_Info |
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_OGIS_Converter Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Grid_OGIS_Converter Class Reference

#include <shapes.h>

Public Member Functions

CSG_Grid_OGIS_Converter (void)

Static Public Member Functions

static bool | from_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid)
static bool | to_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID=-1)

Detailed Description

Definition at line 1578 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Grid_OGIS_Converter()

CSG_Grid_OGIS_Converter::CSG_Grid_OGIS_Converter ( void )
inline

Definition at line 1581 of file shapes.h.

Member Function Documentation

◆ from_WKBinary()

bool CSG_Grid_OGIS_Converter::from_WKBinary | ( | CSG_Bytes & | Bytes,
 |  | class CSG_Grid * | pGrid
 | ) |  |
static

Definition at line 1101 of file shapes_ogis.cpp.

References CSG_Grid::Create(), CSG_Projection::Create(), CSG_Grid::Get_NX(), CSG_Grid::Get_NY(), CSG_Data_Object::Get_Projection(), CSG_Grid::Get_Type(), CSG_Bytes::Read_Byte(), CSG_Bytes::Read_Char(), CSG_Bytes::Read_Double(), CSG_Bytes::Read_DWord(), CSG_Bytes::Read_Float(), CSG_Bytes::Read_Int(), CSG_Bytes::Read_Short(), CSG_Bytes::Read_Word(), CSG_Bytes::Rewind(), CSG_Data_Object::Set_NoData_Value(), CSG_Grid::Set_Value(), SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Short, SG_DATATYPE_Word, and SG_UI_Process_Set_Progress().

◆ to_WKBinary()

bool CSG_Grid_OGIS_Converter::to_WKBinary | ( | CSG_Bytes & | Bytes,
 |  | class CSG_Grid * | pGrid,
 |  | int | SRID = -1
 | ) |  |
static

Definition at line 1197 of file shapes_ogis.cpp.

References CSG_Grid::asDouble(), CSG_Bytes::Clear(), CSG_Grid::Get_Cellsize(), CSG_Projection::Get_EPSG(), CSG_Data_Object::Get_NoData_Value(), CSG_Grid::Get_NX(), CSG_Grid::Get_NY(), CSG_Data_Object::Get_Projection(), CSG_Grid::Get_Type(), CSG_Grid::Get_XMin(), CSG_Grid::Get_YMax(), CSG_Grid::is_NoData(), SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Int, SG_DATATYPE_Short, SG_DATATYPE_Word, and SG_UI_Process_Set_Progress().

The documentation for this class was generated from the following files:
  • shapes.h
  • shapes_ogis.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_OGIS_Converter Member List

This is the complete list of members for CSG_Grid_OGIS_Converter, including all inherited members.

CSG_Grid_OGIS_Converter(void) | CSG_Grid_OGIS_Converter | inline
from_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid) | CSG_Grid_OGIS_Converter | static
to_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID=-1) | CSG_Grid_OGIS_Converter | static
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_Pyramid Class Reference

Public Member Functions | List of all members
CSG_Grid_Pyramid Class Reference

#include <grid_pyramid.h>

Public Member Functions

CSG_Grid_Pyramid (void)
CSG_Grid_Pyramid (class CSG_Grid *pGrid, double Grow=2.0, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric)
bool | Create (class CSG_Grid *pGrid, double Grow=2.0, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric)
CSG_Grid_Pyramid (class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric)
bool | Create (class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric)
virtual | ~CSG_Grid_Pyramid (void)
bool | Destroy (void)
int | Get_Count (void)
class CSG_Grid * | Get_Grid (int iLevel)

Detailed Description

Definition at line 114 of file grid_pyramid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_Pyramid() [1/3]

CSG_Grid_Pyramid::CSG_Grid_Pyramid ( void )

Definition at line 75 of file grid_pyramid.cpp.

◆ CSG_Grid_Pyramid() [2/3]

CSG_Grid_Pyramid::CSG_Grid_Pyramid | ( | class CSG_Grid * | pGrid,
 |  | double | Grow = 2.0,
 |  | TSG_Grid_Pyramid_Generalisation | Generalisation = GRID_PYRAMID_Mean,
 |  | TSG_Grid_Pyramid_Grow_Type | Grow_Type = GRID_PYRAMID_Geometric
 | ) |  |

Definition at line 83 of file grid_pyramid.cpp.

References Create().

◆ CSG_Grid_Pyramid() [3/3]

CSG_Grid_Pyramid::CSG_Grid_Pyramid | ( | class CSG_Grid * | pGrid,
 |  | double | Grow,
 |  | double | Start,
 |  | int | nMaxLevels,
 |  | TSG_Grid_Pyramid_Generalisation | Generalisation = GRID_PYRAMID_Mean,
 |  | TSG_Grid_Pyramid_Grow_Type | Grow_Type = GRID_PYRAMID_Geometric
 | ) |  |

Definition at line 93 of file grid_pyramid.cpp.

References Create().

◆ ~CSG_Grid_Pyramid()

CSG_Grid_Pyramid::~CSG_Grid_Pyramid ( void )
virtual

Definition at line 103 of file grid_pyramid.cpp.

References Destroy().

Member Function Documentation

◆ Create() [1/2]

bool CSG_Grid_Pyramid::Create | ( | class CSG_Grid * | pGrid,
 |  | double | Grow,
 |  | double | Start,
 |  | int | nMaxLevels,
 |  | TSG_Grid_Pyramid_Generalisation | Generalisation = GRID_PYRAMID_Mean,
 |  | TSG_Grid_Pyramid_Grow_Type | Grow_Type = GRID_PYRAMID_Geometric
 | ) |  |

Definition at line 137 of file grid_pyramid.cpp.

References Destroy(), CSG_Grid::Get_NX(), CSG_Grid::Get_NY(), and CSG_Grid::is_Valid().

◆ Create() [2/2]

bool CSG_Grid_Pyramid::Create | ( | class CSG_Grid * | pGrid,
 |  | double | Grow = 2.0,
 |  | TSG_Grid_Pyramid_Generalisation | Generalisation = GRID_PYRAMID_Mean,
 |  | TSG_Grid_Pyramid_Grow_Type | Grow_Type = GRID_PYRAMID_Geometric
 | ) |  |

Definition at line 116 of file grid_pyramid.cpp.

References Destroy(), CSG_Grid::Get_NX(), CSG_Grid::Get_NY(), and CSG_Grid::is_Valid().

Referenced by CSG_Grid_Pyramid().

◆ Destroy()

bool CSG_Grid_Pyramid::Destroy ( void )

Definition at line 165 of file grid_pyramid.cpp.

References SG_Free().

Referenced by Create(), and ~CSG_Grid_Pyramid().

◆ Get_Count()

int CSG_Grid_Pyramid::Get_Count ( void )
inline

Definition at line 130 of file grid_pyramid.h.

◆ Get_Grid()

class CSG_Grid* CSG_Grid_Pyramid::Get_Grid ( int iLevel )
inline

Definition at line 131 of file grid_pyramid.h.

The documentation for this class was generated from the following files:
  • grid_pyramid.h
  • grid_pyramid.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_Pyramid Member List

This is the complete list of members for CSG_Grid_Pyramid, including all inherited members.

Create(class CSG_Grid *pGrid, double Grow=2.0, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric) | CSG_Grid_Pyramid |
Create(class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric) | CSG_Grid_Pyramid |
CSG_Grid_Pyramid(void) | CSG_Grid_Pyramid |
CSG_Grid_Pyramid(class CSG_Grid *pGrid, double Grow=2.0, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric) | CSG_Grid_Pyramid |
CSG_Grid_Pyramid(class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric) | CSG_Grid_Pyramid |
Destroy(void) | CSG_Grid_Pyramid |
Get_Count(void) | CSG_Grid_Pyramid | inline
Get_Grid(int iLevel) | CSG_Grid_Pyramid | inline
~CSG_Grid_Pyramid(void) | CSG_Grid_Pyramid | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_Radius Class Reference

Classes | Public Member Functions | List of all members
CSG_Grid_Radius Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Grid_Radius (int maxRadius=0)
~CSG_Grid_Radius (void)
bool | Create (int maxRadius)
void | Destroy (void)
int | Get_Maximum (void)
int | Get_nPoints (void)
int | Get_nPoints (int iRadius)
double | Get_Point (int iPoint, int &x, int &y)
double | Get_Point (int iPoint, int xOffset, int yOffset, int &x, int &y)
double | Get_Point (int iRadius, int iPoint, int &x, int &y)
double | Get_Point (int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y)

Detailed Description

Definition at line 593 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Grid_Radius()

CSG_Grid_Radius::CSG_Grid_Radius ( int maxRadius = 0 )

Definition at line 76 of file mat_grid_radius.cpp.

References Create().

◆ ~CSG_Grid_Radius()

CSG_Grid_Radius::~CSG_Grid_Radius ( void )

Definition at line 88 of file mat_grid_radius.cpp.

References Destroy().

Member Function Documentation

◆ Create()

bool CSG_Grid_Radius::Create ( int maxRadius )

Definition at line 101 of file mat_grid_radius.cpp.

References Destroy(), M_GET_LENGTH, and SG_Calloc().

Referenced by CSG_Grid_Radius().

◆ Destroy()

void CSG_Grid_Radius::Destroy ( void )

Definition at line 168 of file mat_grid_radius.cpp.

References SG_Free().

Referenced by Create(), and ~CSG_Grid_Radius().

◆ Get_Maximum()

int CSG_Grid_Radius::Get_Maximum ( void )
inline

Definition at line 602 of file mat_tools.h.

◆ Get_nPoints() [1/2]

int CSG_Grid_Radius::Get_nPoints ( int iRadius )
inline

Definition at line 605 of file mat_tools.h.

◆ Get_nPoints() [2/2]

int CSG_Grid_Radius::Get_nPoints ( void )
inline

Definition at line 604 of file mat_tools.h.

◆ Get_Point() [1/4]

double CSG_Grid_Radius::Get_Point | ( | int | iPoint,
 |  | int & | x,
 |  | int & | y
 | ) |  |
inline

Definition at line 607 of file mat_tools.h.

◆ Get_Point() [2/4]

double CSG_Grid_Radius::Get_Point | ( | int | iPoint,
 |  | int | xOffset,
 |  | int | yOffset,
 |  | int & | x,
 |  | int & | y
 | ) |  |
inline

Definition at line 620 of file mat_tools.h.

◆ Get_Point() [3/4]

double CSG_Grid_Radius::Get_Point | ( | int | iRadius,
 |  | int | iPoint,
 |  | int & | x,
 |  | int & | y
 | ) |  |
inline

Definition at line 633 of file mat_tools.h.

◆ Get_Point() [4/4]

double CSG_Grid_Radius::Get_Point | ( | int | iRadius,
 |  | int | iPoint,
 |  | int | xOffset,
 |  | int | yOffset,
 |  | int & | x,
 |  | int & | y
 | ) |  |
inline

Definition at line 646 of file mat_tools.h.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_grid_radius.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_Radius Member List

This is the complete list of members for CSG_Grid_Radius, including all inherited members.

Create(int maxRadius) | CSG_Grid_Radius |
CSG_Grid_Radius(int maxRadius=0) | CSG_Grid_Radius |
Destroy(void) | CSG_Grid_Radius |
Get_Maximum(void) | CSG_Grid_Radius | inline
Get_nPoints(void) | CSG_Grid_Radius | inline
Get_nPoints(int iRadius) | CSG_Grid_Radius | inline
Get_Point(int iPoint, int &x, int &y) | CSG_Grid_Radius | inline
Get_Point(int iPoint, int xOffset, int yOffset, int &x, int &y) | CSG_Grid_Radius | inline
Get_Point(int iRadius, int iPoint, int &x, int &y) | CSG_Grid_Radius | inline
Get_Point(int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y) | CSG_Grid_Radius | inline
~CSG_Grid_Radius(void) | CSG_Grid_Radius |
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_Stack Class Reference

Public Member Functions | List of all members
CSG_Grid_Stack Class Reference

#include <grid.h>

Inheritance diagram for CSG_Grid_Stack:
CSG_Stack

Public Member Functions

CSG_Grid_Stack (void)
const TSG_Point_Int & | operator[] (size_t i) const
virtual bool | Push (int x, int y)
virtual bool | Pop (int &x, int &y)
- Public Member Functions inherited from CSG_Stack
CSG_Stack (size_t RecordSize)
virtual | ~CSG_Stack (void)
bool | Destroy (void)
size_t | Get_RecordSize (void) const
size_t | Get_Size (void) const
bool | Clear (bool bFreeMemory=false)

Additional Inherited Members

- Protected Member Functions inherited from CSG_Stack
void * | Get_Record (size_t i) const
void * | Get_Record_Push (void)
void * | Get_Record_Pop (void)

Detailed Description

Definition at line 1042 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_Stack()

CSG_Grid_Stack::CSG_Grid_Stack ( void )
inline

Definition at line 1045 of file grid.h.

Member Function Documentation

◆ operator[]()

const TSG_Point_Int& CSG_Grid_Stack::operator[] ( size_t i ) const
inline

Definition at line 1048 of file grid.h.

References CSG_Stack::Get_Record().

◆ Pop()

virtual bool CSG_Grid_Stack::Pop | ( | int & | x,
 |  | int & | y
 | ) |  |
inlinevirtual

Definition at line 1067 of file grid.h.

References CSG_Stack::Get_Record_Pop(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Push()

virtual bool CSG_Grid_Stack::Push | ( | int | x,
 |  | int | y
 | ) |  |
inlinevirtual

Definition at line 1051 of file grid.h.

References CSG_Stack::Get_Record_Push(), SSG_Point_Int::x, and SSG_Point_Int::y.

The documentation for this class was generated from the following file:
  • grid.h
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_Stack Member List

This is the complete list of members for CSG_Grid_Stack, including all inherited members.

Clear(bool bFreeMemory=false) | CSG_Stack | inline
CSG_Grid_Stack(void) | CSG_Grid_Stack | inline
CSG_Stack(size_t RecordSize) | CSG_Stack | inline
Destroy(void) | CSG_Stack | inline
Get_Record(size_t i) const | CSG_Stack | inlineprotected
Get_Record_Pop(void) | CSG_Stack | inlineprotected
Get_Record_Push(void) | CSG_Stack | inlineprotected
Get_RecordSize(void) const | CSG_Stack | inline
Get_Size(void) const | CSG_Stack | inline
operator[](size_t i) const | CSG_Grid_Stack | inline
Pop(int &x, int &y) | CSG_Grid_Stack | inlinevirtual
Push(int x, int y) | CSG_Grid_Stack | inlinevirtual
~CSG_Stack(void) | CSG_Stack | inlinevirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grid_System Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Grid_System Class Reference

#include <grid.h>

Public Member Functions

CSG_Grid_System (void)
CSG_Grid_System (const CSG_Grid_System &System)
bool | Create (const CSG_Grid_System &System)
CSG_Grid_System (double Cellsize, const CSG_Rect &Extent)
bool | Create (double Cellsize, const CSG_Rect &Extent)
CSG_Grid_System (double Cellsize, double xMin, double yMin, double xMax, double yMax)
bool | Create (double Cellsize, double xMin, double yMin, double xMax, double yMax)
CSG_Grid_System (double Cellsize, double xMin, double yMin, int NX, int NY)
bool | Create (double Cellsize, double xMin, double yMin, int NX, int NY)
~CSG_Grid_System (void)
bool | Destroy (void)
bool | Assign (const CSG_Grid_System &System)
bool | Assign (double Cellsize, const CSG_Rect &Extent)
bool | Assign (double Cellsize, double xMin, double yMin, double xMax, double yMax)
bool | Assign (double Cellsize, double xMin, double yMin, int NX, int NY)
bool | is_Valid (void) const
const SG_Char * | Get_Name (bool bShort=true)
double | Get_Cellsize (void) const
double | Get_Cellarea (void) const
int | Get_NX (void) const
int | Get_NY (void) const
sLong | Get_NCells (void) const
const CSG_Rect & | Get_Extent (bool bCells=false) const
double | Get_XMin (bool bCells=false) const
double | Get_XMax (bool bCells=false) const
double | Get_XRange (bool bCells=false) const
double | Get_YMin (bool bCells=false) const
double | Get_YMax (bool bCells=false) const
double | Get_YRange (bool bCells=false) const
bool | operator== (const CSG_Grid_System &System) const
void | operator= (const CSG_Grid_System &System)
bool | is_Equal (const CSG_Grid_System &System) const
bool | is_Equal (double Cellsize, const TSG_Rect &Extent) const
double | Fit_xto_Grid_System (double x) const
Aligns the world coordinate x to the rows of the grid system and returns it. More...
double | Fit_yto_Grid_System (double y) const
Aligns the world coordinate y to the columns of the grid system and returns it. More...
TSG_Point | Fit_to_Grid_System (TSG_Point ptWorld) const
Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it. More...
double | Get_xGrid_to_World (int xGrid) const
double | Get_yGrid_to_World (int yGrid) const
TSG_Point | Get_Grid_to_World (int xGrid, int yGrid) const
int | Get_xWorld_to_Grid (double xWorld) const
int | Get_yWorld_to_Grid (double yWorld) const
bool | Get_World_to_Grid (int &xGrid, int &yGrid, double xWorld, double yWorld) const
bool | Get_World_to_Grid (int &xGrid, int &yGrid, TSG_Point ptWorld) const
bool | Get_Neighbor_Pos (int Direction, int x, int y, int &xPos, int &yPos) const
int | Get_xToSave (int Direction, int x) const
int | Get_yToSave (int Direction, int y) const
int | Get_xFromSave (int Direction, int x) const
int | Get_yFromSave (int Direction, int y) const
bool | is_InGrid (int x, int y) const
bool | is_InGrid (int x, int y, int Rand) const
double | Get_Length (int Direction) const
sLong | Get_IndexFromRowCol (int x, int y) const
bool | Get_RowColFromIndex (int &x, int &y, sLong i) const

Static Public Member Functions

static int | Get_xTo (int Direction, int x=0)
static int | Get_yTo (int Direction, int y=0)
static int | Get_xFrom (int Direction, int x=0)
static int | Get_yFrom (int Direction, int y=0)
static double | Get_UnitLength (int Direction)
static int | Set_Precision (int Decimals)
static int | Get_Precision (void)

Detailed Description

CSG_Grid_System is used by the CSG_Grid class to provide information about the number of rows and columns, the cell size and the georeference, which define the grid. It offers various functions, which help when working with grids.

See also
CSG_Grid

Definition at line 199 of file grid.h.

Constructor & Destructor Documentation

◆ CSG_Grid_System() [1/5]

CSG_Grid_System::CSG_Grid_System ( void )

Definition at line 88 of file grid_system.cpp.

References Destroy().

◆ CSG_Grid_System() [2/5]

CSG_Grid_System::CSG_Grid_System ( const CSG_Grid_System & System )

Definition at line 94 of file grid_system.cpp.

References Create().

◆ CSG_Grid_System() [3/5]

CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize,
 |  | const CSG_Rect & | Extent
 | ) |  |

Definition at line 100 of file grid_system.cpp.

References Create().

◆ CSG_Grid_System() [4/5]

CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 106 of file grid_system.cpp.

References Create().

◆ CSG_Grid_System() [5/5]

CSG_Grid_System::CSG_Grid_System | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | int | NX,
 |  | int | NY
 | ) |  |

Definition at line 112 of file grid_system.cpp.

References Create().

◆ ~CSG_Grid_System()

CSG_Grid_System::~CSG_Grid_System ( void )

Definition at line 118 of file grid_system.cpp.

References Destroy().

Member Function Documentation

◆ Assign() [1/4]

bool CSG_Grid_System::Assign ( const CSG_Grid_System & System )

Definition at line 225 of file grid_system.cpp.

References Create().

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Parameters::Add_Grid_System(), CSG_Grid_File_Info::Create(), CSG_Grid::Destroy(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_System(), and CSG_Parameters::Serialize_Compatibility().

◆ Assign() [2/4]

bool CSG_Grid_System::Assign | ( | double | Cellsize,
 |  | const CSG_Rect & | Extent
 | ) |  |

Definition at line 228 of file grid_system.cpp.

References Create().

◆ Assign() [3/4]

bool CSG_Grid_System::Assign | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 231 of file grid_system.cpp.

References Create().

◆ Assign() [4/4]

bool CSG_Grid_System::Assign | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | int | NX,
 |  | int | NY
 | ) |  |

Definition at line 234 of file grid_system.cpp.

References Create().

◆ Create() [1/4]

bool CSG_Grid_System::Create ( const CSG_Grid_System & System )

Definition at line 129 of file grid_system.cpp.

References is_Valid().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), Assign(), Create(), CSG_Grid_System(), Destroy(), operator=(), and CSG_Tool_Grid::Set_System().

◆ Create() [2/4]

bool CSG_Grid_System::Create | ( | double | Cellsize,
 |  | const CSG_Rect & | Extent
 | ) |  |

Definition at line 146 of file grid_system.cpp.

References Create(), Destroy(), CSG_Rect::Get_Center(), CSG_Rect::Get_XMin(), CSG_Rect::Get_XRange(), CSG_Rect::Get_YMin(), CSG_Rect::Get_YRange(), SSG_Point::x, and SSG_Point::y.

◆ Create() [3/4]

bool CSG_Grid_System::Create | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 165 of file grid_system.cpp.

References Create().

◆ Create() [4/4]

bool CSG_Grid_System::Create | ( | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin,
 |  | int | NX,
 |  | int | NY
 | ) |  |

Definition at line 171 of file grid_system.cpp.

References CSG_Rect::Assign(), CSG_Rect::Inflate(), SG_Get_Rounded(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Destroy()

bool CSG_Grid_System::Destroy ( void )

Definition at line 217 of file grid_system.cpp.

References Create().

Referenced by Create(), CSG_Grid_System(), CSG_Parameter_Grid_List::Update_Data(), and ~CSG_Grid_System().

◆ Fit_to_Grid_System()

TSG_Point CSG_Grid_System::Fit_to_Grid_System ( TSG_Point ptWorld ) const
inline

Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it.

Definition at line 265 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Fit_xto_Grid_System()

double CSG_Grid_System::Fit_xto_Grid_System ( double x ) const
inline

Aligns the world coordinate x to the rows of the grid system and returns it.

Definition at line 259 of file grid.h.

◆ Fit_yto_Grid_System()

double CSG_Grid_System::Fit_yto_Grid_System ( double y ) const
inline

Aligns the world coordinate y to the columns of the grid system and returns it.

Definition at line 262 of file grid.h.

◆ Get_Cellarea()

double CSG_Grid_System::Get_Cellarea ( void ) const
inline

Definition at line 232 of file grid.h.

◆ Get_Cellsize()

double CSG_Grid_System::Get_Cellsize ( void ) const
inline

Definition at line 231 of file grid.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grids::Create(), CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_Extent()

const CSG_Rect& CSG_Grid_System::Get_Extent ( bool bCells = false ) const
inline

Definition at line 238 of file grid.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid::Get_Value(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_Grid_to_World()

TSG_Point CSG_Grid_System::Get_Grid_to_World | ( | int | xGrid,
 |  | int | yGrid
 | ) |  | const
 inline

Definition at line 278 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Get_IndexFromRowCol()

sLong CSG_Grid_System::Get_IndexFromRowCol | ( | int | x,
 |  | int | y
 | ) |  | const
 inline

Definition at line 355 of file grid.h.

◆ Get_Length()

double CSG_Grid_System::Get_Length ( int Direction ) const
inline

Definition at line 349 of file grid.h.

Referenced by CSG_Grid::Get_Gradient_NeighborDir().

◆ Get_Name()

const SG_Char * CSG_Grid_System::Get_Name ( bool bShort = true )

Definition at line 249 of file grid_system.cpp.

References _TL, Get_Cellsize(), Get_NX(), Get_NY(), Get_XMin(), Get_YMin(), is_Valid(), CSG_String::Printf(), and SG_Get_Significant_Decimals().

Referenced by CSG_Parameter_Grid_System::_Set_String(), and CSG_Data_Manager::Get_Summary().

◆ Get_NCells()

sLong CSG_Grid_System::Get_NCells ( void ) const
inline

Definition at line 236 of file grid.h.

◆ Get_Neighbor_Pos()

bool CSG_Grid_System::Get_Neighbor_Pos | ( | int | Direction,
 |  | int | x,
 |  | int | y,
 |  | int & | xPos,
 |  | int & | yPos
 | ) |  | const
 inline

Definition at line 305 of file grid.h.

◆ Get_NX()

int CSG_Grid_System::Get_NX ( void ) const
inline

Definition at line 234 of file grid.h.

Referenced by CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_NY()

int CSG_Grid_System::Get_NY ( void ) const
inline

Definition at line 235 of file grid.h.

Referenced by CSG_Grid::Create(), Get_Name(), CSG_Grid_File_Info::Save(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_Precision()

int CSG_Grid_System::Get_Precision ( void )
static

Definition at line 77 of file grid_system.cpp.

Referenced by CSG_Grid_File_Info::Save().

◆ Get_RowColFromIndex()

bool CSG_Grid_System::Get_RowColFromIndex | ( | int & | x,
 |  | int & | y,
 |  | sLong | i
 | ) |  | const
 inline

Definition at line 365 of file grid.h.

◆ Get_UnitLength()

static double CSG_Grid_System::Get_UnitLength ( int Direction )
inlinestatic

Definition at line 350 of file grid.h.

◆ Get_World_to_Grid() [1/2]

bool CSG_Grid_System::Get_World_to_Grid | ( | int & | xGrid,
 |  | int & | yGrid,
 |  | double | xWorld,
 |  | double | yWorld
 | ) |  | const
 inline

Definition at line 293 of file grid.h.

◆ Get_World_to_Grid() [2/2]

bool CSG_Grid_System::Get_World_to_Grid | ( | int & | xGrid,
 |  | int & | yGrid,
 |  | TSG_Point | ptWorld
 | ) |  | const
 inline

Definition at line 298 of file grid.h.

References SSG_Point::x, and SSG_Point::y.

◆ Get_xFrom()

static int CSG_Grid_System::Get_xFrom | ( | int | Direction,
 |  | int | x = 0
 | ) |  |
inlinestatic

Definition at line 338 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_xFrom().

◆ Get_xFromSave()

int CSG_Grid_System::Get_xFromSave | ( | int | Direction,
 |  | int | x
 | ) |  | const
 inline

Definition at line 343 of file grid.h.

◆ Get_xGrid_to_World()

double CSG_Grid_System::Get_xGrid_to_World ( int xGrid ) const
inline

Definition at line 275 of file grid.h.

◆ Get_XMax()

double CSG_Grid_System::Get_XMax ( bool bCells = false ) const
inline

Definition at line 241 of file grid.h.

◆ Get_XMin()

double CSG_Grid_System::Get_XMin ( bool bCells = false ) const
inline

Definition at line 240 of file grid.h.

Referenced by CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_XRange()

double CSG_Grid_System::Get_XRange ( bool bCells = false ) const
inline

Definition at line 242 of file grid.h.

◆ Get_xTo()

static int CSG_Grid_System::Get_xTo | ( | int | Direction,
 |  | int | x = 0
 | ) |  |
inlinestatic

Definition at line 310 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), CSG_Grid::Get_Gradient_NeighborDir(), and CSG_Tool_Grid::Get_xTo().

◆ Get_xToSave()

int CSG_Grid_System::Get_xToSave | ( | int | Direction,
 |  | int | x
 | ) |  | const
 inline

Definition at line 341 of file grid.h.

◆ Get_xWorld_to_Grid()

int CSG_Grid_System::Get_xWorld_to_Grid ( double xWorld ) const
inline

Definition at line 290 of file grid.h.

Referenced by CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), and CSG_Grids::Get_Statistics().

◆ Get_yFrom()

static int CSG_Grid_System::Get_yFrom | ( | int | Direction,
 |  | int | y = 0
 | ) |  |
inlinestatic

Definition at line 339 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), and CSG_Tool_Grid::Get_yFrom().

◆ Get_yFromSave()

int CSG_Grid_System::Get_yFromSave | ( | int | Direction,
 |  | int | y
 | ) |  | const
 inline

Definition at line 344 of file grid.h.

◆ Get_yGrid_to_World()

double CSG_Grid_System::Get_yGrid_to_World ( int yGrid ) const
inline

Definition at line 276 of file grid.h.

◆ Get_YMax()

double CSG_Grid_System::Get_YMax ( bool bCells = false ) const
inline

Definition at line 245 of file grid.h.

◆ Get_YMin()

double CSG_Grid_System::Get_YMin ( bool bCells = false ) const
inline

Definition at line 244 of file grid.h.

Referenced by CSG_Grid::Create(), Get_Name(), and CSG_Grid_File_Info::Save().

◆ Get_YRange()

double CSG_Grid_System::Get_YRange ( bool bCells = false ) const
inline

Definition at line 246 of file grid.h.

◆ Get_yTo()

static int CSG_Grid_System::Get_yTo | ( | int | Direction,
 |  | int | y = 0
 | ) |  |
inlinestatic

Definition at line 324 of file grid.h.

Referenced by CSG_Grid::Get_Gradient(), CSG_Grid::Get_Gradient_NeighborDir(), and CSG_Tool_Grid::Get_yTo().

◆ Get_yToSave()

int CSG_Grid_System::Get_yToSave | ( | int | Direction,
 |  | int | y
 | ) |  | const
 inline

Definition at line 342 of file grid.h.

◆ Get_yWorld_to_Grid()

int CSG_Grid_System::Get_yWorld_to_Grid ( double yWorld ) const
inline

Definition at line 291 of file grid.h.

Referenced by CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), and CSG_Grids::Get_Statistics().

◆ is_Equal() [1/2]

bool CSG_Grid_System::is_Equal ( const CSG_Grid_System & System ) const

Definition at line 302 of file grid_system.cpp.

References SSG_Rect::xMin, and SSG_Rect::yMin.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameter::is_Value_Equal(), and operator==().

◆ is_Equal() [2/2]

bool CSG_Grid_System::is_Equal | ( | double | Cellsize,
 |  | const TSG_Rect & | Extent
 | ) |  | const

Definition at line 313 of file grid_system.cpp.

◆ is_InGrid() [1/2]

bool CSG_Grid_System::is_InGrid | ( | int | x,
 |  | int | y
 | ) |  | const
 inline

Definition at line 346 of file grid.h.

◆ is_InGrid() [2/2]

bool CSG_Grid_System::is_InGrid | ( | int | x,
 |  | int | y,
 |  | int | Rand
 | ) |  | const
 inline

Definition at line 347 of file grid.h.

◆ is_Valid()

bool CSG_Grid_System::is_Valid ( void ) const

Definition at line 243 of file grid_system.cpp.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Grid_Collection::Add(), CSG_Data_Manager::Add_Grid(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), Create(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), Get_Name(), CSG_Grid::is_Valid(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ operator=()

void CSG_Grid_System::operator= ( const CSG_Grid_System & System )

Definition at line 291 of file grid_system.cpp.

References Create().

◆ operator==()

bool CSG_Grid_System::operator== ( const CSG_Grid_System & System ) const

Definition at line 285 of file grid_system.cpp.

References is_Equal().

◆ Set_Precision()

int CSG_Grid_System::Set_Precision ( int Decimals )
static

Definition at line 66 of file grid_system.cpp.

The documentation for this class was generated from the following files:
  • grid.h
  • grid_system.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grid_System Member List

This is the complete list of members for CSG_Grid_System, including all inherited members.

Assign(const CSG_Grid_System &System) | CSG_Grid_System |
Assign(double Cellsize, const CSG_Rect &Extent) | CSG_Grid_System |
Assign(double Cellsize, double xMin, double yMin, double xMax, double yMax) | CSG_Grid_System |
Assign(double Cellsize, double xMin, double yMin, int NX, int NY) | CSG_Grid_System |
Create(const CSG_Grid_System &System) | CSG_Grid_System |
Create(double Cellsize, const CSG_Rect &Extent) | CSG_Grid_System |
Create(double Cellsize, double xMin, double yMin, double xMax, double yMax) | CSG_Grid_System |
Create(double Cellsize, double xMin, double yMin, int NX, int NY) | CSG_Grid_System |
CSG_Grid_System(void) | CSG_Grid_System |
CSG_Grid_System(const CSG_Grid_System &System) | CSG_Grid_System |
CSG_Grid_System(double Cellsize, const CSG_Rect &Extent) | CSG_Grid_System |
CSG_Grid_System(double Cellsize, double xMin, double yMin, double xMax, double yMax) | CSG_Grid_System |
CSG_Grid_System(double Cellsize, double xMin, double yMin, int NX, int NY) | CSG_Grid_System |
Destroy(void) | CSG_Grid_System |
Fit_to_Grid_System(TSG_Point ptWorld) const | CSG_Grid_System | inline
Fit_xto_Grid_System(double x) const | CSG_Grid_System | inline
Fit_yto_Grid_System(double y) const | CSG_Grid_System | inline
Get_Cellarea(void) const | CSG_Grid_System | inline
Get_Cellsize(void) const | CSG_Grid_System | inline
Get_Extent(bool bCells=false) const | CSG_Grid_System | inline
Get_Grid_to_World(int xGrid, int yGrid) const | CSG_Grid_System | inline
Get_IndexFromRowCol(int x, int y) const | CSG_Grid_System | inline
Get_Length(int Direction) const | CSG_Grid_System | inline
Get_Name(bool bShort=true) | CSG_Grid_System |
Get_NCells(void) const | CSG_Grid_System | inline
Get_Neighbor_Pos(int Direction, int x, int y, int &xPos, int &yPos) const | CSG_Grid_System | inline
Get_NX(void) const | CSG_Grid_System | inline
Get_NY(void) const | CSG_Grid_System | inline
Get_Precision(void) | CSG_Grid_System | static
Get_RowColFromIndex(int &x, int &y, sLong i) const | CSG_Grid_System | inline
Get_UnitLength(int Direction) | CSG_Grid_System | inlinestatic
Get_World_to_Grid(int &xGrid, int &yGrid, double xWorld, double yWorld) const | CSG_Grid_System | inline
Get_World_to_Grid(int &xGrid, int &yGrid, TSG_Point ptWorld) const | CSG_Grid_System | inline
Get_xFrom(int Direction, int x=0) | CSG_Grid_System | inlinestatic
Get_xFromSave(int Direction, int x) const | CSG_Grid_System | inline
Get_xGrid_to_World(int xGrid) const | CSG_Grid_System | inline
Get_XMax(bool bCells=false) const | CSG_Grid_System | inline
Get_XMin(bool bCells=false) const | CSG_Grid_System | inline
Get_XRange(bool bCells=false) const | CSG_Grid_System | inline
Get_xTo(int Direction, int x=0) | CSG_Grid_System | inlinestatic
Get_xToSave(int Direction, int x) const | CSG_Grid_System | inline
Get_xWorld_to_Grid(double xWorld) const | CSG_Grid_System | inline
Get_yFrom(int Direction, int y=0) | CSG_Grid_System | inlinestatic
Get_yFromSave(int Direction, int y) const | CSG_Grid_System | inline
Get_yGrid_to_World(int yGrid) const | CSG_Grid_System | inline
Get_YMax(bool bCells=false) const | CSG_Grid_System | inline
Get_YMin(bool bCells=false) const | CSG_Grid_System | inline
Get_YRange(bool bCells=false) const | CSG_Grid_System | inline
Get_yTo(int Direction, int y=0) | CSG_Grid_System | inlinestatic
Get_yToSave(int Direction, int y) const | CSG_Grid_System | inline
Get_yWorld_to_Grid(double yWorld) const | CSG_Grid_System | inline
is_Equal(const CSG_Grid_System &System) const | CSG_Grid_System |
is_Equal(double Cellsize, const TSG_Rect &Extent) const | CSG_Grid_System |
is_InGrid(int x, int y) const | CSG_Grid_System | inline
is_InGrid(int x, int y, int Rand) const | CSG_Grid_System | inline
is_Valid(void) const | CSG_Grid_System |
operator=(const CSG_Grid_System &System) | CSG_Grid_System |
operator==(const CSG_Grid_System &System) const | CSG_Grid_System |
Set_Precision(int Decimals) | CSG_Grid_System | static
~CSG_Grid_System(void) | CSG_Grid_System |
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Grids Class Reference

Public Member Functions | Protected Member Functions | List of all members
CSG_Grids Class Reference

#include <grids.h>

Inheritance diagram for CSG_Grids:
CSG_Data_Object

Public Member Functions

CSG_Grids (void)
virtual | ~CSG_Grids (void)
CSG_Grids (const CSG_Grids &Grids)
virtual bool | Create (const CSG_Grids &Grids)
CSG_Grids (const CSG_Grids *pGrids, bool bCopyData=false)
virtual bool | Create (const CSG_Grids *pGrids, bool bCopyData=false)
CSG_Grids (const char *FileName, bool bLoadData=true)
virtual bool | Create (const char *FileName, bool bLoadData=true)
CSG_Grids (const wchar_t *FileName, bool bLoadData=true)
virtual bool | Create (const wchar_t *FileName, bool bLoadData=true)
CSG_Grids (const CSG_String &FileName, bool bLoadData=true)
virtual bool | Create (const CSG_String &FileName, bool bLoadData=true)
CSG_Grids (const CSG_Grid_System &System, int NZ=0, double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
virtual bool | Create (const CSG_Grid_System &System, int NZ=0, double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
CSG_Grids (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute=0, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCreateGrids=false)
virtual bool | Create (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute=0, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCreateGrids=false)
CSG_Grids (int NX, int NY, int NZ=0, double Cellsize=0., double xMin=0., double yMin=0., double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
virtual bool | Create (int NX, int NY, int NZ=0, double Cellsize=0., double xMin=0., double yMin=0., double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
virtual bool | Destroy (void)
virtual bool | Load (const CSG_String &File, bool bLoadData=true)
virtual bool | Save (const CSG_String &File, int Format=0)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
TSG_Data_Type | Get_Type (void) const
int | Get_nValueBytes (void) const
int | Get_nLineBytes (void) const
void | Set_Unit (const CSG_String &Unit)
const SG_Char * | Get_Unit (void) const
const CSG_Grid_System & | Get_System (void) const
virtual const CSG_Rect & | Get_Extent (void)
int | Get_NX (void) const
int | Get_NY (void) const
int | Get_NZ (void) const
sLong | Get_NCells (void) const
sLong | Get_Data_Count (void)
sLong | Get_NoData_Count (void)
double | Get_Cellsize (void) const
double | Get_Cellarea (void) const
const CSG_Rect & | Get_Extent (bool bCells=false) const
double | Get_XMin (bool bCells=false) const
double | Get_XMax (bool bCells=false) const
double | Get_XRange (bool bCells=false) const
double | Get_YMin (bool bCells=false) const
double | Get_YMax (bool bCells=false) const
double | Get_YRange (bool bCells=false) const
double | Get_ZMin (bool bCells=false) const
double | Get_ZMax (bool bCells=false) const
double | Get_ZRange (bool bCells=false) const
bool | Add_Attribute (const CSG_String &Name, TSG_Data_Type Type, int iField=-1)
bool | Del_Attribute (int iField)
const CSG_Table & | Get_Attributes (void) const
CSG_Table * | Get_Attributes_Ptr (void)
CSG_Table_Record & | Get_Attributes (int i) const
bool | Set_Z_Attribute (int i)
int | Get_Z_Attribute (void) const
bool | Set_Z_Name_Field (int i)
int | Get_Z_Name_Field (void) const
bool | Set_Z (int i, double Value)
double | Get_Z (int i) const
bool | Update_Z_Order (void)
bool | Set_Grid_Count (int Count)
int | Get_Grid_Count (void) const
bool | Add_Grid (double Z)
bool | Add_Grid (double Z, CSG_Grid *pGrid, bool bAttach=false)
bool | Add_Grid (CSG_Table_Record &Attributes)
bool | Add_Grid (CSG_Table_Record &Attributes, CSG_Grid *pGrid, bool bAttach=false)
bool | Del_Grid (int i, bool bDetach=false)
bool | Del_Grids (bool bDetach=false)
const CSG_Grid & | Get_Grid (int i) const
CSG_Grid * | Get_Grid_Ptr (int i) const
CSG_String | Get_Grid_Name (int i, int Style=0) const
sLong | Get_Memory_Size (void) const
void | Set_Scaling (double Scale=1., double Offset=0.)
double | Get_Scaling (void) const
double | Get_Offset (void) const
bool | is_Scaled (void) const
double | Get_Mean (void)
double | Get_Min (void)
double | Get_Max (void)
double | Get_Range (void)
double | Get_StdDev (void)
double | Get_Variance (void)
double | Get_Quantile (double Quantile, bool bFromHistogram=true)
double | Get_Percentile (double Percentile, bool bFromHistogram=true)
const CSG_Simple_Statistics & | Get_Statistics (void)
bool | Get_Statistics (const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues=false) const
const CSG_Histogram & | Get_Histogram (size_t nClasses=0)
bool | Get_Histogram (const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses=0) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
virtual bool | is_Valid (void) const
TSG_Intersection | is_Intersecting (const CSG_Rect &Extent) const
TSG_Intersection | is_Intersecting (const TSG_Rect &Extent) const
TSG_Intersection | is_Intersecting (double xMin, double yMin, double xMax, double yMax) const
bool | is_Compatible (CSG_Grid *pGrid) const
bool | is_Compatible (CSG_Grids *pGrids) const
bool | is_Compatible (const CSG_Grid_System &System) const
bool | is_Compatible (int NX, int NY, double Cellsize, double xMin, double yMin) const
bool | is_InGrid (int x, int y, int z, bool bCheckNoData=true) const
bool | is_InGrid_byPos (double x, double y, double z, bool bCheckNoData=true) const
bool | is_InGrid_byPos (const TSG_Point_3D &p, bool bCheckNoData=true) const
virtual void | Set_Modified (bool bModified=true)
virtual bool | is_Modified (void) const
void | Assign_NoData (void)
virtual bool | Assign (double Value=0.)
virtual bool | Assign (CSG_Data_Object *pObject)
virtual bool | Assign (CSG_Grids *pGrids, TSG_Grid_Resampling Interpolation)
virtual CSG_Grids & | operator= (const CSG_Grids &Grids)
virtual CSG_Grids & | operator= (double Value)
virtual CSG_Grids & | operator+= (double Value)
virtual CSG_Grids & | Add (double Value)
virtual CSG_Grids & | operator-= (double Value)
virtual CSG_Grids & | Subtract (double Value)
virtual CSG_Grids & | operator*= (double Value)
virtual CSG_Grids & | Multiply (double Value)
virtual CSG_Grids & | operator/= (double Value)
virtual CSG_Grids & | Divide (double Value)
virtual double | operator() (int x, int y, int z) const
virtual CSG_Grid & | operator[] (int i)
virtual bool | Set_NoData_Value_Range (double loValue, double hiValue)
virtual bool | is_NoData (int x, int y, int z) const
virtual bool | is_NoData (sLong i) const
virtual void | Set_NoData (int x, int y, int z)
virtual void | Set_NoData (sLong i)
double | Get_Value (double x, double y, double z, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const
double | Get_Value (const TSG_Point_3D &p, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const
bool | Get_Value (double x, double y, double z, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const
bool | Get_Value (const TSG_Point_3D &p, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const
virtual BYTE | asByte (int x, int y, int z, bool bScaled=true) const
virtual BYTE | asByte (sLong i, bool bScaled=true) const
virtual char | asChar (int x, int y, int z, bool bScaled=true) const
virtual char | asChar (sLong i, bool bScaled=true) const
virtual short | asShort (int x, int y, int z, bool bScaled=true) const
virtual short | asShort (sLong i, bool bScaled=true) const
virtual int | asInt (int x, int y, int z, bool bScaled=true) const
virtual int | asInt (sLong i, bool bScaled=true) const
virtual sLong | asLong (int x, int y, int z, bool bScaled=true) const
virtual sLong | asLong (sLong i, bool bScaled=true) const
virtual float | asFloat (int x, int y, int z, bool bScaled=true) const
virtual float | asFloat (sLong i, bool bScaled=true) const
virtual double | asDouble (sLong i, bool bScaled=true) const
virtual double | asDouble (int x, int y, int z, bool bScaled=true) const
virtual void | Add_Value (int x, int y, int z, double Value)
virtual void | Add_Value (sLong i, double Value)
virtual void | Mul_Value (int x, int y, int z, double Value)
virtual void | Mul_Value (sLong i, double Value)
virtual void | Set_Value (sLong i, double Value, bool bScaled=true)
virtual void | Set_Value (int x, int y, int z, double Value, bool bScaled=true)
bool | Set_Index (bool bOn=true)
sLong | Get_Sorted (sLong Position, bool bDown=true, bool bCheckNoData=true)
bool | Get_Sorted (sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
bool | Get_Sorted (sLong Position, int &x, int &y, int &z, bool bDown=true, bool bCheckNoData=true)
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
sLong | Get_Max_Samples (void) const

Protected Member Functions

virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)
virtual bool | On_NoData_Changed (void)

Additional Inherited Members

- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Detailed Description

CSG_Grids is the data object created for handling raster collections.

Definition at line 118 of file grids.h.

Constructor & Destructor Documentation

◆ CSG_Grids() [1/9]

CSG_Grids::CSG_Grids ( void )

Default constructor.

Definition at line 132 of file grids.cpp.

◆ ~CSG_Grids()

CSG_Grids::~CSG_Grids ( void )
virtual

The destructor.

Definition at line 141 of file grids.cpp.

References Destroy().

◆ CSG_Grids() [2/9]

CSG_Grids::CSG_Grids ( const CSG_Grids & Grids )

Copy constructor.

Definition at line 153 of file grids.cpp.

References Create().

◆ CSG_Grids() [3/9]

CSG_Grids::CSG_Grids | ( | const CSG_Grids * | pGrids,
 |  | bool | bCopyData = false
 | ) |  |

Create a grid collection using the pGrids's grid system, data type, and attribute field definition. If bCopyData is true, it also copies the data. Otherwise it has no initial data.

Definition at line 168 of file grids.cpp.

References Create().

◆ CSG_Grids() [4/9]

CSG_Grids::CSG_Grids | ( | const char * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Create a grid collection from file.

Definition at line 180 of file grids.cpp.

References Create().

◆ CSG_Grids() [5/9]

CSG_Grids::CSG_Grids | ( | const wchar_t * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 181 of file grids.cpp.

References Create().

◆ CSG_Grids() [6/9]

CSG_Grids::CSG_Grids | ( | const CSG_String & | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Definition at line 182 of file grids.cpp.

References Create().

◆ CSG_Grids() [7/9]

CSG_Grids::CSG_Grids | ( | const CSG_Grid_System & | System,
 |  | int | NZ = 0,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Create a grid collection with specified dimensions'.

Definition at line 201 of file grids.cpp.

References Create().

◆ CSG_Grids() [8/9]

CSG_Grids::CSG_Grids | ( | const CSG_Grid_System & | System,
 |  | const CSG_Table & | Attributes,
 |  | int | zAttribute = 0,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCreateGrids = false
 | ) |  |

Create a grid collection with specified dimensions'.

Definition at line 213 of file grids.cpp.

References Create().

◆ CSG_Grids() [9/9]

CSG_Grids::CSG_Grids | ( | int | NX,
 |  | int | NY,
 |  | int | NZ = 0,
 |  | double | Cellsize = 0.,
 |  | double | xMin = 0.,
 |  | double | yMin = 0.,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Create a grid collection with specified dimensions'.

Definition at line 189 of file grids.cpp.

References Create().

Member Function Documentation

◆ Add()

CSG_Grids & CSG_Grids::Add ( double Value )
virtual

Definition at line 985 of file grids.cpp.

References CSG_Grid::Add(), and Get_Grid_Count().

Referenced by operator+=().

◆ Add_Attribute()

bool CSG_Grids::Add_Attribute | ( | const CSG_String & | Name,
 |  | TSG_Data_Type | Type,
 |  | int | iField = -1
 | ) |  |

Definition at line 474 of file grids.cpp.

References CSG_Table::Add_Field().

◆ Add_Grid() [1/4]

bool CSG_Grids::Add_Grid ( CSG_Table_Record & Attributes )

Definition at line 662 of file grids.cpp.

References CSG_Table::Add_Record(), CSG_Array_Pointer::Get_Array(), Get_NZ(), Get_System(), Get_Type(), is_Valid(), SG_Create_Grid(), SG_FREE_SAFE, and Update_Z_Order().

◆ Add_Grid() [2/4]

bool CSG_Grids::Add_Grid | ( | CSG_Table_Record & | Attributes,
 |  | CSG_Grid * | pGrid,
 |  | bool | bAttach = false
 | ) |  |

Definition at line 702 of file grids.cpp.

References CSG_Table::Add_Record(), Create(), CSG_Array_Pointer::Get_Array(), Get_NZ(), CSG_Data_Object::Get_Projection(), is_Compatible(), CSG_Projection::is_Okay(), CSG_Grid::is_Valid(), SG_Create_Grid(), SG_FREE_SAFE, and Update_Z_Order().

◆ Add_Grid() [3/4]

bool CSG_Grids::Add_Grid ( double Z )

Definition at line 638 of file grids.cpp.

References CSG_Table::Add_Record(), and CSG_Table::Set_Value().

Referenced by Add_Grid(), Create(), CSG_Parameters_Grid_Target::Get_Grids(), and Set_Grid_Count().

◆ Add_Grid() [4/4]

bool CSG_Grids::Add_Grid | ( | double | Z,
 |  | CSG_Grid * | pGrid,
 |  | bool | bAttach = false
 | ) |  |

Definition at line 650 of file grids.cpp.

References Add_Grid(), CSG_Table::Add_Record(), and CSG_Table::Set_Value().

◆ Add_Value() [1/2]

virtual void CSG_Grids::Add_Value | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 403 of file grids.h.

◆ Add_Value() [2/2]

virtual void CSG_Grids::Add_Value | ( | sLong | i,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 404 of file grids.h.

◆ asByte() [1/2]

virtual BYTE CSG_Grids::asByte | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 373 of file grids.h.

References SG_ROUND_TO_BYTE.

◆ asByte() [2/2]

virtual BYTE CSG_Grids::asByte | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 374 of file grids.h.

References SG_ROUND_TO_BYTE.

◆ asChar() [1/2]

virtual char CSG_Grids::asChar | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 375 of file grids.h.

References SG_ROUND_TO_CHAR.

◆ asChar() [2/2]

virtual char CSG_Grids::asChar | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 376 of file grids.h.

References SG_ROUND_TO_CHAR.

◆ asDouble() [1/2]

virtual double CSG_Grids::asDouble | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 394 of file grids.h.

◆ asDouble() [2/2]

virtual double CSG_Grids::asDouble | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 387 of file grids.h.

Referenced by CSG_Natural_Breaks::Create(), CSG_Histogram::Create(), Get_Histogram(), Get_Quantile(), Get_Statistics(), and On_Update().

◆ asFloat() [1/2]

virtual float CSG_Grids::asFloat | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 383 of file grids.h.

◆ asFloat() [2/2]

virtual float CSG_Grids::asFloat | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 384 of file grids.h.

◆ asInt() [1/2]

virtual int CSG_Grids::asInt | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 379 of file grids.h.

References SG_ROUND_TO_INT.

◆ asInt() [2/2]

virtual int CSG_Grids::asInt | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 380 of file grids.h.

References SG_ROUND_TO_INT.

◆ asLong() [1/2]

virtual sLong CSG_Grids::asLong | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 381 of file grids.h.

References SG_ROUND_TO_SLONG.

◆ asLong() [2/2]

virtual sLong CSG_Grids::asLong | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 382 of file grids.h.

References SG_ROUND_TO_SLONG.

◆ asShort() [1/2]

virtual short CSG_Grids::asShort | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 377 of file grids.h.

References SG_ROUND_TO_SHORT.

◆ asShort() [2/2]

virtual short CSG_Grids::asShort | ( | sLong | i,
 |  | bool | bScaled = true
 | ) |  | const
 inlinevirtual

Definition at line 378 of file grids.h.

References SG_ROUND_TO_SHORT.

◆ Assign() [1/3]

bool CSG_Grids::Assign ( CSG_Data_Object * pObject )
virtual

Reimplemented from CSG_Data_Object.

Definition at line 910 of file grids.cpp.

References Assign(), Get_Grid_Count(), CSG_Data_Object::Get_ObjectType(), SG_DATAOBJECT_TYPE_Grid, and SG_DATAOBJECT_TYPE_Grids.

◆ Assign() [2/3]

bool CSG_Grids::Assign | ( | CSG_Grids * | pGrids,
 |  | TSG_Grid_Resampling | Interpolation
 | ) |  |
virtual

Definition at line 943 of file grids.cpp.

References Assign(), and Get_Grid_Count().

◆ Assign() [3/3]

bool CSG_Grids::Assign ( double Value = 0. )
virtual

Definition at line 899 of file grids.cpp.

References CSG_Grid::Assign(), and Get_Grid_Count().

Referenced by Assign(), and operator=().

◆ Assign_NoData()

void CSG_Grids::Assign_NoData ( void )

Definition at line 890 of file grids.cpp.

References CSG_Grid::Assign_NoData(), and Get_Grid_Count().

◆ Create() [1/8]

bool CSG_Grids::Create | ( | const char * | FileName,
 |  | bool | bLoadData = true
 | ) |  |
virtual

Definition at line 307 of file grids.cpp.

References Load().

◆ Create() [2/8]

bool CSG_Grids::Create | ( | const CSG_Grid_System & | System,
 |  | const CSG_Table & | Attributes,
 |  | int | zAttribute = 0,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCreateGrids = false
 | ) |  |
virtual

Definition at line 335 of file grids.cpp.

References Add_Grid(), CSG_Grid::Create(), CSG_Table::Create(), Destroy(), CSG_Table::Get_Count(), and Set_Z_Attribute().

◆ Create() [3/8]

bool CSG_Grids::Create | ( | const CSG_Grid_System & | System,
 |  | int | NZ = 0,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |
virtual

Definition at line 312 of file grids.cpp.

References Add_Grid(), Create(), Destroy(), CSG_Grid_System::Get_Cellsize(), CSG_Data_Object::Get_NoData_Value(), and Set_NoData_Value_Range().

◆ Create() [4/8]

bool CSG_Grids::Create ( const CSG_Grids & Grids )
virtual

Definition at line 271 of file grids.cpp.

Referenced by Add_Grid(), Create(), CSG_Grids(), On_Reload(), and operator=().

◆ Create() [5/8]

bool CSG_Grids::Create | ( | const CSG_Grids * | pGrids,
 |  | bool | bCopyData = false
 | ) |  |
virtual

Definition at line 277 of file grids.cpp.

References CSG_MetaData::Add_Children(), Add_Grid(), Create(), CSG_Projection::Create(), CSG_Table::Create(), CSG_MetaData::Del_Children(), Get_Attributes(), Get_Grid_Ptr(), CSG_Data_Object::Get_MetaData_DB(), CSG_Data_Object::Get_NoData_Value(), Get_NZ(), CSG_Data_Object::Get_Projection(), Get_System(), Get_Type(), Get_Z_Attribute(), Get_Z_Name_Field(), is_Valid(), Set_NoData_Value_Range(), Set_Z_Attribute(), and Set_Z_Name_Field().

◆ Create() [6/8]

bool CSG_Grids::Create | ( | const CSG_String & | FileName,
 |  | bool | bLoadData = true
 | ) |  |
virtual

Definition at line 309 of file grids.cpp.

References Load().

◆ Create() [7/8]

bool CSG_Grids::Create | ( | const wchar_t * | FileName,
 |  | bool | bLoadData = true
 | ) |  |
virtual

Definition at line 308 of file grids.cpp.

References Load().

◆ Create() [8/8]

bool CSG_Grids::Create | ( | int | NX,
 |  | int | NY,
 |  | int | NZ = 0,
 |  | double | Cellsize = 0.,
 |  | double | xMin = 0.,
 |  | double | yMin = 0.,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |
virtual

Definition at line 361 of file grids.cpp.

References Create().

◆ Del_Attribute()

bool CSG_Grids::Del_Attribute ( int iField )

Definition at line 480 of file grids.cpp.

References CSG_Table::Del_Field(), and CSG_Table::Get_Field_Count().

◆ Del_Grid()

bool CSG_Grids::Del_Grid | ( | int | i,
 |  | bool | bDetach = false
 | ) |  |

Definition at line 765 of file grids.cpp.

References CSG_Table::Del_Record(), CSG_Array_Pointer::Get_Array(), Get_NZ(), CSG_Data_Object::Set_Owner(), SG_Create_Grid(), and SG_FREE_SAFE.

◆ Del_Grids()

bool CSG_Grids::Del_Grids ( bool bDetach = false )

Definition at line 803 of file grids.cpp.

References CSG_Table::Del_Records(), CSG_Array_Pointer::Get_Array(), CSG_Data_Object::Get_Owner(), CSG_Array_Pointer::Get_uSize(), CSG_Data_Object::Set_Owner(), SG_Create_Grid(), and SG_FREE_SAFE.

Referenced by CSG_Parameters_Grid_Target::Get_Grids(), and Set_Grid_Count().

◆ Destroy()

bool CSG_Grids::Destroy ( void )
virtual

Destroys the data space of the CSG_Grids object.

Reimplemented from CSG_Data_Object.

Definition at line 245 of file grids.cpp.

References CSG_Table::Add_Field(), CSG_Data_Object::Destroy(), CSG_Grid::Destroy(), CSG_Table::Destroy(), CSG_Array_Pointer::Get_Array(), CSG_Array_Pointer::Get_uSize(), SG_DATATYPE_Double, and SG_FREE_SAFE.

Referenced by Create(), Load(), and ~CSG_Grids().

◆ Divide()

CSG_Grids & CSG_Grids::Divide ( double Value )
virtual

Definition at line 1033 of file grids.cpp.

References CSG_Grid::Divide(), and Get_Grid_Count().

Referenced by operator/=().

◆ Get_Attributes() [1/2]

CSG_Table_Record& CSG_Grids::Get_Attributes ( int i ) const
inline

Definition at line 219 of file grids.h.

◆ Get_Attributes() [2/2]

const CSG_Table& CSG_Grids::Get_Attributes ( void ) const
inline

Definition at line 216 of file grids.h.

Referenced by Create().

◆ Get_Attributes_Ptr()

CSG_Table* CSG_Grids::Get_Attributes_Ptr ( void )
inline

Definition at line 217 of file grids.h.

◆ Get_Cellarea()

double CSG_Grids::Get_Cellarea ( void ) const
inline

Definition at line 193 of file grids.h.

References Get_Cellarea().

Referenced by Get_Cellarea().

◆ Get_Cellsize()

double CSG_Grids::Get_Cellsize ( void ) const
inline

Definition at line 192 of file grids.h.

References Get_Cellsize().

Referenced by Get_Cellsize(), and Set_Grid_Count().

◆ Get_Data_Count()

sLong CSG_Grids::Get_Data_Count ( void )

Definition at line 1413 of file grids.cpp.

References CSG_Simple_Statistics::Get_Count(), and CSG_Data_Object::Update().

Referenced by Get_Quantile().

◆ Get_Extent() [1/2]

const CSG_Rect& CSG_Grids::Get_Extent ( bool bCells = false ) const
inline

Definition at line 195 of file grids.h.

References Get_Extent().

Referenced by Get_Extent().

◆ Get_Extent() [2/2]

virtual const CSG_Rect& CSG_Grids::Get_Extent ( void )
inlinevirtual

Implements CSG_Data_Object.

Definition at line 183 of file grids.h.

References Get_Extent().

Referenced by Get_Extent(), and Get_Value().

◆ Get_Grid()

const CSG_Grid& CSG_Grids::Get_Grid ( int i ) const
inline

Definition at line 247 of file grids.h.

◆ Get_Grid_Count()

int CSG_Grids::Get_Grid_Count ( void ) const
inline

Definition at line 237 of file grids.h.

Referenced by Add(), Assign(), Assign_NoData(), Divide(), Get_Grid_Name(), Multiply(), Set_Max_Samples(), Set_NoData_Value_Range(), Set_Scaling(), Subtract(), CSG_Parameter_Grid_List::Update_Data(), and Update_Z_Order().

◆ Get_Grid_Name()

CSG_String CSG_Grids::Get_Grid_Name | ( | int | i,
 |  | int | Style = 0
 | ) |  | const

Definition at line 841 of file grids.cpp.

References _TL, Get_Grid_Count(), CSG_Data_Object::Get_Name(), Get_Z(), Get_Z_Name_Field(), CSG_String::is_Empty(), CSG_String::Printf(), SG_Get_String(), SG_GRIDS_NAME_GRID, SG_GRIDS_NAME_INDEX, SG_GRIDS_NAME_OWNER, and SG_GRIDS_NAME_VALUE.

Referenced by Update_Z_Order().

◆ Get_Grid_Ptr()

CSG_Grid* CSG_Grids::Get_Grid_Ptr ( int i ) const
inline

Definition at line 248 of file grids.h.

Referenced by CSG_Parameter_Data_Object::_Serialize(), Create(), CSG_Grid_Collection::Exists(), Set_Max_Samples(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Histogram() [1/2]

bool CSG_Grids::Get_Histogram | ( | const CSG_Rect & | rWorld,
 |  | CSG_Histogram & | Histogram,
 |  | size_t | nClasses = 0
 | ) |  | const

Definition at line 1580 of file grids.cpp.

References asDouble(), CSG_Histogram::Create(), CSG_Data_Object::Get_Max_Samples(), CSG_Simple_Statistics::Get_Maximum(), CSG_Simple_Statistics::Get_Minimum(), Get_NX(), Get_NY(), Get_NZ(), Get_Offset(), Get_Scaling(), Get_Statistics(), Get_System(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Grid_System::Get_xWorld_to_Grid(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), CSG_Grid_System::Get_yWorld_to_Grid(), CSG_Data_Object::is_NoData_Value(), is_Scaled(), SG_GRID_HISTOGRAM_CLASSES_DEFAULT, and CSG_Histogram::Update().

◆ Get_Histogram() [2/2]

const CSG_Histogram & CSG_Grids::Get_Histogram ( size_t nClasses = 0 )

Returns the histogram for the whole data set. It is automatically updated if necessary.

Definition at line 1562 of file grids.cpp.

References CSG_Histogram::Create(), CSG_Histogram::Destroy(), CSG_Histogram::Get_Class_Count(), CSG_Simple_Statistics::Get_Count(), Get_Max(), CSG_Data_Object::Get_Max_Samples(), Get_Min(), CSG_Histogram::Get_Statistics(), SG_GRID_HISTOGRAM_CLASSES_DEFAULT, and CSG_Data_Object::Update().

Referenced by Get_Quantile().

◆ Get_Max()

double CSG_Grids::Get_Max ( void )

Definition at line 1392 of file grids.cpp.

References CSG_Simple_Statistics::Get_Maximum(), and CSG_Data_Object::Update().

Referenced by Get_Histogram(), and Get_Quantile().

◆ Get_Mean()

double CSG_Grids::Get_Mean ( void )

Definition at line 1382 of file grids.cpp.

References CSG_Simple_Statistics::Get_Mean(), and CSG_Data_Object::Update().

◆ Get_Memory_Size()

sLong CSG_Grids::Get_Memory_Size ( void ) const
inline

Definition at line 251 of file grids.h.

References Get_Memory_Size().

Referenced by Get_Memory_Size(), and CSG_Data_Manager::Get_Summary().

◆ Get_Min()

double CSG_Grids::Get_Min ( void )

Definition at line 1387 of file grids.cpp.

References CSG_Simple_Statistics::Get_Minimum(), and CSG_Data_Object::Update().

Referenced by Get_Histogram(), and Get_Quantile().

◆ Get_NCells()

sLong CSG_Grids::Get_NCells ( void ) const
inline

Definition at line 188 of file grids.h.

References Get_NCells().

Referenced by CSG_Natural_Breaks::Create(), CSG_Histogram::Create(), Get_NCells(), Get_NoData_Count(), and On_Update().

◆ Get_nLineBytes()

int CSG_Grids::Get_nLineBytes ( void ) const
inline

Definition at line 172 of file grids.h.

◆ Get_NoData_Count()

sLong CSG_Grids::Get_NoData_Count ( void )

Definition at line 1418 of file grids.cpp.

References CSG_Simple_Statistics::Get_Count(), Get_NCells(), and CSG_Data_Object::Update().

◆ Get_nValueBytes()

int CSG_Grids::Get_nValueBytes ( void ) const
inline

Definition at line 171 of file grids.h.

References Get_nValueBytes().

Referenced by Get_nValueBytes().

◆ Get_NX()

int CSG_Grids::Get_NX ( void ) const
inline

Definition at line 185 of file grids.h.

References Get_NX().

Referenced by Get_Histogram(), Get_NX(), and Get_Statistics().

◆ Get_NY()

int CSG_Grids::Get_NY ( void ) const
inline

Definition at line 186 of file grids.h.

References Get_NY().

Referenced by Get_Histogram(), Get_NY(), and Get_Statistics().

◆ Get_NZ()

int CSG_Grids::Get_NZ ( void ) const
inline

Definition at line 187 of file grids.h.

Referenced by CSG_Parameter_Data_Object::_Serialize(), Add_Grid(), Create(), Del_Grid(), CSG_Grid_Collection::Exists(), Get_Histogram(), Get_Statistics(), CSG_Data_Manager::Get_Summary(), is_Compatible(), Set_Grid_Count(), and Set_Z().

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_Grids::Get_ObjectType ( void ) const
inlinevirtual

Data object type information.

Implements CSG_Data_Object.

Definition at line 163 of file grids.h.

References SG_DATAOBJECT_TYPE_Grids.

◆ Get_Offset()

double CSG_Grids::Get_Offset ( void ) const
inline

Definition at line 259 of file grids.h.

Referenced by Get_Histogram(), Get_Statistics(), and On_Update().

◆ Get_Percentile()

double CSG_Grids::Get_Percentile | ( | double | Percentile,
 |  | bool | bFromHistogram = true
 | ) |  |

Definition at line 1447 of file grids.cpp.

References Get_Quantile().

◆ Get_Quantile()

double CSG_Grids::Get_Quantile | ( | double | Quantile,
 |  | bool | bFromHistogram = true
 | ) |  |

Definition at line 1424 of file grids.cpp.

References asDouble(), Get_Data_Count(), Get_Histogram(), Get_Max(), Get_Min(), CSG_Data_Object::Get_NoData_Value(), and Get_Sorted().

Referenced by Get_Percentile().

◆ Get_Range()

double CSG_Grids::Get_Range ( void )

Definition at line 1397 of file grids.cpp.

References CSG_Simple_Statistics::Get_Range(), and CSG_Data_Object::Update().

◆ Get_Scaling()

double CSG_Grids::Get_Scaling ( void ) const
inline

Definition at line 258 of file grids.h.

References Get_Scaling().

Referenced by Get_Histogram(), Get_Scaling(), Get_Statistics(), and On_Update().

◆ Get_Sorted() [1/3]

sLong CSG_Grids::Get_Sorted | ( | sLong | Position,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 438 of file grids.h.

Referenced by Get_Quantile().

◆ Get_Sorted() [2/3]

bool CSG_Grids::Get_Sorted | ( | sLong | Position,
 |  | int & | x,
 |  | int & | y,
 |  | int & | z,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 458 of file grids.h.

◆ Get_Sorted() [3/3]

bool CSG_Grids::Get_Sorted | ( | sLong | Position,
 |  | sLong & | i,
 |  | bool | bDown = true,
 |  | bool | bCheckNoData = true
 | ) |  |
inline

Definition at line 453 of file grids.h.

◆ Get_Statistics() [1/2]

bool CSG_Grids::Get_Statistics | ( | const CSG_Rect & | rWorld,
 |  | CSG_Simple_Statistics & | Statistics,
 |  | bool | bHoldValues = false
 | ) |  | const

Calculate statistics for the region specified with rWorld. Returns false, if there is no overlapping. Set bHoldValues to true, if you need to obtain quantiles.

Definition at line 1476 of file grids.cpp.

References asDouble(), CSG_Simple_Statistics::Create(), CSG_Simple_Statistics::Get_Count(), CSG_Data_Object::Get_Max_Samples(), Get_NX(), Get_NY(), Get_NZ(), Get_Offset(), Get_Scaling(), Get_System(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Grid_System::Get_xWorld_to_Grid(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), CSG_Grid_System::Get_yWorld_to_Grid(), CSG_Data_Object::is_NoData_Value(), and is_Scaled().

◆ Get_Statistics() [2/2]

const CSG_Simple_Statistics & CSG_Grids::Get_Statistics ( void )

Returns the statistics for the whole data set. It is automatically updated if necessary. Statistics give no access to parameters like quantiles that need values to be kept internally. Use Get_Quantile() function instead.

Definition at line 1464 of file grids.cpp.

References CSG_Data_Object::Update().

Referenced by Get_Histogram().

◆ Get_StdDev()

double CSG_Grids::Get_StdDev ( void )

Definition at line 1402 of file grids.cpp.

References CSG_Simple_Statistics::Get_StdDev(), and CSG_Data_Object::Update().

◆ Get_System()

const CSG_Grid_System& CSG_Grids::Get_System ( void ) const
inline

Definition at line 181 of file grids.h.

References Get_System().

Referenced by Add_Grid(), Create(), Get_Histogram(), Get_Statistics(), Get_System(), Get_Value(), is_Compatible(), is_Valid(), and Set_Grid_Count().

◆ Get_Type()

TSG_Data_Type CSG_Grids::Get_Type ( void ) const
inline

Definition at line 169 of file grids.h.

References Get_Type().

Referenced by Add_Grid(), Create(), CSG_Data_Manager::Get_Summary(), Get_Type(), and is_Compatible().

◆ Get_Unit()

const SG_Char* CSG_Grids::Get_Unit ( void ) const
inline

Definition at line 175 of file grids.h.

References Get_Unit().

Referenced by Get_Unit().

◆ Get_Value() [1/4]

bool CSG_Grids::Get_Value | ( | const TSG_Point_3D & | p,
 |  | double & | Value,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | TSG_Grid_Resampling | ZResampling = GRID_RESAMPLING_Undefined
 | ) |  | const

Definition at line 1065 of file grids.cpp.

References Get_Value(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Value() [2/4]

double CSG_Grids::Get_Value | ( | const TSG_Point_3D & | p,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | TSG_Grid_Resampling | ZResampling = GRID_RESAMPLING_Undefined
 | ) |  | const

Definition at line 1051 of file grids.cpp.

References CSG_Data_Object::Get_NoData_Value(), Get_Value(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Value() [3/4]

bool CSG_Grids::Get_Value | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | double & | Value,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | TSG_Grid_Resampling | ZResampling = GRID_RESAMPLING_Undefined
 | ) |  | const

Definition at line 1071 of file grids.cpp.

References ADD_TO_SPLINE, CSG_Table::Get_Count(), Get_Extent(), Get_System(), CSG_Spline::Get_Value(), Get_Value(), GRID_RESAMPLING_BicubicSpline, GRID_RESAMPLING_Bilinear, GRID_RESAMPLING_BSpline, GRID_RESAMPLING_NearestNeighbour, and GRID_RESAMPLING_Undefined.

◆ Get_Value() [4/4]

double CSG_Grids::Get_Value | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | TSG_Grid_Resampling | Resampling = GRID_RESAMPLING_BSpline,
 |  | TSG_Grid_Resampling | ZResampling = GRID_RESAMPLING_Undefined
 | ) |  | const

Definition at line 1058 of file grids.cpp.

References CSG_Data_Object::Get_NoData_Value().

Referenced by Get_Value().

◆ Get_Variance()

double CSG_Grids::Get_Variance ( void )

Definition at line 1407 of file grids.cpp.

References CSG_Simple_Statistics::Get_Variance(), and CSG_Data_Object::Update().

◆ Get_XMax()

double CSG_Grids::Get_XMax ( bool bCells = false ) const
inline

Definition at line 198 of file grids.h.

◆ Get_XMin()

double CSG_Grids::Get_XMin ( bool bCells = false ) const
inline

Definition at line 197 of file grids.h.

◆ Get_XRange()

double CSG_Grids::Get_XRange ( bool bCells = false ) const
inline

Definition at line 199 of file grids.h.

References Get_XRange().

Referenced by Get_XRange().

◆ Get_YMax()

double CSG_Grids::Get_YMax ( bool bCells = false ) const
inline

Definition at line 202 of file grids.h.

◆ Get_YMin()

double CSG_Grids::Get_YMin ( bool bCells = false ) const
inline

Definition at line 201 of file grids.h.

◆ Get_YRange()

double CSG_Grids::Get_YRange ( bool bCells = false ) const
inline

Definition at line 203 of file grids.h.

References Get_YRange().

Referenced by Get_YRange().

◆ Get_Z()

double CSG_Grids::Get_Z ( int i ) const
inline

Definition at line 228 of file grids.h.

Referenced by Get_Grid_Name().

◆ Get_Z_Attribute()

int CSG_Grids::Get_Z_Attribute ( void ) const
inline

Definition at line 222 of file grids.h.

Referenced by Create().

◆ Get_Z_Name_Field()

int CSG_Grids::Get_Z_Name_Field ( void ) const

Definition at line 530 of file grids.cpp.

References CSG_Table::Get_Field_Count().

Referenced by Create(), and Get_Grid_Name().

◆ Get_ZMax()

double CSG_Grids::Get_ZMax ( bool bCells = false ) const
inline

Definition at line 206 of file grids.h.

Referenced by Set_Grid_Count().

◆ Get_ZMin()

double CSG_Grids::Get_ZMin ( bool bCells = false ) const
inline

Definition at line 205 of file grids.h.

◆ Get_ZRange()

double CSG_Grids::Get_ZRange ( bool bCells = false ) const
inline

Definition at line 207 of file grids.h.

◆ is_Compatible() [1/4]

bool CSG_Grids::is_Compatible ( const CSG_Grid_System & System ) const

Definition at line 456 of file grids.cpp.

References Get_System().

◆ is_Compatible() [2/4]

bool CSG_Grids::is_Compatible ( CSG_Grid * pGrid ) const

Definition at line 446 of file grids.cpp.

References CSG_Grid::Get_System(), CSG_Grid::Get_Type(), and Get_Type().

Referenced by Add_Grid(), and is_Compatible().

◆ is_Compatible() [3/4]

bool CSG_Grids::is_Compatible ( CSG_Grids * pGrids ) const

Definition at line 451 of file grids.cpp.

References Get_NZ(), Get_System(), and is_Compatible().

◆ is_Compatible() [4/4]

bool CSG_Grids::is_Compatible | ( | int | NX,
 |  | int | NY,
 |  | double | Cellsize,
 |  | double | xMin,
 |  | double | yMin
 | ) |  | const

Definition at line 461 of file grids.cpp.

References is_Compatible().

◆ is_InGrid()

bool CSG_Grids::is_InGrid | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 294 of file grids.h.

References is_InGrid().

Referenced by is_InGrid().

◆ is_InGrid_byPos() [1/2]

bool CSG_Grids::is_InGrid_byPos | ( | const TSG_Point_3D & | p,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 296 of file grids.h.

References is_InGrid_byPos(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

Referenced by is_InGrid_byPos().

◆ is_InGrid_byPos() [2/2]

bool CSG_Grids::is_InGrid_byPos | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | bool | bCheckNoData = true
 | ) |  | const
 inline

Definition at line 295 of file grids.h.

References CSG_Data_Object::Get_Extent().

◆ is_Intersecting() [1/3]

TSG_Intersection CSG_Grids::is_Intersecting ( const CSG_Rect & Extent ) const
inline

Definition at line 285 of file grids.h.

References is_Intersecting().

Referenced by is_Intersecting().

◆ is_Intersecting() [2/3]

TSG_Intersection CSG_Grids::is_Intersecting ( const TSG_Rect & Extent ) const
inline

Definition at line 286 of file grids.h.

References is_Intersecting().

Referenced by is_Intersecting().

◆ is_Intersecting() [3/3]

TSG_Intersection CSG_Grids::is_Intersecting | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  | const
 inline

Definition at line 287 of file grids.h.

References is_Intersecting().

Referenced by is_Intersecting().

◆ is_Modified()

virtual bool CSG_Grids::is_Modified ( void ) const
inlinevirtual

Reimplemented from CSG_Data_Object.

Definition at line 314 of file grids.h.

References CSG_Data_Object::is_Modified().

◆ is_NoData() [1/2]

virtual bool CSG_Grids::is_NoData | ( | int | x,
 |  | int | y,
 |  | int | z
 | ) |  | const
 inlinevirtual

Definition at line 358 of file grids.h.

References CSG_Data_Object::is_NoData_Value().

Referenced by CSG_Natural_Breaks::Create(), and CSG_Histogram::Create().

◆ is_NoData() [2/2]

virtual bool CSG_Grids::is_NoData ( sLong i ) const
inlinevirtual

Definition at line 359 of file grids.h.

References CSG_Data_Object::is_NoData_Value().

◆ is_Scaled()

bool CSG_Grids::is_Scaled ( void ) const
inline

Definition at line 260 of file grids.h.

Referenced by Get_Histogram(), Get_Statistics(), and On_Update().

◆ is_Valid()

bool CSG_Grids::is_Valid ( void ) const
virtual

Implements CSG_Data_Object.

Definition at line 440 of file grids.cpp.

References Get_System().

Referenced by Add_Grid(), Create(), On_Update(), Set_Grid_Count(), and SG_Create_Grids().

◆ Load()

bool CSG_Grids::Load | ( | const CSG_String & | File,
 |  | bool | bLoadData = true
 | ) |  |
virtual

Definition at line 1689 of file grids.cpp.

References _TL, CSG_String::c_str(), Destroy(), CSG_String::Format(), Set_Modified(), CSG_Data_Object::Set_Name(), SG_File_Get_Name(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_Process_Set_Ready().

Referenced by Create().

◆ Mul_Value() [1/2]

virtual void CSG_Grids::Mul_Value | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 406 of file grids.h.

◆ Mul_Value() [2/2]

virtual void CSG_Grids::Mul_Value | ( | sLong | i,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 407 of file grids.h.

◆ Multiply()

CSG_Grids & CSG_Grids::Multiply ( double Value )
virtual

Definition at line 1017 of file grids.cpp.

References Get_Grid_Count(), and CSG_Grid::Multiply().

Referenced by operator*=().

◆ On_Delete()

bool CSG_Grids::On_Delete ( void )
protectedvirtual

Implements CSG_Data_Object.

Definition at line 1663 of file grids.cpp.

References CSG_String::Format(), CSG_Data_Object::Get_File_Name(), SG_File_Delete(), and SG_File_Set_Extension().

◆ On_Reload()

bool CSG_Grids::On_Reload ( void )
protectedvirtual

Implements CSG_Data_Object.

Definition at line 1657 of file grids.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_Grids::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Data_Object.

Definition at line 1335 of file grids.cpp.

References asDouble(), CSG_Histogram::Destroy(), CSG_Simple_Statistics::Get_Count(), CSG_Data_Object::Get_Max_Samples(), Get_NCells(), Get_Offset(), Get_Scaling(), CSG_Simple_Statistics::Invalidate(), CSG_Data_Object::is_NoData_Value(), is_Scaled(), is_Valid(), CSG_Simple_Statistics::Set_Count(), and SG_FREE_SAFE.

◆ operator()()

virtual double CSG_Grids::operator() | ( | int | x,
 |  | int | y,
 |  | int | z
 | ) |  | const
 inlinevirtual

Definition at line 348 of file grids.h.

◆ operator*=()

CSG_Grids & CSG_Grids::operator*= ( double Value )
virtual

Definition at line 1012 of file grids.cpp.

References Multiply().

◆ operator+=()

CSG_Grids & CSG_Grids::operator+= ( double Value )
virtual

Definition at line 980 of file grids.cpp.

References Add().

◆ operator-=()

CSG_Grids & CSG_Grids::operator-= ( double Value )
virtual

Definition at line 996 of file grids.cpp.

References Subtract().

◆ operator/=()

CSG_Grids & CSG_Grids::operator/= ( double Value )
virtual

Definition at line 1028 of file grids.cpp.

References Divide().

◆ operator=() [1/2]

CSG_Grids & CSG_Grids::operator= ( const CSG_Grids & Grids )
virtual

Definition at line 969 of file grids.cpp.

References Create().

◆ operator=() [2/2]

CSG_Grids & CSG_Grids::operator= ( double Value )
virtual

Definition at line 974 of file grids.cpp.

References Assign().

◆ operator[]()

virtual CSG_Grid& CSG_Grids::operator[] ( int i )
inlinevirtual

Definition at line 350 of file grids.h.

◆ Save() [1/3]

virtual bool CSG_Grids::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Definition at line 156 of file grids.h.

References Save().

Referenced by Save().

◆ Save() [2/3]

bool CSG_Grids::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Implements CSG_Data_Object.

Definition at line 1717 of file grids.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), GRIDS_FILE_FORMAT_Compressed, GRIDS_FILE_FORMAT_GeoTIFF, GRIDS_FILE_FORMAT_Normal, GRIDS_FILE_FORMAT_Undefined, CSG_Data_Object::Set_File_Name(), Set_Modified(), SG_File_Cmp_Extension(), SG_RUN_TOOL, SG_TOOL_PARAMETER_SET, SG_TOOL_PARAMLIST_ADD, SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_Process_Set_Ready().

◆ Save() [3/3]

virtual bool CSG_Grids::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Definition at line 157 of file grids.h.

References Save().

Referenced by Save().

◆ Set_Grid_Count()

bool CSG_Grids::Set_Grid_Count ( int Count )

Definition at line 583 of file grids.cpp.

References Add_Grid(), Del_Grids(), CSG_Array_Pointer::Get_Array(), Get_Cellsize(), Get_NZ(), Get_System(), Get_ZMax(), is_Valid(), CSG_Table::Set_Count(), and SG_FREE_SAFE.

◆ Set_Index()

bool CSG_Grids::Set_Index ( bool bOn = true )
inline

Definition at line 426 of file grids.h.

References SG_FREE_SAFE.

◆ Set_Max_Samples()

bool CSG_Grids::Set_Max_Samples ( sLong Max_Samples )
virtual

Reimplemented from CSG_Data_Object.

Definition at line 1539 of file grids.cpp.

References Get_Grid_Count(), Get_Grid_Ptr(), and CSG_Data_Object::Set_Max_Samples().

◆ Set_Modified()

virtual void CSG_Grids::Set_Modified ( bool bModified = true )
inlinevirtual

Reimplemented from CSG_Data_Object.

Definition at line 302 of file grids.h.

References CSG_Data_Object::Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by Load(), and Save().

◆ Set_NoData() [1/2]

virtual void CSG_Grids::Set_NoData | ( | int | x,
 |  | int | y,
 |  | int | z
 | ) |  |
inlinevirtual

Definition at line 361 of file grids.h.

References CSG_Data_Object::Get_NoData_Value().

◆ Set_NoData() [2/2]

virtual void CSG_Grids::Set_NoData ( sLong i )
inlinevirtual

Definition at line 362 of file grids.h.

References CSG_Data_Object::Get_NoData_Value().

◆ Set_NoData_Value_Range()

bool CSG_Grids::Set_NoData_Value_Range | ( | double | loValue,
 |  | double | hiValue
 | ) |  |
virtual

Reimplemented from CSG_Data_Object.

Definition at line 393 of file grids.cpp.

References Get_Grid_Count(), and CSG_Data_Object::Set_NoData_Value_Range().

Referenced by Create().

◆ Set_Scaling()

void CSG_Grids::Set_Scaling | ( | double | Scale = 1.,
 |  | double | Offset = 0.
 | ) |  |

Definition at line 380 of file grids.cpp.

References Get_Grid_Count(), CSG_Grid::Set_Scaling(), and CSG_Data_Object::Set_Update_Flag().

◆ Set_Unit()

void CSG_Grids::Set_Unit ( const CSG_String & Unit )

Definition at line 374 of file grids.cpp.

References CSG_Grid::Set_Unit().

◆ Set_Value() [1/2]

virtual void CSG_Grids::Set_Value | ( | int | x,
 |  | int | y,
 |  | int | z,
 |  | double | Value,
 |  | bool | bScaled = true
 | ) |  |
inlinevirtual

Definition at line 417 of file grids.h.

◆ Set_Value() [2/2]

virtual void CSG_Grids::Set_Value | ( | sLong | i,
 |  | double | Value,
 |  | bool | bScaled = true
 | ) |  |
inlinevirtual

Definition at line 410 of file grids.h.

Referenced by Set_Z().

◆ Set_Z()

bool CSG_Grids::Set_Z | ( | int | i,
 |  | double | Value
 | ) |  |

Definition at line 536 of file grids.cpp.

References Get_NZ(), and Set_Value().

◆ Set_Z_Attribute()

bool CSG_Grids::Set_Z_Attribute ( int i )

Definition at line 505 of file grids.cpp.

References CSG_Table::Get_Field_Count(), and Update_Z_Order().

Referenced by Create().

◆ Set_Z_Name_Field()

bool CSG_Grids::Set_Z_Name_Field ( int i )

Definition at line 518 of file grids.cpp.

References CSG_Table::Get_Field_Count().

Referenced by Create().

◆ Subtract()

CSG_Grids & CSG_Grids::Subtract ( double Value )
virtual

Definition at line 1001 of file grids.cpp.

References Get_Grid_Count(), and CSG_Grid::Subtract().

Referenced by operator-=().

◆ Update_Z_Order()

bool CSG_Grids::Update_Z_Order ( void )

Definition at line 542 of file grids.cpp.

References CSG_Table::Assign(), CSG_Array_Pointer::Create(), Get_Grid_Count(), Get_Grid_Name(), CSG_Table::Set_Index(), CSG_Data_Object::Set_Name(), and TABLE_INDEX_Ascending.

Referenced by Add_Grid(), and Set_Z_Attribute().

The documentation for this class was generated from the following files:
  • grids.h
  • grids.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Grids Member List

This is the complete list of members for CSG_Grids, including all inherited members.

Add(double Value) | CSG_Grids | virtual
Add_Attribute(const CSG_String &Name, TSG_Data_Type Type, int iField=-1) | CSG_Grids |
Add_Grid(double Z) | CSG_Grids |
Add_Grid(double Z, CSG_Grid *pGrid, bool bAttach=false) | CSG_Grids |
Add_Grid(CSG_Table_Record &Attributes) | CSG_Grids |
Add_Grid(CSG_Table_Record &Attributes, CSG_Grid *pGrid, bool bAttach=false) | CSG_Grids |
Add_Value(int x, int y, int z, double Value) | CSG_Grids | inlinevirtual
Add_Value(sLong i, double Value) | CSG_Grids | inlinevirtual
asByte(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asByte(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asChar(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asChar(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asDouble(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asDouble(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asFloat(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asFloat(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asInt(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asInt(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asLong(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asLong(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
asShort(int x, int y, int z, bool bScaled=true) const | CSG_Grids | inlinevirtual
asShort(sLong i, bool bScaled=true) const | CSG_Grids | inlinevirtual
Assign(double Value=0.) | CSG_Grids | virtual
Assign(CSG_Data_Object *pObject) | CSG_Grids | virtual
Assign(CSG_Grids *pGrids, TSG_Grid_Resampling Interpolation) | CSG_Grids | virtual
Assign_NoData(void) | CSG_Grids |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(const CSG_Grids &Grids) | CSG_Grids | virtual
Create(const CSG_Grids *pGrids, bool bCopyData=false) | CSG_Grids | virtual
Create(const char *FileName, bool bLoadData=true) | CSG_Grids | virtual
Create(const wchar_t *FileName, bool bLoadData=true) | CSG_Grids | virtual
Create(const CSG_String &FileName, bool bLoadData=true) | CSG_Grids | virtual
Create(const CSG_Grid_System &System, int NZ=0, double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Grids | virtual
Create(const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute=0, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCreateGrids=false) | CSG_Grids | virtual
Create(int NX, int NY, int NZ=0, double Cellsize=0., double xMin=0., double yMin=0., double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Grids | virtual
CSG_Data_Object(void) | CSG_Data_Object |
CSG_Grids(void) | CSG_Grids |
CSG_Grids(const CSG_Grids &Grids) | CSG_Grids |
CSG_Grids(const CSG_Grids *pGrids, bool bCopyData=false) | CSG_Grids |
CSG_Grids(const char *FileName, bool bLoadData=true) | CSG_Grids |
CSG_Grids(const wchar_t *FileName, bool bLoadData=true) | CSG_Grids |
CSG_Grids(const CSG_String &FileName, bool bLoadData=true) | CSG_Grids |
CSG_Grids(const CSG_Grid_System &System, int NZ=0, double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Grids |
CSG_Grids(const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute=0, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCreateGrids=false) | CSG_Grids |
CSG_Grids(int NX, int NY, int NZ=0, double Cellsize=0., double xMin=0., double yMin=0., double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined) | CSG_Grids |
Del_Attribute(int iField) | CSG_Grids |
Del_Grid(int i, bool bDetach=false) | CSG_Grids |
Del_Grids(bool bDetach=false) | CSG_Grids |
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_Grids | virtual
Divide(double Value) | CSG_Grids | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Attributes(void) const | CSG_Grids | inline
Get_Attributes(int i) const | CSG_Grids | inline
Get_Attributes_Ptr(void) | CSG_Grids | inline
Get_Cellarea(void) const | CSG_Grids | inline
Get_Cellsize(void) const | CSG_Grids | inline
Get_Data_Count(void) | CSG_Grids |
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void) | CSG_Grids | inlinevirtual
Get_Extent(bool bCells=false) const | CSG_Grids | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_Grid(int i) const | CSG_Grids | inline
Get_Grid_Count(void) const | CSG_Grids | inline
Get_Grid_Name(int i, int Style=0) const | CSG_Grids |
Get_Grid_Ptr(int i) const | CSG_Grids | inline
Get_Histogram(size_t nClasses=0) | CSG_Grids |
Get_Histogram(const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses=0) const | CSG_Grids |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Max(void) | CSG_Grids |
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Mean(void) | CSG_Grids |
Get_Memory_Size(void) const | CSG_Grids | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Min(void) | CSG_Grids |
Get_Name(void) const | CSG_Data_Object |
Get_NCells(void) const | CSG_Grids | inline
Get_nLineBytes(void) const | CSG_Grids | inline
Get_NoData_Count(void) | CSG_Grids |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_nValueBytes(void) const | CSG_Grids | inline
Get_NX(void) const | CSG_Grids | inline
Get_NY(void) const | CSG_Grids | inline
Get_NZ(void) const | CSG_Grids | inline
Get_ObjectType(void) const | CSG_Grids | inlinevirtual
Get_Offset(void) const | CSG_Grids | inline
Get_Owner(void) const | CSG_Data_Object | inline
Get_Percentile(double Percentile, bool bFromHistogram=true) | CSG_Grids |
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Quantile(double Quantile, bool bFromHistogram=true) | CSG_Grids |
Get_Range(void) | CSG_Grids |
Get_Scaling(void) const | CSG_Grids | inline
Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true) | CSG_Grids | inline
Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true) | CSG_Grids | inline
Get_Sorted(sLong Position, int &x, int &y, int &z, bool bDown=true, bool bCheckNoData=true) | CSG_Grids | inline
Get_Statistics(void) | CSG_Grids |
Get_Statistics(const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues=false) const | CSG_Grids |
Get_StdDev(void) | CSG_Grids |
Get_System(void) const | CSG_Grids | inline
Get_Type(void) const | CSG_Grids | inline
Get_Unit(void) const | CSG_Grids | inline
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(double x, double y, double z, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const | CSG_Grids |
Get_Value(const TSG_Point_3D &p, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const | CSG_Grids |
Get_Value(double x, double y, double z, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const | CSG_Grids |
Get_Value(const TSG_Point_3D &p, double &Value, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const | CSG_Grids |
Get_Variance(void) | CSG_Grids |
Get_XMax(bool bCells=false) const | CSG_Grids | inline
Get_XMin(bool bCells=false) const | CSG_Grids | inline
Get_XRange(bool bCells=false) const | CSG_Grids | inline
Get_YMax(bool bCells=false) const | CSG_Grids | inline
Get_YMin(bool bCells=false) const | CSG_Grids | inline
Get_YRange(bool bCells=false) const | CSG_Grids | inline
Get_Z(int i) const | CSG_Grids | inline
Get_Z_Attribute(void) const | CSG_Grids | inline
Get_Z_Name_Field(void) const | CSG_Grids |
Get_ZMax(bool bCells=false) const | CSG_Grids | inline
Get_ZMin(bool bCells=false) const | CSG_Grids | inline
Get_ZRange(bool bCells=false) const | CSG_Grids | inline
is_Compatible(CSG_Grid *pGrid) const | CSG_Grids |
is_Compatible(CSG_Grids *pGrids) const | CSG_Grids |
is_Compatible(const CSG_Grid_System &System) const | CSG_Grids |
is_Compatible(int NX, int NY, double Cellsize, double xMin, double yMin) const | CSG_Grids |
is_File_Native(void) const | CSG_Data_Object | inline
is_InGrid(int x, int y, int z, bool bCheckNoData=true) const | CSG_Grids | inline
is_InGrid_byPos(double x, double y, double z, bool bCheckNoData=true) const | CSG_Grids | inline
is_InGrid_byPos(const TSG_Point_3D &p, bool bCheckNoData=true) const | CSG_Grids | inline
is_Intersecting(const CSG_Rect &Extent) const | CSG_Grids | inline
is_Intersecting(const TSG_Rect &Extent) const | CSG_Grids | inline
is_Intersecting(double xMin, double yMin, double xMax, double yMax) const | CSG_Grids | inline
is_Modified(void) const | CSG_Grids | inlinevirtual
is_NoData(int x, int y, int z) const | CSG_Grids | inlinevirtual
is_NoData(sLong i) const | CSG_Grids | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Scaled(void) const | CSG_Grids | inline
is_Valid(void) const | CSG_Grids | virtual
Load(const CSG_String &File, bool bLoadData=true) | CSG_Grids | virtual
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_pOwner | CSG_Data_Object | protected
Mul_Value(int x, int y, int z, double Value) | CSG_Grids | inlinevirtual
Mul_Value(sLong i, double Value) | CSG_Grids | inlinevirtual
Multiply(double Value) | CSG_Grids | virtual
On_Delete(void) | CSG_Grids | protectedvirtual
On_NoData_Changed(void) | CSG_Data_Object | protectedvirtual
On_Reload(void) | CSG_Grids | protectedvirtual
On_Update(void) | CSG_Grids | protectedvirtual
operator()(int x, int y, int z) const | CSG_Grids | inlinevirtual
operator*=(double Value) | CSG_Grids | virtual
operator+=(double Value) | CSG_Grids | virtual
operator-=(double Value) | CSG_Grids | virtual
operator/=(double Value) | CSG_Grids | virtual
operator=(const CSG_Grids &Grids) | CSG_Grids | virtual
operator=(double Value) | CSG_Grids | virtual
operator[](int i) | CSG_Grids | inlinevirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format=0) | CSG_Grids | virtual
Save(const char *File, int Format=0) | CSG_Grids | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_Grids | inlinevirtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Grid_Count(int Count) | CSG_Grids |
Set_Index(bool bOn=true) | CSG_Grids | inline
Set_Max_Samples(sLong Max_Samples) | CSG_Grids | virtual
Set_Modified(bool bModified=true) | CSG_Grids | inlinevirtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData(int x, int y, int z) | CSG_Grids | inlinevirtual
Set_NoData(sLong i) | CSG_Grids | inlinevirtual
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double loValue, double hiValue) | CSG_Grids | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Scaling(double Scale=1., double Offset=0.) | CSG_Grids |
Set_Unit(const CSG_String &Unit) | CSG_Grids |
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(sLong i, double Value, bool bScaled=true) | CSG_Grids | inlinevirtual
Set_Value(int x, int y, int z, double Value, bool bScaled=true) | CSG_Grids | inlinevirtual
Set_Z(int i, double Value) | CSG_Grids |
Set_Z_Attribute(int i) | CSG_Grids |
Set_Z_Name_Field(int i) | CSG_Grids |
Subtract(double Value) | CSG_Grids | virtual
Update(bool bForce=false) | CSG_Data_Object |
Update_Z_Order(void) | CSG_Grids |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_Grids(void) | CSG_Grids | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Histogram Class Reference

Public Member Functions | List of all members
CSG_Histogram Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Histogram (void)
virtual | ~CSG_Histogram (void)
bool | Destroy (void)
CSG_Histogram (const CSG_Histogram &Histogram)
bool | Create (const CSG_Histogram &Histogram)
CSG_Histogram (size_t nClasses, double Minimum, double Maximum)
bool | Create (size_t nClasses, double Minimum, double Maximum)
CSG_Histogram (size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples=0)
bool | Create (size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples=0)
CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples=0)
bool | Create (size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples=0)
CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid, size_t maxSamples=0)
bool | Create (size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid, size_t maxSamples=0)
CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids, size_t maxSamples=0)
bool | Create (size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids, size_t maxSamples=0)
void | Add_Value (double Value)
bool | Scale_Element_Count (double Scale)
bool | Update (void)
size_t | Get_Class_Count (void) const
size_t | Get_Element_Count (void) const
size_t | Get_Element_Maximum (void) const
size_t | Get_Elements (int i) const
size_t | Get_Elements (size_t i) const
size_t | Get_Cumulative (int i) const
size_t | Get_Cumulative (size_t i) const
double | Get_Value (double i) const
double | Get_Break (int i) const
double | Get_Break (size_t i) const
double | Get_Center (int i) const
double | Get_Center (size_t i) const
CSG_Histogram & | operator= (const CSG_Histogram &Histogram)
void | operator+= (double Value)
size_t | operator[] (int i) const
size_t | operator[] (size_t i) const
double | Get_Quantile (double Quantile) const
double | Get_Quantile_Value (double Value) const
double | Get_Percentile (double Percentile) const
double | Get_Percentile_Value (double Value) const
const CSG_Simple_Statistics & | Get_Statistics (void) const

Detailed Description

Definition at line 985 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Histogram() [1/7]

CSG_Histogram::CSG_Histogram ( void )

Definition at line 1212 of file mat_tools.cpp.

◆ ~CSG_Histogram()

CSG_Histogram::~CSG_Histogram ( void )
virtual

Definition at line 1266 of file mat_tools.cpp.

References Destroy().

◆ CSG_Histogram() [2/7]

CSG_Histogram::CSG_Histogram ( const CSG_Histogram & Histogram )

Definition at line 1218 of file mat_tools.cpp.

References Create().

◆ CSG_Histogram() [3/7]

CSG_Histogram::CSG_Histogram | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum
 | ) |  |

Definition at line 1226 of file mat_tools.cpp.

References Create().

◆ CSG_Histogram() [4/7]

CSG_Histogram::CSG_Histogram | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | const CSG_Vector & | Values,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1234 of file mat_tools.cpp.

References Create().

◆ CSG_Histogram() [5/7]

CSG_Histogram::CSG_Histogram | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Table * | pTable,
 |  | int | Field,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1242 of file mat_tools.cpp.

References Create().

◆ CSG_Histogram() [6/7]

CSG_Histogram::CSG_Histogram | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Grid * | pGrid,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1250 of file mat_tools.cpp.

References Create().

◆ CSG_Histogram() [7/7]

CSG_Histogram::CSG_Histogram | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Grids * | pGrids,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1258 of file mat_tools.cpp.

References Create().

Member Function Documentation

◆ Add_Value()

void CSG_Histogram::Add_Value ( double Value )

Definition at line 1327 of file mat_tools.cpp.

Referenced by Create().

◆ Create() [1/6]

bool CSG_Histogram::Create ( const CSG_Histogram & Histogram )

Definition at line 1495 of file mat_tools.cpp.

Referenced by CSG_Natural_Breaks::Create(), CSG_Histogram(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), and operator=().

◆ Create() [2/6]

bool CSG_Histogram::Create | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum
 | ) |  |

Definition at line 1516 of file mat_tools.cpp.

◆ Create() [3/6]

bool CSG_Histogram::Create | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Grid * | pGrid,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1606 of file mat_tools.cpp.

References Add_Value(), CSG_Grid::asDouble(), CSG_Simple_Statistics::Get_Count(), CSG_Grid::Get_NCells(), CSG_Grid::is_NoData(), CSG_Data_Object::is_NoData_Value(), and Update().

◆ Create() [4/6]

bool CSG_Histogram::Create | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Grids * | pGrids,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1648 of file mat_tools.cpp.

References Add_Value(), CSG_Grids::asDouble(), CSG_Simple_Statistics::Get_Count(), CSG_Grids::Get_NCells(), CSG_Grids::is_NoData(), CSG_Data_Object::is_NoData_Value(), and Update().

◆ Create() [5/6]

bool CSG_Histogram::Create | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | class CSG_Table * | pTable,
 |  | int | Field,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1562 of file mat_tools.cpp.

References Add_Value(), CSG_Table_Record::asDouble(), CSG_Simple_Statistics::Get_Count(), CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Record(), CSG_Data_Object::is_NoData_Value(), and Update().

◆ Create() [6/6]

bool CSG_Histogram::Create | ( | size_t | nClasses,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | const CSG_Vector & | Values,
 |  | size_t | maxSamples = 0
 | ) |  |

Definition at line 1522 of file mat_tools.cpp.

References Add_Value(), CSG_Simple_Statistics::Get_Count(), CSG_Simple_Statistics::Get_Maximum(), CSG_Simple_Statistics::Get_Minimum(), CSG_Vector::Get_N(), and Update().

◆ Destroy()

bool CSG_Histogram::Destroy ( void )

Definition at line 1272 of file mat_tools.cpp.

References CSG_Simple_Statistics::Create(), and SG_FREE_SAFE.

Referenced by CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::On_Update(), CSG_Grids::On_Update(), and ~CSG_Histogram().

◆ Get_Break() [1/2]

double CSG_Histogram::Get_Break ( int i ) const
inline

Definition at line 1031 of file mat_tools.h.

Referenced by Get_Quantile(), and Get_Quantile_Value().

◆ Get_Break() [2/2]

double CSG_Histogram::Get_Break ( size_t i ) const
inline

Definition at line 1032 of file mat_tools.h.

◆ Get_Center() [1/2]

double CSG_Histogram::Get_Center ( int i ) const
inline

Definition at line 1034 of file mat_tools.h.

Referenced by Get_Quantile().

◆ Get_Center() [2/2]

double CSG_Histogram::Get_Center ( size_t i ) const
inline

Definition at line 1035 of file mat_tools.h.

◆ Get_Class_Count()

size_t CSG_Histogram::Get_Class_Count ( void ) const
inline

Definition at line 1018 of file mat_tools.h.

Referenced by CSG_Grid::Get_Histogram(), and CSG_Grids::Get_Histogram().

◆ Get_Cumulative() [1/2]

size_t CSG_Histogram::Get_Cumulative ( int i ) const
inline

Definition at line 1026 of file mat_tools.h.

References Get_Cumulative().

Referenced by Get_Cumulative().

◆ Get_Cumulative() [2/2]

size_t CSG_Histogram::Get_Cumulative ( size_t i ) const
inline

Definition at line 1027 of file mat_tools.h.

◆ Get_Element_Count()

size_t CSG_Histogram::Get_Element_Count ( void ) const
inline

Definition at line 1020 of file mat_tools.h.

Referenced by Get_Quantile(), Get_Quantile_Value(), Scale_Element_Count(), and Update().

◆ Get_Element_Maximum()

size_t CSG_Histogram::Get_Element_Maximum ( void ) const
inline

Definition at line 1021 of file mat_tools.h.

◆ Get_Elements() [1/2]

size_t CSG_Histogram::Get_Elements ( int i ) const
inline

Definition at line 1023 of file mat_tools.h.

References Get_Elements().

Referenced by Get_Elements().

◆ Get_Elements() [2/2]

size_t CSG_Histogram::Get_Elements ( size_t i ) const
inline

Definition at line 1024 of file mat_tools.h.

◆ Get_Percentile()

double CSG_Histogram::Get_Percentile ( double Percentile ) const

Returns the correspondend value for the requested percentile.

Definition at line 1444 of file mat_tools.cpp.

References Get_Quantile().

◆ Get_Percentile_Value()

double CSG_Histogram::Get_Percentile_Value ( double Value ) const

Returns the correspondend percentile for the requested value.

Definition at line 1484 of file mat_tools.cpp.

References Get_Quantile_Value().

◆ Get_Quantile()

double CSG_Histogram::Get_Quantile ( double Quantile ) const

Returns the correspondend value for the requested quantile.

Definition at line 1409 of file mat_tools.cpp.

References Get_Break(), Get_Center(), and Get_Element_Count().

Referenced by Get_Percentile().

◆ Get_Quantile_Value()

double CSG_Histogram::Get_Quantile_Value ( double Value ) const

Returns the correspondend quantile for the requested value.

Definition at line 1453 of file mat_tools.cpp.

References Get_Break(), and Get_Element_Count().

Referenced by Get_Percentile_Value().

◆ Get_Statistics()

const CSG_Simple_Statistics& CSG_Histogram::Get_Statistics ( void ) const
inline

Definition at line 1051 of file mat_tools.h.

Referenced by CSG_Grid::Get_Histogram(), and CSG_Grids::Get_Histogram().

◆ Get_Value()

double CSG_Histogram::Get_Value ( double i ) const
inline

Definition at line 1029 of file mat_tools.h.

◆ operator+=()

void CSG_Histogram::operator+= ( double Value )
inline

Definition at line 1040 of file mat_tools.h.

◆ operator=()

CSG_Histogram & CSG_Histogram::operator= ( const CSG_Histogram & Histogram )

Definition at line 1695 of file mat_tools.cpp.

References Create().

◆ operator[]() [1/2]

size_t CSG_Histogram::operator[] ( int i ) const
inline

Definition at line 1042 of file mat_tools.h.

◆ operator[]() [2/2]

size_t CSG_Histogram::operator[] ( size_t i ) const
inline

Definition at line 1043 of file mat_tools.h.

◆ Scale_Element_Count()

bool CSG_Histogram::Scale_Element_Count ( double Scale )

Definition at line 1345 of file mat_tools.cpp.

References Get_Element_Count(), CSG_Simple_Statistics::Set_Count(), and Update().

◆ Update()

bool CSG_Histogram::Update ( void )

Definition at line 1363 of file mat_tools.cpp.

References Get_Element_Count(), and CSG_Simple_Statistics::Get_Mean().

Referenced by Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), and Scale_Element_Count().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Histogram Member List

This is the complete list of members for CSG_Histogram, including all inherited members.

Add_Value(double Value) | CSG_Histogram |
Create(const CSG_Histogram &Histogram) | CSG_Histogram |
Create(size_t nClasses, double Minimum, double Maximum) | CSG_Histogram |
Create(size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples=0) | CSG_Histogram |
Create(size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples=0) | CSG_Histogram |
Create(size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid, size_t maxSamples=0) | CSG_Histogram |
Create(size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids, size_t maxSamples=0) | CSG_Histogram |
CSG_Histogram(void) | CSG_Histogram |
CSG_Histogram(const CSG_Histogram &Histogram) | CSG_Histogram |
CSG_Histogram(size_t nClasses, double Minimum, double Maximum) | CSG_Histogram |
CSG_Histogram(size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples=0) | CSG_Histogram |
CSG_Histogram(size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples=0) | CSG_Histogram |
CSG_Histogram(size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid, size_t maxSamples=0) | CSG_Histogram |
CSG_Histogram(size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids, size_t maxSamples=0) | CSG_Histogram |
Destroy(void) | CSG_Histogram |
Get_Break(int i) const | CSG_Histogram | inline
Get_Break(size_t i) const | CSG_Histogram | inline
Get_Center(int i) const | CSG_Histogram | inline
Get_Center(size_t i) const | CSG_Histogram | inline
Get_Class_Count(void) const | CSG_Histogram | inline
Get_Cumulative(int i) const | CSG_Histogram | inline
Get_Cumulative(size_t i) const | CSG_Histogram | inline
Get_Element_Count(void) const | CSG_Histogram | inline
Get_Element_Maximum(void) const | CSG_Histogram | inline
Get_Elements(int i) const | CSG_Histogram | inline
Get_Elements(size_t i) const | CSG_Histogram | inline
Get_Percentile(double Percentile) const | CSG_Histogram |
Get_Percentile_Value(double Value) const | CSG_Histogram |
Get_Quantile(double Quantile) const | CSG_Histogram |
Get_Quantile_Value(double Value) const | CSG_Histogram |
Get_Statistics(void) const | CSG_Histogram | inline
Get_Value(double i) const | CSG_Histogram | inline
operator+=(double Value) | CSG_Histogram | inline
operator=(const CSG_Histogram &Histogram) | CSG_Histogram |
operator[](int i) const | CSG_Histogram | inline
operator[](size_t i) const | CSG_Histogram | inline
Scale_Element_Count(double Scale) | CSG_Histogram |
Update(void) | CSG_Histogram |
~CSG_Histogram(void) | CSG_Histogram | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_HTTP Class Reference

Public Member Functions | Protected Attributes | List of all members
CSG_HTTP Class Reference

#include <metadata.h>

Public Member Functions

CSG_HTTP (void)
bool | Create (void)
CSG_HTTP (const CSG_String &Server, const SG_Char *Username=NULL, const SG_Char *Password=NULL)
bool | Create (const CSG_String &Server, const SG_Char *Username=NULL, const SG_Char *Password=NULL)
virtual | ~CSG_HTTP (void)
bool | Destroy (void)
bool | is_Connected (void) const
bool | Request (const CSG_String &Request, CSG_Bytes &Answer)
bool | Request (const CSG_String &Request, CSG_MetaData &Answer)
bool | Request (const CSG_String &Request, CSG_String &Answer)
bool | Request (const CSG_String &Request, const SG_Char *File)

Protected Attributes

class wxHTTP * m_pHTTP

Detailed Description

Definition at line 238 of file metadata.h.

Constructor & Destructor Documentation

◆ CSG_HTTP() [1/2]

CSG_HTTP::CSG_HTTP ( void )

Definition at line 1201 of file metadata.cpp.

References m_pHTTP.

◆ CSG_HTTP() [2/2]

CSG_HTTP::CSG_HTTP | ( | const CSG_String & | Server,
 |  | const SG_Char * | Username = NULL,
 |  | const SG_Char * | Password = NULL
 | ) |  |

Definition at line 1213 of file metadata.cpp.

References Create(), and m_pHTTP.

◆ ~CSG_HTTP()

CSG_HTTP::~CSG_HTTP ( void )
virtual

Definition at line 1262 of file metadata.cpp.

References Destroy().

Member Function Documentation

◆ Create() [1/2]

bool CSG_HTTP::Create | ( | const CSG_String & | Server,
 |  | const SG_Char * | Username = NULL,
 |  | const SG_Char * | Password = NULL
 | ) |  |

Definition at line 1221 of file metadata.cpp.

References CSG_String::c_str(), Destroy(), m_pHTTP, and SERVER_TRIM.

◆ Create() [2/2]

bool CSG_HTTP::Create ( void )

Definition at line 1207 of file metadata.cpp.

References Destroy().

Referenced by CSG_HTTP().

◆ Destroy()

bool CSG_HTTP::Destroy ( void )

Definition at line 1268 of file metadata.cpp.

References m_pHTTP.

Referenced by Create(), and ~CSG_HTTP().

◆ is_Connected()

bool CSG_HTTP::is_Connected ( void ) const

Definition at line 1281 of file metadata.cpp.

References m_pHTTP.

◆ Request() [1/4]

bool CSG_HTTP::Request | ( | const CSG_String & | Request,
 |  | const SG_Char * | File
 | ) |  |

Definition at line 1391 of file metadata.cpp.

References Request().

◆ Request() [2/4]

bool CSG_HTTP::Request | ( | const CSG_String & | Request,
 |  | CSG_Bytes & | Answer
 | ) |  |

Definition at line 1335 of file metadata.cpp.

References CSG_Bytes::Clear().

Referenced by Request().

◆ Request() [3/4]

bool CSG_HTTP::Request | ( | const CSG_String & | Request,
 |  | CSG_MetaData & | Answer
 | ) |  |

Definition at line 1314 of file metadata.cpp.

References CSG_MetaData::Destroy(), and Request().

◆ Request() [4/4]

bool CSG_HTTP::Request | ( | const CSG_String & | Request,
 |  | CSG_String & | Answer
 | ) |  |

Definition at line 1363 of file metadata.cpp.

References CSG_String::Clear(), and Request().

Member Data Documentation

◆ m_pHTTP

class wxHTTP* CSG_HTTP::m_pHTTP
protected

Definition at line 260 of file metadata.h.

Referenced by Create(), CSG_HTTP(), Destroy(), and is_Connected().

The documentation for this class was generated from the following files:
  • metadata.h
  • metadata.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_HTTP Member List

This is the complete list of members for CSG_HTTP, including all inherited members.

Create(void) | CSG_HTTP |
Create(const CSG_String &Server, const SG_Char *Username=NULL, const SG_Char *Password=NULL) | CSG_HTTP |
CSG_HTTP(void) | CSG_HTTP |
CSG_HTTP(const CSG_String &Server, const SG_Char *Username=NULL, const SG_Char *Password=NULL) | CSG_HTTP |
Destroy(void) | CSG_HTTP |
is_Connected(void) const | CSG_HTTP |
m_pHTTP | CSG_HTTP | protected
Request(const CSG_String &Request, CSG_Bytes &Answer) | CSG_HTTP |
Request(const CSG_String &Request, CSG_MetaData &Answer) | CSG_HTTP |
Request(const CSG_String &Request, CSG_String &Answer) | CSG_HTTP |
Request(const CSG_String &Request, const SG_Char *File) | CSG_HTTP |
~CSG_HTTP(void) | CSG_HTTP | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Index Class Reference

Classes | Public Member Functions | List of all members
CSG_Index Class Reference

#include <mat_tools.h>

Classes

class CSG_Index_Compare

Public Member Functions

CSG_Index (void)
virtual | ~CSG_Index (void)
CSG_Index (sLong nValues, CSG_Index_Compare &Compare)
bool | Create (sLong nValues, CSG_Index_Compare &Compare)
CSG_Index (sLong nValues, CSG_Index_Compare *pCompare)
bool | Create (sLong nValues, CSG_Index_Compare *pCompare)
CSG_Index (sLong nValues, int *Values, bool bAscending=true)
bool | Create (sLong nValues, int *Values, bool bAscending=true)
CSG_Index (sLong nValues, double *Values, bool bAscending=true)
bool | Create (sLong nValues, double *Values, bool bAscending=true)
CSG_Index (sLong nValues, TSG_PFNC_Compare fCompare)
bool | Create (sLong nValues, TSG_PFNC_Compare fCompare)
bool | Destroy (void)
void | Show_Progress (bool bProgress=true)
bool | Add_Entry (sLong Position=-1)
bool | Del_Entry (sLong Position=-1)
bool | is_Okay (void) const
sLong | Get_Count (void) const
sLong | Get_Index (sLong Position, bool Ascending=true) const
sLong | operator[] (sLong Position) const

Detailed Description

Definition at line 184 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Index() [1/6]

CSG_Index::CSG_Index ( void )

Definition at line 63 of file mat_indexing.cpp.

◆ ~CSG_Index()

CSG_Index::~CSG_Index ( void )
virtual

Definition at line 77 of file mat_indexing.cpp.

References Destroy().

◆ CSG_Index() [2/6]

CSG_Index::CSG_Index | ( | sLong | nValues,
 |  | CSG_Index_Compare & | Compare
 | ) |  |

Definition at line 102 of file mat_indexing.cpp.

References Create().

◆ CSG_Index() [3/6]

CSG_Index::CSG_Index | ( | sLong | nValues,
 |  | CSG_Index_Compare * | pCompare
 | ) |  |

Definition at line 123 of file mat_indexing.cpp.

References Create().

◆ CSG_Index() [4/6]

CSG_Index::CSG_Index | ( | sLong | nValues,
 |  | int * | Values,
 |  | bool | bAscending = true
 | ) |  |

Definition at line 166 of file mat_indexing.cpp.

References Create().

◆ CSG_Index() [5/6]

CSG_Index::CSG_Index | ( | sLong | nValues,
 |  | double * | Values,
 |  | bool | bAscending = true
 | ) |  |

Definition at line 206 of file mat_indexing.cpp.

References Create().

◆ CSG_Index() [6/6]

CSG_Index::CSG_Index | ( | sLong | nValues,
 |  | TSG_PFNC_Compare | fCompare
 | ) |  |

Definition at line 241 of file mat_indexing.cpp.

References Create().

Member Function Documentation

◆ Add_Entry()

bool CSG_Index::Add_Entry ( sLong Position = -1 )

Definition at line 268 of file mat_indexing.cpp.

Referenced by CSG_Table::Ins_Record().

◆ Create() [1/5]

bool CSG_Index::Create | ( | sLong | nValues,
 |  | CSG_Index_Compare & | Compare
 | ) |  |

Definition at line 110 of file mat_indexing.cpp.

References Destroy().

Referenced by Create(), CSG_Index(), and CSG_Table::Set_Index().

◆ Create() [2/5]

bool CSG_Index::Create | ( | sLong | nValues,
 |  | CSG_Index_Compare * | pCompare
 | ) |  |

Definition at line 131 of file mat_indexing.cpp.

References Destroy().

◆ Create() [3/5]

bool CSG_Index::Create | ( | sLong | nValues,
 |  | double * | Values,
 |  | bool | bAscending = true
 | ) |  |

Definition at line 214 of file mat_indexing.cpp.

References Create().

◆ Create() [4/5]

bool CSG_Index::Create | ( | sLong | nValues,
 |  | int * | Values,
 |  | bool | bAscending = true
 | ) |  |

Definition at line 174 of file mat_indexing.cpp.

References Create().

◆ Create() [5/5]

bool CSG_Index::Create | ( | sLong | nValues,
 |  | TSG_PFNC_Compare | fCompare
 | ) |  |

Definition at line 249 of file mat_indexing.cpp.

References Create().

◆ Del_Entry()

bool CSG_Index::Del_Entry ( sLong Position = -1 )

Definition at line 289 of file mat_indexing.cpp.

Referenced by CSG_Table::Del_Record().

◆ Destroy()

bool CSG_Index::Destroy ( void )

Definition at line 83 of file mat_indexing.cpp.

References SG_Free().

Referenced by Create(), CSG_Table::Del_Index(), and ~CSG_Index().

◆ Get_Count()

sLong CSG_Index::Get_Count ( void ) const
inline

Definition at line 224 of file mat_tools.h.

◆ Get_Index()

sLong CSG_Index::Get_Index | ( | sLong | Position,
 |  | bool | Ascending = true
 | ) |  | const
 inline

Definition at line 226 of file mat_tools.h.

◆ is_Okay()

bool CSG_Index::is_Okay ( void ) const
inline

Definition at line 223 of file mat_tools.h.

Referenced by CSG_Table::Del_Record(), CSG_Table::Ins_Record(), and CSG_Table::On_Update().

◆ operator[]()

sLong CSG_Index::operator[] ( sLong Position ) const
inline

Definition at line 231 of file mat_tools.h.

◆ Show_Progress()

void CSG_Index::Show_Progress ( bool bProgress = true )

Definition at line 262 of file mat_indexing.cpp.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_indexing.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Index Member List

This is the complete list of members for CSG_Index, including all inherited members.

Add_Entry(sLong Position=-1) | CSG_Index |
Create(sLong nValues, CSG_Index_Compare &Compare) | CSG_Index |
Create(sLong nValues, CSG_Index_Compare *pCompare) | CSG_Index |
Create(sLong nValues, int *Values, bool bAscending=true) | CSG_Index |
Create(sLong nValues, double *Values, bool bAscending=true) | CSG_Index |
Create(sLong nValues, TSG_PFNC_Compare fCompare) | CSG_Index |
CSG_Index(void) | CSG_Index |
CSG_Index(sLong nValues, CSG_Index_Compare &Compare) | CSG_Index |
CSG_Index(sLong nValues, CSG_Index_Compare *pCompare) | CSG_Index |
CSG_Index(sLong nValues, int *Values, bool bAscending=true) | CSG_Index |
CSG_Index(sLong nValues, double *Values, bool bAscending=true) | CSG_Index |
CSG_Index(sLong nValues, TSG_PFNC_Compare fCompare) | CSG_Index |
Del_Entry(sLong Position=-1) | CSG_Index |
Destroy(void) | CSG_Index |
Get_Count(void) const | CSG_Index | inline
Get_Index(sLong Position, bool Ascending=true) const | CSG_Index | inline
is_Okay(void) const | CSG_Index | inline
operator[](sLong Position) const | CSG_Index | inline
Show_Progress(bool bProgress=true) | CSG_Index |
~CSG_Index(void) | CSG_Index | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Index::CSG_Index_Compare Class Reference

  • CSG_Index
  • CSG_Index_Compare
Public Member Functions | List of all members
CSG_Index::CSG_Index_Compare Class Referenceabstract

#include <mat_tools.h>

Inherited by CSG_Index_Compare_Double, CSG_Index_Compare_Function, CSG_Index_Compare_Int, CSG_Index_Compare_Strings, CSG_Table_Record_Compare_Field, and CSG_Table_Record_Compare_Fields.

Public Member Functions

CSG_Index_Compare (void)
virtual | ~CSG_Index_Compare (void)
virtual int | Compare (const sLong a, const sLong b)=0

Detailed Description

Definition at line 187 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Index_Compare()

CSG_Index::CSG_Index_Compare::CSG_Index_Compare ( void )
inline

Definition at line 190 of file mat_tools.h.

◆ ~CSG_Index_Compare()

virtual CSG_Index::CSG_Index_Compare::~CSG_Index_Compare ( void )
inlinevirtual

Definition at line 191 of file mat_tools.h.

Member Function Documentation

◆ Compare()

virtual int CSG_Index::CSG_Index_Compare::Compare | ( | const sLong | a,
 |  | const sLong | b
 | ) |  |
pure virtual
The documentation for this class was generated from the following file:
  • mat_tools.h
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

  • CSG_Index
  • CSG_Index_Compare
CSG_Index::CSG_Index_Compare Member List

This is the complete list of members for CSG_Index::CSG_Index_Compare, including all inherited members.

Compare(const sLong a, const sLong b)=0 | CSG_Index::CSG_Index_Compare | pure virtual
CSG_Index_Compare(void) | CSG_Index::CSG_Index_Compare | inline
~CSG_Index_Compare(void) | CSG_Index::CSG_Index_Compare | inlinevirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_KDTree Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_KDTree Class Referenceabstract

#include <shapes.h>

Inheritance diagram for CSG_KDTree:
CSG_KDTree_2D CSG_KDTree_3D

Public Member Functions

CSG_KDTree (void)
virtual | ~CSG_KDTree (void)
virtual bool | Destroy (void)
bool | is_Okay (void) const
size_t | Get_Match_Count (void) const
size_t | Get_Match_Index (size_t i) const
double | Get_Match_Distance (size_t i) const
CSG_Shape * | Get_Match_Shape (size_t i) const
int | Get_Point_Count (void) const
double * | Get_Point (int i) const
double * | Get_Point (size_t i) const
double * | operator[] (int i) const
double * | operator[] (size_t i) const
virtual double | Get_Point_Value (int i) const
virtual double | Get_Point_Value (size_t i) const =0

Static Public Member Functions

static const char * Get_Version (void)

Protected Member Functions

void _On_Construction (void)

Protected Attributes

class CSG_KDTree_Adaptor * | m_pAdaptor
void * | m_pKDTree
CSG_Array_Int m_Indices
CSG_Vector m_Distances
CSG_Matrix m_Points

Detailed Description

Definition at line 1213 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_KDTree()

CSG_KDTree::CSG_KDTree ( void )

Definition at line 250 of file kdtree.cpp.

References _On_Construction().

◆ ~CSG_KDTree()

CSG_KDTree::~CSG_KDTree ( void )
virtual

Definition at line 256 of file kdtree.cpp.

Member Function Documentation

◆ _On_Construction()

void CSG_KDTree::_On_Construction ( void )
protected

Definition at line 260 of file kdtree.cpp.

References m_pAdaptor, and m_pKDTree.

Referenced by CSG_KDTree(), CSG_KDTree_2D::CSG_KDTree_2D(), and CSG_KDTree_3D::CSG_KDTree_3D().

◆ Destroy()

bool CSG_KDTree::Destroy ( void )
virtual

Reimplemented in CSG_KDTree_3D, and CSG_KDTree_2D.

Definition at line 279 of file kdtree.cpp.

References CSG_Array_Int::Destroy(), CSG_Vector::Destroy(), CSG_Matrix::Destroy(), m_Distances, m_Indices, m_pAdaptor, m_Points, and SG_DELETE_SAFE.

Referenced by CSG_KDTree_2D::Destroy(), and CSG_KDTree_3D::Destroy().

◆ Get_Match_Count()

size_t CSG_KDTree::Get_Match_Count ( void ) const
inline

Definition at line 1225 of file shapes.h.

Referenced by Get_Match_Shape(), and CSG_Parameters_Point_Search_KDTree_2D::Get_Point().

◆ Get_Match_Distance()

double CSG_KDTree::Get_Match_Distance ( size_t i ) const
inline

Definition at line 1227 of file shapes.h.

◆ Get_Match_Index()

size_t CSG_KDTree::Get_Match_Index ( size_t i ) const
inline

Definition at line 1226 of file shapes.h.

Referenced by Get_Match_Shape().

◆ Get_Match_Shape()

CSG_Shape * CSG_KDTree::Get_Match_Shape ( size_t i ) const

Definition at line 291 of file kdtree.cpp.

References Get_Match_Count(), Get_Match_Index(), CSG_Shapes::Get_Shape(), and m_pAdaptor.

Referenced by CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), and CSG_Parameters_Point_Search_KDTree_2D::Get_Points().

◆ Get_Point() [1/2]

double* CSG_KDTree::Get_Point ( int i ) const
inline

Definition at line 1231 of file shapes.h.

Referenced by CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), and CSG_Parameters_Point_Search_KDTree_2D::Get_Points().

◆ Get_Point() [2/2]

double* CSG_KDTree::Get_Point ( size_t i ) const
inline

Definition at line 1232 of file shapes.h.

◆ Get_Point_Count()

int CSG_KDTree::Get_Point_Count ( void ) const
inline

Definition at line 1230 of file shapes.h.

◆ Get_Point_Value() [1/2]

virtual double CSG_KDTree::Get_Point_Value ( int i ) const
inlinevirtual

Definition at line 1235 of file shapes.h.

References Get_Point_Value().

Referenced by Get_Point_Value().

◆ Get_Point_Value() [2/2]

virtual double CSG_KDTree::Get_Point_Value ( size_t i ) const
pure virtual

Implemented in CSG_KDTree_3D, and CSG_KDTree_2D.

◆ Get_Version()

const char * CSG_KDTree::Get_Version ( void )
static

Definition at line 267 of file kdtree.cpp.

References CSG_String::Format().

◆ is_Okay()

bool CSG_KDTree::is_Okay ( void ) const
inline

Definition at line 1223 of file shapes.h.

◆ operator[]() [1/2]

double* CSG_KDTree::operator[] ( int i ) const
inline

Definition at line 1233 of file shapes.h.

◆ operator[]() [2/2]

double* CSG_KDTree::operator[] ( size_t i ) const
inline

Definition at line 1234 of file shapes.h.

Member Data Documentation

◆ m_Distances

CSG_Vector CSG_KDTree::m_Distances
protected

Definition at line 1247 of file shapes.h.

Referenced by Destroy(), CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ m_Indices

CSG_Array_Int CSG_KDTree::m_Indices
protected

Definition at line 1245 of file shapes.h.

Referenced by Destroy(), CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ m_pAdaptor

class CSG_KDTree_Adaptor* CSG_KDTree::m_pAdaptor
protected

Definition at line 1241 of file shapes.h.

Referenced by _On_Construction(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), Destroy(), Get_Match_Shape(), CSG_KDTree_2D::Get_Nearest_Shape(), and CSG_KDTree_3D::Get_Nearest_Shape().

◆ m_pKDTree

void* CSG_KDTree::m_pKDTree
protected

Definition at line 1243 of file shapes.h.

Referenced by _On_Construction(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_KDTree_2D::Destroy(), CSG_KDTree_3D::Destroy(), CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ m_Points

CSG_Matrix CSG_KDTree::m_Points
protected

Definition at line 1249 of file shapes.h.

Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), Destroy(), CSG_KDTree_2D::Get_Nearest_Value(), and CSG_KDTree_3D::Get_Nearest_Value().

The documentation for this class was generated from the following files:
  • shapes.h
  • kdtree.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_KDTree Member List

This is the complete list of members for CSG_KDTree, including all inherited members.

_On_Construction(void) | CSG_KDTree | protected
CSG_KDTree(void) | CSG_KDTree |
Destroy(void) | CSG_KDTree | virtual
Get_Match_Count(void) const | CSG_KDTree | inline
Get_Match_Distance(size_t i) const | CSG_KDTree | inline
Get_Match_Index(size_t i) const | CSG_KDTree | inline
Get_Match_Shape(size_t i) const | CSG_KDTree |
Get_Point(int i) const | CSG_KDTree | inline
Get_Point(size_t i) const | CSG_KDTree | inline
Get_Point_Count(void) const | CSG_KDTree | inline
Get_Point_Value(int i) const | CSG_KDTree | inlinevirtual
Get_Point_Value(size_t i) const =0 | CSG_KDTree | pure virtual
Get_Version(void) | CSG_KDTree | static
is_Okay(void) const | CSG_KDTree | inline
m_Distances | CSG_KDTree | protected
m_Indices | CSG_KDTree | protected
m_pAdaptor | CSG_KDTree | protected
m_pKDTree | CSG_KDTree | protected
m_Points | CSG_KDTree | protected
operator[](int i) const | CSG_KDTree | inline
operator[](size_t i) const | CSG_KDTree | inline
~CSG_KDTree(void) | CSG_KDTree | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_KDTree_2D Class Reference

Public Member Functions | List of all members
CSG_KDTree_2D Class Reference

#include <shapes.h>

Inheritance diagram for CSG_KDTree_2D:
CSG_KDTree

Public Member Functions

CSG_KDTree_2D (void)
virtual | ~CSG_KDTree_2D (void)
CSG_KDTree_2D (CSG_Shapes *pPoints, int Field=-1)
bool | Create (CSG_Shapes *pPoints, int Field=-1)
CSG_KDTree_2D (CSG_PointCloud *pPoints)
bool | Create (CSG_PointCloud *pPoints)
CSG_KDTree_2D (const CSG_Matrix &Points)
bool | Create (const CSG_Matrix &Points)
CSG_KDTree_2D (const double **Points, size_t nPoints)
bool | Create (const double **Points, size_t nPoints)
virtual bool | Destroy (void)
virtual double | Get_Point_Value (size_t i) const
virtual size_t | Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius)
virtual size_t | Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Nearest_Points (double Coordinate[2], size_t Count, size_t *Indices, double *Distances)
virtual bool | Get_Nearest_Point (double Coordinate[2], size_t &Index, double &Distance)
virtual bool | Get_Nearest_Point (double Coordinate[2], size_t &Index)
virtual bool | Get_Nearest_Value (double Coordinate[2], double &Value)
virtual CSG_Shape * | Get_Nearest_Shape (double Coordinate[2])
virtual size_t | Get_Duplicates (double Coordinate[2], CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Duplicates (double Coordinate[2])
virtual size_t | Get_Nearest_Points (double x, double y, size_t Count, double Radius)
virtual size_t | Get_Nearest_Points (double x, double y, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Nearest_Points (double x, double y, size_t Count, size_t *Indices, double *Distances)
virtual bool | Get_Nearest_Point (double x, double y, size_t &Index, double &Distance)
virtual bool | Get_Nearest_Point (double x, double y, size_t &Index)
virtual bool | Get_Nearest_Value (double x, double y, double &Value)
virtual CSG_Shape * | Get_Nearest_Shape (double x, double y)
virtual size_t | Get_Duplicates (double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Duplicates (double x, double y)
- Public Member Functions inherited from CSG_KDTree
CSG_KDTree (void)
virtual | ~CSG_KDTree (void)
bool | is_Okay (void) const
size_t | Get_Match_Count (void) const
size_t | Get_Match_Index (size_t i) const
double | Get_Match_Distance (size_t i) const
CSG_Shape * | Get_Match_Shape (size_t i) const
int | Get_Point_Count (void) const
double * | Get_Point (int i) const
double * | Get_Point (size_t i) const
double * | operator[] (int i) const
double * | operator[] (size_t i) const
virtual double | Get_Point_Value (int i) const

Additional Inherited Members

- Static Public Member Functions inherited from CSG_KDTree
static const char * | Get_Version (void)
- Protected Member Functions inherited from CSG_KDTree
void | _On_Construction (void)
- Protected Attributes inherited from CSG_KDTree
class CSG_KDTree_Adaptor * | m_pAdaptor
void * | m_pKDTree
CSG_Array_Int m_Indices
CSG_Vector m_Distances
CSG_Matrix m_Points

Detailed Description

Definition at line 1262 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_KDTree_2D() [1/5]

CSG_KDTree_2D::CSG_KDTree_2D ( void )

Default constructor.

Definition at line 318 of file kdtree.cpp.

References CSG_KDTree::_On_Construction().

◆ ~CSG_KDTree_2D()

CSG_KDTree_2D::~CSG_KDTree_2D ( void )
virtual

Definition at line 324 of file kdtree.cpp.

References Destroy().

◆ CSG_KDTree_2D() [2/5]

CSG_KDTree_2D::CSG_KDTree_2D | ( | CSG_Shapes * | pPoints,
 |  | int | Field = -1
 | ) |  |

Creates a spatial index for the given points. If 'Field' refers to a valid field, an internal points arrray is created which omits points with no-data entries for the given field.

Definition at line 336 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_2D() [3/5]

CSG_KDTree_2D::CSG_KDTree_2D ( CSG_PointCloud * pPoints )

Creates a spatial index for the given points.

Definition at line 404 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_2D() [4/5]

CSG_KDTree_2D::CSG_KDTree_2D ( const CSG_Matrix & Points )

Points matrix is expected to provide coordinates ordered in rows, with first and second column holding x and y coordinate.

Definition at line 434 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_2D() [5/5]

CSG_KDTree_2D::CSG_KDTree_2D | ( | const double ** | Points,
 |  | size_t | nPoints
 | ) |  |

Points array is expected to provide coordinates ordered in rows, with first and second column holding x and y coordinate.

Definition at line 457 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

Member Function Documentation

◆ Create() [1/4]

bool CSG_KDTree_2D::Create ( const CSG_Matrix & Points )

Definition at line 441 of file kdtree.cpp.

References Create(), CSG_Matrix::Get_Data(), CSG_Matrix::Get_NCols(), and CSG_Matrix::Get_NRows().

◆ Create() [2/4]

bool CSG_KDTree_2D::Create | ( | const double ** | Points,
 |  | size_t | nPoints
 | ) |  |

Definition at line 464 of file kdtree.cpp.

References Destroy(), CSG_KDTree::m_pAdaptor, and CSG_KDTree::m_pKDTree.

◆ Create() [3/4]

bool CSG_KDTree_2D::Create ( CSG_PointCloud * pPoints )

Definition at line 411 of file kdtree.cpp.

References Destroy(), CSG_Table::Get_Count(), CSG_KDTree::m_pAdaptor, and CSG_KDTree::m_pKDTree.

◆ Create() [4/4]

bool CSG_KDTree_2D::Create | ( | CSG_Shapes * | pPoints,
 |  | int | Field = -1
 | ) |  |

Definition at line 343 of file kdtree.cpp.

References CSG_Table_Record::asDouble(), CSG_Matrix::Create(), Destroy(), CSG_Table::Get_Count(), CSG_Matrix::Get_NRows(), CSG_Shape::Get_Point(), CSG_Shapes::Get_Shape(), CSG_Table_Record::is_NoData(), CSG_KDTree::m_pAdaptor, CSG_KDTree::m_pKDTree, CSG_KDTree::m_Points, CSG_Matrix::Set_Rows(), SSG_Point::x, and SSG_Point::y.

Referenced by Create(), CSG_KDTree_2D(), and CSG_Parameters_Point_Search_KDTree_2D::Initialize().

◆ Destroy()

bool CSG_KDTree_2D::Destroy ( void )
virtual

Reimplemented from CSG_KDTree.

Definition at line 482 of file kdtree.cpp.

References CSG_KDTree::Destroy(), and CSG_KDTree::m_pKDTree.

Referenced by Create(), CSG_Parameters_Point_Search_KDTree_2D::Finalize(), and ~CSG_KDTree_2D().

◆ Get_Duplicates() [1/4]

size_t CSG_KDTree_2D::Get_Duplicates ( double Coordinate[2] )
virtual

Definition at line 640 of file kdtree.cpp.

References Get_Duplicates(), CSG_KDTree::m_Distances, and CSG_KDTree::m_Indices.

◆ Get_Duplicates() [2/4]

size_t CSG_KDTree_2D::Get_Duplicates | ( | double | Coordinate[2],
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 609 of file kdtree.cpp.

References CSG_Array_Int::Create(), CSG_Vector::Create(), CSG_Array_Int::Dec_Array(), and CSG_KDTree::m_pKDTree.

Referenced by Get_Duplicates().

◆ Get_Duplicates() [3/4]

size_t CSG_KDTree_2D::Get_Duplicates | ( | double | x,
 |  | double | y
 | ) |  |
virtual

Definition at line 686 of file kdtree.cpp.

References Get_Duplicates().

◆ Get_Duplicates() [4/4]

size_t CSG_KDTree_2D::Get_Duplicates | ( | double | x,
 |  | double | y,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 681 of file kdtree.cpp.

References Get_Duplicates().

◆ Get_Nearest_Point() [1/4]

bool CSG_KDTree_2D::Get_Nearest_Point | ( | double | Coordinate[2],
 |  | size_t & | Index
 | ) |  |
virtual

Definition at line 578 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Point() [2/4]

bool CSG_KDTree_2D::Get_Nearest_Point | ( | double | Coordinate[2],
 |  | size_t & | Index,
 |  | double & | Distance
 | ) |  |
virtual

Definition at line 572 of file kdtree.cpp.

References Get_Nearest_Points().

Referenced by Get_Nearest_Point(), and Get_Nearest_Shape().

◆ Get_Nearest_Point() [3/4]

bool CSG_KDTree_2D::Get_Nearest_Point | ( | double | x,
 |  | double | y,
 |  | size_t & | Index
 | ) |  |
virtual

Definition at line 666 of file kdtree.cpp.

References Get_Nearest_Point().

◆ Get_Nearest_Point() [4/4]

bool CSG_KDTree_2D::Get_Nearest_Point | ( | double | x,
 |  | double | y,
 |  | size_t & | Index,
 |  | double & | Distance
 | ) |  |
virtual

Definition at line 661 of file kdtree.cpp.

References Get_Nearest_Point().

◆ Get_Nearest_Points() [1/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | Coordinate[2],
 |  | size_t | Count,
 |  | double | Radius
 | ) |  |
virtual

Definition at line 500 of file kdtree.cpp.

References CSG_KDTree::m_Distances, and CSG_KDTree::m_Indices.

Referenced by Get_Nearest_Point(), Get_Nearest_Points(), Get_Nearest_Value(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), and CSG_Parameters_Point_Search_KDTree_2D::Set_Location().

◆ Get_Nearest_Points() [2/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | Coordinate[2],
 |  | size_t | Count,
 |  | double | Radius,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 506 of file kdtree.cpp.

References CSG_Array_Int::Create(), CSG_Vector::Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_N(), Get_Nearest_Points(), CSG_KDTree::m_pKDTree, and CSG_Vector::Set_Rows().

◆ Get_Nearest_Points() [3/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | Coordinate[2],
 |  | size_t | Count,
 |  | size_t * | Indices,
 |  | double * | Distances
 | ) |  |
virtual

Definition at line 559 of file kdtree.cpp.

References CSG_KDTree::m_pKDTree.

◆ Get_Nearest_Points() [4/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | size_t | Count,
 |  | double | Radius
 | ) |  |
virtual

Definition at line 646 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Points() [5/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | size_t | Count,
 |  | double | Radius,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 651 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Points() [6/6]

size_t CSG_KDTree_2D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | size_t | Count,
 |  | size_t * | Indices,
 |  | double * | Distances
 | ) |  |
virtual

Definition at line 656 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Shape() [1/2]

CSG_Shape * CSG_KDTree_2D::Get_Nearest_Shape ( double Coordinate[2] )
virtual

Definition at line 601 of file kdtree.cpp.

References Get_Nearest_Point(), CSG_Shapes::Get_Shape(), and CSG_KDTree::m_pAdaptor.

Referenced by Get_Nearest_Shape().

◆ Get_Nearest_Shape() [2/2]

CSG_Shape * CSG_KDTree_2D::Get_Nearest_Shape | ( | double | x,
 |  | double | y
 | ) |  |
virtual

Definition at line 676 of file kdtree.cpp.

References Get_Nearest_Shape().

◆ Get_Nearest_Value() [1/2]

bool CSG_KDTree_2D::Get_Nearest_Value | ( | double | Coordinate[2],
 |  | double & | Value
 | ) |  |
virtual

Definition at line 586 of file kdtree.cpp.

References CSG_Matrix::Get_Data(), Get_Nearest_Points(), Get_Point_Value(), and CSG_KDTree::m_Points.

Referenced by Get_Nearest_Value().

◆ Get_Nearest_Value() [2/2]

bool CSG_KDTree_2D::Get_Nearest_Value | ( | double | x,
 |  | double | y,
 |  | double & | Value
 | ) |  |
virtual

Definition at line 671 of file kdtree.cpp.

References Get_Nearest_Value().

◆ Get_Point_Value()

virtual double CSG_KDTree_2D::Get_Point_Value ( size_t i ) const
inlinevirtual

Implements CSG_KDTree.

Definition at line 1282 of file shapes.h.

Referenced by Get_Nearest_Value().

The documentation for this class was generated from the following files:
  • shapes.h
  • kdtree.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_KDTree_2D Member List

This is the complete list of members for CSG_KDTree_2D, including all inherited members.

_On_Construction(void) | CSG_KDTree | protected
Create(CSG_Shapes *pPoints, int Field=-1) | CSG_KDTree_2D |
Create(CSG_PointCloud *pPoints) | CSG_KDTree_2D |
Create(const CSG_Matrix &Points) | CSG_KDTree_2D |
Create(const double **Points, size_t nPoints) | CSG_KDTree_2D |
CSG_KDTree(void) | CSG_KDTree |
CSG_KDTree_2D(void) | CSG_KDTree_2D |
CSG_KDTree_2D(CSG_Shapes *pPoints, int Field=-1) | CSG_KDTree_2D |
CSG_KDTree_2D(CSG_PointCloud *pPoints) | CSG_KDTree_2D |
CSG_KDTree_2D(const CSG_Matrix &Points) | CSG_KDTree_2D |
CSG_KDTree_2D(const double **Points, size_t nPoints) | CSG_KDTree_2D |
Destroy(void) | CSG_KDTree_2D | virtual
Get_Duplicates(double Coordinate[2], CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_2D | virtual
Get_Duplicates(double Coordinate[2]) | CSG_KDTree_2D | virtual
Get_Duplicates(double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_2D | virtual
Get_Duplicates(double x, double y) | CSG_KDTree_2D | virtual
Get_Match_Count(void) const | CSG_KDTree | inline
Get_Match_Distance(size_t i) const | CSG_KDTree | inline
Get_Match_Index(size_t i) const | CSG_KDTree | inline
Get_Match_Shape(size_t i) const | CSG_KDTree |
Get_Nearest_Point(double Coordinate[2], size_t &Index, double &Distance) | CSG_KDTree_2D | virtual
Get_Nearest_Point(double Coordinate[2], size_t &Index) | CSG_KDTree_2D | virtual
Get_Nearest_Point(double x, double y, size_t &Index, double &Distance) | CSG_KDTree_2D | virtual
Get_Nearest_Point(double x, double y, size_t &Index) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double Coordinate[2], size_t Count, double Radius) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double Coordinate[2], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double Coordinate[2], size_t Count, size_t *Indices, double *Distances) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double x, double y, size_t Count, double Radius) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double x, double y, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_2D | virtual
Get_Nearest_Points(double x, double y, size_t Count, size_t *Indices, double *Distances) | CSG_KDTree_2D | virtual
Get_Nearest_Shape(double Coordinate[2]) | CSG_KDTree_2D | virtual
Get_Nearest_Shape(double x, double y) | CSG_KDTree_2D | virtual
Get_Nearest_Value(double Coordinate[2], double &Value) | CSG_KDTree_2D | virtual
Get_Nearest_Value(double x, double y, double &Value) | CSG_KDTree_2D | virtual
Get_Point(int i) const | CSG_KDTree | inline
Get_Point(size_t i) const | CSG_KDTree | inline
Get_Point_Count(void) const | CSG_KDTree | inline
Get_Point_Value(size_t i) const | CSG_KDTree_2D | inlinevirtual
CSG_KDTree::Get_Point_Value(int i) const | CSG_KDTree | inlinevirtual
Get_Version(void) | CSG_KDTree | static
is_Okay(void) const | CSG_KDTree | inline
m_Distances | CSG_KDTree | protected
m_Indices | CSG_KDTree | protected
m_pAdaptor | CSG_KDTree | protected
m_pKDTree | CSG_KDTree | protected
m_Points | CSG_KDTree | protected
operator[](int i) const | CSG_KDTree | inline
operator[](size_t i) const | CSG_KDTree | inline
~CSG_KDTree(void) | CSG_KDTree | virtual
~CSG_KDTree_2D(void) | CSG_KDTree_2D | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_KDTree_3D Class Reference

Public Member Functions | List of all members
CSG_KDTree_3D Class Reference

#include <shapes.h>

Inheritance diagram for CSG_KDTree_3D:
CSG_KDTree

Public Member Functions

CSG_KDTree_3D (void)
virtual | ~CSG_KDTree_3D (void)
CSG_KDTree_3D (CSG_Shapes *pPoints, int Field=-1, int zField=-1, double zScale=1.)
bool | Create (CSG_Shapes *pPoints, int Field=-1, int zField=-1, double zScale=1.)
CSG_KDTree_3D (CSG_PointCloud *pPoints)
bool | Create (CSG_PointCloud *pPoints)
CSG_KDTree_3D (const CSG_Matrix &Points)
bool | Create (const CSG_Matrix &Points)
CSG_KDTree_3D (const double **Points, size_t nPoints)
bool | Create (const double **Points, size_t nPoints)
virtual bool | Destroy (void)
virtual double | Get_Point_Value (size_t i) const
virtual size_t | Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius)
virtual size_t | Get_Nearest_Points (double Coordinate[3], size_t Count, size_t *Indices, double *Distances)
virtual size_t | Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual bool | Get_Nearest_Point (double Coordinate[3], size_t &Index, double &Distance)
virtual bool | Get_Nearest_Point (double Coordinate[3], size_t &Index)
virtual bool | Get_Nearest_Value (double Coordinate[3], double &Value)
virtual CSG_Shape * | Get_Nearest_Shape (double Coordinate[3])
virtual size_t | Get_Duplicates (double Coordinate[3], CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Duplicates (double Coordinate[3])
virtual size_t | Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius)
virtual size_t | Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Nearest_Points (double x, double y, double z, size_t Count, size_t *Indices, double *Distances)
virtual bool | Get_Nearest_Point (double x, double y, double z, size_t &Index, double &Distance)
virtual bool | Get_Nearest_Point (double x, double y, double z, size_t &Index)
virtual bool | Get_Nearest_Value (double x, double y, double z, double &Value)
virtual CSG_Shape * | Get_Nearest_Shape (double x, double y, double z)
virtual size_t | Get_Duplicates (double x, double y, double z, CSG_Array_Int &Indices, CSG_Vector &Distances)
virtual size_t | Get_Duplicates (double x, double y, double z)
- Public Member Functions inherited from CSG_KDTree
CSG_KDTree (void)
virtual | ~CSG_KDTree (void)
bool | is_Okay (void) const
size_t | Get_Match_Count (void) const
size_t | Get_Match_Index (size_t i) const
double | Get_Match_Distance (size_t i) const
CSG_Shape * | Get_Match_Shape (size_t i) const
int | Get_Point_Count (void) const
double * | Get_Point (int i) const
double * | Get_Point (size_t i) const
double * | operator[] (int i) const
double * | operator[] (size_t i) const
virtual double | Get_Point_Value (int i) const

Additional Inherited Members

- Static Public Member Functions inherited from CSG_KDTree
static const char * | Get_Version (void)
- Protected Member Functions inherited from CSG_KDTree
void | _On_Construction (void)
- Protected Attributes inherited from CSG_KDTree
class CSG_KDTree_Adaptor * | m_pAdaptor
void * | m_pKDTree
CSG_Array_Int m_Indices
CSG_Vector m_Distances
CSG_Matrix m_Points

Detailed Description

Definition at line 1312 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_KDTree_3D() [1/5]

CSG_KDTree_3D::CSG_KDTree_3D ( void )

Definition at line 699 of file kdtree.cpp.

References CSG_KDTree::_On_Construction().

◆ ~CSG_KDTree_3D()

CSG_KDTree_3D::~CSG_KDTree_3D ( void )
virtual

Definition at line 705 of file kdtree.cpp.

References Destroy().

◆ CSG_KDTree_3D() [2/5]

CSG_KDTree_3D::CSG_KDTree_3D | ( | CSG_Shapes * | pPoints,
 |  | int | Field = -1,
 |  | int | zField = -1,
 |  | double | zScale = 1.
 | ) |  |

Creates a spatial index for the given points. If 'Field' refers to a valid field, an internal points arrray is created which omits points with no-data entries for the given field. If 'zField' refers to a valid field, its values are taken as coordinate of the 3rd dimension. Else it is expected that the points provide 3 dimensional coordinates (i.e. x-y-z or x-y-z-m).

Definition at line 720 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_3D() [3/5]

CSG_KDTree_3D::CSG_KDTree_3D ( CSG_PointCloud * pPoints )

Definition at line 785 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_3D() [4/5]

CSG_KDTree_3D::CSG_KDTree_3D ( const CSG_Matrix & Points )

Points matrix is expected to provide coordinates ordered in rows, with first, second and third column holding x, y and z coordinates.

Definition at line 815 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

◆ CSG_KDTree_3D() [5/5]

CSG_KDTree_3D::CSG_KDTree_3D | ( | const double ** | Points,
 |  | size_t | nPoints
 | ) |  |

Points array is expected to provide coordinates ordered in rows, with first, second and third column holding x, y and z coordinates.

Definition at line 838 of file kdtree.cpp.

References CSG_KDTree::_On_Construction(), and Create().

Member Function Documentation

◆ Create() [1/4]

bool CSG_KDTree_3D::Create ( const CSG_Matrix & Points )

Definition at line 822 of file kdtree.cpp.

References Create(), CSG_Matrix::Get_Data(), CSG_Matrix::Get_NCols(), and CSG_Matrix::Get_NRows().

◆ Create() [2/4]

bool CSG_KDTree_3D::Create | ( | const double ** | Points,
 |  | size_t | nPoints
 | ) |  |

Definition at line 845 of file kdtree.cpp.

References Destroy(), CSG_KDTree::m_pAdaptor, and CSG_KDTree::m_pKDTree.

◆ Create() [3/4]

bool CSG_KDTree_3D::Create ( CSG_PointCloud * pPoints )

Definition at line 792 of file kdtree.cpp.

References Destroy(), CSG_Table::Get_Count(), CSG_KDTree::m_pAdaptor, and CSG_KDTree::m_pKDTree.

◆ Create() [4/4]

bool CSG_KDTree_3D::Create | ( | CSG_Shapes * | pPoints,
 |  | int | Field = -1,
 |  | int | zField = -1,
 |  | double | zScale = 1.
 | ) |  |

Definition at line 727 of file kdtree.cpp.

References CSG_Table_Record::asDouble(), CSG_Matrix::Create(), Destroy(), CSG_Table::Get_Count(), CSG_Matrix::Get_NRows(), CSG_Shape::Get_Point(), CSG_Shapes::Get_Shape(), CSG_Shape::Get_Z(), CSG_Table_Record::is_NoData(), CSG_KDTree::m_pAdaptor, CSG_KDTree::m_pKDTree, CSG_KDTree::m_Points, CSG_Matrix::Set_Rows(), SSG_Point::x, and SSG_Point::y.

Referenced by Create(), and CSG_KDTree_3D().

◆ Destroy()

bool CSG_KDTree_3D::Destroy ( void )
virtual

Reimplemented from CSG_KDTree.

Definition at line 863 of file kdtree.cpp.

References CSG_KDTree::Destroy(), and CSG_KDTree::m_pKDTree.

Referenced by Create(), and ~CSG_KDTree_3D().

◆ Get_Duplicates() [1/4]

size_t CSG_KDTree_3D::Get_Duplicates ( double Coordinate[3] )
virtual

Definition at line 1021 of file kdtree.cpp.

References Get_Duplicates(), CSG_KDTree::m_Distances, and CSG_KDTree::m_Indices.

◆ Get_Duplicates() [2/4]

size_t CSG_KDTree_3D::Get_Duplicates | ( | double | Coordinate[3],
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 990 of file kdtree.cpp.

References CSG_Array_Int::Create(), CSG_Vector::Create(), CSG_Array_Int::Dec_Array(), and CSG_KDTree::m_pKDTree.

Referenced by Get_Duplicates().

◆ Get_Duplicates() [3/4]

size_t CSG_KDTree_3D::Get_Duplicates | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
virtual

Definition at line 1067 of file kdtree.cpp.

References Get_Duplicates().

◆ Get_Duplicates() [4/4]

size_t CSG_KDTree_3D::Get_Duplicates | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 1062 of file kdtree.cpp.

References Get_Duplicates().

◆ Get_Nearest_Point() [1/4]

bool CSG_KDTree_3D::Get_Nearest_Point | ( | double | Coordinate[3],
 |  | size_t & | Index
 | ) |  |
virtual

Definition at line 959 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Point() [2/4]

bool CSG_KDTree_3D::Get_Nearest_Point | ( | double | Coordinate[3],
 |  | size_t & | Index,
 |  | double & | Distance
 | ) |  |
virtual

Definition at line 953 of file kdtree.cpp.

References Get_Nearest_Points().

Referenced by Get_Nearest_Point(), and Get_Nearest_Shape().

◆ Get_Nearest_Point() [3/4]

bool CSG_KDTree_3D::Get_Nearest_Point | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | size_t & | Index
 | ) |  |
virtual

Definition at line 1047 of file kdtree.cpp.

References Get_Nearest_Point().

◆ Get_Nearest_Point() [4/4]

bool CSG_KDTree_3D::Get_Nearest_Point | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | size_t & | Index,
 |  | double & | Distance
 | ) |  |
virtual

Definition at line 1042 of file kdtree.cpp.

References Get_Nearest_Point().

◆ Get_Nearest_Points() [1/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | Coordinate[3],
 |  | size_t | Count,
 |  | double | Radius
 | ) |  |
virtual

Definition at line 881 of file kdtree.cpp.

References CSG_KDTree::m_Distances, and CSG_KDTree::m_Indices.

Referenced by Get_Nearest_Point(), Get_Nearest_Points(), and Get_Nearest_Value().

◆ Get_Nearest_Points() [2/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | Coordinate[3],
 |  | size_t | Count,
 |  | double | Radius,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 887 of file kdtree.cpp.

References CSG_Array_Int::Create(), CSG_Vector::Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_N(), Get_Nearest_Points(), CSG_KDTree::m_pKDTree, and CSG_Vector::Set_Rows().

◆ Get_Nearest_Points() [3/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | Coordinate[3],
 |  | size_t | Count,
 |  | size_t * | Indices,
 |  | double * | Distances
 | ) |  |
virtual

Definition at line 940 of file kdtree.cpp.

References CSG_KDTree::m_pKDTree.

◆ Get_Nearest_Points() [4/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | size_t | Count,
 |  | double | Radius
 | ) |  |
virtual

Definition at line 1027 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Points() [5/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | size_t | Count,
 |  | double | Radius,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |
virtual

Definition at line 1032 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Points() [6/6]

size_t CSG_KDTree_3D::Get_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | size_t | Count,
 |  | size_t * | Indices,
 |  | double * | Distances
 | ) |  |
virtual

Definition at line 1037 of file kdtree.cpp.

References Get_Nearest_Points().

◆ Get_Nearest_Shape() [1/2]

CSG_Shape * CSG_KDTree_3D::Get_Nearest_Shape ( double Coordinate[3] )
virtual

Definition at line 982 of file kdtree.cpp.

References Get_Nearest_Point(), CSG_Shapes::Get_Shape(), and CSG_KDTree::m_pAdaptor.

Referenced by Get_Nearest_Shape().

◆ Get_Nearest_Shape() [2/2]

CSG_Shape * CSG_KDTree_3D::Get_Nearest_Shape | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
virtual

Definition at line 1057 of file kdtree.cpp.

References Get_Nearest_Shape().

◆ Get_Nearest_Value() [1/2]

bool CSG_KDTree_3D::Get_Nearest_Value | ( | double | Coordinate[3],
 |  | double & | Value
 | ) |  |
virtual

Definition at line 967 of file kdtree.cpp.

References CSG_Matrix::Get_Data(), Get_Nearest_Points(), Get_Point_Value(), and CSG_KDTree::m_Points.

Referenced by Get_Nearest_Value().

◆ Get_Nearest_Value() [2/2]

bool CSG_KDTree_3D::Get_Nearest_Value | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | double & | Value
 | ) |  |
virtual

Definition at line 1052 of file kdtree.cpp.

References Get_Nearest_Value().

◆ Get_Point_Value()

virtual double CSG_KDTree_3D::Get_Point_Value ( size_t i ) const
inlinevirtual

Implements CSG_KDTree.

Definition at line 1332 of file shapes.h.

Referenced by Get_Nearest_Value().

The documentation for this class was generated from the following files:
  • shapes.h
  • kdtree.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_KDTree_3D Member List

This is the complete list of members for CSG_KDTree_3D, including all inherited members.

_On_Construction(void) | CSG_KDTree | protected
Create(CSG_Shapes *pPoints, int Field=-1, int zField=-1, double zScale=1.) | CSG_KDTree_3D |
Create(CSG_PointCloud *pPoints) | CSG_KDTree_3D |
Create(const CSG_Matrix &Points) | CSG_KDTree_3D |
Create(const double **Points, size_t nPoints) | CSG_KDTree_3D |
CSG_KDTree(void) | CSG_KDTree |
CSG_KDTree_3D(void) | CSG_KDTree_3D |
CSG_KDTree_3D(CSG_Shapes *pPoints, int Field=-1, int zField=-1, double zScale=1.) | CSG_KDTree_3D |
CSG_KDTree_3D(CSG_PointCloud *pPoints) | CSG_KDTree_3D |
CSG_KDTree_3D(const CSG_Matrix &Points) | CSG_KDTree_3D |
CSG_KDTree_3D(const double **Points, size_t nPoints) | CSG_KDTree_3D |
Destroy(void) | CSG_KDTree_3D | virtual
Get_Duplicates(double Coordinate[3], CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_3D | virtual
Get_Duplicates(double Coordinate[3]) | CSG_KDTree_3D | virtual
Get_Duplicates(double x, double y, double z, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_3D | virtual
Get_Duplicates(double x, double y, double z) | CSG_KDTree_3D | virtual
Get_Match_Count(void) const | CSG_KDTree | inline
Get_Match_Distance(size_t i) const | CSG_KDTree | inline
Get_Match_Index(size_t i) const | CSG_KDTree | inline
Get_Match_Shape(size_t i) const | CSG_KDTree |
Get_Nearest_Point(double Coordinate[3], size_t &Index, double &Distance) | CSG_KDTree_3D | virtual
Get_Nearest_Point(double Coordinate[3], size_t &Index) | CSG_KDTree_3D | virtual
Get_Nearest_Point(double x, double y, double z, size_t &Index, double &Distance) | CSG_KDTree_3D | virtual
Get_Nearest_Point(double x, double y, double z, size_t &Index) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double Coordinate[3], size_t Count, double Radius) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double Coordinate[3], size_t Count, size_t *Indices, double *Distances) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double Coordinate[3], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double x, double y, double z, size_t Count, double Radius) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double x, double y, double z, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_KDTree_3D | virtual
Get_Nearest_Points(double x, double y, double z, size_t Count, size_t *Indices, double *Distances) | CSG_KDTree_3D | virtual
Get_Nearest_Shape(double Coordinate[3]) | CSG_KDTree_3D | virtual
Get_Nearest_Shape(double x, double y, double z) | CSG_KDTree_3D | virtual
Get_Nearest_Value(double Coordinate[3], double &Value) | CSG_KDTree_3D | virtual
Get_Nearest_Value(double x, double y, double z, double &Value) | CSG_KDTree_3D | virtual
Get_Point(int i) const | CSG_KDTree | inline
Get_Point(size_t i) const | CSG_KDTree | inline
Get_Point_Count(void) const | CSG_KDTree | inline
Get_Point_Value(size_t i) const | CSG_KDTree_3D | inlinevirtual
CSG_KDTree::Get_Point_Value(int i) const | CSG_KDTree | inlinevirtual
Get_Version(void) | CSG_KDTree | static
is_Okay(void) const | CSG_KDTree | inline
m_Distances | CSG_KDTree | protected
m_Indices | CSG_KDTree | protected
m_pAdaptor | CSG_KDTree | protected
m_pKDTree | CSG_KDTree | protected
m_Points | CSG_KDTree | protected
operator[](int i) const | CSG_KDTree | inline
operator[](size_t i) const | CSG_KDTree | inline
~CSG_KDTree(void) | CSG_KDTree | virtual
~CSG_KDTree_3D(void) | CSG_KDTree_3D | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Lines Class Reference

Public Member Functions | List of all members
CSG_Lines Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Lines (void)
virtual | ~CSG_Lines (void)
CSG_Lines (const CSG_Lines &Lines)
bool | Create (const CSG_Lines &Lines)
CSG_Lines (sLong nLines)
bool | Create (sLong nLines)
bool | Destroy (void)
bool | Clear (void)
CSG_Lines & | operator= (const CSG_Lines &Lines)
bool | Assign (const CSG_Lines &Lines)
CSG_Points & | Add (void)
bool | Add (const CSG_Points &Line)
bool | Add (const CSG_Lines &Lines)
bool | Del (sLong Index)
bool | Set_Count (sLong nLines)
sLong | Get_Count (void) const
CSG_Points & | Get_Line (sLong Index)
const CSG_Points & | Get_Line (sLong Index) const
CSG_Points & | operator[] (sLong Index)
const CSG_Points & | operator[] (sLong Index) const
double | Get_Length (void) const
double | Get_Length (sLong Index) const

Detailed Description

Definition at line 215 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Lines() [1/3]

CSG_Lines::CSG_Lines ( void )

Definition at line 373 of file geo_classes.cpp.

References CSG_Array_Pointer::Create().

◆ ~CSG_Lines()

CSG_Lines::~CSG_Lines ( void )
virtual

Definition at line 403 of file geo_classes.cpp.

References Destroy().

◆ CSG_Lines() [2/3]

CSG_Lines::CSG_Lines ( const CSG_Lines & Lines )

Definition at line 378 of file geo_classes.cpp.

References CSG_Array_Pointer::Create(), and Create().

◆ CSG_Lines() [3/3]

CSG_Lines::CSG_Lines ( sLong nLines )

Definition at line 390 of file geo_classes.cpp.

References CSG_Array_Pointer::Create(), and Create().

Member Function Documentation

◆ Add() [1/3]

bool CSG_Lines::Add ( const CSG_Lines & Lines )

Definition at line 453 of file geo_classes.cpp.

References Add(), and Get_Count().

◆ Add() [2/3]

bool CSG_Lines::Add ( const CSG_Points & Line )

Definition at line 445 of file geo_classes.cpp.

References Add(), and CSG_Points::Assign().

◆ Add() [3/3]

CSG_Points & CSG_Lines::Add ( void )

Definition at line 437 of file geo_classes.cpp.

References Get_Count(), Get_Line(), and Set_Count().

Referenced by Add(), CSG_Shape_Polygon::Get_Shared_Edges(), and CSG_Shape_Polygon_Part::Get_Shared_Edges().

◆ Assign()

bool CSG_Lines::Assign ( const CSG_Lines & Lines )

Definition at line 421 of file geo_classes.cpp.

References CSG_Points::Assign(), Get_Count(), Get_Line(), and Set_Count().

Referenced by Create().

◆ Clear()

bool CSG_Lines::Clear ( void )

Definition at line 415 of file geo_classes.cpp.

References Set_Count().

◆ Create() [1/2]

bool CSG_Lines::Create ( const CSG_Lines & Lines )

Definition at line 385 of file geo_classes.cpp.

References Assign().

Referenced by CSG_Lines().

◆ Create() [2/2]

bool CSG_Lines::Create ( sLong nLines )

Definition at line 397 of file geo_classes.cpp.

References Set_Count().

◆ Del()

bool CSG_Lines::Del ( sLong Index )

Definition at line 464 of file geo_classes.cpp.

References CSG_Array_Pointer::Del(), and CSG_Array_Pointer::Get_Size().

◆ Destroy()

bool CSG_Lines::Destroy ( void )

Definition at line 409 of file geo_classes.cpp.

References Set_Count().

Referenced by ~CSG_Lines().

◆ Get_Count()

sLong CSG_Lines::Get_Count ( void ) const
inline

Definition at line 239 of file geo_tools.h.

Referenced by Add(), Assign(), Get_Length(), and CSG_Shape_Polygon_Part::Get_Shared_Edges().

◆ Get_Length() [1/2]

double CSG_Lines::Get_Length ( sLong Index ) const

Definition at line 520 of file geo_classes.cpp.

References CSG_Points::Get_Count(), Get_Count(), Get_Line(), and SG_Get_Distance().

◆ Get_Length() [2/2]

double CSG_Lines::Get_Length ( void ) const

Definition at line 508 of file geo_classes.cpp.

References Get_Count().

Referenced by CSG_Shape_Polygon::Get_Shared_Length(), and CSG_Shape_Polygon_Part::Get_Shared_Length().

◆ Get_Line() [1/2]

CSG_Points& CSG_Lines::Get_Line ( sLong Index )
inline

Definition at line 241 of file geo_tools.h.

Referenced by Add(), Assign(), and Get_Length().

◆ Get_Line() [2/2]

const CSG_Points& CSG_Lines::Get_Line ( sLong Index ) const
inline

Definition at line 242 of file geo_tools.h.

◆ operator=()

CSG_Lines& CSG_Lines::operator= ( const CSG_Lines & Lines )
inline

Definition at line 230 of file geo_tools.h.

◆ operator[]() [1/2]

CSG_Points& CSG_Lines::operator[] ( sLong Index )
inline

Definition at line 244 of file geo_tools.h.

◆ operator[]() [2/2]

const CSG_Points& CSG_Lines::operator[] ( sLong Index ) const
inline

Definition at line 245 of file geo_tools.h.

◆ Set_Count()

bool CSG_Lines::Set_Count ( sLong nLines )

Definition at line 477 of file geo_classes.cpp.

References CSG_Array_Pointer::Get_Size(), and CSG_Array_Pointer::Set_Array().

Referenced by Add(), Assign(), Clear(), Create(), and Destroy().

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Lines Member List

This is the complete list of members for CSG_Lines, including all inherited members.

Add(void) | CSG_Lines |
Add(const CSG_Points &Line) | CSG_Lines |
Add(const CSG_Lines &Lines) | CSG_Lines |
Assign(const CSG_Lines &Lines) | CSG_Lines |
Clear(void) | CSG_Lines |
Create(const CSG_Lines &Lines) | CSG_Lines |
Create(sLong nLines) | CSG_Lines |
CSG_Lines(void) | CSG_Lines |
CSG_Lines(const CSG_Lines &Lines) | CSG_Lines |
CSG_Lines(sLong nLines) | CSG_Lines |
Del(sLong Index) | CSG_Lines |
Destroy(void) | CSG_Lines |
Get_Count(void) const | CSG_Lines | inline
Get_Length(void) const | CSG_Lines |
Get_Length(sLong Index) const | CSG_Lines |
Get_Line(sLong Index) | CSG_Lines | inline
Get_Line(sLong Index) const | CSG_Lines | inline
operator=(const CSG_Lines &Lines) | CSG_Lines | inline
operator[](sLong Index) | CSG_Lines | inline
operator[](sLong Index) const | CSG_Lines | inline
Set_Count(sLong nLines) | CSG_Lines |
~CSG_Lines(void) | CSG_Lines | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Matrix Class Reference

Public Member Functions | List of all members
CSG_Matrix Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Matrix (void)
virtual | ~CSG_Matrix (void)
CSG_Matrix (const CSG_Matrix &Matrix)
bool | Create (const CSG_Matrix &Matrix)
CSG_Matrix (sLong nCols, sLong nRows, const double *Data=NULL)
bool | Create (sLong nCols, sLong nRows, const double *Data=NULL)
CSG_Matrix (sLong nCols, sLong nRows, const double **Data)
bool | Create (sLong nCols, sLong nRows, const double **Data)
bool | Destroy (void)
bool | Set_Size (sLong nRows, sLong nCols)
bool | Set_Cols (sLong nCols)
bool | Set_Rows (sLong nRows)
bool | Add_Cols (sLong nCols)
bool | Add_Rows (sLong nRows)
bool | Del_Cols (sLong nCols)
bool | Del_Rows (sLong nRows)
bool | Add_Col (const double *Data=NULL)
bool | Add_Col (const CSG_Vector &Data)
bool | Add_Row (const double *Data=NULL)
bool | Add_Row (const CSG_Vector &Data)
bool | Ins_Col (sLong Col, const double *Data=NULL)
bool | Ins_Col (sLong Col, const CSG_Vector &Data)
bool | Ins_Row (sLong Row, const double *Data=NULL)
bool | Ins_Row (sLong Row, const CSG_Vector &Data)
bool | Set_Col (sLong Col, const double *Data)
bool | Set_Col (sLong Col, const CSG_Vector &Data)
bool | Set_Col (const CSG_Vector &Data)
bool | Set_Row (sLong Row, const double *Data)
bool | Set_Row (sLong Row, const CSG_Vector &Data)
bool | Set_Row (const CSG_Vector &Data)
bool | Del_Col (sLong Col)
bool | Del_Row (sLong Row)
CSG_Vector | Get_Col (sLong Col) const
CSG_Vector | Get_Row (sLong Row) const
int | Get_NX (void) const
int | Get_NY (void) const
sLong | Get_NCols (void) const
sLong | Get_NRows (void) const
operator const double ** (void) const
double ** | Get_Data (void) const
double | operator() (sLong Row, sLong Col) const
double * | operator[] (sLong Row) const
double * | operator[] (size_t Row) const
double * | operator[] (int Row) const
CSG_String | to_String (int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
bool | from_String (const CSG_String &String)
bool | is_Square (void) const
bool | is_Equal (const CSG_Matrix &Matrix) const
bool | Assign (double Scalar)
bool | Assign (const CSG_Matrix &Matrix)
bool | Add (double Scalar)
bool | Add (const CSG_Matrix &Matrix)
bool | Subtract (const CSG_Matrix &Matrix)
bool | Multiply (double Scalar)
CSG_Vector | Multiply (const CSG_Vector &Vector) const
CSG_Matrix | Multiply (const CSG_Matrix &Matrix) const
bool | operator== (const CSG_Matrix &Matrix) const
CSG_Matrix & | operator= (double Scalar)
CSG_Matrix & | operator= (const CSG_Matrix &Matrix)
CSG_Matrix & | operator+= (double Scalar)
CSG_Matrix & | operator+= (const CSG_Matrix &Matrix)
CSG_Matrix & | operator-= (double Scalar)
CSG_Matrix & | operator-= (const CSG_Matrix &Matrix)
CSG_Matrix & | operator*= (double Scalar)
CSG_Matrix & | operator*= (const CSG_Matrix &Matrix)
CSG_Matrix | operator+ (double Scalar) const
CSG_Matrix | operator+ (const CSG_Matrix &Matrix) const
CSG_Matrix | operator- (double Scalar) const
CSG_Matrix | operator- (const CSG_Matrix &Matrix) const
CSG_Matrix | operator* (double Scalar) const
CSG_Vector | operator* (const CSG_Vector &Vector) const
CSG_Matrix | operator* (const CSG_Matrix &Matrix) const
bool | Set_Zero (void)
bool | Set_Identity (void)
bool | Set_Transpose (void)
bool | Set_Inverse (bool bSilent=true, int nSubSquare=0)
double | Get_Determinant (void) const
CSG_Matrix | Get_Transpose (void) const
CSG_Matrix | Get_Inverse (bool bSilent=true, int nSubSquare=0) const

Detailed Description

Definition at line 462 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Matrix() [1/4]

CSG_Matrix::CSG_Matrix ( void )

Definition at line 823 of file mat_matrix.cpp.

◆ ~CSG_Matrix()

CSG_Matrix::~CSG_Matrix ( void )
virtual

Definition at line 918 of file mat_matrix.cpp.

References Destroy().

◆ CSG_Matrix() [2/4]

CSG_Matrix::CSG_Matrix ( const CSG_Matrix & Matrix )

Definition at line 829 of file mat_matrix.cpp.

References Create().

◆ CSG_Matrix() [3/4]

CSG_Matrix::CSG_Matrix | ( | sLong | nCols,
 |  | sLong | nRows,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 842 of file mat_matrix.cpp.

References Create().

◆ CSG_Matrix() [4/4]

CSG_Matrix::CSG_Matrix | ( | sLong | nCols,
 |  | sLong | nRows,
 |  | const double ** | Data
 | ) |  |

Definition at line 892 of file mat_matrix.cpp.

References Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Matrix::Add ( const CSG_Matrix & Matrix )

Definition at line 1467 of file mat_matrix.cpp.

◆ Add() [2/2]

bool CSG_Matrix::Add ( double Scalar )

Definition at line 1448 of file mat_matrix.cpp.

Referenced by operator+(), operator+=(), operator-(), and operator-=().

◆ Add_Col() [1/2]

bool CSG_Matrix::Add_Col ( const CSG_Vector & Data )

Definition at line 1089 of file mat_matrix.cpp.

References Add_Col(), Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().

◆ Add_Col() [2/2]

bool CSG_Matrix::Add_Col ( const double * Data = NULL )

Definition at line 1077 of file mat_matrix.cpp.

References Add_Cols(), and Set_Col().

Referenced by Add_Col(), and Ins_Col().

◆ Add_Cols()

bool CSG_Matrix::Add_Cols ( sLong nCols )

Definition at line 990 of file mat_matrix.cpp.

References Create().

Referenced by CSG_Regression_Multiple::_Get_Step_In(), Add_Col(), and Set_Cols().

◆ Add_Row() [1/2]

bool CSG_Matrix::Add_Row ( const CSG_Vector & Data )

Definition at line 1112 of file mat_matrix.cpp.

References Add_Row(), Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().

◆ Add_Row() [2/2]

bool CSG_Matrix::Add_Row ( const double * Data = NULL )

Definition at line 1100 of file mat_matrix.cpp.

References Add_Rows(), and Set_Row().

Referenced by Add_Row(), CSG_Regression_Weighted::Add_Sample(), from_String(), CSG_Regression_Multiple::Get_CrossValidation(), and Ins_Row().

◆ Add_Rows()

bool CSG_Matrix::Add_Rows ( sLong nRows )

Definition at line 1011 of file mat_matrix.cpp.

References SG_Realloc().

Referenced by Add_Row(), and Set_Rows().

◆ Assign() [1/2]

bool CSG_Matrix::Assign ( const CSG_Matrix & Matrix )

Definition at line 1442 of file mat_matrix.cpp.

References Create().

◆ Assign() [2/2]

bool CSG_Matrix::Assign ( double Scalar )

Definition at line 1423 of file mat_matrix.cpp.

Referenced by operator=().

◆ Create() [1/3]

bool CSG_Matrix::Create ( const CSG_Matrix & Matrix )

Definition at line 836 of file mat_matrix.cpp.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Initialize(), Add_Col(), Add_Cols(), Add_Row(), CSG_Regression_Weighted::Add_Sample(), Assign(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Thin_Plate_Spline::Create(), Create(), CSG_Matrix(), Del_Col(), Del_Cols(), Del_Row(), CSG_Cluster_Analysis::Execute(), CSG_Trend_Polynom::Get_Trend(), Ins_Col(), Ins_Row(), Multiply(), Set_Col(), Set_Row(), Set_Transpose(), and Set_Zero().

◆ Create() [2/3]

bool CSG_Matrix::Create | ( | sLong | nCols,
 |  | sLong | nRows,
 |  | const double ** | Data
 | ) |  |

Definition at line 899 of file mat_matrix.cpp.

References Create().

◆ Create() [3/3]

bool CSG_Matrix::Create | ( | sLong | nCols,
 |  | sLong | nRows,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 849 of file mat_matrix.cpp.

References Destroy(), and SG_Malloc().

◆ Del_Col()

bool CSG_Matrix::Del_Col ( sLong Col )

Definition at line 1251 of file mat_matrix.cpp.

References Create(), and Destroy().

Referenced by CSG_Regression_Multiple::_Get_Step_In(), and CSG_Regression_Multiple::_Get_Step_Out().

◆ Del_Cols()

bool CSG_Matrix::Del_Cols ( sLong nCols )

Deletes the last nCols columns.

Definition at line 1037 of file mat_matrix.cpp.

References Create().

Referenced by Set_Cols().

◆ Del_Row()

bool CSG_Matrix::Del_Row ( sLong Row )

Definition at line 1285 of file mat_matrix.cpp.

References Create(), and Destroy().

Referenced by CSG_Regression_Multiple::Get_CrossValidation().

◆ Del_Rows()

bool CSG_Matrix::Del_Rows ( sLong nRows )

Deletes the last nRows rows.

Definition at line 1061 of file mat_matrix.cpp.

References SG_Realloc().

Referenced by Set_Rows().

◆ Destroy()

bool CSG_Matrix::Destroy ( void )

Definition at line 923 of file mat_matrix.cpp.

References SG_Free().

Referenced by Create(), Del_Col(), Del_Row(), CSG_Cluster_Analysis::Destroy(), CSG_Regression_Multiple::Destroy(), CSG_Regression_Weighted::Destroy(), CSG_KDTree::Destroy(), from_String(), and ~CSG_Matrix().

◆ from_String()

bool CSG_Matrix::from_String ( const CSG_String & String )

Definition at line 1372 of file mat_matrix.cpp.

References Add_Row(), CSG_Vector::Add_Row(), CSG_String::AfterFirst(), CSG_String::asDouble(), Destroy(), CSG_String_Tokenizer::Get_Next_Token(), Get_NRows(), and CSG_String_Tokenizer::Has_More_Tokens().

◆ Get_Col()

CSG_Vector CSG_Matrix::Get_Col ( sLong Col ) const

Definition at line 1314 of file mat_matrix.cpp.

References CSG_Vector::Create().

Referenced by CSG_Regression_Multiple::_Get_Step_In(), and CSG_Regression_Multiple::_Initialize().

◆ Get_Data()

double** CSG_Matrix::Get_Data ( void ) const
inline

Definition at line 511 of file mat_tools.h.

Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), Get_Determinant(), CSG_KDTree_2D::Get_Nearest_Value(), CSG_KDTree_3D::Get_Nearest_Value(), Set_Inverse(), and SG_Matrix_Solve().

◆ Get_Determinant()

double CSG_Matrix::Get_Determinant ( void ) const

Definition at line 1806 of file mat_matrix.cpp.

References CSG_Array::Get_Array(), Get_Data(), Get_NX(), is_Square(), and SG_Matrix_LU_Decomposition().

Referenced by CSG_Classifier_Supervised::Add_Class().

◆ Get_Inverse()

CSG_Matrix CSG_Matrix::Get_Inverse | ( | bool | bSilent = true,
 |  | int | nSubSquare = 0
 | ) |  | const

Definition at line 1845 of file mat_matrix.cpp.

References Set_Inverse().

Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Classifier_Supervised::Add_Class().

◆ Get_NCols()

sLong CSG_Matrix::Get_NCols ( void ) const
inline

Definition at line 507 of file mat_tools.h.

Referenced by CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Add_Sample(), CSG_Regression_Weighted::Calculate(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Regression_Multiple::Get_CrossValidation(), and CSG_Regression_Multiple::Set_Data().

◆ Get_NRows()

sLong CSG_Matrix::Get_NRows ( void ) const
inline

Definition at line 508 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::_Set_Step_Info(), CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Add_Sample(), CSG_Regression_Weighted::Calculate(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), from_String(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Regression_Multiple::Get_Residual(), and CSG_Regression_Multiple::Get_Residuals().

◆ Get_NX()

int CSG_Matrix::Get_NX ( void ) const
inline

Definition at line 505 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Initialize(), Get_Determinant(), CSG_Regression_Multiple::Set_Data(), SG_Get_Correlation_Matrix(), SG_Matrix_Solve(), and SG_Matrix_Tridiagonal_QL().

◆ Get_NY()

int CSG_Matrix::Get_NY ( void ) const
inline

Definition at line 506 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Get_Step_Out(), CSG_Regression_Multiple::_Initialize(), CSG_Regression_Multiple::_Set_Step_Info(), CSG_Regression_Multiple::Set_Data(), SG_Get_Correlation_Matrix(), SG_Matrix_Solve(), and SG_Matrix_Tridiagonal_QL().

◆ Get_Row()

CSG_Vector CSG_Matrix::Get_Row ( sLong Row ) const

Definition at line 1332 of file mat_matrix.cpp.

References CSG_Vector::Create().

Referenced by CSG_Regression_Weighted::Calculate().

◆ Get_Transpose()

CSG_Matrix CSG_Matrix::Get_Transpose ( void ) const

Definition at line 1829 of file mat_matrix.cpp.

Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_TIN_Triangle::Get_Value().

◆ Ins_Col() [1/2]

bool CSG_Matrix::Ins_Col | ( | sLong | Col,
 |  | const CSG_Vector & | Data
 | ) |  |

Definition at line 1155 of file mat_matrix.cpp.

References Add_Col(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Ins_Col().

◆ Ins_Col() [2/2]

bool CSG_Matrix::Ins_Col | ( | sLong | Col,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 1123 of file mat_matrix.cpp.

References Create().

Referenced by Ins_Col().

◆ Ins_Row() [1/2]

bool CSG_Matrix::Ins_Row | ( | sLong | Row,
 |  | const CSG_Vector & | Data
 | ) |  |

Definition at line 1188 of file mat_matrix.cpp.

References Add_Row(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Ins_Row().

◆ Ins_Row() [2/2]

bool CSG_Matrix::Ins_Row | ( | sLong | Row,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 1161 of file mat_matrix.cpp.

References Create().

Referenced by Ins_Row().

◆ is_Equal()

bool CSG_Matrix::is_Equal ( const CSG_Matrix & Matrix ) const

Definition at line 1404 of file mat_matrix.cpp.

Referenced by operator==().

◆ is_Square()

bool CSG_Matrix::is_Square ( void ) const
inline

Definition at line 521 of file mat_tools.h.

Referenced by Get_Determinant(), and Set_Inverse().

◆ Multiply() [1/3]

CSG_Matrix CSG_Matrix::Multiply ( const CSG_Matrix & Matrix ) const

Definition at line 1545 of file mat_matrix.cpp.

References Create().

◆ Multiply() [2/3]

CSG_Vector CSG_Matrix::Multiply ( const CSG_Vector & Vector ) const

Definition at line 1523 of file mat_matrix.cpp.

References CSG_Vector::Create(), and CSG_Vector::Get_Size().

◆ Multiply() [3/3]

bool CSG_Matrix::Multiply ( double Scalar )

Definition at line 1505 of file mat_matrix.cpp.

Referenced by CSG_Vector::Multiply(), operator*(), and operator*=().

◆ operator const double **()

CSG_Matrix::operator const double ** ( void ) const
inline

Definition at line 510 of file mat_tools.h.

◆ operator()()

double CSG_Matrix::operator() | ( | sLong | Row,
 |  | sLong | Col
 | ) |  | const
 inline

Definition at line 513 of file mat_tools.h.

◆ operator*() [1/3]

CSG_Matrix CSG_Matrix::operator* ( const CSG_Matrix & Matrix ) const

Definition at line 1694 of file mat_matrix.cpp.

References Multiply().

◆ operator*() [2/3]

CSG_Vector CSG_Matrix::operator* ( const CSG_Vector & Vector ) const

Definition at line 1689 of file mat_matrix.cpp.

References Multiply().

◆ operator*() [3/3]

CSG_Matrix CSG_Matrix::operator* ( double Scalar ) const

Definition at line 1680 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [1/2]

CSG_Matrix & CSG_Matrix::operator*= ( const CSG_Matrix & Matrix )

Definition at line 1634 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [2/2]

CSG_Matrix & CSG_Matrix::operator*= ( double Scalar )

Definition at line 1627 of file mat_matrix.cpp.

References Multiply().

◆ operator+() [1/2]

CSG_Matrix CSG_Matrix::operator+ ( const CSG_Matrix & Matrix ) const

Definition at line 1651 of file mat_matrix.cpp.

References Add().

◆ operator+() [2/2]

CSG_Matrix CSG_Matrix::operator+ ( double Scalar ) const

Definition at line 1642 of file mat_matrix.cpp.

References Add().

◆ operator+=() [1/2]

CSG_Matrix & CSG_Matrix::operator+= ( const CSG_Matrix & Matrix )

Definition at line 1604 of file mat_matrix.cpp.

References Add().

◆ operator+=() [2/2]

CSG_Matrix & CSG_Matrix::operator+= ( double Scalar )

Definition at line 1597 of file mat_matrix.cpp.

References Add().

◆ operator-() [1/2]

CSG_Matrix CSG_Matrix::operator- ( const CSG_Matrix & Matrix ) const

Definition at line 1670 of file mat_matrix.cpp.

References Subtract().

◆ operator-() [2/2]

CSG_Matrix CSG_Matrix::operator- ( double Scalar ) const

Definition at line 1661 of file mat_matrix.cpp.

References Add().

◆ operator-=() [1/2]

CSG_Matrix & CSG_Matrix::operator-= ( const CSG_Matrix & Matrix )

Definition at line 1619 of file mat_matrix.cpp.

References Subtract().

◆ operator-=() [2/2]

CSG_Matrix & CSG_Matrix::operator-= ( double Scalar )

Definition at line 1612 of file mat_matrix.cpp.

References Add().

◆ operator=() [1/2]

CSG_Matrix & CSG_Matrix::operator= ( const CSG_Matrix & Matrix )

Definition at line 1589 of file mat_matrix.cpp.

References Assign().

◆ operator=() [2/2]

CSG_Matrix & CSG_Matrix::operator= ( double Scalar )

Definition at line 1582 of file mat_matrix.cpp.

References Assign().

◆ operator==()

bool CSG_Matrix::operator== ( const CSG_Matrix & Matrix ) const

Definition at line 1576 of file mat_matrix.cpp.

References is_Equal().

◆ operator[]() [1/3]

double* CSG_Matrix::operator[] ( int Row ) const
inline

Definition at line 516 of file mat_tools.h.

◆ operator[]() [2/3]

double* CSG_Matrix::operator[] ( size_t Row ) const
inline

Definition at line 515 of file mat_tools.h.

◆ operator[]() [3/3]

double* CSG_Matrix::operator[] ( sLong Row ) const
inline

Definition at line 514 of file mat_tools.h.

◆ Set_Col() [1/3]

bool CSG_Matrix::Set_Col ( const CSG_Vector & Data )

Sets matrix size to one column with vector's data as row.

Definition at line 1218 of file mat_matrix.cpp.

References Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().

◆ Set_Col() [2/3]

bool CSG_Matrix::Set_Col | ( | sLong | Col,
 |  | const CSG_Vector & | Data
 | ) |  |

Definition at line 1209 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().

◆ Set_Col() [3/3]

bool CSG_Matrix::Set_Col | ( | sLong | Col,
 |  | const double * | Data
 | ) |  |

Definition at line 1194 of file mat_matrix.cpp.

Referenced by CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Initialize(), Add_Col(), and Set_Col().

◆ Set_Cols()

bool CSG_Matrix::Set_Cols ( sLong nCols )

Definition at line 958 of file mat_matrix.cpp.

References Add_Cols(), and Del_Cols().

Referenced by Set_Size().

◆ Set_Identity()

bool CSG_Matrix::Set_Identity ( void )

Definition at line 1716 of file mat_matrix.cpp.

◆ Set_Inverse()

bool CSG_Matrix::Set_Inverse | ( | bool | bSilent = true,
 |  | int | nSubSquare = 0
 | ) |  |

Definition at line 1756 of file mat_matrix.cpp.

References CSG_Array::Get_Array(), CSG_Vector::Get_Data(), Get_Data(), is_Square(), CSG_Vector::Set_Zero(), SG_Matrix_LU_Decomposition(), SG_Matrix_LU_Solve(), and SG_UI_Process_Set_Progress().

Referenced by Get_Inverse().

◆ Set_Row() [1/3]

bool CSG_Matrix::Set_Row ( const CSG_Vector & Data )

Sets matrix size to one row with vector's data as column.

Definition at line 1245 of file mat_matrix.cpp.

References Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().

◆ Set_Row() [2/3]

bool CSG_Matrix::Set_Row | ( | sLong | Row,
 |  | const CSG_Vector & | Data
 | ) |  |

Definition at line 1236 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().

◆ Set_Row() [3/3]

bool CSG_Matrix::Set_Row | ( | sLong | Row,
 |  | const double * | Data
 | ) |  |

Definition at line 1224 of file mat_matrix.cpp.

Referenced by Add_Row(), and Set_Row().

◆ Set_Rows()

bool CSG_Matrix::Set_Rows ( sLong nRows )

Definition at line 974 of file mat_matrix.cpp.

References Add_Rows(), and Del_Rows().

Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), and Set_Size().

◆ Set_Size()

bool CSG_Matrix::Set_Size | ( | sLong | nRows,
 |  | sLong | nCols
 | ) |  |

Definition at line 952 of file mat_matrix.cpp.

References Set_Cols(), and Set_Rows().

◆ Set_Transpose()

bool CSG_Matrix::Set_Transpose ( void )

Definition at line 1735 of file mat_matrix.cpp.

References Create().

◆ Set_Zero()

bool CSG_Matrix::Set_Zero ( void )

Definition at line 1710 of file mat_matrix.cpp.

References Create().

◆ Subtract()

bool CSG_Matrix::Subtract ( const CSG_Matrix & Matrix )

Definition at line 1486 of file mat_matrix.cpp.

Referenced by operator-(), and operator-=().

◆ to_String()

CSG_String CSG_Matrix::to_String | ( | int | Width = -1,
 |  | int | Precision = -1,
 |  | bool | bScientific = false,
 |  | const SG_Char * | Separator = NULL
 | ) |  | const

Definition at line 1350 of file mat_matrix.cpp.

References CSG_String::Format(), SG_Get_Digit_Count(), SG_Get_Double_asString(), and SG_T.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_matrix.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Matrix Member List

This is the complete list of members for CSG_Matrix, including all inherited members.

Add(double Scalar) | CSG_Matrix |
Add(const CSG_Matrix &Matrix) | CSG_Matrix |
Add_Col(const double *Data=NULL) | CSG_Matrix |
Add_Col(const CSG_Vector &Data) | CSG_Matrix |
Add_Cols(sLong nCols) | CSG_Matrix |
Add_Row(const double *Data=NULL) | CSG_Matrix |
Add_Row(const CSG_Vector &Data) | CSG_Matrix |
Add_Rows(sLong nRows) | CSG_Matrix |
Assign(double Scalar) | CSG_Matrix |
Assign(const CSG_Matrix &Matrix) | CSG_Matrix |
Create(const CSG_Matrix &Matrix) | CSG_Matrix |
Create(sLong nCols, sLong nRows, const double *Data=NULL) | CSG_Matrix |
Create(sLong nCols, sLong nRows, const double **Data) | CSG_Matrix |
CSG_Matrix(void) | CSG_Matrix |
CSG_Matrix(const CSG_Matrix &Matrix) | CSG_Matrix |
CSG_Matrix(sLong nCols, sLong nRows, const double *Data=NULL) | CSG_Matrix |
CSG_Matrix(sLong nCols, sLong nRows, const double **Data) | CSG_Matrix |
Del_Col(sLong Col) | CSG_Matrix |
Del_Cols(sLong nCols) | CSG_Matrix |
Del_Row(sLong Row) | CSG_Matrix |
Del_Rows(sLong nRows) | CSG_Matrix |
Destroy(void) | CSG_Matrix |
from_String(const CSG_String &String) | CSG_Matrix |
Get_Col(sLong Col) const | CSG_Matrix |
Get_Data(void) const | CSG_Matrix | inline
Get_Determinant(void) const | CSG_Matrix |
Get_Inverse(bool bSilent=true, int nSubSquare=0) const | CSG_Matrix |
Get_NCols(void) const | CSG_Matrix | inline
Get_NRows(void) const | CSG_Matrix | inline
Get_NX(void) const | CSG_Matrix | inline
Get_NY(void) const | CSG_Matrix | inline
Get_Row(sLong Row) const | CSG_Matrix |
Get_Transpose(void) const | CSG_Matrix |
Ins_Col(sLong Col, const double *Data=NULL) | CSG_Matrix |
Ins_Col(sLong Col, const CSG_Vector &Data) | CSG_Matrix |
Ins_Row(sLong Row, const double *Data=NULL) | CSG_Matrix |
Ins_Row(sLong Row, const CSG_Vector &Data) | CSG_Matrix |
is_Equal(const CSG_Matrix &Matrix) const | CSG_Matrix |
is_Square(void) const | CSG_Matrix | inline
Multiply(double Scalar) | CSG_Matrix |
Multiply(const CSG_Vector &Vector) const | CSG_Matrix |
Multiply(const CSG_Matrix &Matrix) const | CSG_Matrix |
operator const double **(void) const | CSG_Matrix | inline
operator()(sLong Row, sLong Col) const | CSG_Matrix | inline
operator*(double Scalar) const | CSG_Matrix |
operator*(const CSG_Vector &Vector) const | CSG_Matrix |
operator*(const CSG_Matrix &Matrix) const | CSG_Matrix |
operator*=(double Scalar) | CSG_Matrix |
operator*=(const CSG_Matrix &Matrix) | CSG_Matrix |
operator+(double Scalar) const | CSG_Matrix |
operator+(const CSG_Matrix &Matrix) const | CSG_Matrix |
operator+=(double Scalar) | CSG_Matrix |
operator+=(const CSG_Matrix &Matrix) | CSG_Matrix |
operator-(double Scalar) const | CSG_Matrix |
operator-(const CSG_Matrix &Matrix) const | CSG_Matrix |
operator-=(double Scalar) | CSG_Matrix |
operator-=(const CSG_Matrix &Matrix) | CSG_Matrix |
operator=(double Scalar) | CSG_Matrix |
operator=(const CSG_Matrix &Matrix) | CSG_Matrix |
operator==(const CSG_Matrix &Matrix) const | CSG_Matrix |
operator[](sLong Row) const | CSG_Matrix | inline
operator[](size_t Row) const | CSG_Matrix | inline
operator[](int Row) const | CSG_Matrix | inline
Set_Col(sLong Col, const double *Data) | CSG_Matrix |
Set_Col(sLong Col, const CSG_Vector &Data) | CSG_Matrix |
Set_Col(const CSG_Vector &Data) | CSG_Matrix |
Set_Cols(sLong nCols) | CSG_Matrix |
Set_Identity(void) | CSG_Matrix |
Set_Inverse(bool bSilent=true, int nSubSquare=0) | CSG_Matrix |
Set_Row(sLong Row, const double *Data) | CSG_Matrix |
Set_Row(sLong Row, const CSG_Vector &Data) | CSG_Matrix |
Set_Row(const CSG_Vector &Data) | CSG_Matrix |
Set_Rows(sLong nRows) | CSG_Matrix |
Set_Size(sLong nRows, sLong nCols) | CSG_Matrix |
Set_Transpose(void) | CSG_Matrix |
Set_Zero(void) | CSG_Matrix |
Subtract(const CSG_Matrix &Matrix) | CSG_Matrix |
to_String(int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const | CSG_Matrix |
~CSG_Matrix(void) | CSG_Matrix | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_MetaData Class Reference

Public Member Functions | Friends | List of all members
CSG_MetaData Class Reference

#include <metadata.h>

Public Member Functions

CSG_MetaData (void)
bool | Create (void)
CSG_MetaData (const CSG_MetaData &MetaData)
bool | Create (const CSG_MetaData &MetaData)
CSG_MetaData (const CSG_String &File, const SG_Char *Extension=NULL)
bool | Create (const CSG_String &File, const SG_Char *Extension=NULL)
CSG_MetaData (CSG_File &File)
bool | Create (CSG_File &File)
virtual | ~CSG_MetaData (void)
void | Destroy (void)
bool | Load (const CSG_String &File, const SG_Char *Extension=NULL)
bool | Save (const CSG_String &File, const SG_Char *Extension=NULL) const
bool | Load (CSG_File &Stream)
bool | Save (CSG_File &Stream) const
bool | Load_HTTP (const CSG_String &Server, const CSG_String &Path, const SG_Char *Username=NULL, const SG_Char *Password=NULL)
bool | from_XML (const CSG_String &XML)
bool | to_XML (CSG_String &XML) const
bool | from_WKT (const CSG_String &WKT)
bool | to_WKT (CSG_String &WKT) const
bool | Load_JSON (const CSG_String &File)
bool | Save_JSON (const CSG_String &File) const
bool | from_JSON (const CSG_String &JSON)
bool | to_JSON (CSG_String &JSON) const
bool | Assign (const CSG_MetaData &MetaData, bool bAddChildren=true)
CSG_MetaData & | operator= (const CSG_MetaData &MetaData)
CSG_MetaData & | operator+= (const CSG_MetaData &MetaData)
const CSG_String & | Get_Name (void) const
void | Set_Name (const CSG_String &Name)
bool | Cmp_Name (const CSG_String &String, bool bNoCase=true) const
const CSG_String & | Get_Content (void) const
const SG_Char * | Get_Content (int Index) const
const SG_Char * | Get_Content (const CSG_String &Name) const
bool | Get_Content (const CSG_String &Name, CSG_String &Value) const
bool | Get_Content (const CSG_String &Name, double &Value) const
bool | Get_Content (const CSG_String &Name, int &Value) const
bool | Get_Content (const CSG_String &Name, sLong &Value) const
void | Set_Content (const CSG_String &Content)
void | Fmt_Content (const char *Format,...)
void | Fmt_Content (const wchar_t *Format,...)
bool | Cmp_Content (const CSG_String &String, bool bNoCase=false) const
CSG_MetaData * | Get_Parent (void) const
int | Get_Children_Count (void) const
CSG_MetaData * | Get_Child (int Index) const
CSG_MetaData * | Get_Child (const CSG_String &Name) const
CSG_MetaData * | Add_Child (void)
CSG_MetaData * | Add_Child (const CSG_String &Name)
CSG_MetaData * | Add_Child (const CSG_String &Name, const CSG_String &Content)
CSG_MetaData * | Add_Child (const CSG_String &Name, double Content)
CSG_MetaData * | Add_Child (const CSG_String &Name, int Content)
CSG_MetaData * | Add_Child (const CSG_String &Name, sLong Content)
CSG_MetaData * | Add_Child (const CSG_MetaData &MetaData, bool bAddChildren=true)
CSG_MetaData * | Ins_Child (int Position)
CSG_MetaData * | Ins_Child (const CSG_String &Name, int Position)
CSG_MetaData * | Ins_Child (const CSG_String &Name, const CSG_String &Content, int Position)
CSG_MetaData * | Ins_Child (const CSG_String &Name, double Content, int Position)
CSG_MetaData * | Ins_Child (const CSG_String &Name, int Content, int Position)
CSG_MetaData * | Ins_Child (const CSG_String &Name, sLong Content, int Position)
CSG_MetaData * | Ins_Child (const CSG_MetaData &MetaData, int Position, bool bAddChildren=true)
bool | Mov_Child (int from_Index, int to_Index)
bool | Del_Child (int Index)
bool | Del_Child (const CSG_String &Name)
bool | Add_Children (const CSG_MetaData &MetaData)
bool | Del_Children (int Depth=0, const SG_Char *Name=NULL)
CSG_MetaData * | operator() (int Index) const
CSG_MetaData * | operator() (const CSG_String &Name) const
const CSG_MetaData & | operator[] (int Index) const
const CSG_MetaData & | operator[] (const CSG_String &Name) const
int | Get_Property_Count (void) const
const CSG_String & | Get_Property_Name (int i) const
const SG_Char * | Get_Property (int i) const
const SG_Char * | Get_Property (const CSG_String &Name) const
bool | Get_Property (const CSG_String &Name, CSG_String &Value) const
bool | Get_Property (const CSG_String &Name, double &Value) const
bool | Get_Property (const CSG_String &Name, int &Value) const
bool | Get_Property (const CSG_String &Name, sLong &Value) const
bool | Add_Property (const CSG_String &Name, const CSG_String &Value)
bool | Add_Property (const CSG_String &Name, double Value)
bool | Add_Property (const CSG_String &Name, int Value)
bool | Add_Property (const CSG_String &Name, sLong Value)
bool | Set_Property (const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
bool | Set_Property (const CSG_String &Name, double Value, bool bAddIfNotExists=true)
bool | Set_Property (const CSG_String &Name, int Value, bool bAddIfNotExists=true)
bool | Set_Property (const CSG_String &Name, sLong Value, bool bAddIfNotExists=true)
bool | Cmp_Property (const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
bool | Del_Property (const CSG_String &Name)
bool | Del_Property (int i)
CSG_String | asText (int Flags=0) const
class CSG_Table | Get_Table (int Flags=0) const

Friends

class CSG_HTTP

Detailed Description

Definition at line 87 of file metadata.h.

Constructor & Destructor Documentation

◆ CSG_MetaData() [1/4]

CSG_MetaData::CSG_MetaData ( void )

Definition at line 76 of file metadata.cpp.

Referenced by Ins_Child().

◆ CSG_MetaData() [2/4]

CSG_MetaData::CSG_MetaData ( const CSG_MetaData & MetaData )

Definition at line 87 of file metadata.cpp.

References Create().

◆ CSG_MetaData() [3/4]

CSG_MetaData::CSG_MetaData | ( | const CSG_String & | File,
 |  | const SG_Char * | Extension = NULL
 | ) |  |

Definition at line 100 of file metadata.cpp.

References Create().

◆ CSG_MetaData() [4/4]

CSG_MetaData::CSG_MetaData ( CSG_File & File )

Definition at line 113 of file metadata.cpp.

References Create().

◆ ~CSG_MetaData()

CSG_MetaData::~CSG_MetaData ( void )
virtual

Definition at line 142 of file metadata.cpp.

References Destroy().

Member Function Documentation

◆ Add_Child() [1/7]

CSG_MetaData * CSG_MetaData::Add_Child | ( | const CSG_MetaData & | MetaData,
 |  | bool | bAddChildren = true
 | ) |  |

Definition at line 204 of file metadata.cpp.

References Ins_Child().

◆ Add_Child() [2/7]

CSG_MetaData * CSG_MetaData::Add_Child ( const CSG_String & Name )

Definition at line 179 of file metadata.cpp.

References Ins_Child().

◆ Add_Child() [3/7]

CSG_MetaData * CSG_MetaData::Add_Child | ( | const CSG_String & | Name,
 |  | const CSG_String & | Content
 | ) |  |

Definition at line 184 of file metadata.cpp.

References Ins_Child().

◆ Add_Child() [4/7]

CSG_MetaData * CSG_MetaData::Add_Child | ( | const CSG_String & | Name,
 |  | double | Content
 | ) |  |

Definition at line 189 of file metadata.cpp.

References Ins_Child(), and SG_Get_String().

◆ Add_Child() [5/7]

CSG_MetaData * CSG_MetaData::Add_Child | ( | const CSG_String & | Name,
 |  | int | Content
 | ) |  |

Definition at line 194 of file metadata.cpp.

References CSG_String::Format(), Ins_Child(), and SG_T.

◆ Add_Child() [6/7]

CSG_MetaData * CSG_MetaData::Add_Child | ( | const CSG_String & | Name,
 |  | sLong | Content
 | ) |  |

Definition at line 199 of file metadata.cpp.

References CSG_String::Format(), Ins_Child(), and SG_T.

◆ Add_Child() [7/7]

CSG_MetaData * CSG_MetaData::Add_Child ( void )

Definition at line 174 of file metadata.cpp.

References Ins_Child().

Referenced by CSG_Parameter_Font::_Serialize(), CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Grid_System::_Serialize(), CSG_Parameter_List::_Serialize(), Add_Children(), CSG_Tool_Chain::Create(), CSG_TIN::Create(), CSG_Data_Object::CSG_Data_Object(), from_JSON(), CSG_Tool::Get_Summary(), CSG_Projection::is_Equal(), CSG_Data_Object::Load_MetaData(), CSG_Classifier_Supervised::Save(), CSG_Table::Save(), CSG_Projection::Save(), CSG_Data_Object::Save_MetaData(), CSG_Parameter::Serialize(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ Add_Children()

bool CSG_MetaData::Add_Children ( const CSG_MetaData & MetaData )

Definition at line 351 of file metadata.cpp.

References Add_Child(), and Get_Children_Count().

Referenced by Assign(), CSG_Grids::Create(), CSG_TIN::Create(), and CSG_Parameters::Set_History().

◆ Add_Property() [1/4]

bool CSG_MetaData::Add_Property | ( | const CSG_String & | Name,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 544 of file metadata.cpp.

References CSG_Strings::Add(), and CSG_String::is_Empty().

Referenced by CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Data_Object::_Serialize(), Add_Property(), Assign(), from_JSON(), CSG_Tool::Get_Summary(), CSG_Classifier_Supervised::Save(), CSG_Parameter::Serialize(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ Add_Property() [2/4]

bool CSG_MetaData::Add_Property | ( | const CSG_String & | Name,
 |  | double | Value
 | ) |  |

Definition at line 557 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Add_Property() [3/4]

bool CSG_MetaData::Add_Property | ( | const CSG_String & | Name,
 |  | int | Value
 | ) |  |

Definition at line 562 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Add_Property() [4/4]

bool CSG_MetaData::Add_Property | ( | const CSG_String & | Name,
 |  | sLong | Value
 | ) |  |

Definition at line 567 of file metadata.cpp.

References Add_Property(), CSG_String::Format(), and SG_T.

◆ Assign()

bool CSG_MetaData::Assign | ( | const CSG_MetaData & | MetaData,
 |  | bool | bAddChildren = true
 | ) |  |

Definition at line 761 of file metadata.cpp.

References Add_Children(), Add_Property(), Destroy(), Get_Content(), Get_Name(), Get_Property(), Get_Property_Count(), Get_Property_Name(), Set_Content(), and Set_Name().

Referenced by Create(), CSG_Tool::DataObject_Set_History(), Ins_Child(), and CSG_Data_Object::Load_MetaData().

◆ asText()

CSG_String CSG_MetaData::asText ( int Flags = 0 ) const

Definition at line 700 of file metadata.cpp.

References CSG_String::AfterFirst(), Get_Child(), Get_Children_Count(), Get_Content(), and Get_Name().

Referenced by CSG_Tool::Get_Summary().

◆ Cmp_Content()

bool CSG_MetaData::Cmp_Content | ( | const CSG_String & | String,
 |  | bool | bNoCase = false
 | ) |  | const

Definition at line 533 of file metadata.cpp.

References CSG_String::Cmp(), and CSG_String::CmpNoCase().

Referenced by CSG_Parameter_Bool::_Serialize(), CSG_Parameter_Data_Object::_Serialize(), and CSG_Projection::is_Equal().

◆ Cmp_Name()

bool CSG_MetaData::Cmp_Name | ( | const CSG_String & | String,
 |  | bool | bNoCase = true
 | ) |  | const

Definition at line 437 of file metadata.cpp.

References CSG_String::Cmp(), and CSG_String::CmpNoCase().

Referenced by CSG_Tool_Chain::Create(), CSG_Parameters::Load(), CSG_Classifier_Supervised::Load(), and CSG_Projections::WKT_to_Proj4().

◆ Cmp_Property()

bool CSG_MetaData::Cmp_Property | ( | const CSG_String & | Name,
 |  | const CSG_String & | String,
 |  | bool | bNoCase = false
 | ) |  | const

Definition at line 673 of file metadata.cpp.

References CSG_String::Cmp(), CSG_String::CmpNoCase(), and Get_Property().

Referenced by CSG_Tool_Chain::Create(), and CSG_Parameter::Serialize().

◆ Create() [1/4]

bool CSG_MetaData::Create ( const CSG_MetaData & MetaData )

Definition at line 94 of file metadata.cpp.

References Assign().

◆ Create() [2/4]

bool CSG_MetaData::Create | ( | const CSG_String & | File,
 |  | const SG_Char * | Extension = NULL
 | ) |  |

Definition at line 107 of file metadata.cpp.

References Load().

◆ Create() [3/4]

bool CSG_MetaData::Create ( CSG_File & File )

Definition at line 120 of file metadata.cpp.

References Load().

◆ Create() [4/4]

bool CSG_MetaData::Create ( void )

Definition at line 81 of file metadata.cpp.

Referenced by CSG_Grid::Create(), and CSG_MetaData().

◆ Del_Child() [1/2]

bool CSG_MetaData::Del_Child ( const CSG_String & Name )
inline

Definition at line 168 of file metadata.h.

References Del_Child().

Referenced by Del_Child().

◆ Del_Child() [2/2]

bool CSG_MetaData::Del_Child ( int Index )

Definition at line 329 of file metadata.cpp.

References CSG_Array::Dec_Array(), CSG_Array::Get_Array(), and Get_Children_Count().

Referenced by Del_Children(), CSG_Data_Object::Load_MetaData(), and CSG_Data_Object::Save_MetaData().

◆ Del_Children()

bool CSG_MetaData::Del_Children | ( | int | Depth = 0,
 |  | const SG_Char * | Name = NULL
 | ) |  |

Deletes children if depth level is reached, i.e. if depth level equals zero all children of the node will be deleted, if it is one only the grandchildren will be affected, and so on. If Name is a valid string, only those children are taken into account that have this name.

Definition at line 373 of file metadata.cpp.

References Del_Child(), Del_Children(), CSG_Array::Destroy(), Get_Child(), Get_Children_Count(), and Get_Name().

Referenced by CSG_Grids::Create(), Del_Children(), CSG_Table::Save(), and CSG_Projection::Save().

◆ Del_Property() [1/2]

bool CSG_MetaData::Del_Property ( const CSG_String & Name )

Definition at line 573 of file metadata.cpp.

References CSG_String::CmpNoCase(), Get_Property_Count(), and Get_Property_Name().

◆ Del_Property() [2/2]

bool CSG_MetaData::Del_Property ( int i )

Definition at line 586 of file metadata.cpp.

References CSG_Strings::Del(), and Get_Property_Count().

◆ Destroy()

void CSG_MetaData::Destroy ( void )

Definition at line 148 of file metadata.cpp.

References CSG_Strings::Clear(), CSG_Array::Destroy(), CSG_Array::Get_Array(), and Get_Children_Count().

Referenced by Assign(), CSG_Grid::Assign(), CSG_Data_Object::Delete(), CSG_Data_Object::Destroy(), CSG_Tool::Destroy(), CSG_Tool::Execute(), from_JSON(), from_XML(), Load(), Load_HTTP(), CSG_Data_Object::Load_MetaData(), CSG_HTTP::Request(), CSG_Parameters::Save(), CSG_Projections::WKT_to_MetaData(), and ~CSG_MetaData().

◆ Fmt_Content() [1/2]

void CSG_MetaData::Fmt_Content | ( | const char * | Format,
 |  |  | ...
 | ) |  |

Definition at line 491 of file metadata.cpp.

Referenced by CSG_Parameter_Double::_Serialize(), CSG_Parameter_Range::_Serialize(), and CSG_Parameter_Color::_Serialize().

◆ Fmt_Content() [2/2]

void CSG_MetaData::Fmt_Content | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |

Definition at line 512 of file metadata.cpp.

◆ from_JSON()

bool CSG_MetaData::from_JSON ( const CSG_String & JSON )

Definition at line 1101 of file metadata.cpp.

References Add_Child(), Add_Property(), CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_String::c_str(), Destroy(), CSG_String::Find(), CSG_String::Format(), Get_Children_Count(), Get_Parent(), Get_Property(), CSG_String::is_Empty(), Set_Name(), and SG_Char.

Referenced by Load_JSON().

◆ from_WKT()

bool CSG_MetaData::from_WKT ( const CSG_String & WKT )

Definition at line 1065 of file metadata.cpp.

◆ from_XML()

bool CSG_MetaData::from_XML ( const CSG_String & XML )

Definition at line 955 of file metadata.cpp.

References CSG_String::b_str(), Destroy(), and CSG_String::Length().

◆ Get_Child() [1/2]

CSG_MetaData* CSG_MetaData::Get_Child ( const CSG_String & Name ) const
inline

Definition at line 151 of file metadata.h.

References Get_Child().

Referenced by Get_Child().

◆ Get_Child() [2/2]

CSG_MetaData* CSG_MetaData::Get_Child ( int Index ) const
inline

Definition at line 150 of file metadata.h.

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), asText(), CSG_Tool::DataObject_Set_History(), Del_Children(), Get_Table(), CSG_Projection::Load(), CSG_Classifier_Supervised::Load(), CSG_Table::Load(), CSG_Table::Save(), and CSG_Projections::WKT_to_MetaData().

◆ Get_Children_Count()

int CSG_MetaData::Get_Children_Count ( void ) const
inline

Definition at line 149 of file metadata.h.

Referenced by CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_List::_Serialize(), Add_Children(), asText(), CSG_Tool_Chain::Create(), Del_Child(), Del_Children(), Destroy(), from_JSON(), Get_Table(), Ins_Child(), CSG_Projection::is_Equal(), CSG_Parameters::Load(), CSG_Classifier_Supervised::Load(), CSG_Table::Load(), Mov_Child(), CSG_Parameters::Set_History(), CSG_Projections::WKT_to_MetaData(), and CSG_Projections::WKT_to_Proj4().

◆ Get_Content() [1/7]

const SG_Char* CSG_MetaData::Get_Content ( const CSG_String & Name ) const
inline

Definition at line 137 of file metadata.h.

References Get_Content().

Referenced by Get_Content().

◆ Get_Content() [2/7]

bool CSG_MetaData::Get_Content | ( | const CSG_String & | Name,
 |  | CSG_String & | Value
 | ) |  | const

Definition at line 448 of file metadata.cpp.

References CSG_String::c_str(), Get_Content(), CSG_String::is_Empty(), and SG_Char.

◆ Get_Content() [3/7]

bool CSG_MetaData::Get_Content | ( | const CSG_String & | Name,
 |  | double & | Value
 | ) |  | const

Definition at line 463 of file metadata.cpp.

References CSG_String::asDouble(), and Get_Content().

◆ Get_Content() [4/7]

bool CSG_MetaData::Get_Content | ( | const CSG_String & | Name,
 |  | int & | Value
 | ) |  | const

Definition at line 471 of file metadata.cpp.

References CSG_String::asInt(), and Get_Content().

◆ Get_Content() [5/7]

bool CSG_MetaData::Get_Content | ( | const CSG_String & | Name,
 |  | sLong & | Value
 | ) |  | const

Definition at line 479 of file metadata.cpp.

References CSG_String::asLongLong(), and Get_Content().

◆ Get_Content() [6/7]

const SG_Char* CSG_MetaData::Get_Content ( int Index ) const
inline

Definition at line 136 of file metadata.h.

References Get_Content().

Referenced by Get_Content().

◆ Get_Content() [7/7]

const CSG_String& CSG_MetaData::Get_Content ( void ) const
inline

Definition at line 135 of file metadata.h.

Referenced by CSG_Parameter_Int::_Serialize(), CSG_Parameter_Double::_Serialize(), CSG_Parameter_Date::_Serialize(), CSG_Parameter_Range::_Serialize(), CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Choices::_Serialize(), CSG_Parameter_String::_Serialize(), CSG_Parameter_Color::_Serialize(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Grid_System::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameter_Table_Fields::_Serialize(), CSG_Parameter_Data_Object::_Serialize(), CSG_Parameter_List::_Serialize(), Assign(), asText(), CSG_Tool_Chain::Create(), Get_Content(), Get_Table(), CSG_Projection::Load(), CSG_Classifier_Supervised::Load(), CSG_Table::Load(), and CSG_Projections::WKT_to_Proj4().

◆ Get_Name()

const CSG_String& CSG_MetaData::Get_Name ( void ) const
inline

Definition at line 132 of file metadata.h.

Referenced by Assign(), CSG_Projection::Assign(), asText(), Del_Children(), CSG_Projections::Get_Projection(), Get_Table(), CSG_Projection::is_Equal(), Save(), and to_XML().

◆ Get_Parent()

CSG_MetaData* CSG_MetaData::Get_Parent ( void ) const
inline

Definition at line 147 of file metadata.h.

Referenced by from_JSON().

◆ Get_Property() [1/6]

const SG_Char* CSG_MetaData::Get_Property ( const CSG_String & Name ) const
inline

Definition at line 182 of file metadata.h.

References Get_Property().

Referenced by Get_Property().

◆ Get_Property() [2/6]

bool CSG_MetaData::Get_Property | ( | const CSG_String & | Name,
 |  | CSG_String & | Value
 | ) |  | const

Definition at line 637 of file metadata.cpp.

References Get_Property(), and SG_Char.

◆ Get_Property() [3/6]

bool CSG_MetaData::Get_Property | ( | const CSG_String & | Name,
 |  | double & | Value
 | ) |  | const

Definition at line 651 of file metadata.cpp.

References CSG_String::asDouble(), and Get_Property().

◆ Get_Property() [4/6]

bool CSG_MetaData::Get_Property | ( | const CSG_String & | Name,
 |  | int & | Value
 | ) |  | const

Definition at line 658 of file metadata.cpp.

References CSG_String::asInt(), and Get_Property().

◆ Get_Property() [5/6]

bool CSG_MetaData::Get_Property | ( | const CSG_String & | Name,
 |  | sLong & | Value
 | ) |  | const

Definition at line 665 of file metadata.cpp.

References CSG_String::asLongLong(), and Get_Property().

◆ Get_Property() [6/6]

const SG_Char* CSG_MetaData::Get_Property ( int i ) const
inline

Definition at line 181 of file metadata.h.

Referenced by CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameter_Data_Object::_Serialize(), Assign(), CSG_Projection::Assign(), Cmp_Property(), CSG_Tool_Chain::Create(), from_JSON(), CSG_Projections::Get_Projection(), Get_Property(), CSG_Parameters::Load(), CSG_Classifier_Supervised::Load(), and CSG_Projections::WKT_to_Proj4().

◆ Get_Property_Count()

int CSG_MetaData::Get_Property_Count ( void ) const
inline

Definition at line 179 of file metadata.h.

Referenced by Assign(), and Del_Property().

◆ Get_Property_Name()

const CSG_String& CSG_MetaData::Get_Property_Name ( int i ) const
inline

Definition at line 180 of file metadata.h.

Referenced by Assign(), and Del_Property().

◆ Get_Table()

CSG_Table CSG_MetaData::Get_Table ( int Flags = 0 ) const

Definition at line 737 of file metadata.cpp.

References CSG_Table::Add_Field(), CSG_Table::Add_Record(), Get_Child(), Get_Children_Count(), Get_Content(), Get_Name(), CSG_Table_Record::Set_Value(), and SG_DATATYPE_String.

◆ Ins_Child() [1/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_MetaData & | MetaData,
 |  | int | Position,
 |  | bool | bAddChildren = true
 | ) |  |

Definition at line 271 of file metadata.cpp.

References Assign(), and Ins_Child().

◆ Ins_Child() [2/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_String & | Name,
 |  | const CSG_String & | Content,
 |  | int | Position
 | ) |  |

Definition at line 238 of file metadata.cpp.

References Ins_Child().

◆ Ins_Child() [3/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_String & | Name,
 |  | double | Content,
 |  | int | Position
 | ) |  |

Definition at line 256 of file metadata.cpp.

References Ins_Child(), and SG_Get_String().

◆ Ins_Child() [4/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_String & | Name,
 |  | int | Content,
 |  | int | Position
 | ) |  |

Definition at line 261 of file metadata.cpp.

References CSG_String::Format(), Ins_Child(), and SG_T.

◆ Ins_Child() [5/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_String & | Name,
 |  | int | Position
 | ) |  |

Definition at line 251 of file metadata.cpp.

References Ins_Child().

◆ Ins_Child() [6/7]

CSG_MetaData * CSG_MetaData::Ins_Child | ( | const CSG_String & | Name,
 |  | sLong | Content,
 |  | int | Position
 | ) |  |

Definition at line 266 of file metadata.cpp.

References CSG_String::Format(), Ins_Child(), and SG_T.

◆ Ins_Child() [7/7]

CSG_MetaData * CSG_MetaData::Ins_Child ( int Position )

Definition at line 215 of file metadata.cpp.

References CSG_MetaData(), CSG_Array::Get_Array(), Get_Children_Count(), and CSG_Array::Inc_Array().

Referenced by Add_Child(), and Ins_Child().

◆ Load() [1/2]

bool CSG_MetaData::Load | ( | const CSG_String & | File,
 |  | const SG_Char * | Extension = NULL
 | ) |  |

Definition at line 790 of file metadata.cpp.

References CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_String::c_str(), Destroy(), CSG_String::Find(), CSG_String::Length(), Load_HTTP(), Load_JSON(), CSG_String::Right(), SG_File_Cmp_Extension(), SG_File_Exists(), and SG_File_Make_Path().

Referenced by CSG_Tool_Chain::Create(), Create(), CSG_PointCloud::Get_Header_Content(), CSG_Classifier_Supervised::Load(), CSG_Parameters::Load(), and CSG_Data_Object::Load_MetaData().

◆ Load() [2/2]

bool CSG_MetaData::Load ( CSG_File & Stream )

Definition at line 831 of file metadata.cpp.

References Destroy(), CSG_File::Get_Stream(), and CSG_File::is_Reading().

◆ Load_HTTP()

bool CSG_MetaData::Load_HTTP | ( | const CSG_String & | Server,
 |  | const CSG_String & | Path,
 |  | const SG_Char * | Username = NULL,
 |  | const SG_Char * | Password = NULL
 | ) |  |

Definition at line 1006 of file metadata.cpp.

References CSG_String::c_str(), and Destroy().

Referenced by Load().

◆ Load_JSON()

bool CSG_MetaData::Load_JSON ( const CSG_String & File )

Definition at line 1082 of file metadata.cpp.

References from_JSON(), CSG_File::Length(), CSG_File::Open(), CSG_File::Read(), and SG_FILE_R.

Referenced by Load().

◆ Mov_Child()

bool CSG_MetaData::Mov_Child | ( | int | from_Index,
 |  | int | to_Index
 | ) |  |

Definition at line 289 of file metadata.cpp.

References CSG_Array::Get_Array(), and Get_Children_Count().

◆ operator()() [1/2]

CSG_MetaData* CSG_MetaData::operator() ( const CSG_String & Name ) const
inline

Definition at line 174 of file metadata.h.

◆ operator()() [2/2]

CSG_MetaData* CSG_MetaData::operator() ( int Index ) const
inline

Definition at line 173 of file metadata.h.

◆ operator+=()

CSG_MetaData& CSG_MetaData::operator+= ( const CSG_MetaData & MetaData )
inline

Definition at line 130 of file metadata.h.

◆ operator=()

CSG_MetaData& CSG_MetaData::operator= ( const CSG_MetaData & MetaData )
inline

Definition at line 129 of file metadata.h.

◆ operator[]() [1/2]

const CSG_MetaData& CSG_MetaData::operator[] ( const CSG_String & Name ) const
inline

Definition at line 177 of file metadata.h.

◆ operator[]() [2/2]

const CSG_MetaData& CSG_MetaData::operator[] ( int Index ) const
inline

Definition at line 176 of file metadata.h.

◆ Save() [1/2]

bool CSG_MetaData::Save | ( | const CSG_String & | File,
 |  | const SG_Char * | Extension = NULL
 | ) |  | const

Definition at line 883 of file metadata.cpp.

References Get_Name(), and SG_File_Make_Path().

Referenced by CSG_Parameters::Save(), CSG_Classifier_Supervised::Save(), CSG_PointCloud::Save(), and CSG_Data_Object::Save_MetaData().

◆ Save() [2/2]

bool CSG_MetaData::Save ( CSG_File & Stream ) const

Definition at line 902 of file metadata.cpp.

References Get_Name(), CSG_File::Get_Stream(), and CSG_File::is_Writing().

◆ Save_JSON()

bool CSG_MetaData::Save_JSON ( const CSG_String & File ) const

Definition at line 1095 of file metadata.cpp.

◆ Set_Content()

void CSG_MetaData::Set_Content ( const CSG_String & Content )
inline

Definition at line 142 of file metadata.h.

Referenced by CSG_Parameter_Bool::_Serialize(), CSG_Parameter_Int::_Serialize(), CSG_Parameter_Date::_Serialize(), CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Choices::_Serialize(), CSG_Parameter_String::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameter_Table_Fields::_Serialize(), CSG_Parameter_Data_Object::_Serialize(), CSG_Parameter::_Serialize(), Assign(), CSG_Tool::DataObject_Set_History(), and CSG_Data_Object::Save_MetaData().

◆ Set_Name()

void CSG_MetaData::Set_Name ( const CSG_String & Name )
inline

Definition at line 133 of file metadata.h.

Referenced by Assign(), CSG_Data_Object::CSG_Data_Object(), from_JSON(), CSG_Tool::Get_Summary(), CSG_Classifier_Supervised::Save(), CSG_Parameters::Save(), and CSG_Parameters::Set_History().

◆ Set_Property() [1/4]

bool CSG_MetaData::Set_Property | ( | const CSG_String & | Name,
 |  | const CSG_String & | Value,
 |  | bool | bAddIfNotExists = true
 | ) |  |

Definition at line 600 of file metadata.cpp.

References CSG_Strings::Add().

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameter_Parameters::_Serialize(), CSG_Tool::DataObject_Set_History(), CSG_Parameters::Save(), and Set_Property().

◆ Set_Property() [2/4]

bool CSG_MetaData::Set_Property | ( | const CSG_String & | Name,
 |  | double | Value,
 |  | bool | bAddIfNotExists = true
 | ) |  |

Definition at line 621 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ Set_Property() [3/4]

bool CSG_MetaData::Set_Property | ( | const CSG_String & | Name,
 |  | int | Value,
 |  | bool | bAddIfNotExists = true
 | ) |  |

Definition at line 626 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ Set_Property() [4/4]

bool CSG_MetaData::Set_Property | ( | const CSG_String & | Name,
 |  | sLong | Value,
 |  | bool | bAddIfNotExists = true
 | ) |  |

Definition at line 631 of file metadata.cpp.

References CSG_String::Format(), Set_Property(), and SG_T.

◆ to_JSON()

bool CSG_MetaData::to_JSON ( CSG_String & JSON ) const

Definition at line 1188 of file metadata.cpp.

◆ to_WKT()

bool CSG_MetaData::to_WKT ( CSG_String & WKT ) const

Definition at line 1071 of file metadata.cpp.

◆ to_XML()

bool CSG_MetaData::to_XML ( CSG_String & XML ) const

Definition at line 974 of file metadata.cpp.

References CSG_Array::Get_Array(), Get_Name(), and CSG_Array::Get_Size().

Friends And Related Function Documentation

◆ CSG_HTTP

friend class CSG_HTTP
friend

Definition at line 89 of file metadata.h.

The documentation for this class was generated from the following files:
  • metadata.h
  • metadata.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_MetaData Member List

This is the complete list of members for CSG_MetaData, including all inherited members.

Add_Child(void) | CSG_MetaData |
Add_Child(const CSG_String &Name) | CSG_MetaData |
Add_Child(const CSG_String &Name, const CSG_String &Content) | CSG_MetaData |
Add_Child(const CSG_String &Name, double Content) | CSG_MetaData |
Add_Child(const CSG_String &Name, int Content) | CSG_MetaData |
Add_Child(const CSG_String &Name, sLong Content) | CSG_MetaData |
Add_Child(const CSG_MetaData &MetaData, bool bAddChildren=true) | CSG_MetaData |
Add_Children(const CSG_MetaData &MetaData) | CSG_MetaData |
Add_Property(const CSG_String &Name, const CSG_String &Value) | CSG_MetaData |
Add_Property(const CSG_String &Name, double Value) | CSG_MetaData |
Add_Property(const CSG_String &Name, int Value) | CSG_MetaData |
Add_Property(const CSG_String &Name, sLong Value) | CSG_MetaData |
Assign(const CSG_MetaData &MetaData, bool bAddChildren=true) | CSG_MetaData |
asText(int Flags=0) const | CSG_MetaData |
Cmp_Content(const CSG_String &String, bool bNoCase=false) const | CSG_MetaData |
Cmp_Name(const CSG_String &String, bool bNoCase=true) const | CSG_MetaData |
Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const | CSG_MetaData |
Create(void) | CSG_MetaData |
Create(const CSG_MetaData &MetaData) | CSG_MetaData |
Create(const CSG_String &File, const SG_Char *Extension=NULL) | CSG_MetaData |
Create(CSG_File &File) | CSG_MetaData |
CSG_HTTP class | CSG_MetaData | friend
CSG_MetaData(void) | CSG_MetaData |
CSG_MetaData(const CSG_MetaData &MetaData) | CSG_MetaData |
CSG_MetaData(const CSG_String &File, const SG_Char *Extension=NULL) | CSG_MetaData |
CSG_MetaData(CSG_File &File) | CSG_MetaData |
Del_Child(int Index) | CSG_MetaData |
Del_Child(const CSG_String &Name) | CSG_MetaData | inline
Del_Children(int Depth=0, const SG_Char *Name=NULL) | CSG_MetaData |
Del_Property(const CSG_String &Name) | CSG_MetaData |
Del_Property(int i) | CSG_MetaData |
Destroy(void) | CSG_MetaData |
Fmt_Content(const char *Format,...) | CSG_MetaData |
Fmt_Content(const wchar_t *Format,...) | CSG_MetaData |
from_JSON(const CSG_String &JSON) | CSG_MetaData |
from_WKT(const CSG_String &WKT) | CSG_MetaData |
from_XML(const CSG_String &XML) | CSG_MetaData |
Get_Child(int Index) const | CSG_MetaData | inline
Get_Child(const CSG_String &Name) const | CSG_MetaData | inline
Get_Children_Count(void) const | CSG_MetaData | inline
Get_Content(void) const | CSG_MetaData | inline
Get_Content(int Index) const | CSG_MetaData | inline
Get_Content(const CSG_String &Name) const | CSG_MetaData | inline
Get_Content(const CSG_String &Name, CSG_String &Value) const | CSG_MetaData |
Get_Content(const CSG_String &Name, double &Value) const | CSG_MetaData |
Get_Content(const CSG_String &Name, int &Value) const | CSG_MetaData |
Get_Content(const CSG_String &Name, sLong &Value) const | CSG_MetaData |
Get_Name(void) const | CSG_MetaData | inline
Get_Parent(void) const | CSG_MetaData | inline
Get_Property(int i) const | CSG_MetaData | inline
Get_Property(const CSG_String &Name) const | CSG_MetaData | inline
Get_Property(const CSG_String &Name, CSG_String &Value) const | CSG_MetaData |
Get_Property(const CSG_String &Name, double &Value) const | CSG_MetaData |
Get_Property(const CSG_String &Name, int &Value) const | CSG_MetaData |
Get_Property(const CSG_String &Name, sLong &Value) const | CSG_MetaData |
Get_Property_Count(void) const | CSG_MetaData | inline
Get_Property_Name(int i) const | CSG_MetaData | inline
Get_Table(int Flags=0) const | CSG_MetaData |
Ins_Child(int Position) | CSG_MetaData |
Ins_Child(const CSG_String &Name, int Position) | CSG_MetaData |
Ins_Child(const CSG_String &Name, const CSG_String &Content, int Position) | CSG_MetaData |
Ins_Child(const CSG_String &Name, double Content, int Position) | CSG_MetaData |
Ins_Child(const CSG_String &Name, int Content, int Position) | CSG_MetaData |
Ins_Child(const CSG_String &Name, sLong Content, int Position) | CSG_MetaData |
Ins_Child(const CSG_MetaData &MetaData, int Position, bool bAddChildren=true) | CSG_MetaData |
Load(const CSG_String &File, const SG_Char *Extension=NULL) | CSG_MetaData |
Load(CSG_File &Stream) | CSG_MetaData |
Load_HTTP(const CSG_String &Server, const CSG_String &Path, const SG_Char *Username=NULL, const SG_Char *Password=NULL) | CSG_MetaData |
Load_JSON(const CSG_String &File) | CSG_MetaData |
Mov_Child(int from_Index, int to_Index) | CSG_MetaData |
operator()(int Index) const | CSG_MetaData | inline
operator()(const CSG_String &Name) const | CSG_MetaData | inline
operator+=(const CSG_MetaData &MetaData) | CSG_MetaData | inline
operator=(const CSG_MetaData &MetaData) | CSG_MetaData | inline
operator[](int Index) const | CSG_MetaData | inline
operator[](const CSG_String &Name) const | CSG_MetaData | inline
Save(const CSG_String &File, const SG_Char *Extension=NULL) const | CSG_MetaData |
Save(CSG_File &Stream) const | CSG_MetaData |
Save_JSON(const CSG_String &File) const | CSG_MetaData |
Set_Content(const CSG_String &Content) | CSG_MetaData | inline
Set_Name(const CSG_String &Name) | CSG_MetaData | inline
Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true) | CSG_MetaData |
Set_Property(const CSG_String &Name, double Value, bool bAddIfNotExists=true) | CSG_MetaData |
Set_Property(const CSG_String &Name, int Value, bool bAddIfNotExists=true) | CSG_MetaData |
Set_Property(const CSG_String &Name, sLong Value, bool bAddIfNotExists=true) | CSG_MetaData |
to_JSON(CSG_String &JSON) const | CSG_MetaData |
to_WKT(CSG_String &WKT) const | CSG_MetaData |
to_XML(CSG_String &XML) const | CSG_MetaData |
~CSG_MetaData(void) | CSG_MetaData | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Natural_Breaks Class Reference

Public Member Functions | List of all members
CSG_Natural_Breaks Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Natural_Breaks (void)
virtual | ~CSG_Natural_Breaks (void)
CSG_Natural_Breaks (class CSG_Table *pTable, int Field, int nClasses, int Histogram=0)
bool | Create (class CSG_Table *pTable, int Field, int nClasses, int Histogram=0)
CSG_Natural_Breaks (class CSG_Grid *pGrid, int nClasses, int Histogram=0)
bool | Create (class CSG_Grid *pGrid, int nClasses, int Histogram=0)
CSG_Natural_Breaks (class CSG_Grids *pGrids, int nClasses, int Histogram=0)
bool | Create (class CSG_Grids *pGrids, int nClasses, int Histogram=0)
CSG_Natural_Breaks (const CSG_Vector &Values, int nClasses, int Histogram=0)
bool | Create (const CSG_Vector &Values, int nClasses, int Histogram=0)
int | Get_Count (void) const
double | Get_Break (int i) const
double | operator[] (int i) const

Detailed Description

Definition at line 1079 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Natural_Breaks() [1/5]

CSG_Natural_Breaks::CSG_Natural_Breaks ( void )

Definition at line 1710 of file mat_tools.cpp.

◆ ~CSG_Natural_Breaks()

CSG_Natural_Breaks::~CSG_Natural_Breaks ( void )
virtual

Definition at line 1714 of file mat_tools.cpp.

◆ CSG_Natural_Breaks() [2/5]

CSG_Natural_Breaks::CSG_Natural_Breaks | ( | class CSG_Table * | pTable,
 |  | int | Field,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1718 of file mat_tools.cpp.

References Create().

◆ CSG_Natural_Breaks() [3/5]

CSG_Natural_Breaks::CSG_Natural_Breaks | ( | class CSG_Grid * | pGrid,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1724 of file mat_tools.cpp.

References Create().

◆ CSG_Natural_Breaks() [4/5]

CSG_Natural_Breaks::CSG_Natural_Breaks | ( | class CSG_Grids * | pGrids,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1730 of file mat_tools.cpp.

References Create().

◆ CSG_Natural_Breaks() [5/5]

CSG_Natural_Breaks::CSG_Natural_Breaks | ( | const CSG_Vector & | Values,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1736 of file mat_tools.cpp.

References Create().

Member Function Documentation

◆ Create() [1/4]

bool CSG_Natural_Breaks::Create | ( | class CSG_Grid * | pGrid,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1776 of file mat_tools.cpp.

References CSG_Vector::Add_Row(), CSG_Grid::asDouble(), CSG_Histogram::Create(), CSG_Vector::Destroy(), CSG_Grid::Get_NCells(), CSG_Grid::is_NoData(), and CSG_Vector::Sort().

◆ Create() [2/4]

bool CSG_Natural_Breaks::Create | ( | class CSG_Grids * | pGrids,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1803 of file mat_tools.cpp.

References CSG_Vector::Add_Row(), CSG_Grids::asDouble(), CSG_Histogram::Create(), CSG_Vector::Destroy(), CSG_Grids::Get_NCells(), CSG_Grids::is_NoData(), and CSG_Vector::Sort().

◆ Create() [3/4]

bool CSG_Natural_Breaks::Create | ( | class CSG_Table * | pTable,
 |  | int | Field,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1747 of file mat_tools.cpp.

References CSG_Vector::Add_Row(), CSG_Table_Record::asDouble(), CSG_Histogram::Create(), CSG_Vector::Destroy(), CSG_Table::Get_Count(), CSG_Table::Get_Record(), CSG_Table_Record::is_NoData(), and CSG_Vector::Sort().

Referenced by CSG_Natural_Breaks().

◆ Create() [4/4]

bool CSG_Natural_Breaks::Create | ( | const CSG_Vector & | Values,
 |  | int | nClasses,
 |  | int | Histogram = 0
 | ) |  |

Definition at line 1830 of file mat_tools.cpp.

References CSG_Histogram::Create(), CSG_Vector::Create(), CSG_Vector::Destroy(), and CSG_Vector::Sort().

◆ Get_Break()

double CSG_Natural_Breaks::Get_Break ( int i ) const
inline

Definition at line 1098 of file mat_tools.h.

◆ Get_Count()

int CSG_Natural_Breaks::Get_Count ( void ) const
inline

Definition at line 1097 of file mat_tools.h.

◆ operator[]()

double CSG_Natural_Breaks::operator[] ( int i ) const
inline

Definition at line 1100 of file mat_tools.h.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Natural_Breaks Member List

This is the complete list of members for CSG_Natural_Breaks, including all inherited members.

Create(class CSG_Table *pTable, int Field, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
Create(class CSG_Grid *pGrid, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
Create(class CSG_Grids *pGrids, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
Create(const CSG_Vector &Values, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
CSG_Natural_Breaks(void) | CSG_Natural_Breaks |
CSG_Natural_Breaks(class CSG_Table *pTable, int Field, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
CSG_Natural_Breaks(class CSG_Grid *pGrid, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
CSG_Natural_Breaks(class CSG_Grids *pGrids, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
CSG_Natural_Breaks(const CSG_Vector &Values, int nClasses, int Histogram=0) | CSG_Natural_Breaks |
Get_Break(int i) const | CSG_Natural_Breaks | inline
Get_Count(void) const | CSG_Natural_Breaks | inline
operator[](int i) const | CSG_Natural_Breaks | inline
~CSG_Natural_Breaks(void) | CSG_Natural_Breaks | virtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter Class Referenceabstract

#include <parameters.h>

Inheritance diagram for CSG_Parameter:
CSG_Parameter_Bool CSG_Parameter_Choice CSG_Parameter_Choices CSG_Parameter_Colors CSG_Parameter_Data_Object CSG_Parameter_Date CSG_Parameter_Fixed_Table CSG_Parameter_Font CSG_Parameter_Grid_System CSG_Parameter_List CSG_Parameter_Node CSG_Parameter_Parameters CSG_Parameter_Range CSG_Parameter_String CSG_Parameter_Table_Fields CSG_Parameter_Value

Public Member Functions

CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
virtual TSG_Parameter_Type | Get_Type (void) const =0
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Attributes

CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 206 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter()

CSG_Parameter::CSG_Parameter | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 63 of file parameter.cpp.

◆ ~CSG_Parameter()

CSG_Parameter::~CSG_Parameter ( void )
protectedvirtual

Definition at line 85 of file parameter.cpp.

References SG_Free().

Member Function Documentation

◆ _asDouble()

double CSG_Parameter::_asDouble ( void ) const
protectedvirtual

Reimplemented in CSG_Parameter_Grid, CSG_Parameter_Table_Field, CSG_Parameter_Choice, CSG_Parameter_Date, CSG_Parameter_Double, and CSG_Parameter_Int.

Definition at line 961 of file parameter.cpp.

◆ _asInt()

int CSG_Parameter::_asInt ( void ) const
protectedvirtual

Reimplemented in CSG_Parameter_List, CSG_Parameter_Grid, CSG_Parameter_Table_Fields, CSG_Parameter_Colors, CSG_Parameter_Font, CSG_Parameter_Choice, CSG_Parameter_Date, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 960 of file parameter.cpp.

◆ _asPointer()

void * CSG_Parameter::_asPointer ( void ) const
protectedvirtual

Reimplemented in CSG_Parameter_Parameters, CSG_Parameter_List, CSG_Parameter_Data_Object, CSG_Parameter_Table_Fields, CSG_Parameter_Grid_System, CSG_Parameter_Fixed_Table, CSG_Parameter_Colors, and CSG_Parameter_Font.

Definition at line 962 of file parameter.cpp.

◆ _Assign()

bool CSG_Parameter::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented in CSG_Parameter_Parameters, CSG_Parameter_Shapes_List, CSG_Parameter_List, CSG_Parameter_PointCloud, CSG_Parameter_Shapes, CSG_Parameter_Grid, CSG_Parameter_Data_Object, CSG_Parameter_Table_Fields, CSG_Parameter_Table_Field, CSG_Parameter_Grid_System, CSG_Parameter_Fixed_Table, CSG_Parameter_Colors, CSG_Parameter_Font, CSG_Parameter_File_Name, CSG_Parameter_String, CSG_Parameter_Choices, CSG_Parameter_Data_Type, CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Date, CSG_Parameter_Double, CSG_Parameter_Int, CSG_Parameter_Value, and CSG_Parameter_Bool.

Definition at line 1090 of file parameter.cpp.

Referenced by Assign().

◆ _asString()

const SG_Char * CSG_Parameter::_asString ( void ) const
protectedvirtual

Definition at line 963 of file parameter.cpp.

References m_String.

◆ _Serialize()

bool CSG_Parameter::_Serialize | ( | CSG_MetaData & | MetaData,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented in CSG_Parameter_Parameters, CSG_Parameter_List, CSG_Parameter_Data_Object, CSG_Parameter_Table_Fields, CSG_Parameter_Table_Field, CSG_Parameter_Grid_System, CSG_Parameter_Fixed_Table, CSG_Parameter_Colors, CSG_Parameter_Color, CSG_Parameter_Font, CSG_Parameter_String, CSG_Parameter_Choices, CSG_Parameter_Data_Type, CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Date, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 1132 of file parameter.cpp.

References CSG_MetaData::Set_Content().

Referenced by Serialize().

◆ _Set_String()

void CSG_Parameter::_Set_String ( void )
protectedvirtual

Reimplemented in CSG_Parameter_Parameters, CSG_Parameter_List, CSG_Parameter_Data_Object, CSG_Parameter_Table_Field, CSG_Parameter_Grid_System, CSG_Parameter_Fixed_Table, CSG_Parameter_Colors, CSG_Parameter_Choices, CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Date, CSG_Parameter_Degree, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 840 of file parameter.cpp.

Referenced by Assign(), Check(), CSG_Parameters::Get_String(), has_Changed(), and Serialize().

◆ _Set_Value() [1/4]

int CSG_Parameter::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented in CSG_Parameter_Table_Fields, CSG_Parameter_Table_Field, CSG_Parameter_Color, CSG_Parameter_Font, CSG_Parameter_String, CSG_Parameter_Choices, CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Date, CSG_Parameter_Degree, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 741 of file parameter.cpp.

References SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [2/4]

int CSG_Parameter::_Set_Value ( double Value )
protectedvirtual

Reimplemented in CSG_Parameter_Choice, CSG_Parameter_Date, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 740 of file parameter.cpp.

References SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [3/4]

int CSG_Parameter::_Set_Value ( int Value )
protectedvirtual

Reimplemented in CSG_Parameter_Table_Field, CSG_Parameter_Colors, CSG_Parameter_Font, CSG_Parameter_Choice, CSG_Parameter_Date, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 739 of file parameter.cpp.

References SG_PARAMETER_DATA_SET_FALSE.

Referenced by CSG_Parameter_Value::Set_Valid_Range(), and Set_Value().

◆ _Set_Value() [4/4]

int CSG_Parameter::_Set_Value ( void * Value )
protectedvirtual

Reimplemented in CSG_Parameter_PointCloud, CSG_Parameter_TIN, CSG_Parameter_Shapes, CSG_Parameter_Table, CSG_Parameter_Grid, CSG_Parameter_Data_Object_Output, CSG_Parameter_Data_Object, and CSG_Parameter_Grid_System.

Definition at line 742 of file parameter.cpp.

References SG_PARAMETER_DATA_SET_FALSE.

◆ asBool()

bool CSG_Parameter::asBool ( void ) const
inline

Definition at line 280 of file parameters.h.

Referenced by CSG_Parameter_Bool::_Assign(), is_Value_Equal(), SG_XML_Add_Parameter(), and CSG_Parameter_Bool::Toggle_Value().

◆ asChoice()

CSG_Parameter_Choice * CSG_Parameter::asChoice ( void ) const

Definition at line 1038 of file parameter.cpp.

References Get_Type(), PARAMETER_TYPE_Choice, and PARAMETER_TYPE_Data_Type.

Referenced by CSG_Parameter_Choice::_Assign(), CSG_Parameters::Add_Choice(), Get_Description(), is_Compatible(), and SG_XML_Add_Parameter().

◆ asChoices()

CSG_Parameter_Choices * CSG_Parameter::asChoices ( void ) const

Definition at line 1040 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Choices.

Referenced by CSG_Parameter_Choices::_Assign(), CSG_Parameters::Add_Choices(), Get_Description(), is_Compatible(), is_Value_Equal(), and SG_XML_Add_Parameter().

◆ asColor()

long CSG_Parameter::asColor ( void ) const
inline

Definition at line 282 of file parameters.h.

◆ asColors()

CSG_Colors * CSG_Parameter::asColors ( void ) const

Definition at line 966 of file parameter.cpp.

References asPointer(), Get_Type(), and PARAMETER_TYPE_Colors.

Referenced by CSG_Parameter_Colors::_Assign(), CSG_Parameters::Add_Colors(), is_Value_Equal(), and CSG_Parameters::Serialize_Compatibility().

◆ asDataObject()

CSG_Data_Object * CSG_Parameter::asDataObject ( void ) const

Definition at line 972 of file parameter.cpp.

References asPointer(), and is_DataObject().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), asGrid(), asGrids(), asPointCloud(), asShapes(), asTable(), asTIN(), Check(), CSG_Tool::DataObject_Set_History(), is_Value_Equal(), and CSG_Parameters::Set_History().

◆ asDataType()

CSG_Parameter_Data_Type * CSG_Parameter::asDataType ( void ) const

Definition at line 1037 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Data_Type.

Referenced by CSG_Parameters::Add_Data_Type().

◆ asDate()

CSG_Parameter_Date * CSG_Parameter::asDate ( void ) const

Definition at line 1036 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Date.

◆ asDouble()

double CSG_Parameter::asDouble ( void ) const
inline

Definition at line 283 of file parameters.h.

Referenced by CSG_Parameter_Table_Field::_asDouble(), CSG_Parameter_Grid::_asDouble(), CSG_Parameter_Date::_asInt(), CSG_Parameter_Double::_Assign(), CSG_Parameter_Degree::_Set_String(), CSG_Parameter_Date::_Set_Value(), CSG_Parameter_Range::Get_Max(), CSG_Parameter_Range::Get_Min(), CSG_Parameter_Double::is_Default(), is_Value_Equal(), CSG_Parameters_Grid_Target::On_Parameter_Changed(), CSG_Parameter_Value::Set_Valid_Range(), and SG_Get_Projected().

◆ asFilePath()

CSG_Parameter_File_Name * CSG_Parameter::asFilePath ( void ) const

Definition at line 1042 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_FilePath.

Referenced by CSG_Parameter_File_Name::_Assign(), and CSG_Parameters::Add_FilePath().

◆ asFont()

const SG_Char * CSG_Parameter::asFont ( void ) const

Definition at line 967 of file parameter.cpp.

References asPointer(), Get_Type(), PARAMETER_TYPE_Font, and SG_Char.

◆ asGrid()

CSG_Grid * CSG_Parameter::asGrid ( void ) const

Definition at line 973 of file parameter.cpp.

References asDataObject(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), and SG_DATAOBJECT_TYPE_Grid.

Referenced by CSG_Parameters_Grid_Target::Get_Grid().

◆ asGrid_System()

CSG_Grid_System * CSG_Parameter::asGrid_System ( void ) const

Definition at line 968 of file parameter.cpp.

References asPointer(), Get_Type(), and PARAMETER_TYPE_Grid_System.

Referenced by CSG_Parameters::Add_Grid_System(), Check(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters::Get_String(), CSG_Parameters_Grid_Target::Get_System(), CSG_Parameter_Grid::Get_System(), CSG_Parameter_Grid_List::Get_System(), CSG_Parameter_Grids_List::Get_System(), is_Value_Equal(), CSG_Parameters::Serialize_Compatibility(), CSG_Parameters::Set_Grid_System(), and CSG_Parameter_Grid_List::Update_Data().

◆ asGridList()

CSG_Parameter_Grid_List * CSG_Parameter::asGridList ( void ) const

Definition at line 1047 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Grid_List.

Referenced by CSG_Parameter_Grid::_Set_Value(), and CSG_Parameter_Grid_List::Add_Item().

◆ asGrids()

CSG_Grids * CSG_Parameter::asGrids ( void ) const

Definition at line 974 of file parameter.cpp.

References asDataObject(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), and SG_DATAOBJECT_TYPE_Grids.

Referenced by asTable(), and CSG_Parameters_Grid_Target::Get_Grids().

◆ asGridsList()

CSG_Parameter_Grids_List * CSG_Parameter::asGridsList ( void ) const

Definition at line 1048 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Grids_List.

Referenced by CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), and CSG_Parameter_Grids_List::Add_Item().

◆ asInt()

int CSG_Parameter::asInt ( void ) const
inline

Definition at line 281 of file parameters.h.

Referenced by CSG_Parameter_Grid::_asInt(), CSG_Parameter_Int::_Assign(), CSG_Parameter_Font::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameter_Bool::is_Default(), CSG_Parameter_Int::is_Default(), CSG_Parameter_Choice::is_Default(), is_Value_Equal(), CSG_Parameters_Point_Search::On_Parameters_Enable(), CSG_Parameters_Grid_Target::On_Parameters_Enable(), CSG_Parameter_Value::Set_Valid_Range(), Set_Value(), and CSG_Parameter_Choice::Toggle_Value().

◆ asList()

CSG_Parameter_List * CSG_Parameter::asList ( void ) const

Definition at line 1046 of file parameter.cpp.

References is_DataObject_List().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), Check(), CSG_Tool::DataObject_Set_History(), is_Value_Equal(), CSG_Parameters::Restore_Defaults(), CSG_Parameters::Serialize_Compatibility(), and CSG_Parameters::Set_History().

◆ asParameters()

CSG_Parameters * CSG_Parameter::asParameters ( void ) const

Definition at line 969 of file parameter.cpp.

References asPointer(), Get_Type(), and PARAMETER_TYPE_Parameters.

Referenced by CSG_Parameter_Parameters::_Assign(), CSG_Parameters::Add_Parameters(), Check(), Get_Description(), CSG_Parameters::Get_Parameter(), is_Compatible(), is_Value_Equal(), CSG_Parameters::Serialize_Compatibility(), CSG_Parameters::Set_Callback(), CSG_Parameters::Set_Callback_On_Parameter_Changed(), CSG_Parameters::Set_History(), CSG_Parameters::Set_Manager(), and SG_XML_Add_Parameter().

◆ asPointCloud()

CSG_PointCloud * CSG_Parameter::asPointCloud ( void ) const

Definition at line 976 of file parameter.cpp.

References asDataObject(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), and SG_DATAOBJECT_TYPE_PointCloud.

◆ asPointCloudList()

CSG_Parameter_PointCloud_List * CSG_Parameter::asPointCloudList ( void ) const

Definition at line 1052 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_PointCloud_List.

◆ asPointer()

void* CSG_Parameter::asPointer ( void ) const
inline

Definition at line 285 of file parameters.h.

Referenced by CSG_Parameter_Grid::_Assign(), asColors(), asDataObject(), asFont(), asGrid_System(), asParameters(), asTable(), CSG_Parameters_Grid_Target::Get_Grid(), and CSG_Parameters_Grid_Target::Get_Grids().

◆ asRange()

CSG_Parameter_Range * CSG_Parameter::asRange ( void ) const

Definition at line 1041 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Range.

Referenced by CSG_Parameter_Range::_Assign(), CSG_Parameters::Get_Parameter(), is_Value_Equal(), and CSG_Parameters::Serialize_Compatibility().

◆ asShapes()

CSG_Shapes * CSG_Parameter::asShapes ( void ) const

Definition at line 979 of file parameter.cpp.

References asDataObject(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

Referenced by CSG_Parameters_Point_Search::On_Parameter_Changed().

◆ asShapesList()

CSG_Parameter_Shapes_List * CSG_Parameter::asShapesList ( void ) const

Definition at line 1050 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Shapes_List.

◆ Assign()

bool CSG_Parameter::Assign ( CSG_Parameter * pSource )

Definition at line 1072 of file parameter.cpp.

References _Assign(), _Set_String(), and Get_Type().

Referenced by CSG_Parameter_Range::_Assign(), CSG_Parameters::Assign_Values(), CSG_Parameters::Set_Parameter(), and Set_Value().

◆ asString()

const SG_Char* CSG_Parameter::asString ( void ) const
inline

Definition at line 284 of file parameters.h.

References SG_Char.

Referenced by CSG_Parameter_Table_Fields::_Assign(), CSG_Parameter_Int::_Serialize(), CSG_Parameter_Date::_Serialize(), CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Choices::_Serialize(), CSG_Parameter_Table_Field::_Serialize(), CSG_Parameters::Get_String(), is_Default(), and is_Value_Equal().

◆ asTable()

CSG_Table * CSG_Parameter::asTable ( void ) const

Definition at line 994 of file parameter.cpp.

References asDataObject(), asGrids(), asPointer(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), Get_Type(), PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

Referenced by CSG_Parameter_Fixed_Table::_Assign(), CSG_Parameters::Add_FixedTable(), Get_Description(), CSG_Parameter_Table_Field::Get_Table(), CSG_Parameter_Table_Fields::Get_Table(), is_Compatible(), is_Value_Equal(), CSG_Parameters::Serialize_Compatibility(), and SG_XML_Add_Parameter().

◆ asTableFields()

CSG_Parameter_Table_Fields * CSG_Parameter::asTableFields ( void ) const

Definition at line 1043 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Table_Fields.

◆ asTableList()

CSG_Parameter_Table_List * CSG_Parameter::asTableList ( void ) const

Definition at line 1049 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Table_List.

◆ asTIN()

CSG_TIN * CSG_Parameter::asTIN ( void ) const

Definition at line 975 of file parameter.cpp.

References asDataObject(), DATAOBJECT_CREATE, CSG_Data_Object::Get_ObjectType(), and SG_DATAOBJECT_TYPE_TIN.

◆ asTINList()

CSG_Parameter_TIN_List * CSG_Parameter::asTINList ( void ) const

Definition at line 1051 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_TIN_List.

◆ asValue()

CSG_Parameter_Value * CSG_Parameter::asValue ( void ) const

Definition at line 1022 of file parameter.cpp.

References Get_Type(), PARAMETER_TYPE_Color, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_Int, and PARAMETER_TYPE_Table_Field.

Referenced by CSG_Parameter_Value::_Assign(), Get_Description(), and SG_XML_Add_Parameter().

◆ Check()

bool CSG_Parameter::Check ( bool bSilent = true )

Definition at line 898 of file parameter.cpp.

References _Set_String(), asDataObject(), asGrid_System(), asList(), asParameters(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter_List::Del_Item(), CSG_Data_Manager::Exists(), CSG_Parameter_List::Get_Item(), CSG_Parameters::Get_Manager(), Get_Type(), is_DataObject(), is_DataObject_List(), is_Enabled(), is_Input(), is_Optional(), is_Output(), PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Parameters, Set_Value(), and CSG_Parameter_List::Update_Data().

◆ Cmp_Identifier()

bool CSG_Parameter::Cmp_Identifier ( const CSG_String & Identifier ) const

Definition at line 552 of file parameter.cpp.

References CSG_String::Cmp().

Referenced by CSG_Parameters_Grid_Target::On_Parameter_Changed(), and CSG_Parameters_Point_Search::On_Parameters_Enable().

◆ do_UseInCMD()

bool CSG_Parameter::do_UseInCMD ( void ) const

Definition at line 171 of file parameter.cpp.

References Get_Parent(), and PARAMETER_NOT_FOR_CMD.

Referenced by Get_Description(), is_Enabled(), and SG_XML_Add_Parameter().

◆ do_UseInGUI()

bool CSG_Parameter::do_UseInGUI ( void ) const

Definition at line 165 of file parameter.cpp.

References Get_Parent(), and PARAMETER_NOT_FOR_GUI.

Referenced by Get_Description(), is_Enabled(), and SG_XML_Add_Parameter().

◆ Get_Child()

CSG_Parameter* CSG_Parameter::Get_Child ( int iChild ) const
inline

Definition at line 255 of file parameters.h.

Referenced by CSG_Parameter_Table_Field::_asDouble(), CSG_Parameter_Grid::_asDouble(), CSG_Parameter_Grid::_asInt(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters::Del_Parameter(), and Set_Children_Enabled().

◆ Get_Children_Count()

int CSG_Parameter::Get_Children_Count ( void ) const
inline

Definition at line 254 of file parameters.h.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters::Del_Parameter(), Set_Children_Enabled(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_DataObject_Type()

TSG_Data_Object_Type CSG_Parameter::Get_DataObject_Type ( void ) const

Definition at line 518 of file parameter.cpp.

References Get_Type(), PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_TIN, PARAMETER_TYPE_TIN_List, SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, and SG_DATAOBJECT_TYPE_Undefined.

Referenced by Get_Description(), and SG_XML_Add_Parameter().

◆ Get_Default()

const CSG_String & CSG_Parameter::Get_Default ( void ) const

Definition at line 875 of file parameter.cpp.

Referenced by CSG_Parameter_Bool::is_Default(), CSG_Parameter_Int::is_Default(), CSG_Parameter_Double::is_Default(), CSG_Parameter_Choice::is_Default(), and SG_XML_Add_Parameter().

◆ Get_Description() [1/3]

CSG_String CSG_Parameter::Get_Description ( int Flags ) const

Definition at line 584 of file parameter.cpp.

References Get_Description(), and SG_T.

◆ Get_Description() [2/3]

CSG_String CSG_Parameter::Get_Description | ( | int | Flags,
 |  | const SG_Char * | Separator
 | ) |  | const

Definition at line 590 of file parameter.cpp.

References _TL, asChoice(), asChoices(), asParameters(), asTable(), asValue(), CSG_String::c_str(), do_UseInCMD(), do_UseInGUI(), CSG_String::Format(), CSG_Parameter_Choice::Get_Count(), CSG_Parameters::Get_Count(), Get_DataObject_Type(), Get_Description(), CSG_Table::Get_Field_Count(), CSG_Parameter_Choices::Get_Item_Count(), Get_Name(), Get_Type(), Get_Type_Name(), is_DataObject(), is_DataObject_List(), CSG_String::is_Empty(), is_Input(), is_Optional(), CSG_String::Length(), PARAMETER_DESCRIPTION_NAME, PARAMETER_DESCRIPTION_OPTIONAL, PARAMETER_DESCRIPTION_PROPERTIES, PARAMETER_DESCRIPTION_TEXT, PARAMETER_DESCRIPTION_TYPE, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Int, PARAMETER_TYPE_Parameters, SEPARATE, SG_Data_Type_Get_Name(), SG_Get_DataObject_Name(), and SG_T.

◆ Get_Description() [3/3]

const SG_Char * CSG_Parameter::Get_Description ( void ) const

Definition at line 578 of file parameter.cpp.

Referenced by Get_Description(), CSG_Tool::Get_Summary(), and SG_XML_Add_Parameter().

◆ Get_Identifier()

const SG_Char * CSG_Parameter::Get_Identifier ( void ) const

Definition at line 546 of file parameter.cpp.

Referenced by CSG_Parameter_Parameters::_Serialize(), CSG_Parameters::Add_Bool(), CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Color(), CSG_Parameters::Add_Colors(), CSG_Parameters::Add_Date(), CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), CSG_Parameters::Add_Degree(), CSG_Parameters::Add_Double(), CSG_Parameters::Add_FilePath(), CSG_Parameters::Add_FixedTable(), CSG_Parameters::Add_Font(), CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters::Add_Grid(), CSG_Parameters::Add_Grid_List(), CSG_Parameters::Add_Grid_or_Const(), CSG_Parameters::Add_Grid_Output(), CSG_Parameters::Add_Grid_System(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameters::Add_Grids(), CSG_Parameters::Add_Grids_List(), CSG_Parameters::Add_Info_Range(), CSG_Parameters::Add_Info_String(), CSG_Parameters::Add_Info_Value(), CSG_Parameters::Add_Int(), CSG_Parameters::Add_Node(), CSG_Parameters::Add_Parameters(), CSG_Parameters::Add_PointCloud(), CSG_Parameters::Add_PointCloud_List(), CSG_Parameters::Add_PointCloud_Output(), CSG_Parameters::Add_Range(), CSG_Parameters::Add_Shapes(), CSG_Parameters::Add_Shapes_List(), CSG_Parameters::Add_Shapes_Output(), CSG_Parameters::Add_String(), CSG_Parameters::Add_Table(), CSG_Parameters::Add_Table_Field(), CSG_Parameters::Add_Table_Field_or_Const(), CSG_Parameters::Add_Table_Fields(), CSG_Parameters::Add_Table_List(), CSG_Parameters::Add_Table_Output(), CSG_Parameters::Add_TIN(), CSG_Parameters::Add_TIN_List(), CSG_Parameters::Add_TIN_Output(), CSG_Parameters::Add_Value(), CSG_Parameters::Assign_Parameters(), CSG_Parameters::Assign_Values(), CSG_Tool_Chain::Create(), CSG_Parameters::Create(), CSG_Parameters_Grid_Target::Create(), CSG_Tool::DataObject_Set_History(), CSG_Parameters::Del_Parameter(), CSG_Tool::Get_Summary(), CSG_Parameters_Grid_Target::On_Parameter_Changed(), Serialize(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ Get_Manager()

CSG_Data_Manager * CSG_Parameter::Get_Manager ( void ) const

Definition at line 111 of file parameter.cpp.

References CSG_Parameters::Get_Manager().

Referenced by CSG_Parameter_List::_Assign(), CSG_Parameter_Data_Object::_Serialize(), CSG_Parameter_List::_Serialize(), CSG_Parameter_Grid_System::_Set_Value(), and CSG_Parameter_Data_Object_Output::_Set_Value().

◆ Get_Name()

const SG_Char * CSG_Parameter::Get_Name ( void ) const

Definition at line 565 of file parameter.cpp.

Referenced by CSG_Tool::DataObject_Set_History(), Get_Description(), CSG_Parameters::Get_String(), CSG_Tool::Get_Summary(), Serialize(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ Get_Parameters()

CSG_Parameters * CSG_Parameter::Get_Parameters ( void ) const

Definition at line 99 of file parameter.cpp.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), Serialize(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Parent()

CSG_Parameter * CSG_Parameter::Get_Parent ( void ) const

Definition at line 105 of file parameter.cpp.

Referenced by CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters::Del_Parameter(), do_UseInCMD(), do_UseInGUI(), CSG_Parameter_Grid::Get_System(), CSG_Parameter_Grid_List::Get_System(), CSG_Parameter_Grids_List::Get_System(), CSG_Parameter_Table_Field::Get_Table(), CSG_Parameter_Table_Fields::Get_Table(), CSG_Parameters::Set_History(), SG_XML_Add_Parameter(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter::Get_Type ( void ) const
pure virtual

Implemented in CSG_Parameter_Parameters, CSG_Parameter_PointCloud_List, CSG_Parameter_TIN_List, CSG_Parameter_Shapes_List, CSG_Parameter_Table_List, CSG_Parameter_Grids_List, CSG_Parameter_Grid_List, CSG_Parameter_PointCloud, CSG_Parameter_TIN, CSG_Parameter_Shapes, CSG_Parameter_Table, CSG_Parameter_Grids, CSG_Parameter_Grid, CSG_Parameter_Data_Object_Output, CSG_Parameter_Table_Fields, CSG_Parameter_Table_Field, CSG_Parameter_Grid_System, CSG_Parameter_Fixed_Table, CSG_Parameter_Colors, CSG_Parameter_Color, CSG_Parameter_Font, CSG_Parameter_File_Name, CSG_Parameter_Text, CSG_Parameter_String, CSG_Parameter_Choices, CSG_Parameter_Data_Type, CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Date, CSG_Parameter_Degree, CSG_Parameter_Double, CSG_Parameter_Int, CSG_Parameter_Bool, and CSG_Parameter_Node.

Referenced by CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters::Add_Grid(), CSG_Parameters::Add_Grid_List(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameters::Add_Grids(), CSG_Parameters::Add_Grids_List(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameters::Add_Table_Field(), CSG_Parameters::Add_Table_Fields(), asChoice(), asChoices(), asColors(), asDataType(), asDate(), asFilePath(), asFont(), asGrid_System(), asGridList(), asGridsList(), asParameters(), asPointCloudList(), asRange(), asShapesList(), Assign(), CSG_Parameters::Assign_Values(), asTable(), asTableFields(), asTableList(), asTINList(), asValue(), Check(), Get_DataObject_Type(), Get_Description(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), CSG_Parameters::Get_Parameter(), CSG_Parameters::Get_String(), CSG_Tool::Get_Summary(), Get_Type_Identifier(), Get_Type_Name(), is_Compatible(), is_DataObject(), is_DataObject_List(), is_Option(), is_Parameters(), is_Serializable(), is_Value_Equal(), Serialize(), CSG_Parameters::Set_History(), CSG_Parameters::Set_Parameter(), CSG_Parameter_Value::Set_Valid_Range(), Set_Value(), SG_XML_Add_Parameter(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Type_Identifier()

CSG_String CSG_Parameter::Get_Type_Identifier ( void ) const

Definition at line 122 of file parameter.cpp.

References Get_Type(), and SG_Parameter_Type_Get_Identifier().

Referenced by CSG_Parameter_Parameters::_Serialize(), CSG_Tool::DataObject_Set_History(), Serialize(), and CSG_Parameters::Set_History().

◆ Get_Type_Name()

CSG_String CSG_Parameter::Get_Type_Name ( void ) const

Definition at line 128 of file parameter.cpp.

References Get_Type(), and SG_Parameter_Type_Get_Name().

Referenced by Get_Description(), and SG_XML_Add_Parameter().

◆ has_Changed()

bool CSG_Parameter::has_Changed ( int Check_Flags = PARAMETER_CHECK_ALL )

Definition at line 832 of file parameter.cpp.

References _Set_String().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameters::Load(), CSG_Parameter_Range::Set_Max(), CSG_Parameter_Range::Set_Min(), CSG_Parameter_Value::Set_Valid_Range(), and Set_Value().

◆ ignore_Projection() [1/2]

void CSG_Parameter::ignore_Projection ( bool bIgnore )

Definition at line 177 of file parameter.cpp.

References PARAMETER_IGNORE_PROJECTION.

◆ ignore_Projection() [2/2]

bool CSG_Parameter::ignore_Projection ( void ) const
inline

Definition at line 250 of file parameters.h.

References PARAMETER_IGNORE_PROJECTION.

◆ is_Compatible()

bool CSG_Parameter::is_Compatible ( CSG_Parameter * pParameter ) const

Definition at line 336 of file parameter.cpp.

References asChoice(), asChoices(), asParameters(), asTable(), CSG_Parameter_Choice::Get_Count(), CSG_Parameters::Get_Count(), CSG_Parameter_Choices::Get_Item(), CSG_Parameter_Choice::Get_Item(), CSG_Parameter_Choices::Get_Item_Count(), CSG_Parameters::Get_Parameter(), Get_Type(), CSG_Table::is_Compatible(), is_Compatible(), PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Parameters, and SG_STR_CMP.

Referenced by is_Compatible().

◆ is_DataObject()

bool CSG_Parameter::is_DataObject ( void ) const

Definition at line 275 of file parameter.cpp.

References Get_Type(), PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grids, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Table, and PARAMETER_TYPE_TIN.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), asDataObject(), Check(), CSG_Tool::DataObject_Set_History(), Get_Description(), Serialize(), and CSG_Parameters::Set_History().

◆ is_DataObject_List()

bool CSG_Parameter::is_DataObject_List ( void ) const

Definition at line 294 of file parameter.cpp.

References Get_Type(), PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_Table_List, and PARAMETER_TYPE_TIN_List.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), asList(), Check(), CSG_Tool::DataObject_Set_History(), Get_Description(), Serialize(), and CSG_Parameters::Set_History().

◆ is_Default()

bool CSG_Parameter::is_Default ( void ) const
virtual

Reimplemented in CSG_Parameter_Choice, CSG_Parameter_Range, CSG_Parameter_Double, CSG_Parameter_Int, and CSG_Parameter_Bool.

Definition at line 881 of file parameter.cpp.

References asString(), and CSG_String::Cmp().

◆ is_Enabled()

bool CSG_Parameter::is_Enabled ( bool bCheckEnv = true ) const

Definition at line 208 of file parameter.cpp.

References do_UseInCMD(), do_UseInGUI(), CSG_Parameters::has_GUI(), and is_Enabled().

Referenced by Check(), CSG_Parameters::Get_String(), is_Enabled(), and CSG_Parameters::Set_History().

◆ is_Information()

bool CSG_Parameter::is_Information ( void ) const
inline

Definition at line 234 of file parameters.h.

References PARAMETER_INFORMATION.

Referenced by CSG_Parameter_Range::CSG_Parameter_Range(), CSG_Parameters::Get_String(), is_Option(), is_Serializable(), Serialize(), and CSG_Parameters::Set_History().

◆ is_Input()

bool CSG_Parameter::is_Input ( void ) const
inline

Definition at line 231 of file parameters.h.

References PARAMETER_INPUT.

Referenced by CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_Grid::Add_Default(), CSG_Parameter_Grid_List::Add_Item(), Check(), Get_Description(), CSG_Tool::Get_Summary(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ is_Option()

bool CSG_Parameter::is_Option ( void ) const

Definition at line 238 of file parameter.cpp.

References Get_Type(), is_Information(), PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Int, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_Range, PARAMETER_TYPE_String, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, and PARAMETER_TYPE_Text.

Referenced by CSG_Parameters::Get_String(), CSG_Tool::Get_Summary(), Serialize(), CSG_Parameters::Set_History(), and SG_XML_Add_Parameter().

◆ is_Optional()

bool CSG_Parameter::is_Optional ( void ) const
inline

Definition at line 233 of file parameters.h.

References PARAMETER_OPTIONAL.

Referenced by CSG_Parameter_Data_Object::_Set_String(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), Check(), Get_Description(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), CSG_Parameter_Data_Object::is_Valid(), and SG_XML_Add_Parameter().

◆ is_Output()

bool CSG_Parameter::is_Output ( void ) const
inline

Definition at line 232 of file parameters.h.

References PARAMETER_OUTPUT.

Referenced by CSG_Parameter_Data_Object::_Set_String(), Check(), CSG_Tool::Get_Summary(), and SG_XML_Add_Parameter().

◆ is_Parameters()

bool CSG_Parameter::is_Parameters ( void ) const

Definition at line 312 of file parameter.cpp.

References Get_Type(), and PARAMETER_TYPE_Parameters.

Referenced by CSG_Parameters::Set_History().

◆ is_Serializable()

bool CSG_Parameter::is_Serializable ( void ) const

Definition at line 318 of file parameter.cpp.

References Get_Type(), is_Information(), PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Node, PARAMETER_TYPE_String, and PARAMETER_TYPE_Undefined.

◆ is_Valid()

virtual bool CSG_Parameter::is_Valid ( void ) const
inlinevirtual

Reimplemented in CSG_Parameter_Data_Object, and CSG_Parameter_String.

Definition at line 230 of file parameters.h.

◆ is_Value_Equal()

bool CSG_Parameter::is_Value_Equal ( CSG_Parameter * pParameter ) const

Definition at line 395 of file parameter.cpp.

References asBool(), asChoices(), asColors(), asDataObject(), asDouble(), asGrid_System(), asInt(), asList(), asParameters(), asRange(), CSG_Table_Record::asString(), asString(), asTable(), CSG_Colors::Get_Color(), CSG_Colors::Get_Count(), CSG_Parameters::Get_Count(), CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Parameter_List::Get_Item(), CSG_Parameter_List::Get_Item_Count(), CSG_Parameter_Range::Get_Max(), CSG_Parameter_Range::Get_Min(), CSG_Parameters::Get_Parameter(), CSG_Table::Get_Record(), CSG_Parameter_Choices::Get_Selection_Count(), CSG_Parameter_Choices::Get_Selection_Index(), Get_Type(), CSG_Table::is_Compatible(), CSG_Grid_System::is_Equal(), is_Value_Equal(), PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, PARAMETER_TYPE_TIN_List, and SG_STR_CMP.

Referenced by is_Value_Equal().

◆ Restore_Default()

bool CSG_Parameter::Restore_Default ( void )
virtual

Reimplemented in CSG_Parameter_Parameters, CSG_Parameter_Font, and CSG_Parameter_Range.

Definition at line 887 of file parameter.cpp.

References Set_Value().

Referenced by CSG_Parameter_Range::Restore_Default(), and CSG_Parameters::Restore_Defaults().

◆ Serialize()

bool CSG_Parameter::Serialize | ( | CSG_MetaData & | MetaData,
 |  | bool | bSave
 | ) |  |

Definition at line 1096 of file parameter.cpp.

References _Serialize(), _Set_String(), CSG_MetaData::Add_Child(), CSG_MetaData::Add_Property(), CSG_MetaData::Cmp_Property(), Get_Identifier(), Get_Name(), Get_Parameters(), Get_Type(), Get_Type_Identifier(), is_DataObject(), is_DataObject_List(), is_Information(), is_Option(), PARAMETER_TYPE_Node, and PARAMETER_TYPE_Undefined.

Referenced by CSG_Tool_Chain::Create(), CSG_Parameters::Load(), CSG_Parameters::Save(), and CSG_Parameters::Set_History().

◆ Set_Children_Enabled()

bool CSG_Parameter::Set_Children_Enabled ( bool bEnabled = true )

Definition at line 227 of file parameter.cpp.

References Get_Child(), Get_Children_Count(), and Set_Enabled().

◆ Set_Default() [1/3]

bool CSG_Parameter::Set_Default ( const CSG_String & Value )

Definition at line 867 of file parameter.cpp.

◆ Set_Default() [2/3]

bool CSG_Parameter::Set_Default ( double Value )

Definition at line 859 of file parameter.cpp.

References CSG_String::Printf().

◆ Set_Default() [3/3]

bool CSG_Parameter::Set_Default ( int Value )

Definition at line 851 of file parameter.cpp.

References CSG_String::Printf().

Referenced by CSG_Parameters::Add_Choice(), CSG_Parameters::Add_FilePath(), CSG_Parameters::Add_Font(), and CSG_Parameter_Data_Type::Set_Data_Types().

◆ Set_Description()

bool CSG_Parameter::Set_Description ( const CSG_String & Description )

Definition at line 571 of file parameter.cpp.

◆ Set_Enabled()

bool CSG_Parameter::Set_Enabled ( bool bEnabled = true )

Definition at line 195 of file parameter.cpp.

Referenced by CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), Set_Children_Enabled(), and CSG_Parameters::Set_Enabled().

◆ Set_Name()

bool CSG_Parameter::Set_Name ( const CSG_String & Name )

Definition at line 558 of file parameter.cpp.

◆ Set_UseInCMD()

void CSG_Parameter::Set_UseInCMD ( bool bDoUse = false )

Definition at line 152 of file parameter.cpp.

References PARAMETER_NOT_FOR_CMD.

◆ Set_UseInGUI()

void CSG_Parameter::Set_UseInGUI ( bool bDoUse = false )

Definition at line 139 of file parameter.cpp.

References PARAMETER_NOT_FOR_GUI.

Referenced by CSG_Parameters_Grid_Target::Create().

◆ Set_Value() [1/7]

bool CSG_Parameter::Set_Value ( const char * Value )
virtual

Definition at line 775 of file parameter.cpp.

References Set_Value().

◆ Set_Value() [2/7]

bool CSG_Parameter::Set_Value ( const CSG_String & Value )
virtual

Definition at line 777 of file parameter.cpp.

References _Set_Value(), has_Changed(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

◆ Set_Value() [3/7]

bool CSG_Parameter::Set_Value ( const wchar_t * Value )
virtual

Definition at line 776 of file parameter.cpp.

References Set_Value().

◆ Set_Value() [4/7]

bool CSG_Parameter::Set_Value ( CSG_Parameter * Value )
virtual

Definition at line 807 of file parameter.cpp.

References asInt(), Assign(), Get_Type(), PARAMETER_TYPE_Choice, PARAMETER_TYPE_Data_Type, and Set_Value().

◆ Set_Value() [5/7]

bool CSG_Parameter::Set_Value ( double Value )
virtual

Definition at line 760 of file parameter.cpp.

References _Set_Value(), has_Changed(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

◆ Set_Value() [6/7]

bool CSG_Parameter::Set_Value ( int Value )
virtual

Definition at line 745 of file parameter.cpp.

References _Set_Value(), has_Changed(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameters::Add_Choice(), CSG_Parameters::Add_FilePath(), CSG_Parameters::Add_Font(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), Check(), CSG_Tool_Chain::Create(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Get_Grids(), Restore_Default(), CSG_Parameters::Restore_Defaults(), CSG_Parameters::Serialize_Compatibility(), CSG_Parameter_Data_Type::Set_Data_Type(), CSG_Parameter_Data_Type::Set_Data_Types(), CSG_Parameters::Set_Grid_System(), CSG_Parameter_Range::Set_Max(), CSG_Parameter_Range::Set_Min(), CSG_Parameters::Set_Parameter(), CSG_Parameter_Range::Set_Range(), Set_Value(), CSG_Parameter_Bool::Toggle_Value(), and CSG_Parameter_Choice::Toggle_Value().

◆ Set_Value() [7/7]

bool CSG_Parameter::Set_Value ( void * Value )
virtual

Definition at line 792 of file parameter.cpp.

References _Set_Value(), has_Changed(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

◆ Toggle_Value()

bool CSG_Parameter::Toggle_Value ( void )
virtual

Reimplemented in CSG_Parameter_Choice, and CSG_Parameter_Bool.

Definition at line 826 of file parameter.cpp.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 325 of file parameters.h.

Member Data Documentation

◆ m_String

CSG_String CSG_Parameter::m_String
protected

Definition at line 330 of file parameters.h.

Referenced by CSG_Parameter_Font::_asPointer(), CSG_Parameter_String::_Assign(), CSG_Parameter_Font::_Assign(), _asString(), CSG_Parameter_String::_Serialize(), CSG_Parameter_Font::_Serialize(), CSG_Parameter_Table_Fields::_Serialize(), CSG_Parameter_Bool::_Set_String(), CSG_Parameter_Int::_Set_String(), CSG_Parameter_Double::_Set_String(), CSG_Parameter_Degree::_Set_String(), CSG_Parameter_Date::_Set_String(), CSG_Parameter_Range::_Set_String(), CSG_Parameter_Choice::_Set_String(), CSG_Parameter_Choices::_Set_String(), CSG_Parameter_Colors::_Set_String(), CSG_Parameter_Fixed_Table::_Set_String(), CSG_Parameter_Grid_System::_Set_String(), CSG_Parameter_Table_Field::_Set_String(), CSG_Parameter_Data_Object::_Set_String(), CSG_Parameter_List::_Set_String(), CSG_Parameter_Parameters::_Set_String(), CSG_Parameter_String::_Set_Value(), CSG_Parameter_Font::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Parameter_String::is_Valid(), and CSG_Parameter_Font::Restore_Default().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter Member List

This is the complete list of members for CSG_Parameter, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameters class | CSG_Parameter | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const =0 | CSG_Parameter | pure virtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Bool Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Bool Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Bool:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | is_Default (void) const
virtual bool | Toggle_Value (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Bool (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

bool m_Value
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 394 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Bool()

CSG_Parameter_Bool::CSG_Parameter_Bool | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 231 of file parameter_data.cpp.

References m_Value.

Member Function Documentation

◆ _asInt()

virtual int CSG_Parameter_Bool::_asInt ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 418 of file parameters.h.

◆ _Assign()

bool CSG_Parameter_Bool::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 298 of file parameter_data.cpp.

References CSG_Parameter::asBool(), and m_Value.

◆ _Serialize()

bool CSG_Parameter_Bool::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 306 of file parameter_data.cpp.

References CSG_MetaData::Cmp_Content(), m_Value, and CSG_MetaData::Set_Content().

◆ _Set_String()

void CSG_Parameter_Bool::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 292 of file parameter_data.cpp.

References _TL, CSG_Parameter::m_String, and m_Value.

◆ _Set_Value() [1/3]

int CSG_Parameter_Bool::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 269 of file parameter_data.cpp.

References _Set_Value(), _TL, CSG_String::asInt(), CSG_String::CmpNoCase(), and SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [2/3]

int CSG_Parameter_Bool::_Set_Value ( double Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 264 of file parameter_data.cpp.

References _Set_Value().

◆ _Set_Value() [3/3]

int CSG_Parameter_Bool::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 250 of file parameter_data.cpp.

References m_Value, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Bool::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 398 of file parameters.h.

References PARAMETER_TYPE_Bool.

◆ is_Default()

bool CSG_Parameter_Bool::is_Default ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 238 of file parameter_data.cpp.

References CSG_Parameter::asInt(), CSG_Parameter::Get_Default(), and m_Value.

◆ Toggle_Value()

bool CSG_Parameter_Bool::Toggle_Value ( void )
virtual

Reimplemented from CSG_Parameter.

Definition at line 244 of file parameter_data.cpp.

References CSG_Parameter::asBool(), and CSG_Parameter::Set_Value().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 424 of file parameters.h.

Member Data Documentation

◆ m_Value

bool CSG_Parameter_Bool::m_Value
protected

Definition at line 409 of file parameters.h.

Referenced by _Assign(), _Serialize(), _Set_String(), _Set_Value(), CSG_Parameter_Bool(), and is_Default().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Bool Member List

This is the complete list of members for CSG_Parameter_Bool, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_Bool | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Bool | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Bool | protectedvirtual
_Set_String(void) | CSG_Parameter_Bool | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Bool | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Bool | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Bool | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Bool(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Bool | protected
CSG_Parameters class | CSG_Parameter_Bool | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Bool | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Bool | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Bool | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter_Bool | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Choice Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Choice Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Choice:
CSG_Parameter CSG_Parameter_Data_Type

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | is_Default (void) const
virtual bool | Toggle_Value (void)
bool | Del_Items (void)
bool | Add_Item (const CSG_String &Item, const CSG_String &Data="")
bool | Set_Items (const SG_Char *String)
CSG_String | Get_Items (void) const
const SG_Char * | Get_Item (int Index) const
CSG_String | Get_Item_Data (int Index) const
CSG_String | Get_Data (void) const
bool | Get_Data (CSG_String &Value) const
bool | Get_Data (int &Value) const
bool | Get_Data (double &Value) const
int | Get_Count (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Choice (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

int m_Value
CSG_Strings m_Items
CSG_Strings m_Data
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 658 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Choice()

CSG_Parameter_Choice::CSG_Parameter_Choice | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 891 of file parameter_data.cpp.

References m_Value.

Member Function Documentation

◆ _asDouble()

virtual double CSG_Parameter_Choice::_asDouble ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 701 of file parameters.h.

◆ _asInt()

virtual int CSG_Parameter_Choice::_asInt ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 700 of file parameters.h.

◆ _Assign()

bool CSG_Parameter_Choice::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Data_Type.

Definition at line 1095 of file parameter_data.cpp.

References _Set_String(), CSG_Parameter::asChoice(), m_Data, m_Items, and m_Value.

Referenced by CSG_Parameter_Data_Type::_Assign().

◆ _Serialize()

bool CSG_Parameter_Choice::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Data_Type.

Definition at line 1107 of file parameter_data.cpp.

References _Set_Value(), CSG_MetaData::Add_Property(), CSG_String::asInt(), CSG_Parameter::asString(), CSG_MetaData::Get_Content(), CSG_MetaData::Get_Property(), m_Value, and CSG_MetaData::Set_Content().

Referenced by CSG_Parameter_Data_Type::_Serialize().

◆ _Set_String()

void CSG_Parameter_Choice::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1089 of file parameter_data.cpp.

References _TL, Get_Count(), Get_Item(), CSG_Parameter::m_String, and m_Value.

Referenced by _Assign(), Add_Item(), and Set_Items().

◆ _Set_Value() [1/3]

int CSG_Parameter_Choice::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1064 of file parameter_data.cpp.

References _Set_Value(), CSG_String::asInt(), CSG_String::Cmp(), CSG_Strings::Get_Count(), Get_Item(), Get_Item_Data(), CSG_String::is_Empty(), m_Items, and SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [2/3]

int CSG_Parameter_Choice::_Set_Value ( double Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1058 of file parameter_data.cpp.

References _Set_Value().

◆ _Set_Value() [3/3]

int CSG_Parameter_Choice::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1040 of file parameter_data.cpp.

References CSG_Strings::Get_Count(), m_Items, m_Value, SG_PARAMETER_DATA_SET_CHANGED, SG_PARAMETER_DATA_SET_FALSE, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Serialize(), and _Set_Value().

◆ Add_Item()

bool CSG_Parameter_Choice::Add_Item | ( | const CSG_String & | Item,
 |  | const CSG_String & | Data = ""
 | ) |  |

Definition at line 918 of file parameter_data.cpp.

References _Set_String(), CSG_Strings::Add(), CSG_String::is_Empty(), m_Data, and m_Items.

Referenced by CSG_Parameter_Data_Type::Set_Data_Types(), and Set_Items().

◆ Del_Items()

bool CSG_Parameter_Choice::Del_Items ( void )

Definition at line 910 of file parameter_data.cpp.

References CSG_Strings::Clear(), m_Data, and m_Items.

◆ Get_Count()

int CSG_Parameter_Choice::Get_Count ( void ) const
inline

Definition at line 682 of file parameters.h.

Referenced by _Set_String(), CSG_Parameter::Get_Description(), Get_Item(), Get_Item_Data(), Get_Items(), CSG_Parameter::is_Compatible(), CSG_Parameter_Data_Type::Set_Data_Type(), CSG_Parameter_Data_Type::Set_Data_Types(), Set_Items(), and Toggle_Value().

◆ Get_Data() [1/4]

bool CSG_Parameter_Choice::Get_Data ( CSG_String & Value ) const

Definition at line 1018 of file parameter_data.cpp.

References Get_Item_Data(), CSG_String::is_Empty(), and m_Value.

◆ Get_Data() [2/4]

bool CSG_Parameter_Choice::Get_Data ( double & Value ) const

Definition at line 1032 of file parameter_data.cpp.

References CSG_String::asDouble(), and Get_Data().

◆ Get_Data() [3/4]

bool CSG_Parameter_Choice::Get_Data ( int & Value ) const

Definition at line 1025 of file parameter_data.cpp.

References CSG_String::asInt(), and Get_Data().

◆ Get_Data() [4/4]

CSG_String CSG_Parameter_Choice::Get_Data ( void ) const

Definition at line 1013 of file parameter_data.cpp.

References Get_Item_Data(), and m_Value.

Referenced by Get_Data(), and CSG_Parameter_Data_Type::Get_Data_Type().

◆ Get_Item()

const SG_Char * CSG_Parameter_Choice::Get_Item ( int Index ) const

Definition at line 992 of file parameter_data.cpp.

References Get_Count(), and m_Items.

Referenced by _Set_String(), _Set_Value(), CSG_Parameter::is_Compatible(), and SG_XML_Add_Parameter().

◆ Get_Item_Data()

CSG_String CSG_Parameter_Choice::Get_Item_Data ( int Index ) const

Definition at line 1003 of file parameter_data.cpp.

References Get_Count(), and m_Data.

Referenced by _Set_Value(), Get_Data(), and CSG_Parameter_Data_Type::Set_Data_Type().

◆ Get_Items()

CSG_String CSG_Parameter_Choice::Get_Items ( void ) const

Definition at line 974 of file parameter_data.cpp.

References Get_Count(), and m_Items.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Choice::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Reimplemented in CSG_Parameter_Data_Type.

Definition at line 662 of file parameters.h.

References PARAMETER_TYPE_Choice.

◆ is_Default()

bool CSG_Parameter_Choice::is_Default ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 898 of file parameter_data.cpp.

References CSG_Parameter::asInt(), CSG_Parameter::Get_Default(), and m_Value.

◆ Set_Items()

bool CSG_Parameter_Choice::Set_Items ( const SG_Char * String )

Definition at line 934 of file parameter_data.cpp.

References _Set_String(), Add_Item(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), Get_Count(), m_Data, m_Items, m_Value, SG_String_Tokenize(), and CSG_String::Trim().

Referenced by CSG_Parameters::Add_Choice().

◆ Toggle_Value()

bool CSG_Parameter_Choice::Toggle_Value ( void )
virtual

Reimplemented from CSG_Parameter.

Definition at line 904 of file parameter_data.cpp.

References CSG_Parameter::asInt(), Get_Count(), and CSG_Parameter::Set_Value().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 707 of file parameters.h.

Member Data Documentation

◆ m_Data

CSG_Strings CSG_Parameter_Choice::m_Data
protected

Definition at line 691 of file parameters.h.

Referenced by _Assign(), Add_Item(), Del_Items(), Get_Item_Data(), and Set_Items().

◆ m_Items

CSG_Strings CSG_Parameter_Choice::m_Items
protected

Definition at line 691 of file parameters.h.

Referenced by _Assign(), _Set_Value(), Add_Item(), Del_Items(), Get_Item(), Get_Items(), and Set_Items().

◆ m_Value

int CSG_Parameter_Choice::m_Value
protected

Definition at line 689 of file parameters.h.

Referenced by _Assign(), _Serialize(), _Set_String(), _Set_Value(), CSG_Parameter_Choice(), Get_Data(), is_Default(), and Set_Items().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Choice Member List

This is the complete list of members for CSG_Parameter_Choice, including all inherited members.

_asDouble(void) const | CSG_Parameter_Choice | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Choice | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Choice | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Choice | protectedvirtual
_Set_String(void) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Choice | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(const CSG_String &Item, const CSG_String &Data="") | CSG_Parameter_Choice |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Choice(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Choice | protected
CSG_Parameters class | CSG_Parameter_Choice | friend
Del_Items(void) | CSG_Parameter_Choice |
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_Count(void) const | CSG_Parameter_Choice | inline
Get_Data(void) const | CSG_Parameter_Choice |
Get_Data(CSG_String &Value) const | CSG_Parameter_Choice |
Get_Data(int &Value) const | CSG_Parameter_Choice |
Get_Data(double &Value) const | CSG_Parameter_Choice |
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_Choice |
Get_Item_Data(int Index) const | CSG_Parameter_Choice |
Get_Items(void) const | CSG_Parameter_Choice |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Choice | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Choice | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Data | CSG_Parameter_Choice | protected
m_Items | CSG_Parameter_Choice | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Choice | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Items(const SG_Char *String) | CSG_Parameter_Choice |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter_Choice | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Choices Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Choices Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Choices:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Items (const CSG_String &Items)
void | Set_Items (const CSG_Strings &Items)
CSG_String | Get_Items (void) const
void | Del_Items (void)
void | Add_Item (const CSG_String &Item, const CSG_String &Data="")
int | Get_Item_Count (void) const
const CSG_String & | Get_Item (int i) const
const CSG_String & | Get_Item_Data (int i) const
int | Get_Selection_Count (void) const
const CSG_String & | Get_Selection (int i) const
const CSG_String & | Get_Selection_Data (int i) const
int | Get_Selection_Index (int i) const
bool | is_Selected (int Index)
bool | Select (int Index, bool bSelect=true)
bool | Clr_Selection (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Choices (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Strings m_Items [2]
CSG_Array_Int m_Selection
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 746 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Choices()

CSG_Parameter_Choices::CSG_Parameter_Choices | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1265 of file parameter_data.cpp.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Choices::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1414 of file parameter_data.cpp.

References CSG_Parameter::asChoices(), m_Items, and m_Selection.

◆ _Serialize()

bool CSG_Parameter_Choices::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1425 of file parameter_data.cpp.

References _Set_Value(), CSG_Parameter::asString(), CSG_MetaData::Get_Content(), and CSG_MetaData::Set_Content().

◆ _Set_String()

void CSG_Parameter_Choices::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1292 of file parameter_data.cpp.

References CSG_String::Clear(), CSG_String::Format(), CSG_Array_Int::Get_uSize(), m_Selection, and CSG_Parameter::m_String.

◆ _Set_Value()

int CSG_Parameter_Choices::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1272 of file parameter_data.cpp.

References CSG_String::asInt(), CSG_Array_Int::Destroy(), CSG_String_Tokenizer::Get_Next_Token(), CSG_String_Tokenizer::Has_More_Tokens(), m_Selection, Select(), and SG_PARAMETER_DATA_SET_CHANGED.

Referenced by _Serialize().

◆ Add_Item()

void CSG_Parameter_Choices::Add_Item | ( | const CSG_String & | Item,
 |  | const CSG_String & | Data = ""
 | ) |  |

Definition at line 1354 of file parameter_data.cpp.

References m_Items.

Referenced by Set_Items().

◆ Clr_Selection()

bool CSG_Parameter_Choices::Clr_Selection ( void )

Definition at line 1406 of file parameter_data.cpp.

References CSG_Array_Int::Destroy(), and m_Selection.

◆ Del_Items()

void CSG_Parameter_Choices::Del_Items ( void )

Definition at line 1345 of file parameter_data.cpp.

References CSG_Strings::Clear(), CSG_Array_Int::Destroy(), m_Items, and m_Selection.

Referenced by Set_Items().

◆ Get_Item()

const CSG_String& CSG_Parameter_Choices::Get_Item ( int i ) const
inline

Definition at line 759 of file parameters.h.

Referenced by CSG_Parameter::is_Compatible(), and SG_XML_Add_Parameter().

◆ Get_Item_Count()

int CSG_Parameter_Choices::Get_Item_Count ( void ) const
inline

Definition at line 758 of file parameters.h.

Referenced by CSG_Parameter::Get_Description(), CSG_Parameter::is_Compatible(), and Select().

◆ Get_Item_Data()

const CSG_String& CSG_Parameter_Choices::Get_Item_Data ( int i ) const
inline

Definition at line 760 of file parameters.h.

◆ Get_Items()

CSG_String CSG_Parameter_Choices::Get_Items ( void ) const

Definition at line 1327 of file parameter_data.cpp.

References CSG_Strings::Get_Count(), and m_Items.

◆ Get_Selection()

const CSG_String& CSG_Parameter_Choices::Get_Selection ( int i ) const
inline

Definition at line 763 of file parameters.h.

◆ Get_Selection_Count()

int CSG_Parameter_Choices::Get_Selection_Count ( void ) const
inline

Definition at line 762 of file parameters.h.

Referenced by CSG_Parameter::is_Value_Equal().

◆ Get_Selection_Data()

const CSG_String& CSG_Parameter_Choices::Get_Selection_Data ( int i ) const
inline

Definition at line 764 of file parameters.h.

◆ Get_Selection_Index()

int CSG_Parameter_Choices::Get_Selection_Index ( int i ) const
inline

Definition at line 765 of file parameters.h.

Referenced by CSG_Parameter::is_Value_Equal().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Choices::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 750 of file parameters.h.

References PARAMETER_TYPE_Choices.

◆ is_Selected()

bool CSG_Parameter_Choices::is_Selected ( int Index )

Definition at line 1361 of file parameter_data.cpp.

References CSG_Array_Int::Get_uSize(), and m_Selection.

Referenced by Select().

◆ Select()

bool CSG_Parameter_Choices::Select | ( | int | Index,
 |  | bool | bSelect = true
 | ) |  |

Definition at line 1375 of file parameter_data.cpp.

References CSG_Array_Int::Dec_Array(), Get_Item_Count(), CSG_Array_Int::Get_uSize(), is_Selected(), and m_Selection.

Referenced by _Set_Value().

◆ Set_Items() [1/2]

void CSG_Parameter_Choices::Set_Items ( const CSG_String & Items )

Definition at line 1303 of file parameter_data.cpp.

References Add_Item(), Del_Items(), CSG_String_Tokenizer::Get_Next_Token(), and CSG_String_Tokenizer::Has_More_Tokens().

Referenced by CSG_Parameters::Add_Choices().

◆ Set_Items() [2/2]

void CSG_Parameter_Choices::Set_Items ( const CSG_Strings & Items )

Definition at line 1316 of file parameter_data.cpp.

References Add_Item(), Del_Items(), and CSG_Strings::Get_Count().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 789 of file parameters.h.

Member Data Documentation

◆ m_Items

CSG_Strings CSG_Parameter_Choices::m_Items[2]
protected

Definition at line 776 of file parameters.h.

Referenced by _Assign(), Add_Item(), Del_Items(), and Get_Items().

◆ m_Selection

CSG_Array_Int CSG_Parameter_Choices::m_Selection
protected

Definition at line 778 of file parameters.h.

Referenced by _Assign(), _Set_String(), _Set_Value(), Clr_Selection(), Del_Items(), is_Selected(), and Select().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Choices Member List

This is the complete list of members for CSG_Parameter_Choices, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Choices | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Choices | protectedvirtual
_Set_String(void) | CSG_Parameter_Choices | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Choices | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(const CSG_String &Item, const CSG_String &Data="") | CSG_Parameter_Choices |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Clr_Selection(void) | CSG_Parameter_Choices |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Choices(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Choices | protected
CSG_Parameters class | CSG_Parameter_Choices | friend
Del_Items(void) | CSG_Parameter_Choices |
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int i) const | CSG_Parameter_Choices | inline
Get_Item_Count(void) const | CSG_Parameter_Choices | inline
Get_Item_Data(int i) const | CSG_Parameter_Choices | inline
Get_Items(void) const | CSG_Parameter_Choices |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Selection(int i) const | CSG_Parameter_Choices | inline
Get_Selection_Count(void) const | CSG_Parameter_Choices | inline
Get_Selection_Data(int i) const | CSG_Parameter_Choices | inline
Get_Selection_Index(int i) const | CSG_Parameter_Choices | inline
Get_Type(void) const | CSG_Parameter_Choices | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Selected(int Index) | CSG_Parameter_Choices |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Items | CSG_Parameter_Choices | protected
m_Selection | CSG_Parameter_Choices | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Select(int Index, bool bSelect=true) | CSG_Parameter_Choices |
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Items(const CSG_String &Items) | CSG_Parameter_Choices |
Set_Items(const CSG_Strings &Items) | CSG_Parameter_Choices |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Color Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Color Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Color:
CSG_Parameter_Int CSG_Parameter_Value CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual int | _Set_Value (const CSG_String &Value)
- Public Member Functions inherited from CSG_Parameter_Int
virtual bool | is_Default (void) const
- Public Member Functions inherited from CSG_Parameter_Value
bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Color (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Int
CSG_Parameter_Int (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_Value
CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Int
int | m_Value
- Protected Attributes inherited from CSG_Parameter_Value
bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 929 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Color()

CSG_Parameter_Color::CSG_Parameter_Color | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1734 of file parameter_data.cpp.

Member Function Documentation

◆ _Serialize()

bool CSG_Parameter_Color::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 1761 of file parameter_data.cpp.

References CSG_String::AfterFirst(), CSG_String::asInt(), CSG_MetaData::Fmt_Content(), CSG_MetaData::Get_Content(), CSG_Parameter_Int::m_Value, SG_GET_B, SG_GET_G, SG_GET_R, and SG_GET_RGB.

◆ _Set_Value()

int CSG_Parameter_Color::_Set_Value ( const CSG_String & Value )
virtual

Reimplemented from CSG_Parameter_Int.

Definition at line 1741 of file parameter_data.cpp.

References CSG_Parameter_Int::_Set_Value(), CSG_String::asInt(), SG_Color_From_Text(), and SG_PARAMETER_DATA_SET_FALSE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Color::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 933 of file parameters.h.

References PARAMETER_TYPE_Color.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 946 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Color Member List

This is the complete list of members for CSG_Parameter_Color, including all inherited members.

_asDouble(void) const | CSG_Parameter_Int | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Int | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Int | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Color | protectedvirtual
_Set_String(void) | CSG_Parameter_Int | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Color | virtual
CSG_Parameter_Int::_Set_Value(int Value) | CSG_Parameter_Int | protectedvirtual
CSG_Parameter_Int::_Set_Value(double Value) | CSG_Parameter_Int | protectedvirtual
CSG_Parameter_Value::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Color(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Color | protected
CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Int | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Color | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Color | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Int | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Int | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Colors Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Colors Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Colors:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Colors (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Colors m_Colors
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 955 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Colors()

CSG_Parameter_Colors::CSG_Parameter_Colors | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1787 of file parameter_data.cpp.

Member Function Documentation

◆ _asInt()

int CSG_Parameter_Colors::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1814 of file parameter_data.cpp.

References CSG_Colors::Get_Count(), and m_Colors.

◆ _asPointer()

void * CSG_Parameter_Colors::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1820 of file parameter_data.cpp.

References m_Colors.

◆ _Assign()

bool CSG_Parameter_Colors::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1826 of file parameter_data.cpp.

References CSG_Parameter::asColors(), CSG_Colors::Assign(), and m_Colors.

◆ _Serialize()

bool CSG_Parameter_Colors::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1832 of file parameter_data.cpp.

References CSG_MetaData::Add_Child(), CSG_String::AfterFirst(), CSG_String::asInt(), CSG_String::Format(), CSG_Colors::Get_Blue(), CSG_MetaData::Get_Children_Count(), CSG_Colors::Get_Count(), CSG_Colors::Get_Green(), CSG_Colors::Get_Red(), m_Colors, CSG_Colors::Set_Blue(), CSG_Colors::Set_Count(), CSG_Colors::Set_Green(), and CSG_Colors::Set_Red().

◆ _Set_String()

void CSG_Parameter_Colors::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1808 of file parameter_data.cpp.

References _TL, CSG_Colors::Get_Count(), m_Colors, CSG_Parameter::m_String, and CSG_String::Printf().

◆ _Set_Value()

int CSG_Parameter_Colors::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1794 of file parameter_data.cpp.

References CSG_Colors::Create(), CSG_Colors::Get_Count(), CSG_Colors::Get_Predefined_Count(), m_Colors, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Colors::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 959 of file parameters.h.

References PARAMETER_TYPE_Colors.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 980 of file parameters.h.

Member Data Documentation

◆ m_Colors

CSG_Colors CSG_Parameter_Colors::m_Colors
protected

Definition at line 966 of file parameters.h.

Referenced by _asInt(), _asPointer(), _Assign(), _Serialize(), _Set_String(), and _Set_Value().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Colors Member List

This is the complete list of members for CSG_Parameter_Colors, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_Colors | protectedvirtual
_asPointer(void) const | CSG_Parameter_Colors | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Colors | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Colors | protectedvirtual
_Set_String(void) | CSG_Parameter_Colors | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Colors | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Colors(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Colors | protected
CSG_Parameters class | CSG_Parameter_Colors | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Colors | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Colors | CSG_Parameter_Colors | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Data_Object Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Data_Object Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Data_Object:
CSG_Parameter CSG_Parameter_Data_Object_Output CSG_Parameter_Grid CSG_Parameter_PointCloud CSG_Parameter_Shapes CSG_Parameter_Table CSG_Parameter_TIN CSG_Parameter_Grids

Public Member Functions

virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
virtual TSG_Parameter_Type | Get_Type (void) const =0
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1131 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Data_Object()

CSG_Parameter_Data_Object::CSG_Parameter_Data_Object | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2462 of file parameter_data.cpp.

References m_pDataObject.

Member Function Documentation

◆ _asPointer()

void * CSG_Parameter_Data_Object::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2505 of file parameter_data.cpp.

References m_pDataObject.

◆ _Assign()

bool CSG_Parameter_Data_Object::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_PointCloud, CSG_Parameter_Shapes, and CSG_Parameter_Grid.

Definition at line 2511 of file parameter_data.cpp.

References m_pDataObject.

Referenced by CSG_Parameter_Shapes::_Assign(), and CSG_Parameter_PointCloud::_Assign().

◆ _Serialize()

bool CSG_Parameter_Data_Object::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2519 of file parameter_data.cpp.

References _Set_Value(), CSG_MetaData::Add_Property(), CSG_Data_Object::asGrids(), CSG_MetaData::Cmp_Content(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_MetaData::Get_Content(), CSG_Data_Object::Get_File_Name(), CSG_Grids::Get_Grid_Ptr(), CSG_Parameter::Get_Manager(), CSG_Grids::Get_NZ(), CSG_Data_Object::Get_ObjectType(), CSG_Data_Object::Get_Owner(), CSG_MetaData::Get_Property(), m_pDataObject, CSG_MetaData::Set_Content(), and SG_DATAOBJECT_TYPE_Grids.

◆ _Set_String()

void CSG_Parameter_Data_Object::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2488 of file parameter_data.cpp.

References _TL, DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Data_Object::Get_Name(), CSG_Parameter::is_Optional(), CSG_Parameter::is_Output(), m_pDataObject, and CSG_Parameter::m_String.

◆ _Set_Value()

int CSG_Parameter_Data_Object::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_PointCloud, CSG_Parameter_TIN, CSG_Parameter_Shapes, CSG_Parameter_Table, CSG_Parameter_Grid, and CSG_Parameter_Data_Object_Output.

Definition at line 2475 of file parameter_data.cpp.

References m_pDataObject, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Serialize().

◆ is_Valid()

bool CSG_Parameter_Data_Object::is_Valid ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 2469 of file parameter_data.cpp.

References CSG_Parameter::is_Optional(), CSG_Data_Object::is_Valid(), and m_pDataObject.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1155 of file parameters.h.

Member Data Documentation

◆ m_pDataObject

CSG_Data_Object* CSG_Parameter_Data_Object::m_pDataObject
protected

Definition at line 1142 of file parameters.h.

Referenced by _asPointer(), _Assign(), _Serialize(), _Set_String(), _Set_Value(), CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Table::_Set_Value(), CSG_Parameter_Shapes::_Set_Value(), CSG_Parameter_TIN::_Set_Value(), CSG_Parameter_PointCloud::_Set_Value(), CSG_Parameter_Data_Object(), and is_Valid().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Data_Object Member List

This is the complete list of members for CSG_Parameter_Data_Object, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Data_Object | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Data_Object | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameters class | CSG_Parameter_Data_Object | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const =0 | CSG_Parameter | pure virtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Data_Object_Output Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Data_Object_Output Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Data_Object_Output:
CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
bool | Set_DataObject_Type (TSG_Data_Object_Type Type)
TSG_Data_Object_Type | Get_DataObject_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Data_Object_Output (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

TSG_Data_Object_Type m_Type
- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1164 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Data_Object_Output()

CSG_Parameter_Data_Object_Output::CSG_Parameter_Data_Object_Output | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2605 of file parameter_data.cpp.

References m_Type, and SG_DATAOBJECT_TYPE_Undefined.

Member Function Documentation

◆ _Set_Value()

int CSG_Parameter_Data_Object_Output::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2612 of file parameter_data.cpp.

References CSG_Data_Manager::Add(), DATAOBJECT_CREATE, CSG_Parameter::Get_Manager(), CSG_Data_Object::Get_ObjectType(), CSG_Parameter_Data_Object::m_pDataObject, m_Type, SG_Get_Data_Manager(), SG_PARAMETER_DATA_SET_CHANGED, and SG_UI_DataObject_Add().

◆ Get_DataObject_Type()

TSG_Data_Object_Type CSG_Parameter_Data_Object_Output::Get_DataObject_Type ( void ) const
inline

Definition at line 1171 of file parameters.h.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Data_Object_Output::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1168 of file parameters.h.

References PARAMETER_TYPE_DataObject_Output.

◆ Set_DataObject_Type()

bool CSG_Parameter_Data_Object_Output::Set_DataObject_Type ( TSG_Data_Object_Type Type )

Definition at line 2640 of file parameter_data.cpp.

References m_Type, SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_TIN, and SG_DATAOBJECT_TYPE_Undefined.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1184 of file parameters.h.

Member Data Documentation

◆ m_Type

TSG_Data_Object_Type CSG_Parameter_Data_Object_Output::m_Type
protected

Definition at line 1178 of file parameters.h.

Referenced by _Set_Value(), CSG_Parameter_Data_Object_Output(), and Set_DataObject_Type().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Data_Object_Output Member List

This is the complete list of members for CSG_Parameter_Data_Object_Output, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Data_Object | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Data_Object_Output | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_Data_Object_Output(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object_Output | protected
CSG_Parameters class | CSG_Parameter_Data_Object_Output | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter_Data_Object_Output | inline
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Data_Object_Output | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
m_Type | CSG_Parameter_Data_Object_Output | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_DataObject_Type(TSG_Data_Object_Type Type) | CSG_Parameter_Data_Object_Output |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Data_Type Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Data_Type Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Data_Type:
CSG_Parameter_Choice CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
bool | Set_Data_Types (int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
bool | Set_Data_Type (TSG_Data_Type Value)
TSG_Data_Type | Get_Data_Type (TSG_Data_Type Default=SG_DATATYPE_Undefined) const
- Public Member Functions inherited from CSG_Parameter_Choice
virtual bool | is_Default (void) const
virtual bool | Toggle_Value (void)
bool | Del_Items (void)
bool | Add_Item (const CSG_String &Item, const CSG_String &Data="")
bool | Set_Items (const SG_Char *String)
CSG_String | Get_Items (void) const
const SG_Char * | Get_Item (int Index) const
CSG_String | Get_Item_Data (int Index) const
CSG_String | Get_Data (void) const
bool | Get_Data (CSG_String &Value) const
bool | Get_Data (int &Value) const
bool | Get_Data (double &Value) const
int | Get_Count (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Data_Type (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Choice
CSG_Parameter_Choice (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Choice
int m_Value
CSG_Strings m_Items
CSG_Strings m_Data
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 716 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Data_Type()

CSG_Parameter_Data_Type::CSG_Parameter_Data_Type | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1133 of file parameter_data.cpp.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Data_Type::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Choice.

Definition at line 1246 of file parameter_data.cpp.

References CSG_Parameter_Choice::_Assign().

◆ _Serialize()

bool CSG_Parameter_Data_Type::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter_Choice.

Definition at line 1252 of file parameter_data.cpp.

References CSG_Parameter_Choice::_Serialize().

◆ Get_Data_Type()

TSG_Data_Type CSG_Parameter_Data_Type::Get_Data_Type ( TSG_Data_Type Default = SG_DATATYPE_Undefined ) const

This function returns the selected data type. If an additional 'user' option has been added and is selected, the data type returned is the one given as 'Default' argument. This is useful e.g. if you want to return a data type that comes from an input data set.

Definition at line 1238 of file parameter_data.cpp.

References CSG_Parameter_Choice::Get_Data(), SG_Data_Type_Get_Type(), and SG_DATATYPE_Undefined.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Data_Type::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_Choice.

Definition at line 720 of file parameters.h.

References PARAMETER_TYPE_Data_Type.

◆ Set_Data_Type()

bool CSG_Parameter_Data_Type::Set_Data_Type ( TSG_Data_Type Value )

Select a data type from the choices list after it has been initialized. Useful e.g. when adjusting a default data type in CSG_Tool::On_Parameters_Changed() to a changed input data selection.

Definition at line 1216 of file parameter_data.cpp.

References CSG_Parameter_Choice::Get_Count(), CSG_Parameter_Choice::Get_Item_Data(), CSG_Parameter::Set_Value(), and SG_Data_Type_Get_Type().

◆ Set_Data_Types()

bool CSG_Parameter_Data_Type::Set_Data_Types | ( | int | Data_Types,
 |  | TSG_Data_Type | Default = SG_DATATYPE_Undefined,
 |  | const CSG_String & | User = ""
 | ) |  |

This function initializes the data types available for selection. The Data_Types argument expects a combination of data type flags as defined in <api_core.h>, e.g. SG_DATATYPES_Integer or SG_DATATYPES_Numeric. You can add an additional choice with the User argument, e.g. to offer a type related to an selected input data set.

Definition at line 1149 of file parameter_data.cpp.

References CSG_Parameter_Choice::Add_Item(), ADD_TYPE, CSG_Parameter_Choice::Get_Count(), CSG_String::is_Empty(), CSG_Parameter::Set_Default(), CSG_Parameter::Set_Value(), SG_Data_Type_Get_Identifier(), SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Undefined, SG_DATATYPE_Word, SG_DATATYPES_Bit, SG_DATATYPES_Integer, SG_DATATYPES_Numeric, SG_DATATYPES_Standard, SG_DATATYPES_Table, and SG_DATATYPES_Undefined.

Referenced by CSG_Parameters::Add_Data_Type().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 737 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Data_Type Member List

This is the complete list of members for CSG_Parameter_Data_Type, including all inherited members.

_asDouble(void) const | CSG_Parameter_Choice | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Choice | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Data_Type | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Type | protectedvirtual
_Set_String(void) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Choice | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Choice | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(const CSG_String &Item, const CSG_String &Data="") | CSG_Parameter_Choice |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Choice(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Choice | protected
CSG_Parameter_Data_Type(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Type | protected
CSG_Parameters class | CSG_Parameter_Data_Type | friend
Del_Items(void) | CSG_Parameter_Choice |
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_Count(void) const | CSG_Parameter_Choice | inline
Get_Data(void) const | CSG_Parameter_Choice |
Get_Data(CSG_String &Value) const | CSG_Parameter_Choice |
Get_Data(int &Value) const | CSG_Parameter_Choice |
Get_Data(double &Value) const | CSG_Parameter_Choice |
Get_Data_Type(TSG_Data_Type Default=SG_DATATYPE_Undefined) const | CSG_Parameter_Data_Type |
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_Choice |
Get_Item_Data(int Index) const | CSG_Parameter_Choice |
Get_Items(void) const | CSG_Parameter_Choice |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Data_Type | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Choice | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Data | CSG_Parameter_Choice | protected
m_Items | CSG_Parameter_Choice | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Choice | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Data_Type(TSG_Data_Type Value) | CSG_Parameter_Data_Type |
Set_Data_Types(int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="") | CSG_Parameter_Data_Type |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Items(const SG_Char *String) | CSG_Parameter_Choice |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter_Choice | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Date Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Date Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Date:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Date (const CSG_DateTime &Date)
const CSG_DateTime & | Get_Date (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Date (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_DateTime m_Date
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 570 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Date()

CSG_Parameter_Date::CSG_Parameter_Date | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 634 of file parameter_data.cpp.

References _Set_Value(), and CSG_DateTime::Now().

Member Function Documentation

◆ _asDouble()

double CSG_Parameter_Date::_asDouble ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 704 of file parameter_data.cpp.

References CSG_DateTime::Get_JDN(), and m_Date.

◆ _asInt()

int CSG_Parameter_Date::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 698 of file parameter_data.cpp.

References CSG_Parameter::asDouble().

◆ _Assign()

bool CSG_Parameter_Date::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 716 of file parameter_data.cpp.

References m_Date.

◆ _Serialize()

bool CSG_Parameter_Date::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 724 of file parameter_data.cpp.

References _Set_Value(), CSG_Parameter::asString(), CSG_MetaData::Get_Content(), and CSG_MetaData::Set_Content().

◆ _Set_String()

void CSG_Parameter_Date::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 692 of file parameter_data.cpp.

References CSG_DateTime::Format_ISODate(), m_Date, and CSG_Parameter::m_String.

◆ _Set_Value() [1/3]

int CSG_Parameter_Date::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 660 of file parameter_data.cpp.

References CSG_DateTime::is_EqualTo(), m_Date, CSG_DateTime::Parse_Date(), CSG_DateTime::Parse_ISODate(), CSG_DateTime::Set(), SG_PARAMETER_DATA_SET_CHANGED, SG_PARAMETER_DATA_SET_FALSE, and SG_PARAMETER_DATA_SET_TRUE.

◆ _Set_Value() [2/3]

int CSG_Parameter_Date::_Set_Value ( double Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 646 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), m_Date, CSG_DateTime::Set(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ _Set_Value() [3/3]

int CSG_Parameter_Date::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 641 of file parameter_data.cpp.

Referenced by _Serialize(), and CSG_Parameter_Date().

◆ Get_Date()

const CSG_DateTime& CSG_Parameter_Date::Get_Date ( void ) const
inline

Definition at line 577 of file parameters.h.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Date::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 574 of file parameters.h.

References PARAMETER_TYPE_Date.

◆ Set_Date()

void CSG_Parameter_Date::Set_Date ( const CSG_DateTime & Date )

Definition at line 710 of file parameter_data.cpp.

References m_Date.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 600 of file parameters.h.

Member Data Documentation

◆ m_Date

CSG_DateTime CSG_Parameter_Date::m_Date
protected

Definition at line 584 of file parameters.h.

Referenced by _asDouble(), _Assign(), _Set_String(), _Set_Value(), and Set_Date().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Date Member List

This is the complete list of members for CSG_Parameter_Date, including all inherited members.

_asDouble(void) const | CSG_Parameter_Date | protectedvirtual
_asInt(void) const | CSG_Parameter_Date | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Date | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Date | protectedvirtual
_Set_String(void) | CSG_Parameter_Date | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Date | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Date | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Date | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Date(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Date | protected
CSG_Parameters class | CSG_Parameter_Date | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Date(void) const | CSG_Parameter_Date | inline
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Date | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Date | CSG_Parameter_Date | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Date(const CSG_DateTime &Date) | CSG_Parameter_Date |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Degree Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Degree Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Degree:
CSG_Parameter_Double CSG_Parameter_Value CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Double
virtual bool | is_Default (void) const
- Public Member Functions inherited from CSG_Parameter_Value
bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Degree (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
- Protected Member Functions inherited from CSG_Parameter_Double
CSG_Parameter_Double (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Value
CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Double
double | m_Value
- Protected Attributes inherited from CSG_Parameter_Value
bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 545 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Degree()

CSG_Parameter_Degree::CSG_Parameter_Degree | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 608 of file parameter_data.cpp.

Member Function Documentation

◆ _Set_String()

void CSG_Parameter_Degree::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter_Double.

Definition at line 621 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), CSG_Parameter::m_String, and SG_Double_To_Degree().

◆ _Set_Value()

int CSG_Parameter_Degree::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter_Double.

Definition at line 615 of file parameter_data.cpp.

References CSG_Parameter_Double::_Set_Value(), and SG_Degree_To_Double().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Degree::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_Double.

Definition at line 549 of file parameters.h.

References PARAMETER_TYPE_Degree.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 561 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Degree Member List

This is the complete list of members for CSG_Parameter_Degree, including all inherited members.

_asDouble(void) const | CSG_Parameter_Double | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Double | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Double | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Double | protectedvirtual
_Set_String(void) | CSG_Parameter_Degree | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Degree | protectedvirtual
CSG_Parameter_Double::_Set_Value(int Value) | CSG_Parameter_Double | protectedvirtual
CSG_Parameter_Double::_Set_Value(double Value) | CSG_Parameter_Double | protectedvirtual
CSG_Parameter_Value::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Degree(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Degree | protected
CSG_Parameter_Double(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Double | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Degree | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Degree | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Double | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Double | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Double Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Double Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Double:
CSG_Parameter_Value CSG_Parameter CSG_Parameter_Degree

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | is_Default (void) const
- Public Member Functions inherited from CSG_Parameter_Value
bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Double (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Value
CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

double | m_Value
- Protected Attributes inherited from CSG_Parameter_Value
bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 507 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Double()

CSG_Parameter_Double::CSG_Parameter_Double | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 519 of file parameter_data.cpp.

References m_Value.

Member Function Documentation

◆ _asDouble()

virtual double CSG_Parameter_Double::_asDouble ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 530 of file parameters.h.

◆ _asInt()

virtual int CSG_Parameter_Double::_asInt ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 529 of file parameters.h.

◆ _Assign()

bool CSG_Parameter_Double::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Value.

Definition at line 578 of file parameter_data.cpp.

References CSG_Parameter_Value::_Assign(), _Set_Value(), and CSG_Parameter::asDouble().

◆ _Serialize()

bool CSG_Parameter_Double::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 586 of file parameter_data.cpp.

References CSG_String::asDouble(), CSG_MetaData::Fmt_Content(), CSG_MetaData::Get_Content(), m_Value, and SG_Get_Significant_Decimals().

◆ _Set_String()

void CSG_Parameter_Double::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Degree.

Definition at line 572 of file parameter_data.cpp.

References CSG_Parameter::m_String, m_Value, CSG_String::Printf(), and SG_Get_Significant_Decimals().

◆ _Set_Value() [1/3]

int CSG_Parameter_Double::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Degree.

Definition at line 559 of file parameter_data.cpp.

References _Set_Value(), CSG_String::asDouble(), and SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [2/3]

int CSG_Parameter_Double::_Set_Value ( double Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 537 of file parameter_data.cpp.

References _Set_Value(), CSG_Parameter_Value::m_bMaximum, CSG_Parameter_Value::m_bMinimum, CSG_Parameter_Value::m_Maximum, CSG_Parameter_Value::m_Minimum, m_Value, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ _Set_Value() [3/3]

int CSG_Parameter_Double::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 532 of file parameter_data.cpp.

Referenced by _Assign(), CSG_Parameter_Degree::_Set_Value(), and _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Double::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Reimplemented in CSG_Parameter_Degree.

Definition at line 511 of file parameters.h.

References PARAMETER_TYPE_Double.

◆ is_Default()

bool CSG_Parameter_Double::is_Default ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 526 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), CSG_Parameter::Get_Default(), and m_Value.

Referenced by CSG_Parameter_Range::is_Default().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 536 of file parameters.h.

Member Data Documentation

◆ m_Value

double CSG_Parameter_Double::m_Value
protected

Definition at line 520 of file parameters.h.

Referenced by _Serialize(), _Set_String(), _Set_Value(), CSG_Parameter_Double(), and is_Default().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Double Member List

This is the complete list of members for CSG_Parameter_Double, including all inherited members.

_asDouble(void) const | CSG_Parameter_Double | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Double | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Double | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Double | protectedvirtual
_Set_String(void) | CSG_Parameter_Double | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Double | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Double | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Double | protectedvirtual
CSG_Parameter_Value::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Double(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Double | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Double | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Double | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Double | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Double | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_File_Name Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_File_Name Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_File_Name:
CSG_Parameter_String CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Filter (const SG_Char *Filter)
const SG_Char * | Get_Filter (void) const
void | Set_Flag_Save (bool bFlag)
bool | is_Save (void) const
void | Set_Flag_Multiple (bool bFlag)
bool | is_Multiple (void) const
void | Set_Flag_Directory (bool bFlag)
bool | is_Directory (void) const
bool | Get_FilePaths (CSG_Strings &FilePaths) const
- Public Member Functions inherited from CSG_Parameter_String
virtual bool | is_Valid (void) const
void | Set_Password (bool bOn)
bool | is_Password (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_File_Name (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_String
CSG_Parameter_String (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (const CSG_String &Value)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

bool | m_bSave
bool | m_bMultiple
bool | m_bDirectory
CSG_String m_Filter
- Protected Attributes inherited from CSG_Parameter_String
bool | m_bPassword
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 852 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_File_Name()

CSG_Parameter_File_Name::CSG_Parameter_File_Name | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1530 of file parameter_data.cpp.

References _TL, m_bDirectory, m_bMultiple, m_bSave, m_Filter, and CSG_String::Printf().

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_File_Name::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_String.

Definition at line 1606 of file parameter_data.cpp.

References CSG_Parameter_String::_Assign(), CSG_Parameter::asFilePath(), CSG_String::c_str(), m_bDirectory, m_bMultiple, m_bSave, m_Filter, and Set_Filter().

◆ Get_FilePaths()

bool CSG_Parameter_File_Name::Get_FilePaths ( CSG_Strings & FilePaths ) const

Definition at line 1575 of file parameter_data.cpp.

References CSG_Strings::Add(), CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), CSG_String::Length(), m_bMultiple, and CSG_Parameter::m_String.

◆ Get_Filter()

const SG_Char * CSG_Parameter_File_Name::Get_Filter ( void ) const

Definition at line 1553 of file parameter_data.cpp.

References CSG_String::c_str(), and m_Filter.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_File_Name::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_String.

Definition at line 856 of file parameters.h.

References PARAMETER_TYPE_FilePath.

◆ is_Directory()

bool CSG_Parameter_File_Name::is_Directory ( void ) const
inline

Definition at line 868 of file parameters.h.

◆ is_Multiple()

bool CSG_Parameter_File_Name::is_Multiple ( void ) const
inline

Definition at line 865 of file parameters.h.

◆ is_Save()

bool CSG_Parameter_File_Name::is_Save ( void ) const
inline

Definition at line 862 of file parameters.h.

◆ Set_Filter()

void CSG_Parameter_File_Name::Set_Filter ( const SG_Char * Filter )

Definition at line 1541 of file parameter_data.cpp.

References _TL, m_Filter, and CSG_String::Printf().

Referenced by _Assign(), and CSG_Parameters::Add_FilePath().

◆ Set_Flag_Directory()

void CSG_Parameter_File_Name::Set_Flag_Directory ( bool bFlag )

Definition at line 1569 of file parameter_data.cpp.

References m_bDirectory.

Referenced by CSG_Parameters::Add_FilePath().

◆ Set_Flag_Multiple()

void CSG_Parameter_File_Name::Set_Flag_Multiple ( bool bFlag )

Definition at line 1564 of file parameter_data.cpp.

References m_bMultiple.

Referenced by CSG_Parameters::Add_FilePath().

◆ Set_Flag_Save()

void CSG_Parameter_File_Name::Set_Flag_Save ( bool bFlag )

Definition at line 1559 of file parameter_data.cpp.

References m_bSave.

Referenced by CSG_Parameters::Add_FilePath().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 885 of file parameters.h.

Member Data Documentation

◆ m_bDirectory

bool CSG_Parameter_File_Name::m_bDirectory
protected

Definition at line 877 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_File_Name(), and Set_Flag_Directory().

◆ m_bMultiple

bool CSG_Parameter_File_Name::m_bMultiple
protected

Definition at line 877 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_File_Name(), Get_FilePaths(), and Set_Flag_Multiple().

◆ m_bSave

bool CSG_Parameter_File_Name::m_bSave
protected

Definition at line 877 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_File_Name(), and Set_Flag_Save().

◆ m_Filter

CSG_String CSG_Parameter_File_Name::m_Filter
protected

Definition at line 879 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_File_Name(), Get_Filter(), and Set_Filter().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_File_Name Member List

This is the complete list of members for CSG_Parameter_File_Name, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_File_Name | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_String | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_String | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_File_Name(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_File_Name | protected
CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_String | protected
CSG_Parameters class | CSG_Parameter_File_Name | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_FilePaths(CSG_Strings &FilePaths) const | CSG_Parameter_File_Name |
Get_Filter(void) const | CSG_Parameter_File_Name |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_File_Name | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Directory(void) const | CSG_Parameter_File_Name | inline
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Multiple(void) const | CSG_Parameter_File_Name | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Password(void) const | CSG_Parameter_String |
is_Save(void) const | CSG_Parameter_File_Name | inline
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_String | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bDirectory | CSG_Parameter_File_Name | protected
m_bMultiple | CSG_Parameter_File_Name | protected
m_bPassword | CSG_Parameter_String | protected
m_bSave | CSG_Parameter_File_Name | protected
m_Filter | CSG_Parameter_File_Name | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Filter(const SG_Char *Filter) | CSG_Parameter_File_Name |
Set_Flag_Directory(bool bFlag) | CSG_Parameter_File_Name |
Set_Flag_Multiple(bool bFlag) | CSG_Parameter_File_Name |
Set_Flag_Save(bool bFlag) | CSG_Parameter_File_Name |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Password(bool bOn) | CSG_Parameter_String |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Fixed_Table Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Fixed_Table Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Fixed_Table:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Fixed_Table (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Table m_Table
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 989 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Fixed_Table()

CSG_Parameter_Fixed_Table::CSG_Parameter_Fixed_Table | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1875 of file parameter_data.cpp.

References _TL, m_Table, and CSG_Data_Object::Set_Name().

Member Function Documentation

◆ _asPointer()

void * CSG_Parameter_Fixed_Table::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1888 of file parameter_data.cpp.

References m_Table.

◆ _Assign()

bool CSG_Parameter_Fixed_Table::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1894 of file parameter_data.cpp.

References CSG_Parameter::asTable(), CSG_Table::Create(), and m_Table.

◆ _Serialize()

bool CSG_Parameter_Fixed_Table::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1900 of file parameter_data.cpp.

References CSG_MetaData::Add_Child(), CSG_Table::Add_Field(), CSG_Table::Add_Record(), CSG_Table::Assign_Values(), CSG_Table_Record::asString(), CSG_MetaData::Get_Child(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Name(), CSG_Table::Get_Field_Type(), CSG_MetaData::Get_Property(), CSG_Table::Get_Record(), gSG_Data_Type_Identifier, m_Table, CSG_MetaData::Set_Property(), CSG_Table_Record::Set_Value(), SG_Data_Type_Get_Type(), SG_DATATYPE_String, and SG_DATATYPE_Undefined.

◆ _Set_String()

void CSG_Parameter_Fixed_Table::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1882 of file parameter_data.cpp.

References _TL, CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Data_Object::Get_Name(), CSG_Parameter::m_String, m_Table, and CSG_String::Printf().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Fixed_Table::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 993 of file parameters.h.

References PARAMETER_TYPE_FixedTable.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1011 of file parameters.h.

Member Data Documentation

◆ m_Table

CSG_Table CSG_Parameter_Fixed_Table::m_Table
protected

Definition at line 1000 of file parameters.h.

Referenced by _asPointer(), _Assign(), _Serialize(), _Set_String(), and CSG_Parameter_Fixed_Table().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Fixed_Table Member List

This is the complete list of members for CSG_Parameter_Fixed_Table, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Fixed_Table | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Fixed_Table | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Fixed_Table | protectedvirtual
_Set_String(void) | CSG_Parameter_Fixed_Table | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Fixed_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Fixed_Table | protected
CSG_Parameters class | CSG_Parameter_Fixed_Table | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Fixed_Table | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
m_Table | CSG_Parameter_Fixed_Table | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Font Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Font Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Font:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | Restore_Default (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Font (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

int m_Color
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 894 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Font()

CSG_Parameter_Font::CSG_Parameter_Font | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1627 of file parameter_data.cpp.

References Restore_Default().

Member Function Documentation

◆ _asInt()

int CSG_Parameter_Font::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1675 of file parameter_data.cpp.

References m_Color.

◆ _asPointer()

void * CSG_Parameter_Font::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1681 of file parameter_data.cpp.

References CSG_String::c_str(), and CSG_Parameter::m_String.

◆ _Assign()

bool CSG_Parameter_Font::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1687 of file parameter_data.cpp.

References m_Color, and CSG_Parameter::m_String.

◆ _Serialize()

bool CSG_Parameter_Font::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1696 of file parameter_data.cpp.

References _Set_Value(), CSG_MetaData::Add_Child(), CSG_Parameter::asInt(), CSG_String::Format(), m_Color, CSG_Parameter::m_String, SG_GET_B, SG_GET_G, SG_GET_R, and SG_GET_RGB.

◆ _Set_Value() [1/2]

int CSG_Parameter_Font::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1660 of file parameter_data.cpp.

References CSG_String::is_Empty(), CSG_Parameter::m_String, Restore_Default(), and SG_PARAMETER_DATA_SET_CHANGED.

◆ _Set_Value() [2/2]

int CSG_Parameter_Font::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1647 of file parameter_data.cpp.

References m_Color, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Serialize().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Font::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 898 of file parameters.h.

References PARAMETER_TYPE_Font.

◆ Restore_Default()

bool CSG_Parameter_Font::Restore_Default ( void )
virtual

Reimplemented from CSG_Parameter.

Definition at line 1634 of file parameter_data.cpp.

References m_Color, CSG_Parameter::m_String, and SG_GET_RGB.

Referenced by _Set_Value(), and CSG_Parameter_Font().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 920 of file parameters.h.

Member Data Documentation

◆ m_Color

int CSG_Parameter_Font::m_Color
protected

Definition at line 907 of file parameters.h.

Referenced by _asInt(), _Assign(), _Serialize(), _Set_Value(), and Restore_Default().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Font Member List

This is the complete list of members for CSG_Parameter_Font, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_Font | protectedvirtual
_asPointer(void) const | CSG_Parameter_Font | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Font | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Font | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Font | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Font | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Font(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Font | protected
CSG_Parameters class | CSG_Parameter_Font | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Font | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Color | CSG_Parameter_Font | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter_Font | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Grid Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Grid Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Grid:
CSG_Parameter_Data_Object CSG_Parameter CSG_Parameter_Grids

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Preferred_Type (TSG_Data_Type Type)
TSG_Data_Type | Get_Preferred_Type (void) const
CSG_Grid_System * | Get_System (void) const
bool | Add_Default (double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Grid (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual const SG_Char * | _asString (void) const

Protected Attributes

int m_Default
TSG_Data_Type m_Type
- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1193 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Grid()

CSG_Parameter_Grid::CSG_Parameter_Grid | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2672 of file parameter_data.cpp.

References m_Default, m_Type, and SG_DATATYPE_Undefined.

Member Function Documentation

◆ _asDouble()

double CSG_Parameter_Grid::_asDouble ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2780 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), CSG_Parameter::Get_Child(), and m_Default.

◆ _asInt()

int CSG_Parameter_Grid::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2774 of file parameter_data.cpp.

References CSG_Parameter::asInt(), CSG_Parameter::Get_Child(), and m_Default.

◆ _Assign()

bool CSG_Parameter_Grid::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2786 of file parameter_data.cpp.

References _Set_Value(), CSG_Parameter::asPointer(), m_Default, and m_Type.

◆ _Set_Value()

int CSG_Parameter_Grid::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2712 of file parameter_data.cpp.

References CSG_Parameter::asDataObject(), CSG_Parameter::asGridList(), CSG_Parameter::asGridsList(), CSG_Parameter::asList(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter_List::Get_Item_Count(), CSG_Parameter::Get_Parent(), Get_System(), CSG_Parameter_Grid_List::Get_System(), CSG_Parameter_Grids_List::Get_System(), Get_Type(), CSG_Parameter::Get_Type(), CSG_Parameter::is_DataObject_List(), CSG_Grid_System::is_Equal(), CSG_Parameter::is_Input(), CSG_Grid_System::is_Valid(), m_Default, CSG_Parameter_Data_Object::m_pDataObject, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, CSG_Parameter::Set_Enabled(), CSG_Parameter::Set_Value(), SG_PARAMETER_DATA_SET_CHANGED, SG_PARAMETER_DATA_SET_FALSE, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Assign().

◆ Add_Default()

bool CSG_Parameter_Grid::Add_Default | ( | double | Value,
 |  | double | Minimum,
 |  | bool | bMinimum,
 |  | double | Maximum,
 |  | bool | bMaximum
 | ) |  |

Definition at line 2696 of file parameter_data.cpp.

References _TL, CSG_Parameters::Add_Double(), CSG_String::Format(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Identifier(), CSG_Parameter::Get_Parameters(), CSG_Parameter::is_Input(), CSG_Parameter::is_Optional(), and m_Default.

◆ Get_Preferred_Type()

TSG_Data_Type CSG_Parameter_Grid::Get_Preferred_Type ( void ) const
inline

Definition at line 1200 of file parameters.h.

◆ Get_System()

CSG_Grid_System * CSG_Parameter_Grid::Get_System ( void ) const

Definition at line 2685 of file parameter_data.cpp.

References CSG_Parameter::asGrid_System(), CSG_Parameter::Get_Parent(), Get_Type(), and PARAMETER_TYPE_Grid_System.

Referenced by _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Grid::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Reimplemented in CSG_Parameter_Grids.

Definition at line 1197 of file parameters.h.

References PARAMETER_TYPE_Grid.

Referenced by _Set_Value(), and Get_System().

◆ Set_Preferred_Type()

void CSG_Parameter_Grid::Set_Preferred_Type ( TSG_Data_Type Type )

Definition at line 2679 of file parameter_data.cpp.

References m_Type.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1224 of file parameters.h.

Member Data Documentation

◆ m_Default

int CSG_Parameter_Grid::m_Default
protected

Definition at line 1211 of file parameters.h.

Referenced by _asDouble(), _asInt(), _Assign(), _Set_Value(), Add_Default(), and CSG_Parameter_Grid().

◆ m_Type

TSG_Data_Type CSG_Parameter_Grid::m_Type
protected

Definition at line 1213 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Grid(), and Set_Preferred_Type().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Grid Member List

This is the complete list of members for CSG_Parameter_Grid, including all inherited members.

_asDouble(void) const | CSG_Parameter_Grid | protectedvirtual
_asInt(void) const | CSG_Parameter_Grid | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Grid | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Grid | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum) | CSG_Parameter_Grid |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_Grid(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grid | protected
CSG_Parameters class | CSG_Parameter_Grid | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Preferred_Type(void) const | CSG_Parameter_Grid | inline
Get_System(void) const | CSG_Parameter_Grid |
Get_Type(void) const | CSG_Parameter_Grid | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Default | CSG_Parameter_Grid | protected
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
m_Type | CSG_Parameter_Grid | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Preferred_Type(TSG_Data_Type Type) | CSG_Parameter_Grid |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Grid_List Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Grid_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Grid_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_Grid_System * | Get_System (void) const
virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
virtual bool | Update_Data (void)
int | Get_Grid_Count (void) const
CSG_Grid * | Get_Grid (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Grid_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Array_Pointer m_Grids
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1401 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Grid_List()

CSG_Parameter_Grid_List::CSG_Parameter_Grid_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3161 of file parameter_data.cpp.

Member Function Documentation

◆ Add_Item()

bool CSG_Parameter_Grid_List::Add_Item ( CSG_Data_Object * pItem )
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3179 of file parameter_data.cpp.

References CSG_Parameter_List::Add_Item(), CSG_Parameter::asDataObject(), CSG_Parameter::asGridList(), CSG_Parameter::asGridsList(), CSG_Parameter::asList(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter_List::Get_Item_Count(), CSG_Data_Object::Get_ObjectType(), CSG_Parameter::Get_Parent(), Get_System(), CSG_Parameter_Grids_List::Get_System(), CSG_Parameter::Get_Type(), CSG_Parameter::is_DataObject_List(), CSG_Parameter::is_Input(), CSG_Grid_System::is_Valid(), PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, CSG_Parameter::Set_Value(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, and Update_Data().

◆ Del_Item() [1/2]

bool CSG_Parameter_Grid_List::Del_Item | ( | CSG_Data_Object * | pItem,
 |  | bool | bUpdateData = true
 | ) |  |
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3238 of file parameter_data.cpp.

References CSG_Parameter_List::Del_Item().

◆ Del_Item() [2/2]

bool CSG_Parameter_Grid_List::Del_Item | ( | int | Index,
 |  | bool | bUpdateData = true
 | ) |  |
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3244 of file parameter_data.cpp.

References CSG_Parameter_List::Del_Item().

◆ Del_Items()

bool CSG_Parameter_Grid_List::Del_Items ( void )
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3250 of file parameter_data.cpp.

References CSG_Parameter_List::Del_Items(), and Update_Data().

◆ Get_Grid()

CSG_Grid* CSG_Parameter_Grid_List::Get_Grid ( int Index ) const
inline

Definition at line 1417 of file parameters.h.

◆ Get_Grid_Count()

int CSG_Parameter_Grid_List::Get_Grid_Count ( void ) const
inline

Definition at line 1416 of file parameters.h.

◆ Get_System()

CSG_Grid_System * CSG_Parameter_Grid_List::Get_System ( void ) const

Definition at line 3168 of file parameter_data.cpp.

References CSG_Parameter::asGrid_System(), CSG_Parameter::Get_Parent(), Get_Type(), and PARAMETER_TYPE_Grid_System.

Referenced by CSG_Parameter_Grid::_Set_Value(), and Add_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Grid_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1405 of file parameters.h.

References PARAMETER_TYPE_Grid_List.

Referenced by Get_System().

◆ Update_Data()

bool CSG_Parameter_Grid_List::Update_Data ( void )
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3256 of file parameter_data.cpp.

References CSG_Array_Pointer::Add(), CSG_Parameter::asGrid_System(), CSG_Grid_System::Destroy(), CSG_Parameter::Get_Children_Count(), CSG_Grids::Get_Grid_Count(), CSG_Grids::Get_Grid_Ptr(), CSG_Parameter_List::Get_Item(), CSG_Parameter_List::Get_Item_Count(), CSG_Data_Object::Get_ObjectType(), CSG_Parameter::Get_Parameters(), CSG_Parameter::Get_Parent(), CSG_Array_Pointer::Get_Size(), CSG_Parameter::Get_Type(), CSG_Parameters::has_GUI(), m_Grids, PARAMETER_TYPE_Grid_System, CSG_Array_Pointer::Set_Array(), SG_DATAOBJECT_TYPE_Grid, and SG_DATAOBJECT_TYPE_Grids.

Referenced by Add_Item(), and Del_Items().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1427 of file parameters.h.

Member Data Documentation

◆ m_Grids

CSG_Array_Pointer CSG_Parameter_Grid_List::m_Grids
protected

Definition at line 1424 of file parameters.h.

Referenced by Update_Data().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:13 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Grid_List Member List

This is the complete list of members for CSG_Parameter_Grid_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_Grid_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Grid_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grid_List | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameters class | CSG_Parameter_Grid_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_Grid_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_Grid_List | virtual
Del_Items(void) | CSG_Parameter_Grid_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Grid(int Index) const | CSG_Parameter_Grid_List | inline
Get_Grid_Count(void) const | CSG_Parameter_Grid_List | inline
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_System(void) const | CSG_Parameter_Grid_List |
Get_Type(void) const | CSG_Parameter_Grid_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Grids | CSG_Parameter_Grid_List | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_Grid_List | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Grid_System Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Grid_System Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Grid_System:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Grid_System (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Grid_System m_System
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1020 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Grid_System()

CSG_Parameter_Grid_System::CSG_Parameter_Grid_System | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1985 of file parameter_data.cpp.

Member Function Documentation

◆ _asPointer()

void * CSG_Parameter_Grid_System::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2098 of file parameter_data.cpp.

References m_System.

◆ _Assign()

bool CSG_Parameter_Grid_System::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2104 of file parameter_data.cpp.

References m_System.

◆ _Serialize()

bool CSG_Parameter_Grid_System::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2112 of file parameter_data.cpp.

References CSG_MetaData::Add_Child(), CSG_String::asDouble(), CSG_Grid_System::Assign(), CSG_Grid_System::Get_Cellsize(), CSG_MetaData::Get_Content(), CSG_Grid_System::Get_Extent(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), m_System, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ _Set_String()

void CSG_Parameter_Grid_System::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2092 of file parameter_data.cpp.

References CSG_Grid_System::Get_Name(), CSG_Parameter::m_String, and m_System.

◆ _Set_Value()

int CSG_Parameter_Grid_System::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1992 of file parameter_data.cpp.

References CSG_Parameter::asDataObject(), CSG_Parameter::asList(), CSG_Grid_System::Create(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter_List::Del_Item(), CSG_Parameter_List::Del_Items(), CSG_Data_Manager::Exists(), CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter_List::Get_Item(), CSG_Parameter_List::Get_Item_Count(), CSG_Parameter::Get_Manager(), CSG_Data_Object::Get_ObjectType(), CSG_Parameter::Get_Parameters(), CSG_Parameter::has_Changed(), CSG_Parameter::is_DataObject(), CSG_Parameter::is_DataObject_List(), CSG_Grid_System::is_Equal(), CSG_Grid_System::is_Valid(), m_System, CSG_Parameters::Set_Callback(), CSG_Parameter::Set_Value(), SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Grid_System::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1024 of file parameters.h.

References PARAMETER_TYPE_Grid_System.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1044 of file parameters.h.

Member Data Documentation

◆ m_System

CSG_Grid_System CSG_Parameter_Grid_System::m_System
protected

Definition at line 1031 of file parameters.h.

Referenced by _asPointer(), _Assign(), _Serialize(), _Set_String(), and _Set_Value().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Grid_System Member List

This is the complete list of members for CSG_Parameter_Grid_System, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Grid_System | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Grid_System | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Grid_System | protectedvirtual
_Set_String(void) | CSG_Parameter_Grid_System | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Grid_System | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Grid_System(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grid_System | protected
CSG_Parameters class | CSG_Parameter_Grid_System | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Grid_System | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
m_System | CSG_Parameter_Grid_System | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Grids Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Grids Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Grids:
CSG_Parameter_Grid CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Grid
void | Set_Preferred_Type (TSG_Data_Type Type)
TSG_Data_Type | Get_Preferred_Type (void) const
CSG_Grid_System * | Get_System (void) const
bool | Add_Default (double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Grids (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_Grid
CSG_Parameter_Grid (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Grid
int m_Default
TSG_Data_Type m_Type
- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1233 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Grids()

CSG_Parameter_Grids::CSG_Parameter_Grids | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2802 of file parameter_data.cpp.

Member Function Documentation

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Grids::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_Grid.

Definition at line 1237 of file parameters.h.

References PARAMETER_TYPE_Grids.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1245 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Grids Member List

This is the complete list of members for CSG_Parameter_Grids, including all inherited members.

_asDouble(void) const | CSG_Parameter_Grid | protectedvirtual
_asInt(void) const | CSG_Parameter_Grid | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Grid | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Grid | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum) | CSG_Parameter_Grid |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_Grid(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grid | protected
CSG_Parameter_Grids(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grids | protected
CSG_Parameters class | CSG_Parameter_Grids | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Preferred_Type(void) const | CSG_Parameter_Grid | inline
Get_System(void) const | CSG_Parameter_Grid |
Get_Type(void) const | CSG_Parameter_Grids | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Default | CSG_Parameter_Grid | protected
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
m_Type | CSG_Parameter_Grid | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Preferred_Type(TSG_Data_Type Type) | CSG_Parameter_Grid |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Grids_List Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Grids_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Grids_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_Grid_System * | Get_System (void) const
virtual bool | Add_Item (CSG_Data_Object *pItem)
CSG_Grids * | Get_Grids (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Grids_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1436 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Grids_List()

CSG_Parameter_Grids_List::CSG_Parameter_Grids_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3301 of file parameter_data.cpp.

Member Function Documentation

◆ Add_Item()

bool CSG_Parameter_Grids_List::Add_Item ( CSG_Data_Object * pItem )
virtual

Reimplemented from CSG_Parameter_List.

Definition at line 3319 of file parameter_data.cpp.

References CSG_Parameter_List::Add_Item(), CSG_Parameter::asDataObject(), CSG_Parameter::asGridsList(), CSG_Parameter::asList(), DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter_List::Get_Item_Count(), CSG_Data_Object::Get_ObjectType(), CSG_Parameter::Get_Parent(), Get_System(), Get_Type(), CSG_Parameter::Get_Type(), CSG_Parameter::is_DataObject_List(), CSG_Grid_System::is_Equal(), CSG_Grid_System::is_Valid(), PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, CSG_Parameter::Set_Value(), and SG_DATAOBJECT_TYPE_Grids.

◆ Get_Grids()

CSG_Grids* CSG_Parameter_Grids_List::Get_Grids ( int Index ) const
inline

Definition at line 1445 of file parameters.h.

References CSG_Parameter_List::Get_Item().

◆ Get_System()

CSG_Grid_System * CSG_Parameter_Grids_List::Get_System ( void ) const

Definition at line 3308 of file parameter_data.cpp.

References CSG_Parameter::asGrid_System(), CSG_Parameter::Get_Parent(), Get_Type(), and PARAMETER_TYPE_Grid_System.

Referenced by CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), and Add_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Grids_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1439 of file parameters.h.

References PARAMETER_TYPE_Grids_List.

Referenced by Add_Item(), and Get_System().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1453 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Grids_List Member List

This is the complete list of members for CSG_Parameter_Grids_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_Grids_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Grids_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Grids_List | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameters class | CSG_Parameter_Grids_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Grids(int Index) const | CSG_Parameter_Grids_List | inline
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_System(void) const | CSG_Parameter_Grids_List |
Get_Type(void) const | CSG_Parameter_Grids_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Int Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Int Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Int:
CSG_Parameter_Value CSG_Parameter CSG_Parameter_Color CSG_Parameter_Table_Field

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | is_Default (void) const
- Public Member Functions inherited from CSG_Parameter_Value
bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Int (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Value
CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

int | m_Value
- Protected Attributes inherited from CSG_Parameter_Value
bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 469 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Int()

CSG_Parameter_Int::CSG_Parameter_Int | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 430 of file parameter_data.cpp.

References m_Value.

Member Function Documentation

◆ _asDouble()

virtual double CSG_Parameter_Int::_asDouble ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field.

Definition at line 492 of file parameters.h.

◆ _asInt()

virtual int CSG_Parameter_Int::_asInt ( void ) const
inlineprotectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 491 of file parameters.h.

◆ _Assign()

bool CSG_Parameter_Int::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Value.

Reimplemented in CSG_Parameter_Table_Field.

Definition at line 489 of file parameter_data.cpp.

References CSG_Parameter_Value::_Assign(), _Set_Value(), and CSG_Parameter::asInt().

◆ _Serialize()

bool CSG_Parameter_Int::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field, and CSG_Parameter_Color.

Definition at line 497 of file parameter_data.cpp.

References CSG_String::asInt(), CSG_Parameter::asString(), CSG_MetaData::Get_Content(), m_Value, and CSG_MetaData::Set_Content().

◆ _Set_String()

void CSG_Parameter_Int::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field.

Definition at line 483 of file parameter_data.cpp.

References CSG_Parameter::m_String, m_Value, and CSG_String::Printf().

◆ _Set_Value() [1/3]

int CSG_Parameter_Int::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field, and CSG_Parameter_Color.

Definition at line 470 of file parameter_data.cpp.

References _Set_Value(), CSG_String::asInt(), and SG_PARAMETER_DATA_SET_FALSE.

◆ _Set_Value() [2/3]

int CSG_Parameter_Int::_Set_Value ( double Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 465 of file parameter_data.cpp.

References _Set_Value().

◆ _Set_Value() [3/3]

int CSG_Parameter_Int::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field.

Definition at line 443 of file parameter_data.cpp.

References CSG_Parameter_Value::m_bMaximum, CSG_Parameter_Value::m_bMinimum, CSG_Parameter_Value::m_Maximum, CSG_Parameter_Value::m_Minimum, m_Value, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Assign(), CSG_Parameter_Color::_Set_Value(), and _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Int::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field, and CSG_Parameter_Color.

Definition at line 473 of file parameters.h.

References PARAMETER_TYPE_Int.

◆ is_Default()

bool CSG_Parameter_Int::is_Default ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 437 of file parameter_data.cpp.

References CSG_Parameter::asInt(), CSG_Parameter::Get_Default(), and m_Value.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 498 of file parameters.h.

Member Data Documentation

◆ m_Value

int CSG_Parameter_Int::m_Value
protected

Definition at line 482 of file parameters.h.

Referenced by CSG_Parameter_Table_Field::_Assign(), _Serialize(), CSG_Parameter_Color::_Serialize(), _Set_String(), CSG_Parameter_Table_Field::_Set_String(), _Set_Value(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Int(), CSG_Parameter_Table_Field::CSG_Parameter_Table_Field(), and is_Default().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Int Member List

This is the complete list of members for CSG_Parameter_Int, including all inherited members.

_asDouble(void) const | CSG_Parameter_Int | inlineprotectedvirtual
_asInt(void) const | CSG_Parameter_Int | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Int | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Int | protectedvirtual
_Set_String(void) | CSG_Parameter_Int | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Int | protectedvirtual
_Set_Value(double Value) | CSG_Parameter_Int | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Int | protectedvirtual
CSG_Parameter_Value::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Int | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Int | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Int | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Int | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Int | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:14 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_List Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_List:
CSG_Parameter CSG_Parameter_Grid_List CSG_Parameter_Grids_List CSG_Parameter_PointCloud_List CSG_Parameter_Shapes_List CSG_Parameter_Table_List CSG_Parameter_TIN_List

Public Member Functions

virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
virtual TSG_Parameter_Type | Get_Type (void) const =0
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1358 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_List()

CSG_Parameter_List::CSG_Parameter_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3006 of file parameter_data.cpp.

Member Function Documentation

◆ _asInt()

int CSG_Parameter_List::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3093 of file parameter_data.cpp.

References Get_Item_Count().

◆ _asPointer()

void * CSG_Parameter_List::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3099 of file parameter_data.cpp.

References CSG_Array_Pointer::Get_Array().

◆ _Assign()

bool CSG_Parameter_List::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Shapes_List.

Definition at line 3105 of file parameter_data.cpp.

References Add_Item(), Del_Items(), CSG_Data_Manager::Exists(), Get_Item(), CSG_Parameter::Get_Manager(), and SG_Get_Data_Manager().

Referenced by CSG_Parameter_Shapes_List::_Assign().

◆ _Serialize()

bool CSG_Parameter_List::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3121 of file parameter_data.cpp.

References CSG_MetaData::Add_Child(), Add_Item(), CSG_String::BeforeFirst(), CSG_String::Cmp(), Del_Items(), CSG_Data_Manager::Find(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), CSG_Data_Object::Get_File_Name(), Get_Item(), Get_Item_Count(), CSG_Parameter::Get_Manager(), and SG_File_Exists().

◆ _Set_String()

void CSG_Parameter_List::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3068 of file parameter_data.cpp.

References _TL, Get_Item(), Get_Item_Count(), CSG_Data_Object::Get_Name(), CSG_Parameter::m_String, and CSG_String::Printf().

Referenced by Add_Item(), Del_Item(), and Del_Items().

◆ Add_Item()

bool CSG_Parameter_List::Add_Item ( CSG_Data_Object * pItem )
virtual

Reimplemented in CSG_Parameter_Grids_List, and CSG_Parameter_Grid_List.

Definition at line 3013 of file parameter_data.cpp.

References _Set_String(), CSG_Array_Pointer::Add(), DATAOBJECT_CREATE, and DATAOBJECT_NOTSET.

Referenced by _Assign(), _Serialize(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), and CSG_Parameters::Serialize_Compatibility().

◆ Del_Item() [1/2]

bool CSG_Parameter_List::Del_Item | ( | CSG_Data_Object * | pItem,
 |  | bool | bUpdateData = true
 | ) |  |
virtual

Reimplemented in CSG_Parameter_Grid_List.

Definition at line 3025 of file parameter_data.cpp.

References _Set_String(), and CSG_Array_Pointer::Del().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter::Check(), and CSG_Parameter_Grid_List::Del_Item().

◆ Del_Item() [2/2]

bool CSG_Parameter_List::Del_Item | ( | int | Index,
 |  | bool | bUpdateData = true
 | ) |  |
virtual

Reimplemented in CSG_Parameter_Grid_List.

Definition at line 3040 of file parameter_data.cpp.

References _Set_String(), and CSG_Array_Pointer::Del().

◆ Del_Items()

bool CSG_Parameter_List::Del_Items ( void )
virtual

Reimplemented in CSG_Parameter_Grid_List.

Definition at line 3055 of file parameter_data.cpp.

References _Set_String(), and CSG_Array_Pointer::Set_Array().

Referenced by _Assign(), _Serialize(), CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid_List::Del_Items(), and CSG_Parameters::Restore_Defaults().

◆ Get_Item()

CSG_Data_Object* CSG_Parameter_List::Get_Item ( int Index ) const
inline

Definition at line 1368 of file parameters.h.

Referenced by _Assign(), _Serialize(), _Set_String(), CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_TIN_List::asTIN(), CSG_Parameter::Check(), CSG_Tool::DataObject_Set_History(), CSG_Parameter_Grids_List::Get_Grids(), CSG_Parameter_PointCloud_List::Get_PointCloud(), CSG_Parameter_Shapes_List::Get_Shapes(), CSG_Parameter_Table_List::Get_Table(), CSG_Parameter::is_Value_Equal(), CSG_Parameters::Set_History(), and CSG_Parameter_Grid_List::Update_Data().

◆ Get_Item_Count()

int CSG_Parameter_List::Get_Item_Count ( void ) const
inline

Definition at line 1367 of file parameters.h.

Referenced by _asInt(), _Serialize(), _Set_String(), CSG_Parameter_Grid_System::_Set_Value(), CSG_Parameter_Grid::_Set_Value(), CSG_Parameter_Grid_List::Add_Item(), CSG_Parameter_Grids_List::Add_Item(), CSG_Parameter::is_Value_Equal(), CSG_Parameters::Set_History(), and CSG_Parameter_Grid_List::Update_Data().

◆ Update_Data()

virtual bool CSG_Parameter_List::Update_Data ( void )
inlinevirtual

Reimplemented in CSG_Parameter_Grid_List.

Definition at line 1370 of file parameters.h.

Referenced by CSG_Parameter::Check().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1392 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_List Member List

This is the complete list of members for CSG_Parameter_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameters class | CSG_Parameter_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const =0 | CSG_Parameter | pure virtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Node Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Node Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Node:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Node (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &MetaData, bool bSave)

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 374 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Node()

CSG_Parameter_Node::CSG_Parameter_Node | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 217 of file parameter_data.cpp.

Member Function Documentation

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Node::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 378 of file parameters.h.

References PARAMETER_TYPE_Node.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 385 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Node Member List

This is the complete list of members for CSG_Parameter_Node, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Node(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Node | protected
CSG_Parameters class | CSG_Parameter_Node | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Node | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Parameters Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Parameters Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Parameters:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | Restore_Default (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Parameters (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter_Parameters (void)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Parameters * m_pParameters
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1562 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Parameters()

CSG_Parameter_Parameters::CSG_Parameter_Parameters | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3452 of file parameter_data.cpp.

References CSG_Parameters, CSG_Parameters::Get_Owner(), and m_pParameters.

◆ ~CSG_Parameter_Parameters()

CSG_Parameter_Parameters::~CSG_Parameter_Parameters ( void )
protectedvirtual

Definition at line 3458 of file parameter_data.cpp.

References m_pParameters.

Member Function Documentation

◆ _asPointer()

void * CSG_Parameter_Parameters::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3476 of file parameter_data.cpp.

References m_pParameters.

◆ _Assign()

bool CSG_Parameter_Parameters::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3482 of file parameter_data.cpp.

References CSG_Parameter::asParameters(), CSG_Parameters::Assign(), and m_pParameters.

◆ _Serialize()

bool CSG_Parameter_Parameters::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3490 of file parameter_data.cpp.

References CSG_Parameter::Get_Identifier(), CSG_Parameter::Get_Type_Identifier(), m_pParameters, CSG_Parameters::Serialize(), and CSG_MetaData::Set_Property().

◆ _Set_String()

void CSG_Parameter_Parameters::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 3470 of file parameter_data.cpp.

References _TL, CSG_Parameters::Get_Count(), m_pParameters, CSG_Parameter::m_String, and CSG_String::Printf().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Parameters::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1566 of file parameters.h.

References PARAMETER_TYPE_Parameters.

◆ Restore_Default()

bool CSG_Parameter_Parameters::Restore_Default ( void )
virtual

Reimplemented from CSG_Parameter.

Definition at line 3464 of file parameter_data.cpp.

References m_pParameters, and CSG_Parameters::Restore_Defaults().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1587 of file parameters.h.

Referenced by CSG_Parameter_Parameters().

Member Data Documentation

◆ m_pParameters

CSG_Parameters* CSG_Parameter_Parameters::m_pParameters
protected

Definition at line 1576 of file parameters.h.

Referenced by _asPointer(), _Assign(), _Serialize(), _Set_String(), CSG_Parameter_Parameters(), Restore_Default(), and ~CSG_Parameter_Parameters().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Parameters Member List

This is the complete list of members for CSG_Parameter_Parameters, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Parameters | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Parameters | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Parameters | protectedvirtual
_Set_String(void) | CSG_Parameter_Parameters | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Parameters(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Parameters | protected
CSG_Parameters class | CSG_Parameter_Parameters | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Parameters | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pParameters | CSG_Parameter_Parameters | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter_Parameters | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
~CSG_Parameter_Parameters(void) | CSG_Parameter_Parameters | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_PointCloud Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_PointCloud Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_PointCloud:
CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_PointCloud (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1332 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_PointCloud()

CSG_Parameter_PointCloud::CSG_Parameter_PointCloud | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2959 of file parameter_data.cpp.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_PointCloud::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2993 of file parameter_data.cpp.

References CSG_Parameter_Data_Object::_Assign().

◆ _Set_Value()

int CSG_Parameter_PointCloud::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2966 of file parameter_data.cpp.

References CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Optional(), CSG_Parameter_Data_Object::m_pDataObject, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, CSG_Parameter::Set_Value(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_PointCloud::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1336 of file parameters.h.

References PARAMETER_TYPE_PointCloud.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1349 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_PointCloud Member List

This is the complete list of members for CSG_Parameter_PointCloud, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_PointCloud | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_PointCloud | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_PointCloud(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_PointCloud | protected
CSG_Parameters class | CSG_Parameter_PointCloud | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_PointCloud | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_PointCloud_List Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_PointCloud_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_PointCloud_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_PointCloud * | Get_PointCloud (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_PointCloud_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1539 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_PointCloud_List()

CSG_Parameter_PointCloud_List::CSG_Parameter_PointCloud_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3438 of file parameter_data.cpp.

Member Function Documentation

◆ Get_PointCloud()

CSG_PointCloud* CSG_Parameter_PointCloud_List::Get_PointCloud ( int Index ) const
inline

Definition at line 1545 of file parameters.h.

References CSG_Parameter_List::Get_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_PointCloud_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1543 of file parameters.h.

References PARAMETER_TYPE_PointCloud_List.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1553 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_PointCloud_List Member List

This is the complete list of members for CSG_Parameter_PointCloud_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameter_PointCloud_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_PointCloud_List | protected
CSG_Parameters class | CSG_Parameter_PointCloud_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_PointCloud(int Index) const | CSG_Parameter_PointCloud_List | inline
Get_Type(void) const | CSG_Parameter_PointCloud_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Range Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Range Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Range:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
bool | Set_Range (double Min, double Max)
double | Get_Range (void) const
bool | Set_Min (double Min)
double | Get_Min (void) const
CSG_Parameter_Double * | Get_Min_Parameter (void) const
bool | Set_Max (double Max)
double | Get_Max (void) const
CSG_Parameter_Double * | Get_Max_Parameter (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Range (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter_Range (void)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

CSG_Parameters * m_pRange
CSG_Parameter_Double * m_pMin
CSG_Parameter_Double * m_pMax
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 609 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Range()

CSG_Parameter_Range::CSG_Parameter_Range | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 746 of file parameter_data.cpp.

References CSG_Parameters::Add_Double(), CSG_Parameters::Add_Info_Value(), CSG_Parameters, CSG_Parameter::is_Information(), m_pMax, m_pMin, m_pRange, and PARAMETER_TYPE_Double.

◆ ~CSG_Parameter_Range()

CSG_Parameter_Range::~CSG_Parameter_Range ( void )
protectedvirtual

Definition at line 763 of file parameter_data.cpp.

References m_pRange.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Range::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 850 of file parameter_data.cpp.

References CSG_Parameter::asRange(), CSG_Parameter::Assign(), m_pMax, and m_pMin.

◆ _Serialize()

bool CSG_Parameter_Range::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 859 of file parameter_data.cpp.

References CSG_String::AfterFirst(), CSG_String::asDouble(), CSG_String::BeforeFirst(), CSG_MetaData::Fmt_Content(), CSG_MetaData::Get_Content(), Get_Max(), Get_Min(), Set_Range(), and SG_Get_Significant_Decimals().

◆ _Set_String()

void CSG_Parameter_Range::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 769 of file parameter_data.cpp.

References Get_Max(), Get_Min(), CSG_Parameter::m_String, CSG_String::Printf(), and SG_Get_Significant_Decimals().

◆ _Set_Value()

int CSG_Parameter_Range::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 778 of file parameter_data.cpp.

References CSG_String::AfterFirst(), CSG_String::asDouble(), CSG_String::BeforeFirst(), Set_Range(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

◆ Get_Max()

double CSG_Parameter_Range::Get_Max ( void ) const

Definition at line 832 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), and m_pMax.

Referenced by _Serialize(), _Set_String(), and CSG_Parameter::is_Value_Equal().

◆ Get_Max_Parameter()

CSG_Parameter_Double* CSG_Parameter_Range::Get_Max_Parameter ( void ) const
inline

Definition at line 624 of file parameters.h.

Referenced by CSG_Parameters::Get_Parameter().

◆ Get_Min()

double CSG_Parameter_Range::Get_Min ( void ) const

Definition at line 814 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), and m_pMin.

Referenced by _Serialize(), _Set_String(), and CSG_Parameter::is_Value_Equal().

◆ Get_Min_Parameter()

CSG_Parameter_Double* CSG_Parameter_Range::Get_Min_Parameter ( void ) const
inline

Definition at line 620 of file parameters.h.

Referenced by CSG_Parameters::Get_Parameter().

◆ Get_Range()

double CSG_Parameter_Range::Get_Range ( void ) const
inline

Definition at line 616 of file parameters.h.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Range::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 613 of file parameters.h.

References PARAMETER_TYPE_Range.

◆ is_Default()

bool CSG_Parameter_Range::is_Default ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 838 of file parameter_data.cpp.

References CSG_Parameter_Double::is_Default(), m_pMax, and m_pMin.

◆ Restore_Default()

bool CSG_Parameter_Range::Restore_Default ( void )
virtual

Reimplemented from CSG_Parameter.

Definition at line 844 of file parameter_data.cpp.

References m_pMax, m_pMin, and CSG_Parameter::Restore_Default().

◆ Set_Max()

bool CSG_Parameter_Range::Set_Max ( double Max )

Definition at line 820 of file parameter_data.cpp.

References CSG_Parameter::has_Changed(), m_pMax, and CSG_Parameter::Set_Value().

◆ Set_Min()

bool CSG_Parameter_Range::Set_Min ( double Min )

Definition at line 802 of file parameter_data.cpp.

References CSG_Parameter::has_Changed(), m_pMin, and CSG_Parameter::Set_Value().

◆ Set_Range()

bool CSG_Parameter_Range::Set_Range | ( | double | Min,
 |  | double | Max
 | ) |  |

Definition at line 783 of file parameter_data.cpp.

References m_pMax, m_pMin, and CSG_Parameter::Set_Value().

Referenced by _Serialize(), _Set_Value(), and CSG_Parameters::Serialize_Compatibility().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 649 of file parameters.h.

Referenced by CSG_Parameter_Range().

Member Data Documentation

◆ m_pMax

CSG_Parameter_Double * CSG_Parameter_Range::m_pMax
protected

Definition at line 638 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Range(), Get_Max(), is_Default(), Restore_Default(), Set_Max(), and Set_Range().

◆ m_pMin

CSG_Parameter_Double* CSG_Parameter_Range::m_pMin
protected

Definition at line 638 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Range(), Get_Min(), is_Default(), Restore_Default(), Set_Min(), and Set_Range().

◆ m_pRange

CSG_Parameters* CSG_Parameter_Range::m_pRange
protected

Definition at line 636 of file parameters.h.

Referenced by CSG_Parameter_Range(), and ~CSG_Parameter_Range().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Range Member List

This is the complete list of members for CSG_Parameter_Range, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Range | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Range | protectedvirtual
_Set_String(void) | CSG_Parameter_Range | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Range | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Range(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Range | protected
CSG_Parameters class | CSG_Parameter_Range | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Max(void) const | CSG_Parameter_Range |
Get_Max_Parameter(void) const | CSG_Parameter_Range | inline
Get_Min(void) const | CSG_Parameter_Range |
Get_Min_Parameter(void) const | CSG_Parameter_Range | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Range(void) const | CSG_Parameter_Range | inline
Get_Type(void) const | CSG_Parameter_Range | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Range | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pMax | CSG_Parameter_Range | protected
m_pMin | CSG_Parameter_Range | protected
m_pRange | CSG_Parameter_Range | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter_Range | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Max(double Max) | CSG_Parameter_Range |
Set_Min(double Min) | CSG_Parameter_Range |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Range(double Min, double Max) | CSG_Parameter_Range |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
~CSG_Parameter_Range(void) | CSG_Parameter_Range | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Shapes Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Shapes Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Shapes:
CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Shape_Type (TSG_Shape_Type Type)
TSG_Shape_Type | Get_Shape_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Shapes (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

TSG_Shape_Type m_Type
- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1277 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Shapes()

CSG_Parameter_Shapes::CSG_Parameter_Shapes | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2857 of file parameter_data.cpp.

References m_Type, and SHAPE_TYPE_Undefined.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Shapes::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2903 of file parameter_data.cpp.

References CSG_Parameter_Data_Object::_Assign(), and m_Type.

◆ _Set_Value()

int CSG_Parameter_Shapes::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2864 of file parameter_data.cpp.

References DATAOBJECT_CREATE, DATAOBJECT_NOTSET, CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Parameters(), Get_Type(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Input(), CSG_Parameter::is_Optional(), CSG_Parameter_Data_Object::m_pDataObject, m_Type, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, CSG_Parameter::Set_Value(), SG_PARAMETER_DATA_SET_CHANGED, SG_PARAMETER_DATA_SET_FALSE, SG_PARAMETER_DATA_SET_TRUE, and SHAPE_TYPE_Undefined.

◆ Get_Shape_Type()

TSG_Shape_Type CSG_Parameter_Shapes::Get_Shape_Type ( void ) const
inline

Definition at line 1284 of file parameters.h.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Shapes::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1281 of file parameters.h.

References PARAMETER_TYPE_Shapes.

Referenced by _Set_Value().

◆ Set_Shape_Type()

void CSG_Parameter_Shapes::Set_Shape_Type ( TSG_Shape_Type Type )

Definition at line 2897 of file parameter_data.cpp.

References m_Type.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1299 of file parameters.h.

Member Data Documentation

◆ m_Type

TSG_Shape_Type CSG_Parameter_Shapes::m_Type
protected

Definition at line 1291 of file parameters.h.

Referenced by _Assign(), _Set_Value(), CSG_Parameter_Shapes(), and Set_Shape_Type().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Shapes Member List

This is the complete list of members for CSG_Parameter_Shapes, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Shapes | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Shapes | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_Shapes(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Shapes | protected
CSG_Parameters class | CSG_Parameter_Shapes | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Shape_Type(void) const | CSG_Parameter_Shapes | inline
Get_Type(void) const | CSG_Parameter_Shapes | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
m_Type | CSG_Parameter_Shapes | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Shape_Type(TSG_Shape_Type Type) | CSG_Parameter_Shapes |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Shapes_List Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Shapes_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Shapes_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
void | Set_Shape_Type (TSG_Shape_Type Type)
TSG_Shape_Type | Get_Shape_Type (void) const
CSG_Shapes * | Get_Shapes (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Shapes_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

TSG_Shape_Type m_Type
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1485 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Shapes_List()

CSG_Parameter_Shapes_List::CSG_Parameter_Shapes_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3394 of file parameter_data.cpp.

References m_Type, and SHAPE_TYPE_Undefined.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Shapes_List::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_List.

Definition at line 3407 of file parameter_data.cpp.

References CSG_Parameter_List::_Assign(), and m_Type.

◆ Get_Shape_Type()

TSG_Shape_Type CSG_Parameter_Shapes_List::Get_Shape_Type ( void ) const
inline

Definition at line 1492 of file parameters.h.

◆ Get_Shapes()

CSG_Shapes* CSG_Parameter_Shapes_List::Get_Shapes ( int Index ) const
inline

Definition at line 1494 of file parameters.h.

References CSG_Parameter_List::Get_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Shapes_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1489 of file parameters.h.

References PARAMETER_TYPE_Shapes_List.

◆ Set_Shape_Type()

void CSG_Parameter_Shapes_List::Set_Shape_Type ( TSG_Shape_Type Type )

Definition at line 3401 of file parameter_data.cpp.

References m_Type.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1507 of file parameters.h.

Member Data Documentation

◆ m_Type

TSG_Shape_Type CSG_Parameter_Shapes_List::m_Type
protected

Definition at line 1501 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Shapes_List(), and Set_Shape_Type().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Shapes_List Member List

This is the complete list of members for CSG_Parameter_Shapes_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Shapes_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameter_Shapes_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Shapes_List | protected
CSG_Parameters class | CSG_Parameter_Shapes_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Shape_Type(void) const | CSG_Parameter_Shapes_List | inline
Get_Shapes(int Index) const | CSG_Parameter_Shapes_List | inline
Get_Type(void) const | CSG_Parameter_Shapes_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
m_Type | CSG_Parameter_Shapes_List | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Shape_Type(TSG_Shape_Type Type) | CSG_Parameter_Shapes_List |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_String Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_String Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_String:
CSG_Parameter CSG_Parameter_File_Name CSG_Parameter_Text

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
virtual bool | is_Valid (void) const
void | Set_Password (bool bOn)
bool | is_Password (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_String (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (const CSG_String &Value)
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

bool m_bPassword
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 798 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_String()

CSG_Parameter_String::CSG_Parameter_String | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1447 of file parameter_data.cpp.

References m_bPassword.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_String::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_File_Name.

Definition at line 1485 of file parameter_data.cpp.

References m_bPassword, and CSG_Parameter::m_String.

Referenced by CSG_Parameter_File_Name::_Assign().

◆ _Serialize()

bool CSG_Parameter_String::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1494 of file parameter_data.cpp.

References CSG_MetaData::Get_Content(), CSG_Parameter::m_String, and CSG_MetaData::Set_Content().

◆ _Set_Value()

int CSG_Parameter_String::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 1472 of file parameter_data.cpp.

References CSG_String::Cmp(), CSG_Parameter::m_String, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_String::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Reimplemented in CSG_Parameter_File_Name, and CSG_Parameter_Text.

Definition at line 802 of file parameters.h.

References PARAMETER_TYPE_String.

◆ is_Password()

bool CSG_Parameter_String::is_Password ( void ) const

Definition at line 1466 of file parameter_data.cpp.

References m_bPassword.

◆ is_Valid()

bool CSG_Parameter_String::is_Valid ( void ) const
virtual

Reimplemented from CSG_Parameter.

Definition at line 1454 of file parameter_data.cpp.

References CSG_String::is_Empty(), and CSG_Parameter::m_String.

◆ Set_Password()

void CSG_Parameter_String::Set_Password ( bool bOn )

Definition at line 1460 of file parameter_data.cpp.

References m_bPassword.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 823 of file parameters.h.

Member Data Documentation

◆ m_bPassword

bool CSG_Parameter_String::m_bPassword
protected

Definition at line 814 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_String(), is_Password(), and Set_Password().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_String Member List

This is the complete list of members for CSG_Parameter_String, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_String | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_String | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_String | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_String | protected
CSG_Parameters class | CSG_Parameter_String | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_String | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Password(void) const | CSG_Parameter_String |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_String | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bPassword | CSG_Parameter_String | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Password(bool bOn) | CSG_Parameter_String |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Table Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Table Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Table:
CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_Parameter_Table (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

virtual int | _Set_Value (void *Value)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1254 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Table()

CSG_Parameter_Table::CSG_Parameter_Table | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 2816 of file parameter_data.cpp.

Member Function Documentation

◆ _Set_Value()

int CSG_Parameter_Table::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2823 of file parameter_data.cpp.

References CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Optional(), CSG_Parameter_Data_Object::m_pDataObject, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, CSG_Parameter::Set_Value(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Table::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1258 of file parameters.h.

References PARAMETER_TYPE_Table.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1268 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Table Member List

This is the complete list of members for CSG_Parameter_Table, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Data_Object | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_Table | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Table |
CSG_Parameters class | CSG_Parameter_Table | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Table | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Table_Field Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Table_Field Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Table_Field:
CSG_Parameter_Int CSG_Parameter_Value CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
bool | Add_Default (double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
CSG_Table * | Get_Table (void) const
- Public Member Functions inherited from CSG_Parameter_Int
virtual bool | is_Default (void) const
- Public Member Functions inherited from CSG_Parameter_Value
bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Static Public Member Functions

static CSG_String Get_Choices (const class CSG_Table &Table, bool bAllowNone=false)

Protected Member Functions

CSG_Parameter_Table_Field (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual void | _Set_String (void)
virtual double | _asDouble (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter_Int
CSG_Parameter_Int (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (double Value)
virtual int | _asInt (void) const
- Protected Member Functions inherited from CSG_Parameter_Value
CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (void *Value)
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

int | m_Default
- Protected Attributes inherited from CSG_Parameter_Int
int | m_Value
- Protected Attributes inherited from CSG_Parameter_Value
bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1053 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Table_Field()

CSG_Parameter_Table_Field::CSG_Parameter_Table_Field | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2147 of file parameter_data.cpp.

References m_Default, and CSG_Parameter_Int::m_Value.

Member Function Documentation

◆ _asDouble()

double CSG_Parameter_Table_Field::_asDouble ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2256 of file parameter_data.cpp.

References CSG_Parameter::asDouble(), CSG_Parameter::Get_Child(), and m_Default.

◆ _Assign()

bool CSG_Parameter_Table_Field::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2262 of file parameter_data.cpp.

References _Set_String(), m_Default, and CSG_Parameter_Int::m_Value.

◆ _Serialize()

bool CSG_Parameter_Table_Field::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2273 of file parameter_data.cpp.

References _Set_Value(), CSG_Parameter::asInt(), CSG_Parameter::asString(), CSG_MetaData::Get_Content(), CSG_MetaData::Get_Property(), CSG_MetaData::Set_Content(), and CSG_MetaData::Set_Property().

◆ _Set_String()

void CSG_Parameter_Table_Field::_Set_String ( void )
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2237 of file parameter_data.cpp.

References _TL, CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Name(), Get_Table(), CSG_Parameter::m_String, and CSG_Parameter_Int::m_Value.

Referenced by _Assign().

◆ _Set_Value() [1/2]

int CSG_Parameter_Table_Field::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2211 of file parameter_data.cpp.

References _Set_Value(), CSG_String::asInt(), CSG_String::CmpNoCase(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Name(), and Get_Table().

◆ _Set_Value() [2/2]

int CSG_Parameter_Table_Field::_Set_Value ( int Value )
protectedvirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 2179 of file parameter_data.cpp.

References CSG_Parameter::Get_Child(), CSG_Table::Get_Field_Count(), Get_Table(), CSG_Parameter::is_Optional(), m_Default, CSG_Parameter_Int::m_Value, CSG_Parameter::Set_Enabled(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

Referenced by _Serialize(), and _Set_Value().

◆ Add_Default()

bool CSG_Parameter_Table_Field::Add_Default | ( | double | Value,
 |  | double | Minimum,
 |  | bool | bMinimum,
 |  | double | Maximum,
 |  | bool | bMaximum
 | ) |  |

Definition at line 2155 of file parameter_data.cpp.

References _TL, CSG_Parameters::Add_Double(), CSG_String::Format(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Identifier(), CSG_Parameter::Get_Parameters(), CSG_Parameter::is_Optional(), and m_Default.

◆ Get_Choices()

CSG_String CSG_Parameter_Table_Field::Get_Choices | ( | const class CSG_Table & | Table,
 |  | bool | bAllowNone = false
 | ) |  |
static

Definition at line 2296 of file parameter_data.cpp.

References _TL, CSG_Table::Get_Field_Count(), and CSG_Table::Get_Field_Name().

◆ Get_Table()

CSG_Table * CSG_Parameter_Table_Field::Get_Table ( void ) const

Definition at line 2171 of file parameter_data.cpp.

References CSG_Parameter::asTable(), DATAOBJECT_CREATE, CSG_Table::Get_Field_Count(), and CSG_Parameter::Get_Parent().

Referenced by _Set_String(), and _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Table_Field::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_Int.

Definition at line 1057 of file parameters.h.

References PARAMETER_TYPE_Table_Field.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1084 of file parameters.h.

Member Data Documentation

◆ m_Default

int CSG_Parameter_Table_Field::m_Default
protected

Definition at line 1070 of file parameters.h.

Referenced by _asDouble(), _Assign(), _Set_Value(), Add_Default(), and CSG_Parameter_Table_Field().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Table_Field Member List

This is the complete list of members for CSG_Parameter_Table_Field, including all inherited members.

_asDouble(void) const | CSG_Parameter_Table_Field | protectedvirtual
_asInt(void) const | CSG_Parameter_Int | inlineprotectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Table_Field | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Table_Field | protectedvirtual
_Set_String(void) | CSG_Parameter_Table_Field | protectedvirtual
_Set_Value(int Value) | CSG_Parameter_Table_Field | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Table_Field | protectedvirtual
CSG_Parameter_Int::_Set_Value(double Value) | CSG_Parameter_Int | protectedvirtual
CSG_Parameter_Value::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum) | CSG_Parameter_Table_Field |
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Int | protected
CSG_Parameter_Table_Field(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Table_Field | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Table_Field | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_Choices(const class CSG_Table &Table, bool bAllowNone=false) | CSG_Parameter_Table_Field | static
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Table(void) const | CSG_Parameter_Table_Field |
Get_Type(void) const | CSG_Parameter_Table_Field | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter_Int | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Default | CSG_Parameter_Table_Field | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
m_Value | CSG_Parameter_Int | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Table_Fields Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Table_Fields Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Table_Fields:
CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
int | Get_Count (void) const
int | Get_Index (int i) const
CSG_Table * | Get_Table (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Table_Fields (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter_Table_Fields (void)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Protected Attributes

int | m_nFields
int * | m_Fields
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 1093 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Table_Fields()

CSG_Parameter_Table_Fields::CSG_Parameter_Table_Fields | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2325 of file parameter_data.cpp.

References m_Fields, and m_nFields.

◆ ~CSG_Parameter_Table_Fields()

CSG_Parameter_Table_Fields::~CSG_Parameter_Table_Fields ( void )
protectedvirtual

Definition at line 2333 of file parameter_data.cpp.

References m_Fields, and SG_FREE_SAFE.

Member Function Documentation

◆ _asInt()

int CSG_Parameter_Table_Fields::_asInt ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2414 of file parameter_data.cpp.

References m_nFields.

◆ _asPointer()

void * CSG_Parameter_Table_Fields::_asPointer ( void ) const
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2420 of file parameter_data.cpp.

References m_Fields.

◆ _Assign()

bool CSG_Parameter_Table_Fields::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2434 of file parameter_data.cpp.

References _Set_Value(), and CSG_Parameter::asString().

◆ _Serialize()

bool CSG_Parameter_Table_Fields::_Serialize | ( | CSG_MetaData & | Entry,
 |  | bool | bSave
 | ) |  |
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2440 of file parameter_data.cpp.

References CSG_MetaData::Get_Content(), CSG_Parameter::m_String, and CSG_MetaData::Set_Content().

◆ _Set_Value()

int CSG_Parameter_Table_Fields::_Set_Value ( const CSG_String & Value )
protectedvirtual

Reimplemented from CSG_Parameter.

Definition at line 2339 of file parameter_data.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::asInt(), CSG_String::BeforeFirst(), CSG_String::BeforeLast(), CSG_String::Clear(), CSG_String::CmpNoCase(), CSG_String::Format(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Name(), Get_Table(), CSG_String::is_Empty(), CSG_String::Length(), m_Fields, m_nFields, CSG_Parameter::m_String, CSG_String::Replace(), SG_FREE_SAFE, SG_PARAMETER_DATA_SET_CHANGED, SG_Realloc(), and CSG_String::Trim().

Referenced by _Assign().

◆ Get_Count()

int CSG_Parameter_Table_Fields::Get_Count ( void ) const
inline

Definition at line 1099 of file parameters.h.

◆ Get_Index()

int CSG_Parameter_Table_Fields::Get_Index ( int i ) const
inline

Definition at line 1100 of file parameters.h.

◆ Get_Table()

CSG_Table * CSG_Parameter_Table_Fields::Get_Table ( void ) const

Definition at line 2426 of file parameter_data.cpp.

References CSG_Parameter::asTable(), DATAOBJECT_CREATE, CSG_Table::Get_Field_Count(), and CSG_Parameter::Get_Parent().

Referenced by _Set_Value().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Table_Fields::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1097 of file parameters.h.

References PARAMETER_TYPE_Table_Fields.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1122 of file parameters.h.

Member Data Documentation

◆ m_Fields

int * CSG_Parameter_Table_Fields::m_Fields
protected

Definition at line 1110 of file parameters.h.

Referenced by _asPointer(), _Set_Value(), CSG_Parameter_Table_Fields(), and ~CSG_Parameter_Table_Fields().

◆ m_nFields

int CSG_Parameter_Table_Fields::m_nFields
protected

Definition at line 1110 of file parameters.h.

Referenced by _asInt(), _Set_Value(), and CSG_Parameter_Table_Fields().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Table_Fields Member List

This is the complete list of members for CSG_Parameter_Table_Fields, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_Table_Fields | protectedvirtual
_asPointer(void) const | CSG_Parameter_Table_Fields | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Table_Fields | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Table_Fields | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_Table_Fields | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Table_Fields(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Table_Fields | protected
CSG_Parameters class | CSG_Parameter_Table_Fields | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_Count(void) const | CSG_Parameter_Table_Fields | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Index(int i) const | CSG_Parameter_Table_Fields | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Table(void) const | CSG_Parameter_Table_Fields |
Get_Type(void) const | CSG_Parameter_Table_Fields | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_Fields | CSG_Parameter_Table_Fields | protected
m_nFields | CSG_Parameter_Table_Fields | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
~CSG_Parameter_Table_Fields(void) | CSG_Parameter_Table_Fields | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Table_List Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Table_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Table_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_Table * | Get_Table (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Table_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1462 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Table_List()

CSG_Parameter_Table_List::CSG_Parameter_Table_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3379 of file parameter_data.cpp.

Member Function Documentation

◆ Get_Table()

CSG_Table* CSG_Parameter_Table_List::Get_Table ( int Index ) const
inline

Definition at line 1468 of file parameters.h.

References CSG_Parameter_List::Get_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Table_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1466 of file parameters.h.

References PARAMETER_TYPE_Table_List.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1476 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Table_List Member List

This is the complete list of members for CSG_Parameter_Table_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameter_Table_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Table_List | protected
CSG_Parameters class | CSG_Parameter_Table_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Table(int Index) const | CSG_Parameter_Table_List | inline
Get_Type(void) const | CSG_Parameter_Table_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Text Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_Text Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Text:
CSG_Parameter_String CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter_String
virtual bool | is_Valid (void) const
void | Set_Password (bool bOn)
bool | is_Password (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Text (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_String
CSG_Parameter_String (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (const CSG_String &Value)
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_String
bool m_bPassword
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 832 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Text()

CSG_Parameter_Text::CSG_Parameter_Text | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 1516 of file parameter_data.cpp.

Member Function Documentation

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_Text::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Parameter_String.

Definition at line 835 of file parameters.h.

References PARAMETER_TYPE_Text.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 843 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Text Member List

This is the complete list of members for CSG_Parameter_Text, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_String | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_String | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter_String | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_String | protected
CSG_Parameter_Text(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Text | protected
CSG_Parameters class | CSG_Parameter_Text | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_Text | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Password(void) const | CSG_Parameter_String |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_String | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bPassword | CSG_Parameter_String | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_Password(bool bOn) | CSG_Parameter_String |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_TIN Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_TIN Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_TIN:
CSG_Parameter_Data_Object CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
- Public Member Functions inherited from CSG_Parameter_Data_Object
virtual bool | is_Valid (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_TIN (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual int | _Set_Value (void *Value)
- Protected Member Functions inherited from CSG_Parameter_Data_Object
CSG_Parameter_Data_Object (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter_Data_Object
CSG_Data_Object * m_pDataObject
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1308 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_TIN()

CSG_Parameter_TIN::CSG_Parameter_TIN | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 2918 of file parameter_data.cpp.

Member Function Documentation

◆ _Set_Value()

int CSG_Parameter_TIN::_Set_Value ( void * Value )
protectedvirtual

Reimplemented from CSG_Parameter_Data_Object.

Definition at line 2925 of file parameter_data.cpp.

References CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Optional(), CSG_Parameter_Data_Object::m_pDataObject, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, CSG_Parameter::Set_Value(), SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_TRUE.

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_TIN::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1312 of file parameters.h.

References PARAMETER_TYPE_TIN.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1323 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_TIN Member List

This is the complete list of members for CSG_Parameter_TIN, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter_Data_Object | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Data_Object | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_Data_Object | protectedvirtual
_Set_String(void) | CSG_Parameter_Data_Object | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter_TIN | protectedvirtual
CSG_Parameter::_Set_Value(int Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(double Value) | CSG_Parameter | protectedvirtual
CSG_Parameter::_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Data_Object | protected
CSG_Parameter_TIN(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_TIN | protected
CSG_Parameters class | CSG_Parameter_TIN | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_TIN | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter_Data_Object | virtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_pDataObject | CSG_Parameter_Data_Object | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_TIN_List Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Parameter_TIN_List Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_TIN_List:
CSG_Parameter_List CSG_Parameter

Public Member Functions

virtual TSG_Parameter_Type | Get_Type (void) const
CSG_TIN * | asTIN (int Index) const
- Public Member Functions inherited from CSG_Parameter_List
virtual bool | Add_Item (CSG_Data_Object *pItem)
virtual bool | Del_Item (CSG_Data_Object *pItem, bool bUpdateData=true)
virtual bool | Del_Item (int Index, bool bUpdateData=true)
virtual bool | Del_Items (void)
int | Get_Item_Count (void) const
CSG_Data_Object * | Get_Item (int Index) const
virtual bool | Update_Data (void)
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_TIN_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
- Protected Member Functions inherited from CSG_Parameter_List
CSG_Parameter_List (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual void * | _asPointer (void) const
virtual bool | _Assign (CSG_Parameter *pSource)
virtual bool | _Serialize (CSG_MetaData &Entry, bool bSave)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual double | _asDouble (void) const
virtual const SG_Char * | _asString (void) const

Friends

class CSG_Parameters

Additional Inherited Members

- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Detailed Description

Definition at line 1516 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_TIN_List()

CSG_Parameter_TIN_List::CSG_Parameter_TIN_List | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 3423 of file parameter_data.cpp.

Member Function Documentation

◆ asTIN()

CSG_TIN* CSG_Parameter_TIN_List::asTIN ( int Index ) const
inline

Definition at line 1522 of file parameters.h.

References CSG_Parameter_List::Get_Item().

◆ Get_Type()

virtual TSG_Parameter_Type CSG_Parameter_TIN_List::Get_Type ( void ) const
inlinevirtual

Implements CSG_Parameter.

Definition at line 1520 of file parameters.h.

References PARAMETER_TYPE_TIN_List.

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 1530 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_TIN_List Member List

This is the complete list of members for CSG_Parameter_TIN_List, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter_List | protectedvirtual
_asPointer(void) const | CSG_Parameter_List | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_List | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &Entry, bool bSave) | CSG_Parameter_List | protectedvirtual
_Set_String(void) | CSG_Parameter_List | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
Add_Item(CSG_Data_Object *pItem) | CSG_Parameter_List | virtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(int Index) const | CSG_Parameter_TIN_List | inline
CSG_Parameter_List::asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_List | protected
CSG_Parameter_TIN_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_TIN_List | protected
CSG_Parameters class | CSG_Parameter_TIN_List | friend
Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Item(int Index, bool bUpdateData=true) | CSG_Parameter_List | virtual
Del_Items(void) | CSG_Parameter_List | virtual
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Item(int Index) const | CSG_Parameter_List | inline
Get_Item_Count(void) const | CSG_Parameter_List | inline
Get_Manager(void) const | CSG_Parameter |
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const | CSG_Parameter_TIN_List | inlinevirtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
Update_Data(void) | CSG_Parameter_List | inlinevirtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameter_Value Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Parameter_Value Class Reference

#include <parameters.h>

Inheritance diagram for CSG_Parameter_Value:
CSG_Parameter CSG_Parameter_Double CSG_Parameter_Int CSG_Parameter_Degree CSG_Parameter_Color CSG_Parameter_Table_Field

Public Member Functions

bool | Set_Valid_Range (double Minimum, double Maximum)
void | Set_Minimum (double Minimum, bool bOn=true)
double | Get_Minimum (void) const
bool | has_Minimum (void) const
void | Set_Maximum (double Maximum, bool bOn=true)
double | Get_Maximum (void) const
bool | has_Maximum (void) const
- Public Member Functions inherited from CSG_Parameter
CSG_Parameters * | Get_Parameters (void) const
CSG_Parameter * | Get_Parent (void) const
class CSG_Data_Manager * | Get_Manager (void) const
virtual TSG_Parameter_Type | Get_Type (void) const =0
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
const SG_Char * | Get_Identifier (void) const
bool | Cmp_Identifier (const CSG_String &Identifier) const
bool | Set_Name (const CSG_String &Name)
const SG_Char * | Get_Name (void) const
const SG_Char * | Get_Description (void) const
bool | Set_Description (const CSG_String &Description)
CSG_String | Get_Description (int Flags) const
CSG_String | Get_Description (int Flags, const SG_Char *Separator) const
bool | Set_Enabled (bool bEnabled=true)
bool | is_Enabled (bool bCheckEnv=true) const
virtual bool | is_Valid (void) const
bool | is_Input (void) const
bool | is_Output (void) const
bool | is_Optional (void) const
bool | is_Information (void) const
bool | is_Option (void) const
bool | is_DataObject (void) const
bool | is_DataObject_List (void) const
bool | is_Parameters (void) const
bool | is_Serializable (void) const
bool | is_Compatible (CSG_Parameter *pParameter) const
bool | is_Value_Equal (CSG_Parameter *pParameter) const
void | Set_UseInGUI (bool bDoUse=false)
void | Set_UseInCMD (bool bDoUse=false)
bool | do_UseInGUI (void) const
bool | do_UseInCMD (void) const
void | ignore_Projection (bool bIgnore)
bool | ignore_Projection (void) const
TSG_Data_Object_Type | Get_DataObject_Type (void) const
int | Get_Children_Count (void) const
CSG_Parameter * | Get_Child (int iChild) const
bool | Set_Children_Enabled (bool bEnabled=true)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_Value (const CSG_String &Value)
virtual bool | Set_Value (const char *Value)
virtual bool | Set_Value (const wchar_t *Value)
virtual bool | Set_Value (void *Value)
virtual bool | Set_Value (CSG_Parameter *Value)
virtual bool | Toggle_Value (void)
bool | Set_Default (int Value)
bool | Set_Default (double Value)
bool | Set_Default (const CSG_String &Value)
const CSG_String & | Get_Default (void) const
virtual bool | is_Default (void) const
virtual bool | Restore_Default (void)
bool | Check (bool bSilent=true)
bool | has_Changed (int Check_Flags=PARAMETER_CHECK_ALL)
bool | asBool (void) const
int | asInt (void) const
long | asColor (void) const
double | asDouble (void) const
const SG_Char * | asString (void) const
void * | asPointer (void) const
CSG_Colors * | asColors (void) const
const SG_Char * | asFont (void) const
CSG_Grid_System * | asGrid_System (void) const
CSG_Data_Object * | asDataObject (void) const
CSG_Grid * | asGrid (void) const
CSG_Grids * | asGrids (void) const
CSG_Table * | asTable (void) const
CSG_Shapes * | asShapes (void) const
CSG_TIN * | asTIN (void) const
CSG_PointCloud * | asPointCloud (void) const
class CSG_Parameter_Value * | asValue (void) const
class CSG_Parameter_Date * | asDate (void) const
class CSG_Parameter_Data_Type * | asDataType (void) const
class CSG_Parameter_Choice * | asChoice (void) const
class CSG_Parameter_Choices * | asChoices (void) const
class CSG_Parameter_Range * | asRange (void) const
class CSG_Parameter_File_Name * | asFilePath (void) const
class CSG_Parameter_Table_Fields * | asTableFields (void) const
class CSG_Parameters * | asParameters (void) const
class CSG_Parameter_List * | asList (void) const
class CSG_Parameter_Grid_List * | asGridList (void) const
class CSG_Parameter_Grids_List * | asGridsList (void) const
class CSG_Parameter_Table_List * | asTableList (void) const
class CSG_Parameter_Shapes_List * | asShapesList (void) const
class CSG_Parameter_TIN_List * | asTINList (void) const
class CSG_Parameter_PointCloud_List * | asPointCloudList (void) const
bool | Assign (CSG_Parameter *pSource)
bool | Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Member Functions

CSG_Parameter_Value (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual bool | _Assign (CSG_Parameter *pSource)
- Protected Member Functions inherited from CSG_Parameter
CSG_Parameter (CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
virtual | ~CSG_Parameter (void)
virtual int | _Set_Value (int Value)
virtual int | _Set_Value (double Value)
virtual int | _Set_Value (const CSG_String &Value)
virtual int | _Set_Value (void *Value)
virtual void | _Set_String (void)
virtual int | _asInt (void) const
virtual double | _asDouble (void) const
virtual void * | _asPointer (void) const
virtual const SG_Char * | _asString (void) const
virtual bool | _Serialize (CSG_MetaData &MetaData, bool bSave)

Protected Attributes

bool | m_bMinimum
bool | m_bMaximum
double | m_Minimum
double | m_Maximum
- Protected Attributes inherited from CSG_Parameter
CSG_String m_String

Friends

class CSG_Parameters

Detailed Description

Definition at line 433 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameter_Value()

CSG_Parameter_Value::CSG_Parameter_Value | ( | CSG_Parameters * | pOwner,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
protected

Definition at line 328 of file parameter_data.cpp.

References m_bMaximum, m_bMinimum, m_Maximum, and m_Minimum.

Member Function Documentation

◆ _Assign()

bool CSG_Parameter_Value::_Assign ( CSG_Parameter * pSource )
protectedvirtual

Reimplemented from CSG_Parameter.

Reimplemented in CSG_Parameter_Table_Field, CSG_Parameter_Double, and CSG_Parameter_Int.

Definition at line 411 of file parameter_data.cpp.

References CSG_Parameter::asValue(), m_bMaximum, m_bMinimum, m_Maximum, and m_Minimum.

Referenced by CSG_Parameter_Int::_Assign(), and CSG_Parameter_Double::_Assign().

◆ Get_Maximum()

double CSG_Parameter_Value::Get_Maximum ( void ) const
inline

Definition at line 444 of file parameters.h.

Referenced by SG_XML_Add_Parameter().

◆ Get_Minimum()

double CSG_Parameter_Value::Get_Minimum ( void ) const
inline

Definition at line 440 of file parameters.h.

Referenced by SG_XML_Add_Parameter().

◆ has_Maximum()

bool CSG_Parameter_Value::has_Maximum ( void ) const
inline

Definition at line 445 of file parameters.h.

Referenced by SG_XML_Add_Parameter().

◆ has_Minimum()

bool CSG_Parameter_Value::has_Minimum ( void ) const
inline

Definition at line 441 of file parameters.h.

Referenced by SG_XML_Add_Parameter().

◆ Set_Maximum()

void CSG_Parameter_Value::Set_Maximum | ( | double | Maximum,
 |  | bool | bOn = true
 | ) |  |

Definition at line 391 of file parameter_data.cpp.

References m_bMaximum, m_bMinimum, m_Minimum, and Set_Valid_Range().

◆ Set_Minimum()

void CSG_Parameter_Value::Set_Minimum | ( | double | Minimum,
 |  | bool | bOn = true
 | ) |  |

Definition at line 371 of file parameter_data.cpp.

References m_bMaximum, m_bMinimum, m_Maximum, and Set_Valid_Range().

◆ Set_Valid_Range()

bool CSG_Parameter_Value::Set_Valid_Range | ( | double | Minimum,
 |  | double | Maximum
 | ) |  |

Definition at line 339 of file parameter_data.cpp.

References CSG_Parameter::_Set_Value(), CSG_Parameter::asDouble(), CSG_Parameter::asInt(), CSG_Parameter::Get_Type(), CSG_Parameter::has_Changed(), m_bMaximum, m_bMinimum, m_Maximum, m_Minimum, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_Int, SG_PARAMETER_DATA_SET_CHANGED, and SG_PARAMETER_DATA_SET_FALSE.

Referenced by Set_Maximum(), and Set_Minimum().

Friends And Related Function Documentation

◆ CSG_Parameters

friend class CSG_Parameters
friend

Definition at line 460 of file parameters.h.

Member Data Documentation

◆ m_bMaximum

bool CSG_Parameter_Value::m_bMaximum
protected

Definition at line 452 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Double::_Set_Value(), CSG_Parameter_Int::_Set_Value(), CSG_Parameter_Value(), Set_Maximum(), Set_Minimum(), and Set_Valid_Range().

◆ m_bMinimum

bool CSG_Parameter_Value::m_bMinimum
protected

Definition at line 452 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Double::_Set_Value(), CSG_Parameter_Int::_Set_Value(), CSG_Parameter_Value(), Set_Maximum(), Set_Minimum(), and Set_Valid_Range().

◆ m_Maximum

double CSG_Parameter_Value::m_Maximum
protected

Definition at line 454 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Double::_Set_Value(), CSG_Parameter_Int::_Set_Value(), CSG_Parameter_Value(), Set_Minimum(), and Set_Valid_Range().

◆ m_Minimum

double CSG_Parameter_Value::m_Minimum
protected

Definition at line 454 of file parameters.h.

Referenced by _Assign(), CSG_Parameter_Double::_Set_Value(), CSG_Parameter_Int::_Set_Value(), CSG_Parameter_Value(), Set_Maximum(), and Set_Valid_Range().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameter_Value Member List

This is the complete list of members for CSG_Parameter_Value, including all inherited members.

_asDouble(void) const | CSG_Parameter | protectedvirtual
_asInt(void) const | CSG_Parameter | protectedvirtual
_asPointer(void) const | CSG_Parameter | protectedvirtual
_Assign(CSG_Parameter *pSource) | CSG_Parameter_Value | protectedvirtual
_asString(void) const | CSG_Parameter | protectedvirtual
_Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter | protectedvirtual
_Set_String(void) | CSG_Parameter | protectedvirtual
_Set_Value(int Value) | CSG_Parameter | protectedvirtual
_Set_Value(double Value) | CSG_Parameter | protectedvirtual
_Set_Value(const CSG_String &Value) | CSG_Parameter | protectedvirtual
_Set_Value(void *Value) | CSG_Parameter | protectedvirtual
asBool(void) const | CSG_Parameter | inline
asChoice(void) const | CSG_Parameter |
asChoices(void) const | CSG_Parameter |
asColor(void) const | CSG_Parameter | inline
asColors(void) const | CSG_Parameter |
asDataObject(void) const | CSG_Parameter |
asDataType(void) const | CSG_Parameter |
asDate(void) const | CSG_Parameter |
asDouble(void) const | CSG_Parameter | inline
asFilePath(void) const | CSG_Parameter |
asFont(void) const | CSG_Parameter |
asGrid(void) const | CSG_Parameter |
asGrid_System(void) const | CSG_Parameter |
asGridList(void) const | CSG_Parameter |
asGrids(void) const | CSG_Parameter |
asGridsList(void) const | CSG_Parameter |
asInt(void) const | CSG_Parameter | inline
asList(void) const | CSG_Parameter |
asParameters(void) const | CSG_Parameter |
asPointCloud(void) const | CSG_Parameter |
asPointCloudList(void) const | CSG_Parameter |
asPointer(void) const | CSG_Parameter | inline
asRange(void) const | CSG_Parameter |
asShapes(void) const | CSG_Parameter |
asShapesList(void) const | CSG_Parameter |
Assign(CSG_Parameter *pSource) | CSG_Parameter |
asString(void) const | CSG_Parameter | inline
asTable(void) const | CSG_Parameter |
asTableFields(void) const | CSG_Parameter |
asTableList(void) const | CSG_Parameter |
asTIN(void) const | CSG_Parameter |
asTINList(void) const | CSG_Parameter |
asValue(void) const | CSG_Parameter |
Check(bool bSilent=true) | CSG_Parameter |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameter |
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter | protected
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameter_Value | protected
CSG_Parameters class | CSG_Parameter_Value | friend
do_UseInCMD(void) const | CSG_Parameter |
do_UseInGUI(void) const | CSG_Parameter |
Get_Child(int iChild) const | CSG_Parameter | inline
Get_Children_Count(void) const | CSG_Parameter | inline
Get_DataObject_Type(void) const | CSG_Parameter |
Get_Default(void) const | CSG_Parameter |
Get_Description(void) const | CSG_Parameter |
Get_Description(int Flags) const | CSG_Parameter |
Get_Description(int Flags, const SG_Char *Separator) const | CSG_Parameter |
Get_Identifier(void) const | CSG_Parameter |
Get_Manager(void) const | CSG_Parameter |
Get_Maximum(void) const | CSG_Parameter_Value | inline
Get_Minimum(void) const | CSG_Parameter_Value | inline
Get_Name(void) const | CSG_Parameter |
Get_Parameters(void) const | CSG_Parameter |
Get_Parent(void) const | CSG_Parameter |
Get_Type(void) const =0 | CSG_Parameter | pure virtual
Get_Type_Identifier(void) const | CSG_Parameter |
Get_Type_Name(void) const | CSG_Parameter |
has_Changed(int Check_Flags=PARAMETER_CHECK_ALL) | CSG_Parameter |
has_Maximum(void) const | CSG_Parameter_Value | inline
has_Minimum(void) const | CSG_Parameter_Value | inline
ignore_Projection(bool bIgnore) | CSG_Parameter |
ignore_Projection(void) const | CSG_Parameter | inline
is_Compatible(CSG_Parameter *pParameter) const | CSG_Parameter |
is_DataObject(void) const | CSG_Parameter |
is_DataObject_List(void) const | CSG_Parameter |
is_Default(void) const | CSG_Parameter | virtual
is_Enabled(bool bCheckEnv=true) const | CSG_Parameter |
is_Information(void) const | CSG_Parameter | inline
is_Input(void) const | CSG_Parameter | inline
is_Option(void) const | CSG_Parameter |
is_Optional(void) const | CSG_Parameter | inline
is_Output(void) const | CSG_Parameter | inline
is_Parameters(void) const | CSG_Parameter |
is_Serializable(void) const | CSG_Parameter |
is_Valid(void) const | CSG_Parameter | inlinevirtual
is_Value_Equal(CSG_Parameter *pParameter) const | CSG_Parameter |
m_bMaximum | CSG_Parameter_Value | protected
m_bMinimum | CSG_Parameter_Value | protected
m_Maximum | CSG_Parameter_Value | protected
m_Minimum | CSG_Parameter_Value | protected
m_String | CSG_Parameter | protected
Restore_Default(void) | CSG_Parameter | virtual
Serialize(CSG_MetaData &MetaData, bool bSave) | CSG_Parameter |
Set_Children_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Default(int Value) | CSG_Parameter |
Set_Default(double Value) | CSG_Parameter |
Set_Default(const CSG_String &Value) | CSG_Parameter |
Set_Description(const CSG_String &Description) | CSG_Parameter |
Set_Enabled(bool bEnabled=true) | CSG_Parameter |
Set_Maximum(double Maximum, bool bOn=true) | CSG_Parameter_Value |
Set_Minimum(double Minimum, bool bOn=true) | CSG_Parameter_Value |
Set_Name(const CSG_String &Name) | CSG_Parameter |
Set_UseInCMD(bool bDoUse=false) | CSG_Parameter |
Set_UseInGUI(bool bDoUse=false) | CSG_Parameter |
Set_Valid_Range(double Minimum, double Maximum) | CSG_Parameter_Value |
Set_Value(int Value) | CSG_Parameter | virtual
Set_Value(double Value) | CSG_Parameter | virtual
Set_Value(const CSG_String &Value) | CSG_Parameter | virtual
Set_Value(const char *Value) | CSG_Parameter | virtual
Set_Value(const wchar_t *Value) | CSG_Parameter | virtual
Set_Value(void *Value) | CSG_Parameter | virtual
Set_Value(CSG_Parameter *Value) | CSG_Parameter | virtual
Toggle_Value(void) | CSG_Parameter | virtual
~CSG_Parameter(void) | CSG_Parameter | protectedvirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameters Class Reference

Public Member Functions | Friends | List of all members
CSG_Parameters Class Reference

#include <parameters.h>

Public Member Functions

CSG_Parameters (void)
virtual | ~CSG_Parameters (void)
CSG_Parameters (const CSG_Parameters &Parameters)
bool | Create (const CSG_Parameters &Parameters)
CSG_Parameters (const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false)
bool | Create (const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false)
CSG_Parameters (void *pOwner, const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false)
bool | Create (void *pOwner, const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false)
void | Destroy (void)
void * | Get_Owner (void) const
class CSG_Tool * | Get_Tool (void) const
class CSG_Data_Manager * | Get_Manager (void) const
void | Set_Manager (class CSG_Data_Manager *pManager)
bool | Use_Grid_System (void)
bool | has_GUI (void) const
int | Get_Count (void) const
void | Set_Identifier (const CSG_String &Identifier)
bool | Cmp_Identifier (const CSG_String &Identifier) const
const CSG_String & | Get_Identifier (void) const
void | Set_Name (const CSG_String &Name)
const CSG_String & | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const CSG_String & | Get_Description (void) const
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
void | Del_References (void)
const CSG_Strings & | Get_References (void) const
void | Set_Enabled (bool bEnabled=true)
void | Set_Enabled (const CSG_String &Identifier, bool bEnabled=true)
TSG_PFNC_Parameter_Changed | Set_Callback_On_Parameter_Changed (TSG_PFNC_Parameter_Changed pCallback)
bool | Set_Callback (bool bActive=true)
CSG_Parameters & | operator= (const CSG_Parameters &Parameters)
CSG_Parameter * | Get_Parameter (int i) const
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | operator() (int i) const
CSG_Parameter * | operator() (const CSG_String &ID) const
CSG_Parameter * | operator() (const char *ID) const
CSG_Parameter * | operator() (const wchar_t *ID) const
CSG_Parameter & | operator[] (int i) const
CSG_Parameter & | operator[] (const CSG_String &ID) const
CSG_Parameter & | operator[] (const char *ID) const
CSG_Parameter & | operator[] (const wchar_t *ID) const
bool | Del_Parameter (int i)
bool | Del_Parameter (const CSG_String &ID)
bool | Del_Parameters (void)
CSG_Parameter * | Add_Parameter (CSG_Parameter *pParameter)
CSG_Parameter * | Add_Node (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Value (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
CSG_Parameter * | Add_Info_Value (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
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_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_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_Degree (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_Date (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
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_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_Info_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)
CSG_Parameter * | Add_Data_Type (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
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)
CSG_Parameter * | Add_Choices (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
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_Info_String (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false)
CSG_Parameter * | Add_FilePath (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
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_Colors (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL)
CSG_Parameter * | Add_FixedTable (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
CSG_Parameter * | Add_Grid_System (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
CSG_Parameter * | Add_Grid (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
CSG_Parameter * | Add_Grid_or_Const (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, bool bSystem_Dependent=true)
CSG_Parameter * | Add_Grid_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Grid_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
CSG_Parameter * | Add_Grids (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
CSG_Parameter * | Add_Grids_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Grids_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
CSG_Parameter * | Add_Table_Field (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
CSG_Parameter * | Add_Table_Field_or_Const (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_Table_Fields (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Table (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Table_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Table_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Shapes (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
CSG_Parameter * | Add_Shapes_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Shapes_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type=SHAPE_TYPE_Undefined)
CSG_Parameter * | Add_TIN (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_TIN_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_TIN_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_PointCloud (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_PointCloud_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_PointCloud_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Parameters (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Restore_Defaults (bool bClearData=false)
bool | Assign (CSG_Parameters *pSource)
bool | Assign_Values (CSG_Parameters *pSource)
bool | Assign_Parameters (CSG_Parameters *pSource)
bool | Load (const CSG_MetaData &Data)
bool | Save (CSG_MetaData &Data) const
bool | Load (const CSG_String &File)
bool | Save (const CSG_String &File) const
bool | Serialize (CSG_MetaData &Data, bool bSave)
bool | Serialize (CSG_MetaData &Data) const
bool | Serialize (const CSG_String &File, bool bSave)
bool | Serialize (const CSG_String &File) const
bool | Serialize_Compatibility (CSG_File &Stream)
bool | DataObjects_Check (bool bSilent=false)
bool | Get_String (CSG_String &String, bool bOptionsOnly)
bool | Msg_String (bool bOptionsOnly)
bool | Set_History (CSG_MetaData &History, bool bOptions=true, bool bDataObjects=true)
bool | is_Managed (void) const
CSG_Parameter * | Get_Grid_System_Parameter (void) const
CSG_Grid_System * | Get_Grid_System (void) const
bool | Set_Grid_System (const CSG_Grid_System &System)
bool | Reset_Grid_System (void)
CSG_Parameter * | Add_Node (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Value (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
CSG_Parameter * | Add_Info_Value (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
CSG_Parameter * | Add_Bool (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
CSG_Parameter * | Add_Int (CSG_Parameter *pParent, 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_Double (CSG_Parameter *pParent, 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_Degree (CSG_Parameter *pParent, 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_Date (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
CSG_Parameter * | Add_Color (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
CSG_Parameter * | Add_Range (CSG_Parameter *pParent, 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_Info_Range (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0)
CSG_Parameter * | Add_Choice (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
CSG_Parameter * | Add_String (CSG_Parameter *pParent, 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_Info_String (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false)
CSG_Parameter * | Add_FilePath (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
CSG_Parameter * | Add_Font (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL)
CSG_Parameter * | Add_Colors (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL)
CSG_Parameter * | Add_FixedTable (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
CSG_Parameter * | Add_Grid_System (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
CSG_Parameter * | Add_Grid (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
CSG_Parameter * | Add_Grid_or_Const (CSG_Parameter *pParent, 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, bool bSystem_Dependent=true)
CSG_Parameter * | Add_Grid_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Grid_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
CSG_Parameter * | Add_Table_Field (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
CSG_Parameter * | Add_Table_Field_or_Const (CSG_Parameter *pParent, 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_Table_Fields (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Table (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Table_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Table_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Shapes (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
CSG_Parameter * | Add_Shapes_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_Shapes_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
CSG_Parameter * | Add_TIN (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_TIN_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_TIN_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_PointCloud (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_PointCloud_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
CSG_Parameter * | Add_PointCloud_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
CSG_Parameter * | Add_Parameters (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)

Friends

class | CSG_Parameter
class | CSG_Tool

Detailed Description

Definition at line 1649 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameters() [1/4]

CSG_Parameters::CSG_Parameters ( void )

Definition at line 65 of file parameters.cpp.

◆ ~CSG_Parameters()

CSG_Parameters::~CSG_Parameters ( void )
virtual

Definition at line 95 of file parameters.cpp.

References Destroy().

◆ CSG_Parameters() [2/4]

CSG_Parameters::CSG_Parameters ( const CSG_Parameters & Parameters )

Definition at line 71 of file parameters.cpp.

References Create().

◆ CSG_Parameters() [3/4]

CSG_Parameters::CSG_Parameters | ( | const SG_Char * | Name,
 |  | const SG_Char * | Description = NULL,
 |  | const SG_Char * | Identifier = NULL,
 |  | bool | bGrid_System = false
 | ) |  |

Definition at line 79 of file parameters.cpp.

References Create().

◆ CSG_Parameters() [4/4]

CSG_Parameters::CSG_Parameters | ( | void * | pOwner,
 |  | const SG_Char * | Name,
 |  | const SG_Char * | Description = NULL,
 |  | const SG_Char * | Identifier = NULL,
 |  | bool | bGrid_System = false
 | ) |  |

Definition at line 87 of file parameters.cpp.

References Create().

Member Function Documentation

◆ Add_Bool() [1/2]

CSG_Parameter * CSG_Parameters::Add_Bool | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | bool | Value = false
 | ) |  |

Definition at line 396 of file parameters.cpp.

References Add_Value(), and PARAMETER_TYPE_Bool.

Referenced by CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Distance_Weighting::Add_Parameters(), and CSG_Tool_Chain::Create().

◆ Add_Bool() [2/2]

CSG_Parameter* CSG_Parameters::Add_Bool | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | bool | Value = false
 | ) |  |
inline

Definition at line 1900 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Choice() [1/2]

CSG_Parameter * CSG_Parameters::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
 | ) |  |

Definition at line 464 of file parameters.cpp.

References CSG_Parameter::asChoice(), PARAMETER_TYPE_Choice, Set_Callback(), CSG_Parameter::Set_Default(), CSG_Parameter_Choice::Set_Items(), and CSG_Parameter::Set_Value().

Referenced by CSG_Distance_Weighting::Add_Parameters(), CSG_Grid_Cell_Addressor::Add_Parameters(), CSG_Parameters_Point_Search::Create(), CSG_Tool_Chain::Create(), and CSG_Parameters_Grid_Target::Create().

◆ Add_Choice() [2/2]

CSG_Parameter* CSG_Parameters::Add_Choice | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const CSG_String & | Items,
 |  | int | Default = 0
 | ) |  |
inline

Definition at line 1916 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Choices()

CSG_Parameter * CSG_Parameters::Add_Choices | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const CSG_String & | Items
 | ) |  |

Definition at line 479 of file parameters.cpp.

References CSG_Parameter::asChoices(), PARAMETER_TYPE_Choices, and CSG_Parameter_Choices::Set_Items().

Referenced by CSG_Tool_Chain::Create().

◆ Add_Color() [1/2]

CSG_Parameter * CSG_Parameters::Add_Color | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Value = 0
 | ) |  |

Definition at line 426 of file parameters.cpp.

References Add_Value(), and PARAMETER_TYPE_Color.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Color() [2/2]

CSG_Parameter* CSG_Parameters::Add_Color | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Value = 0
 | ) |  |
inline

Definition at line 1910 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Colors() [1/2]

CSG_Parameter * CSG_Parameters::Add_Colors | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Colors * | pInit = NULL
 | ) |  |

Definition at line 536 of file parameters.cpp.

References CSG_Parameter::asColors(), CSG_Colors::Assign(), and PARAMETER_TYPE_Colors.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Colors() [2/2]

CSG_Parameter* CSG_Parameters::Add_Colors | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Colors * | pInit = NULL
 | ) |  |
inline

Definition at line 1926 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Data_Type()

CSG_Parameter * CSG_Parameters::Add_Data_Type | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Data_Types,
 |  | TSG_Data_Type | Default = SG_DATATYPE_Undefined,
 |  | const CSG_String & | User = ""
 | ) |  |

Add a parameter for selecting a data type from a list of choices. The Data_Types argument expects a combination of data type flags as defined in <api_core.h>, e.g. SG_DATATYPES_Integer or SG_DATATYPES_Numeric. You can add an additional choice with the User argument, e.g. to offer a type related to an selected input data set.

Definition at line 452 of file parameters.cpp.

References CSG_Parameter::asDataType(), PARAMETER_TYPE_Data_Type, Set_Callback(), and CSG_Parameter_Data_Type::Set_Data_Types().

◆ Add_Date() [1/2]

CSG_Parameter * CSG_Parameters::Add_Date | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | double | Value = 0.0
 | ) |  |

Definition at line 416 of file parameters.cpp.

References Add_Value(), CSG_DateTime::Get_JDN(), CSG_DateTime::Now(), and PARAMETER_TYPE_Date.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Date() [2/2]

CSG_Parameter* CSG_Parameters::Add_Date | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | double | Value = 0.0
 | ) |  |
inline

Definition at line 1908 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Degree() [1/2]

CSG_Parameter * CSG_Parameters::Add_Degree | ( | 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
 | ) |  |

Definition at line 411 of file parameters.cpp.

References Add_Value(), and PARAMETER_TYPE_Degree.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Degree() [2/2]

CSG_Parameter* CSG_Parameters::Add_Degree | ( | CSG_Parameter * | pParent,
 |  | 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
 | ) |  |
inline

Definition at line 1906 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Double() [1/2]

CSG_Parameter * CSG_Parameters::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
 | ) |  |

Definition at line 406 of file parameters.cpp.

References Add_Value(), and PARAMETER_TYPE_Double.

Referenced by CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Distance_Weighting::Add_Parameters(), CSG_Grid_Cell_Addressor::Add_Parameters(), CSG_Parameters_Point_Search::Create(), CSG_Tool_Chain::Create(), CSG_Parameters_Grid_Target::Create(), and CSG_Parameter_Range::CSG_Parameter_Range().

◆ Add_Double() [2/2]

CSG_Parameter* CSG_Parameters::Add_Double | ( | CSG_Parameter * | pParent,
 |  | 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
 | ) |  |
inline

Definition at line 1904 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_FilePath() [1/2]

CSG_Parameter * CSG_Parameters::Add_FilePath | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const SG_Char * | Filter = NULL,
 |  | const SG_Char * | Default = NULL,
 |  | bool | bSave = false,
 |  | bool | bDirectory = false,
 |  | bool | bMultiple = false
 | ) |  |

Definition at line 500 of file parameters.cpp.

References CSG_Parameter::asFilePath(), PARAMETER_TYPE_FilePath, Set_Callback(), CSG_Parameter::Set_Default(), CSG_Parameter_File_Name::Set_Filter(), CSG_Parameter_File_Name::Set_Flag_Directory(), CSG_Parameter_File_Name::Set_Flag_Multiple(), CSG_Parameter_File_Name::Set_Flag_Save(), and CSG_Parameter::Set_Value().

Referenced by CSG_Tool_Chain::Create().

◆ Add_FilePath() [2/2]

CSG_Parameter* CSG_Parameters::Add_FilePath | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const SG_Char * | Filter = NULL,
 |  | const SG_Char * | Default = NULL,
 |  | bool | bSave = false,
 |  | bool | bDirectory = false,
 |  | bool | bMultiple = false
 | ) |  |
inline

Definition at line 1922 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_FixedTable() [1/2]

CSG_Parameter * CSG_Parameters::Add_FixedTable | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Table * | pInit = NULL
 | ) |  |

Definition at line 548 of file parameters.cpp.

References CSG_Table::Assign_Values(), CSG_Parameter::asTable(), CSG_Table::Create(), PARAMETER_TYPE_FixedTable, and CSG_Data_Object::Set_Name().

Referenced by CSG_Tool_Chain::Create().

◆ Add_FixedTable() [2/2]

CSG_Parameter* CSG_Parameters::Add_FixedTable | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Table * | pInit = NULL
 | ) |  |
inline

Definition at line 1928 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Font() [1/2]

CSG_Parameter * CSG_Parameters::Add_Font | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const SG_Char * | pInit = NULL
 | ) |  |

Definition at line 518 of file parameters.cpp.

References PARAMETER_TYPE_Font, Set_Callback(), CSG_Parameter::Set_Default(), and CSG_Parameter::Set_Value().

◆ Add_Font() [2/2]

CSG_Parameter* CSG_Parameters::Add_Font | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const SG_Char * | pInit = NULL
 | ) |  |
inline

Definition at line 1924 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grid() [1/2]

CSG_Parameter * CSG_Parameters::Add_Grid | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true,
 |  | TSG_Data_Type | Preferred_Type = SG_DATATYPE_Undefined
 | ) |  |

Definition at line 582 of file parameters.cpp.

References _TL, Add_Grid_System(), CSG_Parameter::Get_Identifier(), Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_System, and SG_T.

Referenced by CSG_Parameters_Grid_Target::Add_Grid(), Add_Grid_or_Const(), CSG_Tool_Chain::Create(), and CSG_Parameters_Grid_Target::Create().

◆ Add_Grid() [2/2]

CSG_Parameter* CSG_Parameters::Add_Grid | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true,
 |  | TSG_Data_Type | Preferred_Type = SG_DATATYPE_Undefined
 | ) |  |
inline

Definition at line 1932 of file parameters.h.

References CSG_Data_Manager::Add_Grid(), CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grid_List() [1/2]

CSG_Parameter * CSG_Parameters::Add_Grid_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true
 | ) |  |

Definition at line 632 of file parameters.cpp.

References CSG_Parameter::Get_Identifier(), Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_OPTIONAL, PARAMETER_OUTPUT, PARAMETER_TYPE_Grid_List, and PARAMETER_TYPE_Grid_System.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Grid_List() [2/2]

CSG_Parameter* CSG_Parameters::Add_Grid_List | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true
 | ) |  |
inline

Definition at line 1938 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grid_or_Const() [1/2]

CSG_Parameter * CSG_Parameters::Add_Grid_or_Const | ( | 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,
 |  | bool | bSystem_Dependent = true
 | ) |  |

Definition at line 610 of file parameters.cpp.

References Add_Grid(), and PARAMETER_INPUT_OPTIONAL.

◆ Add_Grid_or_Const() [2/2]

CSG_Parameter* CSG_Parameters::Add_Grid_or_Const | ( | CSG_Parameter * | pParent,
 |  | 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,
 |  | bool | bSystem_Dependent = true
 | ) |  |
inline

Definition at line 1934 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grid_Output() [1/2]

CSG_Parameter * CSG_Parameters::Add_Grid_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 620 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_Grid.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Grid_Output() [2/2]

CSG_Parameter* CSG_Parameters::Add_Grid_Output | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1936 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grid_System() [1/2]

CSG_Parameter * CSG_Parameters::Add_Grid_System | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Grid_System * | pInit = NULL
 | ) |  |

Definition at line 567 of file parameters.cpp.

References CSG_Parameter::asGrid_System(), CSG_Grid_System::Assign(), and PARAMETER_TYPE_Grid_System.

Referenced by Add_Grid(), Add_Grids(), CSG_Tool_Chain::Create(), CSG_Parameters_Grid_Target::Create(), and Use_Grid_System().

◆ Add_Grid_System() [2/2]

CSG_Parameter* CSG_Parameters::Add_Grid_System | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | CSG_Grid_System * | pInit = NULL
 | ) |  |
inline

Definition at line 1930 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Grids()

CSG_Parameter * CSG_Parameters::Add_Grids | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true,
 |  | TSG_Data_Type | Preferred_Type = SG_DATATYPE_Undefined
 | ) |  |

Definition at line 658 of file parameters.cpp.

References _TL, Add_Grid_System(), CSG_Parameter::Get_Identifier(), Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, and SG_T.

Referenced by CSG_Parameters_Grid_Target::Add_Grids(), and CSG_Tool_Chain::Create().

◆ Add_Grids_List()

CSG_Parameter * CSG_Parameters::Add_Grids_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | bool | bSystem_Dependent = true
 | ) |  |

Definition at line 698 of file parameters.cpp.

References CSG_Parameter::Get_Identifier(), Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_OPTIONAL, PARAMETER_OUTPUT, PARAMETER_TYPE_Grid_System, and PARAMETER_TYPE_Grids_List.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Grids_Output()

CSG_Parameter * CSG_Parameters::Add_Grids_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 686 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_Grids.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Info_Range() [1/2]

CSG_Parameter * CSG_Parameters::Add_Info_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
 | ) |  |

Definition at line 437 of file parameters.cpp.

◆ Add_Info_Range() [2/2]

CSG_Parameter* CSG_Parameters::Add_Info_Range | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | double | Range_Min = 0.0,
 |  | double | Range_Max = 0.0
 | ) |  |
inline

Definition at line 1914 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Info_String() [1/2]

CSG_Parameter * CSG_Parameters::Add_Info_String | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const CSG_String & | String,
 |  | bool | bLongText = false
 | ) |  |

Definition at line 494 of file parameters.cpp.

◆ Add_Info_String() [2/2]

CSG_Parameter* CSG_Parameters::Add_Info_String | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const CSG_String & | String,
 |  | bool | bLongText = false
 | ) |  |
inline

Definition at line 1920 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Info_Value() [1/2]

CSG_Parameter * CSG_Parameters::Add_Info_Value | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | TSG_Parameter_Type | Type,
 |  | double | Value = 0.0
 | ) |  |

Definition at line 390 of file parameters.cpp.

Referenced by CSG_Parameter_Range::CSG_Parameter_Range().

◆ Add_Info_Value() [2/2]

CSG_Parameter* CSG_Parameters::Add_Info_Value | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | TSG_Parameter_Type | Type,
 |  | double | Value = 0.0
 | ) |  |
inline

Definition at line 1898 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Int() [1/2]

CSG_Parameter * CSG_Parameters::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
 | ) |  |

Definition at line 401 of file parameters.cpp.

References Add_Value(), and PARAMETER_TYPE_Int.

Referenced by CSG_Parameters_Grid_Target::Add_Grids(), CSG_Grid_Cell_Addressor::Add_Parameters(), CSG_Parameters_Point_Search::Create(), CSG_Tool_Chain::Create(), and CSG_Parameters_Grid_Target::Create().

◆ Add_Int() [2/2]

CSG_Parameter* CSG_Parameters::Add_Int | ( | CSG_Parameter * | pParent,
 |  | 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
 | ) |  |
inline

Definition at line 1902 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Node() [1/2]

CSG_Parameter * CSG_Parameters::Add_Node | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 371 of file parameters.cpp.

References PARAMETER_INFORMATION, and PARAMETER_TYPE_Node.

Referenced by CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameters_Point_Search::Create(), and CSG_Tool_Chain::Create().

◆ Add_Node() [2/2]

CSG_Parameter* CSG_Parameters::Add_Node | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1894 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Parameter()

CSG_Parameter * CSG_Parameters::Add_Parameter ( CSG_Parameter * pParameter )

Definition at line 365 of file parameters.cpp.

◆ Add_Parameters() [1/2]

CSG_Parameter * CSG_Parameters::Add_Parameters | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 923 of file parameters.cpp.

References CSG_Parameter::asParameters(), and PARAMETER_TYPE_Parameters.

◆ Add_Parameters() [2/2]

CSG_Parameter* CSG_Parameters::Add_Parameters | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1970 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_PointCloud() [1/2]

CSG_Parameter * CSG_Parameters::Add_PointCloud | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 886 of file parameters.cpp.

References PARAMETER_TYPE_PointCloud.

Referenced by CSG_Tool_Chain::Create().

◆ Add_PointCloud() [2/2]

CSG_Parameter* CSG_Parameters::Add_PointCloud | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1964 of file parameters.h.

References CSG_Data_Manager::Add_PointCloud(), CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_PointCloud_List() [1/2]

CSG_Parameter * CSG_Parameters::Add_PointCloud_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 908 of file parameters.cpp.

References PARAMETER_TYPE_PointCloud_List.

Referenced by CSG_Tool_Chain::Create().

◆ Add_PointCloud_List() [2/2]

CSG_Parameter* CSG_Parameters::Add_PointCloud_List | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1968 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_PointCloud_Output() [1/2]

CSG_Parameter * CSG_Parameters::Add_PointCloud_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 896 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_PointCloud.

◆ Add_PointCloud_Output() [2/2]

CSG_Parameter* CSG_Parameters::Add_PointCloud_Output | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1966 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Range() [1/2]

CSG_Parameter * CSG_Parameters::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
 | ) |  |

Definition at line 432 of file parameters.cpp.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Range() [2/2]

CSG_Parameter* CSG_Parameters::Add_Range | ( | CSG_Parameter * | pParent,
 |  | 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
 | ) |  |
inline

Definition at line 1912 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Reference() [1/2]

void CSG_Parameters::Add_Reference | ( | const CSG_String & | Authors,
 |  | const CSG_String & | Year,
 |  | const CSG_String & | Title,
 |  | const CSG_String & | Where,
 |  | const SG_Char * | Link = NULL,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |

Add a reference to the list of references.

Definition at line 292 of file parameters.cpp.

References CSG_String::Format(), CSG_String::is_Empty(), and CSG_Strings::Sort().

Referenced by CSG_Tool::Add_Reference().

◆ Add_Reference() [2/2]

void CSG_Parameters::Add_Reference | ( | const CSG_String & | Link,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |

Add a reference to the list of references.

Definition at line 314 of file parameters.cpp.

References CSG_String::c_str(), CSG_String::Format(), and CSG_Strings::Sort().

◆ Add_Shapes() [1/2]

CSG_Parameter * CSG_Parameters::Add_Shapes | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | TSG_Shape_Type | Shape_Type = SHAPE_TYPE_Undefined
 | ) |  |

Definition at line 808 of file parameters.cpp.

References PARAMETER_TYPE_Shapes.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Shapes() [2/2]

CSG_Parameter* CSG_Parameters::Add_Shapes | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | TSG_Shape_Type | Shape_Type = SHAPE_TYPE_Undefined
 | ) |  |
inline

Definition at line 1952 of file parameters.h.

References CSG_Data_Manager::Add_Shapes(), CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Shapes_List() [1/2]

CSG_Parameter * CSG_Parameters::Add_Shapes_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | TSG_Shape_Type | Type = SHAPE_TYPE_Undefined
 | ) |  |

Definition at line 832 of file parameters.cpp.

References PARAMETER_TYPE_Shapes_List.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Shapes_List() [2/2]

CSG_Parameter* CSG_Parameters::Add_Shapes_List | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint,
 |  | TSG_Shape_Type | Shape_Type = SHAPE_TYPE_Undefined
 | ) |  |
inline

Definition at line 1956 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Shapes_Output() [1/2]

CSG_Parameter * CSG_Parameters::Add_Shapes_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 820 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_Shapes.

◆ Add_Shapes_Output() [2/2]

CSG_Parameter* CSG_Parameters::Add_Shapes_Output | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1954 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_String() [1/2]

CSG_Parameter * CSG_Parameters::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
 | ) |  |

Definition at line 489 of file parameters.cpp.

Referenced by CSG_Tool_Chain::Create().

◆ Add_String() [2/2]

CSG_Parameter* CSG_Parameters::Add_String | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | const CSG_String & | String,
 |  | bool | bLongText = false,
 |  | bool | bPassword = false
 | ) |  |
inline

Definition at line 1918 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 771 of file parameters.cpp.

References PARAMETER_TYPE_Table.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Table() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1946 of file parameters.h.

References CSG_Data_Manager::Add_Table(), CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table_Field() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table_Field | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | bool | bAllowNone = false
 | ) |  |

Definition at line 724 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_OPTIONAL, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, and PARAMETER_TYPE_TIN.

Referenced by Add_Table_Field_or_Const(), and CSG_Tool_Chain::Create().

◆ Add_Table_Field() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table_Field | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | bool | bAllowNone = false
 | ) |  |
inline

Definition at line 1940 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table_Field_or_Const() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table_Field_or_Const | ( | 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
 | ) |  |

Definition at line 741 of file parameters.cpp.

References Add_Table_Field().

◆ Add_Table_Field_or_Const() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table_Field_or_Const | ( | CSG_Parameter * | pParent,
 |  | 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
 | ) |  |
inline

Definition at line 1942 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table_Fields() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table_Fields | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 754 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Fields, and PARAMETER_TYPE_TIN.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Table_Fields() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table_Fields | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1944 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table_List() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 793 of file parameters.cpp.

References PARAMETER_TYPE_Table_List.

Referenced by CSG_Tool_Chain::Create().

◆ Add_Table_List() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table_List | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1950 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Table_Output() [1/2]

CSG_Parameter * CSG_Parameters::Add_Table_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 781 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_Table.

◆ Add_Table_Output() [2/2]

CSG_Parameter* CSG_Parameters::Add_Table_Output | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1948 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_TIN() [1/2]

CSG_Parameter * CSG_Parameters::Add_TIN | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 849 of file parameters.cpp.

References PARAMETER_TYPE_TIN.

Referenced by CSG_Tool_Chain::Create().

◆ Add_TIN() [2/2]

CSG_Parameter* CSG_Parameters::Add_TIN | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1958 of file parameters.h.

References CSG_Data_Manager::Add_TIN(), CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_TIN_List() [1/2]

CSG_Parameter * CSG_Parameters::Add_TIN_List | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |

Definition at line 871 of file parameters.cpp.

References PARAMETER_TYPE_TIN_List.

Referenced by CSG_Tool_Chain::Create().

◆ Add_TIN_List() [2/2]

CSG_Parameter* CSG_Parameters::Add_TIN_List | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | int | Constraint
 | ) |  |
inline

Definition at line 1962 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_TIN_Output() [1/2]

CSG_Parameter * CSG_Parameters::Add_TIN_Output | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |

Definition at line 859 of file parameters.cpp.

References PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_DataObject_Output, and SG_DATAOBJECT_TYPE_TIN.

◆ Add_TIN_Output() [2/2]

CSG_Parameter* CSG_Parameters::Add_TIN_Output | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
inline

Definition at line 1960 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Add_Value() [1/2]

CSG_Parameter * CSG_Parameters::Add_Value | ( | const CSG_String & | ParentID,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | TSG_Parameter_Type | Type,
 |  | double | Value = 0.0,
 |  | double | Minimum = 0.0,
 |  | bool | bMinimum = false,
 |  | double | Maximum = 0.0,
 |  | bool | bMaximum = false
 | ) |  |

Following parameter types can be used: PARAMETER_TYPE_Bool PARAMETER_TYPE_Int PARAMETER_TYPE_Double PARAMETER_TYPE_Degree PARAMETER_TYPE_Color

Definition at line 385 of file parameters.cpp.

Referenced by Add_Bool(), Add_Color(), Add_Date(), Add_Degree(), Add_Double(), and Add_Int().

◆ Add_Value() [2/2]

CSG_Parameter* CSG_Parameters::Add_Value | ( | CSG_Parameter * | pParent,
 |  | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description,
 |  | TSG_Parameter_Type | Type,
 |  | double | Value = 0.0,
 |  | double | Minimum = 0.0,
 |  | bool | bMinimum = false,
 |  | double | Maximum = 0.0,
 |  | bool | bMaximum = false
 | ) |  |
inline

Definition at line 1896 of file parameters.h.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Assign()

bool CSG_Parameters::Assign ( CSG_Parameters * pSource )

Definition at line 1453 of file parameters.cpp.

References Create().

Referenced by CSG_Parameter_Parameters::_Assign().

◆ Assign_Parameters()

bool CSG_Parameters::Assign_Parameters ( CSG_Parameters * pSource )

Definition at line 1483 of file parameters.cpp.

References Del_Parameters(), CSG_Parameter::Get_Identifier(), and Get_Parameter().

◆ Assign_Values()

bool CSG_Parameters::Assign_Values ( CSG_Parameters * pSource )

Definition at line 1459 of file parameters.cpp.

References CSG_Parameter::Assign(), Get_Count(), CSG_Parameter::Get_Identifier(), Get_Parameter(), and CSG_Parameter::Get_Type().

Referenced by CSG_Tool::Settings_Pop().

◆ Cmp_Identifier()

bool CSG_Parameters::Cmp_Identifier ( const CSG_String & Identifier ) const

Change the identifier of this parameter list after construction.

Definition at line 262 of file parameters.cpp.

References CSG_String::Cmp().

Referenced by Get_Parameter().

◆ Create() [1/3]

bool CSG_Parameters::Create ( const CSG_Parameters & Parameters )

Definition at line 122 of file parameters.cpp.

References Destroy(), Get_Description(), CSG_Parameter::Get_Identifier(), Get_Identifier(), Get_Name(), Get_Parameter(), Set_Description(), Set_Identifier(), and Set_Name().

Referenced by CSG_Tool::Add_Parameters(), Assign(), Create(), CSG_Parameters(), and CSG_Tool::CSG_Tool().

◆ Create() [2/3]

bool CSG_Parameters::Create | ( | const SG_Char * | Name,
 |  | const SG_Char * | Description = NULL,
 |  | const SG_Char * | Identifier = NULL,
 |  | bool | bGrid_System = false
 | ) |  |

Definition at line 152 of file parameters.cpp.

References Destroy(), Set_Description(), Set_Identifier(), Set_Name(), SG_T, and Use_Grid_System().

◆ Create() [3/3]

bool CSG_Parameters::Create | ( | void * | pOwner,
 |  | const SG_Char * | Name,
 |  | const SG_Char * | Description = NULL,
 |  | const SG_Char * | Identifier = NULL,
 |  | bool | bGrid_System = false
 | ) |  |

Definition at line 169 of file parameters.cpp.

References Create().

◆ DataObjects_Check()

bool CSG_Parameters::DataObjects_Check ( bool bSilent = false )

Definition at line 1512 of file parameters.cpp.

References _TL, CSG_String::Append(), CSG_String::c_str(), CSG_String::Format(), Get_Count(), Get_Name(), and SG_UI_Dlg_Message().

◆ Del_Parameter() [1/2]

bool CSG_Parameters::Del_Parameter ( const CSG_String & ID )

Definition at line 1238 of file parameters.cpp.

References CSG_String::Cmp(), Del_Parameter(), and CSG_String::Length().

◆ Del_Parameter() [2/2]

bool CSG_Parameters::Del_Parameter ( int i )

Definition at line 1191 of file parameters.cpp.

References CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Identifier(), CSG_Parameter::Get_Parent(), and SG_Realloc().

Referenced by CSG_Tool::DataObject_Set_Parameters(), and Del_Parameter().

◆ Del_Parameters()

bool CSG_Parameters::Del_Parameters ( void )

Definition at line 1255 of file parameters.cpp.

References SG_Free().

Referenced by Assign_Parameters(), and Destroy().

◆ Del_References()

void CSG_Parameters::Del_References ( void )

Delete all references.

Definition at line 326 of file parameters.cpp.

References CSG_Strings::Clear().

◆ Destroy()

void CSG_Parameters::Destroy ( void )

Definition at line 182 of file parameters.cpp.

References CSG_Strings::Clear(), and Del_Parameters().

Referenced by Create(), and ~CSG_Parameters().

◆ Get_Count()

int CSG_Parameters::Get_Count ( void ) const
inline

Definition at line 1681 of file parameters.h.

Referenced by CSG_Parameter_Parameters::_Set_String(), Assign_Values(), CSG_Tool::DataObject_Update_All(), DataObjects_Check(), CSG_Parameter::Get_Description(), Get_String(), CSG_Tool::Get_Summary(), CSG_Parameter::is_Compatible(), CSG_Parameter::is_Value_Equal(), Restore_Defaults(), Save(), Set_History(), and Set_Manager().

◆ Get_Description()

const CSG_String& CSG_Parameters::Get_Description ( void ) const
inline

Definition at line 1691 of file parameters.h.

Referenced by Create(), and CSG_Tool::Get_Description().

◆ Get_Grid_System()

CSG_Grid_System* CSG_Parameters::Get_Grid_System ( void ) const
inline

Definition at line 1847 of file parameters.h.

Referenced by CSG_Tool::Get_Grid_System(), and CSG_Tool_Grid::Set_System().

◆ Get_Grid_System_Parameter()

CSG_Parameter* CSG_Parameters::Get_Grid_System_Parameter ( void ) const
inline

Definition at line 1846 of file parameters.h.

◆ Get_Identifier()

const CSG_String& CSG_Parameters::Get_Identifier ( void ) const
inline

Definition at line 1685 of file parameters.h.

Referenced by Create(), CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Parameters_Grid_Target::On_Parameter_Changed(), CSG_Parameters_Point_Search::On_Parameters_Enable(), CSG_Parameters_Grid_Target::On_Parameters_Enable(), Set_History(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ Get_Manager()

class CSG_Data_Manager* CSG_Parameters::Get_Manager ( void ) const
inline

Definition at line 1674 of file parameters.h.

Referenced by CSG_Parameter::Check(), CSG_Tool::DataObject_Add(), CSG_Tool::Execute(), CSG_Parameter::Get_Manager(), and CSG_Tool::Get_Manager().

◆ Get_Name()

const CSG_String& CSG_Parameters::Get_Name ( void ) const
inline

Definition at line 1688 of file parameters.h.

Referenced by Create(), DataObjects_Check(), and CSG_Tool::Get_Name().

◆ Get_Owner()

void* CSG_Parameters::Get_Owner ( void ) const
inline

Definition at line 1670 of file parameters.h.

Referenced by CSG_Parameter_Parameters::CSG_Parameter_Parameters(), and has_GUI().

◆ Get_Parameter() [1/2]

CSG_Parameter * CSG_Parameters::Get_Parameter ( const CSG_String & ID ) const

Definition at line 1144 of file parameters.cpp.

References CSG_String::AfterFirst(), CSG_Parameter::asParameters(), CSG_Parameter::asRange(), CSG_String::BeforeFirst(), Cmp_Identifier(), CSG_String::CmpNoCase(), CSG_String::Find(), CSG_Parameter_Range::Get_Max_Parameter(), CSG_Parameter_Range::Get_Min_Parameter(), Get_Parameter(), CSG_Parameter::Get_Type(), CSG_String::is_Empty(), PARAMETER_TYPE_Parameters, and PARAMETER_TYPE_Range.

◆ Get_Parameter() [2/2]

CSG_Parameter* CSG_Parameters::Get_Parameter ( int i ) const
inline

Definition at line 1708 of file parameters.h.

Referenced by Add_Grid(), Add_Grid_List(), Add_Grids(), Add_Grids_List(), Add_Table_Field(), Add_Table_Fields(), Assign_Parameters(), Assign_Values(), Create(), Get_Parameter(), CSG_Parameter::is_Compatible(), CSG_Parameter::is_Value_Equal(), Load(), Serialize_Compatibility(), Set_Enabled(), Set_Parameter(), and SG_XML_Add_Parameter().

◆ Get_References()

const CSG_Strings& CSG_Parameters::Get_References ( void ) const
inline

Definition at line 1696 of file parameters.h.

Referenced by CSG_Tool::Get_References().

◆ Get_String()

bool CSG_Parameters::Get_String | ( | CSG_String & | String,
 |  | bool | bOptionsOnly
 | ) |  |

Definition at line 1827 of file parameters.cpp.

References CSG_Parameter::_Set_String(), CSG_Parameter::asGrid_System(), CSG_Parameter::asString(), CSG_String::Format(), Get_Count(), CSG_Parameter::Get_Name(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Enabled(), CSG_Parameter::is_Information(), CSG_Parameter::is_Option(), and PARAMETER_TYPE_String.

Referenced by Msg_String().

◆ Get_Tool()

class CSG_Tool* CSG_Parameters::Get_Tool ( void ) const
inline

Definition at line 1672 of file parameters.h.

Referenced by CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Parameters_Grid_Target::Get_Grid(), has_GUI(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ has_GUI()

bool CSG_Parameters::has_GUI ( void ) const

If parameters are owned by a tool the function returns the tool's GUI mode, or the presence of a GUI frame otherwise.

Definition at line 242 of file parameters.cpp.

References Get_Owner(), Get_Tool(), and SG_UI_Get_Window_Main().

Referenced by CSG_Parameter::is_Enabled(), and CSG_Parameter_Grid_List::Update_Data().

◆ is_Managed()

bool CSG_Parameters::is_Managed ( void ) const
inline

Definition at line 1844 of file parameters.h.

Referenced by CSG_Tool::Dlg_Parameters().

◆ Load() [1/2]

bool CSG_Parameters::Load ( const CSG_MetaData & Data )

Definition at line 2029 of file parameters.cpp.

References CSG_MetaData::Cmp_Name(), CSG_MetaData::Get_Children_Count(), Get_Parameter(), CSG_MetaData::Get_Property(), CSG_Parameter::has_Changed(), and CSG_Parameter::Serialize().

Referenced by Load().

◆ Load() [2/2]

bool CSG_Parameters::Load ( const CSG_String & File )

Definition at line 2068 of file parameters.cpp.

References Load(), and CSG_MetaData::Load().

◆ Msg_String()

bool CSG_Parameters::Msg_String ( bool bOptionsOnly )

Definition at line 1859 of file parameters.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), Get_String(), SG_UI_Msg_Add_Execution(), SG_UI_MSG_STYLE_01, and SG_UI_MSG_STYLE_NORMAL.

Referenced by CSG_Tool::Execute().

◆ operator()() [1/4]

CSG_Parameter* CSG_Parameters::operator() ( const char * ID ) const
inline

Definition at line 1713 of file parameters.h.

◆ operator()() [2/4]

CSG_Parameter* CSG_Parameters::operator() ( const CSG_String & ID ) const
inline

Definition at line 1712 of file parameters.h.

◆ operator()() [3/4]

CSG_Parameter* CSG_Parameters::operator() ( const wchar_t * ID ) const
inline

Definition at line 1714 of file parameters.h.

◆ operator()() [4/4]

CSG_Parameter* CSG_Parameters::operator() ( int i ) const
inline

Definition at line 1711 of file parameters.h.

◆ operator=()

CSG_Parameters& CSG_Parameters::operator= ( const CSG_Parameters & Parameters )
inline

Definition at line 1706 of file parameters.h.

◆ operator[]() [1/4]

CSG_Parameter& CSG_Parameters::operator[] ( const char * ID ) const
inline

Definition at line 1718 of file parameters.h.

◆ operator[]() [2/4]

CSG_Parameter& CSG_Parameters::operator[] ( const CSG_String & ID ) const
inline

Definition at line 1717 of file parameters.h.

◆ operator[]() [3/4]

CSG_Parameter& CSG_Parameters::operator[] ( const wchar_t * ID ) const
inline

Definition at line 1719 of file parameters.h.

◆ operator[]() [4/4]

CSG_Parameter& CSG_Parameters::operator[] ( int i ) const
inline

Definition at line 1716 of file parameters.h.

◆ Reset_Grid_System()

bool CSG_Parameters::Reset_Grid_System ( void )

Resets the parameters' grid system if it has one. This is typically the case, if it represents the parameters list of a CSG_Tool_Grid object.

Definition at line 2014 of file parameters.cpp.

References Set_Grid_System().

Referenced by CSG_Tool::Reset_Grid_System().

◆ Restore_Defaults()

bool CSG_Parameters::Restore_Defaults ( bool bClearData = false )

Definition at line 1421 of file parameters.cpp.

References CSG_Parameter::asList(), DATAOBJECT_NOTSET, CSG_Parameter_List::Del_Items(), Get_Count(), CSG_Parameter::Restore_Default(), Set_Callback(), and CSG_Parameter::Set_Value().

Referenced by CSG_Tool::Reset(), CSG_Parameter_Parameters::Restore_Default(), and CSG_Tool::Settings_Push().

◆ Save() [1/2]

bool CSG_Parameters::Save ( const CSG_String & File ) const

Definition at line 2074 of file parameters.cpp.

References CSG_MetaData::Save(), and Save().

◆ Save() [2/2]

bool CSG_Parameters::Save ( CSG_MetaData & Data ) const

Definition at line 2052 of file parameters.cpp.

References CSG_MetaData::Destroy(), Get_Count(), CSG_Parameter::Serialize(), CSG_MetaData::Set_Name(), and CSG_MetaData::Set_Property().

Referenced by Save().

◆ Serialize() [1/4]

bool CSG_Parameters::Serialize ( const CSG_String & File ) const
inline

Definition at line 1831 of file parameters.h.

◆ Serialize() [2/4]

bool CSG_Parameters::Serialize | ( | const CSG_String & | File,
 |  | bool | bSave
 | ) |  |
inline

Definition at line 1830 of file parameters.h.

◆ Serialize() [3/4]

bool CSG_Parameters::Serialize ( CSG_MetaData & Data ) const
inline

Definition at line 1829 of file parameters.h.

◆ Serialize() [4/4]

bool CSG_Parameters::Serialize | ( | CSG_MetaData & | Data,
 |  | bool | bSave
 | ) |  |
inline

Definition at line 1828 of file parameters.h.

Referenced by CSG_Parameter_Parameters::_Serialize().

◆ Serialize_Compatibility()

bool CSG_Parameters::Serialize_Compatibility ( CSG_File & Stream )

Definition at line 2081 of file parameters.cpp.

References CSG_Parameter_List::Add_Item(), CSG_Parameter::asColors(), CSG_Parameter::asGrid_System(), CSG_String::asInt(), CSG_Parameter::asList(), CSG_Parameter::asParameters(), CSG_Parameter::asRange(), CSG_Grid_System::Assign(), CSG_Table::Assign_Values(), CSG_Parameter::asTable(), CSG_String::Clear(), CSG_String::Cmp(), DATAOBJECT_CREATE, Get_Parameter(), CSG_File::is_Open(), CSG_File::Read(), CSG_File::Read_Line(), CSG_File::Scan_Double(), CSG_File::Scan_Int(), CSG_Table::Serialize(), CSG_Colors::Serialize(), Serialize_Compatibility(), CSG_Parameter_Range::Set_Range(), and CSG_Parameter::Set_Value().

Referenced by Serialize_Compatibility().

◆ Set_Callback()

bool CSG_Parameters::Set_Callback ( bool bActive = true )

Definition at line 1306 of file parameters.cpp.

References CSG_Parameter::asParameters(), PARAMETER_TYPE_Parameters, and Set_Callback().

Referenced by CSG_Parameter_Grid_System::_Set_Value(), Add_Choice(), Add_Data_Type(), Add_FilePath(), Add_Font(), Restore_Defaults(), Set_Callback(), CSG_Tool::Set_Callback(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ Set_Callback_On_Parameter_Changed()

TSG_PFNC_Parameter_Changed CSG_Parameters::Set_Callback_On_Parameter_Changed ( TSG_PFNC_Parameter_Changed pCallback )

Definition at line 1285 of file parameters.cpp.

References CSG_Parameter::asParameters(), PARAMETER_TYPE_Parameters, and Set_Callback_On_Parameter_Changed().

Referenced by CSG_Tool::Add_Parameters(), CSG_Tool::CSG_Tool(), and Set_Callback_On_Parameter_Changed().

◆ Set_Description()

void CSG_Parameters::Set_Description ( const CSG_String & Description )

Change the description for this parameter list after construction.

Definition at line 282 of file parameters.cpp.

Referenced by Create(), and CSG_Tool::Set_Description().

◆ Set_Enabled() [1/2]

void CSG_Parameters::Set_Enabled ( bool bEnabled = true )

Enable or disable all parameters.

Definition at line 336 of file parameters.cpp.

References CSG_Parameter::Set_Enabled().

Referenced by CSG_Grid_Cell_Addressor::Add_Parameters(), CSG_Distance_Weighting::Enable_Parameters(), CSG_Grid_Cell_Addressor::Enable_Parameters(), CSG_Parameters_Point_Search::On_Parameters_Enable(), and CSG_Parameters_Grid_Target::On_Parameters_Enable().

◆ Set_Enabled() [2/2]

void CSG_Parameters::Set_Enabled | ( | const CSG_String & | Identifier,
 |  | bool | bEnabled = true
 | ) |  |

Enable or disable parameter with given identifier.

Definition at line 349 of file parameters.cpp.

References Get_Parameter(), and CSG_Parameter::Set_Enabled().

◆ Set_Grid_System()

bool CSG_Parameters::Set_Grid_System ( const CSG_Grid_System & System )

Sets the parameters' grid system if it has one. This is typically the case, if it represents the parameters list of a CSG_Tool_Grid object.

Definition at line 2003 of file parameters.cpp.

References CSG_Parameter::asGrid_System(), and CSG_Parameter::Set_Value().

Referenced by Reset_Grid_System(), and CSG_Tool::Set_Grid_System().

◆ Set_History()

bool CSG_Parameters::Set_History | ( | CSG_MetaData & | History,
 |  | bool | bOptions = true,
 |  | bool | bDataObjects = true
 | ) |  |

Definition at line 1884 of file parameters.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Add_Children(), CSG_MetaData::Add_Property(), CSG_Parameter::asDataObject(), CSG_Parameter::asList(), CSG_Parameter::asParameters(), CSG_MetaData::Get_Children_Count(), Get_Count(), CSG_Data_Object::Get_File_Name(), CSG_Data_Object::Get_History(), CSG_Parameter::Get_Identifier(), Get_Identifier(), CSG_Parameter_List::Get_Item(), CSG_Parameter_List::Get_Item_Count(), CSG_Parameter::Get_Name(), CSG_Parameter::Get_Parent(), CSG_Parameter::Get_Type(), CSG_Parameter::Get_Type_Identifier(), CSG_Parameter::is_DataObject(), CSG_Parameter::is_DataObject_List(), CSG_Parameter::is_Enabled(), CSG_Parameter::is_Information(), CSG_Parameter::is_Input(), CSG_Parameter::is_Option(), CSG_Parameter::is_Parameters(), PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_String, CSG_Parameter::Serialize(), Set_History(), CSG_MetaData::Set_Name(), and SG_Get_History_Ignore_Lists().

Referenced by CSG_Tool::Dlg_Parameters(), and Set_History().

◆ Set_Identifier()

void CSG_Parameters::Set_Identifier ( const CSG_String & Identifier )

Change the identifier of this parameter list after construction.

Definition at line 252 of file parameters.cpp.

Referenced by Create().

◆ Set_Manager()

void CSG_Parameters::Set_Manager ( class CSG_Data_Manager * pManager )

Set the responsible data manager for this parameter list. If it is not NULL, the parameter list will perform checks beforehand tool executions, e.g. check if all data sets in its parameter list are really loaded.

Definition at line 206 of file parameters.cpp.

References CSG_Parameter::asParameters(), Get_Count(), PARAMETER_TYPE_Parameters, and Set_Manager().

Referenced by Set_Manager(), CSG_Tool::Set_Manager(), CSG_Tool::Settings_Pop(), and CSG_Tool::Settings_Push().

◆ Set_Name()

void CSG_Parameters::Set_Name ( const CSG_String & Name )

Change the name of this parameter list after construction.

Definition at line 272 of file parameters.cpp.

Referenced by Create(), and CSG_Tool::Set_Name().

◆ Set_Parameter() [1/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1407 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [2/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1396 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [3/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1412 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [4/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | CSG_Data_Object * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1366 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [5/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Definition at line 1346 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [6/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1386 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [7/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1376 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [8/24]

bool CSG_Parameters::Set_Parameter | ( | const char * | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1356 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [9/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1406 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [10/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1398 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Undefined, and CSG_Parameter::Set_Value().

◆ Set_Parameter() [11/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1411 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [12/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | CSG_Data_Object * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1368 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Undefined, and CSG_Parameter::Set_Value().

◆ Set_Parameter() [13/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Definition at line 1348 of file parameters.cpp.

References CSG_Parameter::Assign(), Get_Parameter(), and CSG_Parameter::Get_Type().

Referenced by CSG_Tool::DataObject_Update(), CSG_Parameters_Point_Search::On_Parameter_Changed(), Set_Parameter(), CSG_Tool::Set_Parameter(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ Set_Parameter() [14/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1388 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Undefined, and CSG_Parameter::Set_Value().

◆ Set_Parameter() [15/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1378 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Undefined, and CSG_Parameter::Set_Value().

◆ Set_Parameter() [16/24]

bool CSG_Parameters::Set_Parameter | ( | const CSG_String & | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1358 of file parameters.cpp.

References Get_Parameter(), CSG_Parameter::Get_Type(), PARAMETER_TYPE_Undefined, and CSG_Parameter::Set_Value().

◆ Set_Parameter() [17/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1408 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [18/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1397 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [19/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1413 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [20/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | CSG_Data_Object * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1367 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [21/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Definition at line 1347 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [22/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1387 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [23/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1377 of file parameters.cpp.

References Set_Parameter().

◆ Set_Parameter() [24/24]

bool CSG_Parameters::Set_Parameter | ( | const wchar_t * | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1357 of file parameters.cpp.

References Set_Parameter().

◆ Use_Grid_System()

bool CSG_Parameters::Use_Grid_System ( void )

Let parameters list provide a default grid system after construction.

Definition at line 224 of file parameters.cpp.

References _TL, and Add_Grid_System().

Referenced by Create(), and CSG_Tool_Grid::CSG_Tool_Grid().

Friends And Related Function Documentation

◆ CSG_Parameter

friend class CSG_Parameter
friend

Definition at line 1651 of file parameters.h.

◆ CSG_Tool

friend class CSG_Tool
friend

Definition at line 1652 of file parameters.h.

The documentation for this class was generated from the following files:
  • parameters.h
  • parameters.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameters Member List

This is the complete list of members for CSG_Parameters, including all inherited members.

Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false) | CSG_Parameters |
Add_Bool(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false) | CSG_Parameters | inline
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) | CSG_Parameters |
Add_Choice(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0) | CSG_Parameters | inline
Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items) | CSG_Parameters |
Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0) | CSG_Parameters |
Add_Color(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0) | CSG_Parameters | inline
Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL) | CSG_Parameters |
Add_Colors(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL) | CSG_Parameters | inline
Add_Data_Type(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="") | CSG_Parameters |
Add_Date(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0) | CSG_Parameters |
Add_Date(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0) | CSG_Parameters | inline
Add_Degree(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_Parameters |
Add_Degree(CSG_Parameter *pParent, 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_Parameters | inline
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_Parameters |
Add_Double(CSG_Parameter *pParent, 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_Parameters | inline
Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false) | CSG_Parameters |
Add_FilePath(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false) | CSG_Parameters | inline
Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL) | CSG_Parameters |
Add_FixedTable(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL) | CSG_Parameters | inline
Add_Font(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL) | CSG_Parameters |
Add_Font(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL) | CSG_Parameters | inline
Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined) | CSG_Parameters |
Add_Grid(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined) | CSG_Parameters | inline
Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true) | CSG_Parameters |
Add_Grid_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true) | CSG_Parameters | inline
Add_Grid_or_Const(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, bool bSystem_Dependent=true) | CSG_Parameters |
Add_Grid_or_Const(CSG_Parameter *pParent, 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, bool bSystem_Dependent=true) | CSG_Parameters | inline
Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Grid_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL) | CSG_Parameters |
Add_Grid_System(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL) | CSG_Parameters | inline
Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined) | CSG_Parameters |
Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true) | CSG_Parameters |
Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Info_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) | CSG_Parameters |
Add_Info_Range(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0) | CSG_Parameters | inline
Add_Info_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false) | CSG_Parameters |
Add_Info_String(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false) | CSG_Parameters | inline
Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0) | CSG_Parameters |
Add_Info_Value(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0) | CSG_Parameters | inline
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_Parameters |
Add_Int(CSG_Parameter *pParent, 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_Parameters | inline
Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Node(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_Parameter(CSG_Parameter *pParameter) | CSG_Parameters |
Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Parameters(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_PointCloud(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_PointCloud_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_PointCloud_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
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_Parameters |
Add_Range(CSG_Parameter *pParent, 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_Parameters | inline
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Parameters |
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Parameters |
Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined) | CSG_Parameters |
Add_Shapes(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined) | CSG_Parameters | inline
Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type=SHAPE_TYPE_Undefined) | CSG_Parameters |
Add_Shapes_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined) | CSG_Parameters | inline
Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Shapes_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
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_Parameters |
Add_String(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false, bool bPassword=false) | CSG_Parameters | inline
Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_Table(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false) | CSG_Parameters |
Add_Table_Field(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false) | CSG_Parameters | inline
Add_Table_Field_or_Const(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_Parameters |
Add_Table_Field_or_Const(CSG_Parameter *pParent, 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_Parameters | inline
Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Table_Fields(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_Table_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_Table_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_TIN(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters |
Add_TIN_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint) | CSG_Parameters | inline
Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters |
Add_TIN_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description) | CSG_Parameters | inline
Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false) | CSG_Parameters |
Add_Value(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false) | CSG_Parameters | inline
Assign(CSG_Parameters *pSource) | CSG_Parameters |
Assign_Parameters(CSG_Parameters *pSource) | CSG_Parameters |
Assign_Values(CSG_Parameters *pSource) | CSG_Parameters |
Cmp_Identifier(const CSG_String &Identifier) const | CSG_Parameters |
Create(const CSG_Parameters &Parameters) | CSG_Parameters |
Create(const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false) | CSG_Parameters |
Create(void *pOwner, const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false) | CSG_Parameters |
CSG_Parameter class | CSG_Parameters | friend
CSG_Parameters(void) | CSG_Parameters |
CSG_Parameters(const CSG_Parameters &Parameters) | CSG_Parameters |
CSG_Parameters(const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false) | CSG_Parameters |
CSG_Parameters(void *pOwner, const SG_Char *Name, const SG_Char *Description=NULL, const SG_Char *Identifier=NULL, bool bGrid_System=false) | CSG_Parameters |
CSG_Tool class | CSG_Parameters | friend
DataObjects_Check(bool bSilent=false) | CSG_Parameters |
Del_Parameter(int i) | CSG_Parameters |
Del_Parameter(const CSG_String &ID) | CSG_Parameters |
Del_Parameters(void) | CSG_Parameters |
Del_References(void) | CSG_Parameters |
Destroy(void) | CSG_Parameters |
Get_Count(void) const | CSG_Parameters | inline
Get_Description(void) const | CSG_Parameters | inline
Get_Grid_System(void) const | CSG_Parameters | inline
Get_Grid_System_Parameter(void) const | CSG_Parameters | inline
Get_Identifier(void) const | CSG_Parameters | inline
Get_Manager(void) const | CSG_Parameters | inline
Get_Name(void) const | CSG_Parameters | inline
Get_Owner(void) const | CSG_Parameters | inline
Get_Parameter(int i) const | CSG_Parameters | inline
Get_Parameter(const CSG_String &ID) const | CSG_Parameters |
Get_References(void) const | CSG_Parameters | inline
Get_String(CSG_String &String, bool bOptionsOnly) | CSG_Parameters |
Get_Tool(void) const | CSG_Parameters | inline
has_GUI(void) const | CSG_Parameters |
is_Managed(void) const | CSG_Parameters | inline
Load(const CSG_MetaData &Data) | CSG_Parameters |
Load(const CSG_String &File) | CSG_Parameters |
Msg_String(bool bOptionsOnly) | CSG_Parameters |
operator()(int i) const | CSG_Parameters | inline
operator()(const CSG_String &ID) const | CSG_Parameters | inline
operator()(const char *ID) const | CSG_Parameters | inline
operator()(const wchar_t *ID) const | CSG_Parameters | inline
operator=(const CSG_Parameters &Parameters) | CSG_Parameters | inline
operator[](int i) const | CSG_Parameters | inline
operator[](const CSG_String &ID) const | CSG_Parameters | inline
operator[](const char *ID) const | CSG_Parameters | inline
operator[](const wchar_t *ID) const | CSG_Parameters | inline
Reset_Grid_System(void) | CSG_Parameters |
Restore_Defaults(bool bClearData=false) | CSG_Parameters |
Save(CSG_MetaData &Data) const | CSG_Parameters |
Save(const CSG_String &File) const | CSG_Parameters |
Serialize(CSG_MetaData &Data, bool bSave) | CSG_Parameters | inline
Serialize(CSG_MetaData &Data) const | CSG_Parameters | inline
Serialize(const CSG_String &File, bool bSave) | CSG_Parameters | inline
Serialize(const CSG_String &File) const | CSG_Parameters | inline
Serialize_Compatibility(CSG_File &Stream) | CSG_Parameters |
Set_Callback(bool bActive=true) | CSG_Parameters |
Set_Callback_On_Parameter_Changed(TSG_PFNC_Parameter_Changed pCallback) | CSG_Parameters |
Set_Description(const CSG_String &Description) | CSG_Parameters |
Set_Enabled(bool bEnabled=true) | CSG_Parameters |
Set_Enabled(const CSG_String &Identifier, bool bEnabled=true) | CSG_Parameters |
Set_Grid_System(const CSG_Grid_System &System) | CSG_Parameters |
Set_History(CSG_MetaData &History, bool bOptions=true, bool bDataObjects=true) | CSG_Parameters |
Set_Identifier(const CSG_String &Identifier) | CSG_Parameters |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Parameters |
Set_Name(const CSG_String &Name) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Parameters |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, CSG_Data_Object *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Parameters |
Use_Grid_System(void) | CSG_Parameters |
~CSG_Parameters(void) | CSG_Parameters | virtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameters_Grid_Target Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Parameters_Grid_Target Class Reference

#include <parameters.h>

Public Member Functions

CSG_Parameters_Grid_Target (void)
bool | Create (CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix="")
bool | Create (CSG_Parameters *pParameters, bool bAddDefaultGrid=true, const CSG_String &ParentID="", const CSG_String &Prefix="")
bool | Add_Grid (const CSG_String &ID, const CSG_String &Name, bool bOptional)
bool | Add_Grids (const CSG_String &ID, const CSG_String &Name, bool bOptional, bool bZLevels=false)
bool | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
bool | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
bool | Set_User_Defined (CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows=0, int Rounding=2)
bool | Set_User_Defined (CSG_Parameters *pParameters, CSG_Shapes *pPoints, int Scale=4, int Rounding=2)
bool | Set_User_Defined (CSG_Parameters *pParameters, double xMin, double yMin, double Size, int nx, int ny)
bool | Set_User_Defined (CSG_Parameters *pParameters, const CSG_Grid_System &System)
bool | Set_User_Defined_ZLevels (CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding=2)
CSG_Grid_System | Get_System (void)
CSG_Grid * | Get_Grid (const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
CSG_Grid * | Get_Grid (TSG_Data_Type Type=SG_DATATYPE_Float)
CSG_Grids * | Get_Grids (const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
CSG_Grids * | Get_Grids (TSG_Data_Type Type=SG_DATATYPE_Float)

Static Public Member Functions

static bool | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix)
static bool | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix)

Detailed Description

Definition at line 1598 of file parameters.h.

Constructor & Destructor Documentation

◆ CSG_Parameters_Grid_Target()

CSG_Parameters_Grid_Target::CSG_Parameters_Grid_Target ( void )

Definition at line 1145 of file parameter.cpp.

Member Function Documentation

◆ Add_Grid()

bool CSG_Parameters_Grid_Target::Add_Grid | ( | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | bool | bOptional
 | ) |  |

Definition at line 1598 of file parameter.cpp.

References _TL, CSG_Parameters::Add_Bool(), CSG_Parameters::Add_Grid(), CSG_Parameters::Add_Node(), CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Identifier(), CSG_Parameters::Get_Tool(), CSG_Parameter::Get_Type(), CSG_Tool::has_GUI(), CSG_String::Length(), PARAMETER_OUTPUT, PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_Grid_System, and SG_T.

Referenced by Create().

◆ Add_Grids()

bool CSG_Parameters_Grid_Target::Add_Grids | ( | const CSG_String & | ID,
 |  | const CSG_String & | Name,
 |  | bool | bOptional,
 |  | bool | bZLevels = false
 | ) |  |

Definition at line 1634 of file parameter.cpp.

References _TL, CSG_Parameters::Add_Bool(), CSG_Parameters::Add_Double(), CSG_Parameters::Add_Grids(), CSG_Parameters::Add_Int(), CSG_Parameters::Add_Node(), CSG_Parameter::Get_Child(), CSG_Parameter::Get_Children_Count(), CSG_Parameter::Get_Identifier(), CSG_Parameters::Get_Tool(), CSG_Parameter::Get_Type(), CSG_Tool::has_GUI(), CSG_String::Length(), PARAMETER_OUTPUT, PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_Grid_System, and SG_T.

◆ Create() [1/2]

bool CSG_Parameters_Grid_Target::Create | ( | CSG_Parameters * | pParameters,
 |  | bool | bAddDefaultGrid,
 |  | CSG_Parameter * | pParent,
 |  | const CSG_String & | Prefix = ""
 | ) |  |

Definition at line 1151 of file parameter.cpp.

References CSG_Parameter::Get_Identifier(), and SG_T.

◆ Create() [2/2]

bool CSG_Parameters_Grid_Target::Create | ( | CSG_Parameters * | pParameters,
 |  | bool | bAddDefaultGrid = true,
 |  | const CSG_String & | ParentID = "",
 |  | const CSG_String & | Prefix = ""
 | ) |  |

Definition at line 1156 of file parameter.cpp.

References _TL, CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Double(), Add_Grid(), CSG_Parameters::Add_Grid(), CSG_Parameters::Add_Grid_System(), CSG_Parameters::Add_Int(), CSG_String::Format(), PARAMETER_INPUT_OPTIONAL, and CSG_Parameter::Set_UseInGUI().

◆ Get_Grid() [1/2]

CSG_Grid * CSG_Parameters_Grid_Target::Get_Grid | ( | const CSG_String & | ID,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Float
 | ) |  |

Definition at line 1724 of file parameter.cpp.

References CSG_Parameter::asGrid(), CSG_Parameter::asGrid_System(), CSG_Parameter::asPointer(), CSG_Grid_System::Assign(), CSG_Grid::Create(), DATAOBJECT_CREATE, Get_System(), CSG_Grid::Get_System(), CSG_Parameters::Get_Tool(), CSG_Grid::Get_Type(), CSG_Parameter::Get_Type(), CSG_Tool::has_GUI(), CSG_Grid_System::is_Equal(), CSG_Parameter::is_Optional(), CSG_Grid_System::is_Valid(), PARAMETER_TYPE_Grid, CSG_Parameter::Set_Value(), and SG_Create_Grid().

Referenced by Get_Grid().

◆ Get_Grid() [2/2]

CSG_Grid * CSG_Parameters_Grid_Target::Get_Grid ( TSG_Data_Type Type = SG_DATATYPE_Float )

Definition at line 1790 of file parameter.cpp.

References Get_Grid().

◆ Get_Grids() [1/2]

CSG_Grids * CSG_Parameters_Grid_Target::Get_Grids | ( | const CSG_String & | ID,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Float
 | ) |  |

Definition at line 1796 of file parameter.cpp.

References CSG_Grids::Add_Grid(), CSG_Parameter::asGrids(), CSG_Parameter::asPointer(), DATAOBJECT_CREATE, CSG_Grids::Del_Grids(), Get_System(), CSG_Parameter::Get_Type(), CSG_Parameter::is_Optional(), CSG_Grid_System::is_Valid(), PARAMETER_TYPE_Grids, CSG_Parameter::Set_Value(), and SG_Create_Grids().

Referenced by Get_Grids().

◆ Get_Grids() [2/2]

CSG_Grids * CSG_Parameters_Grid_Target::Get_Grids ( TSG_Data_Type Type = SG_DATATYPE_Float )

Definition at line 1863 of file parameter.cpp.

References Get_Grids().

◆ Get_System()

CSG_Grid_System CSG_Parameters_Grid_Target::Get_System ( void )

Definition at line 1685 of file parameter.cpp.

References CSG_Parameter::asGrid_System(), CSG_Grid_System::Assign(), and CSG_Rect::Deflate().

Referenced by Get_Grid(), and Get_Grids().

◆ On_Parameter_Changed() [1/2]

bool CSG_Parameters_Grid_Target::On_Parameter_Changed | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter
 | ) |  |

Definition at line 1215 of file parameter.cpp.

References CSG_String::Cmp(), and CSG_Parameters::Get_Identifier().

◆ On_Parameter_Changed() [2/2]

bool CSG_Parameters_Grid_Target::On_Parameter_Changed | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter,
 |  | const CSG_String | Prefix
 | ) |  |
static

Definition at line 1223 of file parameter.cpp.

References CSG_Parameter::asDouble(), CSG_Parameter::Cmp_Identifier(), and CSG_Parameter::Get_Identifier().

◆ On_Parameters_Enable() [1/2]

bool CSG_Parameters_Grid_Target::On_Parameters_Enable | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter
 | ) |  |

Definition at line 1364 of file parameter.cpp.

References CSG_String::Cmp(), and CSG_Parameters::Get_Identifier().

◆ On_Parameters_Enable() [2/2]

bool CSG_Parameters_Grid_Target::On_Parameters_Enable | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter,
 |  | const CSG_String | Prefix
 | ) |  |
static

Definition at line 1372 of file parameter.cpp.

References CSG_Parameter::asInt(), and CSG_Parameters::Set_Enabled().

◆ Set_User_Defined() [1/4]

bool CSG_Parameters_Grid_Target::Set_User_Defined | ( | CSG_Parameters * | pParameters,
 |  | const CSG_Grid_System & | System
 | ) |  |

Initializes the grid system from 'System', if it represents a valid grid system.

Definition at line 1515 of file parameter.cpp.

References CSG_Grid_System::Get_Extent(), CSG_Grid_System::Get_NY(), CSG_Grid_System::is_Valid(), and Set_User_Defined().

◆ Set_User_Defined() [2/4]

bool CSG_Parameters_Grid_Target::Set_User_Defined | ( | CSG_Parameters * | pParameters,
 |  | const TSG_Rect & | Extent,
 |  | int | Rows = 0,
 |  | int | Rounding = 2
 | ) |  |

Initializes the grid system from extent and number of rows. Extent calculation is done for grid nodes and will automatically become adjusted to match the grid cells if necessary. If Rounding is greater than zero it specifies the number of significant figures to which the cell size is rounded and also adjusts the extent coordinates to be a multiple of cell size.

Definition at line 1410 of file parameter.cpp.

References CSG_String::Cmp(), CSG_Parameters::Get_Identifier(), CSG_Parameters::Get_Tool(), CSG_Rect::Get_XCenter(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Rect::Get_XRange(), CSG_Rect::Get_YCenter(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), CSG_Rect::Get_YRange(), CSG_Tool::has_GUI(), CSG_Rect::Inflate(), CSG_Parameters::Set_Callback(), CSG_Parameters::Set_Parameter(), SG_Get_Rounded_To_SignificantFigures(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by Set_User_Defined().

◆ Set_User_Defined() [3/4]

bool CSG_Parameters_Grid_Target::Set_User_Defined | ( | CSG_Parameters * | pParameters,
 |  | CSG_Shapes * | pPoints,
 |  | int | Scale = 4,
 |  | int | Rounding = 2
 | ) |  |

Initializes the grid system from 'pPoints' extent and fits number of columns/rows to the average point density. Number of columns/rows can be increased if 'Scale' is greater than 1.

Definition at line 1485 of file parameter.cpp.

References CSG_Rect::Get_Area(), CSG_Table::Get_Count(), CSG_Shapes::Get_Extent(), CSG_Rect::Get_YRange(), Set_User_Defined(), SG_Get_Rounded_To_SignificantFigures(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Set_User_Defined() [4/4]

bool CSG_Parameters_Grid_Target::Set_User_Defined | ( | CSG_Parameters * | pParameters,
 |  | double | xMin,
 |  | double | yMin,
 |  | double | Cellsize,
 |  | int | nx,
 |  | int | ny
 | ) |  |

Initializes the grid system from lower left cell center coordinate, cell size and number of columns and rows (nx, ny).

Definition at line 1524 of file parameter.cpp.

References Set_User_Defined().

◆ Set_User_Defined_ZLevels()

bool CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels | ( | CSG_Parameters * | pParameters,
 |  | double | zMin,
 |  | double | zMax,
 |  | int | nLevels,
 |  | int | Rounding = 2
 | ) |  |

Initializes the grid collection's z level arrangement.

Definition at line 1533 of file parameter.cpp.

References CSG_String::Cmp(), CSG_Parameters::Get_Identifier(), CSG_Parameters::Get_Tool(), CSG_Tool::has_GUI(), CSG_Parameters::Set_Callback(), CSG_Parameters::Set_Parameter(), and SG_Get_Rounded_To_SignificantFigures().

The documentation for this class was generated from the following files:
  • parameters.h
  • parameter.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameters_Grid_Target Member List

This is the complete list of members for CSG_Parameters_Grid_Target, including all inherited members.

Add_Grid(const CSG_String &ID, const CSG_String &Name, bool bOptional) | CSG_Parameters_Grid_Target |
Add_Grids(const CSG_String &ID, const CSG_String &Name, bool bOptional, bool bZLevels=false) | CSG_Parameters_Grid_Target |
Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix="") | CSG_Parameters_Grid_Target |
Create(CSG_Parameters *pParameters, bool bAddDefaultGrid=true, const CSG_String &ParentID="", const CSG_String &Prefix="") | CSG_Parameters_Grid_Target |
CSG_Parameters_Grid_Target(void) | CSG_Parameters_Grid_Target |
Get_Grid(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float) | CSG_Parameters_Grid_Target |
Get_Grid(TSG_Data_Type Type=SG_DATATYPE_Float) | CSG_Parameters_Grid_Target |
Get_Grids(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float) | CSG_Parameters_Grid_Target |
Get_Grids(TSG_Data_Type Type=SG_DATATYPE_Float) | CSG_Parameters_Grid_Target |
Get_System(void) | CSG_Parameters_Grid_Target |
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Parameters_Grid_Target |
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix) | CSG_Parameters_Grid_Target | static
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Parameters_Grid_Target |
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix) | CSG_Parameters_Grid_Target | static
Set_User_Defined(CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows=0, int Rounding=2) | CSG_Parameters_Grid_Target |
Set_User_Defined(CSG_Parameters *pParameters, CSG_Shapes *pPoints, int Scale=4, int Rounding=2) | CSG_Parameters_Grid_Target |
Set_User_Defined(CSG_Parameters *pParameters, double xMin, double yMin, double Size, int nx, int ny) | CSG_Parameters_Grid_Target |
Set_User_Defined(CSG_Parameters *pParameters, const CSG_Grid_System &System) | CSG_Parameters_Grid_Target |
Set_User_Defined_ZLevels(CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding=2) | CSG_Parameters_Grid_Target |
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameters_Point_Search Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Parameters_Point_Search Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Parameters_Point_Search:
CSG_Parameters_Point_Search_KDTree_2D

Public Member Functions

CSG_Parameters_Point_Search (void)
virtual | ~CSG_Parameters_Point_Search (void)
virtual bool | Create (class CSG_Parameters *pParameters, const CSG_String &Parent="", size_t minPoints=0)
virtual bool | On_Parameter_Changed (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
virtual bool | On_Parameters_Enable (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
bool | Do_Use_All (void) const
bool | Do_Use_All (bool bUpdate)
size_t | Get_Min_Points (void) const
size_t | Get_Max_Points (void) const
double | Get_Radius (void) const

Protected Member Functions

bool Update (void)

Protected Attributes

size_t | m_minPoints
size_t | m_maxPoints
double | m_Radius
class CSG_Parameters * | m_pParameters

Detailed Description

Definition at line 1363 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Parameters_Point_Search()

CSG_Parameters_Point_Search::CSG_Parameters_Point_Search ( void )

Definition at line 1083 of file kdtree.cpp.

References m_maxPoints, m_minPoints, m_pParameters, and m_Radius.

◆ ~CSG_Parameters_Point_Search()

virtual CSG_Parameters_Point_Search::~CSG_Parameters_Point_Search ( void )
inlinevirtual

Definition at line 1367 of file shapes.h.

Member Function Documentation

◆ Create()

bool CSG_Parameters_Point_Search::Create | ( | class CSG_Parameters * | pParameters,
 |  | const CSG_String & | Parent = "",
 |  | size_t | minPoints = 0
 | ) |  |
virtual

Definition at line 1093 of file kdtree.cpp.

References _TL, CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Double(), CSG_Parameters::Add_Int(), CSG_Parameters::Add_Node(), CSG_String::Format(), CSG_String::is_Empty(), and m_pParameters.

◆ Do_Use_All() [1/2]

bool CSG_Parameters_Point_Search::Do_Use_All ( bool bUpdate )

Definition at line 1217 of file kdtree.cpp.

References m_maxPoints, m_Radius, and Update().

◆ Do_Use_All() [2/2]

bool CSG_Parameters_Point_Search::Do_Use_All ( void ) const
inline

Definition at line 1374 of file shapes.h.

Referenced by CSG_Parameters_Point_Search_KDTree_2D::Initialize().

◆ Get_Max_Points()

size_t CSG_Parameters_Point_Search::Get_Max_Points ( void ) const
inline

Definition at line 1378 of file shapes.h.

◆ Get_Min_Points()

size_t CSG_Parameters_Point_Search::Get_Min_Points ( void ) const
inline

Definition at line 1377 of file shapes.h.

◆ Get_Radius()

double CSG_Parameters_Point_Search::Get_Radius ( void ) const
inline

Definition at line 1379 of file shapes.h.

◆ On_Parameter_Changed()

bool CSG_Parameters_Point_Search::On_Parameter_Changed | ( | class CSG_Parameters * | pParameters,
 |  | class CSG_Parameter * | pParameter
 | ) |  |
virtual

Definition at line 1156 of file kdtree.cpp.

References CSG_Parameter::asShapes(), CSG_String::Cmp(), CSG_Rect::Get_Area(), CSG_Table::Get_Count(), CSG_Shapes::Get_Extent(), CSG_Parameters::Get_Identifier(), m_pParameters, CSG_Parameters::Set_Parameter(), and SG_Get_Rounded_To_SignificantFigures().

◆ On_Parameters_Enable()

bool CSG_Parameters_Point_Search::On_Parameters_Enable | ( | class CSG_Parameters * | pParameters,
 |  | class CSG_Parameter * | pParameter
 | ) |  |
virtual

Definition at line 1171 of file kdtree.cpp.

References CSG_Parameter::asInt(), CSG_String::Cmp(), CSG_Parameter::Cmp_Identifier(), CSG_Parameters::Get_Identifier(), m_pParameters, and CSG_Parameters::Set_Enabled().

◆ Update()

bool CSG_Parameters_Point_Search::Update ( void )
protected

Definition at line 1199 of file kdtree.cpp.

References m_maxPoints, m_minPoints, m_pParameters, and m_Radius.

Referenced by Do_Use_All(), and CSG_Parameters_Point_Search_KDTree_2D::Initialize().

Member Data Documentation

◆ m_maxPoints

size_t CSG_Parameters_Point_Search::m_maxPoints
protected

Definition at line 1387 of file shapes.h.

Referenced by CSG_Parameters_Point_Search(), Do_Use_All(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), CSG_Parameters_Point_Search_KDTree_2D::Set_Location(), and Update().

◆ m_minPoints

size_t CSG_Parameters_Point_Search::m_minPoints
protected

Definition at line 1387 of file shapes.h.

Referenced by CSG_Parameters_Point_Search(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), and Update().

◆ m_pParameters

class CSG_Parameters* CSG_Parameters_Point_Search::m_pParameters
protected

Definition at line 1391 of file shapes.h.

Referenced by Create(), CSG_Parameters_Point_Search(), CSG_Parameters_Point_Search_KDTree_2D::Initialize(), On_Parameter_Changed(), On_Parameters_Enable(), and Update().

◆ m_Radius

double CSG_Parameters_Point_Search::m_Radius
protected

Definition at line 1389 of file shapes.h.

Referenced by CSG_Parameters_Point_Search(), Do_Use_All(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), CSG_Parameters_Point_Search_KDTree_2D::Set_Location(), and Update().

The documentation for this class was generated from the following files:
  • shapes.h
  • kdtree.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameters_Point_Search Member List

This is the complete list of members for CSG_Parameters_Point_Search, including all inherited members.

Create(class CSG_Parameters *pParameters, const CSG_String &Parent="", size_t minPoints=0) | CSG_Parameters_Point_Search | virtual
CSG_Parameters_Point_Search(void) | CSG_Parameters_Point_Search |
Do_Use_All(void) const | CSG_Parameters_Point_Search | inline
Do_Use_All(bool bUpdate) | CSG_Parameters_Point_Search |
Get_Max_Points(void) const | CSG_Parameters_Point_Search | inline
Get_Min_Points(void) const | CSG_Parameters_Point_Search | inline
Get_Radius(void) const | CSG_Parameters_Point_Search | inline
m_maxPoints | CSG_Parameters_Point_Search | protected
m_minPoints | CSG_Parameters_Point_Search | protected
m_pParameters | CSG_Parameters_Point_Search | protected
m_Radius | CSG_Parameters_Point_Search | protected
On_Parameter_Changed(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter) | CSG_Parameters_Point_Search | virtual
On_Parameters_Enable(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter) | CSG_Parameters_Point_Search | virtual
Update(void) | CSG_Parameters_Point_Search | protected
~CSG_Parameters_Point_Search(void) | CSG_Parameters_Point_Search | inlinevirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Parameters_Point_Search_KDTree_2D Class Reference

Public Member Functions | List of all members
CSG_Parameters_Point_Search_KDTree_2D Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Parameters_Point_Search_KDTree_2D:
CSG_Parameters_Point_Search

Public Member Functions

CSG_Parameters_Point_Search_KDTree_2D (void)
virtual | ~CSG_Parameters_Point_Search_KDTree_2D (void)
bool | Initialize (CSG_Shapes *pPoints, int zField=-1)
bool | Finalize (void)
sLong | Set_Location (double x, double y)
sLong | Set_Location (const CSG_Point &p)
sLong | Get_Count (void) const
bool | Get_Point (sLong Index, double &x, double &y, double &z)
bool | Get_Points (double x, double y, CSG_Points_3D &Points)
bool | Get_Points (const CSG_Point &p, CSG_Points_3D &Points)
bool | Get_Points (double x, double y, CSG_Array_Int &Indices)
bool | Get_Points (const CSG_Point &p, CSG_Array_Int &Indices)
bool | Get_Points (double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances)
bool | Get_Points (const CSG_Point &p, CSG_Array_Int &Indices, CSG_Vector &Distances)
- Public Member Functions inherited from CSG_Parameters_Point_Search
CSG_Parameters_Point_Search (void)
virtual | ~CSG_Parameters_Point_Search (void)
virtual bool | Create (class CSG_Parameters *pParameters, const CSG_String &Parent="", size_t minPoints=0)
virtual bool | On_Parameter_Changed (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
virtual bool | On_Parameters_Enable (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
bool | Do_Use_All (void) const
bool | Do_Use_All (bool bUpdate)
size_t | Get_Min_Points (void) const
size_t | Get_Max_Points (void) const
double | Get_Radius (void) const

Additional Inherited Members

- Protected Member Functions inherited from CSG_Parameters_Point_Search
bool | Update (void)
- Protected Attributes inherited from CSG_Parameters_Point_Search
size_t | m_minPoints
size_t | m_maxPoints
double | m_Radius
class CSG_Parameters * | m_pParameters

Detailed Description

Definition at line 1396 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Parameters_Point_Search_KDTree_2D()

CSG_Parameters_Point_Search_KDTree_2D::CSG_Parameters_Point_Search_KDTree_2D ( void )

Definition at line 1235 of file kdtree.cpp.

References Finalize().

◆ ~CSG_Parameters_Point_Search_KDTree_2D()

virtual CSG_Parameters_Point_Search_KDTree_2D::~CSG_Parameters_Point_Search_KDTree_2D ( void )
inlinevirtual

Definition at line 1400 of file shapes.h.

Member Function Documentation

◆ Finalize()

bool CSG_Parameters_Point_Search_KDTree_2D::Finalize ( void )

Definition at line 1265 of file kdtree.cpp.

References CSG_KDTree_2D::Destroy().

Referenced by CSG_Parameters_Point_Search_KDTree_2D(), and Initialize().

◆ Get_Count()

sLong CSG_Parameters_Point_Search_KDTree_2D::Get_Count ( void ) const
inline

Definition at line 1408 of file shapes.h.

◆ Get_Point()

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Point | ( | sLong | Index,
 |  | double & | x,
 |  | double & | y,
 |  | double & | z
 | ) |  |

Definition at line 1305 of file kdtree.cpp.

References CSG_Table_Record::asDouble(), CSG_KDTree::Get_Match_Count(), CSG_KDTree::Get_Match_Shape(), CSG_KDTree::Get_Point(), CSG_Shape::Get_Point(), CSG_PointCloud::Get_Shape(), CSG_Table_Record::is_NoData(), SSG_Point::x, and SSG_Point::y.

◆ Get_Points() [1/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | const CSG_Point & | p,
 |  | CSG_Array_Int & | Indices
 | ) |  |

Definition at line 1417 of file kdtree.cpp.

References Get_Points(), SSG_Point::x, and SSG_Point::y.

◆ Get_Points() [2/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | const CSG_Point & | p,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |

Definition at line 1436 of file kdtree.cpp.

References Get_Points(), SSG_Point::x, and SSG_Point::y.

◆ Get_Points() [3/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | const CSG_Point & | p,
 |  | CSG_Points_3D & | Points
 | ) |  |

Definition at line 1391 of file kdtree.cpp.

References Get_Points(), SSG_Point::x, and SSG_Point::y.

◆ Get_Points() [4/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | double | x,
 |  | double | y,
 |  | CSG_Array_Int & | Indices
 | ) |  |

Definition at line 1402 of file kdtree.cpp.

References CSG_Table::Get_Count(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_Parameters_Point_Search::m_maxPoints, CSG_Parameters_Point_Search::m_minPoints, and CSG_Parameters_Point_Search::m_Radius.

◆ Get_Points() [5/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | double | x,
 |  | double | y,
 |  | CSG_Array_Int & | Indices,
 |  | CSG_Vector & | Distances
 | ) |  |

Definition at line 1423 of file kdtree.cpp.

References CSG_Table::Get_Count(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_Parameters_Point_Search::m_maxPoints, CSG_Parameters_Point_Search::m_minPoints, and CSG_Parameters_Point_Search::m_Radius.

◆ Get_Points() [6/6]

bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points | ( | double | x,
 |  | double | y,
 |  | CSG_Points_3D & | Points
 | ) |  |

Definition at line 1359 of file kdtree.cpp.

References CSG_Points_3D::Add(), CSG_Points_3D::Clear(), CSG_KDTree::Get_Match_Shape(), CSG_KDTree::Get_Point(), CSG_Shape::Get_Point(), CSG_Array_Int::Get_Size(), SSG_Point::x, and SSG_Point::y.

Referenced by Get_Points().

◆ Initialize()

bool CSG_Parameters_Point_Search_KDTree_2D::Initialize | ( | CSG_Shapes * | pPoints,
 |  | int | zField = -1
 | ) |  |

Definition at line 1246 of file kdtree.cpp.

References CSG_KDTree_2D::Create(), CSG_Parameters_Point_Search::Do_Use_All(), Finalize(), CSG_Table::Get_Count(), CSG_Parameters_Point_Search::m_pParameters, and CSG_Parameters_Point_Search::Update().

◆ Set_Location() [1/2]

sLong CSG_Parameters_Point_Search_KDTree_2D::Set_Location ( const CSG_Point & p )

Definition at line 1294 of file kdtree.cpp.

References Set_Location(), SSG_Point::x, and SSG_Point::y.

◆ Set_Location() [2/2]

sLong CSG_Parameters_Point_Search_KDTree_2D::Set_Location | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 1281 of file kdtree.cpp.

References CSG_Table::Get_Count(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_Parameters_Point_Search::m_maxPoints, and CSG_Parameters_Point_Search::m_Radius.

Referenced by Set_Location().

The documentation for this class was generated from the following files:
  • shapes.h
  • kdtree.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Parameters_Point_Search_KDTree_2D Member List

This is the complete list of members for CSG_Parameters_Point_Search_KDTree_2D, including all inherited members.

Create(class CSG_Parameters *pParameters, const CSG_String &Parent="", size_t minPoints=0) | CSG_Parameters_Point_Search | virtual
CSG_Parameters_Point_Search(void) | CSG_Parameters_Point_Search |
CSG_Parameters_Point_Search_KDTree_2D(void) | CSG_Parameters_Point_Search_KDTree_2D |
Do_Use_All(void) const | CSG_Parameters_Point_Search | inline
Do_Use_All(bool bUpdate) | CSG_Parameters_Point_Search |
Finalize(void) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Count(void) const | CSG_Parameters_Point_Search_KDTree_2D | inline
Get_Max_Points(void) const | CSG_Parameters_Point_Search | inline
Get_Min_Points(void) const | CSG_Parameters_Point_Search | inline
Get_Point(sLong Index, double &x, double &y, double &z) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(double x, double y, CSG_Points_3D &Points) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(const CSG_Point &p, CSG_Points_3D &Points) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(double x, double y, CSG_Array_Int &Indices) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(const CSG_Point &p, CSG_Array_Int &Indices) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Points(const CSG_Point &p, CSG_Array_Int &Indices, CSG_Vector &Distances) | CSG_Parameters_Point_Search_KDTree_2D |
Get_Radius(void) const | CSG_Parameters_Point_Search | inline
Initialize(CSG_Shapes *pPoints, int zField=-1) | CSG_Parameters_Point_Search_KDTree_2D |
m_maxPoints | CSG_Parameters_Point_Search | protected
m_minPoints | CSG_Parameters_Point_Search | protected
m_pParameters | CSG_Parameters_Point_Search | protected
m_Radius | CSG_Parameters_Point_Search | protected
On_Parameter_Changed(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter) | CSG_Parameters_Point_Search | virtual
On_Parameters_Enable(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter) | CSG_Parameters_Point_Search | virtual
Set_Location(double x, double y) | CSG_Parameters_Point_Search_KDTree_2D |
Set_Location(const CSG_Point &p) | CSG_Parameters_Point_Search_KDTree_2D |
Update(void) | CSG_Parameters_Point_Search | protected
~CSG_Parameters_Point_Search(void) | CSG_Parameters_Point_Search | inlinevirtual
~CSG_Parameters_Point_Search_KDTree_2D(void) | CSG_Parameters_Point_Search_KDTree_2D | inlinevirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Point Class Reference

Public Member Functions | List of all members
CSG_Point Class Reference

#include <geo_tools.h>

Inheritance diagram for CSG_Point:
SSG_Point

Public Member Functions

CSG_Point (void)
CSG_Point (const CSG_Point &Point)
CSG_Point (const TSG_Point &Point)
CSG_Point (double x, double y)
virtual | ~CSG_Point (void)
virtual TSG_Point_Type | Get_Type (void) const
virtual bool | operator== (const CSG_Point &Point) const
virtual bool | operator!= (const CSG_Point &Point) const
virtual CSG_Point | operator+ (const CSG_Point &Point) const
virtual CSG_Point | operator- (const CSG_Point &Point) const
virtual CSG_Point & | operator= (const CSG_Point &Point)
virtual CSG_Point & | operator+= (const CSG_Point &Point)
virtual CSG_Point & | operator-= (const CSG_Point &Point)
virtual CSG_Point & | operator*= (const CSG_Point &Point)
CSG_Point | operator* (double Value) const
CSG_Point | operator/ (double Value) const
virtual CSG_Point & | operator*= (double Value)
virtual CSG_Point & | operator/= (double Value)
virtual void | Assign (double x, double y)
virtual void | Assign (const CSG_Point &Point)
virtual void | Add (const CSG_Point &Point)
virtual void | Subtract (const CSG_Point &Point)
virtual void | Multiply (const CSG_Point &Point)
virtual void | Multiply (double Value)
virtual void | Divide (double Value)
virtual double | Get_Length (void) const
virtual bool | is_Equal (const CSG_Point &Point, double epsilon=0.) const
virtual bool | is_Equal (double _x, double _y, double epsilon=0.) const

Additional Inherited Members

- Public Attributes inherited from SSG_Point
double | x
double | y

Detailed Description

Definition at line 134 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Point() [1/4]

CSG_Point::CSG_Point ( void )

Definition at line 65 of file geo_classes.cpp.

References Assign().

◆ CSG_Point() [2/4]

CSG_Point::CSG_Point ( const CSG_Point & Point )

Definition at line 70 of file geo_classes.cpp.

References Assign(), SSG_Point::x, and SSG_Point::y.

◆ CSG_Point() [3/4]

CSG_Point::CSG_Point ( const TSG_Point & Point )

Definition at line 75 of file geo_classes.cpp.

References Assign(), SSG_Point::x, and SSG_Point::y.

◆ CSG_Point() [4/4]

CSG_Point::CSG_Point | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 80 of file geo_classes.cpp.

References Assign().

◆ ~CSG_Point()

virtual CSG_Point::~CSG_Point ( void )
inlinevirtual

Definition at line 142 of file geo_tools.h.

Member Function Documentation

◆ Add()

void CSG_Point::Add ( const CSG_Point & Point )
virtual

Definition at line 99 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Assign() [1/2]

void CSG_Point::Assign ( const CSG_Point & Point )
virtual

Definition at line 92 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Assign() [2/2]

void CSG_Point::Assign | ( | double | x,
 |  | double | y
 | ) |  |
virtual

Definition at line 86 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Point(), CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base(), and CSG_Shape_Points::Get_Centroid().

◆ Divide()

void CSG_Point::Divide ( double Value )
virtual

Definition at line 123 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Length()

double CSG_Point::Get_Length ( void ) const
virtual

Definition at line 130 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Type()

virtual TSG_Point_Type CSG_Point::Get_Type ( void ) const
inlinevirtual

Definition at line 144 of file geo_tools.h.

◆ is_Equal() [1/2]

virtual bool CSG_Point::is_Equal | ( | const CSG_Point & | Point,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 174 of file geo_tools.h.

References is_Equal(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape::Intersects(), is_Equal(), and CSG_Shape_Points::On_Intersects().

◆ is_Equal() [2/2]

virtual bool CSG_Point::is_Equal | ( | double | _x,
 |  | double | _y,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 175 of file geo_tools.h.

◆ Multiply() [1/2]

void CSG_Point::Multiply ( const CSG_Point & Point )
virtual

Definition at line 111 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Multiply() [2/2]

void CSG_Point::Multiply ( double Value )
virtual

Definition at line 117 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ operator!=()

virtual bool CSG_Point::operator!= ( const CSG_Point & Point ) const
inlinevirtual

Definition at line 147 of file geo_tools.h.

◆ operator*()

CSG_Point CSG_Point::operator* ( double Value ) const
inline

Definition at line 157 of file geo_tools.h.

◆ operator*=() [1/2]

virtual CSG_Point& CSG_Point::operator*= ( const CSG_Point & Point )
inlinevirtual

Definition at line 155 of file geo_tools.h.

◆ operator*=() [2/2]

virtual CSG_Point& CSG_Point::operator*= ( double Value )
inlinevirtual

Definition at line 159 of file geo_tools.h.

◆ operator+()

virtual CSG_Point CSG_Point::operator+ ( const CSG_Point & Point ) const
inlinevirtual

Definition at line 149 of file geo_tools.h.

References SSG_Point::x, and SSG_Point::y.

◆ operator+=()

virtual CSG_Point& CSG_Point::operator+= ( const CSG_Point & Point )
inlinevirtual

Definition at line 153 of file geo_tools.h.

◆ operator-()

virtual CSG_Point CSG_Point::operator- ( const CSG_Point & Point ) const
inlinevirtual

Definition at line 150 of file geo_tools.h.

References SSG_Point::x, and SSG_Point::y.

◆ operator-=()

virtual CSG_Point& CSG_Point::operator-= ( const CSG_Point & Point )
inlinevirtual

Definition at line 154 of file geo_tools.h.

◆ operator/()

CSG_Point CSG_Point::operator/ ( double Value ) const
inline

Definition at line 158 of file geo_tools.h.

◆ operator/=()

virtual CSG_Point& CSG_Point::operator/= ( double Value )
inlinevirtual

Definition at line 160 of file geo_tools.h.

◆ operator=()

virtual CSG_Point& CSG_Point::operator= ( const CSG_Point & Point )
inlinevirtual

Definition at line 152 of file geo_tools.h.

◆ operator==()

virtual bool CSG_Point::operator== ( const CSG_Point & Point ) const
inlinevirtual

Definition at line 146 of file geo_tools.h.

◆ Subtract()

void CSG_Point::Subtract ( const CSG_Point & Point )
virtual

Definition at line 105 of file geo_classes.cpp.

References SSG_Point::x, and SSG_Point::y.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Point Member List

This is the complete list of members for CSG_Point, including all inherited members.

Add(const CSG_Point &Point) | CSG_Point | virtual
Assign(double x, double y) | CSG_Point | virtual
Assign(const CSG_Point &Point) | CSG_Point | virtual
CSG_Point(void) | CSG_Point |
CSG_Point(const CSG_Point &Point) | CSG_Point |
CSG_Point(const TSG_Point &Point) | CSG_Point |
CSG_Point(double x, double y) | CSG_Point |
Divide(double Value) | CSG_Point | virtual
Get_Length(void) const | CSG_Point | virtual
Get_Type(void) const | CSG_Point | inlinevirtual
is_Equal(const CSG_Point &Point, double epsilon=0.) const | CSG_Point | inlinevirtual
is_Equal(double _x, double _y, double epsilon=0.) const | CSG_Point | inlinevirtual
Multiply(const CSG_Point &Point) | CSG_Point | virtual
Multiply(double Value) | CSG_Point | virtual
operator!=(const CSG_Point &Point) const | CSG_Point | inlinevirtual
operator*(double Value) const | CSG_Point | inline
operator*=(const CSG_Point &Point) | CSG_Point | inlinevirtual
operator*=(double Value) | CSG_Point | inlinevirtual
operator+(const CSG_Point &Point) const | CSG_Point | inlinevirtual
operator+=(const CSG_Point &Point) | CSG_Point | inlinevirtual
operator-(const CSG_Point &Point) const | CSG_Point | inlinevirtual
operator-=(const CSG_Point &Point) | CSG_Point | inlinevirtual
operator/(double Value) const | CSG_Point | inline
operator/=(double Value) | CSG_Point | inlinevirtual
operator=(const CSG_Point &Point) | CSG_Point | inlinevirtual
operator==(const CSG_Point &Point) const | CSG_Point | inlinevirtual
Subtract(const CSG_Point &Point) | CSG_Point | virtual
x | SSG_Point |
y | SSG_Point |
~CSG_Point(void) | CSG_Point | inlinevirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Point_3D Class Reference

Public Member Functions | List of all members
CSG_Point_3D Class Reference

#include <geo_tools.h>

Inheritance diagram for CSG_Point_3D:
SSG_Point_3D

Public Member Functions

CSG_Point_3D (void)
CSG_Point_3D (const CSG_Point_3D &Point)
CSG_Point_3D (const TSG_Point_3D &Point)
CSG_Point_3D (double x, double y, double z)
virtual | ~CSG_Point_3D (void)
virtual TSG_Point_Type | Get_Type (void) const
virtual bool | operator== (const CSG_Point_3D &Point) const
virtual bool | operator!= (const CSG_Point_3D &Point) const
virtual CSG_Point_3D | operator+ (const CSG_Point_3D &Point) const
virtual CSG_Point_3D | operator- (const CSG_Point_3D &Point) const
virtual CSG_Point_3D & | operator= (const CSG_Point_3D &Point)
virtual CSG_Point_3D & | operator+= (const CSG_Point_3D &Point)
virtual CSG_Point_3D & | operator-= (const CSG_Point_3D &Point)
virtual CSG_Point_3D & | operator*= (const CSG_Point_3D &Point)
CSG_Point_3D | operator* (double Value) const
CSG_Point_3D | operator/ (double Value) const
virtual CSG_Point_3D & | operator*= (double Value)
virtual CSG_Point_3D & | operator/= (double Value)
virtual void | Assign (double x, double y, double z)
virtual void | Assign (const CSG_Point_3D &Point)
virtual void | Add (const CSG_Point_3D &Point)
virtual void | Subtract (const CSG_Point_3D &Point)
virtual void | Multiply (const CSG_Point_3D &Point)
virtual void | Multiply (double Value)
virtual void | Divide (double Value)
virtual double | Get_Length (void) const
virtual bool | is_Equal (const CSG_Point_3D &Point, double epsilon=0.) const
virtual bool | is_Equal (double _x, double _y, double _z, double epsilon=0.) const

Additional Inherited Members

- Public Attributes inherited from SSG_Point_3D
double | x
double | y
double | z

Detailed Description

Definition at line 270 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Point_3D() [1/4]

CSG_Point_3D::CSG_Point_3D ( void )

Definition at line 141 of file geo_classes.cpp.

References Assign().

◆ CSG_Point_3D() [2/4]

CSG_Point_3D::CSG_Point_3D ( const CSG_Point_3D & Point )

Definition at line 146 of file geo_classes.cpp.

References Assign(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ CSG_Point_3D() [3/4]

CSG_Point_3D::CSG_Point_3D ( const TSG_Point_3D & Point )

Definition at line 151 of file geo_classes.cpp.

References Assign(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ CSG_Point_3D() [4/4]

CSG_Point_3D::CSG_Point_3D | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |

Definition at line 156 of file geo_classes.cpp.

References Assign().

◆ ~CSG_Point_3D()

virtual CSG_Point_3D::~CSG_Point_3D ( void )
inlinevirtual

Definition at line 278 of file geo_tools.h.

Member Function Documentation

◆ Add()

void CSG_Point_3D::Add ( const CSG_Point_3D & Point )
virtual

Definition at line 177 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Assign() [1/2]

void CSG_Point_3D::Assign ( const CSG_Point_3D & Point )
virtual

Definition at line 169 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Assign() [2/2]

void CSG_Point_3D::Assign | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
virtual

Definition at line 162 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

Referenced by CSG_Point_3D().

◆ Divide()

void CSG_Point_3D::Divide ( double Value )
virtual

Definition at line 205 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Length()

double CSG_Point_3D::Get_Length ( void ) const
virtual

Definition at line 213 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Type()

virtual TSG_Point_Type CSG_Point_3D::Get_Type ( void ) const
inlinevirtual

Definition at line 280 of file geo_tools.h.

◆ is_Equal() [1/2]

virtual bool CSG_Point_3D::is_Equal | ( | const CSG_Point_3D & | Point,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 310 of file geo_tools.h.

References is_Equal(), SSG_Point_3D::x, and SSG_Point_3D::y.

Referenced by is_Equal().

◆ is_Equal() [2/2]

virtual bool CSG_Point_3D::is_Equal | ( | double | _x,
 |  | double | _y,
 |  | double | _z,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 311 of file geo_tools.h.

◆ Multiply() [1/2]

void CSG_Point_3D::Multiply ( const CSG_Point_3D & Point )
virtual

Definition at line 191 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Multiply() [2/2]

void CSG_Point_3D::Multiply ( double Value )
virtual

Definition at line 198 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ operator!=()

virtual bool CSG_Point_3D::operator!= ( const CSG_Point_3D & Point ) const
inlinevirtual

Definition at line 283 of file geo_tools.h.

◆ operator*()

CSG_Point_3D CSG_Point_3D::operator* ( double Value ) const
inline

Definition at line 293 of file geo_tools.h.

◆ operator*=() [1/2]

virtual CSG_Point_3D& CSG_Point_3D::operator*= ( const CSG_Point_3D & Point )
inlinevirtual

Definition at line 291 of file geo_tools.h.

◆ operator*=() [2/2]

virtual CSG_Point_3D& CSG_Point_3D::operator*= ( double Value )
inlinevirtual

Definition at line 295 of file geo_tools.h.

◆ operator+()

virtual CSG_Point_3D CSG_Point_3D::operator+ ( const CSG_Point_3D & Point ) const
inlinevirtual

Definition at line 285 of file geo_tools.h.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ operator+=()

virtual CSG_Point_3D& CSG_Point_3D::operator+= ( const CSG_Point_3D & Point )
inlinevirtual

Definition at line 289 of file geo_tools.h.

◆ operator-()

virtual CSG_Point_3D CSG_Point_3D::operator- ( const CSG_Point_3D & Point ) const
inlinevirtual

Definition at line 286 of file geo_tools.h.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ operator-=()

virtual CSG_Point_3D& CSG_Point_3D::operator-= ( const CSG_Point_3D & Point )
inlinevirtual

Definition at line 290 of file geo_tools.h.

◆ operator/()

CSG_Point_3D CSG_Point_3D::operator/ ( double Value ) const
inline

Definition at line 294 of file geo_tools.h.

◆ operator/=()

virtual CSG_Point_3D& CSG_Point_3D::operator/= ( double Value )
inlinevirtual

Definition at line 296 of file geo_tools.h.

◆ operator=()

virtual CSG_Point_3D& CSG_Point_3D::operator= ( const CSG_Point_3D & Point )
inlinevirtual

Definition at line 288 of file geo_tools.h.

◆ operator==()

virtual bool CSG_Point_3D::operator== ( const CSG_Point_3D & Point ) const
inlinevirtual

Definition at line 282 of file geo_tools.h.

◆ Subtract()

void CSG_Point_3D::Subtract ( const CSG_Point_3D & Point )
virtual

Definition at line 184 of file geo_classes.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Point_3D Member List

This is the complete list of members for CSG_Point_3D, including all inherited members.

Add(const CSG_Point_3D &Point) | CSG_Point_3D | virtual
Assign(double x, double y, double z) | CSG_Point_3D | virtual
Assign(const CSG_Point_3D &Point) | CSG_Point_3D | virtual
CSG_Point_3D(void) | CSG_Point_3D |
CSG_Point_3D(const CSG_Point_3D &Point) | CSG_Point_3D |
CSG_Point_3D(const TSG_Point_3D &Point) | CSG_Point_3D |
CSG_Point_3D(double x, double y, double z) | CSG_Point_3D |
Divide(double Value) | CSG_Point_3D | virtual
Get_Length(void) const | CSG_Point_3D | virtual
Get_Type(void) const | CSG_Point_3D | inlinevirtual
is_Equal(const CSG_Point_3D &Point, double epsilon=0.) const | CSG_Point_3D | inlinevirtual
is_Equal(double _x, double _y, double _z, double epsilon=0.) const | CSG_Point_3D | inlinevirtual
Multiply(const CSG_Point_3D &Point) | CSG_Point_3D | virtual
Multiply(double Value) | CSG_Point_3D | virtual
operator!=(const CSG_Point_3D &Point) const | CSG_Point_3D | inlinevirtual
operator*(double Value) const | CSG_Point_3D | inline
operator*=(const CSG_Point_3D &Point) | CSG_Point_3D | inlinevirtual
operator*=(double Value) | CSG_Point_3D | inlinevirtual
operator+(const CSG_Point_3D &Point) const | CSG_Point_3D | inlinevirtual
operator+=(const CSG_Point_3D &Point) | CSG_Point_3D | inlinevirtual
operator-(const CSG_Point_3D &Point) const | CSG_Point_3D | inlinevirtual
operator-=(const CSG_Point_3D &Point) | CSG_Point_3D | inlinevirtual
operator/(double Value) const | CSG_Point_3D | inline
operator/=(double Value) | CSG_Point_3D | inlinevirtual
operator=(const CSG_Point_3D &Point) | CSG_Point_3D | inlinevirtual
operator==(const CSG_Point_3D &Point) const | CSG_Point_3D | inlinevirtual
Subtract(const CSG_Point_3D &Point) | CSG_Point_3D | virtual
x | SSG_Point_3D |
y | SSG_Point_3D |
z | SSG_Point_3D |
~CSG_Point_3D(void) | CSG_Point_3D | inlinevirtual
Generated on Thu Oct 5 2023 17:36:15 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Point_4D Class Reference

Public Member Functions | List of all members
CSG_Point_4D Class Reference

#include <geo_tools.h>

Inheritance diagram for CSG_Point_4D:
SSG_Point_4D

Public Member Functions

CSG_Point_4D (void)
CSG_Point_4D (const CSG_Point_4D &Point)
CSG_Point_4D (const TSG_Point_4D &Point)
CSG_Point_4D (double x, double y, double z, double m)
virtual | ~CSG_Point_4D (void)
virtual TSG_Point_Type | Get_Type (void) const
virtual bool | operator== (const CSG_Point_4D &Point) const
virtual bool | operator!= (const CSG_Point_4D &Point) const
virtual CSG_Point_4D | operator+ (const CSG_Point_4D &Point) const
virtual CSG_Point_4D | operator- (const CSG_Point_4D &Point) const
CSG_Point_4D | operator* (double Value) const
CSG_Point_4D | operator/ (double Value) const
virtual CSG_Point_4D & | operator*= (double Value)
virtual CSG_Point_4D & | operator/= (double Value)
virtual CSG_Point_4D & | operator= (const CSG_Point_4D &Point)
virtual CSG_Point_4D & | operator+= (const CSG_Point_4D &Point)
virtual CSG_Point_4D & | operator-= (const CSG_Point_4D &Point)
virtual CSG_Point_4D & | operator*= (const CSG_Point_4D &Point)
virtual void | Assign (double x, double y, double z, double m)
virtual void | Assign (const CSG_Point_4D &Point)
virtual void | Add (const CSG_Point_4D &Point)
virtual void | Subtract (const CSG_Point_4D &Point)
virtual void | Multiply (const CSG_Point_4D &Point)
virtual void | Multiply (double Value)
virtual void | Divide (double Value)
virtual double | Get_Length (void) const
virtual bool | is_Equal (const CSG_Point_4D &Point, double epsilon=0.) const
virtual bool | is_Equal (double _x, double _y, double _z, double _m, double epsilon=0.) const

Additional Inherited Members

- Public Attributes inherited from SSG_Point_4D
double | x
double | y
double | z
double | m

Detailed Description

Definition at line 363 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Point_4D() [1/4]

CSG_Point_4D::CSG_Point_4D ( void )

Definition at line 224 of file geo_classes.cpp.

References Assign().

◆ CSG_Point_4D() [2/4]

CSG_Point_4D::CSG_Point_4D ( const CSG_Point_4D & Point )

Definition at line 229 of file geo_classes.cpp.

References Assign(), SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ CSG_Point_4D() [3/4]

CSG_Point_4D::CSG_Point_4D ( const TSG_Point_4D & Point )

Definition at line 234 of file geo_classes.cpp.

References Assign(), SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ CSG_Point_4D() [4/4]

CSG_Point_4D::CSG_Point_4D | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | double | m
 | ) |  |

Definition at line 239 of file geo_classes.cpp.

References Assign().

◆ ~CSG_Point_4D()

virtual CSG_Point_4D::~CSG_Point_4D ( void )
inlinevirtual

Definition at line 371 of file geo_tools.h.

Member Function Documentation

◆ Add()

void CSG_Point_4D::Add ( const CSG_Point_4D & Point )
virtual

Definition at line 262 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Assign() [1/2]

void CSG_Point_4D::Assign ( const CSG_Point_4D & Point )
virtual

Definition at line 253 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Assign() [2/2]

void CSG_Point_4D::Assign | ( | double | x,
 |  | double | y,
 |  | double | z,
 |  | double | m
 | ) |  |
virtual

Definition at line 245 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

Referenced by CSG_Point_4D().

◆ Divide()

void CSG_Point_4D::Divide ( double Value )
virtual

Definition at line 294 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Get_Length()

double CSG_Point_4D::Get_Length ( void ) const
virtual

Definition at line 303 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Get_Type()

virtual TSG_Point_Type CSG_Point_4D::Get_Type ( void ) const
inlinevirtual

Definition at line 373 of file geo_tools.h.

◆ is_Equal() [1/2]

virtual bool CSG_Point_4D::is_Equal | ( | const CSG_Point_4D & | Point,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 403 of file geo_tools.h.

References is_Equal(), SSG_Point_4D::m, SSG_Point_4D::x, and SSG_Point_4D::y.

Referenced by is_Equal().

◆ is_Equal() [2/2]

virtual bool CSG_Point_4D::is_Equal | ( | double | _x,
 |  | double | _y,
 |  | double | _z,
 |  | double | _m,
 |  | double | epsilon = 0.
 | ) |  | const
 inlinevirtual

Definition at line 404 of file geo_tools.h.

◆ Multiply() [1/2]

void CSG_Point_4D::Multiply ( const CSG_Point_4D & Point )
virtual

Definition at line 278 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Multiply() [2/2]

void CSG_Point_4D::Multiply ( double Value )
virtual

Definition at line 286 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ operator!=()

virtual bool CSG_Point_4D::operator!= ( const CSG_Point_4D & Point ) const
inlinevirtual

Definition at line 376 of file geo_tools.h.

◆ operator*()

CSG_Point_4D CSG_Point_4D::operator* ( double Value ) const
inline

Definition at line 381 of file geo_tools.h.

◆ operator*=() [1/2]

virtual CSG_Point_4D& CSG_Point_4D::operator*= ( const CSG_Point_4D & Point )
inlinevirtual

Definition at line 389 of file geo_tools.h.

◆ operator*=() [2/2]

virtual CSG_Point_4D& CSG_Point_4D::operator*= ( double Value )
inlinevirtual

Definition at line 383 of file geo_tools.h.

◆ operator+()

virtual CSG_Point_4D CSG_Point_4D::operator+ ( const CSG_Point_4D & Point ) const
inlinevirtual

Definition at line 378 of file geo_tools.h.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ operator+=()

virtual CSG_Point_4D& CSG_Point_4D::operator+= ( const CSG_Point_4D & Point )
inlinevirtual

Definition at line 387 of file geo_tools.h.

◆ operator-()

virtual CSG_Point_4D CSG_Point_4D::operator- ( const CSG_Point_4D & Point ) const
inlinevirtual

Definition at line 379 of file geo_tools.h.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ operator-=()

virtual CSG_Point_4D& CSG_Point_4D::operator-= ( const CSG_Point_4D & Point )
inlinevirtual

Definition at line 388 of file geo_tools.h.

◆ operator/()

CSG_Point_4D CSG_Point_4D::operator/ ( double Value ) const
inline

Definition at line 382 of file geo_tools.h.

◆ operator/=()

virtual CSG_Point_4D& CSG_Point_4D::operator/= ( double Value )
inlinevirtual

Definition at line 384 of file geo_tools.h.

◆ operator=()

virtual CSG_Point_4D& CSG_Point_4D::operator= ( const CSG_Point_4D & Point )
inlinevirtual

Definition at line 386 of file geo_tools.h.

◆ operator==()

virtual bool CSG_Point_4D::operator== ( const CSG_Point_4D & Point ) const
inlinevirtual

Definition at line 375 of file geo_tools.h.

◆ Subtract()

void CSG_Point_4D::Subtract ( const CSG_Point_4D & Point )
virtual

Definition at line 270 of file geo_classes.cpp.

References SSG_Point_4D::m, SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Point_4D Member List

This is the complete list of members for CSG_Point_4D, including all inherited members.

Add(const CSG_Point_4D &Point) | CSG_Point_4D | virtual
Assign(double x, double y, double z, double m) | CSG_Point_4D | virtual
Assign(const CSG_Point_4D &Point) | CSG_Point_4D | virtual
CSG_Point_4D(void) | CSG_Point_4D |
CSG_Point_4D(const CSG_Point_4D &Point) | CSG_Point_4D |
CSG_Point_4D(const TSG_Point_4D &Point) | CSG_Point_4D |
CSG_Point_4D(double x, double y, double z, double m) | CSG_Point_4D |
Divide(double Value) | CSG_Point_4D | virtual
Get_Length(void) const | CSG_Point_4D | virtual
Get_Type(void) const | CSG_Point_4D | inlinevirtual
is_Equal(const CSG_Point_4D &Point, double epsilon=0.) const | CSG_Point_4D | inlinevirtual
is_Equal(double _x, double _y, double _z, double _m, double epsilon=0.) const | CSG_Point_4D | inlinevirtual
m | SSG_Point_4D |
Multiply(const CSG_Point_4D &Point) | CSG_Point_4D | virtual
Multiply(double Value) | CSG_Point_4D | virtual
operator!=(const CSG_Point_4D &Point) const | CSG_Point_4D | inlinevirtual
operator*(double Value) const | CSG_Point_4D | inline
operator*=(double Value) | CSG_Point_4D | inlinevirtual
operator*=(const CSG_Point_4D &Point) | CSG_Point_4D | inlinevirtual
operator+(const CSG_Point_4D &Point) const | CSG_Point_4D | inlinevirtual
operator+=(const CSG_Point_4D &Point) | CSG_Point_4D | inlinevirtual
operator-(const CSG_Point_4D &Point) const | CSG_Point_4D | inlinevirtual
operator-=(const CSG_Point_4D &Point) | CSG_Point_4D | inlinevirtual
operator/(double Value) const | CSG_Point_4D | inline
operator/=(double Value) | CSG_Point_4D | inlinevirtual
operator=(const CSG_Point_4D &Point) | CSG_Point_4D | inlinevirtual
operator==(const CSG_Point_4D &Point) const | CSG_Point_4D | inlinevirtual
Subtract(const CSG_Point_4D &Point) | CSG_Point_4D | virtual
x | SSG_Point_4D |
y | SSG_Point_4D |
z | SSG_Point_4D |
~CSG_Point_4D(void) | CSG_Point_4D | inlinevirtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PointCloud Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CSG_PointCloud Class Reference

#include <pointcloud.h>

Inheritance diagram for CSG_PointCloud:
CSG_Shapes CSG_Table CSG_Data_Object

Public Member Functions

CSG_PointCloud (void)
bool | Create (void)
CSG_PointCloud (const CSG_PointCloud &PointCloud)
bool | Create (const CSG_PointCloud &PointCloud)
CSG_PointCloud (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_PointCloud (const char *File)
bool | Create (const char *File)
CSG_PointCloud (const wchar_t *File)
bool | Create (const wchar_t *File)
CSG_PointCloud (CSG_PointCloud *pTemplate)
bool | Create (CSG_PointCloud *pTemplate)
virtual | ~CSG_PointCloud (void)
virtual bool | Destroy (void)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking. More...
virtual bool | Assign (CSG_Data_Object *pSource)
virtual bool | Save (const CSG_String &File, int Format=0)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
void | Set_XYZ_Precision (bool bDouble)
virtual bool | is_Valid (void) const
bool | is_Compatible (CSG_PointCloud *pPointCloud) const
virtual bool | Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Field=-1)
virtual bool | Del_Field (int Field)
virtual bool | Mov_Field (int Field, int Position)
virtual bool | Set_Field_Type (int Field, TSG_Data_Type Type)
int | Get_Attribute_Count (void) const
const SG_Char * | Get_Attribute_Name (int Field) const
TSG_Data_Type | Get_Attribute_Type (int Field) const
bool | Add_Point (double x, double y, double z)
bool | Del_Point (sLong Index)
bool | Del_Points (void)
bool | Set_Cursor (sLong Index)
virtual bool | Set_Value (int Field, double Value)
virtual double | Get_Value (int Field) const
double | Get_X (void) const
double | Get_Y (void) const
double | Get_Z (void) const
bool | Set_Attribute (int Field, double Value)
double | Get_Attribute (int Field) const
bool | Set_NoData (int Field)
bool | is_NoData (int Field) const
virtual bool | Set_Value (sLong Index, int Field, double Value)
virtual double | Get_Value (sLong Index, int Field) const
double | Get_X (sLong Index) const
double | Get_Y (sLong Index) const
double | Get_Z (sLong Index) const
bool | Set_Attribute (sLong Index, int Field, double Value)
double | Get_Attribute (sLong Index, int Field) const
bool | Set_NoData (sLong Index, int Field)
bool | is_NoData (sLong Index, int Field) const
virtual bool | Set_Value (int Field, const SG_Char *Value)
virtual bool | Get_Value (int Field, CSG_String &Value) const
virtual bool | Set_Value (sLong Index, int Field, const SG_Char *Value)
virtual bool | Get_Value (sLong Index, int Field, CSG_String &Value) const
virtual bool | Set_Attribute (int Field, const SG_Char *Value)
virtual bool | Get_Attribute (int Field, CSG_String &Value) const
virtual bool | Set_Attribute (sLong Index, int Field, const SG_Char *Value)
virtual bool | Get_Attribute (sLong Index, int Field, CSG_String &Value) const
TSG_Point_3D | Get_Point (void) const
TSG_Point_3D | Get_Point (sLong Index) const
virtual bool | Set_Point (const TSG_Point_3D &Point)
virtual bool | Set_Point (sLong Index, const TSG_Point_3D &Point)
virtual void | Set_Modified (bool bModified=true)
virtual CSG_Table_Record * | Get_Record (sLong Index) const
virtual CSG_Shape * | Get_Shape (const CSG_Point &Point, double Epsilon=0.)
virtual bool | Del_Record (sLong Index)
virtual bool | Del_Shape (sLong Index)
virtual bool | Del_Records (void)
virtual bool | Del_Shapes (void)
virtual CSG_Table_Record * | Ins_Record (sLong Index, CSG_Table_Record *pCopy=NULL)
virtual CSG_Table_Record * | Add_Record (CSG_Table_Record *pCopy=NULL)
virtual CSG_Shape * | Add_Shape (CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
virtual bool | Del_Shape (CSG_Shape *pShape)
virtual bool | Select (sLong Index, bool bInvert=false)
virtual bool | Select (CSG_Table_Record *pShape=NULL, bool bInvert=false)
virtual bool | Select (const TSG_Rect &Extent, bool bInvert=false)
virtual bool | Select (const TSG_Point &Point, bool bInvert=false)
virtual bool | is_Selected (sLong Index) const
virtual sLong | Del_Selection (void)
virtual sLong | Inv_Selection (void)
virtual CSG_Shape * | Get_Selection (sLong Index=0)
virtual const CSG_Rect & | Get_Selection_Extent (void)
- Public Member Functions inherited from CSG_Shapes
CSG_Shapes (void)
CSG_Shapes (const CSG_Shapes &Shapes)
bool | Create (const CSG_Shapes &Shapes)
CSG_Shapes (const char *File)
bool | Create (const char *File)
CSG_Shapes (const wchar_t *File)
bool | Create (const wchar_t *File)
CSG_Shapes (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_Shapes (TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY)
bool | Create (TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY)
virtual | ~CSG_Shapes (void)
virtual TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
virtual const CSG_Rect & | Get_Extent (void)
double | Get_ZMin (void)
double | Get_ZMax (void)
double | Get_MMin (void)
double | Get_MMax (void)
virtual CSG_Shape * | Get_Shape (sLong Index) const
virtual CSG_Shape * | Get_Shape_byIndex (sLong Index) const
bool | Make_Clean (void)
- Public Member Functions inherited from CSG_Table
CSG_Table (void)
CSG_Table (const CSG_Table &Table)
bool | Create (const CSG_Table &Table)
CSG_Table (const CSG_Table *pTemplate)
bool | Create (const CSG_Table *pTemplate)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual | ~CSG_Table (void)
CSG_Table & | operator= (const CSG_Table &Table)
bool | Assign_Values (const CSG_Table &Table)
bool | Assign_Values (CSG_Table *pTable)
bool | Assign_Values (const SG_Char *File)
bool | Load (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Set_File_Encoding (int Encoding)
int | Get_File_Encoding (void) const
bool | Serialize (CSG_File &Stream, bool bSave)
bool | is_Compatible (const CSG_Table &Table, bool bExactMatch=false) const
bool | is_Compatible (CSG_Table *pTable, bool bExactMatch=false) const
virtual bool | Add_Field (const char *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const wchar_t *Name, TSG_Data_Type Type, int Position=-1)
int | Get_Field_Count (void) const
const SG_Char * | Get_Field_Name (int iField) const
TSG_Data_Type | Get_Field_Type (int iField) const
int | Get_Field_Length (int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
int | Get_Field (const CSG_String &Name) const
bool | Set_Field_Name (int iField, const SG_Char *Name)
int | Find_Field (const CSG_String &Name) const
bool | Find_Field (const CSG_String &Name, int &Index) const
sLong | Get_N (int iField) const
double | Get_Minimum (int iField) const
double | Get_Maximum (int iField) const
double | Get_Range (int iField) const
double | Get_Sum (int iField) const
double | Get_Mean (int iField) const
double | Get_StdDev (int iField) const
double | Get_Variance (int iField) const
const CSG_Simple_Statistics & | Get_Statistics (int iField) const
virtual bool | Set_Record (sLong Index, CSG_Table_Record *pCopy)
virtual bool | Set_Count (sLong nRecords)
sLong | Get_Count (void) const
virtual CSG_Table_Record & | operator[] (sLong Index) const
sLong | Get_Index (sLong Index) const
CSG_Table_Record * | Get_Record_byIndex (sLong Index) const
virtual bool | Find_Record (sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual bool | Find_Record (sLong &Index, int iField, double Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, double Value, bool bCreateIndex=false)
virtual bool | Get_Value (sLong Index, int iField, double &Value) const
sLong | Get_Selection_Count (void) const
sLong | Get_Selection_Index (sLong Index=0) const
virtual CSG_Table_Record * | Get_Selection (sLong Index=0) const
bool | Set_Index (CSG_Index &Index, int Field, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const
bool | is_Indexed (void) const
bool | Set_Index (int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None)
bool | Del_Index (void)
bool | Toggle_Index (int iField)
int | Get_Index_Field (int i) const
TSG_Table_Index_Order | Get_Index_Order (int i) const
int | Get_Index_Field (size_t i) const
TSG_Table_Index_Order | Get_Index_Order (size_t i) const
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Static Public Member Functions

static bool Get_Header_Content (const CSG_String &FileName, CSG_MetaData &Header)

Protected Member Functions

virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
virtual void | _On_Construction (void)
virtual bool | _Stats_Update (int Field) const
- Protected Member Functions inherited from CSG_Shapes
virtual CSG_Table_Record * | _Get_New_Record (sLong Index)
- Protected Member Functions inherited from CSG_Table
bool | _Add_Selection (sLong Index)
bool | _Set_Selection (sLong Index, sLong Selected)
bool | _Del_Selection (sLong Index)
bool | _Stats_Invalidate (void) const
bool | _Stats_Invalidate (int iField) const
virtual bool | On_NoData_Changed (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)

Additional Inherited Members

- Protected Attributes inherited from CSG_Shapes
double | m_ZMin
double | m_ZMax
double | m_MMin
double | m_MMax
TSG_Shape_Type m_Type
TSG_Vertex_Type m_Vertex_Type
CSG_Rect m_Extent_Selected
- Protected Attributes inherited from CSG_Table
int | m_nFields
int | m_Encoding
sLong m_nRecords
sLong m_nBuffer
TSG_Data_Type * m_Field_Type
CSG_String ** m_Field_Name
CSG_Simple_Statistics ** m_Field_Stats
CSG_Array m_Selection
CSG_Rect m_Extent
- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Detailed Description

Definition at line 104 of file pointcloud.h.

Constructor & Destructor Documentation

◆ CSG_PointCloud() [1/6]

CSG_PointCloud::CSG_PointCloud ( void )

Definition at line 109 of file pointcloud.cpp.

References _On_Construction(), and Create().

◆ CSG_PointCloud() [2/6]

CSG_PointCloud::CSG_PointCloud ( const CSG_PointCloud & PointCloud )

Definition at line 127 of file pointcloud.cpp.

References _On_Construction(), and Create().

◆ CSG_PointCloud() [3/6]

CSG_PointCloud::CSG_PointCloud ( const CSG_String & File )

Definition at line 141 of file pointcloud.cpp.

References _On_Construction(), and Create().

◆ CSG_PointCloud() [4/6]

CSG_PointCloud::CSG_PointCloud ( const char * File )

Definition at line 139 of file pointcloud.cpp.

◆ CSG_PointCloud() [5/6]

CSG_PointCloud::CSG_PointCloud ( const wchar_t * File )

Definition at line 140 of file pointcloud.cpp.

◆ CSG_PointCloud() [6/6]

CSG_PointCloud::CSG_PointCloud ( CSG_PointCloud * pTemplate )

Definition at line 155 of file pointcloud.cpp.

References _On_Construction(), and Create().

◆ ~CSG_PointCloud()

CSG_PointCloud::~CSG_PointCloud ( void )
virtual

Definition at line 212 of file pointcloud.cpp.

References Destroy().

Member Function Documentation

◆ _On_Construction()

void CSG_PointCloud::_On_Construction ( void )
protectedvirtual

Reimplemented from CSG_Shapes.

Definition at line 179 of file pointcloud.cpp.

References CSG_Array::Create(), CSG_Shapes::Create(), CSG_Table::Get_Count(), CSG_Table::m_Field_Name, CSG_Table::m_Field_Stats, CSG_Table::m_Field_Type, CSG_Table::m_nFields, CSG_Table::m_nRecords, CSG_Shapes::m_Type, CSG_Shapes::m_Vertex_Type, CSG_Table::Set_Count(), CSG_Data_Object::Set_NoData_Value(), CSG_Data_Object::Set_Update_Flag(), SG_OMP_Get_Max_Num_Procs(), SG_VERTEX_TYPE_XYZ, and SHAPE_TYPE_Point.

Referenced by CSG_PointCloud(), and Destroy().

◆ _Stats_Update()

bool CSG_PointCloud::_Stats_Update ( int Field ) const
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 1241 of file pointcloud.cpp.

References CSG_Simple_Statistics::Evaluate(), CSG_Simple_Statistics::Get_Count(), CSG_Data_Object::Get_Max_Samples(), Get_Value(), CSG_Simple_Statistics::is_Evaluated(), CSG_Data_Object::is_NoData_Value(), CSG_Table::m_Field_Stats, CSG_Table::m_nFields, CSG_Table::m_nRecords, and CSG_Simple_Statistics::Set_Count().

Referenced by On_Update().

◆ Add_Field()

bool CSG_PointCloud::Add_Field | ( | const CSG_String & | Name,
 |  | TSG_Data_Type | Type,
 |  | int | Field = -1
 | ) |  |
virtual

Reimplemented from CSG_Table.

Definition at line 665 of file pointcloud.cpp.

References CSG_Table::m_nFields, SG_DATATYPE_Double, SG_DATATYPE_Float, and SG_T.

Referenced by Create(), Mov_Field(), and Set_Field_Type().

◆ Add_Point()

bool CSG_PointCloud::Add_Point | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |

Definition at line 1094 of file pointcloud.cpp.

References CSG_Table::_Stats_Invalidate(), Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by Add_Shape().

◆ Add_Record()

CSG_Table_Record * CSG_PointCloud::Add_Record ( CSG_Table_Record * pCopy = NULL )
virtual

Reimplemented from CSG_Table.

Definition at line 1436 of file pointcloud.cpp.

References Add_Shape(), and SHAPE_COPY.

◆ Add_Shape()

CSG_Shape * CSG_PointCloud::Add_Shape | ( | CSG_Table_Record * | pCopy = NULL,
 |  | TSG_ADD_Shape_Copy_Mode | mCopy = SHAPE_COPY
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1442 of file pointcloud.cpp.

References Add_Point(), CSG_Table_Record::asDouble(), CSG_Table_Record::asString(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Type(), CSG_Table_Record::Get_Table(), CSG_Table::m_nFields, CSG_Table::m_nRecords, Set_Value(), SG_Data_Type_is_Numeric(), SHAPE_COPY, and SHAPE_COPY_ATTR.

Referenced by Add_Record().

◆ Assign()

bool CSG_PointCloud::Assign ( CSG_Data_Object * pSource )
virtual

Reimplemented from CSG_Shapes.

Definition at line 598 of file pointcloud.cpp.

References CSG_String::c_str(), CSG_Projection::Create(), Destroy(), CSG_Data_Object::Get_History(), CSG_Data_Object::Get_Name(), Get_ObjectType(), CSG_Data_Object::Get_ObjectType(), CSG_Data_Object::Get_Projection(), CSG_Data_Object::is_Valid(), CSG_Table::m_Field_Name, CSG_Table::m_Field_Type, CSG_Table::m_nFields, CSG_Table::m_nRecords, and CSG_Data_Object::Set_Name().

Referenced by Create().

◆ Create() [1/6]

bool CSG_PointCloud::Create ( const char * File )

Definition at line 147 of file pointcloud.cpp.

References Create().

◆ Create() [2/6]

bool CSG_PointCloud::Create ( const CSG_PointCloud & PointCloud )

Definition at line 133 of file pointcloud.cpp.

References Assign().

◆ Create() [3/6]

bool CSG_PointCloud::Create ( const CSG_String & File )

Definition at line 149 of file pointcloud.cpp.

◆ Create() [4/6]

bool CSG_PointCloud::Create ( const wchar_t * File )

Definition at line 148 of file pointcloud.cpp.

References Create().

◆ Create() [5/6]

bool CSG_PointCloud::Create ( CSG_PointCloud * pTemplate )

Definition at line 161 of file pointcloud.cpp.

References Destroy(), CSG_Table::Get_Field_Name(), CSG_Table::Get_Field_Type(), and CSG_Table::m_nFields.

◆ Create() [6/6]

bool CSG_PointCloud::Create ( void )

Definition at line 117 of file pointcloud.cpp.

References Add_Field(), Destroy(), and SG_DATATYPE_Undefined.

Referenced by Create(), CSG_PointCloud(), and On_Reload().

◆ Del_Field()

bool CSG_PointCloud::Del_Field ( int Field )
virtual

Reimplemented from CSG_Table.

Definition at line 752 of file pointcloud.cpp.

References CSG_Table::Del_Field(), CSG_Table::m_Field_Name, m_Field_Size, CSG_Table::m_Field_Stats, CSG_Table::m_Field_Type, CSG_Table::m_nFields, CSG_Table::m_nRecords, PC_GET_NBYTES, Set_Modified(), and SG_Realloc().

Referenced by Mov_Field(), and Set_Field_Type().

◆ Del_Point()

bool CSG_PointCloud::Del_Point ( sLong Index )

Definition at line 1113 of file pointcloud.cpp.

References CSG_Table::_Stats_Invalidate(), is_Selected(), CSG_Table::m_nRecords, Select(), Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

◆ Del_Points()

bool CSG_PointCloud::Del_Points ( void )

Definition at line 1146 of file pointcloud.cpp.

References CSG_Table::_Stats_Invalidate(), CSG_Array::Destroy(), CSG_Table::m_nRecords, CSG_Table::m_Selection, CSG_Array::Set_Array(), Set_Modified(), CSG_Data_Object::Set_Update_Flag(), and SG_Free().

Referenced by Destroy().

◆ Del_Record()

virtual bool CSG_PointCloud::Del_Record ( sLong Index )
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 207 of file pointcloud.h.

◆ Del_Records()

virtual bool CSG_PointCloud::Del_Records ( void )
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 209 of file pointcloud.h.

◆ Del_Selection()

sLong CSG_PointCloud::Del_Selection ( void )
virtual

Reimplemented from CSG_Table.

Definition at line 1606 of file pointcloud.cpp.

References CSG_Table::_Stats_Invalidate(), CSG_Table::Get_Selection_Count(), CSG_Table::m_nRecords, CSG_Table::m_Selection, CSG_Array::Set_Array(), Set_Modified(), CSG_Data_Object::Set_Update_Flag(), SG_Free(), and SG_TABLE_REC_FLAG_Selected.

◆ Del_Shape() [1/2]

virtual bool CSG_PointCloud::Del_Shape ( CSG_Shape * pShape )
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 215 of file pointcloud.h.

◆ Del_Shape() [2/2]

virtual bool CSG_PointCloud::Del_Shape ( sLong Index )
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 208 of file pointcloud.h.

◆ Del_Shapes()

virtual bool CSG_PointCloud::Del_Shapes ( void )
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 210 of file pointcloud.h.

◆ Destroy()

bool CSG_PointCloud::Destroy ( void )
virtual

Reimplemented from CSG_Shapes.

Definition at line 217 of file pointcloud.cpp.

References _On_Construction(), Del_Points(), CSG_Data_Object::Destroy(), CSG_Table::m_Field_Name, CSG_Table::m_Field_Stats, CSG_Table::m_Field_Type, CSG_Table::m_nFields, and SG_Free().

Referenced by Assign(), Create(), and ~CSG_PointCloud().

◆ Get_Attribute() [1/4]

double CSG_PointCloud::Get_Attribute ( int Field ) const
inline

Definition at line 169 of file pointcloud.h.

References CSG_Table::Get_Value().

◆ Get_Attribute() [2/4]

virtual bool CSG_PointCloud::Get_Attribute | ( | int | Field,
 |  | CSG_String & | Value
 | ) |  | const
 inlinevirtual

Definition at line 188 of file pointcloud.h.

References CSG_Table::Get_Value().

◆ Get_Attribute() [3/4]

double CSG_PointCloud::Get_Attribute | ( | sLong | Index,
 |  | int | Field
 | ) |  | const
 inline

Definition at line 179 of file pointcloud.h.

References CSG_Table::Get_Value().

◆ Get_Attribute() [4/4]

virtual bool CSG_PointCloud::Get_Attribute | ( | sLong | Index,
 |  | int | Field,
 |  | CSG_String & | Value
 | ) |  | const
 inlinevirtual

Definition at line 190 of file pointcloud.h.

References CSG_Table::Get_Value().

◆ Get_Attribute_Count()

int CSG_PointCloud::Get_Attribute_Count ( void ) const
inline

Definition at line 152 of file pointcloud.h.

◆ Get_Attribute_Name()

const SG_Char* CSG_PointCloud::Get_Attribute_Name ( int Field ) const
inline

Definition at line 153 of file pointcloud.h.

◆ Get_Attribute_Type()

TSG_Data_Type CSG_PointCloud::Get_Attribute_Type ( int Field ) const
inline

Definition at line 154 of file pointcloud.h.

References SG_DATATYPE_Undefined.

◆ Get_Header_Content()

bool CSG_PointCloud::Get_Header_Content | ( | const CSG_String & | FileName,
 |  | CSG_MetaData & | Header
 | ) |  |
static

Definition at line 416 of file pointcloud.cpp.

References CSG_File_Zip::Get_File(), CSG_MetaData::Load(), SG_File_Cmp_Extension(), SG_File_Get_Name(), SG_FILE_R, and SG_T.

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_PointCloud::Get_ObjectType ( void ) const
inlinevirtual

Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.

Reimplemented from CSG_Shapes.

Definition at line 128 of file pointcloud.h.

References SG_DATAOBJECT_TYPE_PointCloud.

Referenced by Assign().

◆ Get_Point() [1/2]

TSG_Point_3D CSG_PointCloud::Get_Point ( sLong Index ) const

Definition at line 1043 of file pointcloud.cpp.

References CSG_Table::m_nRecords, SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Point() [2/2]

TSG_Point_3D CSG_PointCloud::Get_Point ( void ) const

Definition at line 1024 of file pointcloud.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Record()

CSG_Table_Record * CSG_PointCloud::Get_Record ( sLong Index ) const
virtual

Reimplemented from CSG_Table.

Definition at line 1386 of file pointcloud.cpp.

◆ Get_Selection()

CSG_Shape * CSG_PointCloud::Get_Selection ( sLong Index = 0 )
virtual

Reimplemented from CSG_Shapes.

Definition at line 1566 of file pointcloud.cpp.

References CSG_Table::Get_Selection_Count(), and CSG_Table::Get_Selection_Index().

◆ Get_Selection_Extent()

const CSG_Rect & CSG_PointCloud::Get_Selection_Extent ( void )
virtual

Reimplemented from CSG_Shapes.

Definition at line 1572 of file pointcloud.cpp.

References CSG_Rect::Assign(), CSG_Table::Get_Selection_Count(), CSG_Table::Get_Selection_Index(), Get_X(), Get_Y(), CSG_Shapes::m_Extent_Selected, Set_Cursor(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Get_Shape()

CSG_Shape * CSG_PointCloud::Get_Shape | ( | const CSG_Point & | Point,
 |  | double | Epsilon = 0.
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1399 of file pointcloud.cpp.

References CSG_Rect::Contains(), CSG_Shapes::Get_Extent(), CSG_Shapes::Get_Shape(), Get_X(), Get_Y(), INTERSECTION_None, CSG_Rect::Intersects(), CSG_Table::m_nRecords, Set_Cursor(), SG_Get_Distance(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Parameters_Point_Search_KDTree_2D::Get_Point().

◆ Get_Value() [1/4]

virtual double CSG_PointCloud::Get_Value ( int Field ) const
inlinevirtual

Definition at line 164 of file pointcloud.h.

Referenced by _Stats_Update(), and Set_Field_Type().

◆ Get_Value() [2/4]

virtual bool CSG_PointCloud::Get_Value | ( | int | Field,
 |  | CSG_String & | Value
 | ) |  | const
 inlinevirtual

Definition at line 184 of file pointcloud.h.

◆ Get_Value() [3/4]

virtual double CSG_PointCloud::Get_Value | ( | sLong | Index,
 |  | int | Field
 | ) |  | const
 inlinevirtual

Definition at line 174 of file pointcloud.h.

◆ Get_Value() [4/4]

virtual bool CSG_PointCloud::Get_Value | ( | sLong | Index,
 |  | int | Field,
 |  | CSG_String & | Value
 | ) |  | const
 inlinevirtual

Reimplemented from CSG_Table.

Definition at line 186 of file pointcloud.h.

◆ Get_X() [1/2]

double CSG_PointCloud::Get_X ( sLong Index ) const
inline

Definition at line 175 of file pointcloud.h.

◆ Get_X() [2/2]

double CSG_PointCloud::Get_X ( void ) const
inline

Definition at line 165 of file pointcloud.h.

Referenced by Get_Selection_Extent(), Get_Shape(), and Select().

◆ Get_Y() [1/2]

double CSG_PointCloud::Get_Y ( sLong Index ) const
inline

Definition at line 176 of file pointcloud.h.

◆ Get_Y() [2/2]

double CSG_PointCloud::Get_Y ( void ) const
inline

Definition at line 166 of file pointcloud.h.

Referenced by Get_Selection_Extent(), Get_Shape(), and Select().

◆ Get_Z() [1/2]

double CSG_PointCloud::Get_Z ( sLong Index ) const
inline

Definition at line 177 of file pointcloud.h.

◆ Get_Z() [2/2]

double CSG_PointCloud::Get_Z ( void ) const
inline

Definition at line 167 of file pointcloud.h.

◆ Ins_Record()

CSG_Table_Record * CSG_PointCloud::Ins_Record | ( | sLong | Index,
 |  | CSG_Table_Record * | pCopy = NULL
 | ) |  |
virtual

Reimplemented from CSG_Table.

Definition at line 1430 of file pointcloud.cpp.

◆ Inv_Selection()

sLong CSG_PointCloud::Inv_Selection ( void )
virtual

Reimplemented from CSG_Table.

Definition at line 1644 of file pointcloud.cpp.

References CSG_Table::_Set_Selection(), CSG_Table::Get_Selection_Count(), CSG_Table::m_nRecords, CSG_Table::m_Selection, CSG_Array::Set_Array(), and SG_TABLE_REC_FLAG_Selected.

◆ is_Compatible()

bool CSG_PointCloud::is_Compatible ( CSG_PointCloud * pPointCloud ) const

Definition at line 639 of file pointcloud.cpp.

References CSG_Table::Get_Field_Type(), and CSG_Table::m_nFields.

◆ is_NoData() [1/2]

bool CSG_PointCloud::is_NoData ( int Field ) const
inline

Definition at line 171 of file pointcloud.h.

References CSG_Table::Get_Value(), and CSG_Data_Object::is_NoData_Value().

◆ is_NoData() [2/2]

bool CSG_PointCloud::is_NoData | ( | sLong | Index,
 |  | int | Field
 | ) |  | const
 inline

Definition at line 181 of file pointcloud.h.

References CSG_Table::Get_Value(), and CSG_Data_Object::is_NoData_Value().

◆ is_Selected()

bool CSG_PointCloud::is_Selected ( sLong Index ) const
virtual

Reimplemented from CSG_Table.

Definition at line 1555 of file pointcloud.cpp.

References CSG_Table::m_nRecords, and SG_TABLE_REC_FLAG_Selected.

Referenced by Del_Point().

◆ is_Valid()

virtual bool CSG_PointCloud::is_Valid ( void ) const
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 141 of file pointcloud.h.

◆ Mov_Field()

bool CSG_PointCloud::Mov_Field | ( | int | Field,
 |  | int | Position
 | ) |  |
virtual

Reimplemented from CSG_Table.

Definition at line 807 of file pointcloud.cpp.

References Add_Field(), Del_Field(), CSG_Table::Get_Field_Name(), CSG_Table::Get_Field_Type(), CSG_Table::m_Field_Type, CSG_Table::m_nFields, CSG_Table::m_nRecords, and PC_GET_NBYTES.

◆ On_Delete()

bool CSG_PointCloud::On_Delete ( void )
protectedvirtual

Reimplemented from CSG_Shapes.

Definition at line 1305 of file pointcloud.cpp.

References CSG_Data_Object::Get_File_Name(), and SG_File_Delete().

◆ On_Reload()

bool CSG_PointCloud::On_Reload ( void )
protectedvirtual

Reimplemented from CSG_Shapes.

Definition at line 1299 of file pointcloud.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_PointCloud::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Shapes.

Definition at line 1213 of file pointcloud.cpp.

References _Stats_Update(), CSG_Rect::Assign(), CSG_Table::Get_Maximum(), CSG_Simple_Statistics::Get_Maximum(), CSG_Table::Get_Minimum(), CSG_Simple_Statistics::Get_Minimum(), CSG_Simple_Statistics::Invalidate(), CSG_Table::m_Extent, CSG_Table::m_Field_Stats, CSG_Table::m_nFields, CSG_Shapes::m_ZMax, and CSG_Shapes::m_ZMin.

◆ Save() [1/3]

virtual bool CSG_PointCloud::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 133 of file pointcloud.h.

References Save().

Referenced by Save().

◆ Save() [2/3]

bool CSG_PointCloud::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 322 of file pointcloud.cpp.

References _TL, CSG_File_Zip::Add_File(), CSG_String::c_str(), CSG_String::Format(), CSG_Data_Object::Get_Projection(), POINTCLOUD_FILE_FORMAT_Compressed, POINTCLOUD_FILE_FORMAT_Normal, POINTCLOUD_FILE_FORMAT_Undefined, CSG_MetaData::Save(), CSG_Projection::Save(), CSG_Data_Object::Save_MetaData(), CSG_Data_Object::Set_File_Name(), Set_Modified(), SG_File_Cmp_Extension(), SG_File_Get_Name(), SG_File_Make_Path(), SG_File_Set_Extension(), SG_FILE_W, SG_PROJ_FMT_WKT, SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_Process_Set_Ready().

◆ Save() [3/3]

virtual bool CSG_PointCloud::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shapes.

Definition at line 134 of file pointcloud.h.

References Save().

Referenced by Save().

◆ Select() [1/4]

bool CSG_PointCloud::Select | ( | const TSG_Point & | Point,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1544 of file pointcloud.cpp.

References Select(), SSG_Point::x, and SSG_Point::y.

◆ Select() [2/4]

bool CSG_PointCloud::Select | ( | const TSG_Rect & | Extent,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1519 of file pointcloud.cpp.

References CSG_Shapes::Get_Extent(), CSG_Table::Get_Selection_Count(), Get_X(), Get_Y(), INTERSECTION_None, CSG_Table::m_nRecords, Select(), Set_Cursor(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Select() [3/4]

bool CSG_PointCloud::Select | ( | CSG_Table_Record * | pShape = NULL,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1513 of file pointcloud.cpp.

References CSG_Table::Select().

◆ Select() [4/4]

bool CSG_PointCloud::Select | ( | sLong | Index,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Shapes.

Definition at line 1475 of file pointcloud.cpp.

References CSG_Table::_Add_Selection(), CSG_Table::_Del_Selection(), CSG_Array::Destroy(), CSG_Table::Get_Selection_Count(), CSG_Table::Get_Selection_Index(), CSG_Table::m_Selection, Set_Cursor(), and SG_TABLE_REC_FLAG_Selected.

Referenced by Del_Point(), and Select().

◆ Set_Attribute() [1/4]

virtual bool CSG_PointCloud::Set_Attribute | ( | int | Field,
 |  | const SG_Char * | Value
 | ) |  |
inlinevirtual

Definition at line 187 of file pointcloud.h.

References CSG_Table::Set_Value().

◆ Set_Attribute() [2/4]

bool CSG_PointCloud::Set_Attribute | ( | int | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 168 of file pointcloud.h.

References CSG_Table::Set_Value().

◆ Set_Attribute() [3/4]

virtual bool CSG_PointCloud::Set_Attribute | ( | sLong | Index,
 |  | int | Field,
 |  | const SG_Char * | Value
 | ) |  |
inlinevirtual

Definition at line 189 of file pointcloud.h.

References CSG_Table::Set_Value().

◆ Set_Attribute() [4/4]

bool CSG_PointCloud::Set_Attribute | ( | sLong | Index,
 |  | int | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 178 of file pointcloud.h.

References CSG_Table::Set_Value().

◆ Set_Cursor()

bool CSG_PointCloud::Set_Cursor ( sLong Index )
inline

Definition at line 162 of file pointcloud.h.

Referenced by Get_Selection_Extent(), Get_Shape(), and Select().

◆ Set_Field_Type()

bool CSG_PointCloud::Set_Field_Type | ( | int | Field,
 |  | TSG_Data_Type | Type
 | ) |  |
virtual

Reimplemented from CSG_Table.

Definition at line 862 of file pointcloud.cpp.

References Add_Field(), Del_Field(), CSG_Table::Get_Field_Name(), Get_Value(), CSG_Table::m_Field_Type, CSG_Table::m_nFields, CSG_Table::m_nRecords, CSG_Table::Set_Field_Type(), Set_Modified(), and Set_Value().

◆ Set_Modified()

virtual void CSG_PointCloud::Set_Modified ( bool bModified = true )
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 197 of file pointcloud.h.

References CSG_Data_Object::Set_Modified().

Referenced by Add_Point(), Del_Field(), Del_Point(), Del_Points(), Del_Selection(), Save(), and Set_Field_Type().

◆ Set_NoData() [1/2]

bool CSG_PointCloud::Set_NoData ( int Field )
inline

Definition at line 170 of file pointcloud.h.

References CSG_Data_Object::Get_NoData_Value(), and CSG_Table::Set_Value().

◆ Set_NoData() [2/2]

bool CSG_PointCloud::Set_NoData | ( | sLong | Index,
 |  | int | Field
 | ) |  |
inline

Definition at line 180 of file pointcloud.h.

References CSG_Data_Object::Get_NoData_Value(), and CSG_Table::Set_Value().

◆ Set_Point() [1/2]

bool CSG_PointCloud::Set_Point ( const TSG_Point_3D & Point )
virtual

Definition at line 1064 of file pointcloud.cpp.

References SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Set_Point() [2/2]

bool CSG_PointCloud::Set_Point | ( | sLong | Index,
 |  | const TSG_Point_3D & | Point
 | ) |  |
virtual

Definition at line 1073 of file pointcloud.cpp.

References CSG_Table::m_nRecords, SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Set_Value() [1/4]

virtual bool CSG_PointCloud::Set_Value | ( | int | Field,
 |  | const SG_Char * | Value
 | ) |  |
inlinevirtual

Definition at line 183 of file pointcloud.h.

◆ Set_Value() [2/4]

virtual bool CSG_PointCloud::Set_Value | ( | int | Field,
 |  | double | Value
 | ) |  |
inlinevirtual

Definition at line 163 of file pointcloud.h.

Referenced by Add_Shape(), and Set_Field_Type().

◆ Set_Value() [3/4]

virtual bool CSG_PointCloud::Set_Value | ( | sLong | Index,
 |  | int | Field,
 |  | const SG_Char * | Value
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 185 of file pointcloud.h.

◆ Set_Value() [4/4]

virtual bool CSG_PointCloud::Set_Value | ( | sLong | Index,
 |  | int | Field,
 |  | double | Value
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 173 of file pointcloud.h.

◆ Set_XYZ_Precision()

void CSG_PointCloud::Set_XYZ_Precision ( bool bDouble )
inline

Definition at line 136 of file pointcloud.h.

The documentation for this class was generated from the following files:
  • pointcloud.h
  • pointcloud.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PointCloud Member List

This is the complete list of members for CSG_PointCloud, including all inherited members.

_Add_Selection(sLong Index) | CSG_Table | protected
_Del_Selection(sLong Index) | CSG_Table | protected
_Get_New_Record(sLong Index) | CSG_Shapes | protectedvirtual
_On_Construction(void) | CSG_PointCloud | protectedvirtual
_Set_Selection(sLong Index, sLong Selected) | CSG_Table | protected
_Stats_Invalidate(void) const | CSG_Table | protected
_Stats_Invalidate(int iField) const | CSG_Table | protected
_Stats_Update(int Field) const | CSG_PointCloud | protectedvirtual
Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Field=-1) | CSG_PointCloud | virtual
CSG_Shapes::Add_Field(const char *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
CSG_Shapes::Add_Field(const wchar_t *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Point(double x, double y, double z) | CSG_PointCloud |
Add_Record(CSG_Table_Record *pCopy=NULL) | CSG_PointCloud | virtual
Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY) | CSG_PointCloud | virtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
Assign(CSG_Data_Object *pSource) | CSG_PointCloud | virtual
Assign_Values(const CSG_Table &Table) | CSG_Table |
Assign_Values(CSG_Table *pTable) | CSG_Table |
Assign_Values(const SG_Char *File) | CSG_Table |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(void) | CSG_PointCloud |
Create(const CSG_PointCloud &PointCloud) | CSG_PointCloud |
Create(const CSG_String &File) | CSG_PointCloud |
Create(const char *File) | CSG_PointCloud |
Create(const wchar_t *File) | CSG_PointCloud |
Create(CSG_PointCloud *pTemplate) | CSG_PointCloud |
CSG_Shapes::Create(const CSG_Shapes &Shapes) | CSG_Shapes |
CSG_Shapes::Create(TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY) | CSG_Shapes |
CSG_Table::Create(const CSG_Table &Table) | CSG_Table |
CSG_Table::Create(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Data_Object(void) | CSG_Data_Object |
CSG_PointCloud(void) | CSG_PointCloud |
CSG_PointCloud(const CSG_PointCloud &PointCloud) | CSG_PointCloud |
CSG_PointCloud(const CSG_String &File) | CSG_PointCloud |
CSG_PointCloud(const char *File) | CSG_PointCloud |
CSG_PointCloud(const wchar_t *File) | CSG_PointCloud |
CSG_PointCloud(CSG_PointCloud *pTemplate) | CSG_PointCloud |
CSG_Shapes(void) | CSG_Shapes |
CSG_Shapes(const CSG_Shapes &Shapes) | CSG_Shapes |
CSG_Shapes(const char *File) | CSG_Shapes |
CSG_Shapes(const wchar_t *File) | CSG_Shapes |
CSG_Shapes(const CSG_String &File) | CSG_Shapes |
CSG_Shapes(TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY) | CSG_Shapes |
CSG_Table(void) | CSG_Table |
CSG_Table(const CSG_Table &Table) | CSG_Table |
CSG_Table(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Del_Field(int Field) | CSG_PointCloud | virtual
Del_Index(void) | CSG_Table |
Del_Point(sLong Index) | CSG_PointCloud |
Del_Points(void) | CSG_PointCloud |
Del_Record(sLong Index) | CSG_PointCloud | inlinevirtual
Del_Records(void) | CSG_PointCloud | inlinevirtual
Del_Selection(void) | CSG_PointCloud | virtual
Del_Shape(sLong Index) | CSG_PointCloud | inlinevirtual
Del_Shape(CSG_Shape *pShape) | CSG_PointCloud | inlinevirtual
Del_Shapes(void) | CSG_PointCloud | inlinevirtual
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_PointCloud | virtual
Find_Field(const CSG_String &Name) const | CSG_Table |
Find_Field(const CSG_String &Name, int &Index) const | CSG_Table |
Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(sLong &Index, int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Attribute(int Field) const | CSG_PointCloud | inline
Get_Attribute(sLong Index, int Field) const | CSG_PointCloud | inline
Get_Attribute(int Field, CSG_String &Value) const | CSG_PointCloud | inlinevirtual
Get_Attribute(sLong Index, int Field, CSG_String &Value) const | CSG_PointCloud | inlinevirtual
Get_Attribute_Count(void) const | CSG_PointCloud | inline
Get_Attribute_Name(int Field) const | CSG_PointCloud | inline
Get_Attribute_Type(int Field) const | CSG_PointCloud | inline
Get_Count(void) const | CSG_Table | inline
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void) | CSG_Shapes | inlinevirtual
Get_Field(const CSG_String &Name) const | CSG_Table |
Get_Field_Count(void) const | CSG_Table | inline
Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const | CSG_Table |
Get_Field_Name(int iField) const | CSG_Table | inline
Get_Field_Type(int iField) const | CSG_Table | inline
Get_File_Encoding(void) const | CSG_Table | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_Header_Content(const CSG_String &FileName, CSG_MetaData &Header) | CSG_PointCloud | static
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Index(sLong Index) const | CSG_Table | inline
Get_Index_Field(int i) const | CSG_Table | inline
Get_Index_Field(size_t i) const | CSG_Table | inline
Get_Index_Order(int i) const | CSG_Table | inline
Get_Index_Order(size_t i) const | CSG_Table | inline
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Maximum(int iField) const | CSG_Table | inline
Get_Mean(int iField) const | CSG_Table | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Minimum(int iField) const | CSG_Table | inline
Get_MMax(void) | CSG_Shapes | inline
Get_MMin(void) | CSG_Shapes | inline
Get_N(int iField) const | CSG_Table | inline
Get_Name(void) const | CSG_Data_Object |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_ObjectType(void) const | CSG_PointCloud | inlinevirtual
Get_Owner(void) const | CSG_Data_Object | inline
Get_Point(void) const | CSG_PointCloud |
Get_Point(sLong Index) const | CSG_PointCloud |
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Range(int iField) const | CSG_Table | inline
Get_Record(sLong Index) const | CSG_PointCloud | virtual
Get_Record_byIndex(sLong Index) const | CSG_Table | inline
Get_Selection(sLong Index=0) | CSG_PointCloud | virtual
CSG_Table::Get_Selection(sLong Index=0) const | CSG_Table | inlinevirtual
Get_Selection_Count(void) const | CSG_Table | inline
Get_Selection_Extent(void) | CSG_PointCloud | virtual
Get_Selection_Index(sLong Index=0) const | CSG_Table | inline
Get_Shape(const CSG_Point &Point, double Epsilon=0.) | CSG_PointCloud | virtual
CSG_Shapes::Get_Shape(sLong Index) const | CSG_Shapes | inlinevirtual
Get_Shape_byIndex(sLong Index) const | CSG_Shapes | inlinevirtual
Get_Statistics(int iField) const | CSG_Table | inline
Get_StdDev(int iField) const | CSG_Table | inline
Get_Sum(int iField) const | CSG_Table | inline
Get_Type(void) const | CSG_Shapes | inlinevirtual
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(int Field) const | CSG_PointCloud | inlinevirtual
Get_Value(sLong Index, int Field) const | CSG_PointCloud | inlinevirtual
Get_Value(int Field, CSG_String &Value) const | CSG_PointCloud | inlinevirtual
Get_Value(sLong Index, int Field, CSG_String &Value) const | CSG_PointCloud | inlinevirtual
CSG_Shapes::Get_Value(sLong Index, int iField, double &Value) const | CSG_Table | virtual
Get_Variance(int iField) const | CSG_Table | inline
Get_Vertex_Type(void) const | CSG_Shapes | inline
Get_X(void) const | CSG_PointCloud | inline
Get_X(sLong Index) const | CSG_PointCloud | inline
Get_Y(void) const | CSG_PointCloud | inline
Get_Y(sLong Index) const | CSG_PointCloud | inline
Get_Z(void) const | CSG_PointCloud | inline
Get_Z(sLong Index) const | CSG_PointCloud | inline
Get_ZMax(void) | CSG_Shapes | inline
Get_ZMin(void) | CSG_Shapes | inline
Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL) | CSG_PointCloud | virtual
Inv_Selection(void) | CSG_PointCloud | virtual
is_Compatible(CSG_PointCloud *pPointCloud) const | CSG_PointCloud |
CSG_Shapes::is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const | CSG_Table |
CSG_Shapes::is_Compatible(CSG_Table *pTable, bool bExactMatch=false) const | CSG_Table |
is_File_Native(void) const | CSG_Data_Object | inline
is_Indexed(void) const | CSG_Table | inline
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData(int Field) const | CSG_PointCloud | inline
is_NoData(sLong Index, int Field) const | CSG_PointCloud | inline
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Selected(sLong Index) const | CSG_PointCloud | virtual
is_Valid(void) const | CSG_PointCloud | inlinevirtual
Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_Encoding | CSG_Table | protected
m_Extent | CSG_Table | protected
m_Extent_Selected | CSG_Shapes | protected
m_Field_Name | CSG_Table | protected
m_Field_Stats | CSG_Table | protected
m_Field_Type | CSG_Table | protected
m_MMax | CSG_Shapes | protected
m_MMin | CSG_Shapes | protected
m_nBuffer | CSG_Table | protected
m_nFields | CSG_Table | protected
m_nRecords | CSG_Table | protected
m_pOwner | CSG_Data_Object | protected
m_Selection | CSG_Table | protected
m_Type | CSG_Shapes | protected
m_Vertex_Type | CSG_Shapes | protected
m_ZMax | CSG_Shapes | protected
m_ZMin | CSG_Shapes | protected
Make_Clean(void) | CSG_Shapes |
Mov_Field(int Field, int Position) | CSG_PointCloud | virtual
On_Delete(void) | CSG_PointCloud | protectedvirtual
On_NoData_Changed(void) | CSG_Table | protectedvirtual
On_Reload(void) | CSG_PointCloud | protectedvirtual
On_Update(void) | CSG_PointCloud | protectedvirtual
operator=(const CSG_Table &Table) | CSG_Table |
operator[](sLong Index) const | CSG_Table | inlinevirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format=0) | CSG_PointCloud | virtual
Save(const char *File, int Format=0) | CSG_PointCloud | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_PointCloud | inlinevirtual
CSG_Table::Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | virtual
CSG_Table::Save(const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
CSG_Table::Save(const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Select(sLong Index, bool bInvert=false) | CSG_PointCloud | virtual
Select(CSG_Table_Record *pShape=NULL, bool bInvert=false) | CSG_PointCloud | virtual
Select(const TSG_Rect &Extent, bool bInvert=false) | CSG_PointCloud | virtual
Select(const TSG_Point &Point, bool bInvert=false) | CSG_PointCloud | virtual
Serialize(CSG_File &Stream, bool bSave) | CSG_Table |
Set_Attribute(int Field, double Value) | CSG_PointCloud | inline
Set_Attribute(sLong Index, int Field, double Value) | CSG_PointCloud | inline
Set_Attribute(int Field, const SG_Char *Value) | CSG_PointCloud | inlinevirtual
Set_Attribute(sLong Index, int Field, const SG_Char *Value) | CSG_PointCloud | inlinevirtual
Set_Count(sLong nRecords) | CSG_Table | virtual
Set_Cursor(sLong Index) | CSG_PointCloud | inline
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_Field_Name(int iField, const SG_Char *Name) | CSG_Table |
Set_Field_Type(int Field, TSG_Data_Type Type) | CSG_PointCloud | virtual
Set_File_Encoding(int Encoding) | CSG_Table |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const | CSG_Table |
Set_Index(int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None) | CSG_Table |
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bModified=true) | CSG_PointCloud | inlinevirtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData(int Field) | CSG_PointCloud | inline
Set_NoData(sLong Index, int Field) | CSG_PointCloud | inline
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Point(const TSG_Point_3D &Point) | CSG_PointCloud | virtual
Set_Point(sLong Index, const TSG_Point_3D &Point) | CSG_PointCloud | virtual
Set_Record(sLong Index, CSG_Table_Record *pCopy) | CSG_Table | virtual
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(int Field, double Value) | CSG_PointCloud | inlinevirtual
Set_Value(sLong Index, int Field, double Value) | CSG_PointCloud | inlinevirtual
Set_Value(int Field, const SG_Char *Value) | CSG_PointCloud | inlinevirtual
Set_Value(sLong Index, int Field, const SG_Char *Value) | CSG_PointCloud | inlinevirtual
Set_XYZ_Precision(bool bDouble) | CSG_PointCloud | inline
Toggle_Index(int iField) | CSG_Table |
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_PointCloud(void) | CSG_PointCloud | virtual
~CSG_Shapes(void) | CSG_Shapes | virtual
~CSG_Table(void) | CSG_Table | virtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Points Class Reference

Public Member Functions | List of all members
CSG_Points Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Points (void)
CSG_Points (const CSG_Points &Points)
CSG_Points (sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1)
bool | Clear (void)
CSG_Points & | operator= (const CSG_Points &Points)
bool | Assign (const CSG_Points &Points)
bool | Add (double x, double y)
bool | Add (const TSG_Point &Point)
bool | Del (sLong Index)
bool | Set_Count (sLong nPoints)
sLong | Get_Count (void) const
TSG_Point * | Get_Points (void) const
TSG_Point & | operator[] (sLong Index)
const TSG_Point & | operator[] (sLong Index) const

Detailed Description

Definition at line 183 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Points() [1/3]

CSG_Points::CSG_Points ( void )

Definition at line 316 of file geo_classes.cpp.

References CSG_Array::Create().

◆ CSG_Points() [2/3]

CSG_Points::CSG_Points ( const CSG_Points & Points )

Definition at line 321 of file geo_classes.cpp.

References Assign(), and CSG_Array::Create().

◆ CSG_Points() [3/3]

CSG_Points::CSG_Points | ( | sLong | nPoints,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1
 | ) |  |

Definition at line 328 of file geo_classes.cpp.

References CSG_Array::Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Points::Add ( const TSG_Point & Point )
inline

Definition at line 196 of file geo_tools.h.

References Add(), SSG_Point::x, and SSG_Point::y.

Referenced by Add().

◆ Add() [2/2]

bool CSG_Points::Add | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 350 of file geo_classes.cpp.

References CSG_Array::Get_Entry(), CSG_Array::Get_Size(), CSG_Array::Inc_Array(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_TIN_Node::Get_Polygon(), and CSG_Shape_Polygon_Part::Get_Shared_Edges().

◆ Assign()

bool CSG_Points::Assign ( const CSG_Points & Points )

Definition at line 334 of file geo_classes.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Size(), CSG_Array::Get_Value_Size(), and CSG_Array::Set_Array().

Referenced by CSG_Lines::Add(), CSG_Lines::Assign(), and CSG_Points().

◆ Clear()

bool CSG_Points::Clear ( void )
inline

Definition at line 190 of file geo_tools.h.

Referenced by CSG_TIN_Node::Get_Polygon().

◆ Del()

bool CSG_Points::Del ( sLong Index )
inline

Definition at line 197 of file geo_tools.h.

◆ Get_Count()

sLong CSG_Points::Get_Count ( void ) const
inline

Definition at line 200 of file geo_tools.h.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_Lines::Get_Length(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Trend::Set_Data(), and SG_Get_Polygon_Area().

◆ Get_Points()

TSG_Point* CSG_Points::Get_Points ( void ) const
inline

Definition at line 202 of file geo_tools.h.

◆ operator=()

CSG_Points& CSG_Points::operator= ( const CSG_Points & Points )
inline

Definition at line 192 of file geo_tools.h.

◆ operator[]() [1/2]

TSG_Point& CSG_Points::operator[] ( sLong Index )
inline

Definition at line 204 of file geo_tools.h.

◆ operator[]() [2/2]

const TSG_Point& CSG_Points::operator[] ( sLong Index ) const
inline

Definition at line 205 of file geo_tools.h.

◆ Set_Count()

bool CSG_Points::Set_Count ( sLong nPoints )
inline

Definition at line 199 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Points Member List

This is the complete list of members for CSG_Points, including all inherited members.

Add(double x, double y) | CSG_Points |
Add(const TSG_Point &Point) | CSG_Points | inline
Assign(const CSG_Points &Points) | CSG_Points |
Clear(void) | CSG_Points | inline
CSG_Points(void) | CSG_Points |
CSG_Points(const CSG_Points &Points) | CSG_Points |
CSG_Points(sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1) | CSG_Points |
Del(sLong Index) | CSG_Points | inline
Get_Count(void) const | CSG_Points | inline
Get_Points(void) const | CSG_Points | inline
operator=(const CSG_Points &Points) | CSG_Points | inline
operator[](sLong Index) | CSG_Points | inline
operator[](sLong Index) const | CSG_Points | inline
Set_Count(sLong nPoints) | CSG_Points | inline
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Points_3D Class Reference

Public Member Functions | List of all members
CSG_Points_3D Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Points_3D (void)
CSG_Points_3D (const CSG_Points_3D &Points)
CSG_Points_3D (sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1)
bool | Clear (void)
CSG_Points_3D & | operator= (const CSG_Points_3D &Points)
bool | Assign (const CSG_Points_3D &Points)
bool | Add (double x, double y, double z)
bool | Add (const TSG_Point_3D &Point)
bool | Del (sLong Index)
bool | Set_Count (sLong nPoints)
sLong | Get_Count (void) const
TSG_Point_3D * | Get_Points (void) const
TSG_Point_3D & | operator[] (sLong Index)
const TSG_Point_3D & | operator[] (sLong Index) const

Detailed Description

Definition at line 319 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Points_3D() [1/3]

CSG_Points_3D::CSG_Points_3D ( void )

Definition at line 548 of file geo_classes.cpp.

References CSG_Array::Create().

◆ CSG_Points_3D() [2/3]

CSG_Points_3D::CSG_Points_3D ( const CSG_Points_3D & Points )

Definition at line 553 of file geo_classes.cpp.

References Assign(), and CSG_Array::Create().

◆ CSG_Points_3D() [3/3]

CSG_Points_3D::CSG_Points_3D | ( | sLong | nPoints,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1
 | ) |  |

Definition at line 560 of file geo_classes.cpp.

References CSG_Array::Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Points_3D::Add ( const TSG_Point_3D & Point )
inline

Definition at line 332 of file geo_tools.h.

References Add(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

Referenced by Add().

◆ Add() [2/2]

bool CSG_Points_3D::Add | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |

Definition at line 582 of file geo_classes.cpp.

References CSG_Array::Get_Entry(), CSG_Array::Get_Size(), CSG_Array::Inc_Array(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

Referenced by CSG_PRQuadTree::Get_Nearest_Points(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), and CSG_TIN_Node::Get_Polygon().

◆ Assign()

bool CSG_Points_3D::Assign ( const CSG_Points_3D & Points )

Definition at line 566 of file geo_classes.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Size(), CSG_Array::Get_Value_Size(), and CSG_Array::Set_Array().

Referenced by CSG_Points_3D().

◆ Clear()

bool CSG_Points_3D::Clear ( void )
inline

Definition at line 326 of file geo_tools.h.

Referenced by CSG_Thin_Plate_Spline::Destroy(), CSG_PRQuadTree::Get_Nearest_Points(), and CSG_Parameters_Point_Search_KDTree_2D::Get_Points().

◆ Del()

bool CSG_Points_3D::Del ( sLong Index )
inline

Definition at line 333 of file geo_tools.h.

◆ Get_Count()

sLong CSG_Points_3D::Get_Count ( void ) const
inline

Definition at line 336 of file geo_tools.h.

Referenced by CSG_Thin_Plate_Spline::Create(), CSG_PRQuadTree::Get_Nearest_Points(), CSG_TIN_Node::Get_Polygon(), and CSG_Thin_Plate_Spline::Get_Value().

◆ Get_Points()

TSG_Point_3D* CSG_Points_3D::Get_Points ( void ) const
inline

Definition at line 338 of file geo_tools.h.

◆ operator=()

CSG_Points_3D& CSG_Points_3D::operator= ( const CSG_Points_3D & Points )
inline

Definition at line 328 of file geo_tools.h.

◆ operator[]() [1/2]

TSG_Point_3D& CSG_Points_3D::operator[] ( sLong Index )
inline

Definition at line 340 of file geo_tools.h.

◆ operator[]() [2/2]

const TSG_Point_3D& CSG_Points_3D::operator[] ( sLong Index ) const
inline

Definition at line 341 of file geo_tools.h.

◆ Set_Count()

bool CSG_Points_3D::Set_Count ( sLong nPoints )
inline

Definition at line 335 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Points_3D Member List

This is the complete list of members for CSG_Points_3D, including all inherited members.

Add(double x, double y, double z) | CSG_Points_3D |
Add(const TSG_Point_3D &Point) | CSG_Points_3D | inline
Assign(const CSG_Points_3D &Points) | CSG_Points_3D |
Clear(void) | CSG_Points_3D | inline
CSG_Points_3D(void) | CSG_Points_3D |
CSG_Points_3D(const CSG_Points_3D &Points) | CSG_Points_3D |
CSG_Points_3D(sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1) | CSG_Points_3D |
Del(sLong Index) | CSG_Points_3D | inline
Get_Count(void) const | CSG_Points_3D | inline
Get_Points(void) const | CSG_Points_3D | inline
operator=(const CSG_Points_3D &Points) | CSG_Points_3D | inline
operator[](sLong Index) | CSG_Points_3D | inline
operator[](sLong Index) const | CSG_Points_3D | inline
Set_Count(sLong nPoints) | CSG_Points_3D | inline
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Points_Int Class Reference

Public Member Functions | List of all members
CSG_Points_Int Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Points_Int (void)
CSG_Points_Int (const CSG_Points_Int &Points)
CSG_Points_Int (sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1)
bool | Clear (void)
CSG_Points_Int & | operator= (const CSG_Points_Int &Points)
bool | Assign (const CSG_Points_Int &Points)
bool | Add (int x, int y)
bool | Add (const TSG_Point_Int &Point)
bool | Del (sLong Index)
bool | Set_Count (sLong nPoints)
sLong | Get_Count (void) const
TSG_Point_Int * | Get_Points (void) const
TSG_Point_Int & | operator[] (sLong Index)
const TSG_Point_Int & | operator[] (sLong Index) const

Detailed Description

Definition at line 424 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Points_Int() [1/3]

CSG_Points_Int::CSG_Points_Int ( void )

Definition at line 606 of file geo_classes.cpp.

References CSG_Array::Create().

◆ CSG_Points_Int() [2/3]

CSG_Points_Int::CSG_Points_Int ( const CSG_Points_Int & Points )

Definition at line 611 of file geo_classes.cpp.

References Assign(), and CSG_Array::Create().

◆ CSG_Points_Int() [3/3]

CSG_Points_Int::CSG_Points_Int | ( | sLong | nPoints,
 |  | TSG_Array_Growth | Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1
 | ) |  |

Definition at line 618 of file geo_classes.cpp.

References CSG_Array::Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Points_Int::Add ( const TSG_Point_Int & Point )
inline

Definition at line 437 of file geo_tools.h.

References Add(), SSG_Point_Int::x, and SSG_Point_Int::y.

Referenced by Add().

◆ Add() [2/2]

bool CSG_Points_Int::Add | ( | int | x,
 |  | int | y
 | ) |  |

Definition at line 640 of file geo_classes.cpp.

References CSG_Array::Get_Entry(), CSG_Array::Get_Size(), CSG_Array::Inc_Array(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Assign()

bool CSG_Points_Int::Assign ( const CSG_Points_Int & Points )

Definition at line 624 of file geo_classes.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Size(), CSG_Array::Get_Value_Size(), and CSG_Array::Set_Array().

Referenced by CSG_Points_Int().

◆ Clear()

bool CSG_Points_Int::Clear ( void )
inline

Definition at line 431 of file geo_tools.h.

◆ Del()

bool CSG_Points_Int::Del ( sLong Index )
inline

Definition at line 438 of file geo_tools.h.

◆ Get_Count()

sLong CSG_Points_Int::Get_Count ( void ) const
inline

Definition at line 441 of file geo_tools.h.

◆ Get_Points()

TSG_Point_Int* CSG_Points_Int::Get_Points ( void ) const
inline

Definition at line 443 of file geo_tools.h.

◆ operator=()

CSG_Points_Int& CSG_Points_Int::operator= ( const CSG_Points_Int & Points )
inline

Definition at line 433 of file geo_tools.h.

◆ operator[]() [1/2]

TSG_Point_Int& CSG_Points_Int::operator[] ( sLong Index )
inline

Definition at line 445 of file geo_tools.h.

◆ operator[]() [2/2]

const TSG_Point_Int& CSG_Points_Int::operator[] ( sLong Index ) const
inline

Definition at line 446 of file geo_tools.h.

◆ Set_Count()

bool CSG_Points_Int::Set_Count ( sLong nPoints )
inline

Definition at line 440 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Points_Int Member List

This is the complete list of members for CSG_Points_Int, including all inherited members.

Add(int x, int y) | CSG_Points_Int |
Add(const TSG_Point_Int &Point) | CSG_Points_Int | inline
Assign(const CSG_Points_Int &Points) | CSG_Points_Int |
Clear(void) | CSG_Points_Int | inline
CSG_Points_Int(void) | CSG_Points_Int |
CSG_Points_Int(const CSG_Points_Int &Points) | CSG_Points_Int |
CSG_Points_Int(sLong nPoints, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_1) | CSG_Points_Int |
Del(sLong Index) | CSG_Points_Int | inline
Get_Count(void) const | CSG_Points_Int | inline
Get_Points(void) const | CSG_Points_Int | inline
operator=(const CSG_Points_Int &Points) | CSG_Points_Int | inline
operator[](sLong Index) | CSG_Points_Int | inline
operator[](sLong Index) const | CSG_Points_Int | inline
Set_Count(sLong nPoints) | CSG_Points_Int | inline
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PriorityQueue Class Reference

Classes | Public Member Functions | List of all members
CSG_PriorityQueue Class Reference

#include <mat_tools.h>

Classes

class CSG_PriorityQueueItem

Public Member Functions

CSG_PriorityQueue (size_t maxSize=256)
virtual | ~CSG_PriorityQueue (void)
void | Create (size_t maxSize=256)
void | Destroy (void)
bool | is_Empty (void) const
size_t | Get_Size (void) const
CSG_PriorityQueueItem * | Get_Item (size_t i) const
void | Add (CSG_PriorityQueueItem *pItem)
CSG_PriorityQueueItem * | Peek (void) const
CSG_PriorityQueueItem * | Poll (void)
CSG_PriorityQueueItem * | Minimum (void) const
CSG_PriorityQueueItem * | Maximum (void) const

Detailed Description

Definition at line 259 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_PriorityQueue()

CSG_PriorityQueue::CSG_PriorityQueue ( size_t maxSize = 256 )

Definition at line 499 of file mat_indexing.cpp.

References Create().

Referenced by Add().

◆ ~CSG_PriorityQueue()

CSG_PriorityQueue::~CSG_PriorityQueue ( void )
virtual

Definition at line 507 of file mat_indexing.cpp.

References Destroy().

Member Function Documentation

◆ Add()

void CSG_PriorityQueue::Add ( CSG_PriorityQueueItem * pItem )

Definition at line 602 of file mat_indexing.cpp.

References Add(), CSG_PriorityQueue::CSG_PriorityQueueItem::Compare(), CSG_PriorityQueue(), Minimum(), and SG_Free().

Referenced by Add().

◆ Create()

void CSG_PriorityQueue::Create ( size_t maxSize = 256 )

Definition at line 513 of file mat_indexing.cpp.

References Destroy(), and SG_Malloc().

Referenced by CSG_PriorityQueue().

◆ Destroy()

void CSG_PriorityQueue::Destroy ( void )

Definition at line 526 of file mat_indexing.cpp.

References SG_Free().

Referenced by Create(), and ~CSG_PriorityQueue().

◆ Get_Item()

CSG_PriorityQueueItem* CSG_PriorityQueue::Get_Item ( size_t i ) const
inline

Definition at line 284 of file mat_tools.h.

◆ Get_Size()

size_t CSG_PriorityQueue::Get_Size ( void ) const
inline

Definition at line 283 of file mat_tools.h.

◆ is_Empty()

bool CSG_PriorityQueue::is_Empty ( void ) const
inline

Definition at line 282 of file mat_tools.h.

◆ Maximum()

CSG_PriorityQueueItem* CSG_PriorityQueue::Maximum ( void ) const
inline

Definition at line 307 of file mat_tools.h.

◆ Minimum()

CSG_PriorityQueueItem* CSG_PriorityQueue::Minimum ( void ) const
inline

Definition at line 292 of file mat_tools.h.

Referenced by Add().

◆ Peek()

CSG_PriorityQueueItem* CSG_PriorityQueue::Peek ( void ) const
inline

Definition at line 288 of file mat_tools.h.

◆ Poll()

CSG_PriorityQueue::CSG_PriorityQueueItem * CSG_PriorityQueue::Poll ( void )

Definition at line 650 of file mat_indexing.cpp.

References Poll().

Referenced by Poll().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_indexing.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PriorityQueue Member List

This is the complete list of members for CSG_PriorityQueue, including all inherited members.

Add(CSG_PriorityQueueItem *pItem) | CSG_PriorityQueue |
Create(size_t maxSize=256) | CSG_PriorityQueue |
CSG_PriorityQueue(size_t maxSize=256) | CSG_PriorityQueue |
Destroy(void) | CSG_PriorityQueue |
Get_Item(size_t i) const | CSG_PriorityQueue | inline
Get_Size(void) const | CSG_PriorityQueue | inline
is_Empty(void) const | CSG_PriorityQueue | inline
Maximum(void) const | CSG_PriorityQueue | inline
Minimum(void) const | CSG_PriorityQueue | inline
Peek(void) const | CSG_PriorityQueue | inline
Poll(void) | CSG_PriorityQueue |
~CSG_PriorityQueue(void) | CSG_PriorityQueue | virtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PriorityQueue::CSG_PriorityQueueItem Class Reference

  • CSG_PriorityQueue
  • CSG_PriorityQueueItem
Public Member Functions | List of all members
CSG_PriorityQueue::CSG_PriorityQueueItem Class Referenceabstract

#include <mat_tools.h>

Public Member Functions

CSG_PriorityQueueItem (void)
virtual int Compare (CSG_PriorityQueueItem *pItem)=0

Detailed Description

Definition at line 264 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_PriorityQueueItem()

CSG_PriorityQueue::CSG_PriorityQueueItem::CSG_PriorityQueueItem ( void )
inline

Definition at line 267 of file mat_tools.h.

Member Function Documentation

◆ Compare()

virtual int CSG_PriorityQueue::CSG_PriorityQueueItem::Compare ( CSG_PriorityQueueItem * pItem )
pure virtual

Referenced by CSG_PriorityQueue::Add().

The documentation for this class was generated from the following file:
  • mat_tools.h
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

  • CSG_PriorityQueue
  • CSG_PriorityQueueItem
CSG_PriorityQueue::CSG_PriorityQueueItem Member List

This is the complete list of members for CSG_PriorityQueue::CSG_PriorityQueueItem, including all inherited members.

Compare(CSG_PriorityQueueItem *pItem)=0 | CSG_PriorityQueue::CSG_PriorityQueueItem | pure virtual
CSG_PriorityQueueItem(void) | CSG_PriorityQueue::CSG_PriorityQueueItem | inline
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Projection Class Reference

Public Member Functions | Friends | List of all members
CSG_Projection Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Projection (void)
virtual | ~CSG_Projection (void)
void | Destroy (void)
CSG_Projection (const CSG_Projection &Projection)
bool | Create (const CSG_Projection &Projection)
bool | Assign (const CSG_Projection &Projection)
CSG_Projection & | operator= (const CSG_Projection &Projection)
CSG_Projection (int Authority_ID, const SG_Char *Authority=NULL)
bool | Create (int Authority_ID, const SG_Char *Authority=NULL)
bool | Assign (int Authority_ID, const SG_Char *Authority=NULL)
CSG_Projection & | operator= (int Authority_ID)
CSG_Projection (const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
bool | Create (const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
bool | Assign (const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
CSG_Projection & | operator= (const CSG_String &Projection)
CSG_Projection (const CSG_String &WKT, const CSG_String &Proj4)
bool | Create (const CSG_String &WKT, const CSG_String &Proj4)
bool | Assign (const CSG_String &WKT, const CSG_String &Proj4)
bool | is_Okay (void) const
bool | is_Equal (const CSG_Projection &Projection) const
bool | operator== (const CSG_Projection &Projection) const
bool | operator!= (const CSG_Projection &Projection) const
bool | Set_GCS_WGS84 (void)
bool | Set_UTM_WGS84 (int Zone, bool bSouth=false)
bool | Load (const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
bool | Save (const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
bool | Load (CSG_File &Stream, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
bool | Save (CSG_File &Stream, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
bool | Load (const CSG_MetaData &Projection)
bool | Save (CSG_MetaData &Projection) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_WKT (void) const
const CSG_String & | Get_Proj4 (void) const
const CSG_String & | Get_Authority (void) const
int | Get_Authority_ID (void) const
int | Get_EPSG (void) const
CSG_String | Get_Description (void) const
TSG_Projection_Type | Get_Type (void) const
CSG_String | Get_Type_Identifier (void) const
CSG_String | Get_Type_Name (void) const
bool | is_Projection (void) const
bool | is_Geographic (void) const
bool | is_Geocentric (void) const
TSG_Projection_Unit | Get_Unit (void) const
CSG_String | Get_Unit_Identifier (void) const
CSG_String | Get_Unit_Name (void) const
double | Get_Unit_To_Meter (void) const

Friends

class CSG_Projections

Detailed Description

Definition at line 832 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Projection() [1/5]

CSG_Projection::CSG_Projection ( void )

Definition at line 236 of file projections.cpp.

References Destroy().

◆ ~CSG_Projection()

CSG_Projection::~CSG_Projection ( void )
virtual

Definition at line 241 of file projections.cpp.

◆ CSG_Projection() [2/5]

CSG_Projection::CSG_Projection ( const CSG_Projection & Projection )

Definition at line 245 of file projections.cpp.

References Create(), and Destroy().

◆ CSG_Projection() [3/5]

CSG_Projection::CSG_Projection | ( | int | Authority_ID,
 |  | const SG_Char * | Authority = NULL
 | ) |  |

Definition at line 273 of file projections.cpp.

References Create(), and Destroy().

◆ CSG_Projection() [4/5]

CSG_Projection::CSG_Projection | ( | const CSG_String & | Projection,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  |

Definition at line 294 of file projections.cpp.

References Create().

◆ CSG_Projection() [5/5]

CSG_Projection::CSG_Projection | ( | const CSG_String & | WKT,
 |  | const CSG_String & | Proj4
 | ) |  |

Definition at line 371 of file projections.cpp.

References Create().

Member Function Documentation

◆ Assign() [1/4]

bool CSG_Projection::Assign ( const CSG_Projection & Projection )

Definition at line 257 of file projections.cpp.

Referenced by Assign(), Create(), and Load().

◆ Assign() [2/4]

bool CSG_Projection::Assign | ( | const CSG_String & | Projection,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  |

Definition at line 304 of file projections.cpp.

References CSG_String::asInt(), Assign(), CSG_String::CmpNoCase(), Destroy(), CSG_MetaData::Get_Name(), CSG_Projections::Get_Projection(), CSG_MetaData::Get_Property(), gSG_Projections, CSG_String::is_Empty(), SG_Get_Projection_Type(), SG_PROJ_FMT_EPSG, SG_PROJ_FMT_Proj4, SG_PROJ_FMT_WKT, SG_Set_Projection_Unit(), SG_T, CSG_Projections::WKT_from_Proj4(), CSG_Projections::WKT_to_MetaData(), and CSG_Projections::WKT_to_Proj4().

◆ Assign() [3/4]

bool CSG_Projection::Assign | ( | const CSG_String & | WKT,
 |  | const CSG_String & | Proj4
 | ) |  |

Definition at line 381 of file projections.cpp.

References Assign().

◆ Assign() [4/4]

bool CSG_Projection::Assign | ( | int | Authority_ID,
 |  | const SG_Char * | Authority = NULL
 | ) |  |

Definition at line 285 of file projections.cpp.

References CSG_Projections::Get_Projection(), and gSG_Projections.

◆ Create() [1/4]

bool CSG_Projection::Create ( const CSG_Projection & Projection )

Definition at line 252 of file projections.cpp.

References Assign().

Referenced by CSG_Shapes::Assign(), CSG_PointCloud::Assign(), CSG_Grids::Create(), CSG_Projection(), CSG_Grid_OGIS_Converter::from_WKBinary(), Set_GCS_WGS84(), CSG_Tool_Interactive_Base::Set_Projection(), Set_UTM_WGS84(), and SG_Get_Projected().

◆ Create() [2/4]

bool CSG_Projection::Create | ( | const CSG_String & | Projection,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  |

Definition at line 299 of file projections.cpp.

References Assign().

◆ Create() [3/4]

bool CSG_Projection::Create | ( | const CSG_String & | WKT,
 |  | const CSG_String & | Proj4
 | ) |  |

Definition at line 376 of file projections.cpp.

References Assign().

◆ Create() [4/4]

bool CSG_Projection::Create | ( | int | Authority_ID,
 |  | const SG_Char * | Authority = NULL
 | ) |  |

Definition at line 280 of file projections.cpp.

References Assign().

◆ Destroy()

void CSG_Projection::Destroy ( void )

Definition at line 394 of file projections.cpp.

References _TL, CSG_String::Clear(), SG_PROJ_TYPE_CS_Undefined, and SG_PROJ_UNIT_Undefined.

Referenced by Assign(), CSG_Projection(), and CSG_Tool::Get_Projection().

◆ Get_Authority()

const CSG_String& CSG_Projection::Get_Authority ( void ) const
inline

Definition at line 881 of file geo_tools.h.

◆ Get_Authority_ID()

int CSG_Projection::Get_Authority_ID ( void ) const
inline

Definition at line 882 of file geo_tools.h.

◆ Get_Description()

CSG_String CSG_Projection::Get_Description ( void ) const

Definition at line 661 of file projections.cpp.

References CSG_String::c_str(), CSG_String::Format(), is_Okay(), CSG_String::Length(), and SG_Get_Projection_Type_Name().

◆ Get_EPSG()

int CSG_Projection::Get_EPSG ( void ) const
inline

Definition at line 883 of file geo_tools.h.

Referenced by Save(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ Get_Name()

const CSG_String& CSG_Projection::Get_Name ( void ) const
inline

Definition at line 878 of file geo_tools.h.

◆ Get_Proj4()

const CSG_String& CSG_Projection::Get_Proj4 ( void ) const
inline

Definition at line 880 of file geo_tools.h.

Referenced by SG_Get_Projected().

◆ Get_Type()

TSG_Projection_Type CSG_Projection::Get_Type ( void ) const
inline

Definition at line 887 of file geo_tools.h.

Referenced by CSG_Data_Object::Save_MetaData().

◆ Get_Type_Identifier()

CSG_String CSG_Projection::Get_Type_Identifier ( void ) const
inline

Definition at line 888 of file geo_tools.h.

References SG_Get_Projection_Type_Identifier().

◆ Get_Type_Name()

CSG_String CSG_Projection::Get_Type_Name ( void ) const
inline

Definition at line 889 of file geo_tools.h.

References SG_Get_Projection_Type_Name().

◆ Get_Unit()

TSG_Projection_Unit CSG_Projection::Get_Unit ( void ) const
inline

Definition at line 896 of file geo_tools.h.

◆ Get_Unit_Identifier()

CSG_String CSG_Projection::Get_Unit_Identifier ( void ) const
inline

Definition at line 897 of file geo_tools.h.

References SG_Get_Projection_Unit_Identifier().

◆ Get_Unit_Name()

CSG_String CSG_Projection::Get_Unit_Name ( void ) const
inline

Definition at line 898 of file geo_tools.h.

◆ Get_Unit_To_Meter()

double CSG_Projection::Get_Unit_To_Meter ( void ) const
inline

Definition at line 899 of file geo_tools.h.

◆ Get_WKT()

const CSG_String& CSG_Projection::Get_WKT ( void ) const
inline

Definition at line 879 of file geo_tools.h.

Referenced by CSG_Grid_File_Info::Save_AUX_XML().

◆ is_Equal()

bool CSG_Projection::is_Equal ( const CSG_Projection & Projection ) const

Definition at line 557 of file projections.cpp.

References CSG_MetaData::Add_Child(), CSG_String::Cmp(), CSG_MetaData::Cmp_Content(), CSG_String::CmpNoCase(), CSG_MetaData::Get_Children_Count(), CSG_Strings::Get_Count(), GET_DATUM, CSG_MetaData::Get_Name(), CSG_String::is_Empty(), is_Okay(), CSG_String::Make_Lower(), SG_String_Tokenize(), and CSG_String::Trim_Both().

◆ is_Geocentric()

bool CSG_Projection::is_Geocentric ( void ) const
inline

Definition at line 893 of file geo_tools.h.

References SG_PROJ_TYPE_CS_Geocentric.

◆ is_Geographic()

bool CSG_Projection::is_Geographic ( void ) const
inline

Definition at line 892 of file geo_tools.h.

References SG_PROJ_TYPE_CS_Geographic.

◆ is_Okay()

bool CSG_Projection::is_Okay ( void ) const
inline

Definition at line 861 of file geo_tools.h.

References SG_PROJ_TYPE_CS_Undefined.

Referenced by CSG_Grids::Add_Grid(), CSG_Grid::Assign(), Get_Description(), CSG_Tool::Get_Projection(), is_Equal(), Save(), CSG_Grid_File_Info::Save_AUX_XML(), SG_Get_Projected(), and SG_Grid_Get_Geographic_Coordinates().

◆ is_Projection()

bool CSG_Projection::is_Projection ( void ) const
inline

Definition at line 891 of file geo_tools.h.

References SG_PROJ_TYPE_CS_Projected.

◆ Load() [1/3]

bool CSG_Projection::Load ( const CSG_MetaData & Projection )

Definition at line 462 of file projections.cpp.

References Assign(), CSG_MetaData::Get_Child(), CSG_MetaData::Get_Content(), and SG_PROJ_FMT_WKT.

◆ Load() [2/3]

bool CSG_Projection::Load | ( | const CSG_String & | FileName,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  |

Definition at line 413 of file projections.cpp.

References SG_FILE_R.

Referenced by CSG_Data_Object::Load_MetaData().

◆ Load() [3/3]

bool CSG_Projection::Load | ( | CSG_File & | Stream,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  |

Definition at line 429 of file projections.cpp.

References Assign(), CSG_File::is_Reading(), CSG_File::Length(), and CSG_File::Read().

◆ operator!=()

bool CSG_Projection::operator!= ( const CSG_Projection & Projection ) const
inline

Definition at line 864 of file geo_tools.h.

◆ operator=() [1/3]

CSG_Projection& CSG_Projection::operator= ( const CSG_Projection & Projection )
inline

Definition at line 845 of file geo_tools.h.

◆ operator=() [2/3]

CSG_Projection& CSG_Projection::operator= ( const CSG_String & Projection )
inline

Definition at line 855 of file geo_tools.h.

◆ operator=() [3/3]

CSG_Projection& CSG_Projection::operator= ( int Authority_ID )
inline

Definition at line 850 of file geo_tools.h.

◆ operator==()

bool CSG_Projection::operator== ( const CSG_Projection & Projection ) const
inline

Definition at line 863 of file geo_tools.h.

◆ Save() [1/3]

bool CSG_Projection::Save | ( | const CSG_String & | FileName,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  | const

Definition at line 421 of file projections.cpp.

References is_Okay(), and SG_FILE_W.

Referenced by CSG_PointCloud::Save(), and CSG_Data_Object::Save_MetaData().

◆ Save() [2/3]

bool CSG_Projection::Save | ( | CSG_File & | Stream,
 |  | TSG_Projection_Format | Format = SG_PROJ_FMT_WKT
 | ) |  | const

Definition at line 444 of file projections.cpp.

References is_Okay(), CSG_File::is_Writing(), CSG_String::Length(), SG_PROJ_FMT_Proj4, SG_PROJ_FMT_WKT, and CSG_File::Write().

◆ Save() [3/3]

bool CSG_Projection::Save ( CSG_MetaData & Projection ) const

Definition at line 482 of file projections.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Del_Children(), and Get_EPSG().

◆ Set_GCS_WGS84()

bool CSG_Projection::Set_GCS_WGS84 ( void )

Definition at line 509 of file projections.cpp.

References Create(), PROJ4_GCS_WGS84, and WKT_GCS_WGS84.

◆ Set_UTM_WGS84()

bool CSG_Projection::Set_UTM_WGS84 | ( | int | Zone,
 |  | bool | bSouth = false
 | ) |  |

Definition at line 515 of file projections.cpp.

References CSG_String::c_str(), Create(), CSG_String::Printf(), SG_T, and WKT_GCS_WGS84.

Referenced by CSG_Projections::Get_UTM_WGS84().

Friends And Related Function Documentation

◆ CSG_Projections

friend class CSG_Projections
friend

Definition at line 834 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • projections.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Projection Member List

This is the complete list of members for CSG_Projection, including all inherited members.

Assign(const CSG_Projection &Projection) | CSG_Projection |
Assign(int Authority_ID, const SG_Char *Authority=NULL) | CSG_Projection |
Assign(const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) | CSG_Projection |
Assign(const CSG_String &WKT, const CSG_String &Proj4) | CSG_Projection |
Create(const CSG_Projection &Projection) | CSG_Projection |
Create(int Authority_ID, const SG_Char *Authority=NULL) | CSG_Projection |
Create(const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) | CSG_Projection |
Create(const CSG_String &WKT, const CSG_String &Proj4) | CSG_Projection |
CSG_Projection(void) | CSG_Projection |
CSG_Projection(const CSG_Projection &Projection) | CSG_Projection |
CSG_Projection(int Authority_ID, const SG_Char *Authority=NULL) | CSG_Projection |
CSG_Projection(const CSG_String &Projection, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) | CSG_Projection |
CSG_Projection(const CSG_String &WKT, const CSG_String &Proj4) | CSG_Projection |
CSG_Projections class | CSG_Projection | friend
Destroy(void) | CSG_Projection |
Get_Authority(void) const | CSG_Projection | inline
Get_Authority_ID(void) const | CSG_Projection | inline
Get_Description(void) const | CSG_Projection |
Get_EPSG(void) const | CSG_Projection | inline
Get_Name(void) const | CSG_Projection | inline
Get_Proj4(void) const | CSG_Projection | inline
Get_Type(void) const | CSG_Projection | inline
Get_Type_Identifier(void) const | CSG_Projection | inline
Get_Type_Name(void) const | CSG_Projection | inline
Get_Unit(void) const | CSG_Projection | inline
Get_Unit_Identifier(void) const | CSG_Projection | inline
Get_Unit_Name(void) const | CSG_Projection | inline
Get_Unit_To_Meter(void) const | CSG_Projection | inline
Get_WKT(void) const | CSG_Projection | inline
is_Equal(const CSG_Projection &Projection) const | CSG_Projection |
is_Geocentric(void) const | CSG_Projection | inline
is_Geographic(void) const | CSG_Projection | inline
is_Okay(void) const | CSG_Projection | inline
is_Projection(void) const | CSG_Projection | inline
Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) | CSG_Projection |
Load(CSG_File &Stream, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) | CSG_Projection |
Load(const CSG_MetaData &Projection) | CSG_Projection |
operator!=(const CSG_Projection &Projection) const | CSG_Projection | inline
operator=(const CSG_Projection &Projection) | CSG_Projection | inline
operator=(int Authority_ID) | CSG_Projection | inline
operator=(const CSG_String &Projection) | CSG_Projection | inline
operator==(const CSG_Projection &Projection) const | CSG_Projection | inline
Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const | CSG_Projection |
Save(CSG_File &Stream, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const | CSG_Projection |
Save(CSG_MetaData &Projection) const | CSG_Projection |
Set_GCS_WGS84(void) | CSG_Projection |
Set_UTM_WGS84(int Zone, bool bSouth=false) | CSG_Projection |
~CSG_Projection(void) | CSG_Projection | virtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Projections Class Reference

Public Member Functions | Static Public Member Functions | Friends | List of all members
CSG_Projections Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Projections (void)
virtual | ~CSG_Projections (void)
CSG_Projections (bool bLoad_DB)
bool | Create (bool bLoad_DB=true)
CSG_Projections (const CSG_String &File_DB)
bool | Create (const CSG_String &File_DB)
void | Destroy (void)
bool | Reset_Dictionary (void)
bool | Load_Dictionary (const CSG_String &FileName)
bool | Save_Dictionary (const CSG_String &FileName)
bool | Load_DB (const CSG_String &FileName, bool bAppend=false)
bool | Save_DB (const CSG_String &FileName)
sLong | Get_Count (void) const
bool | Add (const CSG_Projection &Projection)
bool | Add (const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID)
CSG_Projection | Get_Projection (sLong Index) const
CSG_Projection | operator[] (sLong Index) const
bool | Get_Projection (CSG_Projection &Projection, int EPSG_ID) const
bool | Get_Projection (CSG_Projection &Projection, const CSG_String &Authority, int Authority_ID) const
CSG_String | Get_Names_List (TSG_Projection_Type Type=SG_PROJ_TYPE_CS_Undefined) const
bool | WKT_to_Proj4 (CSG_String &Proj4, const CSG_String &WKT) const
bool | WKT_from_Proj4 (CSG_String &WKT, const CSG_String &Proj4) const
bool | EPSG_to_Proj4 (CSG_String &Proj4, int EPSG_Code) const
bool | EPSG_to_WKT (CSG_String &WKT, int EPSG_Code) const

Static Public Member Functions

static CSG_MetaData | WKT_to_MetaData (const CSG_String &WKT)
static const CSG_Projection & | Get_GCS_WGS84 (void)
static CSG_Projection | Get_UTM_WGS84 (int Zone, bool bSouth=false)

Friends

class CSG_Projection

Detailed Description

CSG_Projections is a projections dictionary and translator for EPSG codes, OGC Well-Known-Text, and Proj.4.

Definition at line 927 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Projections() [1/3]

CSG_Projections::CSG_Projections ( void )

Definition at line 708 of file projections.cpp.

◆ ~CSG_Projections()

CSG_Projections::~CSG_Projections ( void )
virtual

Definition at line 778 of file projections.cpp.

References Destroy().

◆ CSG_Projections() [2/3]

CSG_Projections::CSG_Projections ( bool bLoad_DB )

Definition at line 714 of file projections.cpp.

References Create().

◆ CSG_Projections() [3/3]

CSG_Projections::CSG_Projections ( const CSG_String & File_DB )

Definition at line 745 of file projections.cpp.

References Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Projections::Add ( const CSG_Projection & Projection )

Definition at line 928 of file projections.cpp.

◆ Add() [2/2]

bool CSG_Projections::Add | ( | const SG_Char * | WKT,
 |  | const SG_Char * | Proj4,
 |  | const SG_Char * | Authority,
 |  | int | Authority_ID
 | ) |  |

Definition at line 934 of file projections.cpp.

References CSG_Table::Add_Record(), CSG_Table::Get_Count(), PRJ_FIELD_AUTH_NAME, PRJ_FIELD_AUTH_SRID, PRJ_FIELD_PROJ4TEXT, PRJ_FIELD_SRID, PRJ_FIELD_SRTEXT, and CSG_Table_Record::Set_Value().

◆ Create() [1/2]

bool CSG_Projections::Create ( bool bLoad_DB = true )

Definition at line 721 of file projections.cpp.

References Destroy(), Load_DB(), Load_Dictionary(), SG_File_Make_Path(), SG_UI_Get_Application_Path(), and SG_UI_Msg_Lock().

Referenced by CSG_Projections().

◆ Create() [2/2]

bool CSG_Projections::Create ( const CSG_String & File_DB )

Definition at line 752 of file projections.cpp.

References Load_DB(), and SG_UI_Msg_Lock().

◆ Destroy()

void CSG_Projections::Destroy ( void )

Definition at line 786 of file projections.cpp.

References CSG_Table::Del_Records(), and Reset_Dictionary().

Referenced by Create(), and ~CSG_Projections().

◆ EPSG_to_Proj4()

bool CSG_Projections::EPSG_to_Proj4 | ( | CSG_String & | Proj4,
 |  | int | EPSG_Code
 | ) |  | const

Definition at line 1005 of file projections.cpp.

References CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_Table::Get_Count(), CSG_Table::Get_Record(), CSG_String::Printf(), PRJ_FIELD_AUTH_SRID, and PRJ_FIELD_PROJ4TEXT.

Referenced by WKT_to_Proj4().

◆ EPSG_to_WKT()

bool CSG_Projections::EPSG_to_WKT | ( | CSG_String & | WKT,
 |  | int | EPSG_Code
 | ) |  | const

Definition at line 1023 of file projections.cpp.

References CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_Table::Get_Count(), CSG_Table::Get_Record(), PRJ_FIELD_AUTH_SRID, and PRJ_FIELD_SRTEXT.

◆ Get_Count()

sLong CSG_Projections::Get_Count ( void ) const

Definition at line 922 of file projections.cpp.

References CSG_Table::Get_Count().

Referenced by Get_Names_List(), and Get_Projection().

◆ Get_GCS_WGS84()

const CSG_Projection & CSG_Projections::Get_GCS_WGS84 ( void )
static

Definition at line 899 of file projections.cpp.

References PROJ4_GCS_WGS84, and WKT_GCS_WGS84.

◆ Get_Names_List()

CSG_String CSG_Projections::Get_Names_List ( TSG_Projection_Type Type = SG_PROJ_TYPE_CS_Undefined ) const

Definition at line 1044 of file projections.cpp.

References CSG_String::AfterFirst(), CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_String::BeforeFirst(), CSG_String::c_str(), CSG_String::Cmp(), CSG_String::Format(), Get_Count(), CSG_Table::Get_Record(), PRJ_FIELD_SRID, PRJ_FIELD_SRTEXT, SG_Get_Projection_Type_Name(), SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, SG_PROJ_TYPE_CS_Projected, and SG_PROJ_TYPE_CS_Undefined.

◆ Get_Projection() [1/3]

bool CSG_Projections::Get_Projection | ( | CSG_Projection & | Projection,
 |  | const CSG_String & | Authority,
 |  | int | Authority_ID
 | ) |  | const

Definition at line 981 of file projections.cpp.

References CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_String::CmpNoCase(), CSG_Table::Get_Count(), Get_Projection(), CSG_Table::Get_Record(), CSG_String::is_Empty(), PRJ_FIELD_AUTH_NAME, and PRJ_FIELD_AUTH_SRID.

◆ Get_Projection() [2/3]

bool CSG_Projections::Get_Projection | ( | CSG_Projection & | Projection,
 |  | int | EPSG_ID
 | ) |  | const

Definition at line 976 of file projections.cpp.

References Get_Projection().

◆ Get_Projection() [3/3]

CSG_Projection CSG_Projections::Get_Projection ( sLong Index ) const

Definition at line 948 of file projections.cpp.

References CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_String::Cmp(), Get_Count(), CSG_MetaData::Get_Name(), CSG_MetaData::Get_Property(), CSG_Table::Get_Record(), PRJ_FIELD_AUTH_NAME, PRJ_FIELD_AUTH_SRID, PRJ_FIELD_PROJ4TEXT, PRJ_FIELD_SRTEXT, SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, SG_PROJ_TYPE_CS_Projected, SG_PROJ_TYPE_CS_Undefined, SG_Set_Projection_Unit(), and WKT_to_MetaData().

Referenced by CSG_Projection::Assign(), and Get_Projection().

◆ Get_UTM_WGS84()

CSG_Projection CSG_Projections::Get_UTM_WGS84 | ( | int | Zone,
 |  | bool | bSouth = false
 | ) |  |
static

Definition at line 907 of file projections.cpp.

References CSG_Projection::Set_UTM_WGS84().

◆ Load_DB()

bool CSG_Projections::Load_DB | ( | const CSG_String & | FileName,
 |  | bool | bAppend = false
 | ) |  |

Definition at line 860 of file projections.cpp.

References CSG_Table::Add_Record(), CSG_Table::Create(), CSG_Table::Del_Records(), CSG_Table::Get_Count(), CSG_Table::Get_Record_byIndex(), PRJ_FIELD_SRTEXT, CSG_Table::Set_Index(), SG_File_Exists(), SG_UI_Process_Set_Progress(), and TABLE_INDEX_Ascending.

Referenced by Create(), and SG_Initialize_Environment().

◆ Load_Dictionary()

bool CSG_Projections::Load_Dictionary ( const CSG_String & FileName )

Definition at line 811 of file projections.cpp.

References CSG_Translator::Create(), CSG_Table::Create(), CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Record(), SG_File_Exists(), SG_T, and WKT_to_Proj4().

Referenced by Create(), and SG_Initialize_Environment().

◆ operator[]()

CSG_Projection CSG_Projections::operator[] ( sLong Index ) const
inline

Definition at line 956 of file geo_tools.h.

◆ Reset_Dictionary()

bool CSG_Projections::Reset_Dictionary ( void )

Definition at line 802 of file projections.cpp.

Referenced by Destroy().

◆ Save_DB()

bool CSG_Projections::Save_DB ( const CSG_String & FileName )

Definition at line 888 of file projections.cpp.

References CSG_Table::Save().

◆ Save_Dictionary()

bool CSG_Projections::Save_Dictionary ( const CSG_String & FileName )

Definition at line 847 of file projections.cpp.

References CSG_Table::Save().

◆ WKT_from_Proj4()

bool CSG_Projections::WKT_from_Proj4 | ( | CSG_String & | WKT,
 |  | const CSG_String & | Proj4
 | ) |  | const

Definition at line 1735 of file projections.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::asDouble(), CSG_String::BeforeFirst(), CSG_String::c_str(), CSG_String::CmpNoCase(), CSG_String::Find(), CSG_String::Format(), CSG_Translator::Get_Translation(), SG_T, and SG_UI_Msg_Add_Error().

Referenced by CSG_Projection::Assign().

◆ WKT_to_MetaData()

CSG_MetaData CSG_Projections::WKT_to_MetaData ( const CSG_String & WKT )
static

Definition at line 1189 of file projections.cpp.

References CSG_MetaData::Destroy(), CSG_MetaData::Get_Child(), and CSG_MetaData::Get_Children_Count().

Referenced by CSG_Projection::Assign(), Get_Projection(), and WKT_to_Proj4().

◆ WKT_to_Proj4()

bool CSG_Projections::WKT_to_Proj4 | ( | CSG_String & | Proj4,
 |  | const CSG_String & | WKT
 | ) |  | const

Definition at line 1258 of file projections.cpp.

References _TL, CSG_String::Clear(), CSG_MetaData::Cmp_Name(), CSG_String::CmpNoCase(), EPSG_to_Proj4(), CSG_String::Format(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), CSG_MetaData::Get_Property(), CSG_Translator::Get_Translation(), SG_UI_Msg_Add_Error(), and WKT_to_MetaData().

Referenced by CSG_Projection::Assign(), and Load_Dictionary().

Friends And Related Function Documentation

◆ CSG_Projection

friend class CSG_Projection
friend

Definition at line 929 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • projections.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Projections Member List

This is the complete list of members for CSG_Projections, including all inherited members.

Add(const CSG_Projection &Projection) | CSG_Projections |
Add(const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID) | CSG_Projections |
Create(bool bLoad_DB=true) | CSG_Projections |
Create(const CSG_String &File_DB) | CSG_Projections |
CSG_Projection class | CSG_Projections | friend
CSG_Projections(void) | CSG_Projections |
CSG_Projections(bool bLoad_DB) | CSG_Projections |
CSG_Projections(const CSG_String &File_DB) | CSG_Projections |
Destroy(void) | CSG_Projections |
EPSG_to_Proj4(CSG_String &Proj4, int EPSG_Code) const | CSG_Projections |
EPSG_to_WKT(CSG_String &WKT, int EPSG_Code) const | CSG_Projections |
Get_Count(void) const | CSG_Projections |
Get_GCS_WGS84(void) | CSG_Projections | static
Get_Names_List(TSG_Projection_Type Type=SG_PROJ_TYPE_CS_Undefined) const | CSG_Projections |
Get_Projection(sLong Index) const | CSG_Projections |
Get_Projection(CSG_Projection &Projection, int EPSG_ID) const | CSG_Projections |
Get_Projection(CSG_Projection &Projection, const CSG_String &Authority, int Authority_ID) const | CSG_Projections |
Get_UTM_WGS84(int Zone, bool bSouth=false) | CSG_Projections | static
Load_DB(const CSG_String &FileName, bool bAppend=false) | CSG_Projections |
Load_Dictionary(const CSG_String &FileName) | CSG_Projections |
operator[](sLong Index) const | CSG_Projections | inline
Reset_Dictionary(void) | CSG_Projections |
Save_DB(const CSG_String &FileName) | CSG_Projections |
Save_Dictionary(const CSG_String &FileName) | CSG_Projections |
WKT_from_Proj4(CSG_String &WKT, const CSG_String &Proj4) const | CSG_Projections |
WKT_to_MetaData(const CSG_String &WKT) | CSG_Projections | static
WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) const | CSG_Projections |
~CSG_Projections(void) | CSG_Projections | virtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree Class Reference

Classes | Public Member Functions | List of all members
CSG_PRQuadTree Class Reference

#include <shapes.h>

Public Member Functions

CSG_PRQuadTree (void)
virtual | ~CSG_PRQuadTree (void)
CSG_PRQuadTree (const TSG_Rect &Extent, bool bStatistics=false)
bool | Create (const CSG_Rect &Extent, bool bStatistics=false)
CSG_PRQuadTree (CSG_Shapes *pShapes, int Attribute, bool bStatistics=false)
bool | Create (CSG_Shapes *pShapes, int Attribute, bool bStatistics=false)
void | Destroy (void)
bool | Add_Point (double x, double y, double z)
bool | Add_Point (const TSG_Point &p, double z)
size_t | Get_Point_Count (void) const
const CSG_PRQuadTree_Node & | Get_Root (void) const
CSG_PRQuadTree_Node * | Get_Root_Pointer (void) const
bool | is_Okay (void) const
bool | is_Polar (void) const
void | Set_Polar_Search (bool bOn)
CSG_PRQuadTree_Leaf * | Get_Nearest_Leaf (const TSG_Point &p, double &Distance) const
CSG_PRQuadTree_Leaf * | Get_Nearest_Leaf (double x, double y, double &Distance) const
bool | Get_Nearest_Point (const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const
bool | Get_Nearest_Point (double x, double y, TSG_Point &Point, double &Value, double &Distance) const
size_t | Get_Nearest_Points (CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1) const
size_t | Get_Nearest_Points (CSG_Points_3D &Points, double x, double y, size_t maxPoints, double Radius=0., int iQuadrant=-1) const
size_t | Select_Nearest_Points (const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1)
size_t | Select_Nearest_Points (double x, double y, size_t maxPoints, double Radius=0., int iQuadrant=-1)
size_t | Get_Selected_Count (void) const
CSG_PRQuadTree_Leaf * | Get_Selected_Leaf (size_t i) const
double | Get_Selected_Z (size_t i) const
double | Get_Selected_Distance (size_t i) const
bool | Get_Selected_Point (size_t i, double &x, double &y, double &z) const

Detailed Description

Definition at line 1106 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree() [1/3]

CSG_PRQuadTree::CSG_PRQuadTree ( void )

Definition at line 183 of file quadtree.cpp.

◆ ~CSG_PRQuadTree()

CSG_PRQuadTree::~CSG_PRQuadTree ( void )
virtual

Definition at line 211 of file quadtree.cpp.

References Destroy().

◆ CSG_PRQuadTree() [2/3]

CSG_PRQuadTree::CSG_PRQuadTree | ( | const TSG_Rect & | Extent,
 |  | bool | bStatistics = false
 | ) |  |

Definition at line 191 of file quadtree.cpp.

References Create().

◆ CSG_PRQuadTree() [3/3]

CSG_PRQuadTree::CSG_PRQuadTree | ( | CSG_Shapes * | pShapes,
 |  | int | Attribute,
 |  | bool | bStatistics = false
 | ) |  |

Definition at line 201 of file quadtree.cpp.

References Create().

Member Function Documentation

◆ Add_Point() [1/2]

bool CSG_PRQuadTree::Add_Point | ( | const TSG_Point & | p,
 |  | double | z
 | ) |  |

Definition at line 310 of file quadtree.cpp.

References Add_Point(), SSG_Point::x, and SSG_Point::y.

◆ Add_Point() [2/2]

bool CSG_PRQuadTree::Add_Point | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |

Definition at line 297 of file quadtree.cpp.

References CSG_PRQuadTree_Node::Add_Point().

Referenced by Add_Point(), and Create().

◆ Create() [1/2]

bool CSG_PRQuadTree::Create | ( | const CSG_Rect & | Extent,
 |  | bool | bStatistics = false
 | ) |  |

Definition at line 217 of file quadtree.cpp.

References Destroy(), CSG_Rect::Get_XCenter(), CSG_Rect::Get_XRange(), CSG_Rect::Get_YCenter(), and CSG_Rect::Get_YRange().

Referenced by Create(), and CSG_PRQuadTree().

◆ Create() [2/2]

bool CSG_PRQuadTree::Create | ( | CSG_Shapes * | pShapes,
 |  | int | Attribute,
 |  | bool | bStatistics = false
 | ) |  |

Definition at line 246 of file quadtree.cpp.

References Add_Point(), CSG_Table_Record::asDouble(), Create(), Destroy(), CSG_Table::Get_Count(), CSG_Shapes::Get_Extent(), CSG_Shape::Get_Part_Count(), CSG_Shape::Get_Point(), CSG_Shape::Get_Point_Count(), CSG_Shapes::Get_Shape(), CSG_Shapes::is_Valid(), and SG_UI_Process_Set_Progress().

◆ Destroy()

void CSG_PRQuadTree::Destroy ( void )

Definition at line 277 of file quadtree.cpp.

References CSG_Array::Destroy().

Referenced by Create(), and ~CSG_PRQuadTree().

◆ Get_Nearest_Leaf() [1/2]

CSG_PRQuadTree_Leaf * CSG_PRQuadTree::Get_Nearest_Leaf | ( | const TSG_Point & | p,
 |  | double & | Distance
 | ) |  | const

Definition at line 472 of file quadtree.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Nearest_Leaf() [2/2]

CSG_PRQuadTree_Leaf * CSG_PRQuadTree::Get_Nearest_Leaf | ( | double | x,
 |  | double | y,
 |  | double & | Distance
 | ) |  | const

Definition at line 477 of file quadtree.cpp.

◆ Get_Nearest_Point() [1/2]

bool CSG_PRQuadTree::Get_Nearest_Point | ( | const TSG_Point & | p,
 |  | TSG_Point & | Point,
 |  | double & | Value,
 |  | double & | Distance
 | ) |  | const

Definition at line 483 of file quadtree.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Nearest_Point() [2/2]

bool CSG_PRQuadTree::Get_Nearest_Point | ( | double | x,
 |  | double | y,
 |  | TSG_Point & | Point,
 |  | double & | Value,
 |  | double & | Distance
 | ) |  | const

Definition at line 488 of file quadtree.cpp.

References CSG_PRQuadTree_Leaf::Get_X(), CSG_PRQuadTree_Leaf::Get_Y(), CSG_PRQuadTree_Leaf::Get_Z(), SSG_Point::x, and SSG_Point::y.

◆ Get_Nearest_Points() [1/2]

size_t CSG_PRQuadTree::Get_Nearest_Points | ( | CSG_Points_3D & | Points,
 |  | const TSG_Point & | p,
 |  | size_t | maxPoints,
 |  | double | Radius = 0.,
 |  | int | iQuadrant = -1
 | ) |  | const

Definition at line 748 of file quadtree.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Nearest_Points() [2/2]

size_t CSG_PRQuadTree::Get_Nearest_Points | ( | CSG_Points_3D & | Points,
 |  | double | x,
 |  | double | y,
 |  | size_t | maxPoints,
 |  | double | Radius = 0.,
 |  | int | iQuadrant = -1
 | ) |  | const

Definition at line 754 of file quadtree.cpp.

References CSG_Points_3D::Add(), CSG_Points_3D::Clear(), CSG_Points_3D::Get_Count(), CSG_Array::Get_Size(), CSG_PRQuadTree_Leaf::Get_X(), CSG_PRQuadTree_Leaf::Get_Y(), and CSG_PRQuadTree_Leaf::Get_Z().

◆ Get_Point_Count()

size_t CSG_PRQuadTree::Get_Point_Count ( void ) const
inline

Definition at line 1123 of file shapes.h.

◆ Get_Root()

const CSG_PRQuadTree_Node& CSG_PRQuadTree::Get_Root ( void ) const
inline

Definition at line 1125 of file shapes.h.

◆ Get_Root_Pointer()

CSG_PRQuadTree_Node* CSG_PRQuadTree::Get_Root_Pointer ( void ) const
inline

Definition at line 1126 of file shapes.h.

◆ Get_Selected_Count()

size_t CSG_PRQuadTree::Get_Selected_Count ( void ) const
inline

Definition at line 1144 of file shapes.h.

◆ Get_Selected_Distance()

double CSG_PRQuadTree::Get_Selected_Distance ( size_t i ) const
inline

Definition at line 1147 of file shapes.h.

◆ Get_Selected_Leaf()

CSG_PRQuadTree_Leaf* CSG_PRQuadTree::Get_Selected_Leaf ( size_t i ) const
inline

Definition at line 1145 of file shapes.h.

◆ Get_Selected_Point()

bool CSG_PRQuadTree::Get_Selected_Point | ( | size_t | i,
 |  | double & | x,
 |  | double & | y,
 |  | double & | z
 | ) |  | const
 inline

Definition at line 1148 of file shapes.h.

References CSG_PRQuadTree_Leaf::Get_X(), CSG_PRQuadTree_Leaf::Get_Y(), and CSG_PRQuadTree_Leaf::Get_Z().

◆ Get_Selected_Z()

double CSG_PRQuadTree::Get_Selected_Z ( size_t i ) const
inline

Definition at line 1146 of file shapes.h.

◆ is_Okay()

bool CSG_PRQuadTree::is_Okay ( void ) const
inline

Definition at line 1128 of file shapes.h.

◆ is_Polar()

bool CSG_PRQuadTree::is_Polar ( void ) const
inline

Definition at line 1130 of file shapes.h.

◆ Select_Nearest_Points() [1/2]

size_t CSG_PRQuadTree::Select_Nearest_Points | ( | const TSG_Point & | p,
 |  | size_t | maxPoints,
 |  | double | Radius = 0.,
 |  | int | iQuadrant = -1
 | ) |  |

Definition at line 607 of file quadtree.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Select_Nearest_Points() [2/2]

size_t CSG_PRQuadTree::Select_Nearest_Points | ( | double | x,
 |  | double | y,
 |  | size_t | maxPoints,
 |  | double | Radius = 0.,
 |  | int | iQuadrant = -1
 | ) |  |

Definition at line 613 of file quadtree.cpp.

◆ Set_Polar_Search()

void CSG_PRQuadTree::Set_Polar_Search ( bool bOn )
inline

Definition at line 1131 of file shapes.h.

The documentation for this class was generated from the following files:
  • shapes.h
  • quadtree.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree Member List

This is the complete list of members for CSG_PRQuadTree, including all inherited members.

Add_Point(double x, double y, double z) | CSG_PRQuadTree |
Add_Point(const TSG_Point &p, double z) | CSG_PRQuadTree |
Create(const CSG_Rect &Extent, bool bStatistics=false) | CSG_PRQuadTree |
Create(CSG_Shapes *pShapes, int Attribute, bool bStatistics=false) | CSG_PRQuadTree |
CSG_PRQuadTree(void) | CSG_PRQuadTree |
CSG_PRQuadTree(const TSG_Rect &Extent, bool bStatistics=false) | CSG_PRQuadTree |
CSG_PRQuadTree(CSG_Shapes *pShapes, int Attribute, bool bStatistics=false) | CSG_PRQuadTree |
Destroy(void) | CSG_PRQuadTree |
Get_Nearest_Leaf(const TSG_Point &p, double &Distance) const | CSG_PRQuadTree |
Get_Nearest_Leaf(double x, double y, double &Distance) const | CSG_PRQuadTree |
Get_Nearest_Point(const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const | CSG_PRQuadTree |
Get_Nearest_Point(double x, double y, TSG_Point &Point, double &Value, double &Distance) const | CSG_PRQuadTree |
Get_Nearest_Points(CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1) const | CSG_PRQuadTree |
Get_Nearest_Points(CSG_Points_3D &Points, double x, double y, size_t maxPoints, double Radius=0., int iQuadrant=-1) const | CSG_PRQuadTree |
Get_Point_Count(void) const | CSG_PRQuadTree | inline
Get_Root(void) const | CSG_PRQuadTree | inline
Get_Root_Pointer(void) const | CSG_PRQuadTree | inline
Get_Selected_Count(void) const | CSG_PRQuadTree | inline
Get_Selected_Distance(size_t i) const | CSG_PRQuadTree | inline
Get_Selected_Leaf(size_t i) const | CSG_PRQuadTree | inline
Get_Selected_Point(size_t i, double &x, double &y, double &z) const | CSG_PRQuadTree | inline
Get_Selected_Z(size_t i) const | CSG_PRQuadTree | inline
is_Okay(void) const | CSG_PRQuadTree | inline
is_Polar(void) const | CSG_PRQuadTree | inline
Select_Nearest_Points(const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1) | CSG_PRQuadTree |
Select_Nearest_Points(double x, double y, size_t maxPoints, double Radius=0., int iQuadrant=-1) | CSG_PRQuadTree |
Set_Polar_Search(bool bOn) | CSG_PRQuadTree | inline
~CSG_PRQuadTree(void) | CSG_PRQuadTree | virtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree_Item Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_PRQuadTree_Item Class Reference

#include <shapes.h>

Inheritance diagram for CSG_PRQuadTree_Item:
CSG_PRQuadTree_Leaf CSG_PRQuadTree_Node CSG_PRQuadTree_Leaf_List CSG_PRQuadTree_Node_Statistics

Public Member Functions

virtual bool | is_Leaf (void) const
virtual bool | is_Node (void) const
virtual bool | has_Statistics (void) const
const CSG_Rect & | Get_Extent (void) const
double | Get_xMin (void) const
double | Get_xCenter (void) const
double | Get_xMax (void) const
double | Get_yMin (void) const
double | Get_yCenter (void) const
double | Get_yMax (void) const
double | Get_Size (void) const
bool | Contains (const CSG_Point &p) const
bool | Contains (double x, double y) const
class CSG_PRQuadTree_Leaf * | asLeaf (void) const
class CSG_PRQuadTree_Node * | asNode (void) const

Protected Member Functions

CSG_PRQuadTree_Item (const CSG_Rect &Extent, int Quadrant=-1)
virtual | ~CSG_PRQuadTree_Item (void)
void | Set_Extent (const CSG_Rect &Extent, int Quadrant=-1)
int | Get_Quadrant (const TSG_Point &p) const
int | Get_Quadrant (double x, double y) const

Protected Attributes

CSG_Rect m_Extent

Detailed Description

Definition at line 912 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree_Item()

CSG_PRQuadTree_Item::CSG_PRQuadTree_Item | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant = -1
 | ) |  |
inlineprotected

Definition at line 938 of file shapes.h.

References Set_Extent().

◆ ~CSG_PRQuadTree_Item()

virtual CSG_PRQuadTree_Item::~CSG_PRQuadTree_Item ( void )
inlineprotectedvirtual

Definition at line 940 of file shapes.h.

Member Function Documentation

◆ asLeaf()

class CSG_PRQuadTree_Leaf* CSG_PRQuadTree_Item::asLeaf ( void ) const
inline

Definition at line 932 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point().

◆ asNode()

class CSG_PRQuadTree_Node* CSG_PRQuadTree_Item::asNode ( void ) const
inline

Definition at line 933 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Get_Child().

◆ Contains() [1/2]

bool CSG_PRQuadTree_Item::Contains ( const CSG_Point & p ) const
inline

Definition at line 929 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point(), and CSG_PRQuadTree_Node::Get_Child().

◆ Contains() [2/2]

bool CSG_PRQuadTree_Item::Contains | ( | double | x,
 |  | double | y
 | ) |  | const
 inline

Definition at line 930 of file shapes.h.

◆ Get_Extent()

const CSG_Rect& CSG_PRQuadTree_Item::Get_Extent ( void ) const
inline

Definition at line 920 of file shapes.h.

◆ Get_Quadrant() [1/2]

int CSG_PRQuadTree_Item::Get_Quadrant ( const TSG_Point & p ) const
inlineprotected

Definition at line 954 of file shapes.h.

References Get_Quadrant(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_PRQuadTree_Node::Add_Point(), CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(), and Get_Quadrant().

◆ Get_Quadrant() [2/2]

int CSG_PRQuadTree_Item::Get_Quadrant | ( | double | x,
 |  | double | y
 | ) |  | const
 inlineprotected

Definition at line 956 of file shapes.h.

References Get_xCenter(), and Get_yCenter().

◆ Get_Size()

double CSG_PRQuadTree_Item::Get_Size ( void ) const
inline

Definition at line 927 of file shapes.h.

◆ Get_xCenter()

double CSG_PRQuadTree_Item::Get_xCenter ( void ) const
inline

Definition at line 922 of file shapes.h.

Referenced by Get_Quadrant().

◆ Get_xMax()

double CSG_PRQuadTree_Item::Get_xMax ( void ) const
inline

Definition at line 923 of file shapes.h.

◆ Get_xMin()

double CSG_PRQuadTree_Item::Get_xMin ( void ) const
inline

Definition at line 921 of file shapes.h.

◆ Get_yCenter()

double CSG_PRQuadTree_Item::Get_yCenter ( void ) const
inline

Definition at line 925 of file shapes.h.

Referenced by Get_Quadrant().

◆ Get_yMax()

double CSG_PRQuadTree_Item::Get_yMax ( void ) const
inline

Definition at line 926 of file shapes.h.

◆ Get_yMin()

double CSG_PRQuadTree_Item::Get_yMin ( void ) const
inline

Definition at line 924 of file shapes.h.

◆ has_Statistics()

virtual bool CSG_PRQuadTree_Item::has_Statistics ( void ) const
inlinevirtual

Reimplemented in CSG_PRQuadTree_Node_Statistics, and CSG_PRQuadTree_Leaf_List.

Definition at line 918 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point().

◆ is_Leaf()

virtual bool CSG_PRQuadTree_Item::is_Leaf ( void ) const
inlinevirtual

Reimplemented in CSG_PRQuadTree_Leaf.

Definition at line 916 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point(), and CSG_PRQuadTree_Node::~CSG_PRQuadTree_Node().

◆ is_Node()

virtual bool CSG_PRQuadTree_Item::is_Node ( void ) const
inlinevirtual

Reimplemented in CSG_PRQuadTree_Node.

Definition at line 917 of file shapes.h.

◆ Set_Extent()

void CSG_PRQuadTree_Item::Set_Extent | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant = -1
 | ) |  |
inlineprotected

Definition at line 942 of file shapes.h.

References CSG_Rect::Assign(), CSG_Rect::Get_XCenter(), CSG_Rect::Get_XMax(), CSG_Rect::Get_XMin(), CSG_Rect::Get_YCenter(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), and m_Extent.

Referenced by CSG_PRQuadTree_Item(), and CSG_PRQuadTree_Node::CSG_PRQuadTree_Node().

Member Data Documentation

◆ m_Extent

CSG_Rect CSG_PRQuadTree_Item::m_Extent
protected

Definition at line 962 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point(), CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(), and Set_Extent().

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree_Item Member List

This is the complete list of members for CSG_PRQuadTree_Item, including all inherited members.

asLeaf(void) const | CSG_PRQuadTree_Item | inline
asNode(void) const | CSG_PRQuadTree_Item | inline
Contains(const CSG_Point &p) const | CSG_PRQuadTree_Item | inline
Contains(double x, double y) const | CSG_PRQuadTree_Item | inline
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
Get_Extent(void) const | CSG_PRQuadTree_Item | inline
Get_Quadrant(const TSG_Point &p) const | CSG_PRQuadTree_Item | inlineprotected
Get_Quadrant(double x, double y) const | CSG_PRQuadTree_Item | inlineprotected
Get_Size(void) const | CSG_PRQuadTree_Item | inline
Get_xCenter(void) const | CSG_PRQuadTree_Item | inline
Get_xMax(void) const | CSG_PRQuadTree_Item | inline
Get_xMin(void) const | CSG_PRQuadTree_Item | inline
Get_yCenter(void) const | CSG_PRQuadTree_Item | inline
Get_yMax(void) const | CSG_PRQuadTree_Item | inline
Get_yMin(void) const | CSG_PRQuadTree_Item | inline
has_Statistics(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Leaf(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Node(void) const | CSG_PRQuadTree_Item | inlinevirtual
m_Extent | CSG_PRQuadTree_Item | protected
Set_Extent(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
~CSG_PRQuadTree_Item(void) | CSG_PRQuadTree_Item | inlineprotectedvirtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree_Leaf Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_PRQuadTree_Leaf Class Reference

#include <shapes.h>

Inheritance diagram for CSG_PRQuadTree_Leaf:
CSG_PRQuadTree_Item CSG_PRQuadTree_Leaf_List

Public Member Functions

virtual bool | is_Leaf (void) const
const TSG_Point & | Get_Point (void) const
double | Get_X (void) const
double | Get_Y (void) const
double | Get_Z (void) const
- Public Member Functions inherited from CSG_PRQuadTree_Item
virtual bool | is_Node (void) const
virtual bool | has_Statistics (void) const
const CSG_Rect & | Get_Extent (void) const
double | Get_xMin (void) const
double | Get_xCenter (void) const
double | Get_xMax (void) const
double | Get_yMin (void) const
double | Get_yCenter (void) const
double | Get_yMax (void) const
double | Get_Size (void) const
bool | Contains (const CSG_Point &p) const
bool | Contains (double x, double y) const
class CSG_PRQuadTree_Leaf * | asLeaf (void) const
class CSG_PRQuadTree_Node * | asNode (void) const

Protected Member Functions

CSG_PRQuadTree_Leaf (const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
virtual | ~CSG_PRQuadTree_Leaf (void)
- Protected Member Functions inherited from CSG_PRQuadTree_Item
CSG_PRQuadTree_Item (const CSG_Rect &Extent, int Quadrant=-1)
virtual | ~CSG_PRQuadTree_Item (void)
void | Set_Extent (const CSG_Rect &Extent, int Quadrant=-1)
int | Get_Quadrant (const TSG_Point &p) const
int | Get_Quadrant (double x, double y) const

Protected Attributes

double m_z
TSG_Point m_Point
- Protected Attributes inherited from CSG_PRQuadTree_Item
CSG_Rect m_Extent

Friends

class CSG_PRQuadTree_Node

Detailed Description

Definition at line 967 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree_Leaf()

CSG_PRQuadTree_Leaf::CSG_PRQuadTree_Leaf | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant,
 |  | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
inlineprotected

Definition at line 983 of file shapes.h.

◆ ~CSG_PRQuadTree_Leaf()

virtual CSG_PRQuadTree_Leaf::~CSG_PRQuadTree_Leaf ( void )
inlineprotectedvirtual

Definition at line 991 of file shapes.h.

Member Function Documentation

◆ Get_Point()

const TSG_Point& CSG_PRQuadTree_Leaf::Get_Point ( void ) const
inline

Definition at line 975 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::CSG_PRQuadTree_Node().

◆ Get_X()

double CSG_PRQuadTree_Leaf::Get_X ( void ) const
inline

Definition at line 976 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point(), CSG_PRQuadTree::Get_Nearest_Point(), CSG_PRQuadTree::Get_Nearest_Points(), and CSG_PRQuadTree::Get_Selected_Point().

◆ Get_Y()

double CSG_PRQuadTree_Leaf::Get_Y ( void ) const
inline

Definition at line 977 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point(), CSG_PRQuadTree::Get_Nearest_Point(), CSG_PRQuadTree::Get_Nearest_Points(), and CSG_PRQuadTree::Get_Selected_Point().

◆ Get_Z()

double CSG_PRQuadTree_Leaf::Get_Z ( void ) const
inline

Definition at line 978 of file shapes.h.

Referenced by CSG_PRQuadTree::Get_Nearest_Point(), CSG_PRQuadTree::Get_Nearest_Points(), and CSG_PRQuadTree::Get_Selected_Point().

◆ is_Leaf()

virtual bool CSG_PRQuadTree_Leaf::is_Leaf ( void ) const
inlinevirtual

Reimplemented from CSG_PRQuadTree_Item.

Definition at line 973 of file shapes.h.

Friends And Related Function Documentation

◆ CSG_PRQuadTree_Node

friend class CSG_PRQuadTree_Node
friend

Definition at line 969 of file shapes.h.

Member Data Documentation

◆ m_Point

TSG_Point CSG_PRQuadTree_Leaf::m_Point
protected

Definition at line 996 of file shapes.h.

◆ m_z

double CSG_PRQuadTree_Leaf::m_z
protected

Definition at line 994 of file shapes.h.

Referenced by CSG_PRQuadTree_Node::Add_Point().

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree_Leaf Member List

This is the complete list of members for CSG_PRQuadTree_Leaf, including all inherited members.

asLeaf(void) const | CSG_PRQuadTree_Item | inline
asNode(void) const | CSG_PRQuadTree_Item | inline
Contains(const CSG_Point &p) const | CSG_PRQuadTree_Item | inline
Contains(double x, double y) const | CSG_PRQuadTree_Item | inline
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z) | CSG_PRQuadTree_Leaf | inlineprotected
CSG_PRQuadTree_Node class | CSG_PRQuadTree_Leaf | friend
Get_Extent(void) const | CSG_PRQuadTree_Item | inline
Get_Point(void) const | CSG_PRQuadTree_Leaf | inline
Get_Quadrant(const TSG_Point &p) const | CSG_PRQuadTree_Item | inlineprotected
Get_Quadrant(double x, double y) const | CSG_PRQuadTree_Item | inlineprotected
Get_Size(void) const | CSG_PRQuadTree_Item | inline
Get_X(void) const | CSG_PRQuadTree_Leaf | inline
Get_xCenter(void) const | CSG_PRQuadTree_Item | inline
Get_xMax(void) const | CSG_PRQuadTree_Item | inline
Get_xMin(void) const | CSG_PRQuadTree_Item | inline
Get_Y(void) const | CSG_PRQuadTree_Leaf | inline
Get_yCenter(void) const | CSG_PRQuadTree_Item | inline
Get_yMax(void) const | CSG_PRQuadTree_Item | inline
Get_yMin(void) const | CSG_PRQuadTree_Item | inline
Get_Z(void) const | CSG_PRQuadTree_Leaf | inline
has_Statistics(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Leaf(void) const | CSG_PRQuadTree_Leaf | inlinevirtual
is_Node(void) const | CSG_PRQuadTree_Item | inlinevirtual
m_Extent | CSG_PRQuadTree_Item | protected
m_Point | CSG_PRQuadTree_Leaf | protected
m_z | CSG_PRQuadTree_Leaf | protected
Set_Extent(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
~CSG_PRQuadTree_Item(void) | CSG_PRQuadTree_Item | inlineprotectedvirtual
~CSG_PRQuadTree_Leaf(void) | CSG_PRQuadTree_Leaf | inlineprotectedvirtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree_Leaf_List Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_PRQuadTree_Leaf_List Class Reference

#include <shapes.h>

Inheritance diagram for CSG_PRQuadTree_Leaf_List:
CSG_PRQuadTree_Leaf CSG_PRQuadTree_Item

Public Member Functions

virtual bool | has_Statistics (void) const
sLong | Get_Count (void)
double | Get_Value (sLong i)
double | Get_Minimum (void)
double | Get_Maximum (void)
double | Get_Range (void)
double | Get_Sum (void)
double | Get_Mean (void)
double | Get_Variance (void)
double | Get_StdDev (void)
- Public Member Functions inherited from CSG_PRQuadTree_Leaf
virtual bool | is_Leaf (void) const
const TSG_Point & | Get_Point (void) const
double | Get_X (void) const
double | Get_Y (void) const
double | Get_Z (void) const
- Public Member Functions inherited from CSG_PRQuadTree_Item
virtual bool | is_Node (void) const
const CSG_Rect & | Get_Extent (void) const
double | Get_xMin (void) const
double | Get_xCenter (void) const
double | Get_xMax (void) const
double | Get_yMin (void) const
double | Get_yCenter (void) const
double | Get_yMax (void) const
double | Get_Size (void) const
bool | Contains (const CSG_Point &p) const
bool | Contains (double x, double y) const
class CSG_PRQuadTree_Leaf * | asLeaf (void) const
class CSG_PRQuadTree_Node * | asNode (void) const

Protected Member Functions

CSG_PRQuadTree_Leaf_List (const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
virtual | ~CSG_PRQuadTree_Leaf_List (void)
void | Add_Value (double z)
- Protected Member Functions inherited from CSG_PRQuadTree_Leaf
CSG_PRQuadTree_Leaf (const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
virtual | ~CSG_PRQuadTree_Leaf (void)
- Protected Member Functions inherited from CSG_PRQuadTree_Item
CSG_PRQuadTree_Item (const CSG_Rect &Extent, int Quadrant=-1)
virtual | ~CSG_PRQuadTree_Item (void)
void | Set_Extent (const CSG_Rect &Extent, int Quadrant=-1)
int | Get_Quadrant (const TSG_Point &p) const
int | Get_Quadrant (double x, double y) const

Protected Attributes

CSG_Simple_Statistics s_z
- Protected Attributes inherited from CSG_PRQuadTree_Leaf
double m_z
TSG_Point m_Point
- Protected Attributes inherited from CSG_PRQuadTree_Item
CSG_Rect m_Extent

Friends

class CSG_PRQuadTree_Node

Detailed Description

Definition at line 1001 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree_Leaf_List()

CSG_PRQuadTree_Leaf_List::CSG_PRQuadTree_Leaf_List | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant,
 |  | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
inlineprotected

Definition at line 1022 of file shapes.h.

◆ ~CSG_PRQuadTree_Leaf_List()

virtual CSG_PRQuadTree_Leaf_List::~CSG_PRQuadTree_Leaf_List ( void )
inlineprotectedvirtual

Definition at line 1030 of file shapes.h.

Member Function Documentation

◆ Add_Value()

void CSG_PRQuadTree_Leaf_List::Add_Value ( double z )
inlineprotected

Definition at line 1032 of file shapes.h.

◆ Get_Count()

sLong CSG_PRQuadTree_Leaf_List::Get_Count ( void )
inline

Definition at line 1009 of file shapes.h.

◆ Get_Maximum()

double CSG_PRQuadTree_Leaf_List::Get_Maximum ( void )
inline

Definition at line 1012 of file shapes.h.

◆ Get_Mean()

double CSG_PRQuadTree_Leaf_List::Get_Mean ( void )
inline

Definition at line 1015 of file shapes.h.

◆ Get_Minimum()

double CSG_PRQuadTree_Leaf_List::Get_Minimum ( void )
inline

Definition at line 1011 of file shapes.h.

◆ Get_Range()

double CSG_PRQuadTree_Leaf_List::Get_Range ( void )
inline

Definition at line 1013 of file shapes.h.

◆ Get_StdDev()

double CSG_PRQuadTree_Leaf_List::Get_StdDev ( void )
inline

Definition at line 1017 of file shapes.h.

◆ Get_Sum()

double CSG_PRQuadTree_Leaf_List::Get_Sum ( void )
inline

Definition at line 1014 of file shapes.h.

◆ Get_Value()

double CSG_PRQuadTree_Leaf_List::Get_Value ( sLong i )
inline

Definition at line 1010 of file shapes.h.

◆ Get_Variance()

double CSG_PRQuadTree_Leaf_List::Get_Variance ( void )
inline

Definition at line 1016 of file shapes.h.

◆ has_Statistics()

virtual bool CSG_PRQuadTree_Leaf_List::has_Statistics ( void ) const
inlinevirtual

Reimplemented from CSG_PRQuadTree_Item.

Definition at line 1007 of file shapes.h.

Friends And Related Function Documentation

◆ CSG_PRQuadTree_Node

friend class CSG_PRQuadTree_Node
friend

Definition at line 1003 of file shapes.h.

Member Data Documentation

◆ s_z

CSG_Simple_Statistics CSG_PRQuadTree_Leaf_List::s_z
protected

Definition at line 1039 of file shapes.h.

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree_Leaf_List Member List

This is the complete list of members for CSG_PRQuadTree_Leaf_List, including all inherited members.

Add_Value(double z) | CSG_PRQuadTree_Leaf_List | inlineprotected
asLeaf(void) const | CSG_PRQuadTree_Item | inline
asNode(void) const | CSG_PRQuadTree_Item | inline
Contains(const CSG_Point &p) const | CSG_PRQuadTree_Item | inline
Contains(double x, double y) const | CSG_PRQuadTree_Item | inline
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z) | CSG_PRQuadTree_Leaf | inlineprotected
CSG_PRQuadTree_Leaf_List(const CSG_Rect &Extent, int Quadrant, double x, double y, double z) | CSG_PRQuadTree_Leaf_List | inlineprotected
CSG_PRQuadTree_Node class | CSG_PRQuadTree_Leaf_List | friend
Get_Count(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Extent(void) const | CSG_PRQuadTree_Item | inline
Get_Maximum(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Mean(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Minimum(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Point(void) const | CSG_PRQuadTree_Leaf | inline
Get_Quadrant(const TSG_Point &p) const | CSG_PRQuadTree_Item | inlineprotected
Get_Quadrant(double x, double y) const | CSG_PRQuadTree_Item | inlineprotected
Get_Range(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Size(void) const | CSG_PRQuadTree_Item | inline
Get_StdDev(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Sum(void) | CSG_PRQuadTree_Leaf_List | inline
Get_Value(sLong i) | CSG_PRQuadTree_Leaf_List | inline
Get_Variance(void) | CSG_PRQuadTree_Leaf_List | inline
Get_X(void) const | CSG_PRQuadTree_Leaf | inline
Get_xCenter(void) const | CSG_PRQuadTree_Item | inline
Get_xMax(void) const | CSG_PRQuadTree_Item | inline
Get_xMin(void) const | CSG_PRQuadTree_Item | inline
Get_Y(void) const | CSG_PRQuadTree_Leaf | inline
Get_yCenter(void) const | CSG_PRQuadTree_Item | inline
Get_yMax(void) const | CSG_PRQuadTree_Item | inline
Get_yMin(void) const | CSG_PRQuadTree_Item | inline
Get_Z(void) const | CSG_PRQuadTree_Leaf | inline
has_Statistics(void) const | CSG_PRQuadTree_Leaf_List | inlinevirtual
is_Leaf(void) const | CSG_PRQuadTree_Leaf | inlinevirtual
is_Node(void) const | CSG_PRQuadTree_Item | inlinevirtual
m_Extent | CSG_PRQuadTree_Item | protected
m_Point | CSG_PRQuadTree_Leaf | protected
m_z | CSG_PRQuadTree_Leaf | protected
s_z | CSG_PRQuadTree_Leaf_List | protected
Set_Extent(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
~CSG_PRQuadTree_Item(void) | CSG_PRQuadTree_Item | inlineprotectedvirtual
~CSG_PRQuadTree_Leaf(void) | CSG_PRQuadTree_Leaf | inlineprotectedvirtual
~CSG_PRQuadTree_Leaf_List(void) | CSG_PRQuadTree_Leaf_List | inlineprotectedvirtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree_Node Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_PRQuadTree_Node Class Reference

#include <shapes.h>

Inheritance diagram for CSG_PRQuadTree_Node:
CSG_PRQuadTree_Item CSG_PRQuadTree_Node_Statistics

Public Member Functions

virtual bool | is_Node (void) const
CSG_PRQuadTree_Item * | Get_Child (int Quadrant) const
CSG_PRQuadTree_Item * | Get_Child (double x, double y)
bool | Add_Point (double x, double y, double z)
virtual CSG_Simple_Statistics * | Get_X (void)
virtual CSG_Simple_Statistics * | Get_Y (void)
virtual CSG_Simple_Statistics * | Get_Z (void)
- Public Member Functions inherited from CSG_PRQuadTree_Item
virtual bool | is_Leaf (void) const
virtual bool | has_Statistics (void) const
const CSG_Rect & | Get_Extent (void) const
double | Get_xMin (void) const
double | Get_xCenter (void) const
double | Get_xMax (void) const
double | Get_yMin (void) const
double | Get_yCenter (void) const
double | Get_yMax (void) const
double | Get_Size (void) const
bool | Contains (const CSG_Point &p) const
bool | Contains (double x, double y) const
class CSG_PRQuadTree_Leaf * | asLeaf (void) const
class CSG_PRQuadTree_Node * | asNode (void) const

Protected Member Functions

CSG_PRQuadTree_Node (const CSG_Rect &Extent, int Quadrant=-1)
CSG_PRQuadTree_Node (CSG_PRQuadTree_Leaf *pLeaf)
virtual | ~CSG_PRQuadTree_Node (void)
- Protected Member Functions inherited from CSG_PRQuadTree_Item
CSG_PRQuadTree_Item (const CSG_Rect &Extent, int Quadrant=-1)
virtual | ~CSG_PRQuadTree_Item (void)
void | Set_Extent (const CSG_Rect &Extent, int Quadrant=-1)
int | Get_Quadrant (const TSG_Point &p) const
int | Get_Quadrant (double x, double y) const

Protected Attributes

CSG_PRQuadTree_Item * m_pChildren [4]
- Protected Attributes inherited from CSG_PRQuadTree_Item
CSG_Rect m_Extent

Friends

class CSG_PRQuadTree

Detailed Description

Definition at line 1044 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree_Node() [1/2]

CSG_PRQuadTree_Node::CSG_PRQuadTree_Node | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant = -1
 | ) |  |
protected

Definition at line 61 of file quadtree.cpp.

References m_pChildren.

Referenced by Add_Point().

◆ CSG_PRQuadTree_Node() [2/2]

CSG_PRQuadTree_Node::CSG_PRQuadTree_Node ( CSG_PRQuadTree_Leaf * pLeaf )
protected

Definition at line 68 of file quadtree.cpp.

References CSG_PRQuadTree_Leaf::Get_Point(), CSG_PRQuadTree_Item::Get_Quadrant(), CSG_PRQuadTree_Item::m_Extent, m_pChildren, and CSG_PRQuadTree_Item::Set_Extent().

◆ ~CSG_PRQuadTree_Node()

CSG_PRQuadTree_Node::~CSG_PRQuadTree_Node ( void )
protectedvirtual

Definition at line 81 of file quadtree.cpp.

References CSG_PRQuadTree_Item::is_Leaf(), and m_pChildren.

Member Function Documentation

◆ Add_Point()

bool CSG_PRQuadTree_Node::Add_Point | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |

Definition at line 114 of file quadtree.cpp.

References CSG_Simple_Statistics::Add_Value(), CSG_PRQuadTree_Item::asLeaf(), CSG_PRQuadTree_Item::Contains(), CSG_PRQuadTree_Node(), CSG_PRQuadTree_Item::Get_Quadrant(), Get_X(), CSG_PRQuadTree_Leaf::Get_X(), Get_Y(), CSG_PRQuadTree_Leaf::Get_Y(), Get_Z(), CSG_PRQuadTree_Item::has_Statistics(), CSG_PRQuadTree_Item::is_Leaf(), CSG_PRQuadTree_Item::m_Extent, m_pChildren, and CSG_PRQuadTree_Leaf::m_z.

Referenced by CSG_PRQuadTree::Add_Point().

◆ Get_Child() [1/2]

CSG_PRQuadTree_Item * CSG_PRQuadTree_Node::Get_Child | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 100 of file quadtree.cpp.

References CSG_PRQuadTree_Item::asNode(), CSG_PRQuadTree_Item::Contains(), Get_Child(), is_Node(), and m_pChildren.

◆ Get_Child() [2/2]

CSG_PRQuadTree_Item* CSG_PRQuadTree_Node::Get_Child ( int Quadrant ) const
inline

Definition at line 1052 of file shapes.h.

Referenced by Get_Child().

◆ Get_X()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node::Get_X ( void )
inlinevirtual

Reimplemented in CSG_PRQuadTree_Node_Statistics.

Definition at line 1057 of file shapes.h.

Referenced by Add_Point().

◆ Get_Y()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node::Get_Y ( void )
inlinevirtual

Reimplemented in CSG_PRQuadTree_Node_Statistics.

Definition at line 1058 of file shapes.h.

Referenced by Add_Point().

◆ Get_Z()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node::Get_Z ( void )
inlinevirtual

Reimplemented in CSG_PRQuadTree_Node_Statistics.

Definition at line 1059 of file shapes.h.

Referenced by Add_Point().

◆ is_Node()

virtual bool CSG_PRQuadTree_Node::is_Node ( void ) const
inlinevirtual

Reimplemented from CSG_PRQuadTree_Item.

Definition at line 1050 of file shapes.h.

Referenced by Get_Child().

Friends And Related Function Documentation

◆ CSG_PRQuadTree

friend class CSG_PRQuadTree
friend

Definition at line 1046 of file shapes.h.

Member Data Documentation

◆ m_pChildren

CSG_PRQuadTree_Item* CSG_PRQuadTree_Node::m_pChildren[4]
protected

Definition at line 1069 of file shapes.h.

Referenced by Add_Point(), CSG_PRQuadTree_Node(), Get_Child(), and ~CSG_PRQuadTree_Node().

The documentation for this class was generated from the following files:
  • shapes.h
  • quadtree.cpp
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree_Node Member List

This is the complete list of members for CSG_PRQuadTree_Node, including all inherited members.

Add_Point(double x, double y, double z) | CSG_PRQuadTree_Node |
asLeaf(void) const | CSG_PRQuadTree_Item | inline
asNode(void) const | CSG_PRQuadTree_Item | inline
Contains(const CSG_Point &p) const | CSG_PRQuadTree_Item | inline
Contains(double x, double y) const | CSG_PRQuadTree_Item | inline
CSG_PRQuadTree class | CSG_PRQuadTree_Node | friend
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Node | protected
CSG_PRQuadTree_Node(CSG_PRQuadTree_Leaf *pLeaf) | CSG_PRQuadTree_Node | protected
Get_Child(int Quadrant) const | CSG_PRQuadTree_Node | inline
Get_Child(double x, double y) | CSG_PRQuadTree_Node |
Get_Extent(void) const | CSG_PRQuadTree_Item | inline
Get_Quadrant(const TSG_Point &p) const | CSG_PRQuadTree_Item | inlineprotected
Get_Quadrant(double x, double y) const | CSG_PRQuadTree_Item | inlineprotected
Get_Size(void) const | CSG_PRQuadTree_Item | inline
Get_X(void) | CSG_PRQuadTree_Node | inlinevirtual
Get_xCenter(void) const | CSG_PRQuadTree_Item | inline
Get_xMax(void) const | CSG_PRQuadTree_Item | inline
Get_xMin(void) const | CSG_PRQuadTree_Item | inline
Get_Y(void) | CSG_PRQuadTree_Node | inlinevirtual
Get_yCenter(void) const | CSG_PRQuadTree_Item | inline
Get_yMax(void) const | CSG_PRQuadTree_Item | inline
Get_yMin(void) const | CSG_PRQuadTree_Item | inline
Get_Z(void) | CSG_PRQuadTree_Node | inlinevirtual
has_Statistics(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Leaf(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Node(void) const | CSG_PRQuadTree_Node | inlinevirtual
m_Extent | CSG_PRQuadTree_Item | protected
m_pChildren | CSG_PRQuadTree_Node | protected
Set_Extent(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
~CSG_PRQuadTree_Item(void) | CSG_PRQuadTree_Item | inlineprotectedvirtual
~CSG_PRQuadTree_Node(void) | CSG_PRQuadTree_Node | protectedvirtual
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: CSG_PRQuadTree_Node_Statistics Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_PRQuadTree_Node_Statistics Class Reference

#include <shapes.h>

Inheritance diagram for CSG_PRQuadTree_Node_Statistics:
CSG_PRQuadTree_Node CSG_PRQuadTree_Item

Public Member Functions

virtual bool | has_Statistics (void) const
virtual CSG_Simple_Statistics * | Get_X (void)
virtual CSG_Simple_Statistics * | Get_Y (void)
virtual CSG_Simple_Statistics * | Get_Z (void)
- Public Member Functions inherited from CSG_PRQuadTree_Node
virtual bool | is_Node (void) const
CSG_PRQuadTree_Item * | Get_Child (int Quadrant) const
CSG_PRQuadTree_Item * | Get_Child (double x, double y)
bool | Add_Point (double x, double y, double z)
- Public Member Functions inherited from CSG_PRQuadTree_Item
virtual bool | is_Leaf (void) const
const CSG_Rect & | Get_Extent (void) const
double | Get_xMin (void) const
double | Get_xCenter (void) const
double | Get_xMax (void) const
double | Get_yMin (void) const
double | Get_yCenter (void) const
double | Get_yMax (void) const
double | Get_Size (void) const
bool | Contains (const CSG_Point &p) const
bool | Contains (double x, double y) const
class CSG_PRQuadTree_Leaf * | asLeaf (void) const
class CSG_PRQuadTree_Node * | asNode (void) const

Protected Member Functions

CSG_PRQuadTree_Node_Statistics (const CSG_Rect &Extent, int Quadrant=-1)
CSG_PRQuadTree_Node_Statistics (CSG_PRQuadTree_Leaf *pLeaf)
virtual | ~CSG_PRQuadTree_Node_Statistics (void)
- Protected Member Functions inherited from CSG_PRQuadTree_Node
CSG_PRQuadTree_Node (const CSG_Rect &Extent, int Quadrant=-1)
CSG_PRQuadTree_Node (CSG_PRQuadTree_Leaf *pLeaf)
virtual | ~CSG_PRQuadTree_Node (void)
- Protected Member Functions inherited from CSG_PRQuadTree_Item
CSG_PRQuadTree_Item (const CSG_Rect &Extent, int Quadrant=-1)
virtual | ~CSG_PRQuadTree_Item (void)
void | Set_Extent (const CSG_Rect &Extent, int Quadrant=-1)
int | Get_Quadrant (const TSG_Point &p) const
int | Get_Quadrant (double x, double y) const

Protected Attributes

CSG_Simple_Statistics m_x
CSG_Simple_Statistics m_y
CSG_Simple_Statistics m_z
- Protected Attributes inherited from CSG_PRQuadTree_Node
CSG_PRQuadTree_Item * m_pChildren [4]
- Protected Attributes inherited from CSG_PRQuadTree_Item
CSG_Rect m_Extent

Friends

class | CSG_PRQuadTree
class | CSG_PRQuadTree_Node

Detailed Description

Definition at line 1074 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_PRQuadTree_Node_Statistics() [1/2]

CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics | ( | const CSG_Rect & | Extent,
 |  | int | Quadrant = -1
 | ) |  |
inlineprotected

Definition at line 1090 of file shapes.h.

◆ CSG_PRQuadTree_Node_Statistics() [2/2]

CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics ( CSG_PRQuadTree_Leaf * pLeaf )
inlineprotected

Definition at line 1094 of file shapes.h.

◆ ~CSG_PRQuadTree_Node_Statistics()

virtual CSG_PRQuadTree_Node_Statistics::~CSG_PRQuadTree_Node_Statistics ( void )
inlineprotectedvirtual

Definition at line 1098 of file shapes.h.

Member Function Documentation

◆ Get_X()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node_Statistics::Get_X ( void )
inlinevirtual

Reimplemented from CSG_PRQuadTree_Node.

Definition at line 1083 of file shapes.h.

◆ Get_Y()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node_Statistics::Get_Y ( void )
inlinevirtual

Reimplemented from CSG_PRQuadTree_Node.

Definition at line 1084 of file shapes.h.

◆ Get_Z()

virtual CSG_Simple_Statistics* CSG_PRQuadTree_Node_Statistics::Get_Z ( void )
inlinevirtual

Reimplemented from CSG_PRQuadTree_Node.

Definition at line 1085 of file shapes.h.

◆ has_Statistics()

virtual bool CSG_PRQuadTree_Node_Statistics::has_Statistics ( void ) const
inlinevirtual

Reimplemented from CSG_PRQuadTree_Item.

Definition at line 1081 of file shapes.h.

Friends And Related Function Documentation

◆ CSG_PRQuadTree

friend class CSG_PRQuadTree
friend

Definition at line 1076 of file shapes.h.

◆ CSG_PRQuadTree_Node

friend class CSG_PRQuadTree_Node
friend

Definition at line 1077 of file shapes.h.

Member Data Documentation

◆ m_x

CSG_Simple_Statistics CSG_PRQuadTree_Node_Statistics::m_x
protected

Definition at line 1101 of file shapes.h.

◆ m_y

CSG_Simple_Statistics CSG_PRQuadTree_Node_Statistics::m_y
protected

Definition at line 1101 of file shapes.h.

◆ m_z

CSG_Simple_Statistics CSG_PRQuadTree_Node_Statistics::m_z
protected

Definition at line 1101 of file shapes.h.

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:16 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_PRQuadTree_Node_Statistics Member List

This is the complete list of members for CSG_PRQuadTree_Node_Statistics, including all inherited members.

Add_Point(double x, double y, double z) | CSG_PRQuadTree_Node |
asLeaf(void) const | CSG_PRQuadTree_Item | inline
asNode(void) const | CSG_PRQuadTree_Item | inline
Contains(const CSG_Point &p) const | CSG_PRQuadTree_Item | inline
Contains(double x, double y) const | CSG_PRQuadTree_Item | inline
CSG_PRQuadTree class | CSG_PRQuadTree_Node_Statistics | friend
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
CSG_PRQuadTree_Node class | CSG_PRQuadTree_Node_Statistics | friend
CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Node | protected
CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(CSG_PRQuadTree_Leaf *pLeaf) | CSG_PRQuadTree_Node | protected
CSG_PRQuadTree_Node_Statistics(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Node_Statistics | inlineprotected
CSG_PRQuadTree_Node_Statistics(CSG_PRQuadTree_Leaf *pLeaf) | CSG_PRQuadTree_Node_Statistics | inlineprotected
Get_Child(int Quadrant) const | CSG_PRQuadTree_Node | inline
Get_Child(double x, double y) | CSG_PRQuadTree_Node |
Get_Extent(void) const | CSG_PRQuadTree_Item | inline
Get_Quadrant(const TSG_Point &p) const | CSG_PRQuadTree_Item | inlineprotected
Get_Quadrant(double x, double y) const | CSG_PRQuadTree_Item | inlineprotected
Get_Size(void) const | CSG_PRQuadTree_Item | inline
Get_X(void) | CSG_PRQuadTree_Node_Statistics | inlinevirtual
Get_xCenter(void) const | CSG_PRQuadTree_Item | inline
Get_xMax(void) const | CSG_PRQuadTree_Item | inline
Get_xMin(void) const | CSG_PRQuadTree_Item | inline
Get_Y(void) | CSG_PRQuadTree_Node_Statistics | inlinevirtual
Get_yCenter(void) const | CSG_PRQuadTree_Item | inline
Get_yMax(void) const | CSG_PRQuadTree_Item | inline
Get_yMin(void) const | CSG_PRQuadTree_Item | inline
Get_Z(void) | CSG_PRQuadTree_Node_Statistics | inlinevirtual
has_Statistics(void) const | CSG_PRQuadTree_Node_Statistics | inlinevirtual
is_Leaf(void) const | CSG_PRQuadTree_Item | inlinevirtual
is_Node(void) const | CSG_PRQuadTree_Node | inlinevirtual
m_Extent | CSG_PRQuadTree_Item | protected
m_pChildren | CSG_PRQuadTree_Node | protected
m_x | CSG_PRQuadTree_Node_Statistics | protected
m_y | CSG_PRQuadTree_Node_Statistics | protected
m_z | CSG_PRQuadTree_Node_Statistics | protected
Set_Extent(const CSG_Rect &Extent, int Quadrant=-1) | CSG_PRQuadTree_Item | inlineprotected
~CSG_PRQuadTree_Item(void) | CSG_PRQuadTree_Item | inlineprotectedvirtual
~CSG_PRQuadTree_Node(void) | CSG_PRQuadTree_Node | protectedvirtual
~CSG_PRQuadTree_Node_Statistics(void) | CSG_PRQuadTree_Node_Statistics | inlineprotectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Random Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Random Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Random (void)

Static Public Member Functions

static void | Initialize (void)
static void | Initialize (unsigned int Value)
static double | Get_Uniform (void)
static double | Get_Uniform (double min, double max)
static double | Get_Gaussian (double mean, double stddev)

Detailed Description

Definition at line 684 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Random()

CSG_Random::CSG_Random ( void )

Definition at line 254 of file mat_tools.cpp.

References Initialize().

Member Function Documentation

◆ Get_Gaussian()

double CSG_Random::Get_Gaussian | ( | double | mean,
 |  | double | stddev
 | ) |  |
static

Definition at line 298 of file mat_tools.cpp.

References Get_Uniform().

Referenced by f_rand_g().

◆ Get_Uniform() [1/2]

double CSG_Random::Get_Uniform | ( | double | min,
 |  | double | max
 | ) |  |
static

Definition at line 282 of file mat_tools.cpp.

◆ Get_Uniform() [2/2]

double CSG_Random::Get_Uniform ( void )
static

Definition at line 274 of file mat_tools.cpp.

Referenced by CSG_Cluster_Analysis::Execute(), f_rand_u(), Get_Gaussian(), and SG_Color_Get_Random().

◆ Initialize() [1/2]

void CSG_Random::Initialize ( unsigned int Value )
static

Definition at line 266 of file mat_tools.cpp.

◆ Initialize() [2/2]

void CSG_Random::Initialize ( void )
static

Definition at line 260 of file mat_tools.cpp.

Referenced by CSG_Random(), and CSG_Tool_Library_Manager::CSG_Tool_Library_Manager().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Random Member List

This is the complete list of members for CSG_Random, including all inherited members.

CSG_Random(void) | CSG_Random |
Get_Gaussian(double mean, double stddev) | CSG_Random | static
Get_Uniform(void) | CSG_Random | static
Get_Uniform(double min, double max) | CSG_Random | static
Initialize(void) | CSG_Random | static
Initialize(unsigned int Value) | CSG_Random | static
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Rect Class Reference

Public Member Functions | List of all members
CSG_Rect Class Reference

#include <geo_tools.h>

Inheritance diagram for CSG_Rect:
SSG_Rect

Public Member Functions

CSG_Rect (void)
CSG_Rect (const CSG_Rect &Rect)
CSG_Rect (const TSG_Rect &Rect)
CSG_Rect (const CSG_Point &A, const CSG_Point &B)
CSG_Rect (double xMin, double yMin, double xMax, double yMax)
~CSG_Rect (void)
bool | operator== (const CSG_Rect &Rect) const
bool | operator!= (const CSG_Rect &Rect) const
CSG_Rect & | operator= (const CSG_Rect &Rect)
void | operator+= (const CSG_Point &Point)
void | operator-= (const CSG_Point &Point)
void | Assign (double xMin, double yMin, double xMax, double yMax)
void | Assign (const CSG_Point &A, const CSG_Point &B)
void | Assign (const CSG_Rect &Rect)
void | Set_BottomLeft (double x, double y)
void | Set_BottomLeft (const CSG_Point &Point)
void | Set_TopRight (double x, double y)
void | Set_TopRight (const CSG_Point &Point)
bool | is_Equal (double xMin, double yMin, double xMax, double yMax, double epsilon=0.) const
bool | is_Equal (const CSG_Rect &Rect, double epsilon=0.) const
double | Get_XMin (void) const
double | Get_XMax (void) const
double | Get_YMin (void) const
double | Get_YMax (void) const
double | Get_XRange (void) const
double | Get_YRange (void) const
double | Get_Area (void) const
double | Get_Diameter (void) const
CSG_Point | Get_TopLeft (void) const
CSG_Point | Get_BottomRight (void) const
CSG_Point | Get_Center (void) const
double | Get_XCenter (void) const
double | Get_YCenter (void) const
void | Move (double dx, double dy)
void | Move (const CSG_Point &Point)
void | Inflate (double d, bool bPercent=true)
void | Deflate (double d, bool bPercent=true)
void | Inflate (double dx, double dy, bool bPercent=true)
void | Deflate (double dx, double dy, bool bPercent=true)
void | Union (double x, double y)
void | Union (const CSG_Point &Point)
void | Union (const CSG_Rect &Rect)
bool | Intersect (const CSG_Rect &Rect)
TSG_Intersection | Intersects (const CSG_Rect &Rect) const
bool | Contains (double x, double y) const
bool | Contains (const CSG_Point &Point) const

Additional Inherited Members

- Public Attributes inherited from SSG_Rect
double | xMin
double | yMin
double | xMax
double | yMax

Detailed Description

Definition at line 470 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Rect() [1/5]

CSG_Rect::CSG_Rect ( void )

Definition at line 663 of file geo_classes.cpp.

References Assign().

◆ CSG_Rect() [2/5]

CSG_Rect::CSG_Rect ( const CSG_Rect & Rect )

Definition at line 668 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ CSG_Rect() [3/5]

CSG_Rect::CSG_Rect ( const TSG_Rect & Rect )

Definition at line 673 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ CSG_Rect() [4/5]

CSG_Rect::CSG_Rect | ( | const CSG_Point & | A,
 |  | const CSG_Point & | B
 | ) |  |

Definition at line 678 of file geo_classes.cpp.

References A, Assign(), and B.

◆ CSG_Rect() [5/5]

CSG_Rect::CSG_Rect | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 683 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ ~CSG_Rect()

CSG_Rect::~CSG_Rect ( void )

Definition at line 689 of file geo_classes.cpp.

Member Function Documentation

◆ Assign() [1/3]

void CSG_Rect::Assign | ( | const CSG_Point & | A,
 |  | const CSG_Point & | B
 | ) |  |

Definition at line 746 of file geo_classes.cpp.

References A, Assign(), and B.

◆ Assign() [2/3]

void CSG_Rect::Assign ( const CSG_Rect & Rect )

Definition at line 751 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Assign() [3/3]

void CSG_Rect::Assign | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 721 of file geo_classes.cpp.

References SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by CSG_TIN::_Triangulate(), CSG_Shape_Part::_Update_Extent(), Assign(), CSG_Grid_System::Create(), CSG_Rect(), CSG_Shape_Point::Get_Extent(), CSG_PointCloud::Get_Selection_Extent(), CSG_Shapes::Get_Selection_Extent(), Inflate(), CSG_PointCloud::On_Update(), CSG_Shapes::On_Update(), operator=(), Set_BottomLeft(), CSG_PRQuadTree_Item::Set_Extent(), and Set_TopRight().

◆ Contains() [1/2]

bool CSG_Rect::Contains ( const CSG_Point & Point ) const

Definition at line 916 of file geo_classes.cpp.

References Contains(), SSG_Point::x, and SSG_Point::y.

◆ Contains() [2/2]

bool CSG_Rect::Contains | ( | double | x,
 |  | double | y
 | ) |  | const

Definition at line 911 of file geo_classes.cpp.

References SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by Contains(), CSG_PointCloud::Get_Shape(), CSG_Grid::Get_Value(), Intersects(), and CSG_TIN_Triangle::is_Containing().

◆ Deflate() [1/2]

void CSG_Rect::Deflate | ( | double | d,
 |  | bool | bPercent = true
 | ) |  |

Definition at line 826 of file geo_classes.cpp.

Referenced by CSG_Parameters_Grid_Target::Get_System().

◆ Deflate() [2/2]

void CSG_Rect::Deflate | ( | double | dx,
 |  | double | dy,
 |  | bool | bPercent = true
 | ) |  |

Definition at line 821 of file geo_classes.cpp.

References Inflate().

◆ Get_Area()

double CSG_Rect::Get_Area ( void ) const
inline

Definition at line 508 of file geo_tools.h.

Referenced by CSG_Parameters_Point_Search::On_Parameter_Changed(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_BottomRight()

CSG_Point CSG_Rect::Get_BottomRight ( void ) const
inline

Definition at line 512 of file geo_tools.h.

◆ Get_Center()

CSG_Point CSG_Rect::Get_Center ( void ) const
inline

Definition at line 514 of file geo_tools.h.

Referenced by CSG_Grid_System::Create().

◆ Get_Diameter()

double CSG_Rect::Get_Diameter ( void ) const
inline

Definition at line 509 of file geo_tools.h.

◆ Get_TopLeft()

CSG_Point CSG_Rect::Get_TopLeft ( void ) const
inline

Definition at line 511 of file geo_tools.h.

◆ Get_XCenter()

double CSG_Rect::Get_XCenter ( void ) const
inline

Definition at line 515 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_PRQuadTree::Create(), CSG_PRQuadTree_Item::Set_Extent(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_XMax()

double CSG_Rect::Get_XMax ( void ) const
inline

Definition at line 501 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), Intersect(), Intersects(), CSG_PRQuadTree_Item::Set_Extent(), CSG_Parameters_Grid_Target::Set_User_Defined(), and Union().

◆ Get_XMin()

double CSG_Rect::Get_XMin ( void ) const
inline

Definition at line 500 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid_System::Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), Intersect(), Intersects(), CSG_PRQuadTree_Item::Set_Extent(), CSG_Parameters_Grid_Target::Set_User_Defined(), and Union().

◆ Get_XRange()

double CSG_Rect::Get_XRange ( void ) const
inline

Definition at line 505 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_PRQuadTree::Create(), CSG_Grid_System::Create(), Inflate(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_YCenter()

double CSG_Rect::Get_YCenter ( void ) const
inline

Definition at line 516 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_PRQuadTree::Create(), CSG_PRQuadTree_Item::Set_Extent(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_YMax()

double CSG_Rect::Get_YMax ( void ) const
inline

Definition at line 503 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), Intersect(), Intersects(), CSG_TIN_Triangle::is_Containing(), CSG_PRQuadTree_Item::Set_Extent(), CSG_Parameters_Grid_Target::Set_User_Defined(), and Union().

◆ Get_YMin()

double CSG_Rect::Get_YMin ( void ) const
inline

Definition at line 502 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Grid_System::Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), Intersect(), Intersects(), CSG_TIN_Triangle::is_Containing(), CSG_PRQuadTree_Item::Set_Extent(), CSG_Parameters_Grid_Target::Set_User_Defined(), and Union().

◆ Get_YRange()

double CSG_Rect::Get_YRange ( void ) const
inline

Definition at line 506 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_PRQuadTree::Create(), CSG_Grid_System::Create(), Inflate(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Inflate() [1/2]

void CSG_Rect::Inflate | ( | double | d,
 |  | bool | bPercent = true
 | ) |  |

Definition at line 816 of file geo_classes.cpp.

Referenced by CSG_Grid_System::Create(), Deflate(), CSG_Parameters_Grid_Target::Set_User_Defined(), and SG_Shape_Get_Offset().

◆ Inflate() [2/2]

void CSG_Rect::Inflate | ( | double | dx,
 |  | double | dy,
 |  | bool | bPercent = true
 | ) |  |

Definition at line 802 of file geo_classes.cpp.

References Assign(), Get_XRange(), Get_YRange(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Intersect()

bool CSG_Rect::Intersect ( const CSG_Rect & Rect )

Definition at line 855 of file geo_classes.cpp.

References Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, Intersects(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Intersects()

TSG_Intersection CSG_Rect::Intersects ( const CSG_Rect & Rect ) const

Definition at line 882 of file geo_classes.cpp.

References Contains(), Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, is_Equal(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by CSG_PointCloud::Get_Shape(), CSG_Shapes::Get_Shape(), Intersect(), CSG_Shape::Intersects(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ is_Equal() [1/2]

bool CSG_Rect::is_Equal | ( | const CSG_Rect & | Rect,
 |  | double | epsilon = 0.
 | ) |  | const

Definition at line 784 of file geo_classes.cpp.

References is_Equal(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ is_Equal() [2/2]

bool CSG_Rect::is_Equal | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax,
 |  | double | epsilon = 0.
 | ) |  | const

Definition at line 778 of file geo_classes.cpp.

References SG_Is_Equal(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by Intersects(), is_Equal(), operator!=(), and operator==().

◆ Move() [1/2]

void CSG_Rect::Move ( const CSG_Point & Point )

Definition at line 796 of file geo_classes.cpp.

References Move(), SSG_Point::x, and SSG_Point::y.

◆ Move() [2/2]

void CSG_Rect::Move | ( | double | dx,
 |  | double | dy
 | ) |  |

Definition at line 790 of file geo_classes.cpp.

References SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by Move(), operator+=(), and operator-=().

◆ operator!=()

bool CSG_Rect::operator!= ( const CSG_Rect & Rect ) const

Definition at line 698 of file geo_classes.cpp.

References is_Equal().

◆ operator+=()

void CSG_Rect::operator+= ( const CSG_Point & Point )

Definition at line 710 of file geo_classes.cpp.

References Move(), SSG_Point::x, and SSG_Point::y.

◆ operator-=()

void CSG_Rect::operator-= ( const CSG_Point & Point )

Definition at line 715 of file geo_classes.cpp.

References Move(), and SSG_Point::y.

◆ operator=()

CSG_Rect & CSG_Rect::operator= ( const CSG_Rect & Rect )

Definition at line 703 of file geo_classes.cpp.

References Assign().

◆ operator==()

bool CSG_Rect::operator== ( const CSG_Rect & Rect ) const

Definition at line 693 of file geo_classes.cpp.

References is_Equal().

◆ Set_BottomLeft() [1/2]

void CSG_Rect::Set_BottomLeft ( const CSG_Point & Point )

Definition at line 762 of file geo_classes.cpp.

References Set_BottomLeft(), SSG_Point::x, and SSG_Point::y.

◆ Set_BottomLeft() [2/2]

void CSG_Rect::Set_BottomLeft | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 757 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMax, and SSG_Rect::yMax.

Referenced by Set_BottomLeft().

◆ Set_TopRight() [1/2]

void CSG_Rect::Set_TopRight ( const CSG_Point & Point )

Definition at line 772 of file geo_classes.cpp.

References Set_TopRight(), SSG_Point::x, and SSG_Point::y.

◆ Set_TopRight() [2/2]

void CSG_Rect::Set_TopRight | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 767 of file geo_classes.cpp.

References Assign(), SSG_Rect::xMin, and SSG_Rect::yMin.

Referenced by Set_TopRight().

◆ Union() [1/3]

void CSG_Rect::Union ( const CSG_Point & Point )

Definition at line 839 of file geo_classes.cpp.

References SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Union() [2/3]

void CSG_Rect::Union ( const CSG_Rect & Rect )

Definition at line 846 of file geo_classes.cpp.

References Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Union() [3/3]

void CSG_Rect::Union | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 832 of file geo_classes.cpp.

References SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by _SG_Polygon_Clip(), CSG_TIN::_Triangulate(), CSG_Shape_Points::_Update_Extent(), CSG_Shapes::Get_Selection_Extent(), and CSG_Shapes::On_Update().

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Rect Member List

This is the complete list of members for CSG_Rect, including all inherited members.

Assign(double xMin, double yMin, double xMax, double yMax) | CSG_Rect |
Assign(const CSG_Point &A, const CSG_Point &B) | CSG_Rect |
Assign(const CSG_Rect &Rect) | CSG_Rect |
Contains(double x, double y) const | CSG_Rect |
Contains(const CSG_Point &Point) const | CSG_Rect |
CSG_Rect(void) | CSG_Rect |
CSG_Rect(const CSG_Rect &Rect) | CSG_Rect |
CSG_Rect(const TSG_Rect &Rect) | CSG_Rect |
CSG_Rect(const CSG_Point &A, const CSG_Point &B) | CSG_Rect |
CSG_Rect(double xMin, double yMin, double xMax, double yMax) | CSG_Rect |
Deflate(double d, bool bPercent=true) | CSG_Rect |
Deflate(double dx, double dy, bool bPercent=true) | CSG_Rect |
Get_Area(void) const | CSG_Rect | inline
Get_BottomRight(void) const | CSG_Rect | inline
Get_Center(void) const | CSG_Rect | inline
Get_Diameter(void) const | CSG_Rect | inline
Get_TopLeft(void) const | CSG_Rect | inline
Get_XCenter(void) const | CSG_Rect | inline
Get_XMax(void) const | CSG_Rect | inline
Get_XMin(void) const | CSG_Rect | inline
Get_XRange(void) const | CSG_Rect | inline
Get_YCenter(void) const | CSG_Rect | inline
Get_YMax(void) const | CSG_Rect | inline
Get_YMin(void) const | CSG_Rect | inline
Get_YRange(void) const | CSG_Rect | inline
Inflate(double d, bool bPercent=true) | CSG_Rect |
Inflate(double dx, double dy, bool bPercent=true) | CSG_Rect |
Intersect(const CSG_Rect &Rect) | CSG_Rect |
Intersects(const CSG_Rect &Rect) const | CSG_Rect |
is_Equal(double xMin, double yMin, double xMax, double yMax, double epsilon=0.) const | CSG_Rect |
is_Equal(const CSG_Rect &Rect, double epsilon=0.) const | CSG_Rect |
Move(double dx, double dy) | CSG_Rect |
Move(const CSG_Point &Point) | CSG_Rect |
operator!=(const CSG_Rect &Rect) const | CSG_Rect |
operator+=(const CSG_Point &Point) | CSG_Rect |
operator-=(const CSG_Point &Point) | CSG_Rect |
operator=(const CSG_Rect &Rect) | CSG_Rect |
operator==(const CSG_Rect &Rect) const | CSG_Rect |
Set_BottomLeft(double x, double y) | CSG_Rect |
Set_BottomLeft(const CSG_Point &Point) | CSG_Rect |
Set_TopRight(double x, double y) | CSG_Rect |
Set_TopRight(const CSG_Point &Point) | CSG_Rect |
Union(double x, double y) | CSG_Rect |
Union(const CSG_Point &Point) | CSG_Rect |
Union(const CSG_Rect &Rect) | CSG_Rect |
xMax | SSG_Rect |
xMin | SSG_Rect |
yMax | SSG_Rect |
yMin | SSG_Rect |
~CSG_Rect(void) | CSG_Rect |
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Rect_Int Class Reference

Public Member Functions | List of all members
CSG_Rect_Int Class Reference

#include <geo_tools.h>

Inheritance diagram for CSG_Rect_Int:
SSG_Rect_Int

Public Member Functions

CSG_Rect_Int (void)
CSG_Rect_Int (const CSG_Rect_Int &Rect)
CSG_Rect_Int (const TSG_Rect_Int &Rect)
CSG_Rect_Int (const TSG_Point_Int &A, const TSG_Point_Int &B)
CSG_Rect_Int (int xMin, int yMin, int xMax, int yMax)
~CSG_Rect_Int (void)
bool | operator== (const CSG_Rect_Int &Rect) const
bool | operator!= (const CSG_Rect_Int &Rect) const
CSG_Rect_Int & | operator= (const CSG_Rect_Int &Rect)
void | operator+= (const TSG_Point_Int &Point)
void | operator-= (const TSG_Point_Int &Point)
void | Assign (int xMin, int yMin, int xMax, int yMax)
void | Assign (const TSG_Point_Int &A, const TSG_Point_Int &B)
void | Assign (const CSG_Rect_Int &Rect)
void | Set_BottomLeft (int x, int y)
void | Set_BottomLeft (const TSG_Point_Int &Point)
void | Set_TopRight (int x, int y)
void | Set_TopRight (const TSG_Point_Int &Point)
bool | is_Equal (int xMin, int yMin, int xMax, int yMax) const
bool | is_Equal (const CSG_Rect_Int &Rect) const
int | Get_XMin (void) const
int | Get_XMax (void) const
int | Get_YMin (void) const
int | Get_YMax (void) const
int | Get_XRange (void) const
int | Get_YRange (void) const
double | Get_Area (void) const
double | Get_Diameter (void) const
TSG_Point_Int | Get_TopLeft (void) const
TSG_Point_Int | Get_BottomRight (void) const
void | Move (int dx, int dy)
void | Move (const TSG_Point_Int &Point)
void | Inflate (int d)
void | Deflate (int d)
void | Inflate (int dx, int dy)
void | Deflate (int dx, int dy)
void | Union (int x, int y)
void | Union (const TSG_Point_Int &Point)
void | Union (const CSG_Rect_Int &Rect)
bool | Intersect (const CSG_Rect_Int &Rect)
TSG_Intersection | Intersects (const CSG_Rect_Int &Rect) const
bool | Contains (double x, double y) const
bool | Contains (const TSG_Point_Int &Point) const

Additional Inherited Members

- Public Attributes inherited from SSG_Rect_Int
int | xMin
int | yMin
int | xMax
int | yMax

Detailed Description

Definition at line 582 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Rect_Int() [1/5]

CSG_Rect_Int::CSG_Rect_Int ( void )

Definition at line 1014 of file geo_classes.cpp.

References Assign().

◆ CSG_Rect_Int() [2/5]

CSG_Rect_Int::CSG_Rect_Int ( const CSG_Rect_Int & Rect )

Definition at line 1019 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ CSG_Rect_Int() [3/5]

CSG_Rect_Int::CSG_Rect_Int ( const TSG_Rect_Int & Rect )

Definition at line 1024 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ CSG_Rect_Int() [4/5]

CSG_Rect_Int::CSG_Rect_Int | ( | const TSG_Point_Int & | A,
 |  | const TSG_Point_Int & | B
 | ) |  |

Definition at line 1029 of file geo_classes.cpp.

References A, Assign(), and B.

◆ CSG_Rect_Int() [5/5]

CSG_Rect_Int::CSG_Rect_Int | ( | int | xMin,
 |  | int | yMin,
 |  | int | xMax,
 |  | int | yMax
 | ) |  |

Definition at line 1034 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ ~CSG_Rect_Int()

CSG_Rect_Int::~CSG_Rect_Int ( void )

Definition at line 1040 of file geo_classes.cpp.

Member Function Documentation

◆ Assign() [1/3]

void CSG_Rect_Int::Assign ( const CSG_Rect_Int & Rect )

Definition at line 1102 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ Assign() [2/3]

void CSG_Rect_Int::Assign | ( | const TSG_Point_Int & | A,
 |  | const TSG_Point_Int & | B
 | ) |  |

Definition at line 1097 of file geo_classes.cpp.

References A, Assign(), and B.

◆ Assign() [3/3]

void CSG_Rect_Int::Assign | ( | int | xMin,
 |  | int | yMin,
 |  | int | xMax,
 |  | int | yMax
 | ) |  |

Definition at line 1072 of file geo_classes.cpp.

References SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

Referenced by Assign(), CSG_Rect_Int(), Inflate(), operator=(), Set_BottomLeft(), and Set_TopRight().

◆ Contains() [1/2]

bool CSG_Rect_Int::Contains ( const TSG_Point_Int & Point ) const

Definition at line 1258 of file geo_classes.cpp.

References Contains(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Contains() [2/2]

bool CSG_Rect_Int::Contains | ( | double | x,
 |  | double | y
 | ) |  | const

Definition at line 1253 of file geo_classes.cpp.

References SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

Referenced by Contains(), and Intersects().

◆ Deflate() [1/2]

void CSG_Rect_Int::Deflate ( int d )

Definition at line 1168 of file geo_classes.cpp.

◆ Deflate() [2/2]

void CSG_Rect_Int::Deflate | ( | int | dx,
 |  | int | dy
 | ) |  |

Definition at line 1163 of file geo_classes.cpp.

References Inflate().

◆ Get_Area()

double CSG_Rect_Int::Get_Area ( void ) const
inline

Definition at line 620 of file geo_tools.h.

◆ Get_BottomRight()

TSG_Point_Int CSG_Rect_Int::Get_BottomRight ( void ) const
inline

Definition at line 624 of file geo_tools.h.

References SSG_Point_Int::x, SSG_Rect_Int::xMax, SSG_Point_Int::y, and SSG_Rect_Int::yMin.

◆ Get_Diameter()

double CSG_Rect_Int::Get_Diameter ( void ) const
inline

Definition at line 621 of file geo_tools.h.

References SSG_Rect_Int::yMin.

◆ Get_TopLeft()

TSG_Point_Int CSG_Rect_Int::Get_TopLeft ( void ) const
inline

Definition at line 623 of file geo_tools.h.

References SSG_Point_Int::x, SSG_Rect_Int::xMin, SSG_Point_Int::y, and SSG_Rect_Int::yMax.

◆ Get_XMax()

int CSG_Rect_Int::Get_XMax ( void ) const
inline

Definition at line 613 of file geo_tools.h.

Referenced by Intersect(), Intersects(), and Union().

◆ Get_XMin()

int CSG_Rect_Int::Get_XMin ( void ) const
inline

Definition at line 612 of file geo_tools.h.

Referenced by Intersect(), Intersects(), and Union().

◆ Get_XRange()

int CSG_Rect_Int::Get_XRange ( void ) const
inline

Definition at line 617 of file geo_tools.h.

◆ Get_YMax()

int CSG_Rect_Int::Get_YMax ( void ) const
inline

Definition at line 615 of file geo_tools.h.

Referenced by Intersect(), Intersects(), and Union().

◆ Get_YMin()

int CSG_Rect_Int::Get_YMin ( void ) const
inline

Definition at line 614 of file geo_tools.h.

Referenced by Intersect(), Intersects(), and Union().

◆ Get_YRange()

int CSG_Rect_Int::Get_YRange ( void ) const
inline

Definition at line 618 of file geo_tools.h.

◆ Inflate() [1/2]

void CSG_Rect_Int::Inflate ( int d )

Definition at line 1158 of file geo_classes.cpp.

Referenced by Deflate().

◆ Inflate() [2/2]

void CSG_Rect_Int::Inflate | ( | int | dx,
 |  | int | dy
 | ) |  |

Definition at line 1153 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ Intersect()

bool CSG_Rect_Int::Intersect ( const CSG_Rect_Int & Rect )

Definition at line 1197 of file geo_classes.cpp.

References Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, Intersects(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ Intersects()

TSG_Intersection CSG_Rect_Int::Intersects ( const CSG_Rect_Int & Rect ) const

Definition at line 1224 of file geo_classes.cpp.

References Contains(), Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, is_Equal(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

Referenced by Intersect().

◆ is_Equal() [1/2]

bool CSG_Rect_Int::is_Equal ( const CSG_Rect_Int & Rect ) const

Definition at line 1135 of file geo_classes.cpp.

References is_Equal(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ is_Equal() [2/2]

bool CSG_Rect_Int::is_Equal | ( | int | xMin,
 |  | int | yMin,
 |  | int | xMax,
 |  | int | yMax
 | ) |  | const

Definition at line 1129 of file geo_classes.cpp.

References SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

Referenced by Intersects(), is_Equal(), operator!=(), and operator==().

◆ Move() [1/2]

void CSG_Rect_Int::Move ( const TSG_Point_Int & Point )

Definition at line 1147 of file geo_classes.cpp.

References Move(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Move() [2/2]

void CSG_Rect_Int::Move | ( | int | dx,
 |  | int | dy
 | ) |  |

Definition at line 1141 of file geo_classes.cpp.

References SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

Referenced by Move(), operator+=(), and operator-=().

◆ operator!=()

bool CSG_Rect_Int::operator!= ( const CSG_Rect_Int & Rect ) const

Definition at line 1049 of file geo_classes.cpp.

References is_Equal().

◆ operator+=()

void CSG_Rect_Int::operator+= ( const TSG_Point_Int & Point )

Definition at line 1061 of file geo_classes.cpp.

References Move(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ operator-=()

void CSG_Rect_Int::operator-= ( const TSG_Point_Int & Point )

Definition at line 1066 of file geo_classes.cpp.

References Move(), and SSG_Point_Int::y.

◆ operator=()

CSG_Rect_Int & CSG_Rect_Int::operator= ( const CSG_Rect_Int & Rect )

Definition at line 1054 of file geo_classes.cpp.

References Assign().

◆ operator==()

bool CSG_Rect_Int::operator== ( const CSG_Rect_Int & Rect ) const

Definition at line 1044 of file geo_classes.cpp.

References is_Equal().

◆ Set_BottomLeft() [1/2]

void CSG_Rect_Int::Set_BottomLeft ( const TSG_Point_Int & Point )

Definition at line 1113 of file geo_classes.cpp.

References Set_BottomLeft(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Set_BottomLeft() [2/2]

void CSG_Rect_Int::Set_BottomLeft | ( | int | x,
 |  | int | y
 | ) |  |

Definition at line 1108 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMax, and SSG_Rect_Int::yMax.

Referenced by Set_BottomLeft().

◆ Set_TopRight() [1/2]

void CSG_Rect_Int::Set_TopRight ( const TSG_Point_Int & Point )

Definition at line 1123 of file geo_classes.cpp.

References Set_TopRight(), SSG_Point_Int::x, and SSG_Point_Int::y.

◆ Set_TopRight() [2/2]

void CSG_Rect_Int::Set_TopRight | ( | int | x,
 |  | int | y
 | ) |  |

Definition at line 1118 of file geo_classes.cpp.

References Assign(), SSG_Rect_Int::xMin, and SSG_Rect_Int::yMin.

Referenced by Set_TopRight().

◆ Union() [1/3]

void CSG_Rect_Int::Union ( const CSG_Rect_Int & Rect )

Definition at line 1188 of file geo_classes.cpp.

References Get_XMax(), Get_XMin(), Get_YMax(), Get_YMin(), SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ Union() [2/3]

void CSG_Rect_Int::Union ( const TSG_Point_Int & Point )

Definition at line 1181 of file geo_classes.cpp.

References SSG_Point_Int::x, SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Point_Int::y, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

◆ Union() [3/3]

void CSG_Rect_Int::Union | ( | int | x,
 |  | int | y
 | ) |  |

Definition at line 1174 of file geo_classes.cpp.

References SSG_Rect_Int::xMax, SSG_Rect_Int::xMin, SSG_Rect_Int::yMax, and SSG_Rect_Int::yMin.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Rect_Int Member List

This is the complete list of members for CSG_Rect_Int, including all inherited members.

Assign(int xMin, int yMin, int xMax, int yMax) | CSG_Rect_Int |
Assign(const TSG_Point_Int &A, const TSG_Point_Int &B) | CSG_Rect_Int |
Assign(const CSG_Rect_Int &Rect) | CSG_Rect_Int |
Contains(double x, double y) const | CSG_Rect_Int |
Contains(const TSG_Point_Int &Point) const | CSG_Rect_Int |
CSG_Rect_Int(void) | CSG_Rect_Int |
CSG_Rect_Int(const CSG_Rect_Int &Rect) | CSG_Rect_Int |
CSG_Rect_Int(const TSG_Rect_Int &Rect) | CSG_Rect_Int |
CSG_Rect_Int(const TSG_Point_Int &A, const TSG_Point_Int &B) | CSG_Rect_Int |
CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax) | CSG_Rect_Int |
Deflate(int d) | CSG_Rect_Int |
Deflate(int dx, int dy) | CSG_Rect_Int |
Get_Area(void) const | CSG_Rect_Int | inline
Get_BottomRight(void) const | CSG_Rect_Int | inline
Get_Diameter(void) const | CSG_Rect_Int | inline
Get_TopLeft(void) const | CSG_Rect_Int | inline
Get_XMax(void) const | CSG_Rect_Int | inline
Get_XMin(void) const | CSG_Rect_Int | inline
Get_XRange(void) const | CSG_Rect_Int | inline
Get_YMax(void) const | CSG_Rect_Int | inline
Get_YMin(void) const | CSG_Rect_Int | inline
Get_YRange(void) const | CSG_Rect_Int | inline
Inflate(int d) | CSG_Rect_Int |
Inflate(int dx, int dy) | CSG_Rect_Int |
Intersect(const CSG_Rect_Int &Rect) | CSG_Rect_Int |
Intersects(const CSG_Rect_Int &Rect) const | CSG_Rect_Int |
is_Equal(int xMin, int yMin, int xMax, int yMax) const | CSG_Rect_Int |
is_Equal(const CSG_Rect_Int &Rect) const | CSG_Rect_Int |
Move(int dx, int dy) | CSG_Rect_Int |
Move(const TSG_Point_Int &Point) | CSG_Rect_Int |
operator!=(const CSG_Rect_Int &Rect) const | CSG_Rect_Int |
operator+=(const TSG_Point_Int &Point) | CSG_Rect_Int |
operator-=(const TSG_Point_Int &Point) | CSG_Rect_Int |
operator=(const CSG_Rect_Int &Rect) | CSG_Rect_Int |
operator==(const CSG_Rect_Int &Rect) const | CSG_Rect_Int |
Set_BottomLeft(int x, int y) | CSG_Rect_Int |
Set_BottomLeft(const TSG_Point_Int &Point) | CSG_Rect_Int |
Set_TopRight(int x, int y) | CSG_Rect_Int |
Set_TopRight(const TSG_Point_Int &Point) | CSG_Rect_Int |
Union(int x, int y) | CSG_Rect_Int |
Union(const TSG_Point_Int &Point) | CSG_Rect_Int |
Union(const CSG_Rect_Int &Rect) | CSG_Rect_Int |
xMax | SSG_Rect_Int |
xMin | SSG_Rect_Int |
yMax | SSG_Rect_Int |
yMin | SSG_Rect_Int |
~CSG_Rect_Int(void) | CSG_Rect_Int |
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Rects Class Reference

Public Member Functions | List of all members
CSG_Rects Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Rects (void)
CSG_Rects (const CSG_Rects &Rects)
virtual | ~CSG_Rects (void)
void | Clear (void)
CSG_Rects & | operator= (const CSG_Rects &Rects)
bool | Assign (const CSG_Rects &Rects)
bool | Add (void)
bool | Add (double xMin, double yMin, double xMax, double yMax)
bool | Add (const CSG_Rect &Rect)
int | Get_Count (void) const
CSG_Rect & | operator[] (int Index)
CSG_Rect & | Get_Rect (int Index)

Detailed Description

Definition at line 539 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Rects() [1/2]

CSG_Rects::CSG_Rects ( void )

Definition at line 927 of file geo_classes.cpp.

◆ CSG_Rects() [2/2]

CSG_Rects::CSG_Rects ( const CSG_Rects & Rects )

Definition at line 933 of file geo_classes.cpp.

References Assign().

◆ ~CSG_Rects()

CSG_Rects::~CSG_Rects ( void )
virtual

Definition at line 941 of file geo_classes.cpp.

References Clear().

Member Function Documentation

◆ Add() [1/3]

bool CSG_Rects::Add ( const CSG_Rect & Rect )

Definition at line 997 of file geo_classes.cpp.

References SG_Realloc().

◆ Add() [2/3]

bool CSG_Rects::Add | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax
 | ) |  |

Definition at line 991 of file geo_classes.cpp.

References Add().

◆ Add() [3/3]

bool CSG_Rects::Add ( void )

Definition at line 985 of file geo_classes.cpp.

Referenced by Add(), and Assign().

◆ Assign()

bool CSG_Rects::Assign ( const CSG_Rects & Rects )

Definition at line 964 of file geo_classes.cpp.

References Add(), and Clear().

Referenced by CSG_Rects(), and operator=().

◆ Clear()

void CSG_Rects::Clear ( void )

Definition at line 947 of file geo_classes.cpp.

References SG_Free().

Referenced by Assign(), and ~CSG_Rects().

◆ Get_Count()

int CSG_Rects::Get_Count ( void ) const
inline

Definition at line 555 of file geo_tools.h.

◆ Get_Rect()

CSG_Rect& CSG_Rects::Get_Rect ( int Index )
inline

Definition at line 558 of file geo_tools.h.

◆ operator=()

CSG_Rects & CSG_Rects::operator= ( const CSG_Rects & Rects )

Definition at line 977 of file geo_classes.cpp.

References Assign().

◆ operator[]()

CSG_Rect& CSG_Rects::operator[] ( int Index )
inline

Definition at line 557 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Rects Member List

This is the complete list of members for CSG_Rects, including all inherited members.

Add(void) | CSG_Rects |
Add(double xMin, double yMin, double xMax, double yMax) | CSG_Rects |
Add(const CSG_Rect &Rect) | CSG_Rects |
Assign(const CSG_Rects &Rects) | CSG_Rects |
Clear(void) | CSG_Rects |
CSG_Rects(void) | CSG_Rects |
CSG_Rects(const CSG_Rects &Rects) | CSG_Rects |
Get_Count(void) const | CSG_Rects | inline
Get_Rect(int Index) | CSG_Rects | inline
operator=(const CSG_Rects &Rects) | CSG_Rects |
operator[](int Index) | CSG_Rects | inline
~CSG_Rects(void) | CSG_Rects | virtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Rects_Int Class Reference

Public Member Functions | List of all members
CSG_Rects_Int Class Reference

#include <geo_tools.h>

Public Member Functions

CSG_Rects_Int (void)
virtual | ~CSG_Rects_Int (void)
void | Clear (void)
CSG_Rects_Int & | operator= (const CSG_Rects_Int &Rects)
bool | Assign (const CSG_Rects_Int &Rects)
bool | Add (void)
bool | Add (int xMin, int yMin, int xMax, int yMax)
bool | Add (const CSG_Rect_Int &Rect)
int | Get_Count (void) const
CSG_Rect_Int & | operator[] (int Index)
CSG_Rect_Int & | Get_Rect (int Index)

Detailed Description

Definition at line 647 of file geo_tools.h.

Constructor & Destructor Documentation

◆ CSG_Rects_Int()

CSG_Rects_Int::CSG_Rects_Int ( void )

Definition at line 1269 of file geo_classes.cpp.

◆ ~CSG_Rects_Int()

CSG_Rects_Int::~CSG_Rects_Int ( void )
virtual

Definition at line 1276 of file geo_classes.cpp.

References Clear().

Member Function Documentation

◆ Add() [1/3]

bool CSG_Rects_Int::Add ( const CSG_Rect_Int & Rect )

Definition at line 1332 of file geo_classes.cpp.

References SG_Realloc().

◆ Add() [2/3]

bool CSG_Rects_Int::Add | ( | int | xMin,
 |  | int | yMin,
 |  | int | xMax,
 |  | int | yMax
 | ) |  |

Definition at line 1326 of file geo_classes.cpp.

References Add().

◆ Add() [3/3]

bool CSG_Rects_Int::Add ( void )

Definition at line 1320 of file geo_classes.cpp.

Referenced by Add(), and Assign().

◆ Assign()

bool CSG_Rects_Int::Assign ( const CSG_Rects_Int & Rects )

Definition at line 1299 of file geo_classes.cpp.

References Add(), and Clear().

Referenced by operator=().

◆ Clear()

void CSG_Rects_Int::Clear ( void )

Definition at line 1282 of file geo_classes.cpp.

References SG_Free().

Referenced by Assign(), and ~CSG_Rects_Int().

◆ Get_Count()

int CSG_Rects_Int::Get_Count ( void ) const
inline

Definition at line 662 of file geo_tools.h.

◆ Get_Rect()

CSG_Rect_Int& CSG_Rects_Int::Get_Rect ( int Index )
inline

Definition at line 665 of file geo_tools.h.

◆ operator=()

CSG_Rects_Int & CSG_Rects_Int::operator= ( const CSG_Rects_Int & Rects )

Definition at line 1312 of file geo_classes.cpp.

References Assign().

◆ operator[]()

CSG_Rect_Int& CSG_Rects_Int::operator[] ( int Index )
inline

Definition at line 664 of file geo_tools.h.

The documentation for this class was generated from the following files:
  • geo_tools.h
  • geo_classes.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Rects_Int Member List

This is the complete list of members for CSG_Rects_Int, including all inherited members.

Add(void) | CSG_Rects_Int |
Add(int xMin, int yMin, int xMax, int yMax) | CSG_Rects_Int |
Add(const CSG_Rect_Int &Rect) | CSG_Rects_Int |
Assign(const CSG_Rects_Int &Rects) | CSG_Rects_Int |
Clear(void) | CSG_Rects_Int |
CSG_Rects_Int(void) | CSG_Rects_Int |
Get_Count(void) const | CSG_Rects_Int | inline
Get_Rect(int Index) | CSG_Rects_Int | inline
operator=(const CSG_Rects_Int &Rects) | CSG_Rects_Int |
operator[](int Index) | CSG_Rects_Int | inline
~CSG_Rects_Int(void) | CSG_Rects_Int | virtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Regression Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Regression Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Regression (void)
virtual | ~CSG_Regression (void)
void | Destroy (void)
bool | Set_Values (int nValues, double *x, double *y)
bool | Add_Values (double x, double y)
int | Get_Count (void) const
double | Get_xValue (int i) const
double | Get_yValue (int i) const
bool | Get_Values (int i, double &x, double &y) const
double | Get_xMin (void) const
double | Get_xMax (void) const
double | Get_xMean (void) const
double | Get_xVariance (void) const
double | Get_x (double y) const
double | Get_yMin (void) const
double | Get_yMax (void) const
double | Get_yMean (void) const
double | Get_yVariance (void) const
double | Get_y (double x) const
double | Get_Constant (void) const
double | Get_Coefficient (void) const
double | Get_R (void) const
double | Get_R2 (void) const
double | Get_R2_Adj (void) const
double | Get_P (void) const
double | Get_StdError (void) const
const SG_Char * | asString (void)
TSG_Regression_Type | Get_Type (void) const
bool | Calculate (TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false)
bool | Calculate (int nValues, double *x, double *y, TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false)

Protected Member Functions

double | _Y_Transform (double x)
double | _X_Transform (double y)

Protected Attributes

double | m_RConst
double | m_RCoeff
double | m_R
double | m_R2
double | m_R2_Adj
double | m_P
double | m_SE
double | m_xMin
double | m_xMax
double | m_xMean
double | m_xVar
double | m_yMin
double | m_yMax
double | m_yMean
double | m_yVar
CSG_Vector m_x
CSG_Vector m_y
TSG_Regression_Type m_Type

Detailed Description

Definition at line 1584 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Regression()

CSG_Regression::CSG_Regression ( void )

Definition at line 109 of file mat_regression.cpp.

References Destroy().

◆ ~CSG_Regression()

CSG_Regression::~CSG_Regression ( void )
virtual

Definition at line 115 of file mat_regression.cpp.

References Destroy().

Member Function Documentation

◆ _X_Transform()

double CSG_Regression::_X_Transform ( double y )
inlineprotected

Definition at line 293 of file mat_regression.cpp.

References M_ALMOST_ZERO, m_Type, REGRESSION_Log, REGRESSION_Pow, and REGRESSION_Rez_X.

Referenced by Calculate().

◆ _Y_Transform()

double CSG_Regression::_Y_Transform ( double x )
inlineprotected

Definition at line 274 of file mat_regression.cpp.

References M_ALMOST_ZERO, m_Type, REGRESSION_Exp, REGRESSION_Pow, and REGRESSION_Rez_Y.

Referenced by Calculate().

◆ Add_Values()

bool CSG_Regression::Add_Values | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 142 of file mat_regression.cpp.

References CSG_Vector::Add_Row(), m_x, and m_y.

◆ asString()

const SG_Char * CSG_Regression::asString ( void )

Definition at line 161 of file mat_regression.cpp.

References CSG_String::Clear(), CSG_String::Format(), Get_Count(), m_R, m_R2, m_RCoeff, m_RConst, m_Type, m_xMax, m_xMean, m_xMin, m_xVar, m_yMax, m_yMean, m_yMin, m_yVar, REGRESSION_Exp, REGRESSION_Linear, REGRESSION_Log, REGRESSION_Pow, REGRESSION_Rez_X, REGRESSION_Rez_Y, and SG_T.

◆ Calculate() [1/2]

bool CSG_Regression::Calculate | ( | int | nValues,
 |  | double * | x,
 |  | double * | y,
 |  | TSG_Regression_Type | Type = REGRESSION_Linear,
 |  | bool | bStdError = false
 | ) |  |

Definition at line 433 of file mat_regression.cpp.

References Calculate(), and Set_Values().

◆ Calculate() [2/2]

bool CSG_Regression::Calculate | ( | TSG_Regression_Type | Type = REGRESSION_Linear,
 |  | bool | bStdError = false
 | ) |  |

Definition at line 317 of file mat_regression.cpp.

References _X_Transform(), _Y_Transform(), CSG_Simple_Statistics::Create(), Get_Count(), CSG_Test_Distribution::Get_F_Tail_from_R2(), CSG_Simple_Statistics::Get_Maximum(), CSG_Simple_Statistics::Get_Mean(), CSG_Simple_Statistics::Get_Minimum(), CSG_Simple_Statistics::Get_Variance(), Get_y(), m_P, m_R, m_R2, m_R2_Adj, m_RCoeff, m_RConst, m_SE, m_Type, m_x, m_xMax, m_xMean, m_xMin, m_xVar, m_y, m_yMax, m_yMean, m_yMin, m_yVar, REGRESSION_Exp, REGRESSION_Log, REGRESSION_Pow, REGRESSION_Rez_X, REGRESSION_Rez_Y, and SG_Regression_Get_Adjusted_R2().

Referenced by Calculate().

◆ Destroy()

void CSG_Regression::Destroy ( void )

Definition at line 126 of file mat_regression.cpp.

References CSG_Vector::Destroy(), m_R2, m_Type, m_x, m_y, and REGRESSION_Linear.

Referenced by CSG_Regression(), Set_Values(), and ~CSG_Regression().

◆ Get_Coefficient()

double CSG_Regression::Get_Coefficient ( void ) const
inline

Definition at line 1625 of file mat_tools.h.

◆ Get_Constant()

double CSG_Regression::Get_Constant ( void ) const
inline

Definition at line 1624 of file mat_tools.h.

◆ Get_Count()

int CSG_Regression::Get_Count ( void ) const
inline

Definition at line 1595 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ Get_P()

double CSG_Regression::Get_P ( void ) const
inline

Definition at line 1629 of file mat_tools.h.

◆ Get_R()

double CSG_Regression::Get_R ( void ) const
inline

Definition at line 1626 of file mat_tools.h.

◆ Get_R2()

double CSG_Regression::Get_R2 ( void ) const
inline

Definition at line 1627 of file mat_tools.h.

◆ Get_R2_Adj()

double CSG_Regression::Get_R2_Adj ( void ) const
inline

Definition at line 1628 of file mat_tools.h.

◆ Get_StdError()

double CSG_Regression::Get_StdError ( void ) const
inline

Definition at line 1630 of file mat_tools.h.

◆ Get_Type()

TSG_Regression_Type CSG_Regression::Get_Type ( void ) const
inline

Definition at line 1634 of file mat_tools.h.

◆ Get_Values()

bool CSG_Regression::Get_Values | ( | int | i,
 |  | double & | x,
 |  | double & | y
 | ) |  | const
 inline

Definition at line 1599 of file mat_tools.h.

◆ Get_x()

double CSG_Regression::Get_x ( double y ) const

Definition at line 191 of file mat_regression.cpp.

References m_R2, m_RCoeff, m_RConst, m_Type, REGRESSION_Exp, REGRESSION_Linear, REGRESSION_Log, REGRESSION_Pow, REGRESSION_Rez_X, and REGRESSION_Rez_Y.

◆ Get_xMax()

double CSG_Regression::Get_xMax ( void ) const
inline

Definition at line 1613 of file mat_tools.h.

◆ Get_xMean()

double CSG_Regression::Get_xMean ( void ) const
inline

Definition at line 1614 of file mat_tools.h.

◆ Get_xMin()

double CSG_Regression::Get_xMin ( void ) const
inline

Definition at line 1612 of file mat_tools.h.

◆ Get_xValue()

double CSG_Regression::Get_xValue ( int i ) const
inline

Definition at line 1597 of file mat_tools.h.

◆ Get_xVariance()

double CSG_Regression::Get_xVariance ( void ) const
inline

Definition at line 1615 of file mat_tools.h.

◆ Get_y()

double CSG_Regression::Get_y ( double x ) const

Definition at line 233 of file mat_regression.cpp.

References m_R2, m_RCoeff, m_RConst, m_Type, REGRESSION_Exp, REGRESSION_Linear, REGRESSION_Log, REGRESSION_Pow, REGRESSION_Rez_X, and REGRESSION_Rez_Y.

Referenced by Calculate().

◆ Get_yMax()

double CSG_Regression::Get_yMax ( void ) const
inline

Definition at line 1619 of file mat_tools.h.

◆ Get_yMean()

double CSG_Regression::Get_yMean ( void ) const
inline

Definition at line 1620 of file mat_tools.h.

◆ Get_yMin()

double CSG_Regression::Get_yMin ( void ) const
inline

Definition at line 1618 of file mat_tools.h.

◆ Get_yValue()

double CSG_Regression::Get_yValue ( int i ) const
inline

Definition at line 1598 of file mat_tools.h.

◆ Get_yVariance()

double CSG_Regression::Get_yVariance ( void ) const
inline

Definition at line 1621 of file mat_tools.h.

◆ Set_Values()

bool CSG_Regression::Set_Values | ( | int | nValues,
 |  | double * | x,
 |  | double * | y
 | ) |  |

Definition at line 148 of file mat_regression.cpp.

References CSG_Vector::Create(), Destroy(), m_x, and m_y.

Referenced by Calculate().

Member Data Documentation

◆ m_P

double CSG_Regression::m_P
protected

Definition at line 1642 of file mat_tools.h.

Referenced by Calculate().

◆ m_R

double CSG_Regression::m_R
protected

Definition at line 1642 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_R2

double CSG_Regression::m_R2
protected

Definition at line 1642 of file mat_tools.h.

Referenced by asString(), Calculate(), Destroy(), Get_x(), and Get_y().

◆ m_R2_Adj

double CSG_Regression::m_R2_Adj
protected

Definition at line 1642 of file mat_tools.h.

Referenced by Calculate().

◆ m_RCoeff

double CSG_Regression::m_RCoeff
protected

Definition at line 1642 of file mat_tools.h.

Referenced by asString(), Calculate(), Get_x(), and Get_y().

◆ m_RConst

double CSG_Regression::m_RConst
protected

Definition at line 1642 of file mat_tools.h.

Referenced by asString(), Calculate(), Get_x(), and Get_y().

◆ m_SE

double CSG_Regression::m_SE
protected

Definition at line 1642 of file mat_tools.h.

Referenced by Calculate().

◆ m_Type

TSG_Regression_Type CSG_Regression::m_Type
protected

Definition at line 1648 of file mat_tools.h.

Referenced by _X_Transform(), _Y_Transform(), asString(), Calculate(), Destroy(), Get_x(), and Get_y().

◆ m_x

CSG_Vector CSG_Regression::m_x
protected

Definition at line 1646 of file mat_tools.h.

Referenced by Add_Values(), Calculate(), Destroy(), and Set_Values().

◆ m_xMax

double CSG_Regression::m_xMax
protected

Definition at line 1643 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_xMean

double CSG_Regression::m_xMean
protected

Definition at line 1643 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_xMin

double CSG_Regression::m_xMin
protected

Definition at line 1643 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_xVar

double CSG_Regression::m_xVar
protected

Definition at line 1643 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_y

CSG_Vector CSG_Regression::m_y
protected

Definition at line 1646 of file mat_tools.h.

Referenced by Add_Values(), Calculate(), Destroy(), and Set_Values().

◆ m_yMax

double CSG_Regression::m_yMax
protected

Definition at line 1644 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_yMean

double CSG_Regression::m_yMean
protected

Definition at line 1644 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_yMin

double CSG_Regression::m_yMin
protected

Definition at line 1644 of file mat_tools.h.

Referenced by asString(), and Calculate().

◆ m_yVar

double CSG_Regression::m_yVar
protected

Definition at line 1644 of file mat_tools.h.

Referenced by asString(), and Calculate().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_regression.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Regression Member List

This is the complete list of members for CSG_Regression, including all inherited members.

_X_Transform(double y) | CSG_Regression | inlineprotected
_Y_Transform(double x) | CSG_Regression | inlineprotected
Add_Values(double x, double y) | CSG_Regression |
asString(void) | CSG_Regression |
Calculate(TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false) | CSG_Regression |
Calculate(int nValues, double *x, double *y, TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false) | CSG_Regression |
CSG_Regression(void) | CSG_Regression |
Destroy(void) | CSG_Regression |
Get_Coefficient(void) const | CSG_Regression | inline
Get_Constant(void) const | CSG_Regression | inline
Get_Count(void) const | CSG_Regression | inline
Get_P(void) const | CSG_Regression | inline
Get_R(void) const | CSG_Regression | inline
Get_R2(void) const | CSG_Regression | inline
Get_R2_Adj(void) const | CSG_Regression | inline
Get_StdError(void) const | CSG_Regression | inline
Get_Type(void) const | CSG_Regression | inline
Get_Values(int i, double &x, double &y) const | CSG_Regression | inline
Get_x(double y) const | CSG_Regression |
Get_xMax(void) const | CSG_Regression | inline
Get_xMean(void) const | CSG_Regression | inline
Get_xMin(void) const | CSG_Regression | inline
Get_xValue(int i) const | CSG_Regression | inline
Get_xVariance(void) const | CSG_Regression | inline
Get_y(double x) const | CSG_Regression |
Get_yMax(void) const | CSG_Regression | inline
Get_yMean(void) const | CSG_Regression | inline
Get_yMin(void) const | CSG_Regression | inline
Get_yValue(int i) const | CSG_Regression | inline
Get_yVariance(void) const | CSG_Regression | inline
m_P | CSG_Regression | protected
m_R | CSG_Regression | protected
m_R2 | CSG_Regression | protected
m_R2_Adj | CSG_Regression | protected
m_RCoeff | CSG_Regression | protected
m_RConst | CSG_Regression | protected
m_SE | CSG_Regression | protected
m_Type | CSG_Regression | protected
m_x | CSG_Regression | protected
m_xMax | CSG_Regression | protected
m_xMean | CSG_Regression | protected
m_xMin | CSG_Regression | protected
m_xVar | CSG_Regression | protected
m_y | CSG_Regression | protected
m_yMax | CSG_Regression | protected
m_yMean | CSG_Regression | protected
m_yMin | CSG_Regression | protected
m_yVar | CSG_Regression | protected
Set_Values(int nValues, double *x, double *y) | CSG_Regression |
~CSG_Regression(void) | CSG_Regression | virtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Regression_Multiple Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Regression_Multiple Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Regression_Multiple (bool bIntercept=true)
virtual | ~CSG_Regression_Multiple (void)
void | Destroy (void)
bool | Set_Data (const CSG_Matrix &Samples, CSG_Strings *pNames=NULL)
void | Set_With_Intercept (bool bOn=true)
bool | Get_With_Intercept (void) const
bool | Get_Model (const CSG_Matrix &Samples, CSG_Strings *pNames=NULL)
bool | Get_Model_Forward (const CSG_Matrix &Samples, double P_in, CSG_Strings *pNames=NULL)
bool | Get_Model_Backward (const CSG_Matrix &Samples, double P_out, CSG_Strings *pNames=NULL)
bool | Get_Model_Stepwise (const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames=NULL)
bool | Get_Model (void)
bool | Get_Model_Forward (double P_in)
bool | Get_Model_Backward (double P_out)
bool | Get_Model_Stepwise (double P_in, double P_out)
bool | Get_CrossValidation (int nSubSamples=0)
CSG_String | Get_Info (void) const
class CSG_Table * | Get_Info_Regression (void) const
class CSG_Table * | Get_Info_Model (void) const
class CSG_Table * | Get_Info_Steps (void) const
double | Get_R2 (void) const
double | Get_R2_Adj (void) const
double | Get_StdError (void) const
double | Get_F (void) const
double | Get_P (void) const
double | Get_CV_RMSE (void) const
double | Get_CV_NRMSE (void) const
double | Get_CV_R2 (void) const
int | Get_CV_nSamples (void) const
int | Get_DegFreedom (void) const
int | Get_nSamples (void) const
int | Get_nPredictors (void) const
int | Get_Predictor (int i) const
double | Get_RConst (void) const
const SG_Char * | Get_Name (int iVariable) const
double | Get_ID (int iVariable) const
double | Get_RCoeff (int iVariable) const
double | Get_R2_Partial (int iVariable) const
double | Get_R2_Partial_Adj (int iVariable) const
double | Get_StdError (int iVariable) const
double | Get_T (int iVariable) const
double | Get_P (int iVariable) const
double | Get_Parameter (int iVariable, int Parameter) const
double | Get_Value (const CSG_Vector &Predictors) const
bool | Get_Value (const CSG_Vector &Predictors, double &Value) const
double | Get_Residual (int iSample) const
bool | Get_Residual (int iSample, double &Residual) const
bool | Get_Residuals (CSG_Vector &Residuals) const

Protected Member Functions

bool | _Initialize (bool bInclude)
double | _Get_F (int nPredictors, int nSamples, double r2_full, double r2_reduced)
double | _Get_P (int nPredictors, int nSamples, double r2_full, double r2_reduced)
bool | _Get_Regression (const class CSG_Matrix &Samples)
int | _Get_Step_In (CSG_Matrix &X, double P_in, double &R2, const CSG_Matrix &Samples)
int | _Get_Step_Out (CSG_Matrix &X, double P_out, double &R2)
bool | _Set_Step_Info (const CSG_Matrix &X)
bool | _Set_Step_Info (const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn)

Protected Attributes

bool | m_bIntercept
int * | m_bIncluded
int * | m_Predictor
int | m_nPredictors
CSG_Strings m_Names
CSG_Matrix m_Samples
CSG_Matrix m_Samples_Model
class CSG_Table * | m_pRegression
class CSG_Table * | m_pModel
class CSG_Table * | m_pSteps

Detailed Description

Definition at line 1677 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Regression_Multiple()

CSG_Regression_Multiple::CSG_Regression_Multiple ( bool bIntercept = true )

Definition at line 114 of file mat_regression_multiple.cpp.

References CSG_Table::Add_Field(), CSG_Table::Add_Record(), m_bIntercept, m_nPredictors, m_pModel, m_Predictor, m_pRegression, m_pSteps, CSG_Table_Record::Set_Value(), SG_DATATYPE_Double, SG_DATATYPE_Int, SG_DATATYPE_String, and SG_T.

◆ ~CSG_Regression_Multiple()

CSG_Regression_Multiple::~CSG_Regression_Multiple ( void )
virtual

Definition at line 181 of file mat_regression_multiple.cpp.

References Destroy(), m_pModel, m_pRegression, and m_pSteps.

Member Function Documentation

◆ _Get_F()

double CSG_Regression_Multiple::_Get_F | ( | int | nPredictors,
 |  | int | nSamples,
 |  | double | r2_full,
 |  | double | r2_reduced
 | ) |  |
inlineprotected

Definition at line 563 of file mat_regression_multiple.cpp.

Referenced by _Get_P(), and _Set_Step_Info().

◆ _Get_P()

double CSG_Regression_Multiple::_Get_P | ( | int | nPredictors,
 |  | int | nSamples,
 |  | double | r2_full,
 |  | double | r2_reduced
 | ) |  |
inlineprotected

Definition at line 569 of file mat_regression_multiple.cpp.

References _Get_F(), CSG_Test_Distribution::Get_F_Tail(), and TESTDIST_TYPE_Right.

Referenced by _Get_Step_In(), _Get_Step_Out(), and _Set_Step_Info().

◆ _Get_Regression()

bool CSG_Regression_Multiple::_Get_Regression ( const class CSG_Matrix & Samples )
protected

Definition at line 582 of file mat_regression_multiple.cpp.

References CSG_Table::Add_Record(), B, C, CSG_Matrix::Create(), CSG_Vector::Create(), CSG_Test_Distribution::Get_F_Tail_from_R2(), CSG_Matrix::Get_Inverse(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), CSG_Table::Get_Record(), CSG_Test_Distribution::Get_T_Tail(), CSG_Matrix::Get_Transpose(), m_bIntercept, m_Names, m_pModel, m_pRegression, MLR_MODEL_F, MLR_MODEL_MSE, MLR_MODEL_MSR, MLR_MODEL_NPREDICT, MLR_MODEL_NSAMPLES, MLR_MODEL_R2, MLR_MODEL_R2_ADJ, MLR_MODEL_SE, MLR_MODEL_SIG, MLR_MODEL_SSE, MLR_MODEL_SSR, MLR_MODEL_SST, MLR_VAR_ID, MLR_VAR_NAME, MLR_VAR_R, MLR_VAR_R2, MLR_VAR_R2_ADJ, MLR_VAR_RCOEFF, MLR_VAR_SE, MLR_VAR_SIG, MLR_VAR_T, CSG_Table_Record::Set_Value(), SG_Get_Correlation_Matrix(), SG_Get_Square(), SG_Regression_Get_Adjusted_R2(), and TESTDIST_TYPE_TwoTail.

Referenced by Get_Model().

◆ _Get_Step_In()

int CSG_Regression_Multiple::_Get_Step_In | ( | CSG_Matrix & | X,
 |  | double | P_in,
 |  | double & | R2,
 |  | const CSG_Matrix & | Samples
 | ) |  |
protected

Definition at line 701 of file mat_regression_multiple.cpp.

References _Get_P(), _Set_Step_Info(), CSG_Matrix::Add_Cols(), CSG_Matrix::Del_Col(), CSG_Matrix::Get_Col(), Get_Model(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), Get_R2(), m_bIncluded, m_bIntercept, m_nPredictors, m_Predictor, and CSG_Matrix::Set_Col().

Referenced by Get_Model_Forward(), and Get_Model_Stepwise().

◆ _Get_Step_Out()

int CSG_Regression_Multiple::_Get_Step_Out | ( | CSG_Matrix & | X,
 |  | double | P_out,
 |  | double & | R2
 | ) |  |
protected

Definition at line 745 of file mat_regression_multiple.cpp.

References _Get_P(), _Set_Step_Info(), CSG_Matrix::Del_Col(), Get_Model(), CSG_Matrix::Get_NY(), Get_R2(), m_bIncluded, m_bIntercept, m_nPredictors, and m_Predictor.

Referenced by Get_Model_Backward(), and Get_Model_Stepwise().

◆ _Initialize()

bool CSG_Regression_Multiple::_Initialize ( bool bInclude )
protected

Definition at line 255 of file mat_regression_multiple.cpp.

References CSG_Matrix::Create(), CSG_Matrix::Get_Col(), CSG_Table::Get_Count(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), CSG_Table::Get_Record(), m_bIncluded, m_nPredictors, m_pModel, m_Predictor, m_Samples, m_Samples_Model, CSG_Matrix::Set_Col(), and CSG_Table_Record::Set_NoData().

Referenced by Get_Model(), Get_Model_Backward(), Get_Model_Forward(), and Get_Model_Stepwise().

◆ _Set_Step_Info() [1/2]

bool CSG_Regression_Multiple::_Set_Step_Info ( const CSG_Matrix & X )
protected

Definition at line 802 of file mat_regression_multiple.cpp.

References CSG_Table::Assign(), Get_Model(), CSG_Table::Get_Record(), m_bIntercept, m_Names, m_nPredictors, m_pModel, m_Predictor, m_pRegression, MLR_VAR_ID, MLR_VAR_NAME, and CSG_Table_Record::Set_Value().

Referenced by _Get_Step_In(), _Get_Step_Out(), Get_Model_Backward(), Get_Model_Forward(), and Get_Model_Stepwise().

◆ _Set_Step_Info() [2/2]

bool CSG_Regression_Multiple::_Set_Step_Info | ( | const CSG_Matrix & | X,
 |  | double | R2_prev,
 |  | int | iVariable,
 |  | bool | bIn
 | ) |  |
protected

Definition at line 828 of file mat_regression_multiple.cpp.

References _Get_F(), _Get_P(), CSG_Table::Add_Record(), CSG_Table_Record::asDouble(), CSG_Table::Get_Count(), Get_Model(), CSG_Matrix::Get_NRows(), CSG_Matrix::Get_NY(), Get_R2(), Get_R2_Adj(), CSG_Table::Get_Record(), Get_StdError(), m_bIntercept, m_Names, m_nPredictors, m_pModel, m_pSteps, MLR_MODEL_F, MLR_MODEL_MSE, MLR_MODEL_MSR, MLR_MODEL_SIG, MLR_MODEL_SSE, MLR_MODEL_SSR, MLR_STEP_DF, MLR_STEP_DIR, MLR_STEP_F, MLR_STEP_MSE, MLR_STEP_MSR, MLR_STEP_NR, MLR_STEP_R, MLR_STEP_R2, MLR_STEP_R2_ADJ, MLR_STEP_SE, MLR_STEP_SIG, MLR_STEP_SSE, MLR_STEP_SSR, MLR_STEP_VAR, MLR_STEP_VAR_F, MLR_STEP_VAR_SIG, CSG_Table_Record::Set_Value(), and SG_T.

◆ Destroy()

void CSG_Regression_Multiple::Destroy ( void )

Definition at line 196 of file mat_regression_multiple.cpp.

References CSG_Strings::Clear(), CSG_Table::Del_Records(), CSG_Matrix::Destroy(), CSG_Table::Get_Count(), CSG_Table::Get_Record(), m_bIncluded, m_Names, m_nPredictors, m_pModel, m_Predictor, m_pRegression, m_pSteps, m_Samples, m_Samples_Model, and CSG_Table_Record::Set_NoData().

Referenced by Set_Data(), and ~CSG_Regression_Multiple().

◆ Get_CrossValidation()

bool CSG_Regression_Multiple::Get_CrossValidation ( int nSubSamples = 0 )

Definition at line 385 of file mat_regression_multiple.cpp.

References CSG_Matrix::Add_Row(), CSG_Matrix::Del_Row(), CSG_Simple_Statistics::Get_Mean(), Get_Model(), CSG_Matrix::Get_NCols(), CSG_Matrix::Get_NRows(), CSG_Simple_Statistics::Get_Range(), CSG_Table::Get_Record(), CSG_Simple_Statistics::Get_Sum(), Get_Value(), m_bIntercept, m_nPredictors, m_pModel, m_Samples_Model, MLR_MODEL_CV_MSE, MLR_MODEL_CV_NRMSE, MLR_MODEL_CV_NSAMPLES, MLR_MODEL_CV_R2, MLR_MODEL_CV_RMSE, CSG_Table_Record::Set_Value(), SG_Get_Square(), and SG_UI_Process_Get_Okay().

◆ Get_CV_NRMSE()

double CSG_Regression_Multiple::Get_CV_NRMSE ( void ) const

Definition at line 870 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_CV_NRMSE.

◆ Get_CV_nSamples()

int CSG_Regression_Multiple::Get_CV_nSamples ( void ) const

Definition at line 872 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asInt(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_CV_NSAMPLES.

◆ Get_CV_R2()

double CSG_Regression_Multiple::Get_CV_R2 ( void ) const

Definition at line 871 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_CV_R2.

◆ Get_CV_RMSE()

double CSG_Regression_Multiple::Get_CV_RMSE ( void ) const

Definition at line 869 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_CV_RMSE.

◆ Get_DegFreedom()

int CSG_Regression_Multiple::Get_DegFreedom ( void ) const

Definition at line 875 of file mat_regression_multiple.cpp.

References Get_nPredictors(), and Get_nSamples().

Referenced by Get_Info().

◆ Get_F()

double CSG_Regression_Multiple::Get_F ( void ) const

Definition at line 867 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_F.

Referenced by Get_Info().

◆ Get_ID()

double CSG_Regression_Multiple::Get_ID ( int iVariable ) const
inline

Definition at line 1723 of file mat_tools.h.

References MLR_VAR_ID.

◆ Get_Info()

CSG_String CSG_Regression_Multiple::Get_Info ( void ) const

Definition at line 916 of file mat_regression_multiple.cpp.

References _TL, CSG_Table_Record::asDouble(), CSG_Table_Record::asInt(), CSG_Table_Record::asString(), CSG_String::Format(), CSG_Table::Get_Count(), Get_DegFreedom(), Get_F(), Get_nPredictors(), Get_P(), Get_R2(), Get_R2_Adj(), Get_RCoeff(), Get_RConst(), CSG_Table::Get_Record(), Get_StdError(), m_pRegression, m_pSteps, MLR_STEP_DIR, MLR_STEP_F, MLR_STEP_NR, MLR_STEP_R, MLR_STEP_R2, MLR_STEP_R2_ADJ, MLR_STEP_SE, MLR_STEP_SIG, MLR_STEP_VAR, MLR_STEP_VAR_F, MLR_STEP_VAR_SIG, MLR_VAR_NAME, MLR_VAR_R, MLR_VAR_R2, MLR_VAR_R2_ADJ, MLR_VAR_RCOEFF, MLR_VAR_SE, MLR_VAR_SIG, and MLR_VAR_T.

◆ Get_Info_Model()

class CSG_Table* CSG_Regression_Multiple::Get_Info_Model ( void ) const
inline

Definition at line 1704 of file mat_tools.h.

◆ Get_Info_Regression()

class CSG_Table* CSG_Regression_Multiple::Get_Info_Regression ( void ) const
inline

Definition at line 1703 of file mat_tools.h.

◆ Get_Info_Steps()

class CSG_Table* CSG_Regression_Multiple::Get_Info_Steps ( void ) const
inline

Definition at line 1705 of file mat_tools.h.

◆ Get_Model() [1/2]

bool CSG_Regression_Multiple::Get_Model | ( | const CSG_Matrix & | Samples,
 |  | CSG_Strings * | pNames = NULL
 | ) |  |

Definition at line 297 of file mat_regression_multiple.cpp.

References Get_Model(), and Set_Data().

Referenced by _Get_Step_In(), _Get_Step_Out(), _Set_Step_Info(), and Get_CrossValidation().

◆ Get_Model() [2/2]

bool CSG_Regression_Multiple::Get_Model ( void )

Definition at line 318 of file mat_regression_multiple.cpp.

References _Get_Regression(), _Initialize(), and m_Samples.

Referenced by Get_Model().

◆ Get_Model_Backward() [1/2]

bool CSG_Regression_Multiple::Get_Model_Backward | ( | const CSG_Matrix & | Samples,
 |  | double | P_out,
 |  | CSG_Strings * | pNames = NULL
 | ) |  |

Definition at line 307 of file mat_regression_multiple.cpp.

References Set_Data().

◆ Get_Model_Backward() [2/2]

bool CSG_Regression_Multiple::Get_Model_Backward ( double P_out )

Definition at line 339 of file mat_regression_multiple.cpp.

References _Get_Step_Out(), _Initialize(), _Set_Step_Info(), and m_Samples_Model.

◆ Get_Model_Forward() [1/2]

bool CSG_Regression_Multiple::Get_Model_Forward | ( | const CSG_Matrix & | Samples,
 |  | double | P_in,
 |  | CSG_Strings * | pNames = NULL
 | ) |  |

Definition at line 302 of file mat_regression_multiple.cpp.

References Set_Data().

◆ Get_Model_Forward() [2/2]

bool CSG_Regression_Multiple::Get_Model_Forward ( double P_in )

Definition at line 324 of file mat_regression_multiple.cpp.

References _Get_Step_In(), _Initialize(), _Set_Step_Info(), m_Samples, and m_Samples_Model.

◆ Get_Model_Stepwise() [1/2]

bool CSG_Regression_Multiple::Get_Model_Stepwise | ( | const CSG_Matrix & | Samples,
 |  | double | P_in,
 |  | double | P_out,
 |  | CSG_Strings * | pNames = NULL
 | ) |  |

Definition at line 312 of file mat_regression_multiple.cpp.

References Set_Data().

◆ Get_Model_Stepwise() [2/2]

bool CSG_Regression_Multiple::Get_Model_Stepwise | ( | double | P_in,
 |  | double | P_out
 | ) |  |

Definition at line 354 of file mat_regression_multiple.cpp.

References _Get_Step_In(), _Get_Step_Out(), _Initialize(), _Set_Step_Info(), m_nPredictors, m_Samples, m_Samples_Model, and SG_UI_Process_Get_Okay().

◆ Get_Name()

const SG_Char * CSG_Regression_Multiple::Get_Name ( int iVariable ) const

Definition at line 878 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asString(), CSG_Table::Get_Record(), m_pRegression, MLR_VAR_NAME, and SG_T.

◆ Get_nPredictors()

int CSG_Regression_Multiple::Get_nPredictors ( void ) const

Definition at line 873 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asInt(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_NPREDICT.

Referenced by Get_DegFreedom(), and Get_Info().

◆ Get_nSamples()

int CSG_Regression_Multiple::Get_nSamples ( void ) const

Definition at line 874 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asInt(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_NSAMPLES.

Referenced by Get_DegFreedom().

◆ Get_P() [1/2]

double CSG_Regression_Multiple::Get_P ( int iVariable ) const
inline

Definition at line 1729 of file mat_tools.h.

References MLR_VAR_SIG.

◆ Get_P() [2/2]

double CSG_Regression_Multiple::Get_P ( void ) const

Definition at line 868 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_SIG.

Referenced by Get_Info().

◆ Get_Parameter()

double CSG_Regression_Multiple::Get_Parameter | ( | int | iVariable,
 |  | int | Parameter
 | ) |  | const

Definition at line 900 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pRegression, and MLR_VAR_P.

◆ Get_Predictor()

int CSG_Regression_Multiple::Get_Predictor ( int i ) const
inline

Definition at line 1719 of file mat_tools.h.

◆ Get_R2()

double CSG_Regression_Multiple::Get_R2 ( void ) const

Definition at line 864 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_R2.

Referenced by _Get_Step_In(), _Get_Step_Out(), _Set_Step_Info(), and Get_Info().

◆ Get_R2_Adj()

double CSG_Regression_Multiple::Get_R2_Adj ( void ) const

Definition at line 865 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_R2_ADJ.

Referenced by _Set_Step_Info(), and Get_Info().

◆ Get_R2_Partial()

double CSG_Regression_Multiple::Get_R2_Partial ( int iVariable ) const
inline

Definition at line 1725 of file mat_tools.h.

References MLR_VAR_R2.

◆ Get_R2_Partial_Adj()

double CSG_Regression_Multiple::Get_R2_Partial_Adj ( int iVariable ) const
inline

Definition at line 1726 of file mat_tools.h.

References MLR_VAR_R2_ADJ.

◆ Get_RCoeff()

double CSG_Regression_Multiple::Get_RCoeff ( int iVariable ) const
inline

Definition at line 1724 of file mat_tools.h.

References MLR_VAR_RCOEFF.

Referenced by Get_Info(), Get_Residual(), and Get_Value().

◆ Get_RConst()

double CSG_Regression_Multiple::Get_RConst ( void ) const

Definition at line 889 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Count(), CSG_Table::Get_Record(), m_pRegression, and MLR_VAR_RCOEFF.

Referenced by Get_Info(), Get_Residual(), and Get_Value().

◆ Get_Residual() [1/2]

double CSG_Regression_Multiple::Get_Residual ( int iSample ) const

Definition at line 518 of file mat_regression_multiple.cpp.

Referenced by Get_Residuals().

◆ Get_Residual() [2/2]

bool CSG_Regression_Multiple::Get_Residual | ( | int | iSample,
 |  | double & | Residual
 | ) |  | const

Definition at line 523 of file mat_regression_multiple.cpp.

References CSG_Matrix::Get_NRows(), Get_RCoeff(), Get_RConst(), m_nPredictors, and m_Samples_Model.

◆ Get_Residuals()

bool CSG_Regression_Multiple::Get_Residuals ( CSG_Vector & Residuals ) const

Definition at line 545 of file mat_regression_multiple.cpp.

References CSG_Vector::Create(), CSG_Vector::Get_N(), CSG_Matrix::Get_NRows(), Get_Residual(), and m_Samples_Model.

◆ Get_StdError() [1/2]

double CSG_Regression_Multiple::Get_StdError ( int iVariable ) const
inline

Definition at line 1727 of file mat_tools.h.

References MLR_VAR_SE.

◆ Get_StdError() [2/2]

double CSG_Regression_Multiple::Get_StdError ( void ) const

Definition at line 866 of file mat_regression_multiple.cpp.

References CSG_Table_Record::asDouble(), CSG_Table::Get_Record(), m_pModel, and MLR_MODEL_SE.

Referenced by _Set_Step_Info(), and Get_Info().

◆ Get_T()

double CSG_Regression_Multiple::Get_T ( int iVariable ) const
inline

Definition at line 1728 of file mat_tools.h.

References MLR_VAR_T.

◆ Get_Value() [1/2]

double CSG_Regression_Multiple::Get_Value ( const CSG_Vector & Predictors ) const

Definition at line 493 of file mat_regression_multiple.cpp.

Referenced by Get_CrossValidation().

◆ Get_Value() [2/2]

bool CSG_Regression_Multiple::Get_Value | ( | const CSG_Vector & | Predictors,
 |  | double & | Value
 | ) |  | const

Definition at line 498 of file mat_regression_multiple.cpp.

References CSG_Vector::Get_N(), Get_RCoeff(), Get_RConst(), and m_nPredictors.

◆ Get_With_Intercept()

bool CSG_Regression_Multiple::Get_With_Intercept ( void ) const
inline

Definition at line 1688 of file mat_tools.h.

◆ Set_Data()

bool CSG_Regression_Multiple::Set_Data | ( | const CSG_Matrix & | Samples,
 |  | CSG_Strings * | pNames = NULL
 | ) |  |

Definition at line 226 of file mat_regression_multiple.cpp.

References _TL, Destroy(), CSG_String::Format(), CSG_Strings::Get_Count(), CSG_Matrix::Get_NCols(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), CSG_Strings::Get_String(), m_bIncluded, m_Names, m_Predictor, and m_Samples.

Referenced by Get_Model(), Get_Model_Backward(), Get_Model_Forward(), and Get_Model_Stepwise().

◆ Set_With_Intercept()

void CSG_Regression_Multiple::Set_With_Intercept ( bool bOn = true )
inline

Definition at line 1687 of file mat_tools.h.

Member Data Documentation

◆ m_bIncluded

int* CSG_Regression_Multiple::m_bIncluded
protected

Definition at line 1746 of file mat_tools.h.

Referenced by _Get_Step_In(), _Get_Step_Out(), _Initialize(), Destroy(), and Set_Data().

◆ m_bIntercept

bool CSG_Regression_Multiple::m_bIntercept
protected

Definition at line 1744 of file mat_tools.h.

Referenced by _Get_Regression(), _Get_Step_In(), _Get_Step_Out(), _Set_Step_Info(), CSG_Regression_Multiple(), and Get_CrossValidation().

◆ m_Names

CSG_Strings CSG_Regression_Multiple::m_Names
protected

Definition at line 1748 of file mat_tools.h.

Referenced by _Get_Regression(), _Set_Step_Info(), Destroy(), and Set_Data().

◆ m_nPredictors

int CSG_Regression_Multiple::m_nPredictors
protected

Definition at line 1746 of file mat_tools.h.

Referenced by _Get_Step_In(), _Get_Step_Out(), _Initialize(), _Set_Step_Info(), CSG_Regression_Multiple(), Destroy(), Get_CrossValidation(), Get_Model_Stepwise(), Get_Residual(), and Get_Value().

◆ m_pModel

class CSG_Table * CSG_Regression_Multiple::m_pModel
protected

Definition at line 1752 of file mat_tools.h.

Referenced by _Get_Regression(), _Initialize(), _Set_Step_Info(), CSG_Regression_Multiple(), Destroy(), Get_CrossValidation(), Get_CV_NRMSE(), Get_CV_nSamples(), Get_CV_R2(), Get_CV_RMSE(), Get_F(), Get_nPredictors(), Get_nSamples(), Get_P(), Get_R2(), Get_R2_Adj(), Get_StdError(), and ~CSG_Regression_Multiple().

◆ m_Predictor

int * CSG_Regression_Multiple::m_Predictor
protected

Definition at line 1746 of file mat_tools.h.

Referenced by _Get_Step_In(), _Get_Step_Out(), _Initialize(), _Set_Step_Info(), CSG_Regression_Multiple(), Destroy(), and Set_Data().

◆ m_pRegression

class CSG_Table* CSG_Regression_Multiple::m_pRegression
protected

Definition at line 1752 of file mat_tools.h.

Referenced by _Get_Regression(), _Set_Step_Info(), CSG_Regression_Multiple(), Destroy(), Get_Info(), Get_Name(), Get_Parameter(), Get_RConst(), and ~CSG_Regression_Multiple().

◆ m_pSteps

class CSG_Table * CSG_Regression_Multiple::m_pSteps
protected

Definition at line 1752 of file mat_tools.h.

Referenced by _Set_Step_Info(), CSG_Regression_Multiple(), Destroy(), Get_Info(), and ~CSG_Regression_Multiple().

◆ m_Samples

CSG_Matrix CSG_Regression_Multiple::m_Samples
protected

Definition at line 1750 of file mat_tools.h.

Referenced by _Initialize(), Destroy(), Get_Model(), Get_Model_Forward(), Get_Model_Stepwise(), and Set_Data().

◆ m_Samples_Model

CSG_Matrix CSG_Regression_Multiple::m_Samples_Model
protected

Definition at line 1750 of file mat_tools.h.

Referenced by _Initialize(), Destroy(), Get_CrossValidation(), Get_Model_Backward(), Get_Model_Forward(), Get_Model_Stepwise(), Get_Residual(), and Get_Residuals().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_regression_multiple.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Regression_Multiple Member List

This is the complete list of members for CSG_Regression_Multiple, including all inherited members.

_Get_F(int nPredictors, int nSamples, double r2_full, double r2_reduced) | CSG_Regression_Multiple | inlineprotected
_Get_P(int nPredictors, int nSamples, double r2_full, double r2_reduced) | CSG_Regression_Multiple | inlineprotected
_Get_Regression(const class CSG_Matrix &Samples) | CSG_Regression_Multiple | protected
_Get_Step_In(CSG_Matrix &X, double P_in, double &R2, const CSG_Matrix &Samples) | CSG_Regression_Multiple | protected
_Get_Step_Out(CSG_Matrix &X, double P_out, double &R2) | CSG_Regression_Multiple | protected
_Initialize(bool bInclude) | CSG_Regression_Multiple | protected
_Set_Step_Info(const CSG_Matrix &X) | CSG_Regression_Multiple | protected
_Set_Step_Info(const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn) | CSG_Regression_Multiple | protected
CSG_Regression_Multiple(bool bIntercept=true) | CSG_Regression_Multiple |
Destroy(void) | CSG_Regression_Multiple |
Get_CrossValidation(int nSubSamples=0) | CSG_Regression_Multiple |
Get_CV_NRMSE(void) const | CSG_Regression_Multiple |
Get_CV_nSamples(void) const | CSG_Regression_Multiple |
Get_CV_R2(void) const | CSG_Regression_Multiple |
Get_CV_RMSE(void) const | CSG_Regression_Multiple |
Get_DegFreedom(void) const | CSG_Regression_Multiple |
Get_F(void) const | CSG_Regression_Multiple |
Get_ID(int iVariable) const | CSG_Regression_Multiple | inline
Get_Info(void) const | CSG_Regression_Multiple |
Get_Info_Model(void) const | CSG_Regression_Multiple | inline
Get_Info_Regression(void) const | CSG_Regression_Multiple | inline
Get_Info_Steps(void) const | CSG_Regression_Multiple | inline
Get_Model(const CSG_Matrix &Samples, CSG_Strings *pNames=NULL) | CSG_Regression_Multiple |
Get_Model(void) | CSG_Regression_Multiple |
Get_Model_Backward(const CSG_Matrix &Samples, double P_out, CSG_Strings *pNames=NULL) | CSG_Regression_Multiple |
Get_Model_Backward(double P_out) | CSG_Regression_Multiple |
Get_Model_Forward(const CSG_Matrix &Samples, double P_in, CSG_Strings *pNames=NULL) | CSG_Regression_Multiple |
Get_Model_Forward(double P_in) | CSG_Regression_Multiple |
Get_Model_Stepwise(const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames=NULL) | CSG_Regression_Multiple |
Get_Model_Stepwise(double P_in, double P_out) | CSG_Regression_Multiple |
Get_Name(int iVariable) const | CSG_Regression_Multiple |
Get_nPredictors(void) const | CSG_Regression_Multiple |
Get_nSamples(void) const | CSG_Regression_Multiple |
Get_P(void) const | CSG_Regression_Multiple |
Get_P(int iVariable) const | CSG_Regression_Multiple | inline
Get_Parameter(int iVariable, int Parameter) const | CSG_Regression_Multiple |
Get_Predictor(int i) const | CSG_Regression_Multiple | inline
Get_R2(void) const | CSG_Regression_Multiple |
Get_R2_Adj(void) const | CSG_Regression_Multiple |
Get_R2_Partial(int iVariable) const | CSG_Regression_Multiple | inline
Get_R2_Partial_Adj(int iVariable) const | CSG_Regression_Multiple | inline
Get_RCoeff(int iVariable) const | CSG_Regression_Multiple | inline
Get_RConst(void) const | CSG_Regression_Multiple |
Get_Residual(int iSample) const | CSG_Regression_Multiple |
Get_Residual(int iSample, double &Residual) const | CSG_Regression_Multiple |
Get_Residuals(CSG_Vector &Residuals) const | CSG_Regression_Multiple |
Get_StdError(void) const | CSG_Regression_Multiple |
Get_StdError(int iVariable) const | CSG_Regression_Multiple | inline
Get_T(int iVariable) const | CSG_Regression_Multiple | inline
Get_Value(const CSG_Vector &Predictors) const | CSG_Regression_Multiple |
Get_Value(const CSG_Vector &Predictors, double &Value) const | CSG_Regression_Multiple |
Get_With_Intercept(void) const | CSG_Regression_Multiple | inline
m_bIncluded | CSG_Regression_Multiple | protected
m_bIntercept | CSG_Regression_Multiple | protected
m_Names | CSG_Regression_Multiple | protected
m_nPredictors | CSG_Regression_Multiple | protected
m_pModel | CSG_Regression_Multiple | protected
m_Predictor | CSG_Regression_Multiple | protected
m_pRegression | CSG_Regression_Multiple | protected
m_pSteps | CSG_Regression_Multiple | protected
m_Samples | CSG_Regression_Multiple | protected
m_Samples_Model | CSG_Regression_Multiple | protected
Set_Data(const CSG_Matrix &Samples, CSG_Strings *pNames=NULL) | CSG_Regression_Multiple |
Set_With_Intercept(bool bOn=true) | CSG_Regression_Multiple | inline
~CSG_Regression_Multiple(void) | CSG_Regression_Multiple | virtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Regression_Weighted Class Reference

Public Member Functions | List of all members
CSG_Regression_Weighted Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Regression_Weighted (void)
virtual | ~CSG_Regression_Weighted (void)
bool | Destroy (void)
bool | Add_Sample (double Weight, double Dependent, const CSG_Vector &Predictors)
int | Get_Sample_Count (void) const
int | Get_Predictor_Count (void) const
bool | Calculate (const CSG_Vector &Weights, const CSG_Vector &Dependents, const CSG_Matrix &Predictors, bool bLogistic=false)
bool | Calculate (bool bLogistic=false)
double | Get_R2 (void) const
const CSG_Vector & | Get_RCoeff (void) const
double | Get_RCoeff (int i) const
double | operator[] (int i) const
int | Get_Log_maxIter (void) const
double | Get_Log_Epsilon (void) const
double | Get_Log_Difference (void) const
bool | Set_Log_maxIter (int maxIter)
bool | Set_Log_Epsilon (double Epsilon)
bool | Set_Log_Difference (double Difference)
bool | Get_CrossValidation (int nSubSamples=0)
int | Get_CV_nSamples (void) const
double | Get_CV_RMSE (void) const
double | Get_CV_NRMSE (void) const
double | Get_CV_R2 (void) const

Detailed Description

Definition at line 1776 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Regression_Weighted()

CSG_Regression_Weighted::CSG_Regression_Weighted ( void )

Definition at line 63 of file mat_regression_weighted.cpp.

◆ ~CSG_Regression_Weighted()

CSG_Regression_Weighted::~CSG_Regression_Weighted ( void )
virtual

Definition at line 73 of file mat_regression_weighted.cpp.

References Destroy().

Member Function Documentation

◆ Add_Sample()

bool CSG_Regression_Weighted::Add_Sample | ( | double | Weight,
 |  | double | Dependent,
 |  | const CSG_Vector & | Predictors
 | ) |  |

Definition at line 97 of file mat_regression_weighted.cpp.

References CSG_Matrix::Add_Row(), CSG_Vector::Add_Row(), CSG_Matrix::Create(), CSG_Vector::Get_N(), CSG_Matrix::Get_NCols(), and CSG_Matrix::Get_NRows().

Referenced by Calculate().

◆ Calculate() [1/2]

bool CSG_Regression_Weighted::Calculate ( bool bLogistic = false )

Definition at line 151 of file mat_regression_weighted.cpp.

References CSG_Simple_Statistics::Get_Mean(), CSG_Vector::Get_N(), CSG_Matrix::Get_NCols(), CSG_Vector::Get_Size(), and SG_Get_Square().

◆ Calculate() [2/2]

bool CSG_Regression_Weighted::Calculate | ( | const CSG_Vector & | Weights,
 |  | const CSG_Vector & | Dependents,
 |  | const CSG_Matrix & | Predictors,
 |  | bool | bLogistic = false
 | ) |  |

Definition at line 133 of file mat_regression_weighted.cpp.

References Add_Sample(), Destroy(), CSG_Vector::Get_N(), CSG_Matrix::Get_NRows(), and CSG_Matrix::Get_Row().

◆ Destroy()

bool CSG_Regression_Weighted::Destroy ( void )

Definition at line 79 of file mat_regression_weighted.cpp.

References CSG_Vector::Destroy(), and CSG_Matrix::Destroy().

Referenced by Calculate(), and ~CSG_Regression_Weighted().

◆ Get_CrossValidation()

bool CSG_Regression_Weighted::Get_CrossValidation ( int nSubSamples = 0 )

Definition at line 425 of file mat_regression_weighted.cpp.

◆ Get_CV_NRMSE()

double CSG_Regression_Weighted::Get_CV_NRMSE ( void ) const
inline

Definition at line 1810 of file mat_tools.h.

◆ Get_CV_nSamples()

int CSG_Regression_Weighted::Get_CV_nSamples ( void ) const
inline

Definition at line 1808 of file mat_tools.h.

◆ Get_CV_R2()

double CSG_Regression_Weighted::Get_CV_R2 ( void ) const
inline

Definition at line 1811 of file mat_tools.h.

◆ Get_CV_RMSE()

double CSG_Regression_Weighted::Get_CV_RMSE ( void ) const
inline

Definition at line 1809 of file mat_tools.h.

◆ Get_Log_Difference()

double CSG_Regression_Weighted::Get_Log_Difference ( void ) const
inline

Definition at line 1799 of file mat_tools.h.

◆ Get_Log_Epsilon()

double CSG_Regression_Weighted::Get_Log_Epsilon ( void ) const
inline

Definition at line 1798 of file mat_tools.h.

◆ Get_Log_maxIter()

int CSG_Regression_Weighted::Get_Log_maxIter ( void ) const
inline

Definition at line 1797 of file mat_tools.h.

◆ Get_Predictor_Count()

int CSG_Regression_Weighted::Get_Predictor_Count ( void ) const
inline

Definition at line 1786 of file mat_tools.h.

◆ Get_R2()

double CSG_Regression_Weighted::Get_R2 ( void ) const
inline

Definition at line 1791 of file mat_tools.h.

◆ Get_RCoeff() [1/2]

double CSG_Regression_Weighted::Get_RCoeff ( int i ) const
inline

Definition at line 1793 of file mat_tools.h.

◆ Get_RCoeff() [2/2]

const CSG_Vector& CSG_Regression_Weighted::Get_RCoeff ( void ) const
inline

Definition at line 1792 of file mat_tools.h.

◆ Get_Sample_Count()

int CSG_Regression_Weighted::Get_Sample_Count ( void ) const
inline

Definition at line 1785 of file mat_tools.h.

◆ operator[]()

double CSG_Regression_Weighted::operator[] ( int i ) const
inline

Definition at line 1794 of file mat_tools.h.

◆ Set_Log_Difference()

bool CSG_Regression_Weighted::Set_Log_Difference ( double Difference )

Definition at line 261 of file mat_regression_weighted.cpp.

◆ Set_Log_Epsilon()

bool CSG_Regression_Weighted::Set_Log_Epsilon ( double Epsilon )

Definition at line 248 of file mat_regression_weighted.cpp.

◆ Set_Log_maxIter()

bool CSG_Regression_Weighted::Set_Log_maxIter ( int maxIter )

Definition at line 235 of file mat_regression_weighted.cpp.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_regression_weighted.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Regression_Weighted Member List

This is the complete list of members for CSG_Regression_Weighted, including all inherited members.

Add_Sample(double Weight, double Dependent, const CSG_Vector &Predictors) | CSG_Regression_Weighted |
Calculate(const CSG_Vector &Weights, const CSG_Vector &Dependents, const CSG_Matrix &Predictors, bool bLogistic=false) | CSG_Regression_Weighted |
Calculate(bool bLogistic=false) | CSG_Regression_Weighted |
CSG_Regression_Weighted(void) | CSG_Regression_Weighted |
Destroy(void) | CSG_Regression_Weighted |
Get_CrossValidation(int nSubSamples=0) | CSG_Regression_Weighted |
Get_CV_NRMSE(void) const | CSG_Regression_Weighted | inline
Get_CV_nSamples(void) const | CSG_Regression_Weighted | inline
Get_CV_R2(void) const | CSG_Regression_Weighted | inline
Get_CV_RMSE(void) const | CSG_Regression_Weighted | inline
Get_Log_Difference(void) const | CSG_Regression_Weighted | inline
Get_Log_Epsilon(void) const | CSG_Regression_Weighted | inline
Get_Log_maxIter(void) const | CSG_Regression_Weighted | inline
Get_Predictor_Count(void) const | CSG_Regression_Weighted | inline
Get_R2(void) const | CSG_Regression_Weighted | inline
Get_RCoeff(void) const | CSG_Regression_Weighted | inline
Get_RCoeff(int i) const | CSG_Regression_Weighted | inline
Get_Sample_Count(void) const | CSG_Regression_Weighted | inline
operator[](int i) const | CSG_Regression_Weighted | inline
Set_Log_Difference(double Difference) | CSG_Regression_Weighted |
Set_Log_Epsilon(double Epsilon) | CSG_Regression_Weighted |
Set_Log_maxIter(int maxIter) | CSG_Regression_Weighted |
~CSG_Regression_Weighted(void) | CSG_Regression_Weighted | virtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Shape Class Referenceabstract

#include <shapes.h>

Inheritance diagram for CSG_Shape:
CSG_Table_Record CSG_Shape_Point CSG_Shape_Points CSG_Shape_Point_Z CSG_Shape_Line CSG_Shape_Polygon CSG_Shape_Point_ZM

Public Member Functions

virtual void | Destroy (void)
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
virtual bool | is_Valid (void) const =0
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual int | Get_Point_Count (void) const =0
virtual int | Get_Point_Count (int iPart) const =0
virtual int | Get_Part_Count (void) const =0
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual int | Add_Point (double x, double y, int iPart=0)=0
virtual int | Add_Point (const CSG_Point &p, int iPart=0)=0
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)=0
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)=0
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)=0
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)=0
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)=0
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)=0
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)=0
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)=0
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)=0
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)=0
virtual int | Del_Point (int iPoint, int iPart=0)=0
virtual TSG_Point | Get_Point (int iPoint=0) const =0
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const =0
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (void)=0
virtual const CSG_Rect & | Get_Extent (int iPart)
virtual TSG_Point | Get_Centroid (void)=0
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
virtual double | Get_Distance (TSG_Point Point) const =0
virtual double | Get_Distance (TSG_Point Point, int iPart) const =0
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const =0
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const =0
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
virtual bool | On_Assign (CSG_Shape *pShape)=0
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)=0
virtual TSG_Intersection | On_Intersects (TSG_Rect Extent)=0
virtual void | _Invalidate (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Friends

class CSG_Shapes

Additional Inherited Members

- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * | _Create_Value (TSG_Data_Type Type)
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Detailed Description

Definition at line 140 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape()

CSG_Shape::CSG_Shape | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 63 of file shape.cpp.

◆ ~CSG_Shape()

CSG_Shape::~CSG_Shape ( void )
protectedvirtual

Definition at line 68 of file shape.cpp.

References Destroy().

Member Function Documentation

◆ _Invalidate()

void CSG_Shape::_Invalidate ( void )
inlineprotectedvirtual

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Points.

Definition at line 105 of file shape.cpp.

References CSG_Table_Record::m_pTable, and CSG_Table_Record::Set_Modified().

Referenced by CSG_Shape_Points::_Invalidate(), CSG_Shape_Point_ZM::Set_M(), CSG_Shape_Point::Set_Point(), and CSG_Shape_Point_Z::Set_Z().

◆ Add_Part()

virtual int CSG_Shape::Add_Part | ( | class CSG_Shape_Part * | pPart,
 |  | bool | bRevert = false
 | ) |  |
inlinevirtual

Reimplemented in CSG_Shape_Points.

Definition at line 168 of file shapes.h.

Referenced by SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Add_Point() [1/4]

virtual int CSG_Shape::Add_Point | ( | const CSG_Point & | p,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Add_Point() [2/4]

virtual int CSG_Shape::Add_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Add_Point() [3/4]

virtual int CSG_Shape::Add_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Add_Point() [4/4]

virtual int CSG_Shape::Add_Point | ( | double | x,
 |  | double | y,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_TIN::Save(), SG_Get_Projected(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ asLine()

class CSG_Shape_Line* CSG_Shape::asLine ( void ) const
inline

Definition at line 160 of file shapes.h.

References Get_Type(), and SHAPE_TYPE_Line.

◆ asPoint()

class CSG_Shape_Point* CSG_Shape::asPoint ( void ) const
inline

Definition at line 158 of file shapes.h.

References Get_Type(), and SHAPE_TYPE_Point.

◆ asPoints()

class CSG_Shape_Points* CSG_Shape::asPoints ( void ) const
inline

Definition at line 159 of file shapes.h.

References Get_Type(), and SHAPE_TYPE_Points.

◆ asPolygon()

class CSG_Shape_Polygon* CSG_Shape::asPolygon ( void ) const
inline

Definition at line 161 of file shapes.h.

References Get_Type(), and SHAPE_TYPE_Polygon.

◆ Assign() [1/3]

bool CSG_Shape::Assign ( CSG_Table_Record * pRecord )
virtual

Reimplemented from CSG_Table_Record.

Definition at line 195 of file shape.cpp.

References SHAPE_COPY.

Referenced by CSG_Shapes::Add_Shape(), Assign(), SG_Shape_Get_Difference(), SG_Shape_Get_ExclusiveOr(), SG_Shape_Get_Intersection(), and SG_Shape_Get_Union().

◆ Assign() [2/3]

bool CSG_Shape::Assign | ( | CSG_Table_Record * | pRecord,
 |  | bool | bAssign_Attributes
 | ) |  |
virtual

Definition at line 200 of file shape.cpp.

References Assign(), SHAPE_COPY, and SHAPE_COPY_GEOM.

◆ Assign() [3/3]

bool CSG_Shape::Assign | ( | CSG_Table_Record * | pRecord,
 |  | TSG_ADD_Shape_Copy_Mode | mCopy
 | ) |  |
virtual

Definition at line 205 of file shape.cpp.

References CSG_Table_Record::Assign(), CSG_Table::Get_ObjectType(), CSG_Table_Record::Get_Table(), Get_Type(), On_Assign(), SG_DATAOBJECT_TYPE_Shapes, SHAPE_COPY, SHAPE_COPY_ATTR, and SHAPE_COPY_GEOM.

◆ Del_Part()

virtual int CSG_Shape::Del_Part ( int iPart )
inlinevirtual

Reimplemented in CSG_Shape_Points.

Definition at line 170 of file shapes.h.

◆ Del_Parts()

virtual int CSG_Shape::Del_Parts ( void )
inlinevirtual

Reimplemented in CSG_Shape_Points.

Definition at line 171 of file shapes.h.

Referenced by CSG_Shapes_OGIS_Converter::from_WKBinary(), and CSG_Shapes_OGIS_Converter::from_WKText().

◆ Del_Point()

virtual int CSG_Shape::Del_Point | ( | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Destroy()

void CSG_Shape::Destroy ( void )
virtual

Reimplemented in CSG_Shape_Points.

Definition at line 79 of file shape.cpp.

Referenced by CSG_Shape_Points::Destroy(), and ~CSG_Shape().

◆ Get_Centroid()

virtual TSG_Point CSG_Shape::Get_Centroid ( void )
pure virtual

Implemented in CSG_Shape_Polygon, CSG_Shape_Line, CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Distance() [1/4]

virtual double CSG_Shape::Get_Distance ( TSG_Point Point ) const
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_Shapes::Get_Shape().

◆ Get_Distance() [2/4]

virtual double CSG_Shape::Get_Distance | ( | TSG_Point | Point,
 |  | int | iPart
 | ) |  | const
 pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Distance() [3/4]

virtual double CSG_Shape::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next
 | ) |  | const
 pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Distance() [4/4]

virtual double CSG_Shape::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next,
 |  | int | iPart
 | ) |  | const
 pure virtual

Implemented in CSG_Shape_Polygon, CSG_Shape_Line, CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Extent() [1/2]

virtual const CSG_Rect& CSG_Shape::Get_Extent ( int iPart )
inlinevirtual

Definition at line 228 of file shapes.h.

References Get_Extent().

Referenced by Get_Extent().

◆ Get_Extent() [2/2]

virtual const CSG_Rect& CSG_Shape::Get_Extent ( void )
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by _SG_Polygon_Clip(), Intersects(), CSG_Shapes::On_Update(), SG_Shape_Get_Dissolve(), and SG_Shape_Get_Offset().

◆ Get_M()

virtual double CSG_Shape::Get_M | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_ZM.

Definition at line 211 of file shapes.h.

Referenced by CSG_Shape_Point::On_Assign(), and CSG_Shape_Points::On_Assign().

◆ Get_MMax()

virtual double CSG_Shape::Get_MMax ( void )
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_ZM.

Definition at line 213 of file shapes.h.

Referenced by CSG_Shapes::On_Update().

◆ Get_MMin()

virtual double CSG_Shape::Get_MMin ( void )
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_ZM.

Definition at line 212 of file shapes.h.

Referenced by CSG_Shapes::On_Update().

◆ Get_Part()

virtual CSG_Shape_Part* CSG_Shape::Get_Part ( int iPart ) const
inlinevirtual

Reimplemented in CSG_Shape_Points.

Definition at line 169 of file shapes.h.

◆ Get_Part_Count()

virtual int CSG_Shape::Get_Part_Count ( void ) const
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_TIN::Create(), CSG_PRQuadTree::Create(), Intersects(), CSG_Shape_Points::On_Assign(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Get_Point() [1/2]

virtual TSG_Point CSG_Shape::Get_Point | ( | int | iPoint,
 |  | int | iPart,
 |  | bool | bAscending = true
 | ) |  | const
 pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Point() [2/2]

virtual TSG_Point CSG_Shape::Get_Point ( int iPoint = 0 ) const
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), CSG_Shape_Points::Get_Point(), CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), Intersects(), CSG_Shape_Point::On_Assign(), CSG_Shape_Points::On_Assign(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ Get_Point_Count() [1/2]

virtual int CSG_Shape::Get_Point_Count ( int iPart ) const
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Get_Point_Count() [2/2]

virtual int CSG_Shape::Get_Point_Count ( void ) const
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_Shape_Points::Add_Point(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), Intersects(), CSG_Shape_Point::On_Assign(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ Get_Point_Z()

virtual TSG_Point_3D CSG_Shape::Get_Point_Z | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Definition at line 198 of file shapes.h.

References CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Z(), SSG_Point::x, SSG_Point_3D::x, SSG_Point::y, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Point_ZM()

virtual TSG_Point_4D CSG_Shape::Get_Point_ZM | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Definition at line 214 of file shapes.h.

References CSG_Shape_Points::Get_M(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Z(), SSG_Point_4D::m, SSG_Point::x, SSG_Point_4D::x, SSG_Point::y, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Get_Type()

TSG_Shape_Type CSG_Shape::Get_Type ( void ) const

Definition at line 88 of file shape.cpp.

References CSG_Table_Record::m_pTable.

Referenced by _SG_Polygon_Clip(), asLine(), asPoint(), asPoints(), asPolygon(), Assign(), CSG_Shapes_OGIS_Converter::from_WKBinary(), CSG_Shapes_OGIS_Converter::from_WKText(), Intersects(), CSG_Shape_Points::On_Assign(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Shape_Get_Offset(), CSG_Shapes_OGIS_Converter::to_WKBinary(), and CSG_Shapes_OGIS_Converter::to_WKText().

◆ Get_Vertex_Type()

TSG_Vertex_Type CSG_Shape::Get_Vertex_Type ( void ) const

Definition at line 94 of file shape.cpp.

References CSG_Table_Record::m_pTable.

Referenced by CSG_Shape_Points::On_Assign(), CSG_Shapes_OGIS_Converter::to_WKBinary(), and CSG_Shapes_OGIS_Converter::to_WKText().

◆ Get_Z()

virtual double CSG_Shape::Get_Z | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_Z.

Definition at line 195 of file shapes.h.

Referenced by CSG_KDTree_3D::Create(), CSG_Shape_Point::On_Assign(), and CSG_Shape_Points::On_Assign().

◆ Get_ZMax()

virtual double CSG_Shape::Get_ZMax ( void )
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_Z.

Definition at line 197 of file shapes.h.

Referenced by CSG_Shapes::On_Update().

◆ Get_ZMin()

virtual double CSG_Shape::Get_ZMin ( void )
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_Z.

Definition at line 196 of file shapes.h.

Referenced by CSG_Shapes::On_Update().

◆ Ins_Point() [1/4]

virtual int CSG_Shape::Ins_Point | ( | const CSG_Point & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Ins_Point() [2/4]

virtual int CSG_Shape::Ins_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Ins_Point() [3/4]

virtual int CSG_Shape::Ins_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Ins_Point() [4/4]

virtual int CSG_Shape::Ins_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_Shape_Points::Add_Point().

◆ Intersects() [1/2]

TSG_Intersection CSG_Shape::Intersects ( const TSG_Rect & Extent )

Definition at line 177 of file shape.cpp.

References Get_Extent(), INTERSECTION_Contains, INTERSECTION_Overlaps, CSG_Rect::Intersects(), and On_Intersects().

◆ Intersects() [2/2]

TSG_Intersection CSG_Shape::Intersects ( CSG_Shape * pShape )

Definition at line 118 of file shape.cpp.

References Get_Extent(), Get_Part_Count(), Get_Point(), Get_Point_Count(), Get_Type(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, CSG_Point::is_Equal(), and On_Intersects().

Referenced by CSG_Shapes::Get_Shape(), CSG_Shape_Polygon::Get_Shared_Edges(), CSG_Shape_Polygon::is_Neighbour(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), CSG_Shapes::Select(), SG_Shape_Get_Difference(), SG_Shape_Get_ExclusiveOr(), SG_Shape_Get_Intersection(), and SG_Shape_Get_Union().

◆ is_Valid()

virtual bool CSG_Shape::is_Valid ( void ) const
pure virtual

Implemented in CSG_Shape_Polygon, CSG_Shape_Line, CSG_Shape_Points, and CSG_Shape_Point.

◆ On_Assign()

virtual bool CSG_Shape::On_Assign ( CSG_Shape * pShape )
protectedpure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by Assign().

◆ On_Intersects() [1/2]

virtual TSG_Intersection CSG_Shape::On_Intersects ( CSG_Shape * pShape )
protectedpure virtual

Implemented in CSG_Shape_Polygon, CSG_Shape_Line, CSG_Shape_Points, and CSG_Shape_Point.

Referenced by Intersects().

◆ On_Intersects() [2/2]

virtual TSG_Intersection CSG_Shape::On_Intersects ( TSG_Rect Extent )
protectedpure virtual

Implemented in CSG_Shape_Polygon, CSG_Shape_Line, CSG_Shape_Points, and CSG_Shape_Point.

◆ Revert_Points()

virtual bool CSG_Shape::Revert_Points ( int iPart )
inlinevirtual

Reimplemented in CSG_Shape_Points.

Definition at line 240 of file shapes.h.

◆ Set_M()

virtual void CSG_Shape::Set_M | ( | double | m,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_ZM.

Definition at line 210 of file shapes.h.

Referenced by CSG_Shape_Point::On_Assign(), and CSG_Shape_Point::Set_Point().

◆ Set_Point() [1/4]

virtual int CSG_Shape::Set_Point | ( | const CSG_Point & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Set_Point() [2/4]

virtual int CSG_Shape::Set_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Set_Point() [3/4]

virtual int CSG_Shape::Set_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

◆ Set_Point() [4/4]

virtual int CSG_Shape::Set_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
pure virtual

Implemented in CSG_Shape_Points, and CSG_Shape_Point.

Referenced by CSG_Shape_Point::Add_Point(), and CSG_Shape_Point::Ins_Point().

◆ Set_Z()

virtual void CSG_Shape::Set_Z | ( | double | z,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented in CSG_Shape_Points, and CSG_Shape_Point_Z.

Definition at line 194 of file shapes.h.

Referenced by CSG_Shape_Point::On_Assign(), and CSG_Shape_Point::Set_Point().

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 142 of file shapes.h.

The documentation for this class was generated from the following files:
  • shapes.h
  • shape.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape Member List

This is the complete list of members for CSG_Shape, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Invalidate(void) | CSG_Shape | inlineprotectedvirtual
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape | inlinevirtual
Add_Point(double x, double y, int iPart=0)=0 | CSG_Shape | pure virtual
Add_Point(const CSG_Point &p, int iPart=0)=0 | CSG_Shape | pure virtual
Add_Point(const CSG_Point_3D &p, int iPart=0)=0 | CSG_Shape | pure virtual
Add_Point(const CSG_Point_4D &p, int iPart=0)=0 | CSG_Shape | pure virtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shapes class | CSG_Shape | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape | inlinevirtual
Del_Parts(void) | CSG_Shape | inlinevirtual
Del_Point(int iPoint, int iPart=0)=0 | CSG_Shape | pure virtual
Destroy(void) | CSG_Shape | virtual
Get_Centroid(void)=0 | CSG_Shape | pure virtual
Get_Distance(TSG_Point Point) const =0 | CSG_Shape | pure virtual
Get_Distance(TSG_Point Point, int iPart) const =0 | CSG_Shape | pure virtual
Get_Distance(TSG_Point Point, TSG_Point &Next) const =0 | CSG_Shape | pure virtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const =0 | CSG_Shape | pure virtual
Get_Extent(void)=0 | CSG_Shape | pure virtual
Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_MMax(void) | CSG_Shape | inlinevirtual
Get_MMin(void) | CSG_Shape | inlinevirtual
Get_Part(int iPart) const | CSG_Shape | inlinevirtual
Get_Part_Count(void) const =0 | CSG_Shape | pure virtual
Get_Point(int iPoint=0) const =0 | CSG_Shape | pure virtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const =0 | CSG_Shape | pure virtual
Get_Point_Count(void) const =0 | CSG_Shape | pure virtual
Get_Point_Count(int iPart) const =0 | CSG_Shape | pure virtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_ZMax(void) | CSG_Shape | inlinevirtual
Get_ZMin(void) | CSG_Shape | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0)=0 | CSG_Shape | pure virtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)=0 | CSG_Shape | pure virtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0)=0 | CSG_Shape | pure virtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0)=0 | CSG_Shape | pure virtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const =0 | CSG_Shape | pure virtual
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape)=0 | CSG_Shape | protectedpure virtual
On_Intersects(CSG_Shape *pShape)=0 | CSG_Shape | protectedpure virtual
On_Intersects(TSG_Rect Extent)=0 | CSG_Shape | protectedpure virtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0)=0 | CSG_Shape | pure virtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)=0 | CSG_Shape | pure virtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0)=0 | CSG_Shape | pure virtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0)=0 | CSG_Shape | pure virtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Line Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Shape_Line Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Line:
CSG_Shape_Points CSG_Shape CSG_Table_Record

Public Member Functions

virtual bool | is_Valid (void) const
virtual TSG_Point | Get_Centroid (void)
double | Get_Length (void)
double | Get_Length (int iPart)
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
- Public Member Functions inherited from CSG_Shape_Points
virtual void | Destroy (void)
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Shape
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Shape_Line (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Line (void)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape_Points
CSG_Shape_Points (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Points (void)
int | _Add_Part (void)
virtual CSG_Shape_Part * | _Get_Part (void)
virtual void | _Invalidate (void)
void | _Update_Extent (void)
virtual bool | On_Assign (CSG_Shape *pShape)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Friends

class CSG_Shapes

Additional Inherited Members

- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * | _Create_Value (TSG_Data_Type Type)
- Protected Attributes inherited from CSG_Shape_Points
bool | m_bUpdate
int | m_nParts
int | m_nPoints
double | m_ZMin
double | m_ZMax
double | m_MMin
double | m_MMax
CSG_Rect m_Extent
CSG_Shape_Part ** m_pParts
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Detailed Description

Definition at line 600 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Line()

CSG_Shape_Line::CSG_Shape_Line | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 63 of file shape_line.cpp.

◆ ~CSG_Shape_Line()

CSG_Shape_Line::~CSG_Shape_Line ( void )
protectedvirtual

Definition at line 68 of file shape_line.cpp.

Member Function Documentation

◆ Get_Centroid()

TSG_Point CSG_Shape_Line::Get_Centroid ( void )
virtual

Reimplemented from CSG_Shape_Points.

Definition at line 220 of file shape_line.cpp.

References CSG_Shape_Points::Get_Extent().

◆ Get_Distance()

double CSG_Shape_Line::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next,
 |  | int | iPart
 | ) |  | const
 virtual

Reimplemented from CSG_Shape_Points.

Definition at line 277 of file shape_line.cpp.

References C, CSG_Shape_Part::Get_Count(), CSG_Shape_Points::m_nParts, CSG_Shape_Part::m_Points, CSG_Shape_Points::m_pParts, and SG_Get_Nearest_Point_On_Line().

Referenced by On_Intersects().

◆ Get_Length() [1/2]

double CSG_Shape_Line::Get_Length ( int iPart )

Definition at line 247 of file shape_line.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Points::m_nParts, CSG_Shape_Part::m_Points, CSG_Shape_Points::m_pParts, and SG_Get_Distance().

◆ Get_Length() [2/2]

double CSG_Shape_Line::Get_Length ( void )

Definition at line 233 of file shape_line.cpp.

References CSG_Shape_Points::m_nParts.

◆ is_Valid()

virtual bool CSG_Shape_Line::is_Valid ( void ) const
inlinevirtual

Reimplemented from CSG_Shape_Points.

Definition at line 606 of file shapes.h.

References CSG_Table::Get_Count().

◆ On_Intersects() [1/2]

TSG_Intersection CSG_Shape_Line::On_Intersects ( CSG_Shape * pShape )
protectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 79 of file shape_line.cpp.

References Get_Distance(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape::Get_Point(), CSG_Shape_Points::Get_Point_Count(), CSG_Shape::Get_Point_Count(), CSG_Shape::Get_Type(), INTERSECTION_Contained, INTERSECTION_None, INTERSECTION_Overlaps, CSG_Shape_Points::m_nParts, SG_Get_Crossing(), SHAPE_TYPE_Line, SHAPE_TYPE_Point, and SHAPE_TYPE_Points.

◆ On_Intersects() [2/2]

TSG_Intersection CSG_Shape_Line::On_Intersects ( TSG_Rect Region )
protectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 160 of file shape_line.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Points::Get_Extent(), CSG_Shape_Points::Get_Point(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, CSG_Rect::Intersects(), CSG_Shape::Intersects(), CSG_Shape_Points::m_nParts, CSG_Shape_Part::m_Points, CSG_Shape_Points::m_pParts, SG_Get_Crossing_InRegion(), SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 602 of file shapes.h.

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_line.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Line Member List

This is the complete list of members for CSG_Shape_Line, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Add_Part(void) | CSG_Shape_Points | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Get_Part(void) | CSG_Shape_Points | inlineprotectedvirtual
_Invalidate(void) | CSG_Shape_Points | inlineprotectedvirtual
_Update_Extent(void) | CSG_Shape_Points | protected
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape_Points | virtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Line(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Line | protected
CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Points | protected
CSG_Shapes class | CSG_Shape_Line | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape_Points | virtual
Del_Parts(void) | CSG_Shape_Points | virtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Destroy(void) | CSG_Shape_Points | virtual
Get_Centroid(void) | CSG_Shape_Line | virtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Line | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point) const | CSG_Shape_Points | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Points | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Points | virtual
Get_Extent(void) | CSG_Shape_Points | inlinevirtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_Length(void) | CSG_Shape_Line |
Get_Length(int iPart) | CSG_Shape_Line |
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_MMax(void) | CSG_Shape_Points | inlinevirtual
Get_MMin(void) | CSG_Shape_Points | inlinevirtual
Get_Part(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Point(int iPoint=0) const | CSG_Shape_Points | virtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_ZMax(void) | CSG_Shape_Points | inlinevirtual
Get_ZMin(void) | CSG_Shape_Points | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Points | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Line | inlinevirtual
m_bUpdate | CSG_Shape_Points | protected
m_Extent | CSG_Shape_Points | protected
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_MMax | CSG_Shape_Points | protected
m_MMin | CSG_Shape_Points | protected
m_nParts | CSG_Shape_Points | protected
m_nPoints | CSG_Shape_Points | protected
m_pParts | CSG_Shape_Points | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
m_ZMax | CSG_Shape_Points | protected
m_ZMin | CSG_Shape_Points | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Points | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Line | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Line | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape_Points | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Line(void) | CSG_Shape_Line | protectedvirtual
~CSG_Shape_Points(void) | CSG_Shape_Points | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Part Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shape_Part Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Part:
CSG_Shape_Polygon_Part

Public Member Functions

class CSG_Shape_Points * | Get_Owner (void)
virtual bool | Destroy (void)
virtual bool | Assign (CSG_Shape_Part *pPart)
const CSG_Rect & | Get_Extent (void)
int | Get_Count (void) const
TSG_Point | Get_Point (int iPoint, bool bAscending=true) const
int | Add_Point (double x, double y)
int | Add_Point (const CSG_Point &p)
int | Add_Point (const CSG_Point_3D &p)
int | Add_Point (const CSG_Point_4D &p)
int | Ins_Point (double x, double y, int iPoint)
int | Ins_Point (const CSG_Point &p, int iPoint)
int | Ins_Point (const CSG_Point_3D &p, int iPoint)
int | Ins_Point (const CSG_Point_4D &p, int iPoint)
int | Set_Point (double x, double y, int iPoint)
int | Set_Point (const CSG_Point &p, int iPoint)
int | Set_Point (const CSG_Point_3D &p, int iPoint)
int | Set_Point (const CSG_Point_4D &p, int iPoint)
int | Del_Point (int iPoint)
void | Set_Z (double z, int iPoint)
double | Get_Z (int iPoint, bool bAscending=true) const
double | Get_ZMin (void)
double | Get_ZMax (void)
TSG_Point_3D | Get_Point_Z (int iPoint, bool bAscending=true) const
void | Set_M (double m, int iPoint)
double | Get_M (int iPoint, bool bAscending=true) const
double | Get_MMin (void)
double | Get_MMax (void)
TSG_Point_4D | Get_Point_ZM (int iPoint, bool bAscending=true) const
bool | Revert_Points (void)

Protected Member Functions

CSG_Shape_Part (class CSG_Shape_Points *pOwner)
virtual | ~CSG_Shape_Part (void)
virtual bool | _Alloc_Memory (int nPoints)
virtual void | _Invalidate (void)
virtual void | _Update_Extent (void)

Protected Attributes

bool | m_bUpdate
int | m_nPoints
int | m_nBuffer
double * | m_Z
double | m_ZMin
double | m_ZMax
double * | m_M
double | m_MMin
double | m_MMax
TSG_Point * m_Points
CSG_Rect m_Extent
class CSG_Shape_Points * | m_pOwner

Friends

class | CSG_Shape_Points
class | CSG_Shape_Line
class | CSG_Shape_Polygon

Detailed Description

Definition at line 371 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Part()

CSG_Shape_Part::CSG_Shape_Part ( class CSG_Shape_Points * pOwner )
protected

Definition at line 63 of file shape_part.cpp.

References m_bUpdate, m_M, m_nBuffer, m_nPoints, m_Points, m_pOwner, and m_Z.

Referenced by CSG_Shape_Points::_Get_Part().

◆ ~CSG_Shape_Part()

CSG_Shape_Part::~CSG_Shape_Part ( void )
protectedvirtual

Definition at line 77 of file shape_part.cpp.

References Destroy().

Member Function Documentation

◆ _Alloc_Memory()

bool CSG_Shape_Part::_Alloc_Memory ( int nPoints )
protectedvirtual

Definition at line 110 of file shape_part.cpp.

References GET_GROW_SIZE, CSG_Table_Record::Get_Table(), m_M, m_nBuffer, m_nPoints, m_Points, m_pOwner, m_Z, SG_Realloc(), SG_VERTEX_TYPE_XY, and SG_VERTEX_TYPE_XYZM.

Referenced by Assign(), Del_Point(), and Ins_Point().

◆ _Invalidate()

void CSG_Shape_Part::_Invalidate ( void )
inlineprotectedvirtual

Reimplemented in CSG_Shape_Polygon_Part.

Definition at line 375 of file shape_part.cpp.

References CSG_Shape_Points::_Invalidate(), m_bUpdate, and m_pOwner.

Referenced by CSG_Shape_Polygon_Part::_Invalidate(), Del_Point(), Destroy(), Ins_Point(), and Set_Point().

◆ _Update_Extent()

void CSG_Shape_Part::_Update_Extent ( void )
protectedvirtual

Definition at line 386 of file shape_part.cpp.

References CSG_Simple_Statistics::Add_Value(), CSG_Rect::Assign(), CSG_Simple_Statistics::Get_Maximum(), CSG_Simple_Statistics::Get_Minimum(), m_bUpdate, m_Extent, m_M, m_MMax, m_MMin, m_nPoints, m_Points, m_Z, m_ZMax, and m_ZMin.

Referenced by CSG_Shape_Points::Get_Extent(), CSG_Shape_Points::Get_MMax(), CSG_Shape_Points::Get_MMin(), CSG_Shape_Points::Get_ZMax(), and CSG_Shape_Points::Get_ZMin().

◆ Add_Point() [1/4]

int CSG_Shape_Part::Add_Point ( const CSG_Point & p )
inline

Definition at line 400 of file shapes.h.

References CSG_Shape_Points::Ins_Point(), and CSG_Shape_Points::m_nPoints.

◆ Add_Point() [2/4]

int CSG_Shape_Part::Add_Point ( const CSG_Point_3D & p )
inline

Definition at line 401 of file shapes.h.

References CSG_Shape_Points::Ins_Point(), and CSG_Shape_Points::m_nPoints.

◆ Add_Point() [3/4]

int CSG_Shape_Part::Add_Point ( const CSG_Point_4D & p )
inline

Definition at line 402 of file shapes.h.

References CSG_Shape_Points::Ins_Point(), and CSG_Shape_Points::m_nPoints.

◆ Add_Point() [4/4]

int CSG_Shape_Part::Add_Point | ( | double | x,
 |  | double | y
 | ) |  |
inline

Definition at line 399 of file shapes.h.

References CSG_Shape_Points::Ins_Point(), and CSG_Shape_Points::m_nPoints.

◆ Assign()

bool CSG_Shape_Part::Assign ( CSG_Shape_Part * pPart )
virtual

Definition at line 177 of file shape_part.cpp.

References _Alloc_Memory(), CSG_Shape_Points::_Invalidate(), m_bUpdate, m_Extent, m_M, m_MMax, m_MMin, m_nPoints, CSG_Shape_Points::m_nPoints, m_Points, m_pOwner, m_Z, m_ZMax, and m_ZMin.

Referenced by CSG_Shape_Points::Add_Part().

◆ Del_Point()

int CSG_Shape_Part::Del_Point ( int iPoint )

Definition at line 319 of file shape_part.cpp.

References _Alloc_Memory(), _Invalidate(), m_M, m_nPoints, CSG_Shape_Points::m_nPoints, m_Points, m_pOwner, and m_Z.

◆ Destroy()

bool CSG_Shape_Part::Destroy ( void )
virtual

Definition at line 83 of file shape_part.cpp.

References _Invalidate(), m_bUpdate, m_M, m_nBuffer, m_nPoints, CSG_Shape_Points::m_nPoints, m_Points, m_pOwner, m_Z, and SG_Free().

Referenced by ~CSG_Shape_Part().

◆ Get_Count()

int CSG_Shape_Part::Get_Count ( void ) const
inline

Definition at line 386 of file shapes.h.

References CSG_Shape_Points::m_nPoints.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_Shape_Polygon_Part::_is_OnEdge(), CSG_Shape_Points::_Update_Extent(), CSG_Shape_Points::Get_Distance(), CSG_Shape_Line::Get_Distance(), CSG_Shape_Line::Get_Length(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Shape_Polygon_Part::is_Neighbour(), CSG_Shape_Points::is_Valid(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ Get_Extent()

const CSG_Rect& CSG_Shape_Part::Get_Extent ( void )
inline

Definition at line 384 of file shapes.h.

References CSG_Shape_Points::_Update_Extent(), and CSG_Shape_Points::m_Extent.

Referenced by CSG_Shape_Polygon_Part::_Update_Area(), CSG_Shape_Points::_Update_Extent(), CSG_Shape_Polygon_Part::Contains(), CSG_Shape_Polygon_Part::Get_Point_Relation(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Shape_Polygon_Part::is_Neighbour(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ Get_M()

double CSG_Shape_Part::Get_M | ( | int | iPoint,
 |  | bool | bAscending = true
 | ) |  | const
 inline

Definition at line 432 of file shapes.h.

References CSG_Shape_Points::m_nPoints.

◆ Get_MMax()

double CSG_Shape_Part::Get_MMax ( void )
inline

Definition at line 434 of file shapes.h.

References CSG_Shape_Points::_Update_Extent(), and CSG_Shape_Points::m_MMax.

Referenced by CSG_Shape_Points::_Update_Extent().

◆ Get_MMin()

double CSG_Shape_Part::Get_MMin ( void )
inline

Definition at line 433 of file shapes.h.

References CSG_Shape_Points::_Update_Extent(), and CSG_Shape_Points::m_MMin.

Referenced by CSG_Shape_Points::_Update_Extent().

◆ Get_Owner()

class CSG_Shape_Points* CSG_Shape_Part::Get_Owner ( void )
inline

Definition at line 379 of file shapes.h.

◆ Get_Point()

TSG_Point CSG_Shape_Part::Get_Point | ( | int | iPoint,
 |  | bool | bAscending = true
 | ) |  | const
 inline

Definition at line 388 of file shapes.h.

References CSG_Shape_Points::m_nPoints.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_Shape_Polygon_Part::_is_OnEdge(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Shape_Polygon::is_Lake(), and CSG_Shape_Polygon_Part::is_Neighbour().

◆ Get_Point_Z()

TSG_Point_3D CSG_Shape_Part::Get_Point_Z | ( | int | iPoint,
 |  | bool | bAscending = true
 | ) |  | const
 inline

Definition at line 420 of file shapes.h.

References CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Z(), SSG_Point::x, SSG_Point_3D::x, SSG_Point::y, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Get_Point_ZM()

TSG_Point_4D CSG_Shape_Part::Get_Point_ZM | ( | int | iPoint,
 |  | bool | bAscending = true
 | ) |  | const
 inline

Definition at line 435 of file shapes.h.

References CSG_Shape_Points::Get_M(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Z(), SSG_Point_4D::m, SSG_Point::x, SSG_Point_4D::x, SSG_Point::y, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Get_Z()

double CSG_Shape_Part::Get_Z | ( | int | iPoint,
 |  | bool | bAscending = true
 | ) |  | const
 inline

Definition at line 417 of file shapes.h.

References CSG_Shape_Points::m_nPoints.

◆ Get_ZMax()

double CSG_Shape_Part::Get_ZMax ( void )
inline

Definition at line 419 of file shapes.h.

References CSG_Shape_Points::_Update_Extent(), and CSG_Shape_Points::m_ZMax.

Referenced by CSG_Shape_Points::_Update_Extent().

◆ Get_ZMin()

double CSG_Shape_Part::Get_ZMin ( void )
inline

Definition at line 418 of file shapes.h.

References CSG_Shape_Points::_Update_Extent(), and CSG_Shape_Points::m_ZMin.

Referenced by CSG_Shape_Points::_Update_Extent().

◆ Ins_Point() [1/4]

int CSG_Shape_Part::Ins_Point | ( | const CSG_Point & | p,
 |  | int | iPoint
 | ) |  |
inline

Definition at line 405 of file shapes.h.

References Ins_Point(), SSG_Point::x, and SSG_Point::y.

Referenced by Ins_Point().

◆ Ins_Point() [2/4]

int CSG_Shape_Part::Ins_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint
 | ) |  |

Definition at line 252 of file shape_part.cpp.

References Ins_Point(), Set_Z(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Ins_Point() [3/4]

int CSG_Shape_Part::Ins_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint
 | ) |  |

Definition at line 264 of file shape_part.cpp.

References Ins_Point(), SSG_Point_4D::m, Set_M(), Set_Z(), SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Ins_Point() [4/4]

int CSG_Shape_Part::Ins_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint
 | ) |  |

Definition at line 224 of file shape_part.cpp.

References _Alloc_Memory(), _Invalidate(), m_M, m_nPoints, CSG_Shape_Points::m_nPoints, m_Points, m_pOwner, m_Z, SSG_Point::x, and SSG_Point::y.

Referenced by Ins_Point().

◆ Revert_Points()

bool CSG_Shape_Part::Revert_Points ( void )

Definition at line 356 of file shape_part.cpp.

References m_M, m_nPoints, m_Points, and m_Z.

Referenced by CSG_Shape_Points::Add_Part().

◆ Set_M()

void CSG_Shape_Part::Set_M | ( | double | m,
 |  | int | iPoint
 | ) |  |
inline

Definition at line 431 of file shapes.h.

References CSG_Shape_Points::_Invalidate(), and CSG_Shape_Points::m_nPoints.

Referenced by Ins_Point(), CSG_Shape_Points::On_Assign(), and Set_Point().

◆ Set_Point() [1/4]

int CSG_Shape_Part::Set_Point | ( | const CSG_Point & | p,
 |  | int | iPoint
 | ) |  |
inline

Definition at line 410 of file shapes.h.

References Set_Point(), SSG_Point::x, and SSG_Point::y.

Referenced by Set_Point().

◆ Set_Point() [2/4]

int CSG_Shape_Part::Set_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint
 | ) |  |

Definition at line 293 of file shape_part.cpp.

References Set_Point(), Set_Z(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Set_Point() [3/4]

int CSG_Shape_Part::Set_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint
 | ) |  |

Definition at line 305 of file shape_part.cpp.

References SSG_Point_4D::m, Set_M(), Set_Point(), Set_Z(), SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Set_Point() [4/4]

int CSG_Shape_Part::Set_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint
 | ) |  |

Definition at line 278 of file shape_part.cpp.

References _Invalidate(), m_nPoints, m_Points, SSG_Point::x, and SSG_Point::y.

Referenced by Set_Point().

◆ Set_Z()

void CSG_Shape_Part::Set_Z | ( | double | z,
 |  | int | iPoint
 | ) |  |
inline

Definition at line 416 of file shapes.h.

References CSG_Shape_Points::_Invalidate(), and CSG_Shape_Points::m_nPoints.

Referenced by Ins_Point(), CSG_Shape_Points::On_Assign(), and Set_Point().

Friends And Related Function Documentation

◆ CSG_Shape_Line

friend class CSG_Shape_Line
friend

Definition at line 374 of file shapes.h.

◆ CSG_Shape_Points

friend class CSG_Shape_Points
friend

Definition at line 373 of file shapes.h.

◆ CSG_Shape_Polygon

friend class CSG_Shape_Polygon
friend

Definition at line 375 of file shapes.h.

Member Data Documentation

◆ m_bUpdate

bool CSG_Shape_Part::m_bUpdate
protected

Definition at line 456 of file shapes.h.

Referenced by _Invalidate(), CSG_Shape_Points::_Invalidate(), _Update_Extent(), Assign(), CSG_Shape_Part(), and Destroy().

◆ m_Extent

CSG_Rect CSG_Shape_Part::m_Extent
protected

Definition at line 464 of file shapes.h.

Referenced by _Update_Extent(), Assign(), and CSG_Shape_Points::Get_Extent().

◆ m_M

double * CSG_Shape_Part::m_M
protected

Definition at line 460 of file shapes.h.

Referenced by _Alloc_Memory(), _Update_Extent(), Assign(), CSG_Shape_Part(), Del_Point(), Destroy(), Ins_Point(), and Revert_Points().

◆ m_MMax

double CSG_Shape_Part::m_MMax
protected

Definition at line 460 of file shapes.h.

Referenced by _Update_Extent(), Assign(), and CSG_Shape_Points::Get_MMax().

◆ m_MMin

double CSG_Shape_Part::m_MMin
protected

Definition at line 460 of file shapes.h.

Referenced by _Update_Extent(), Assign(), and CSG_Shape_Points::Get_MMin().

◆ m_nBuffer

int CSG_Shape_Part::m_nBuffer
protected

Definition at line 458 of file shapes.h.

Referenced by _Alloc_Memory(), CSG_Shape_Part(), and Destroy().

◆ m_nPoints

int CSG_Shape_Part::m_nPoints
protected

Definition at line 458 of file shapes.h.

Referenced by _Alloc_Memory(), CSG_Shape_Polygon_Part::_Update_Area(), _Update_Extent(), Assign(), CSG_Shape_Polygon_Part::Contains(), CSG_Shape_Part(), Del_Point(), Destroy(), CSG_Shape_Polygon_Part::Get_Distance(), CSG_Shape_Points::Get_Point_Count(), CSG_Shape_Polygon_Part::Get_Point_Relation(), Ins_Point(), CSG_Shape_Polygon::is_Lake(), CSG_Shape_Polygon::On_Intersects(), Revert_Points(), and Set_Point().

◆ m_Points

TSG_Point* CSG_Shape_Part::m_Points
protected

Definition at line 462 of file shapes.h.

Referenced by _Alloc_Memory(), CSG_Shape_Polygon_Part::_Update_Area(), _Update_Extent(), Assign(), CSG_Shape_Polygon_Part::Contains(), CSG_Shape_Part(), Del_Point(), Destroy(), CSG_Shape_Polygon_Part::Get_Distance(), CSG_Shape_Points::Get_Distance(), CSG_Shape_Line::Get_Distance(), CSG_Shape_Line::Get_Length(), CSG_Shape_Polygon_Part::Get_Point_Relation(), Ins_Point(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), Revert_Points(), and Set_Point().

◆ m_pOwner

class CSG_Shape_Points* CSG_Shape_Part::m_pOwner
protected

Definition at line 466 of file shapes.h.

Referenced by _Alloc_Memory(), _Invalidate(), Assign(), CSG_Shape_Part(), Del_Point(), Destroy(), and Ins_Point().

◆ m_Z

double* CSG_Shape_Part::m_Z
protected

Definition at line 460 of file shapes.h.

Referenced by _Alloc_Memory(), _Update_Extent(), Assign(), CSG_Shape_Part(), Del_Point(), Destroy(), Ins_Point(), and Revert_Points().

◆ m_ZMax

double CSG_Shape_Part::m_ZMax
protected

Definition at line 460 of file shapes.h.

Referenced by _Update_Extent(), Assign(), and CSG_Shape_Points::Get_ZMax().

◆ m_ZMin

double CSG_Shape_Part::m_ZMin
protected

Definition at line 460 of file shapes.h.

Referenced by _Update_Extent(), Assign(), and CSG_Shape_Points::Get_ZMin().

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_part.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Part Member List

This is the complete list of members for CSG_Shape_Part, including all inherited members.

_Alloc_Memory(int nPoints) | CSG_Shape_Part | protectedvirtual
_Invalidate(void) | CSG_Shape_Part | inlineprotectedvirtual
_Update_Extent(void) | CSG_Shape_Part | protectedvirtual
Add_Point(double x, double y) | CSG_Shape_Part | inline
Add_Point(const CSG_Point &p) | CSG_Shape_Part | inline
Add_Point(const CSG_Point_3D &p) | CSG_Shape_Part | inline
Add_Point(const CSG_Point_4D &p) | CSG_Shape_Part | inline
Assign(CSG_Shape_Part *pPart) | CSG_Shape_Part | virtual
CSG_Shape_Line class | CSG_Shape_Part | friend
CSG_Shape_Part(class CSG_Shape_Points *pOwner) | CSG_Shape_Part | protected
CSG_Shape_Points class | CSG_Shape_Part | friend
CSG_Shape_Polygon class | CSG_Shape_Part | friend
Del_Point(int iPoint) | CSG_Shape_Part |
Destroy(void) | CSG_Shape_Part | virtual
Get_Count(void) const | CSG_Shape_Part | inline
Get_Extent(void) | CSG_Shape_Part | inline
Get_M(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_MMax(void) | CSG_Shape_Part | inline
Get_MMin(void) | CSG_Shape_Part | inline
Get_Owner(void) | CSG_Shape_Part | inline
Get_Point(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Point_Z(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Point_ZM(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Z(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_ZMax(void) | CSG_Shape_Part | inline
Get_ZMin(void) | CSG_Shape_Part | inline
Ins_Point(double x, double y, int iPoint) | CSG_Shape_Part |
Ins_Point(const CSG_Point &p, int iPoint) | CSG_Shape_Part | inline
Ins_Point(const CSG_Point_3D &p, int iPoint) | CSG_Shape_Part |
Ins_Point(const CSG_Point_4D &p, int iPoint) | CSG_Shape_Part |
m_bUpdate | CSG_Shape_Part | protected
m_Extent | CSG_Shape_Part | protected
m_M | CSG_Shape_Part | protected
m_MMax | CSG_Shape_Part | protected
m_MMin | CSG_Shape_Part | protected
m_nBuffer | CSG_Shape_Part | protected
m_nPoints | CSG_Shape_Part | protected
m_Points | CSG_Shape_Part | protected
m_pOwner | CSG_Shape_Part | protected
m_Z | CSG_Shape_Part | protected
m_ZMax | CSG_Shape_Part | protected
m_ZMin | CSG_Shape_Part | protected
Revert_Points(void) | CSG_Shape_Part |
Set_M(double m, int iPoint) | CSG_Shape_Part | inline
Set_Point(double x, double y, int iPoint) | CSG_Shape_Part |
Set_Point(const CSG_Point &p, int iPoint) | CSG_Shape_Part | inline
Set_Point(const CSG_Point_3D &p, int iPoint) | CSG_Shape_Part |
Set_Point(const CSG_Point_4D &p, int iPoint) | CSG_Shape_Part |
Set_Z(double z, int iPoint) | CSG_Shape_Part | inline
~CSG_Shape_Part(void) | CSG_Shape_Part | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Point Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shape_Point Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Point:
CSG_Shape CSG_Table_Record CSG_Shape_Point_Z CSG_Shape_Point_ZM

Public Member Functions

virtual bool | is_Valid (void) const
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual TSG_Point | Get_Centroid (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
- Public Member Functions inherited from CSG_Shape
virtual void | Destroy (void)
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Shape_Point (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Point (void)
virtual bool | On_Assign (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
virtual void | _Invalidate (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Protected Attributes

TSG_Point m_Point
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Friends

class CSG_Shapes

Additional Inherited Members

- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * _Create_Value (TSG_Data_Type Type)

Detailed Description

Definition at line 264 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Point()

CSG_Shape_Point::CSG_Shape_Point | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 63 of file shape_point.cpp.

◆ ~CSG_Shape_Point()

CSG_Shape_Point::~CSG_Shape_Point ( void )
protectedvirtual

Definition at line 68 of file shape_point.cpp.

Member Function Documentation

◆ Add_Point() [1/4]

virtual int CSG_Shape_Point::Add_Point | ( | const CSG_Point & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 277 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Add_Point() [2/4]

virtual int CSG_Shape_Point::Add_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 278 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Add_Point() [3/4]

virtual int CSG_Shape_Point::Add_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 279 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Add_Point() [4/4]

virtual int CSG_Shape_Point::Add_Point | ( | double | x,
 |  | double | y,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 276 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Del_Point()

virtual int CSG_Shape_Point::Del_Point | ( | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 291 of file shapes.h.

◆ Get_Centroid()

virtual TSG_Point CSG_Shape_Point::Get_Centroid ( void )
inlinevirtual

Implements CSG_Shape.

Definition at line 296 of file shapes.h.

◆ Get_Distance() [1/4]

virtual double CSG_Shape_Point::Get_Distance ( TSG_Point Point ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 300 of file shapes.h.

References SG_Get_Distance().

◆ Get_Distance() [2/4]

virtual double CSG_Shape_Point::Get_Distance | ( | TSG_Point | Point,
 |  | int | iPart
 | ) |  | const
 inlinevirtual

Implements CSG_Shape.

Definition at line 301 of file shapes.h.

References SG_Get_Distance().

◆ Get_Distance() [3/4]

virtual double CSG_Shape_Point::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next
 | ) |  | const
 inlinevirtual

Implements CSG_Shape.

Definition at line 302 of file shapes.h.

References SG_Get_Distance().

◆ Get_Distance() [4/4]

virtual double CSG_Shape_Point::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next,
 |  | int | iPart
 | ) |  | const
 inlinevirtual

Implements CSG_Shape.

Definition at line 303 of file shapes.h.

References SG_Get_Distance().

◆ Get_Extent()

const CSG_Rect & CSG_Shape_Point::Get_Extent ( void )
virtual

Implements CSG_Shape.

Definition at line 97 of file shape_point.cpp.

References CSG_Rect::Assign(), m_Point, SSG_Point::x, and SSG_Point::y.

◆ Get_Part_Count()

virtual int CSG_Shape_Point::Get_Part_Count ( void ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 274 of file shapes.h.

◆ Get_Point() [1/2]

virtual TSG_Point CSG_Shape_Point::Get_Point | ( | int | iPoint,
 |  | int | iPart,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Implements CSG_Shape.

Definition at line 294 of file shapes.h.

◆ Get_Point() [2/2]

virtual TSG_Point CSG_Shape_Point::Get_Point ( int iPoint = 0 ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 293 of file shapes.h.

◆ Get_Point_Count() [1/2]

virtual int CSG_Shape_Point::Get_Point_Count ( int iPart ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 273 of file shapes.h.

◆ Get_Point_Count() [2/2]

virtual int CSG_Shape_Point::Get_Point_Count ( void ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 272 of file shapes.h.

◆ Ins_Point() [1/4]

virtual int CSG_Shape_Point::Ins_Point | ( | const CSG_Point & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 282 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Ins_Point() [2/4]

virtual int CSG_Shape_Point::Ins_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 283 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Ins_Point() [3/4]

virtual int CSG_Shape_Point::Ins_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 284 of file shapes.h.

References CSG_Shape::Set_Point().

◆ Ins_Point() [4/4]

virtual int CSG_Shape_Point::Ins_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 281 of file shapes.h.

References CSG_Shape::Set_Point().

◆ is_Valid()

virtual bool CSG_Shape_Point::is_Valid ( void ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 270 of file shapes.h.

◆ On_Assign()

bool CSG_Shape_Point::On_Assign ( CSG_Shape * pShape )
protectedvirtual

Implements CSG_Shape.

Definition at line 77 of file shape_point.cpp.

References CSG_Shape::Get_M(), CSG_Shape::Get_Point(), CSG_Shape::Get_Point_Count(), CSG_Shape::Get_Z(), CSG_Shape::Set_M(), Set_Point(), and CSG_Shape::Set_Z().

◆ On_Intersects() [1/2]

TSG_Intersection CSG_Shape_Point::On_Intersects ( CSG_Shape * pShape )
protectedvirtual

Implements CSG_Shape.

Definition at line 107 of file shape_point.cpp.

References INTERSECTION_None.

◆ On_Intersects() [2/2]

TSG_Intersection CSG_Shape_Point::On_Intersects ( TSG_Rect Region )
protectedvirtual

Implements CSG_Shape.

Definition at line 113 of file shape_point.cpp.

References INTERSECTION_None, INTERSECTION_Overlaps, m_Point, SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Set_Point() [1/4]

virtual int CSG_Shape_Point::Set_Point | ( | const CSG_Point & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 287 of file shapes.h.

References CSG_Shape::_Invalidate(), SSG_Point::x, and SSG_Point::y.

◆ Set_Point() [2/4]

virtual int CSG_Shape_Point::Set_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 288 of file shapes.h.

References CSG_Shape::_Invalidate(), CSG_Shape::Set_Z(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Set_Point() [3/4]

virtual int CSG_Shape_Point::Set_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 289 of file shapes.h.

References CSG_Shape::_Invalidate(), SSG_Point_4D::m, CSG_Shape::Set_M(), CSG_Shape::Set_Z(), SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Set_Point() [4/4]

virtual int CSG_Shape_Point::Set_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 286 of file shapes.h.

References CSG_Shape::_Invalidate().

Referenced by On_Assign().

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 266 of file shapes.h.

Member Data Documentation

◆ m_Point

TSG_Point CSG_Shape_Point::m_Point
protected

Definition at line 312 of file shapes.h.

Referenced by Get_Extent(), and On_Intersects().

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_point.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Point Member List

This is the complete list of members for CSG_Shape_Point, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Invalidate(void) | CSG_Shape | inlineprotectedvirtual
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape | inlinevirtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point | protected
CSG_Shapes class | CSG_Shape_Point | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape | inlinevirtual
Del_Parts(void) | CSG_Shape | inlinevirtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Destroy(void) | CSG_Shape | virtual
Get_Centroid(void) | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Extent(void) | CSG_Shape_Point | virtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_MMax(void) | CSG_Shape | inlinevirtual
Get_MMin(void) | CSG_Shape | inlinevirtual
Get_Part(int iPart) const | CSG_Shape | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint=0) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_ZMax(void) | CSG_Shape | inlinevirtual
Get_ZMin(void) | CSG_Shape | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Point | inlinevirtual
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_Point | CSG_Shape_Point | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Point | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Point(void) | CSG_Shape_Point | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Point_Z Class Reference

Public Member Functions | Friends | List of all members
CSG_Shape_Point_Z Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Point_Z:
CSG_Shape_Point CSG_Shape CSG_Table_Record CSG_Shape_Point_ZM

Public Member Functions

CSG_Shape_Point_Z (class CSG_Shapes *pOwner, sLong Index)
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
- Public Member Functions inherited from CSG_Shape_Point
virtual bool | is_Valid (void) const
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual TSG_Point | Get_Centroid (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
- Public Member Functions inherited from CSG_Shape
virtual void | Destroy (void)
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Friends

class CSG_Shapes

Additional Inherited Members

- Protected Member Functions inherited from CSG_Shape_Point
CSG_Shape_Point (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Point (void)
virtual bool | On_Assign (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
virtual void | _Invalidate (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const
- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * | _Create_Value (TSG_Data_Type Type)
- Protected Attributes inherited from CSG_Shape_Point
TSG_Point m_Point
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Detailed Description

Definition at line 322 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Point_Z()

CSG_Shape_Point_Z::CSG_Shape_Point_Z | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
inline

Definition at line 328 of file shapes.h.

Member Function Documentation

◆ Get_Z()

virtual double CSG_Shape_Point_Z::Get_Z | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 331 of file shapes.h.

◆ Get_ZMax()

virtual double CSG_Shape_Point_Z::Get_ZMax ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 333 of file shapes.h.

◆ Get_ZMin()

virtual double CSG_Shape_Point_Z::Get_ZMin ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 332 of file shapes.h.

◆ Set_Z()

virtual void CSG_Shape_Point_Z::Set_Z | ( | double | z,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 330 of file shapes.h.

References CSG_Shape::_Invalidate().

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 324 of file shapes.h.

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Point_Z Member List

This is the complete list of members for CSG_Shape_Point_Z, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Invalidate(void) | CSG_Shape | inlineprotectedvirtual
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape | inlinevirtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point | protected
CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point_Z | inline
CSG_Shapes class | CSG_Shape_Point_Z | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape | inlinevirtual
Del_Parts(void) | CSG_Shape | inlinevirtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Destroy(void) | CSG_Shape | virtual
Get_Centroid(void) | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Extent(void) | CSG_Shape_Point | virtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_MMax(void) | CSG_Shape | inlinevirtual
Get_MMin(void) | CSG_Shape | inlinevirtual
Get_Part(int iPart) const | CSG_Shape | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint=0) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Point_Z | inlinevirtual
Get_ZMax(void) | CSG_Shape_Point_Z | inlinevirtual
Get_ZMin(void) | CSG_Shape_Point_Z | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Point | inlinevirtual
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_Point | CSG_Shape_Point | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Point | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape_Point_Z | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Point(void) | CSG_Shape_Point | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Point_ZM Class Reference

Public Member Functions | Friends | List of all members
CSG_Shape_Point_ZM Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Point_ZM:
CSG_Shape_Point_Z CSG_Shape_Point CSG_Shape CSG_Table_Record

Public Member Functions

CSG_Shape_Point_ZM (class CSG_Shapes *pOwner, sLong Index)
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
- Public Member Functions inherited from CSG_Shape_Point_Z
CSG_Shape_Point_Z (class CSG_Shapes *pOwner, sLong Index)
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
- Public Member Functions inherited from CSG_Shape_Point
virtual bool | is_Valid (void) const
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual TSG_Point | Get_Centroid (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
- Public Member Functions inherited from CSG_Shape
virtual void | Destroy (void)
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Friends

class CSG_Shapes

Additional Inherited Members

- Protected Member Functions inherited from CSG_Shape_Point
CSG_Shape_Point (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Point (void)
virtual bool | On_Assign (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
virtual void | _Invalidate (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const
- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * | _Create_Value (TSG_Data_Type Type)
- Protected Attributes inherited from CSG_Shape_Point
TSG_Point m_Point
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Detailed Description

Definition at line 343 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Point_ZM()

CSG_Shape_Point_ZM::CSG_Shape_Point_ZM | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
inline

Definition at line 349 of file shapes.h.

Member Function Documentation

◆ Get_M()

virtual double CSG_Shape_Point_ZM::Get_M | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 352 of file shapes.h.

◆ Get_MMax()

virtual double CSG_Shape_Point_ZM::Get_MMax ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 354 of file shapes.h.

◆ Get_MMin()

virtual double CSG_Shape_Point_ZM::Get_MMin ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 353 of file shapes.h.

◆ Set_M()

virtual void CSG_Shape_Point_ZM::Set_M | ( | double | m,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 351 of file shapes.h.

References CSG_Shape::_Invalidate().

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 345 of file shapes.h.

The documentation for this class was generated from the following file:
  • shapes.h
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Point_ZM Member List

This is the complete list of members for CSG_Shape_Point_ZM, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Invalidate(void) | CSG_Shape | inlineprotectedvirtual
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape | inlinevirtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Point | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point | protected
CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point_Z | inline
CSG_Shape_Point_ZM(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Point_ZM | inline
CSG_Shapes class | CSG_Shape_Point_ZM | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape | inlinevirtual
Del_Parts(void) | CSG_Shape | inlinevirtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Destroy(void) | CSG_Shape | virtual
Get_Centroid(void) | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Point | inlinevirtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Extent(void) | CSG_Shape_Point | virtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Point_ZM | inlinevirtual
Get_MMax(void) | CSG_Shape_Point_ZM | inlinevirtual
Get_MMin(void) | CSG_Shape_Point_ZM | inlinevirtual
Get_Part(int iPart) const | CSG_Shape | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint=0) const | CSG_Shape_Point | inlinevirtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Point | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Point | inlinevirtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Point_Z | inlinevirtual
Get_ZMax(void) | CSG_Shape_Point_Z | inlinevirtual
Get_ZMin(void) | CSG_Shape_Point_Z | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Point | inlinevirtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Point | inlinevirtual
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_Point | CSG_Shape_Point | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Point | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Point | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape_Point_ZM | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Point | inlinevirtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape_Point_Z | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Point(void) | CSG_Shape_Point | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Points Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shape_Points Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Points:
CSG_Shape CSG_Table_Record CSG_Shape_Line CSG_Shape_Polygon

Public Member Functions

virtual void | Destroy (void)
virtual bool | is_Valid (void) const
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual TSG_Point | Get_Centroid (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Shape
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Shape_Points (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Points (void)
int | _Add_Part (void)
virtual CSG_Shape_Part * | _Get_Part (void)
virtual void | _Invalidate (void)
void | _Update_Extent (void)
virtual bool | On_Assign (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Protected Attributes

bool | m_bUpdate
int | m_nParts
int | m_nPoints
double | m_ZMin
double | m_ZMax
double | m_MMin
double | m_MMax
CSG_Rect m_Extent
CSG_Shape_Part ** m_pParts
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Friends

class | CSG_Shapes
class | CSG_Shape_Part

Additional Inherited Members

- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * _Create_Value (TSG_Data_Type Type)

Detailed Description

Definition at line 483 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Points()

CSG_Shape_Points::CSG_Shape_Points | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 63 of file shape_points.cpp.

References m_bUpdate, m_nParts, m_nPoints, and m_pParts.

◆ ~CSG_Shape_Points()

CSG_Shape_Points::~CSG_Shape_Points ( void )
protectedvirtual

Definition at line 75 of file shape_points.cpp.

References Destroy().

Member Function Documentation

◆ _Add_Part()

int CSG_Shape_Points::_Add_Part ( void )
protected

Definition at line 133 of file shape_points.cpp.

References _Get_Part(), m_nParts, m_pParts, and SG_Realloc().

Referenced by Add_Part(), and Ins_Point().

◆ _Get_Part()

virtual CSG_Shape_Part* CSG_Shape_Points::_Get_Part ( void )
inlineprotectedvirtual

Reimplemented in CSG_Shape_Polygon.

Definition at line 572 of file shapes.h.

References CSG_Shape_Part::CSG_Shape_Part().

Referenced by _Add_Part().

◆ _Invalidate()

virtual void CSG_Shape_Points::_Invalidate ( void )
inlineprotectedvirtual

Reimplemented from CSG_Shape.

Reimplemented in CSG_Shape_Polygon.

Definition at line 574 of file shapes.h.

References CSG_Shape::_Invalidate(), and CSG_Shape_Part::m_bUpdate.

Referenced by CSG_Shape_Part::_Invalidate(), CSG_Shape_Polygon::_Invalidate(), CSG_Shape_Part::Assign(), Del_Part(), CSG_Shape_Part::Set_M(), and CSG_Shape_Part::Set_Z().

◆ _Update_Extent()

void CSG_Shape_Points::_Update_Extent ( void )
protected

Definition at line 313 of file shape_points.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_MMax(), Get_MMax(), CSG_Shape_Part::Get_MMin(), CSG_Shape_Part::Get_ZMax(), Get_ZMax(), CSG_Shape_Part::Get_ZMin(), m_bUpdate, m_Extent, m_MMax, m_MMin, m_nParts, m_pParts, m_ZMax, m_ZMin, and CSG_Rect::Union().

Referenced by CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_MMax(), CSG_Shape_Part::Get_MMin(), CSG_Shape_Part::Get_ZMax(), and CSG_Shape_Part::Get_ZMin().

◆ Add_Part()

int CSG_Shape_Points::Add_Part | ( | class CSG_Shape_Part * | pPart,
 |  | bool | bRevert = false
 | ) |  |
virtual

Reimplemented from CSG_Shape.

Definition at line 143 of file shape_points.cpp.

References _Add_Part(), CSG_Shape_Part::Assign(), m_nParts, m_pParts, and CSG_Shape_Part::Revert_Points().

Referenced by On_Assign().

◆ Add_Point() [1/4]

virtual int CSG_Shape_Points::Add_Point | ( | const CSG_Point & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 504 of file shapes.h.

References CSG_Shape::Get_Point_Count(), and CSG_Shape::Ins_Point().

◆ Add_Point() [2/4]

virtual int CSG_Shape_Points::Add_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 505 of file shapes.h.

References CSG_Shape::Get_Point_Count(), and CSG_Shape::Ins_Point().

◆ Add_Point() [3/4]

virtual int CSG_Shape_Points::Add_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 506 of file shapes.h.

References CSG_Shape::Get_Point_Count(), and CSG_Shape::Ins_Point().

◆ Add_Point() [4/4]

virtual int CSG_Shape_Points::Add_Point | ( | double | x,
 |  | double | y,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 503 of file shapes.h.

References CSG_Shape::Get_Point_Count(), and CSG_Shape::Ins_Point().

Referenced by On_Assign().

◆ Del_Part()

int CSG_Shape_Points::Del_Part ( int iPart )
virtual

Reimplemented from CSG_Shape.

Definition at line 161 of file shape_points.cpp.

References _Invalidate(), m_nParts, m_pParts, and SG_Realloc().

Referenced by Del_Parts().

◆ Del_Parts()

int CSG_Shape_Points::Del_Parts ( void )
virtual

Reimplemented from CSG_Shape.

Definition at line 183 of file shape_points.cpp.

References Del_Part(), and m_nParts.

Referenced by Destroy(), and On_Assign().

◆ Del_Point()

int CSG_Shape_Points::Del_Point | ( | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 283 of file shape_points.cpp.

References m_nParts, and m_pParts.

◆ Destroy()

void CSG_Shape_Points::Destroy ( void )
virtual

Reimplemented from CSG_Shape.

Definition at line 86 of file shape_points.cpp.

References Del_Parts(), and CSG_Shape::Destroy().

Referenced by ~CSG_Shape_Points().

◆ Get_Centroid()

TSG_Point CSG_Shape_Points::Get_Centroid ( void )
virtual

Implements CSG_Shape.

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Line.

Definition at line 364 of file shape_points.cpp.

References CSG_Point::Assign(), Get_Part_Count(), Get_Point(), Get_Point_Count(), SSG_Point::x, and SSG_Point::y.

◆ Get_Distance() [1/4]

double CSG_Shape_Points::Get_Distance ( TSG_Point Point ) const
virtual

Implements CSG_Shape.

Definition at line 391 of file shape_points.cpp.

Referenced by Get_Distance().

◆ Get_Distance() [2/4]

double CSG_Shape_Points::Get_Distance | ( | TSG_Point | Point,
 |  | int | iPart
 | ) |  | const
 virtual

Implements CSG_Shape.

Definition at line 397 of file shape_points.cpp.

References Get_Distance().

◆ Get_Distance() [3/4]

double CSG_Shape_Points::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next
 | ) |  | const
 virtual

Implements CSG_Shape.

Definition at line 403 of file shape_points.cpp.

References Get_Distance(), and m_nParts.

◆ Get_Distance() [4/4]

double CSG_Shape_Points::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next,
 |  | int | iPart
 | ) |  | const
 virtual

Implements CSG_Shape.

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Line.

Definition at line 421 of file shape_points.cpp.

References CSG_Shape_Part::Get_Count(), m_nParts, CSG_Shape_Part::m_Points, m_pParts, and SG_Get_Distance().

◆ Get_Extent()

virtual const CSG_Rect& CSG_Shape_Points::Get_Extent ( void )
inlinevirtual

Implements CSG_Shape.

Definition at line 541 of file shapes.h.

References CSG_Shape_Part::_Update_Extent(), and CSG_Shape_Part::m_Extent.

Referenced by CSG_Shape_Polygon::Contains(), CSG_Shape_Line::Get_Centroid(), CSG_Shape_Polygon::Get_Point_Relation(), CSG_Shape_Polygon::Get_Shared_Edges(), CSG_Shape_Polygon::is_Neighbour(), CSG_Shape_Polygon::is_OnEdge(), CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ Get_M()

virtual double CSG_Shape_Points::Get_M | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 537 of file shapes.h.

References Get_M().

Referenced by Get_M(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), and CSG_Shapes::Make_Clean().

◆ Get_MMax()

virtual double CSG_Shape_Points::Get_MMax ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 539 of file shapes.h.

References CSG_Shape_Part::_Update_Extent(), and CSG_Shape_Part::m_MMax.

Referenced by _Update_Extent().

◆ Get_MMin()

virtual double CSG_Shape_Points::Get_MMin ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 538 of file shapes.h.

References CSG_Shape_Part::_Update_Extent(), and CSG_Shape_Part::m_MMin.

◆ Get_Part()

virtual CSG_Shape_Part* CSG_Shape_Points::Get_Part ( int iPart ) const
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 499 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Polygon_Part(), On_Assign(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Get_Part_Count()

virtual int CSG_Shape_Points::Get_Part_Count ( void ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 496 of file shapes.h.

Referenced by Get_Centroid(), CSG_Shape_Polygon::Get_Shared_Edges(), CSG_Shapes::Make_Clean(), CSG_Shape_Polygon::On_Intersects(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Get_Point() [1/2]

virtual TSG_Point CSG_Shape_Points::Get_Point | ( | int | iPoint,
 |  | int | iPart,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Implements CSG_Shape.

Definition at line 521 of file shapes.h.

References CSG_Shape::Get_Point().

◆ Get_Point() [2/2]

TSG_Point CSG_Shape_Points::Get_Point ( int iPoint = 0 ) const
virtual

Implements CSG_Shape.

Definition at line 294 of file shape_points.cpp.

References CSG_Shape_Part::Get_Count(), m_nParts, and m_pParts.

Referenced by Get_Centroid(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Shape_Polygon::is_Neighbour(), CSG_Shapes::Make_Clean(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Get_Point_Count() [1/2]

virtual int CSG_Shape_Points::Get_Point_Count ( int iPart ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 495 of file shapes.h.

References CSG_Shape_Part::Get_Count().

◆ Get_Point_Count() [2/2]

virtual int CSG_Shape_Points::Get_Point_Count ( void ) const
inlinevirtual

Implements CSG_Shape.

Definition at line 494 of file shapes.h.

References CSG_Shape_Part::m_nPoints.

Referenced by Get_Centroid(), CSG_Shape_Polygon::is_Neighbour(), CSG_Shapes::Make_Clean(), On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Shape_Get_ExclusiveOr(), and SG_Shape_Get_Union().

◆ Get_Z()

virtual double CSG_Shape_Points::Get_Z | ( | int | iPoint = 0,
 |  | int | iPart = 0,
 |  | bool | bAscending = true
 | ) |  | const
 inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 532 of file shapes.h.

References Get_Z().

Referenced by CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), Get_Z(), and CSG_Shapes::Make_Clean().

◆ Get_ZMax()

virtual double CSG_Shape_Points::Get_ZMax ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 534 of file shapes.h.

References CSG_Shape_Part::_Update_Extent(), and CSG_Shape_Part::m_ZMax.

Referenced by _Update_Extent().

◆ Get_ZMin()

virtual double CSG_Shape_Points::Get_ZMin ( void )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 533 of file shapes.h.

References CSG_Shape_Part::_Update_Extent(), and CSG_Shape_Part::m_ZMin.

◆ Ins_Point() [1/4]

virtual int CSG_Shape_Points::Ins_Point | ( | const CSG_Point & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 509 of file shapes.h.

References Ins_Point(), SSG_Point::x, and SSG_Point::y.

Referenced by Ins_Point().

◆ Ins_Point() [2/4]

int CSG_Shape_Points::Ins_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 213 of file shape_points.cpp.

References Ins_Point(), Set_Z(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Ins_Point() [3/4]

int CSG_Shape_Points::Ins_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 226 of file shape_points.cpp.

References Ins_Point(), SSG_Point_4D::m, Set_M(), Set_Z(), SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Ins_Point() [4/4]

int CSG_Shape_Points::Ins_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 199 of file shape_points.cpp.

References _Add_Part(), m_nParts, and m_pParts.

Referenced by CSG_Shape_Part::Add_Point(), and Ins_Point().

◆ is_Valid()

virtual bool CSG_Shape_Points::is_Valid ( void ) const
inlinevirtual

Implements CSG_Shape.

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Line.

Definition at line 492 of file shapes.h.

References CSG_Shape_Part::Get_Count().

◆ On_Assign()

bool CSG_Shape_Points::On_Assign ( CSG_Shape * pShape )
protectedvirtual

Implements CSG_Shape.

Definition at line 99 of file shape_points.cpp.

References Add_Part(), Add_Point(), Del_Parts(), CSG_Shape::Get_M(), Get_Part(), CSG_Shape::Get_Part_Count(), CSG_Shape::Get_Point(), CSG_Shape::Get_Type(), CSG_Shape::Get_Vertex_Type(), CSG_Shape::Get_Z(), CSG_Shape_Part::Set_M(), CSG_Shape_Part::Set_Z(), SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, and SHAPE_TYPE_Point.

◆ On_Intersects() [1/2]

TSG_Intersection CSG_Shape_Points::On_Intersects ( CSG_Shape * pShape )
protectedvirtual

Implements CSG_Shape.

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Line.

Definition at line 449 of file shape_points.cpp.

References CSG_Shape::Get_Part_Count(), CSG_Shape::Get_Point(), Get_Point_Count(), CSG_Shape::Get_Point_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Point::is_Equal().

◆ On_Intersects() [2/2]

TSG_Intersection CSG_Shape_Points::On_Intersects ( TSG_Rect Region )
protectedvirtual

Implements CSG_Shape.

Reimplemented in CSG_Shape_Polygon, and CSG_Shape_Line.

Definition at line 504 of file shape_points.cpp.

References CSG_Shape_Part::Get_Count(), INTERSECTION_None, INTERSECTION_Overlaps, m_nParts, CSG_Shape_Part::m_Points, m_pParts, SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ Revert_Points()

virtual bool CSG_Shape_Points::Revert_Points ( int iPart )
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 550 of file shapes.h.

References Revert_Points().

Referenced by CSG_Shapes::Make_Clean(), and Revert_Points().

◆ Set_M()

virtual void CSG_Shape_Points::Set_M | ( | double | m,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 536 of file shapes.h.

Referenced by Ins_Point(), CSG_Shapes::Make_Clean(), and Set_Point().

◆ Set_Point() [1/4]

virtual int CSG_Shape_Points::Set_Point | ( | const CSG_Point & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Implements CSG_Shape.

Definition at line 514 of file shapes.h.

References Set_Point(), SSG_Point::x, and SSG_Point::y.

Referenced by Set_Point().

◆ Set_Point() [2/4]

int CSG_Shape_Points::Set_Point | ( | const CSG_Point_3D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 251 of file shape_points.cpp.

References Set_Point(), Set_Z(), SSG_Point_3D::x, SSG_Point_3D::y, and SSG_Point_3D::z.

◆ Set_Point() [3/4]

int CSG_Shape_Points::Set_Point | ( | const CSG_Point_4D & | p,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 264 of file shape_points.cpp.

References SSG_Point_4D::m, Set_M(), Set_Point(), Set_Z(), SSG_Point_4D::x, SSG_Point_4D::y, and SSG_Point_4D::z.

◆ Set_Point() [4/4]

int CSG_Shape_Points::Set_Point | ( | double | x,
 |  | double | y,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
virtual

Implements CSG_Shape.

Definition at line 245 of file shape_points.cpp.

References m_nParts, and m_pParts.

Referenced by Set_Point().

◆ Set_Z()

virtual void CSG_Shape_Points::Set_Z | ( | double | z,
 |  | int | iPoint = 0,
 |  | int | iPart = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Shape.

Definition at line 531 of file shapes.h.

Referenced by Ins_Point(), CSG_Shapes::Make_Clean(), and Set_Point().

Friends And Related Function Documentation

◆ CSG_Shape_Part

friend class CSG_Shape_Part
friend

Definition at line 486 of file shapes.h.

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 485 of file shapes.h.

Member Data Documentation

◆ m_bUpdate

bool CSG_Shape_Points::m_bUpdate
protected

Definition at line 559 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Points().

◆ m_Extent

CSG_Rect CSG_Shape_Points::m_Extent
protected

Definition at line 565 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Part::Get_Extent().

◆ m_MMax

double CSG_Shape_Points::m_MMax
protected

Definition at line 563 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Part::Get_MMax().

◆ m_MMin

double CSG_Shape_Points::m_MMin
protected

Definition at line 563 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Part::Get_MMin().

◆ m_nParts

int CSG_Shape_Points::m_nParts
protected

Definition at line 561 of file shapes.h.

Referenced by _Add_Part(), CSG_Shape_Polygon::_Invalidate(), _Update_Extent(), Add_Part(), CSG_Shape_Polygon::Contains(), CSG_Shape_Points(), Del_Part(), Del_Parts(), Del_Point(), CSG_Shape_Polygon::Get_Area(), CSG_Shape_Polygon::Get_Centroid(), Get_Distance(), CSG_Shape_Line::Get_Distance(), CSG_Shape_Line::Get_Length(), CSG_Shape_Polygon::Get_Perimeter(), Get_Point(), CSG_Shape_Polygon::Get_Point_Relation(), Ins_Point(), CSG_Shape_Polygon::is_Lake(), CSG_Shape_Polygon::is_OnEdge(), CSG_Shape_Line::On_Intersects(), On_Intersects(), CSG_Shape_Polygon::On_Intersects(), and Set_Point().

◆ m_nPoints

int CSG_Shape_Points::m_nPoints
protected

Definition at line 561 of file shapes.h.

Referenced by CSG_Shape_Part::Add_Point(), CSG_Shape_Part::Assign(), CSG_Shape_Points(), CSG_Shape_Part::Del_Point(), CSG_Shape_Part::Destroy(), CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_M(), CSG_Shape_Part::Get_Point(), CSG_Shape_Part::Get_Z(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Part::Set_M(), and CSG_Shape_Part::Set_Z().

◆ m_pParts

CSG_Shape_Part** CSG_Shape_Points::m_pParts
protected

Definition at line 567 of file shapes.h.

Referenced by _Add_Part(), _Update_Extent(), Add_Part(), CSG_Shape_Points(), Del_Part(), Del_Point(), Get_Distance(), CSG_Shape_Line::Get_Distance(), CSG_Shape_Line::Get_Length(), Get_Point(), Ins_Point(), CSG_Shape_Polygon::is_Lake(), On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), and Set_Point().

◆ m_ZMax

double CSG_Shape_Points::m_ZMax
protected

Definition at line 563 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Part::Get_ZMax().

◆ m_ZMin

double CSG_Shape_Points::m_ZMin
protected

Definition at line 563 of file shapes.h.

Referenced by _Update_Extent(), and CSG_Shape_Part::Get_ZMin().

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_points.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Points Member List

This is the complete list of members for CSG_Shape_Points, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Add_Part(void) | CSG_Shape_Points | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Get_Part(void) | CSG_Shape_Points | inlineprotectedvirtual
_Invalidate(void) | CSG_Shape_Points | inlineprotectedvirtual
_Update_Extent(void) | CSG_Shape_Points | protected
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape_Points | virtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Part class | CSG_Shape_Points | friend
CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Points | protected
CSG_Shapes class | CSG_Shape_Points | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape_Points | virtual
Del_Parts(void) | CSG_Shape_Points | virtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Destroy(void) | CSG_Shape_Points | virtual
Get_Centroid(void) | CSG_Shape_Points | virtual
Get_Distance(TSG_Point Point) const | CSG_Shape_Points | virtual
Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Points | virtual
Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Points | virtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Points | virtual
Get_Extent(void) | CSG_Shape_Points | inlinevirtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_MMax(void) | CSG_Shape_Points | inlinevirtual
Get_MMin(void) | CSG_Shape_Points | inlinevirtual
Get_Part(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Point(int iPoint=0) const | CSG_Shape_Points | virtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_ZMax(void) | CSG_Shape_Points | inlinevirtual
Get_ZMin(void) | CSG_Shape_Points | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Points | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Points | inlinevirtual
m_bUpdate | CSG_Shape_Points | protected
m_Extent | CSG_Shape_Points | protected
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_MMax | CSG_Shape_Points | protected
m_MMin | CSG_Shape_Points | protected
m_nParts | CSG_Shape_Points | protected
m_nPoints | CSG_Shape_Points | protected
m_pParts | CSG_Shape_Points | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
m_ZMax | CSG_Shape_Points | protected
m_ZMin | CSG_Shape_Points | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Points | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Points | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Points | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape_Points | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Points(void) | CSG_Shape_Points | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Polygon Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shape_Polygon Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Polygon:
CSG_Shape_Points CSG_Shape CSG_Table_Record

Public Member Functions

virtual bool | is_Valid (void) const
CSG_Shape_Polygon_Part * | Get_Polygon_Part (int iPart) const
bool | is_Lake (int iPart)
bool | is_Clockwise (int iPart)
double | Get_Perimeter (int iPart)
double | Get_Perimeter (void)
double | Get_Area (int iPart)
double | Get_Area (void)
TSG_Point | Get_Centroid (int iPart)
TSG_Point | Get_Centroid (void)
TSG_Polygon_Point_Relation | Get_Point_Relation (const CSG_Point &p, int iPart)
TSG_Polygon_Point_Relation | Get_Point_Relation (double x, double y, int iPart)
TSG_Polygon_Point_Relation | Get_Point_Relation (const CSG_Point &p)
TSG_Polygon_Point_Relation | Get_Point_Relation (double x, double y)
bool | is_OnEdge (const CSG_Point &p, int iPart)
bool | is_OnEdge (double x, double y, int iPart)
bool | is_OnEdge (const CSG_Point &p)
bool | is_OnEdge (double x, double y)
bool | Contains (const CSG_Point &p, int iPart)
bool | Contains (double x, double y, int iPart)
bool | Contains (const CSG_Point &p)
bool | Contains (double x, double y)
bool | is_Neighbour (CSG_Shape_Polygon *pPolygon, bool bSimpleCheck=true)
CSG_Lines | Get_Shared_Edges (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
double | Get_Shared_Length (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const
- Public Member Functions inherited from CSG_Shape_Points
virtual void | Destroy (void)
virtual int | Get_Point_Count (void) const
virtual int | Get_Point_Count (int iPart) const
virtual int | Get_Part_Count (void) const
virtual int | Add_Part (class CSG_Shape_Part *pPart, bool bRevert=false)
virtual CSG_Shape_Part * | Get_Part (int iPart) const
virtual int | Del_Part (int iPart)
virtual int | Del_Parts (void)
virtual int | Add_Point (double x, double y, int iPart=0)
virtual int | Add_Point (const CSG_Point &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_3D &p, int iPart=0)
virtual int | Add_Point (const CSG_Point_4D &p, int iPart=0)
virtual int | Ins_Point (double x, double y, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_3D &p, int iPoint, int iPart=0)
virtual int | Ins_Point (const CSG_Point_4D &p, int iPoint, int iPart=0)
virtual int | Set_Point (double x, double y, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_3D &p, int iPoint=0, int iPart=0)
virtual int | Set_Point (const CSG_Point_4D &p, int iPoint=0, int iPart=0)
virtual int | Del_Point (int iPoint, int iPart=0)
virtual TSG_Point | Get_Point (int iPoint=0) const
virtual TSG_Point | Get_Point (int iPoint, int iPart, bool bAscending=true) const
virtual void | Set_Z (double z, int iPoint=0, int iPart=0)
virtual double | Get_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_ZMin (void)
virtual double | Get_ZMax (void)
virtual void | Set_M (double m, int iPoint=0, int iPart=0)
virtual double | Get_M (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual double | Get_MMin (void)
virtual double | Get_MMax (void)
virtual const CSG_Rect & | Get_Extent (void)
virtual double | Get_Distance (TSG_Point Point) const
virtual double | Get_Distance (TSG_Point Point, int iPart) const
virtual double | Get_Distance (TSG_Point Point, TSG_Point &Next) const
virtual bool | Revert_Points (int iPart)
- Public Member Functions inherited from CSG_Shape
virtual bool | Assign (CSG_Table_Record *pRecord)
virtual bool | Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes)
virtual bool | Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
class CSG_Shape_Point * | asPoint (void) const
class CSG_Shape_Points * | asPoints (void) const
class CSG_Shape_Line * | asLine (void) const
class CSG_Shape_Polygon * | asPolygon (void) const
virtual TSG_Point_3D | Get_Point_Z (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual TSG_Point_4D | Get_Point_ZM (int iPoint=0, int iPart=0, bool bAscending=true) const
virtual const CSG_Rect & | Get_Extent (int iPart)
TSG_Intersection | Intersects (CSG_Shape *pShape)
TSG_Intersection | Intersects (const TSG_Rect &Extent)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Shape_Polygon (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Polygon (void)
virtual CSG_Shape_Part * | _Get_Part (void)
virtual void | _Invalidate (void)
virtual TSG_Intersection | On_Intersects (CSG_Shape *pShape)
virtual TSG_Intersection | On_Intersects (TSG_Rect Region)
- Protected Member Functions inherited from CSG_Shape_Points
CSG_Shape_Points (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape_Points (void)
int | _Add_Part (void)
void | _Update_Extent (void)
virtual bool | On_Assign (CSG_Shape *pShape)
- Protected Member Functions inherited from CSG_Shape
CSG_Shape (class CSG_Shapes *pOwner, sLong Index)
virtual | ~CSG_Shape (void)
- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Protected Attributes

int | m_bUpdate_Lakes
- Protected Attributes inherited from CSG_Shape_Points
bool | m_bUpdate
int | m_nParts
int | m_nPoints
double | m_ZMin
double | m_ZMax
double | m_MMin
double | m_MMax
CSG_Rect m_Extent
CSG_Shape_Part ** m_pParts
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Friends

class CSG_Shapes

Additional Inherited Members

- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * _Create_Value (TSG_Data_Type Type)

Detailed Description

Definition at line 698 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Polygon()

CSG_Shape_Polygon::CSG_Shape_Polygon | ( | class CSG_Shapes * | pOwner,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 638 of file shape_polygon.cpp.

References m_bUpdate_Lakes.

◆ ~CSG_Shape_Polygon()

CSG_Shape_Polygon::~CSG_Shape_Polygon ( void )
protectedvirtual

Definition at line 645 of file shape_polygon.cpp.

Member Function Documentation

◆ _Get_Part()

virtual CSG_Shape_Part* CSG_Shape_Polygon::_Get_Part ( void )
inlineprotectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 755 of file shapes.h.

◆ _Invalidate()

void CSG_Shape_Polygon::_Invalidate ( void )
protectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 654 of file shape_polygon.cpp.

References CSG_Shape_Points::_Invalidate(), BOOL3_NOTSET, Get_Polygon_Part(), CSG_Shape_Polygon_Part::m_bLake, m_bUpdate_Lakes, and CSG_Shape_Points::m_nParts.

◆ Contains() [1/4]

bool CSG_Shape_Polygon::Contains ( const CSG_Point & p )

Definition at line 1085 of file shape_polygon.cpp.

References Contains(), SSG_Point::x, and SSG_Point::y.

◆ Contains() [2/4]

bool CSG_Shape_Polygon::Contains | ( | const CSG_Point & | p,
 |  | int | iPart
 | ) |  |

Definition at line 1071 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Contains(), Get_Point_Relation(), is_OnEdge(), and On_Intersects().

◆ Contains() [3/4]

bool CSG_Shape_Polygon::Contains | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 1091 of file shape_polygon.cpp.

References Contains(), CSG_Shape_Points::Get_Extent(), Get_Polygon_Part(), and CSG_Shape_Points::m_nParts.

◆ Contains() [4/4]

bool CSG_Shape_Polygon::Contains | ( | double | x,
 |  | double | y,
 |  | int | iPart
 | ) |  |

Definition at line 1077 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Contains(), and Get_Polygon_Part().

◆ Get_Area() [1/2]

double CSG_Shape_Polygon::Get_Area ( int iPart )

Definition at line 900 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Get_Area(), and Get_Polygon_Part().

◆ Get_Area() [2/2]

double CSG_Shape_Polygon::Get_Area ( void )

Definition at line 908 of file shape_polygon.cpp.

References is_Lake(), and CSG_Shape_Points::m_nParts.

Referenced by Get_Centroid().

◆ Get_Centroid() [1/2]

TSG_Point CSG_Shape_Polygon::Get_Centroid ( int iPart )

Definition at line 921 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Get_Centroid(), and Get_Polygon_Part().

◆ Get_Centroid() [2/2]

TSG_Point CSG_Shape_Polygon::Get_Centroid ( void )
virtual

Reimplemented from CSG_Shape_Points.

Definition at line 934 of file shape_polygon.cpp.

References Get_Area(), is_Lake(), CSG_Shape_Points::m_nParts, SSG_Point::x, and SSG_Point::y.

◆ Get_Distance()

double CSG_Shape_Polygon::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next,
 |  | int | iPart
 | ) |  | const
 virtual

Reimplemented from CSG_Shape_Points.

Definition at line 1221 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Get_Distance(), and Get_Polygon_Part().

◆ Get_Perimeter() [1/2]

double CSG_Shape_Polygon::Get_Perimeter ( int iPart )

Definition at line 879 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Get_Perimeter(), and Get_Polygon_Part().

◆ Get_Perimeter() [2/2]

double CSG_Shape_Polygon::Get_Perimeter ( void )

Definition at line 887 of file shape_polygon.cpp.

References CSG_Shape_Points::m_nParts.

◆ Get_Point_Relation() [1/4]

TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation ( const CSG_Point & p )

Definition at line 991 of file shape_polygon.cpp.

References Get_Point_Relation(), SSG_Point::x, and SSG_Point::y.

◆ Get_Point_Relation() [2/4]

TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation | ( | const CSG_Point & | p,
 |  | int | iPart
 | ) |  |

Definition at line 977 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Get_Point_Relation(), is_Lake(), and is_Neighbour().

◆ Get_Point_Relation() [3/4]

TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 997 of file shape_polygon.cpp.

References Contains(), CSG_Shape_Points::Get_Extent(), Get_Point_Relation(), Get_Polygon_Part(), CSG_Shape_Points::m_nParts, SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, and SG_POLYGON_POINT_Vertex.

◆ Get_Point_Relation() [4/4]

TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation | ( | double | x,
 |  | double | y,
 |  | int | iPart
 | ) |  |

Definition at line 983 of file shape_polygon.cpp.

References CSG_Shape_Polygon_Part::Get_Point_Relation(), Get_Polygon_Part(), and SG_POLYGON_POINT_Outside.

◆ Get_Polygon_Part()

CSG_Shape_Polygon_Part* CSG_Shape_Polygon::Get_Polygon_Part ( int iPart ) const
inline

Definition at line 707 of file shapes.h.

References CSG_Shape_Points::Get_Part().

Referenced by _Invalidate(), Contains(), Get_Area(), Get_Centroid(), Get_Distance(), Get_Perimeter(), Get_Point_Relation(), Get_Shared_Edges(), is_Clockwise(), is_Lake(), and is_OnEdge().

◆ Get_Shared_Edges()

CSG_Lines CSG_Shape_Polygon::Get_Shared_Edges | ( | CSG_Shape_Polygon * | pPolygon,
 |  | bool | bVertexCheck,
 |  | double | Epsilon = 0.
 | ) |  |

Returns all edge segments shared by this polygon and the one provide by the pPolygon argument as CSG_Lines object. If bVertexCheck is true vertices lying on edged segments of the other polygon will be recognized. If not only vertices are taken into respect that are shared by both polygons. Due to precision issues the tolerance factor specified with Epsilon argument should be slightly greater than zero when using the bVertexCheck option.

Definition at line 1183 of file shape_polygon.cpp.

References CSG_Lines::Add(), CSG_Shape_Points::Get_Extent(), CSG_Shape_Points::Get_Part_Count(), Get_Polygon_Part(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), and CSG_Shape::Intersects().

Referenced by Get_Shared_Length().

◆ Get_Shared_Length()

double CSG_Shape_Polygon::Get_Shared_Length | ( | CSG_Shape_Polygon * | pPolygon,
 |  | bool | bVertexCheck,
 |  | double | Epsilon = 0.
 | ) |  |

This function requests the edges shared by this polygon and the one provided by the pPolygon argument and returns the total length. See Get_Shared_Edges() for more details.

Definition at line 1208 of file shape_polygon.cpp.

References CSG_Lines::Get_Length(), and Get_Shared_Edges().

◆ is_Clockwise()

bool CSG_Shape_Polygon::is_Clockwise ( int iPart )

Definition at line 871 of file shape_polygon.cpp.

References Get_Polygon_Part(), and CSG_Shape_Polygon_Part::is_Clockwise().

Referenced by CSG_Shapes::Make_Clean().

◆ is_Lake()

bool CSG_Shape_Polygon::is_Lake ( int iPart )

Definition at line 811 of file shape_polygon.cpp.

References BOOL3_FALSE, BOOL3_NOTSET, BOOL3_TRUE, CSG_Shape_Part::Get_Point(), Get_Point_Relation(), Get_Polygon_Part(), CSG_Shape_Polygon_Part::m_bLake, m_bUpdate_Lakes, CSG_Shape_Points::m_nParts, CSG_Shape_Part::m_nPoints, CSG_Shape_Points::m_pParts, SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, and SG_POLYGON_POINT_Vertex.

Referenced by Get_Area(), Get_Centroid(), and CSG_Shapes::Make_Clean().

◆ is_Neighbour()

bool CSG_Shape_Polygon::is_Neighbour | ( | CSG_Shape_Polygon * | pPolygon,
 |  | bool | bSimpleCheck = true
 | ) |  |

Returns true if this polygon touches pPolyogon, i.e. the polygons share vertices or have vertices placed on the edge of the other. If bSimpleCheck is true the check is only performed until one shared vertex is found, which is sufficient if it can be expected that the polygons do not overlap.

Definition at line 1126 of file shape_polygon.cpp.

References CSG_Shape_Points::Get_Extent(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), Get_Point_Relation(), CSG_Shape::Intersects(), SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, and SG_POLYGON_POINT_Vertex.

◆ is_OnEdge() [1/4]

bool CSG_Shape_Polygon::is_OnEdge ( const CSG_Point & p )

Definition at line 1043 of file shape_polygon.cpp.

References is_OnEdge(), SSG_Point::x, and SSG_Point::y.

◆ is_OnEdge() [2/4]

bool CSG_Shape_Polygon::is_OnEdge | ( | const CSG_Point & | p,
 |  | int | iPart
 | ) |  |

Definition at line 1029 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by is_OnEdge().

◆ is_OnEdge() [3/4]

bool CSG_Shape_Polygon::is_OnEdge | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 1049 of file shape_polygon.cpp.

References Contains(), CSG_Shape_Points::Get_Extent(), Get_Polygon_Part(), is_OnEdge(), and CSG_Shape_Points::m_nParts.

◆ is_OnEdge() [4/4]

bool CSG_Shape_Polygon::is_OnEdge | ( | double | x,
 |  | double | y,
 |  | int | iPart
 | ) |  |

Definition at line 1035 of file shape_polygon.cpp.

References Get_Polygon_Part(), and CSG_Shape_Polygon_Part::is_OnEdge().

◆ is_Valid()

virtual bool CSG_Shape_Polygon::is_Valid ( void ) const
inlinevirtual

Reimplemented from CSG_Shape_Points.

Definition at line 704 of file shapes.h.

References CSG_Table::Get_Count().

◆ On_Intersects() [1/2]

TSG_Intersection CSG_Shape_Polygon::On_Intersects ( CSG_Shape * pShape )
protectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 675 of file shape_polygon.cpp.

References A, B, C, Contains(), CSG_Shape_Points::Get_Part_Count(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape::Get_Point(), CSG_Shape_Points::Get_Point_Count(), CSG_Shape::Get_Point_Count(), CSG_Shape::Get_Type(), INTERSECTION_Contains, INTERSECTION_None, INTERSECTION_Overlaps, SG_Get_Crossing(), SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ On_Intersects() [2/2]

TSG_Intersection CSG_Shape_Polygon::On_Intersects ( TSG_Rect Region )
protectedvirtual

Reimplemented from CSG_Shape_Points.

Definition at line 763 of file shape_polygon.cpp.

References C, Contains(), CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Points::Get_Extent(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, CSG_Rect::Intersects(), CSG_Shape::Intersects(), CSG_Shape_Points::m_nParts, CSG_Shape_Part::m_nPoints, CSG_Shape_Part::m_Points, CSG_Shape_Points::m_pParts, SG_Get_Crossing_InRegion(), SSG_Rect::xMin, and SSG_Rect::yMin.

Friends And Related Function Documentation

◆ CSG_Shapes

friend class CSG_Shapes
friend

Definition at line 700 of file shapes.h.

Member Data Documentation

◆ m_bUpdate_Lakes

int CSG_Shape_Polygon::m_bUpdate_Lakes
protected

Definition at line 752 of file shapes.h.

Referenced by _Invalidate(), CSG_Shape_Polygon(), and is_Lake().

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_polygon.cpp
Generated on Thu Oct 5 2023 17:36:17 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Polygon Member List

This is the complete list of members for CSG_Shape_Polygon, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Add_Part(void) | CSG_Shape_Points | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
_Get_Part(void) | CSG_Shape_Polygon | inlineprotectedvirtual
_Invalidate(void) | CSG_Shape_Polygon | protectedvirtual
_Update_Extent(void) | CSG_Shape_Points | protected
Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false) | CSG_Shape_Points | virtual
Add_Point(double x, double y, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_3D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Point(const CSG_Point_4D &p, int iPart=0) | CSG_Shape_Points | inlinevirtual
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLine(void) const | CSG_Shape | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asPoint(void) const | CSG_Shape | inline
asPoints(void) const | CSG_Shape | inline
asPolygon(void) const | CSG_Shape | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes) | CSG_Shape | virtual
Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy) | CSG_Shape | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
Contains(const CSG_Point &p, int iPart) | CSG_Shape_Polygon |
Contains(double x, double y, int iPart) | CSG_Shape_Polygon |
Contains(const CSG_Point &p) | CSG_Shape_Polygon |
Contains(double x, double y) | CSG_Shape_Polygon |
CSG_Shape(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape | protected
CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Points | protected
CSG_Shape_Polygon(class CSG_Shapes *pOwner, sLong Index) | CSG_Shape_Polygon | protected
CSG_Shapes class | CSG_Shape_Polygon | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Del_Part(int iPart) | CSG_Shape_Points | virtual
Del_Parts(void) | CSG_Shape_Points | virtual
Del_Point(int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Destroy(void) | CSG_Shape_Points | virtual
Get_Area(int iPart) | CSG_Shape_Polygon |
Get_Area(void) | CSG_Shape_Polygon |
Get_Centroid(int iPart) | CSG_Shape_Polygon |
Get_Centroid(void) | CSG_Shape_Polygon | virtual
Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const | CSG_Shape_Polygon | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point) const | CSG_Shape_Points | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point, int iPart) const | CSG_Shape_Points | virtual
CSG_Shape_Points::Get_Distance(TSG_Point Point, TSG_Point &Next) const | CSG_Shape_Points | virtual
Get_Extent(void) | CSG_Shape_Points | inlinevirtual
CSG_Shape::Get_Extent(int iPart) | CSG_Shape | inlinevirtual
Get_Index(void) const | CSG_Table_Record | inline
Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_MMax(void) | CSG_Shape_Points | inlinevirtual
Get_MMin(void) | CSG_Shape_Points | inlinevirtual
Get_Part(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Part_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Perimeter(int iPart) | CSG_Shape_Polygon |
Get_Perimeter(void) | CSG_Shape_Polygon |
Get_Point(int iPoint=0) const | CSG_Shape_Points | virtual
Get_Point(int iPoint, int iPart, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(void) const | CSG_Shape_Points | inlinevirtual
Get_Point_Count(int iPart) const | CSG_Shape_Points | inlinevirtual
Get_Point_Relation(const CSG_Point &p, int iPart) | CSG_Shape_Polygon |
Get_Point_Relation(double x, double y, int iPart) | CSG_Shape_Polygon |
Get_Point_Relation(const CSG_Point &p) | CSG_Shape_Polygon |
Get_Point_Relation(double x, double y) | CSG_Shape_Polygon |
Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape | inlinevirtual
Get_Polygon_Part(int iPart) const | CSG_Shape_Polygon | inline
Get_Shared_Edges(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.) | CSG_Shape_Polygon |
Get_Shared_Length(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.) | CSG_Shape_Polygon |
Get_Table(void) | CSG_Table_Record | inline
Get_Type(void) const | CSG_Shape |
Get_Value(int Field) | CSG_Table_Record | inline
Get_Vertex_Type(void) const | CSG_Shape |
Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const | CSG_Shape_Points | inlinevirtual
Get_ZMax(void) | CSG_Shape_Points | inlinevirtual
Get_ZMin(void) | CSG_Shape_Points | inlinevirtual
Ins_Point(double x, double y, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point &p, int iPoint, int iPart=0) | CSG_Shape_Points | inlinevirtual
Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0) | CSG_Shape_Points | virtual
Intersects(CSG_Shape *pShape) | CSG_Shape |
Intersects(const TSG_Rect &Extent) | CSG_Shape |
is_Clockwise(int iPart) | CSG_Shape_Polygon |
is_Lake(int iPart) | CSG_Shape_Polygon |
is_Modified(void) const | CSG_Table_Record | inline
is_Neighbour(CSG_Shape_Polygon *pPolygon, bool bSimpleCheck=true) | CSG_Shape_Polygon |
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_OnEdge(const CSG_Point &p, int iPart) | CSG_Shape_Polygon |
is_OnEdge(double x, double y, int iPart) | CSG_Shape_Polygon |
is_OnEdge(const CSG_Point &p) | CSG_Shape_Polygon |
is_OnEdge(double x, double y) | CSG_Shape_Polygon |
is_Selected(void) const | CSG_Table_Record | inline
is_Valid(void) const | CSG_Shape_Polygon | inlinevirtual
m_bUpdate | CSG_Shape_Points | protected
m_bUpdate_Lakes | CSG_Shape_Polygon | protected
m_Extent | CSG_Shape_Points | protected
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_MMax | CSG_Shape_Points | protected
m_MMin | CSG_Shape_Points | protected
m_nParts | CSG_Shape_Points | protected
m_nPoints | CSG_Shape_Points | protected
m_pParts | CSG_Shape_Points | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
m_ZMax | CSG_Shape_Points | protected
m_ZMin | CSG_Shape_Points | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
On_Assign(CSG_Shape *pShape) | CSG_Shape_Points | protectedvirtual
On_Intersects(CSG_Shape *pShape) | CSG_Shape_Polygon | protectedvirtual
On_Intersects(TSG_Rect Region) | CSG_Shape_Polygon | protectedvirtual
operator[](int Field) const | CSG_Table_Record | inline
Revert_Points(int iPart) | CSG_Shape_Points | inlinevirtual
Set_M(double m, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Point(double x, double y, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0) | CSG_Shape_Points | virtual
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
Set_Z(double z, int iPoint=0, int iPart=0) | CSG_Shape_Points | inlinevirtual
~CSG_Shape(void) | CSG_Shape | protectedvirtual
~CSG_Shape_Points(void) | CSG_Shape_Points | protectedvirtual
~CSG_Shape_Polygon(void) | CSG_Shape_Polygon | protectedvirtual
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shape_Polygon_Part Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shape_Polygon_Part Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Polygon_Part:
CSG_Shape_Part

Public Member Functions

bool | is_Clockwise (void)
double | Get_Perimeter (void)
double | Get_Area (void)
const TSG_Point & | Get_Centroid (void)
TSG_Polygon_Point_Relation | Get_Point_Relation (const CSG_Point &p)
TSG_Polygon_Point_Relation | Get_Point_Relation (double x, double y)
bool | is_OnEdge (const CSG_Point &p)
bool | is_OnEdge (double x, double y)
bool | Contains (const CSG_Point &p)
bool | Contains (double x, double y)
bool | is_Neighbour (CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck=true)
CSG_Lines | Get_Shared_Edges (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
double | Get_Shared_Length (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
double | Get_Distance (TSG_Point Point, TSG_Point &Next)
- Public Member Functions inherited from CSG_Shape_Part
class CSG_Shape_Points * | Get_Owner (void)
virtual bool | Destroy (void)
virtual bool | Assign (CSG_Shape_Part *pPart)
const CSG_Rect & | Get_Extent (void)
int | Get_Count (void) const
TSG_Point | Get_Point (int iPoint, bool bAscending=true) const
int | Add_Point (double x, double y)
int | Add_Point (const CSG_Point &p)
int | Add_Point (const CSG_Point_3D &p)
int | Add_Point (const CSG_Point_4D &p)
int | Ins_Point (double x, double y, int iPoint)
int | Ins_Point (const CSG_Point &p, int iPoint)
int | Ins_Point (const CSG_Point_3D &p, int iPoint)
int | Ins_Point (const CSG_Point_4D &p, int iPoint)
int | Set_Point (double x, double y, int iPoint)
int | Set_Point (const CSG_Point &p, int iPoint)
int | Set_Point (const CSG_Point_3D &p, int iPoint)
int | Set_Point (const CSG_Point_4D &p, int iPoint)
int | Del_Point (int iPoint)
void | Set_Z (double z, int iPoint)
double | Get_Z (int iPoint, bool bAscending=true) const
double | Get_ZMin (void)
double | Get_ZMax (void)
TSG_Point_3D | Get_Point_Z (int iPoint, bool bAscending=true) const
void | Set_M (double m, int iPoint)
double | Get_M (int iPoint, bool bAscending=true) const
double | Get_MMin (void)
double | Get_MMax (void)
TSG_Point_4D | Get_Point_ZM (int iPoint, bool bAscending=true) const
bool | Revert_Points (void)

Protected Member Functions

CSG_Shape_Polygon_Part (class CSG_Shape_Points *pOwner)
virtual | ~CSG_Shape_Polygon_Part (void)
virtual void | _Invalidate (void)
void | _Update_Area (void)
void | _Add_Edge_Points (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon)
bool | _is_OnEdge (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex, double Epsilon)
- Protected Member Functions inherited from CSG_Shape_Part
CSG_Shape_Part (class CSG_Shape_Points *pOwner)
virtual | ~CSG_Shape_Part (void)
virtual bool | _Alloc_Memory (int nPoints)
virtual void | _Update_Extent (void)

Protected Attributes

int | m_bClockwise
int | m_bLake
double | m_Area
double | m_Perimeter
TSG_Point m_Centroid
- Protected Attributes inherited from CSG_Shape_Part
bool | m_bUpdate
int | m_nPoints
int | m_nBuffer
double * | m_Z
double | m_ZMin
double | m_ZMax
double * | m_M
double | m_MMin
double | m_MMax
TSG_Point * m_Points
CSG_Rect m_Extent
class CSG_Shape_Points * | m_pOwner

Friends

class CSG_Shape_Polygon

Detailed Description

Definition at line 644 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Polygon_Part()

CSG_Shape_Polygon_Part::CSG_Shape_Polygon_Part ( class CSG_Shape_Points * pOwner )
protected

Definition at line 75 of file shape_polygon.cpp.

References BOOL3_NOTSET, m_bClockwise, and m_bLake.

◆ ~CSG_Shape_Polygon_Part()

CSG_Shape_Polygon_Part::~CSG_Shape_Polygon_Part ( void )
protectedvirtual

Definition at line 83 of file shape_polygon.cpp.

Member Function Documentation

◆ _Add_Edge_Points()

void CSG_Shape_Polygon_Part::_Add_Edge_Points | ( | CSG_Shape_Polygon_Part * | pPart,
 |  | const CSG_Point & | P0,
 |  | const CSG_Point & | P1,
 |  | CSG_Points & | Part,
 |  | double | Epsilon
 | ) |  |
protected

Definition at line 403 of file shape_polygon.cpp.

References CSG_Points::Add(), CSG_Points::Get_Count(), CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Point(), SG_Get_Distance(), and SG_Is_Point_On_Line().

Referenced by Get_Shared_Edges().

◆ _Invalidate()

void CSG_Shape_Polygon_Part::_Invalidate ( void )
protectedvirtual

Reimplemented from CSG_Shape_Part.

Definition at line 92 of file shape_polygon.cpp.

References CSG_Shape_Part::_Invalidate(), BOOL3_NOTSET, m_bClockwise, and m_bLake.

◆ _is_OnEdge()

bool CSG_Shape_Polygon_Part::_is_OnEdge | ( | CSG_Shape_Polygon_Part * | pPart,
 |  | const CSG_Point & | P,
 |  | bool | bVertex,
 |  | double | Epsilon
 | ) |  |
protected

Definition at line 440 of file shape_polygon.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Point(), and SG_Is_Point_On_Line().

Referenced by Get_Shared_Edges().

◆ _Update_Area()

void CSG_Shape_Polygon_Part::_Update_Area ( void )
protected

Definition at line 101 of file shape_polygon.cpp.

References A, B, BOOL3_FALSE, BOOL3_NOTSET, BOOL3_TRUE, CSG_Shape_Part::Get_Extent(), CSG_Rect::Get_XCenter(), CSG_Rect::Get_YCenter(), m_Area, m_bClockwise, m_Centroid, CSG_Shape_Part::m_nPoints, m_Perimeter, CSG_Shape_Part::m_Points, SG_Get_Distance(), SSG_Point::x, and SSG_Point::y.

◆ Contains() [1/2]

bool CSG_Shape_Polygon_Part::Contains ( const CSG_Point & p )

Definition at line 289 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Contains(), CSG_Shape_Polygon::Contains(), Get_Distance(), and Get_Point_Relation().

◆ Contains() [2/2]

bool CSG_Shape_Polygon_Part::Contains | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 295 of file shape_polygon.cpp.

References Contains(), CSG_Shape_Part::Get_Extent(), Get_Point_Relation(), CSG_Shape_Part::m_nPoints, CSG_Shape_Part::m_Points, SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Vertex, SSG_Point::x, and SSG_Point::y.

◆ Get_Area()

double CSG_Shape_Polygon_Part::Get_Area ( void )
inline

Definition at line 654 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Area().

◆ Get_Centroid()

const TSG_Point& CSG_Shape_Polygon_Part::Get_Centroid ( void )
inline

Definition at line 656 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Centroid().

◆ Get_Distance()

double CSG_Shape_Polygon_Part::Get_Distance | ( | TSG_Point | Point,
 |  | TSG_Point & | Next
 | ) |  |

Definition at line 599 of file shape_polygon.cpp.

References C, Contains(), CSG_Shape_Part::m_nPoints, CSG_Shape_Part::m_Points, and SG_Get_Nearest_Point_On_Line().

Referenced by CSG_Shape_Polygon::Get_Distance().

◆ Get_Perimeter()

double CSG_Shape_Polygon_Part::Get_Perimeter ( void )
inline

Definition at line 652 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Perimeter().

◆ Get_Point_Relation() [1/2]

TSG_Polygon_Point_Relation CSG_Shape_Polygon_Part::Get_Point_Relation ( const CSG_Point & p )

Definition at line 151 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Contains(), CSG_Shape_Polygon::Get_Point_Relation(), is_Neighbour(), and is_OnEdge().

◆ Get_Point_Relation() [2/2]

TSG_Polygon_Point_Relation CSG_Shape_Polygon_Part::Get_Point_Relation | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 157 of file shape_polygon.cpp.

References Contains(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::m_nPoints, CSG_Shape_Part::m_Points, SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, SG_POLYGON_POINT_Vertex, SSG_Point::x, and SSG_Point::y.

◆ Get_Shared_Edges()

CSG_Lines CSG_Shape_Polygon_Part::Get_Shared_Edges | ( | CSG_Shape_Polygon_Part * | pPart,
 |  | bool | bVertexCheck,
 |  | double | Epsilon = 0.
 | ) |  |

Returns all edge segments shared by this polygon part and the one provide by pPart argument as CSG_Lines object. If bVertexCheck is true vertices lying on edged segments of the other polygon part will be recognized. If not only vertices are taken into respect that are shared by both polygon parts. Due to precision issues the tolerance factor specified with Epsilon should be slightly greater than zero when using the bVertexCheck option.

Definition at line 479 of file shape_polygon.cpp.

References _Add_Edge_Points(), _is_OnEdge(), CSG_Points::Add(), CSG_Lines::Add(), CSG_Points::Get_Count(), CSG_Lines::Get_Count(), CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_Point(), is_OnEdge(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon::Get_Shared_Edges(), and Get_Shared_Length().

◆ Get_Shared_Length()

double CSG_Shape_Polygon_Part::Get_Shared_Length | ( | CSG_Shape_Polygon_Part * | pPart,
 |  | bool | bVertexCheck,
 |  | double | Epsilon = 0.
 | ) |  |

This function requests the edges shared by this polygon part and the one provided by the pPart argument and returns the total length. See Get_Shared_Edges() for more details.

Definition at line 586 of file shape_polygon.cpp.

References CSG_Lines::Get_Length(), and Get_Shared_Edges().

◆ is_Clockwise()

bool CSG_Shape_Polygon_Part::is_Clockwise ( void )
inline

Definition at line 650 of file shapes.h.

Referenced by CSG_Shape_Polygon::is_Clockwise().

◆ is_Neighbour()

bool CSG_Shape_Polygon_Part::is_Neighbour | ( | CSG_Shape_Polygon_Part * | pPart,
 |  | bool | bSimpleCheck = true
 | ) |  |

Returns true if this polygon part touches that defined by pPart, i.e. the polygons share vertices or have vertices placed on the edge of the other. If bSimpleCheck is true the check is only performed until one shared vertex is found, which is sufficient if it can be expected that the polygons do not overlap.

Definition at line 357 of file shape_polygon.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_Point(), Get_Point_Relation(), SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, and SG_POLYGON_POINT_Vertex.

◆ is_OnEdge() [1/2]

bool CSG_Shape_Polygon_Part::is_OnEdge ( const CSG_Point & p )

Definition at line 268 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Get_Shared_Edges(), and CSG_Shape_Polygon::is_OnEdge().

◆ is_OnEdge() [2/2]

bool CSG_Shape_Polygon_Part::is_OnEdge | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 274 of file shape_polygon.cpp.

References Get_Point_Relation(), SG_POLYGON_POINT_Edge, and SG_POLYGON_POINT_Vertex.

Friends And Related Function Documentation

◆ CSG_Shape_Polygon

friend class CSG_Shape_Polygon
friend

Definition at line 646 of file shapes.h.

Member Data Documentation

◆ m_Area

double CSG_Shape_Polygon_Part::m_Area
protected

Definition at line 683 of file shapes.h.

Referenced by _Update_Area().

◆ m_bClockwise

int CSG_Shape_Polygon_Part::m_bClockwise
protected

Definition at line 681 of file shapes.h.

Referenced by _Invalidate(), _Update_Area(), and CSG_Shape_Polygon_Part().

◆ m_bLake

int CSG_Shape_Polygon_Part::m_bLake
protected

Definition at line 681 of file shapes.h.

Referenced by _Invalidate(), CSG_Shape_Polygon::_Invalidate(), CSG_Shape_Polygon_Part(), and CSG_Shape_Polygon::is_Lake().

◆ m_Centroid

TSG_Point CSG_Shape_Polygon_Part::m_Centroid
protected

Definition at line 685 of file shapes.h.

Referenced by _Update_Area().

◆ m_Perimeter

double CSG_Shape_Polygon_Part::m_Perimeter
protected

Definition at line 683 of file shapes.h.

Referenced by _Update_Area().

The documentation for this class was generated from the following files:
  • shapes.h
  • shape_polygon.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shape_Polygon_Part Member List

This is the complete list of members for CSG_Shape_Polygon_Part, including all inherited members.

_Add_Edge_Points(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon) | CSG_Shape_Polygon_Part | protected
_Alloc_Memory(int nPoints) | CSG_Shape_Part | protectedvirtual
_Invalidate(void) | CSG_Shape_Polygon_Part | protectedvirtual
_is_OnEdge(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex, double Epsilon) | CSG_Shape_Polygon_Part | protected
_Update_Area(void) | CSG_Shape_Polygon_Part | protected
_Update_Extent(void) | CSG_Shape_Part | protectedvirtual
Add_Point(double x, double y) | CSG_Shape_Part | inline
Add_Point(const CSG_Point &p) | CSG_Shape_Part | inline
Add_Point(const CSG_Point_3D &p) | CSG_Shape_Part | inline
Add_Point(const CSG_Point_4D &p) | CSG_Shape_Part | inline
Assign(CSG_Shape_Part *pPart) | CSG_Shape_Part | virtual
Contains(const CSG_Point &p) | CSG_Shape_Polygon_Part |
Contains(double x, double y) | CSG_Shape_Polygon_Part |
CSG_Shape_Part(class CSG_Shape_Points *pOwner) | CSG_Shape_Part | protected
CSG_Shape_Polygon class | CSG_Shape_Polygon_Part | friend
CSG_Shape_Polygon_Part(class CSG_Shape_Points *pOwner) | CSG_Shape_Polygon_Part | protected
Del_Point(int iPoint) | CSG_Shape_Part |
Destroy(void) | CSG_Shape_Part | virtual
Get_Area(void) | CSG_Shape_Polygon_Part | inline
Get_Centroid(void) | CSG_Shape_Polygon_Part | inline
Get_Count(void) const | CSG_Shape_Part | inline
Get_Distance(TSG_Point Point, TSG_Point &Next) | CSG_Shape_Polygon_Part |
Get_Extent(void) | CSG_Shape_Part | inline
Get_M(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_MMax(void) | CSG_Shape_Part | inline
Get_MMin(void) | CSG_Shape_Part | inline
Get_Owner(void) | CSG_Shape_Part | inline
Get_Perimeter(void) | CSG_Shape_Polygon_Part | inline
Get_Point(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Point_Relation(const CSG_Point &p) | CSG_Shape_Polygon_Part |
Get_Point_Relation(double x, double y) | CSG_Shape_Polygon_Part |
Get_Point_Z(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Point_ZM(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_Shared_Edges(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.) | CSG_Shape_Polygon_Part |
Get_Shared_Length(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.) | CSG_Shape_Polygon_Part |
Get_Z(int iPoint, bool bAscending=true) const | CSG_Shape_Part | inline
Get_ZMax(void) | CSG_Shape_Part | inline
Get_ZMin(void) | CSG_Shape_Part | inline
Ins_Point(double x, double y, int iPoint) | CSG_Shape_Part |
Ins_Point(const CSG_Point &p, int iPoint) | CSG_Shape_Part | inline
Ins_Point(const CSG_Point_3D &p, int iPoint) | CSG_Shape_Part |
Ins_Point(const CSG_Point_4D &p, int iPoint) | CSG_Shape_Part |
is_Clockwise(void) | CSG_Shape_Polygon_Part | inline
is_Neighbour(CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck=true) | CSG_Shape_Polygon_Part |
is_OnEdge(const CSG_Point &p) | CSG_Shape_Polygon_Part |
is_OnEdge(double x, double y) | CSG_Shape_Polygon_Part |
m_Area | CSG_Shape_Polygon_Part | protected
m_bClockwise | CSG_Shape_Polygon_Part | protected
m_bLake | CSG_Shape_Polygon_Part | protected
m_bUpdate | CSG_Shape_Part | protected
m_Centroid | CSG_Shape_Polygon_Part | protected
m_Extent | CSG_Shape_Part | protected
m_M | CSG_Shape_Part | protected
m_MMax | CSG_Shape_Part | protected
m_MMin | CSG_Shape_Part | protected
m_nBuffer | CSG_Shape_Part | protected
m_nPoints | CSG_Shape_Part | protected
m_Perimeter | CSG_Shape_Polygon_Part | protected
m_Points | CSG_Shape_Part | protected
m_pOwner | CSG_Shape_Part | protected
m_Z | CSG_Shape_Part | protected
m_ZMax | CSG_Shape_Part | protected
m_ZMin | CSG_Shape_Part | protected
Revert_Points(void) | CSG_Shape_Part |
Set_M(double m, int iPoint) | CSG_Shape_Part | inline
Set_Point(double x, double y, int iPoint) | CSG_Shape_Part |
Set_Point(const CSG_Point &p, int iPoint) | CSG_Shape_Part | inline
Set_Point(const CSG_Point_3D &p, int iPoint) | CSG_Shape_Part |
Set_Point(const CSG_Point_4D &p, int iPoint) | CSG_Shape_Part |
Set_Z(double z, int iPoint) | CSG_Shape_Part | inline
~CSG_Shape_Part(void) | CSG_Shape_Part | protectedvirtual
~CSG_Shape_Polygon_Part(void) | CSG_Shape_Polygon_Part | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shapes Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Shapes Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shapes:
CSG_Table CSG_Data_Object CSG_PointCloud

Public Member Functions

CSG_Shapes (void)
CSG_Shapes (const CSG_Shapes &Shapes)
bool | Create (const CSG_Shapes &Shapes)
CSG_Shapes (const char *File)
bool | Create (const char *File)
CSG_Shapes (const wchar_t *File)
bool | Create (const wchar_t *File)
CSG_Shapes (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_Shapes (TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY)
bool | Create (TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY)
virtual | ~CSG_Shapes (void)
virtual bool | Destroy (void)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking. More...
virtual bool | Assign (CSG_Data_Object *pObject)
virtual bool | Save (const CSG_String &File, int Format=0)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
virtual bool | is_Valid (void) const
virtual TSG_Shape_Type | Get_Type (void) const
TSG_Vertex_Type | Get_Vertex_Type (void) const
virtual const CSG_Rect & | Get_Extent (void)
double | Get_ZMin (void)
double | Get_ZMax (void)
double | Get_MMin (void)
double | Get_MMax (void)
virtual CSG_Shape * | Add_Shape (CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
virtual bool | Del_Shape (sLong Index)
virtual bool | Del_Shape (CSG_Shape *pShape)
virtual bool | Del_Shapes (void)
virtual CSG_Shape * | Get_Shape (const CSG_Point &Point, double Epsilon=0.)
virtual CSG_Shape * | Get_Shape (sLong Index) const
virtual CSG_Shape * | Get_Shape_byIndex (sLong Index) const
bool | Make_Clean (void)
virtual const CSG_Rect & | Get_Selection_Extent (void)
virtual CSG_Shape * | Get_Selection (sLong Index=0)
virtual bool | Select (sLong Index, bool bInvert=false)
virtual bool | Select (CSG_Table_Record *pShape=NULL, bool bInvert=false)
virtual bool | Select (const TSG_Rect &Extent, bool bInvert=false)
virtual bool | Select (const TSG_Point &Point, bool bInvert=false)
- Public Member Functions inherited from CSG_Table
CSG_Table (void)
CSG_Table (const CSG_Table &Table)
bool | Create (const CSG_Table &Table)
CSG_Table (const CSG_Table *pTemplate)
bool | Create (const CSG_Table *pTemplate)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual | ~CSG_Table (void)
CSG_Table & | operator= (const CSG_Table &Table)
bool | Assign_Values (const CSG_Table &Table)
bool | Assign_Values (CSG_Table *pTable)
bool | Assign_Values (const SG_Char *File)
bool | Load (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Set_File_Encoding (int Encoding)
int | Get_File_Encoding (void) const
bool | Serialize (CSG_File &Stream, bool bSave)
bool | is_Compatible (const CSG_Table &Table, bool bExactMatch=false) const
bool | is_Compatible (CSG_Table *pTable, bool bExactMatch=false) const
virtual bool | Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const char *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const wchar_t *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Del_Field (int iField)
virtual bool | Mov_Field (int iField, int Position)
int | Get_Field_Count (void) const
const SG_Char * | Get_Field_Name (int iField) const
TSG_Data_Type | Get_Field_Type (int iField) const
int | Get_Field_Length (int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
int | Get_Field (const CSG_String &Name) const
bool | Set_Field_Name (int iField, const SG_Char *Name)
virtual bool | Set_Field_Type (int iField, TSG_Data_Type Type)
int | Find_Field (const CSG_String &Name) const
bool | Find_Field (const CSG_String &Name, int &Index) const
sLong | Get_N (int iField) const
double | Get_Minimum (int iField) const
double | Get_Maximum (int iField) const
double | Get_Range (int iField) const
double | Get_Sum (int iField) const
double | Get_Mean (int iField) const
double | Get_StdDev (int iField) const
double | Get_Variance (int iField) const
const CSG_Simple_Statistics & | Get_Statistics (int iField) const
virtual CSG_Table_Record * | Add_Record (CSG_Table_Record *pCopy=NULL)
virtual CSG_Table_Record * | Ins_Record (sLong Index, CSG_Table_Record *pCopy=NULL)
virtual bool | Set_Record (sLong Index, CSG_Table_Record *pCopy)
virtual bool | Del_Record (sLong Index)
virtual bool | Del_Records (void)
virtual bool | Set_Count (sLong nRecords)
sLong | Get_Count (void) const
virtual CSG_Table_Record * | Get_Record (sLong Index) const
virtual CSG_Table_Record & | operator[] (sLong Index) const
sLong | Get_Index (sLong Index) const
CSG_Table_Record * | Get_Record_byIndex (sLong Index) const
virtual bool | Find_Record (sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual bool | Find_Record (sLong &Index, int iField, double Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, double Value, bool bCreateIndex=false)
virtual bool | Set_Value (sLong Index, int iField, const SG_Char *Value)
virtual bool | Set_Value (sLong Index, int iField, double Value)
virtual bool | Get_Value (sLong Index, int iField, CSG_String &Value) const
virtual bool | Get_Value (sLong Index, int iField, double &Value) const
virtual void | Set_Modified (bool bModified=true)
sLong | Get_Selection_Count (void) const
sLong | Get_Selection_Index (sLong Index=0) const
virtual CSG_Table_Record * | Get_Selection (sLong Index=0) const
virtual bool | is_Selected (sLong Index) const
virtual sLong | Del_Selection (void)
virtual sLong | Inv_Selection (void)
bool | Set_Index (CSG_Index &Index, int Field, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const
bool | is_Indexed (void) const
bool | Set_Index (int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None)
bool | Del_Index (void)
bool | Toggle_Index (int iField)
int | Get_Index_Field (int i) const
TSG_Table_Index_Order | Get_Index_Order (int i) const
int | Get_Index_Field (size_t i) const
TSG_Table_Index_Order | Get_Index_Order (size_t i) const
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Protected Member Functions

virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
virtual void | _On_Construction (void)
virtual CSG_Table_Record * | _Get_New_Record (sLong Index)
- Protected Member Functions inherited from CSG_Table
bool | _Add_Selection (sLong Index)
bool | _Set_Selection (sLong Index, sLong Selected)
bool | _Del_Selection (sLong Index)
bool | _Stats_Invalidate (void) const
bool | _Stats_Invalidate (int iField) const
virtual bool | _Stats_Update (int iField) const
virtual bool | On_NoData_Changed (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)

Protected Attributes

double | m_ZMin
double | m_ZMax
double | m_MMin
double | m_MMax
TSG_Shape_Type m_Type
TSG_Vertex_Type m_Vertex_Type
CSG_Rect m_Extent_Selected
- Protected Attributes inherited from CSG_Table
int | m_nFields
int | m_Encoding
sLong m_nRecords
sLong m_nBuffer
TSG_Data_Type * m_Field_Type
CSG_String ** m_Field_Name
CSG_Simple_Statistics ** m_Field_Stats
CSG_Array m_Selection
CSG_Rect m_Extent
- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Friends

class CSG_Shape

Detailed Description

Definition at line 772 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shapes() [1/6]

CSG_Shapes::CSG_Shapes ( void )

Definition at line 151 of file shapes.cpp.

References _On_Construction().

◆ CSG_Shapes() [2/6]

CSG_Shapes::CSG_Shapes ( const CSG_Shapes & Shapes )

Definition at line 158 of file shapes.cpp.

References _On_Construction(), and Create().

◆ CSG_Shapes() [3/6]

CSG_Shapes::CSG_Shapes ( const char * File )

Definition at line 165 of file shapes.cpp.

◆ CSG_Shapes() [4/6]

CSG_Shapes::CSG_Shapes ( const wchar_t * File )

Definition at line 166 of file shapes.cpp.

◆ CSG_Shapes() [5/6]

CSG_Shapes::CSG_Shapes ( const CSG_String & File )

Definition at line 167 of file shapes.cpp.

References _On_Construction(), and Create().

◆ CSG_Shapes() [6/6]

CSG_Shapes::CSG_Shapes | ( | TSG_Shape_Type | Type,
 |  | const SG_Char * | Name = NULL,
 |  | CSG_Table * | pTemplate = NULL,
 |  | TSG_Vertex_Type | Vertex_Type = SG_VERTEX_TYPE_XY
 | ) |  |

Definition at line 174 of file shapes.cpp.

References _On_Construction(), and Create().

◆ ~CSG_Shapes()

CSG_Shapes::~CSG_Shapes ( void )
virtual

Definition at line 341 of file shapes.cpp.

References Destroy().

Member Function Documentation

◆ _Get_New_Record()

CSG_Table_Record * CSG_Shapes::_Get_New_Record ( sLong Index )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 483 of file shapes.cpp.

References m_Type, m_Vertex_Type, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ _On_Construction()

void CSG_Shapes::_On_Construction ( void )
protectedvirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 188 of file shapes.cpp.

References CSG_Table::_On_Construction(), CSG_Table::m_Encoding, m_Type, m_Vertex_Type, SG_FILE_ENCODING_UTF8, SG_VERTEX_TYPE_XY, and SHAPE_TYPE_Undefined.

Referenced by CSG_Shapes().

◆ Add_Shape()

CSG_Shape * CSG_Shapes::Add_Shape | ( | CSG_Table_Record * | pCopy = NULL,
 |  | TSG_ADD_Shape_Copy_Mode | mCopy = SHAPE_COPY
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 505 of file shapes.cpp.

References CSG_Table::Add_Record(), CSG_Shape::Assign(), and SHAPE_NO_COPY.

Referenced by Assign(), CSG_TIN::Save(), and SG_Get_Projected().

◆ Assign()

bool CSG_Shapes::Assign ( CSG_Data_Object * pObject )
virtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 360 of file shapes.cpp.

References Add_Shape(), CSG_Projection::Create(), Create(), CSG_Table::Get_Count(), CSG_Data_Object::Get_History(), CSG_Data_Object::Get_Name(), CSG_Data_Object::Get_ObjectType(), CSG_Data_Object::Get_Projection(), Get_Shape(), Get_Type(), Get_Vertex_Type(), CSG_Data_Object::is_Valid(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_UI_Process_Get_Okay().

Referenced by Create().

◆ Create() [1/5]

bool CSG_Shapes::Create ( const char * File )

Definition at line 210 of file shapes.cpp.

References Create().

◆ Create() [2/5]

bool CSG_Shapes::Create ( const CSG_Shapes & Shapes )

Definition at line 204 of file shapes.cpp.

References Assign().

Referenced by CSG_PointCloud::_On_Construction(), Assign(), Create(), CSG_Shapes(), On_Reload(), CSG_TIN::Save(), and SG_Get_Projected().

◆ Create() [3/5]

bool CSG_Shapes::Create ( const CSG_String & File )

Definition at line 212 of file shapes.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_String::c_str(), CSG_String::Cmp(), CSG_Tool_Library_Manager::Create_Tool(), Del_Shape(), CSG_Tool_Library_Manager::Delete_Tool(), Destroy(), CSG_Tool::Execute(), CSG_String::Format(), CSG_Table::Get_Count(), Get_Shape(), is_Valid(), CSG_Tool::On_Before_Execution(), CSG_Tool::Set_Manager(), CSG_Table::Set_Modified(), CSG_Data_Object::Set_Update_Flag(), SG_File_Cmp_Extension(), SG_Get_Tool_Library_Manager(), SG_TOOL_PARAMETER_SET, SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, SG_UI_Process_Set_Ready(), and SG_UI_ProgressAndMsg_Lock().

◆ Create() [4/5]

bool CSG_Shapes::Create ( const wchar_t * File )

Definition at line 211 of file shapes.cpp.

References Create().

◆ Create() [5/5]

bool CSG_Shapes::Create | ( | TSG_Shape_Type | Type,
 |  | const SG_Char * | Name = NULL,
 |  | CSG_Table * | pTemplate = NULL,
 |  | TSG_Vertex_Type | Vertex_Type = SG_VERTEX_TYPE_XY
 | ) |  |

Definition at line 317 of file shapes.cpp.

References CSG_Table::Create(), Destroy(), m_Type, m_Vertex_Type, and CSG_Data_Object::Set_Name().

◆ Del_Shape() [1/2]

bool CSG_Shapes::Del_Shape ( CSG_Shape * pShape )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 518 of file shapes.cpp.

References CSG_Table::Del_Record(), and CSG_Table_Record::Get_Index().

◆ Del_Shape() [2/2]

bool CSG_Shapes::Del_Shape ( sLong Index )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 523 of file shapes.cpp.

References CSG_Table::Del_Record().

Referenced by Create().

◆ Del_Shapes()

virtual bool CSG_Shapes::Del_Shapes ( void )
inlinevirtual

Reimplemented in CSG_PointCloud.

Definition at line 822 of file shapes.h.

References CSG_Table::Del_Records().

◆ Destroy()

bool CSG_Shapes::Destroy ( void )
virtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 347 of file shapes.cpp.

References CSG_Table::Destroy().

Referenced by Create(), and ~CSG_Shapes().

◆ Get_Extent()

virtual const CSG_Rect& CSG_Shapes::Get_Extent ( void )
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 811 of file shapes.h.

References CSG_Data_Object::Update().

Referenced by CSG_PRQuadTree::Create(), Get_Selection_Extent(), CSG_PointCloud::Get_Shape(), Get_Shape(), CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_PointCloud::Select(), CSG_Parameters_Grid_Target::Set_User_Defined(), and SG_Get_Projected().

◆ Get_MMax()

double CSG_Shapes::Get_MMax ( void )
inline

Definition at line 816 of file shapes.h.

References CSG_Data_Object::Update().

Referenced by On_Update().

◆ Get_MMin()

double CSG_Shapes::Get_MMin ( void )
inline

Definition at line 815 of file shapes.h.

References CSG_Data_Object::Update().

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_Shapes::Get_ObjectType ( void ) const
inlinevirtual

Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 797 of file shapes.h.

References SG_DATAOBJECT_TYPE_Shapes.

Referenced by SG_Create_Shapes().

◆ Get_Selection()

virtual CSG_Shape* CSG_Shapes::Get_Selection ( sLong Index = 0 )
inlinevirtual

Reimplemented in CSG_PointCloud.

Definition at line 833 of file shapes.h.

References CSG_Table::Get_Selection().

Referenced by Get_Selection_Extent().

◆ Get_Selection_Extent()

const CSG_Rect & CSG_Shapes::Get_Selection_Extent ( void )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 118 of file shapes_selection.cpp.

References CSG_Rect::Assign(), Get_Extent(), Get_Selection(), CSG_Table::Get_Selection_Count(), m_Extent_Selected, and CSG_Rect::Union().

◆ Get_Shape() [1/2]

CSG_Shape * CSG_Shapes::Get_Shape | ( | const CSG_Point & | Point,
 |  | double | Epsilon = 0.
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 586 of file shapes.cpp.

References CSG_Table::Get_Count(), CSG_Shape::Get_Distance(), Get_Extent(), INTERSECTION_None, CSG_Rect::Intersects(), CSG_Shape::Intersects(), SSG_Point::x, and SSG_Point::y.

Referenced by Assign(), Create(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), CSG_KDTree::Get_Match_Shape(), CSG_KDTree_2D::Get_Nearest_Shape(), CSG_KDTree_3D::Get_Nearest_Shape(), CSG_PointCloud::Get_Shape(), Make_Clean(), On_Update(), and Select().

◆ Get_Shape() [2/2]

virtual CSG_Shape* CSG_Shapes::Get_Shape ( sLong Index ) const
inlinevirtual

Definition at line 825 of file shapes.h.

◆ Get_Shape_byIndex()

virtual CSG_Shape* CSG_Shapes::Get_Shape_byIndex ( sLong Index ) const
inlinevirtual

Definition at line 826 of file shapes.h.

References CSG_Table::Get_Record_byIndex().

◆ Get_Type()

virtual TSG_Shape_Type CSG_Shapes::Get_Type ( void ) const
inlinevirtual

Definition at line 807 of file shapes.h.

Referenced by Assign(), CSG_Data_Manager::Get_Summary(), Select(), and SG_Create_Shapes().

◆ Get_Vertex_Type()

TSG_Vertex_Type CSG_Shapes::Get_Vertex_Type ( void ) const
inline

Definition at line 809 of file shapes.h.

Referenced by Assign(), and SG_Create_Shapes().

◆ Get_ZMax()

double CSG_Shapes::Get_ZMax ( void )
inline

Definition at line 814 of file shapes.h.

References CSG_Data_Object::Update().

Referenced by On_Update().

◆ Get_ZMin()

double CSG_Shapes::Get_ZMin ( void )
inline

Definition at line 813 of file shapes.h.

References CSG_Data_Object::Update().

◆ is_Valid()

virtual bool CSG_Shapes::is_Valid ( void ) const
inlinevirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 805 of file shapes.h.

References CSG_Table::Get_Count(), and SHAPE_TYPE_Undefined.

Referenced by Create(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), SG_Create_Shapes(), and SG_Get_Projected().

◆ Make_Clean()

bool CSG_Shapes::Make_Clean ( void )

Definition at line 628 of file shapes.cpp.

References CSG_Table::Get_Count(), CSG_Shape_Points::Get_M(), CSG_Shape_Points::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), Get_Shape(), CSG_Shape_Points::Get_Z(), CSG_Shape_Polygon::is_Clockwise(), CSG_Shape_Polygon::is_Lake(), m_Type, m_Vertex_Type, CSG_Shape_Points::Revert_Points(), CSG_Shape_Points::Set_M(), CSG_Shape_Points::Set_Z(), SG_UI_Process_Set_Progress(), SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZM, and SHAPE_TYPE_Polygon.

◆ On_Delete()

bool CSG_Shapes::On_Delete ( void )
protectedvirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 72 of file shapes_io.cpp.

References CSG_Data_Object::Get_File_Name(), SG_File_Delete(), and SG_File_Set_Extension().

◆ On_Reload()

bool CSG_Shapes::On_Reload ( void )
protectedvirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 66 of file shapes_io.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_Shapes::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 536 of file shapes.cpp.

References CSG_Rect::Assign(), CSG_Table::Get_Count(), CSG_Shape::Get_Extent(), CSG_Shape::Get_MMax(), Get_MMax(), CSG_Shape::Get_MMin(), Get_Shape(), CSG_Shape::Get_ZMax(), Get_ZMax(), CSG_Shape::Get_ZMin(), CSG_Table::m_Extent, m_MMax, m_MMin, m_Vertex_Type, m_ZMax, m_ZMin, CSG_Table::On_Update(), SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, and CSG_Rect::Union().

◆ Save() [1/3]

virtual bool CSG_Shapes::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 802 of file shapes.h.

References Save().

Referenced by Save().

◆ Save() [2/3]

bool CSG_Shapes::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 432 of file shapes.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), gSG_Shape_File_Format_Default, CSG_Data_Object::Set_File_Name(), CSG_Table::Set_Modified(), SG_File_Cmp_Extension(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, SG_UI_Process_Set_Ready(), SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoJSON, SHAPE_FILE_FORMAT_GeoPackage, and SHAPE_FILE_FORMAT_Undefined.

Referenced by CSG_TIN::Save().

◆ Save() [3/3]

virtual bool CSG_Shapes::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 803 of file shapes.h.

References Save().

Referenced by Save().

◆ Select() [1/4]

bool CSG_Shapes::Select | ( | const TSG_Point & | Point,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 94 of file shapes_selection.cpp.

References CSG_Table::Get_Count(), CSG_Table::Get_Selection_Count(), Get_Shape(), Get_Type(), Select(), CSG_Table::Select(), and SHAPE_TYPE_Polygon.

◆ Select() [2/4]

bool CSG_Shapes::Select | ( | const TSG_Rect & | Extent,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 75 of file shapes_selection.cpp.

References CSG_Table::Get_Count(), CSG_Table::Get_Selection_Count(), Get_Shape(), CSG_Shape::Intersects(), and CSG_Table::Select().

◆ Select() [3/4]

bool CSG_Shapes::Select | ( | CSG_Table_Record * | pShape = NULL,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 69 of file shapes_selection.cpp.

References CSG_Table::Select().

◆ Select() [4/4]

bool CSG_Shapes::Select | ( | sLong | Index,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented from CSG_Table.

Reimplemented in CSG_PointCloud.

Definition at line 63 of file shapes_selection.cpp.

References CSG_Table::Select().

Referenced by Select().

Friends And Related Function Documentation

◆ CSG_Shape

friend class CSG_Shape
friend

Definition at line 774 of file shapes.h.

Member Data Documentation

◆ m_Extent_Selected

CSG_Rect CSG_Shapes::m_Extent_Selected
protected

Definition at line 849 of file shapes.h.

Referenced by CSG_PointCloud::Get_Selection_Extent(), and Get_Selection_Extent().

◆ m_MMax

double CSG_Shapes::m_MMax
protected

Definition at line 843 of file shapes.h.

Referenced by On_Update().

◆ m_MMin

double CSG_Shapes::m_MMin
protected

Definition at line 843 of file shapes.h.

Referenced by On_Update().

◆ m_Type

TSG_Shape_Type CSG_Shapes::m_Type
protected

Definition at line 845 of file shapes.h.

Referenced by _Get_New_Record(), CSG_PointCloud::_On_Construction(), _On_Construction(), Create(), and Make_Clean().

◆ m_Vertex_Type

TSG_Vertex_Type CSG_Shapes::m_Vertex_Type
protected

Definition at line 847 of file shapes.h.

Referenced by _Get_New_Record(), CSG_PointCloud::_On_Construction(), _On_Construction(), Create(), Make_Clean(), and On_Update().

◆ m_ZMax

double CSG_Shapes::m_ZMax
protected

Definition at line 843 of file shapes.h.

Referenced by CSG_PointCloud::On_Update(), and On_Update().

◆ m_ZMin

double CSG_Shapes::m_ZMin
protected

Definition at line 843 of file shapes.h.

Referenced by CSG_PointCloud::On_Update(), and On_Update().

The documentation for this class was generated from the following files:
  • shapes.h
  • shapes.cpp
  • shapes_io.cpp
  • shapes_selection.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shapes Member List

This is the complete list of members for CSG_Shapes, including all inherited members.

_Add_Selection(sLong Index) | CSG_Table | protected
_Del_Selection(sLong Index) | CSG_Table | protected
_Get_New_Record(sLong Index) | CSG_Shapes | protectedvirtual
_On_Construction(void) | CSG_Shapes | protectedvirtual
_Set_Selection(sLong Index, sLong Selected) | CSG_Table | protected
_Stats_Invalidate(void) const | CSG_Table | protected
_Stats_Invalidate(int iField) const | CSG_Table | protected
_Stats_Update(int iField) const | CSG_Table | protectedvirtual
Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | virtual
Add_Field(const char *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Field(const wchar_t *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Record(CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY) | CSG_Shapes | virtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
Assign(CSG_Data_Object *pObject) | CSG_Shapes | virtual
Assign_Values(const CSG_Table &Table) | CSG_Table |
Assign_Values(CSG_Table *pTable) | CSG_Table |
Assign_Values(const SG_Char *File) | CSG_Table |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(const CSG_Shapes &Shapes) | CSG_Shapes |
Create(const char *File) | CSG_Shapes |
Create(const wchar_t *File) | CSG_Shapes |
Create(const CSG_String &File) | CSG_Shapes |
Create(TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY) | CSG_Shapes |
CSG_Table::Create(const CSG_Table &Table) | CSG_Table |
CSG_Table::Create(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Data_Object(void) | CSG_Data_Object |
CSG_Shape class | CSG_Shapes | friend
CSG_Shapes(void) | CSG_Shapes |
CSG_Shapes(const CSG_Shapes &Shapes) | CSG_Shapes |
CSG_Shapes(const char *File) | CSG_Shapes |
CSG_Shapes(const wchar_t *File) | CSG_Shapes |
CSG_Shapes(const CSG_String &File) | CSG_Shapes |
CSG_Shapes(TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY) | CSG_Shapes |
CSG_Table(void) | CSG_Table |
CSG_Table(const CSG_Table &Table) | CSG_Table |
CSG_Table(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Del_Field(int iField) | CSG_Table | virtual
Del_Index(void) | CSG_Table |
Del_Record(sLong Index) | CSG_Table | virtual
Del_Records(void) | CSG_Table | virtual
Del_Selection(void) | CSG_Table | virtual
Del_Shape(sLong Index) | CSG_Shapes | virtual
Del_Shape(CSG_Shape *pShape) | CSG_Shapes | virtual
Del_Shapes(void) | CSG_Shapes | inlinevirtual
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_Shapes | virtual
Find_Field(const CSG_String &Name) const | CSG_Table |
Find_Field(const CSG_String &Name, int &Index) const | CSG_Table |
Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(sLong &Index, int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Count(void) const | CSG_Table | inline
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void) | CSG_Shapes | inlinevirtual
Get_Field(const CSG_String &Name) const | CSG_Table |
Get_Field_Count(void) const | CSG_Table | inline
Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const | CSG_Table |
Get_Field_Name(int iField) const | CSG_Table | inline
Get_Field_Type(int iField) const | CSG_Table | inline
Get_File_Encoding(void) const | CSG_Table | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Index(sLong Index) const | CSG_Table | inline
Get_Index_Field(int i) const | CSG_Table | inline
Get_Index_Field(size_t i) const | CSG_Table | inline
Get_Index_Order(int i) const | CSG_Table | inline
Get_Index_Order(size_t i) const | CSG_Table | inline
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Maximum(int iField) const | CSG_Table | inline
Get_Mean(int iField) const | CSG_Table | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Minimum(int iField) const | CSG_Table | inline
Get_MMax(void) | CSG_Shapes | inline
Get_MMin(void) | CSG_Shapes | inline
Get_N(int iField) const | CSG_Table | inline
Get_Name(void) const | CSG_Data_Object |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_ObjectType(void) const | CSG_Shapes | inlinevirtual
Get_Owner(void) const | CSG_Data_Object | inline
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Range(int iField) const | CSG_Table | inline
Get_Record(sLong Index) const | CSG_Table | inlinevirtual
Get_Record_byIndex(sLong Index) const | CSG_Table | inline
Get_Selection(sLong Index=0) | CSG_Shapes | inlinevirtual
CSG_Table::Get_Selection(sLong Index=0) const | CSG_Table | inlinevirtual
Get_Selection_Count(void) const | CSG_Table | inline
Get_Selection_Extent(void) | CSG_Shapes | virtual
Get_Selection_Index(sLong Index=0) const | CSG_Table | inline
Get_Shape(const CSG_Point &Point, double Epsilon=0.) | CSG_Shapes | virtual
Get_Shape(sLong Index) const | CSG_Shapes | inlinevirtual
Get_Shape_byIndex(sLong Index) const | CSG_Shapes | inlinevirtual
Get_Statistics(int iField) const | CSG_Table | inline
Get_StdDev(int iField) const | CSG_Table | inline
Get_Sum(int iField) const | CSG_Table | inline
Get_Type(void) const | CSG_Shapes | inlinevirtual
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(sLong Index, int iField, CSG_String &Value) const | CSG_Table | virtual
Get_Value(sLong Index, int iField, double &Value) const | CSG_Table | virtual
Get_Variance(int iField) const | CSG_Table | inline
Get_Vertex_Type(void) const | CSG_Shapes | inline
Get_ZMax(void) | CSG_Shapes | inline
Get_ZMin(void) | CSG_Shapes | inline
Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
Inv_Selection(void) | CSG_Table | virtual
is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const | CSG_Table |
is_Compatible(CSG_Table *pTable, bool bExactMatch=false) const | CSG_Table |
is_File_Native(void) const | CSG_Data_Object | inline
is_Indexed(void) const | CSG_Table | inline
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Selected(sLong Index) const | CSG_Table | inlinevirtual
is_Valid(void) const | CSG_Shapes | inlinevirtual
Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_Encoding | CSG_Table | protected
m_Extent | CSG_Table | protected
m_Extent_Selected | CSG_Shapes | protected
m_Field_Name | CSG_Table | protected
m_Field_Stats | CSG_Table | protected
m_Field_Type | CSG_Table | protected
m_MMax | CSG_Shapes | protected
m_MMin | CSG_Shapes | protected
m_nBuffer | CSG_Table | protected
m_nFields | CSG_Table | protected
m_nRecords | CSG_Table | protected
m_pOwner | CSG_Data_Object | protected
m_Selection | CSG_Table | protected
m_Type | CSG_Shapes | protected
m_Vertex_Type | CSG_Shapes | protected
m_ZMax | CSG_Shapes | protected
m_ZMin | CSG_Shapes | protected
Make_Clean(void) | CSG_Shapes |
Mov_Field(int iField, int Position) | CSG_Table | virtual
On_Delete(void) | CSG_Shapes | protectedvirtual
On_NoData_Changed(void) | CSG_Table | protectedvirtual
On_Reload(void) | CSG_Shapes | protectedvirtual
On_Update(void) | CSG_Shapes | protectedvirtual
operator=(const CSG_Table &Table) | CSG_Table |
operator[](sLong Index) const | CSG_Table | inlinevirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format=0) | CSG_Shapes | virtual
Save(const char *File, int Format=0) | CSG_Shapes | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_Shapes | inlinevirtual
CSG_Table::Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | virtual
CSG_Table::Save(const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
CSG_Table::Save(const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Select(sLong Index, bool bInvert=false) | CSG_Shapes | virtual
Select(CSG_Table_Record *pShape=NULL, bool bInvert=false) | CSG_Shapes | virtual
Select(const TSG_Rect &Extent, bool bInvert=false) | CSG_Shapes | virtual
Select(const TSG_Point &Point, bool bInvert=false) | CSG_Shapes | virtual
Serialize(CSG_File &Stream, bool bSave) | CSG_Table |
Set_Count(sLong nRecords) | CSG_Table | virtual
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_Field_Name(int iField, const SG_Char *Name) | CSG_Table |
Set_Field_Type(int iField, TSG_Data_Type Type) | CSG_Table | virtual
Set_File_Encoding(int Encoding) | CSG_Table |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const | CSG_Table |
Set_Index(int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None) | CSG_Table |
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bModified=true) | CSG_Table | virtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Record(sLong Index, CSG_Table_Record *pCopy) | CSG_Table | virtual
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(sLong Index, int iField, const SG_Char *Value) | CSG_Table | virtual
Set_Value(sLong Index, int iField, double Value) | CSG_Table | virtual
Toggle_Index(int iField) | CSG_Table |
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_Shapes(void) | CSG_Shapes | virtual
~CSG_Table(void) | CSG_Table | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Shapes_OGIS_Converter Class Reference

Public Member Functions | Static Public Member Functions | List of all members
CSG_Shapes_OGIS_Converter Class Reference

#include <shapes.h>

Public Member Functions

CSG_Shapes_OGIS_Converter (void)

Static Public Member Functions

static bool | from_WKText (const CSG_String &Text, CSG_Shape *pShape)
static bool | to_WKText (CSG_Shape *pShape, CSG_String &Text)
static bool | from_WKBinary (CSG_Bytes &Bytes, CSG_Shape *pShape)
static bool | to_WKBinary (CSG_Shape *pShape, CSG_Bytes &Bytes)
static bool | from_ShapeType (CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY)
static CSG_String | from_ShapeType (TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY)
static bool | to_ShapeType (const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex)
static TSG_Shape_Type | to_ShapeType (const CSG_String &Type)
static TSG_Vertex_Type | to_VertexType (const CSG_String &Type)
static bool | from_ShapeType (DWORD &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY)
static bool | to_ShapeType (DWORD Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex)
static TSG_Shape_Type | to_ShapeType (DWORD Type)
static TSG_Vertex_Type | to_VertexType (DWORD Type)
static CSG_String | Type_asWKText (DWORD Type)
static DWORD | Type_asWKBinary (const CSG_String &Type)

Detailed Description

Definition at line 1519 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shapes_OGIS_Converter()

CSG_Shapes_OGIS_Converter::CSG_Shapes_OGIS_Converter ( void )
inline

Definition at line 1522 of file shapes.h.

Member Function Documentation

◆ from_ShapeType() [1/3]

bool CSG_Shapes_OGIS_Converter::from_ShapeType | ( | CSG_String & | Type,
 |  | TSG_Shape_Type | Shape,
 |  | TSG_Vertex_Type | Vertex = SG_VERTEX_TYPE_XY
 | ) |  |
static

Definition at line 831 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, SHAPE_TYPE_Polygon, and Type_asWKText().

Referenced by from_ShapeType(), to_WKBinary(), and to_WKText().

◆ from_ShapeType() [2/3]

bool CSG_Shapes_OGIS_Converter::from_ShapeType | ( | DWORD & | Type,
 |  | TSG_Shape_Type | Shape,
 |  | TSG_Vertex_Type | Vertex = SG_VERTEX_TYPE_XY
 | ) |  |
static

Definition at line 873 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ from_ShapeType() [3/3]

CSG_String CSG_Shapes_OGIS_Converter::from_ShapeType | ( | TSG_Shape_Type | Shape,
 |  | TSG_Vertex_Type | Vertex = SG_VERTEX_TYPE_XY
 | ) |  |
static

Definition at line 915 of file shapes_ogis.cpp.

References from_ShapeType().

◆ from_WKBinary()

bool CSG_Shapes_OGIS_Converter::from_WKBinary | ( | CSG_Bytes & | Bytes,
 |  | CSG_Shape * | pShape
 | ) |  |
static

Definition at line 583 of file shapes_ogis.cpp.

References CSG_Shape::Del_Parts(), CSG_Bytes::Get_Count(), CSG_Shape::Get_Type(), CSG_Bytes::Read_Byte(), CSG_Bytes::Read_DWord(), CSG_Bytes::Rewind(), SG_OGIS_BYTEORDER_NDR, SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, and to_ShapeType().

◆ from_WKText()

bool CSG_Shapes_OGIS_Converter::from_WKText | ( | const CSG_String & | Text,
 |  | CSG_Shape * | pShape
 | ) |  |
static

Definition at line 279 of file shapes_ogis.cpp.

References CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_Shape::Del_Parts(), CSG_Shape::Get_Type(), SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, to_ShapeType(), CSG_String::Trim_Both(), and Type_asWKBinary().

◆ to_ShapeType() [1/4]

TSG_Shape_Type CSG_Shapes_OGIS_Converter::to_ShapeType ( const CSG_String & Type )
static

Definition at line 1003 of file shapes_ogis.cpp.

References to_ShapeType().

◆ to_ShapeType() [2/4]

bool CSG_Shapes_OGIS_Converter::to_ShapeType | ( | const CSG_String & | Type,
 |  | TSG_Shape_Type & | Shape,
 |  | TSG_Vertex_Type & | Vertex
 | ) |  |
static

Definition at line 925 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, SHAPE_TYPE_Polygon, SHAPE_TYPE_Undefined, and Type_asWKBinary().

Referenced by from_WKBinary(), from_WKText(), to_ShapeType(), and to_VertexType().

◆ to_ShapeType() [3/4]

TSG_Shape_Type CSG_Shapes_OGIS_Converter::to_ShapeType ( DWORD Type )
static

Definition at line 1011 of file shapes_ogis.cpp.

References to_ShapeType().

◆ to_ShapeType() [4/4]

bool CSG_Shapes_OGIS_Converter::to_ShapeType | ( | DWORD | Type,
 |  | TSG_Shape_Type & | Shape,
 |  | TSG_Vertex_Type & | Vertex
 | ) |  |
static

Definition at line 964 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, SG_VERTEX_TYPE_XY, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, SHAPE_TYPE_Polygon, and SHAPE_TYPE_Undefined.

◆ to_VertexType() [1/2]

TSG_Vertex_Type CSG_Shapes_OGIS_Converter::to_VertexType ( const CSG_String & Type )
static

Definition at line 1019 of file shapes_ogis.cpp.

References to_ShapeType().

◆ to_VertexType() [2/2]

TSG_Vertex_Type CSG_Shapes_OGIS_Converter::to_VertexType ( DWORD Type )
static

Definition at line 1027 of file shapes_ogis.cpp.

References to_ShapeType().

◆ to_WKBinary()

bool CSG_Shapes_OGIS_Converter::to_WKBinary | ( | CSG_Shape * | pShape,
 |  | CSG_Bytes & | Bytes
 | ) |  |
static

Definition at line 799 of file shapes_ogis.cpp.

References CSG_Bytes::Destroy(), from_ShapeType(), CSG_Shape::Get_Type(), CSG_Shape::Get_Vertex_Type(), SG_OGIS_BYTEORDER_NDR, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ to_WKText()

bool CSG_Shapes_OGIS_Converter::to_WKText | ( | CSG_Shape * | pShape,
 |  | CSG_String & | Text
 | ) |  |
static

Definition at line 438 of file shapes_ogis.cpp.

References from_ShapeType(), CSG_Shape::Get_Type(), CSG_Shape::Get_Vertex_Type(), SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ Type_asWKBinary()

DWORD CSG_Shapes_OGIS_Converter::Type_asWKBinary ( const CSG_String & Type )
static

Definition at line 114 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_GeometryCollection, SG_OGIS_TYPE_GeometryCollectionM, SG_OGIS_TYPE_GeometryCollectionZ, SG_OGIS_TYPE_GeometryCollectionZM, SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, SG_OGIS_TYPE_PolyhedralSurface, SG_OGIS_TYPE_PolyhedralSurfaceM, SG_OGIS_TYPE_PolyhedralSurfaceZ, SG_OGIS_TYPE_PolyhedralSurfaceZM, SG_OGIS_TYPE_TIN, SG_OGIS_TYPE_TINM, SG_OGIS_TYPE_TINZ, SG_OGIS_TYPE_TINZM, SG_OGIS_TYPE_Triangle, SG_OGIS_TYPE_TriangleM, SG_OGIS_TYPE_TriangleZ, SG_OGIS_TYPE_TriangleZM, SG_OGIS_TYPE_Undefined, and TYPE_AS_WKB.

Referenced by from_WKText(), and to_ShapeType().

◆ Type_asWKText()

CSG_String CSG_Shapes_OGIS_Converter::Type_asWKText ( DWORD Type )
static

Definition at line 61 of file shapes_ogis.cpp.

References SG_OGIS_TYPE_GeometryCollection, SG_OGIS_TYPE_GeometryCollectionM, SG_OGIS_TYPE_GeometryCollectionZ, SG_OGIS_TYPE_GeometryCollectionZM, SG_OGIS_TYPE_LineString, SG_OGIS_TYPE_LineStringM, SG_OGIS_TYPE_LineStringZ, SG_OGIS_TYPE_LineStringZM, SG_OGIS_TYPE_MultiLineString, SG_OGIS_TYPE_MultiLineStringM, SG_OGIS_TYPE_MultiLineStringZ, SG_OGIS_TYPE_MultiLineStringZM, SG_OGIS_TYPE_MultiPoint, SG_OGIS_TYPE_MultiPointM, SG_OGIS_TYPE_MultiPointZ, SG_OGIS_TYPE_MultiPointZM, SG_OGIS_TYPE_MultiPolygon, SG_OGIS_TYPE_MultiPolygonM, SG_OGIS_TYPE_MultiPolygonZ, SG_OGIS_TYPE_MultiPolygonZM, SG_OGIS_TYPE_Point, SG_OGIS_TYPE_PointM, SG_OGIS_TYPE_PointZ, SG_OGIS_TYPE_PointZM, SG_OGIS_TYPE_Polygon, SG_OGIS_TYPE_PolygonM, SG_OGIS_TYPE_PolygonZ, SG_OGIS_TYPE_PolygonZM, SG_OGIS_TYPE_PolyhedralSurface, SG_OGIS_TYPE_PolyhedralSurfaceM, SG_OGIS_TYPE_PolyhedralSurfaceZ, SG_OGIS_TYPE_PolyhedralSurfaceZM, SG_OGIS_TYPE_TIN, SG_OGIS_TYPE_TINM, SG_OGIS_TYPE_TINZ, SG_OGIS_TYPE_TINZM, SG_OGIS_TYPE_Triangle, SG_OGIS_TYPE_TriangleM, SG_OGIS_TYPE_TriangleZ, and SG_OGIS_TYPE_TriangleZM.

Referenced by from_ShapeType().

The documentation for this class was generated from the following files:
  • shapes.h
  • shapes_ogis.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Shapes_OGIS_Converter Member List

This is the complete list of members for CSG_Shapes_OGIS_Converter, including all inherited members.

CSG_Shapes_OGIS_Converter(void) | CSG_Shapes_OGIS_Converter | inline
from_ShapeType(CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY) | CSG_Shapes_OGIS_Converter | static
from_ShapeType(TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY) | CSG_Shapes_OGIS_Converter | static
from_ShapeType(DWORD &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY) | CSG_Shapes_OGIS_Converter | static
from_WKBinary(CSG_Bytes &Bytes, CSG_Shape *pShape) | CSG_Shapes_OGIS_Converter | static
from_WKText(const CSG_String &Text, CSG_Shape *pShape) | CSG_Shapes_OGIS_Converter | static
to_ShapeType(const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex) | CSG_Shapes_OGIS_Converter | static
to_ShapeType(const CSG_String &Type) | CSG_Shapes_OGIS_Converter | static
to_ShapeType(DWORD Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex) | CSG_Shapes_OGIS_Converter | static
to_ShapeType(DWORD Type) | CSG_Shapes_OGIS_Converter | static
to_VertexType(const CSG_String &Type) | CSG_Shapes_OGIS_Converter | static
to_VertexType(DWORD Type) | CSG_Shapes_OGIS_Converter | static
to_WKBinary(CSG_Shape *pShape, CSG_Bytes &Bytes) | CSG_Shapes_OGIS_Converter | static
to_WKText(CSG_Shape *pShape, CSG_String &Text) | CSG_Shapes_OGIS_Converter | static
Type_asWKBinary(const CSG_String &Type) | CSG_Shapes_OGIS_Converter | static
Type_asWKText(DWORD Type) | CSG_Shapes_OGIS_Converter | static
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Simple_Statistics Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Simple_Statistics Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Simple_Statistics (void)
CSG_Simple_Statistics (bool bHoldValues)
CSG_Simple_Statistics (const CSG_Simple_Statistics &Statistics)
CSG_Simple_Statistics (double Mean, double StdDev, sLong Count=1000)
CSG_Simple_Statistics (const CSG_Vector &Values, bool bHoldValues=false)
bool | Create (bool bHoldValues=false)
bool | Create (const CSG_Simple_Statistics &Statistics)
bool | Create (double Mean, double StdDev, sLong Count=1000)
bool | Create (const CSG_Vector &Values, bool bHoldValues=false)
void | Invalidate (void)
bool | Evaluate (void)
int | is_Evaluated (void) const
bool | Set_Count (sLong Count)
sLong | Get_Count (void) const
double | Get_Weights (void) const
double | Get_Minimum (void)
double | Get_Maximum (void)
double | Get_Range (void)
double | Get_Sum (void)
double | Get_Sum_Of_Squares (void)
double | Get_Mean (void)
double | Get_Variance (void)
double | Get_StdDev (void)
double | Get_Kurtosis (void)
double | Get_Skewness (void)
double | Get_SkewnessPearson (void)
double | Get_Quantile (double Quantile)
double | Get_Percentile (double Percentile)
double | Get_Median (void)
double | Get_Gini (void)
sLong | Get_IndexOfMinimum (void)
sLong | Get_IndexOfMaximum (void)
sLong | Get_nValues_Above (double Threshold, bool bEquals=false)
sLong | Get_nValues_Below (double Threshold, bool bEquals=false)
void | Add (const CSG_Simple_Statistics &Statistics)
void | Add_Value (double Value, double Weight=1.)
double * | Get_Values (void) const
double | Get_Value (sLong i) const
double | operator[] (sLong i) const
CSG_Simple_Statistics & | operator= (const CSG_Simple_Statistics &Statistics)
CSG_Simple_Statistics & | operator+= (const CSG_Simple_Statistics &Statistics)
CSG_Simple_Statistics & | operator+= (double Value)

Protected Member Functions

void _Evaluate (int Level=1)

Protected Attributes

bool | m_bSorted
int | m_bEvaluated
sLong m_nValues
double | m_Weights
double | m_Sum
double | m_Sum2
double | m_Minimum
double | m_Maximum
double | m_Range
double | m_Mean
double | m_Variance
double | m_StdDev
double | m_Kurtosis
double | m_Skewness
double | m_Gini
CSG_Array m_Values

Detailed Description

Definition at line 707 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Simple_Statistics() [1/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( void )

Definition at line 324 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [2/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( bool bHoldValues )

Definition at line 329 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [3/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( const CSG_Simple_Statistics & Statistics )

Definition at line 334 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [4/5]

CSG_Simple_Statistics::CSG_Simple_Statistics | ( | double | Mean,
 |  | double | StdDev,
 |  | sLong | Count = 1000
 | ) |  |

Definition at line 339 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [5/5]

CSG_Simple_Statistics::CSG_Simple_Statistics | ( | const CSG_Vector & | Values,
 |  | bool | bHoldValues = false
 | ) |  |

Definition at line 344 of file mat_tools.cpp.

References Create().

Member Function Documentation

◆ _Evaluate()

void CSG_Simple_Statistics::_Evaluate ( int Level = 1 )
protected

Definition at line 562 of file mat_tools.cpp.

References Get_Count(), Get_Mean(), CSG_Array::Get_Size(), Get_StdDev(), Get_Value(), m_bEvaluated, m_Kurtosis, m_Maximum, m_Mean, m_Minimum, m_Range, m_Skewness, m_StdDev, m_Sum, m_Sum2, m_Values, m_Variance, and m_Weights.

Referenced by Evaluate().

◆ Add()

void CSG_Simple_Statistics::Add ( const CSG_Simple_Statistics & Statistics )

Definition at line 481 of file mat_tools.cpp.

References Create(), CSG_Array::Destroy(), CSG_Array::Get_Array(), CSG_Array::Get_Size(), Get_Value(), m_bEvaluated, m_bSorted, m_Kurtosis, m_Maximum, m_Minimum, m_nValues, m_Skewness, m_Sum, m_Sum2, m_Values, m_Weights, and CSG_Array::Set_Array().

◆ Add_Value()

void CSG_Simple_Statistics::Add_Value | ( | double | Value,
 |  | double | Weight = 1.
 | ) |  |

Definition at line 527 of file mat_tools.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Value_Size(), CSG_Array::Inc_Array(), m_bEvaluated, m_bSorted, m_Maximum, m_Minimum, m_nValues, m_Sum, m_Sum2, m_Values, and m_Weights.

Referenced by CSG_Shape_Part::_Update_Extent(), CSG_PRQuadTree_Node::Add_Point(), and Create().

◆ Create() [1/4]

bool CSG_Simple_Statistics::Create ( bool bHoldValues = false )

Definition at line 350 of file mat_tools.cpp.

References CSG_Array::Create(), Invalidate(), and m_Values.

Referenced by Add(), CSG_Regression::Calculate(), CSG_Trend::Clr_Data(), Create(), CSG_Simple_Statistics(), CSG_Histogram::Destroy(), CSG_Grid::Get_Statistics(), and CSG_Grids::Get_Statistics().

◆ Create() [2/4]

bool CSG_Simple_Statistics::Create ( const CSG_Simple_Statistics & Statistics )

Definition at line 359 of file mat_tools.cpp.

References CSG_Array::Create(), m_bEvaluated, m_bSorted, m_Gini, m_Kurtosis, m_Maximum, m_Mean, m_Minimum, m_nValues, m_Range, m_Skewness, m_StdDev, m_Sum, m_Sum2, m_Values, m_Variance, and m_Weights.

◆ Create() [3/4]

bool CSG_Simple_Statistics::Create | ( | const CSG_Vector & | Values,
 |  | bool | bHoldValues = false
 | ) |  |

Definition at line 408 of file mat_tools.cpp.

References Add_Value(), Create(), and CSG_Vector::Get_Size().

◆ Create() [4/4]

bool CSG_Simple_Statistics::Create | ( | double | Mean,
 |  | double | StdDev,
 |  | sLong | Count = 1000
 | ) |  |

Definition at line 386 of file mat_tools.cpp.

References Invalidate(), m_bEvaluated, m_Maximum, m_Mean, m_Minimum, m_nValues, m_Range, m_StdDev, m_Sum, m_Sum2, m_Variance, and m_Weights.

◆ Evaluate()

bool CSG_Simple_Statistics::Evaluate ( void )

Definition at line 473 of file mat_tools.cpp.

References _Evaluate(), and is_Evaluated().

Referenced by CSG_PointCloud::_Stats_Update(), and CSG_Table::_Stats_Update().

◆ Get_Count()

sLong CSG_Simple_Statistics::Get_Count ( void ) const
inline

Definition at line 728 of file mat_tools.h.

Referenced by _Evaluate(), CSG_PointCloud::_Stats_Update(), CSG_Table::_Stats_Update(), CSG_Histogram::Create(), CSG_Grid::Get_Data_Count(), CSG_Grids::Get_Data_Count(), Get_Gini(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_NoData_Count(), CSG_Grids::Get_NoData_Count(), Get_nValues_Above(), Get_nValues_Below(), CSG_Grid::Get_Statistics(), CSG_Grids::Get_Statistics(), CSG_Grid::On_Update(), and CSG_Grids::On_Update().

◆ Get_Gini()

double CSG_Simple_Statistics::Get_Gini ( void )

The Gini coefficient is a measure of statistical dispersion intended to represent the income or wealth distribution of a nation's residents, and is the most commonly used measure of inequality.

Definition at line 681 of file mat_tools.cpp.

References CSG_Array::Get_Array(), Get_Count(), CSG_Array::Get_Size(), Get_Sum(), Get_Value(), m_bSorted, m_Gini, m_Values, and SG_Compare_Double().

◆ Get_IndexOfMaximum()

sLong CSG_Simple_Statistics::Get_IndexOfMaximum ( void )

Returns the index of the maximum value in the order values have been added to the statistics. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 734 of file mat_tools.cpp.

References CSG_Array::Get_Size(), Get_Values(), and m_Values.

◆ Get_IndexOfMinimum()

sLong CSG_Simple_Statistics::Get_IndexOfMinimum ( void )

Returns the index of the minimum value in the order values have been added to the statistics. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 710 of file mat_tools.cpp.

References CSG_Array::Get_Size(), Get_Values(), and m_Values.

◆ Get_Kurtosis()

double CSG_Simple_Statistics::Get_Kurtosis ( void )
inline

Definition at line 740 of file mat_tools.h.

◆ Get_Maximum()

double CSG_Simple_Statistics::Get_Maximum ( void )
inline

Definition at line 732 of file mat_tools.h.

Referenced by CSG_Shape_Part::_Update_Extent(), CSG_Regression::Calculate(), CSG_Histogram::Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Max(), CSG_Grids::Get_Max(), and CSG_PointCloud::On_Update().

◆ Get_Mean()

double CSG_Simple_Statistics::Get_Mean ( void )
inline

Definition at line 736 of file mat_tools.h.

Referenced by _Evaluate(), CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Calculate(), CSG_Regression::Calculate(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Grid::Get_Mean(), CSG_Grids::Get_Mean(), Get_SkewnessPearson(), CSG_Classifier_Supervised::Load(), SG_Get_Correlation_Matrix(), and CSG_Histogram::Update().

◆ Get_Median()

double CSG_Simple_Statistics::Get_Median ( void )

Returns the medium (i.e. thee 50 percentile or 0.5 quantile). Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 669 of file mat_tools.cpp.

References Get_Quantile().

Referenced by Get_SkewnessPearson().

◆ Get_Minimum()

double CSG_Simple_Statistics::Get_Minimum ( void )
inline

Definition at line 731 of file mat_tools.h.

Referenced by CSG_Shape_Part::_Update_Extent(), CSG_Regression::Calculate(), CSG_Histogram::Create(), CSG_Grid::Get_Histogram(), CSG_Grids::Get_Histogram(), CSG_Grid::Get_Min(), CSG_Grids::Get_Min(), and CSG_PointCloud::On_Update().

◆ Get_nValues_Above()

sLong CSG_Simple_Statistics::Get_nValues_Above | ( | double | Threshold,
 |  | bool | bEquals = false
 | ) |  |

Returns the number of values greater than the threshold value. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 758 of file mat_tools.cpp.

References Get_Count(), CSG_Array::Get_Size(), Get_Value(), and m_Values.

◆ Get_nValues_Below()

sLong CSG_Simple_Statistics::Get_nValues_Below | ( | double | Threshold,
 |  | bool | bEquals = false
 | ) |  |

Returns the number of values lower than the threshold value. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 780 of file mat_tools.cpp.

References Get_Count(), CSG_Array::Get_Size(), Get_Value(), and m_Values.

◆ Get_Percentile()

double CSG_Simple_Statistics::Get_Percentile ( double Percentile )

Returns the requested percentile (i.e. the quantile requested as percentage, the 50 percentile is the medium value). Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 658 of file mat_tools.cpp.

References Get_Quantile().

◆ Get_Quantile()

double CSG_Simple_Statistics::Get_Quantile ( double Quantile )

Returns the requested quantile (value between 0 and 1). The 0.5 quantile returns the median. Remark: Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 618 of file mat_tools.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Size(), Get_Values(), m_bSorted, m_Mean, m_Values, and SG_Compare_Double().

Referenced by Get_Median(), and Get_Percentile().

◆ Get_Range()

double CSG_Simple_Statistics::Get_Range ( void )
inline

Definition at line 733 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::Get_CrossValidation(), CSG_Grid::Get_Range(), and CSG_Grids::Get_Range().

◆ Get_Skewness()

double CSG_Simple_Statistics::Get_Skewness ( void )
inline

Definition at line 741 of file mat_tools.h.

◆ Get_SkewnessPearson()

double CSG_Simple_Statistics::Get_SkewnessPearson ( void )

Skewness after Pearson, i.e. the difference of mean and median divided by standard deviation. Remark: Skewness calculation is only possible, if statistics has been created with the bHoldValues flag set to true.

Definition at line 606 of file mat_tools.cpp.

References Get_Mean(), Get_Median(), and Get_StdDev().

◆ Get_StdDev()

double CSG_Simple_Statistics::Get_StdDev ( void )
inline

Definition at line 738 of file mat_tools.h.

Referenced by _Evaluate(), Get_SkewnessPearson(), CSG_Grid::Get_StdDev(), CSG_Grids::Get_StdDev(), and SG_Get_Correlation_Matrix().

◆ Get_Sum()

double CSG_Simple_Statistics::Get_Sum ( void )
inline

Definition at line 734 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::Get_CrossValidation(), and Get_Gini().

◆ Get_Sum_Of_Squares()

double CSG_Simple_Statistics::Get_Sum_Of_Squares ( void )
inline

Definition at line 735 of file mat_tools.h.

◆ Get_Value()

double CSG_Simple_Statistics::Get_Value ( sLong i ) const
inline

Definition at line 760 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Get_Gini(), Get_nValues_Above(), and Get_nValues_Below().

◆ Get_Values()

double* CSG_Simple_Statistics::Get_Values ( void ) const
inline

Definition at line 759 of file mat_tools.h.

Referenced by Get_IndexOfMaximum(), Get_IndexOfMinimum(), and Get_Quantile().

◆ Get_Variance()

double CSG_Simple_Statistics::Get_Variance ( void )
inline

Definition at line 737 of file mat_tools.h.

Referenced by CSG_Regression::Calculate(), CSG_Grid::Get_Variance(), and CSG_Grids::Get_Variance().

◆ Get_Weights()

double CSG_Simple_Statistics::Get_Weights ( void ) const
inline

Definition at line 729 of file mat_tools.h.

◆ Invalidate()

void CSG_Simple_Statistics::Invalidate ( void )

Definition at line 447 of file mat_tools.cpp.

References CSG_Array::Destroy(), m_bEvaluated, m_bSorted, m_Gini, m_Kurtosis, m_Maximum, m_Mean, m_Minimum, m_nValues, m_Range, m_Skewness, m_StdDev, m_Sum, m_Sum2, m_Values, m_Variance, and m_Weights.

Referenced by CSG_Table::_Stats_Invalidate(), CSG_Grid::Assign(), Create(), CSG_Grid::On_Update(), CSG_Grids::On_Update(), and CSG_PointCloud::On_Update().

◆ is_Evaluated()

int CSG_Simple_Statistics::is_Evaluated ( void ) const
inline

Definition at line 724 of file mat_tools.h.

Referenced by CSG_PointCloud::_Stats_Update(), CSG_Table::_Stats_Update(), and Evaluate().

◆ operator+=() [1/2]

CSG_Simple_Statistics& CSG_Simple_Statistics::operator+= ( const CSG_Simple_Statistics & Statistics )
inline

Definition at line 765 of file mat_tools.h.

◆ operator+=() [2/2]

CSG_Simple_Statistics& CSG_Simple_Statistics::operator+= ( double Value )
inline

Definition at line 766 of file mat_tools.h.

◆ operator=()

CSG_Simple_Statistics& CSG_Simple_Statistics::operator= ( const CSG_Simple_Statistics & Statistics )
inline

Definition at line 764 of file mat_tools.h.

◆ operator[]()

double CSG_Simple_Statistics::operator[] ( sLong i ) const
inline

Definition at line 761 of file mat_tools.h.

◆ Set_Count()

bool CSG_Simple_Statistics::Set_Count ( sLong Count )

Definition at line 424 of file mat_tools.cpp.

References CSG_Array::Destroy(), m_bEvaluated, m_nValues, m_Sum, m_Sum2, m_Values, and m_Weights.

Referenced by CSG_PointCloud::_Stats_Update(), CSG_Table::_Stats_Update(), CSG_Grid::On_Update(), CSG_Grids::On_Update(), and CSG_Histogram::Scale_Element_Count().

Member Data Documentation

◆ m_bEvaluated

int CSG_Simple_Statistics::m_bEvaluated
protected

Definition at line 773 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_bSorted

bool CSG_Simple_Statistics::m_bSorted
protected

Definition at line 771 of file mat_tools.h.

Referenced by Add(), Add_Value(), Create(), Get_Gini(), Get_Quantile(), and Invalidate().

◆ m_Gini

double CSG_Simple_Statistics::m_Gini
protected

Definition at line 777 of file mat_tools.h.

Referenced by Create(), Get_Gini(), and Invalidate().

◆ m_Kurtosis

double CSG_Simple_Statistics::m_Kurtosis
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Create(), and Invalidate().

◆ m_Maximum

double CSG_Simple_Statistics::m_Maximum
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), and Invalidate().

◆ m_Mean

double CSG_Simple_Statistics::m_Mean
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Create(), Get_Quantile(), and Invalidate().

◆ m_Minimum

double CSG_Simple_Statistics::m_Minimum
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), and Invalidate().

◆ m_nValues

sLong CSG_Simple_Statistics::m_nValues
protected

Definition at line 775 of file mat_tools.h.

Referenced by Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Range

double CSG_Simple_Statistics::m_Range
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Skewness

double CSG_Simple_Statistics::m_Skewness
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Create(), and Invalidate().

◆ m_StdDev

double CSG_Simple_Statistics::m_StdDev
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Sum

double CSG_Simple_Statistics::m_Sum
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Sum2

double CSG_Simple_Statistics::m_Sum2
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Values

CSG_Array CSG_Simple_Statistics::m_Values
protected

Definition at line 779 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Get_Gini(), Get_IndexOfMaximum(), Get_IndexOfMinimum(), Get_nValues_Above(), Get_nValues_Below(), Get_Quantile(), Invalidate(), and Set_Count().

◆ m_Variance

double CSG_Simple_Statistics::m_Variance
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Weights

double CSG_Simple_Statistics::m_Weights
protected

Definition at line 777 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Simple_Statistics Member List

This is the complete list of members for CSG_Simple_Statistics, including all inherited members.

_Evaluate(int Level=1) | CSG_Simple_Statistics | protected
Add(const CSG_Simple_Statistics &Statistics) | CSG_Simple_Statistics |
Add_Value(double Value, double Weight=1.) | CSG_Simple_Statistics |
Create(bool bHoldValues=false) | CSG_Simple_Statistics |
Create(const CSG_Simple_Statistics &Statistics) | CSG_Simple_Statistics |
Create(double Mean, double StdDev, sLong Count=1000) | CSG_Simple_Statistics |
Create(const CSG_Vector &Values, bool bHoldValues=false) | CSG_Simple_Statistics |
CSG_Simple_Statistics(void) | CSG_Simple_Statistics |
CSG_Simple_Statistics(bool bHoldValues) | CSG_Simple_Statistics |
CSG_Simple_Statistics(const CSG_Simple_Statistics &Statistics) | CSG_Simple_Statistics |
CSG_Simple_Statistics(double Mean, double StdDev, sLong Count=1000) | CSG_Simple_Statistics |
CSG_Simple_Statistics(const CSG_Vector &Values, bool bHoldValues=false) | CSG_Simple_Statistics |
Evaluate(void) | CSG_Simple_Statistics |
Get_Count(void) const | CSG_Simple_Statistics | inline
Get_Gini(void) | CSG_Simple_Statistics |
Get_IndexOfMaximum(void) | CSG_Simple_Statistics |
Get_IndexOfMinimum(void) | CSG_Simple_Statistics |
Get_Kurtosis(void) | CSG_Simple_Statistics | inline
Get_Maximum(void) | CSG_Simple_Statistics | inline
Get_Mean(void) | CSG_Simple_Statistics | inline
Get_Median(void) | CSG_Simple_Statistics |
Get_Minimum(void) | CSG_Simple_Statistics | inline
Get_nValues_Above(double Threshold, bool bEquals=false) | CSG_Simple_Statistics |
Get_nValues_Below(double Threshold, bool bEquals=false) | CSG_Simple_Statistics |
Get_Percentile(double Percentile) | CSG_Simple_Statistics |
Get_Quantile(double Quantile) | CSG_Simple_Statistics |
Get_Range(void) | CSG_Simple_Statistics | inline
Get_Skewness(void) | CSG_Simple_Statistics | inline
Get_SkewnessPearson(void) | CSG_Simple_Statistics |
Get_StdDev(void) | CSG_Simple_Statistics | inline
Get_Sum(void) | CSG_Simple_Statistics | inline
Get_Sum_Of_Squares(void) | CSG_Simple_Statistics | inline
Get_Value(sLong i) const | CSG_Simple_Statistics | inline
Get_Values(void) const | CSG_Simple_Statistics | inline
Get_Variance(void) | CSG_Simple_Statistics | inline
Get_Weights(void) const | CSG_Simple_Statistics | inline
Invalidate(void) | CSG_Simple_Statistics |
is_Evaluated(void) const | CSG_Simple_Statistics | inline
m_bEvaluated | CSG_Simple_Statistics | protected
m_bSorted | CSG_Simple_Statistics | protected
m_Gini | CSG_Simple_Statistics | protected
m_Kurtosis | CSG_Simple_Statistics | protected
m_Maximum | CSG_Simple_Statistics | protected
m_Mean | CSG_Simple_Statistics | protected
m_Minimum | CSG_Simple_Statistics | protected
m_nValues | CSG_Simple_Statistics | protected
m_Range | CSG_Simple_Statistics | protected
m_Skewness | CSG_Simple_Statistics | protected
m_StdDev | CSG_Simple_Statistics | protected
m_Sum | CSG_Simple_Statistics | protected
m_Sum2 | CSG_Simple_Statistics | protected
m_Values | CSG_Simple_Statistics | protected
m_Variance | CSG_Simple_Statistics | protected
m_Weights | CSG_Simple_Statistics | protected
operator+=(const CSG_Simple_Statistics &Statistics) | CSG_Simple_Statistics | inline
operator+=(double Value) | CSG_Simple_Statistics | inline
operator=(const CSG_Simple_Statistics &Statistics) | CSG_Simple_Statistics | inline
operator[](sLong i) const | CSG_Simple_Statistics | inline
Set_Count(sLong Count) | CSG_Simple_Statistics |
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Spline Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_Spline Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Spline (void)
virtual | ~CSG_Spline (void)
void | Destroy (void)
bool | Create (double *xValues, double *yValues, int nValues, double yA=1.0e30, double yB=1.0e30)
bool | Create (double yA=1.0e30, double yB=1.0e30)
void | Add (double x, double y)
int | Get_Count (void) const
double | Get_xMin (void) const
double | Get_xMax (void) const
double | Get_x (int i) const
double | Get_y (int i) const
bool | Get_Value (double x, double &y)
double | Get_Value (double x)

Protected Member Functions

bool _Create (double yA, double yB)

Protected Attributes

bool m_bCreated
CSG_Vector m_x
CSG_Vector m_y
CSG_Vector m_z

Detailed Description

Definition at line 1398 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Spline()

CSG_Spline::CSG_Spline ( void )

Definition at line 63 of file mat_spline.cpp.

References m_bCreated.

◆ ~CSG_Spline()

CSG_Spline::~CSG_Spline ( void )
virtual

Definition at line 69 of file mat_spline.cpp.

References Destroy().

Member Function Documentation

◆ _Create()

bool CSG_Spline::_Create | ( | double | yA,
 |  | double | yB
 | ) |  |
protected

Definition at line 128 of file mat_spline.cpp.

References CSG_Vector::Create(), Get_Count(), CSG_Vector::Get_Data(), m_bCreated, m_x, m_y, and m_z.

Referenced by Create().

◆ Add()

void CSG_Spline::Add | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 114 of file mat_spline.cpp.

References CSG_Vector::Add_Row(), m_bCreated, m_x, and m_y.

Referenced by Create().

◆ Create() [1/2]

bool CSG_Spline::Create | ( | double * | xValues,
 |  | double * | yValues,
 |  | int | nValues,
 |  | double | yA = 1.0e30,
 |  | double | yB = 1.0e30
 | ) |  |

Definition at line 90 of file mat_spline.cpp.

References _Create(), Add(), and Destroy().

Referenced by Get_Value().

◆ Create() [2/2]

bool CSG_Spline::Create | ( | double | yA = 1.0e30,
 |  | double | yB = 1.0e30
 | ) |  |

Definition at line 103 of file mat_spline.cpp.

References _Create().

◆ Destroy()

void CSG_Spline::Destroy ( void )

Definition at line 80 of file mat_spline.cpp.

References CSG_Vector::Destroy(), m_bCreated, m_x, m_y, and m_z.

Referenced by Create(), and ~CSG_Spline().

◆ Get_Count()

int CSG_Spline::Get_Count ( void ) const
inline

Definition at line 1411 of file mat_tools.h.

Referenced by _Create(), and Get_Value().

◆ Get_Value() [1/2]

double CSG_Spline::Get_Value ( double x )

Definition at line 248 of file mat_spline.cpp.

References Get_Value().

◆ Get_Value() [2/2]

bool CSG_Spline::Get_Value | ( | double | x,
 |  | double & | y
 | ) |  |

Definition at line 206 of file mat_spline.cpp.

References Create(), Get_Count(), m_bCreated, m_x, m_y, and m_z.

Referenced by Get_Value(), and CSG_Grids::Get_Value().

◆ Get_x()

double CSG_Spline::Get_x ( int i ) const
inline

Definition at line 1414 of file mat_tools.h.

◆ Get_xMax()

double CSG_Spline::Get_xMax ( void ) const
inline

Definition at line 1413 of file mat_tools.h.

◆ Get_xMin()

double CSG_Spline::Get_xMin ( void ) const
inline

Definition at line 1412 of file mat_tools.h.

◆ Get_y()

double CSG_Spline::Get_y ( int i ) const
inline

Definition at line 1415 of file mat_tools.h.

Member Data Documentation

◆ m_bCreated

bool CSG_Spline::m_bCreated
protected

Definition at line 1423 of file mat_tools.h.

Referenced by _Create(), Add(), CSG_Spline(), Destroy(), and Get_Value().

◆ m_x

CSG_Vector CSG_Spline::m_x
protected

Definition at line 1425 of file mat_tools.h.

Referenced by _Create(), Add(), Destroy(), and Get_Value().

◆ m_y

CSG_Vector CSG_Spline::m_y
protected

Definition at line 1425 of file mat_tools.h.

Referenced by _Create(), Add(), Destroy(), and Get_Value().

◆ m_z

CSG_Vector CSG_Spline::m_z
protected

Definition at line 1425 of file mat_tools.h.

Referenced by _Create(), Destroy(), and Get_Value().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_spline.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Spline Member List

This is the complete list of members for CSG_Spline, including all inherited members.

_Create(double yA, double yB) | CSG_Spline | protected
Add(double x, double y) | CSG_Spline |
Create(double *xValues, double *yValues, int nValues, double yA=1.0e30, double yB=1.0e30) | CSG_Spline |
Create(double yA=1.0e30, double yB=1.0e30) | CSG_Spline |
CSG_Spline(void) | CSG_Spline |
Destroy(void) | CSG_Spline |
Get_Count(void) const | CSG_Spline | inline
Get_Value(double x, double &y) | CSG_Spline |
Get_Value(double x) | CSG_Spline |
Get_x(int i) const | CSG_Spline | inline
Get_xMax(void) const | CSG_Spline | inline
Get_xMin(void) const | CSG_Spline | inline
Get_y(int i) const | CSG_Spline | inline
m_bCreated | CSG_Spline | protected
m_x | CSG_Spline | protected
m_y | CSG_Spline | protected
m_z | CSG_Spline | protected
~CSG_Spline(void) | CSG_Spline | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Stack Class Reference

Public Member Functions | Protected Member Functions | List of all members
CSG_Stack Class Reference

#include <api_core.h>

Inheritance diagram for CSG_Stack:
CSG_Grid_Stack

Public Member Functions

CSG_Stack (size_t RecordSize)
virtual | ~CSG_Stack (void)
bool | Destroy (void)
size_t | Get_RecordSize (void) const
size_t | Get_Size (void) const
bool | Clear (bool bFreeMemory=false)

Protected Member Functions

void * | Get_Record (size_t i) const
void * | Get_Record_Push (void)
void * | Get_Record_Pop (void)

Detailed Description

Definition at line 922 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Stack()

CSG_Stack::CSG_Stack ( size_t RecordSize )
inline

Definition at line 925 of file api_core.h.

References CSG_Array::Create().

◆ ~CSG_Stack()

virtual CSG_Stack::~CSG_Stack ( void )
inlinevirtual

Definition at line 930 of file api_core.h.

Member Function Documentation

◆ Clear()

bool CSG_Stack::Clear ( bool bFreeMemory = false )
inline

Definition at line 937 of file api_core.h.

References CSG_Array::Set_Array().

◆ Destroy()

bool CSG_Stack::Destroy ( void )
inline

Definition at line 932 of file api_core.h.

References CSG_Array::Set_Array().

◆ Get_Record()

void* CSG_Stack::Get_Record ( size_t i ) const
inlineprotected

Definition at line 945 of file api_core.h.

References CSG_Array::Get_Entry().

Referenced by CSG_Grid_Stack::operator[]().

◆ Get_Record_Pop()

void* CSG_Stack::Get_Record_Pop ( void )
inlineprotected

Definition at line 955 of file api_core.h.

References CSG_Array::Dec_Array(), CSG_Array::Get_Array(), CSG_Array::Get_Entry(), CSG_Array::Get_Size(), and CSG_Array::Get_Value_Size().

Referenced by CSG_Grid_Stack::Pop().

◆ Get_Record_Push()

void* CSG_Stack::Get_Record_Push ( void )
inlineprotected

Definition at line 950 of file api_core.h.

References CSG_Array::Get_Entry(), CSG_Array::Get_Size(), and CSG_Array::Inc_Array().

Referenced by CSG_Grid_Stack::Push().

◆ Get_RecordSize()

size_t CSG_Stack::Get_RecordSize ( void ) const
inline

Definition at line 934 of file api_core.h.

References CSG_Array::Get_Value_Size().

◆ Get_Size()

size_t CSG_Stack::Get_Size ( void ) const
inline

Definition at line 935 of file api_core.h.

References CSG_Array::Get_uSize().

The documentation for this class was generated from the following file:
  • api_core.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Stack Member List

This is the complete list of members for CSG_Stack, including all inherited members.

Clear(bool bFreeMemory=false) | CSG_Stack | inline
CSG_Stack(size_t RecordSize) | CSG_Stack | inline
Destroy(void) | CSG_Stack | inline
Get_Record(size_t i) const | CSG_Stack | inlineprotected
Get_Record_Pop(void) | CSG_Stack | inlineprotected
Get_Record_Push(void) | CSG_Stack | inlineprotected
Get_RecordSize(void) const | CSG_Stack | inline
Get_Size(void) const | CSG_Stack | inline
~CSG_Stack(void) | CSG_Stack | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_String Class Reference

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CSG_String Class Reference

#include <api_core.h>

Public Member Functions

CSG_String (void)
CSG_String (const CSG_String &String)
CSG_String (const char *String)
CSG_String (const wchar_t *String)
CSG_String (char Character, size_t nRepeat=1)
CSG_String (wchar_t Character, size_t nRepeat=1)
CSG_String (const class wxString *pString)
bool | Create (const class wxString *pString)
virtual | ~CSG_String (void)
CSG_String & | operator= (const CSG_String &String)
CSG_String & | operator= (const char *String)
CSG_String & | operator= (const wchar_t *String)
CSG_String & | operator= (char Character)
CSG_String & | operator= (wchar_t Character)
size_t | Length (void) const
bool | is_Empty (void) const
SG_Char | operator[] (int i) const
SG_Char | operator[] (size_t i) const
SG_Char | Get_Char (size_t i) const
void | Set_Char (size_t i, char Character)
void | Set_Char (size_t i, wchar_t Character)
const char * | b_str (void) const
const wchar_t * | w_str (void) const
const SG_Char * | c_str (void) const
operator const char * (void) const
operator const wchar_t * (void) const
CSG_String & | Prepend (const CSG_String &String)
CSG_String & | Append (const CSG_String &String)
CSG_String & | Append (const char *String)
CSG_String & | Append (const wchar_t *String)
CSG_String & | Append (char Character, size_t nRepeat=1)
CSG_String & | Append (wchar_t Character, size_t nRepeat=1)
void | operator+= (const CSG_String &String)
void | operator+= (const char *String)
void | operator+= (const wchar_t *String)
void | operator+= (char Character)
void | operator+= (wchar_t Character)
CSG_String | operator+ (const CSG_String &String) const
CSG_String | operator+ (const char *String) const
CSG_String | operator+ (const wchar_t *String) const
CSG_String | operator+ (char Character) const
CSG_String | operator+ (wchar_t Character) const
int | Cmp (const CSG_String &String) const
int | CmpNoCase (const CSG_String &String) const
bool | is_Same_As (const CSG_String &String, bool bCase=true) const
bool | is_Same_As (const char Character, bool bCase=true) const
bool | is_Same_As (const wchar_t Character, bool bCase=true) const
CSG_String & | Make_Lower (void)
CSG_String & | Make_Upper (void)
void | Clear (void)
int | Printf (const char *Format,...)
int | Printf (const wchar_t *Format,...)
size_t | Replace (const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
CSG_String & | Remove (size_t pos)
CSG_String & | Remove (size_t pos, size_t len)
int | Trim (bool fromRight=false)
int | Trim_Both (void)
int | Find (char Character, bool fromEnd=false) const
int | Find (wchar_t Character, bool fromEnd=false) const
int | Find (const CSG_String &String) const
bool | Contains (const CSG_String &String) const
CSG_String | AfterFirst (char Character) const
CSG_String | AfterFirst (wchar_t Character) const
CSG_String | AfterLast (char Character) const
CSG_String | AfterLast (wchar_t Character) const
CSG_String | BeforeFirst (char Character) const
CSG_String | BeforeFirst (wchar_t Character) const
CSG_String | BeforeLast (char Character) const
CSG_String | BeforeLast (wchar_t Character) const
CSG_String | Right (size_t count) const
CSG_String | Mid (size_t first, size_t count=0) const
CSG_String | Left (size_t count) const
bool | is_Number (void) const
int | asInt (void) const
bool | asInt (int &Value) const
sLong | asLongLong (void) const
bool | asLongLong (sLong &Value) const
double | asDouble (void) const
bool | asDouble (double &Value) const
size_t | to_UTF8 (char **pString) const
CSG_Buffer | to_UTF8 (void) const
size_t | to_MBChar (char **pString, int Encoding) const
CSG_Buffer | to_MBChar (int Encoding) const
bool | to_ASCII (char **pString, char Replace='_') const
CSG_Buffer | to_ASCII (char Replace='_') const
std::string | to_StdString (void) const
std::wstring | to_StdWstring (void) const

Static Public Member Functions

static CSG_String | Format (const char *Format,...)
static CSG_String | Format (const wchar_t *Format,...)
static CSG_String | from_UTF8 (const char *String, size_t Length=0)

Protected Attributes

class wxString * m_pString

Detailed Description

Definition at line 556 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_String() [1/7]

CSG_String::CSG_String ( void )

Definition at line 73 of file api_string.cpp.

References m_pString.

Referenced by AfterFirst(), AfterLast(), BeforeFirst(), BeforeLast(), Left(), Mid(), and Right().

◆ CSG_String() [2/7]

CSG_String::CSG_String ( const CSG_String & String )

Definition at line 78 of file api_string.cpp.

References m_pString.

◆ CSG_String() [3/7]

CSG_String::CSG_String ( const char * String )

Definition at line 83 of file api_string.cpp.

References m_pString.

◆ CSG_String() [4/7]

CSG_String::CSG_String ( const wchar_t * String )

Definition at line 88 of file api_string.cpp.

References m_pString.

◆ CSG_String() [5/7]

CSG_String::CSG_String | ( | char | Character,
 |  | size_t | nRepeat = 1
 | ) |  |

Definition at line 93 of file api_string.cpp.

References m_pString.

◆ CSG_String() [6/7]

CSG_String::CSG_String | ( | wchar_t | Character,
 |  | size_t | nRepeat = 1
 | ) |  |

Definition at line 98 of file api_string.cpp.

References m_pString.

◆ CSG_String() [7/7]

CSG_String::CSG_String ( const class wxString * pString )

Definition at line 104 of file api_string.cpp.

References m_pString.

◆ ~CSG_String()

CSG_String::~CSG_String ( void )
virtual

Definition at line 120 of file api_string.cpp.

References m_pString.

Member Function Documentation

◆ AfterFirst() [1/2]

CSG_String CSG_String::AfterFirst ( char Character ) const

Definition at line 644 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Parameter_Range::_Serialize(), CSG_Parameter_Color::_Serialize(), CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Range::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_MetaData::asText(), CSG_Tool_Chain::Create(), CSG_Shapes::Create(), CSG_Table::Create(), CSG_Grid_File_Info::Create(), CSG_MetaData::from_JSON(), CSG_Matrix::from_String(), CSG_Shapes_OGIS_Converter::from_WKText(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Tool::Get_MenuPath(), CSG_Projections::Get_Names_List(), CSG_Parameters::Get_Parameter(), CSG_Translator::Get_Translation(), CSG_MetaData::Load(), CSG_Table::Serialize(), CSG_Colors::Serialize(), SG_Compare_SAGA_Version(), SG_Compare_Version(), SG_Date_To_JulianDayNumber(), SG_Degree_To_Double(), SG_FTP_Download(), and CSG_Projections::WKT_from_Proj4().

◆ AfterFirst() [2/2]

CSG_String CSG_String::AfterFirst ( wchar_t Character ) const

Definition at line 649 of file api_string.cpp.

References CSG_String(), and m_pString.

◆ AfterLast() [1/2]

CSG_String CSG_String::AfterLast ( char Character ) const

Definition at line 655 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Colors::Serialize(), SG_Compare_SAGA_Version(), SG_Compare_Version(), and SG_FTP_Download().

◆ AfterLast() [2/2]

CSG_String CSG_String::AfterLast ( wchar_t Character ) const

Definition at line 660 of file api_string.cpp.

References CSG_String(), and m_pString.

◆ Append() [1/5]

CSG_String & CSG_String::Append | ( | char | Character,
 |  | size_t | nRepeat = 1
 | ) |  |

Definition at line 379 of file api_string.cpp.

References m_pString.

◆ Append() [2/5]

CSG_String & CSG_String::Append ( const char * String )

Definition at line 363 of file api_string.cpp.

References m_pString.

◆ Append() [3/5]

CSG_String & CSG_String::Append ( const CSG_String & String )

Definition at line 355 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameters::DataObjects_Check(), CSG_Formula::Get_Used_Variables(), and SG_Get_CurrentTimeStr().

◆ Append() [4/5]

CSG_String & CSG_String::Append ( const wchar_t * String )

Definition at line 371 of file api_string.cpp.

References m_pString.

◆ Append() [5/5]

CSG_String & CSG_String::Append | ( | wchar_t | Character,
 |  | size_t | nRepeat = 1
 | ) |  |

Definition at line 387 of file api_string.cpp.

References m_pString.

◆ asDouble() [1/2]

bool CSG_String::asDouble ( double & Value ) const

Definition at line 765 of file api_string.cpp.

References m_pString.

◆ asDouble() [2/2]

double CSG_String::asDouble ( void ) const

Definition at line 760 of file api_string.cpp.

Referenced by CSG_Parameter_Double::_Serialize(), CSG_Parameter_Range::_Serialize(), CSG_Parameter_Grid_System::_Serialize(), CSG_Parameter_Double::_Set_Value(), CSG_Parameter_Range::_Set_Value(), CSG_Table_DBase::asDouble(), CSG_Table_Value_String::asDouble(), CSG_Tool_Chain::Create(), CSG_Grid_File_Info::Create(), CSG_Vector::from_String(), CSG_Matrix::from_String(), CSG_MetaData::Get_Content(), CSG_Parameter_Choice::Get_Data(), CSG_MetaData::Get_Property(), CSG_File::Scan(), CSG_Table_Value_Double::Set_Value(), SG_Degree_To_Double(), and CSG_Projections::WKT_from_Proj4().

◆ asInt() [1/2]

bool CSG_String::asInt ( int & Value ) const

Definition at line 727 of file api_string.cpp.

References m_pString.

◆ asInt() [2/2]

int CSG_String::asInt ( void ) const

Definition at line 722 of file api_string.cpp.

Referenced by CSG_Parameter_Int::_Serialize(), CSG_Parameter_Choice::_Serialize(), CSG_Parameter_Color::_Serialize(), CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Bool::_Set_Value(), CSG_Parameter_Int::_Set_Value(), CSG_Parameter_Choice::_Set_Value(), CSG_Parameter_Choices::_Set_Value(), CSG_Parameter_Color::_Set_Value(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Table_DBase::asDouble(), CSG_Table_Value_String::asInt(), CSG_Table_Value_String::asLong(), CSG_Projection::Assign(), CSG_Tool_Chain::Create(), CSG_Grid_File_Info::Create(), CSG_Tool_Library::Create_Tool(), CSG_Colors::from_Text(), CSG_MetaData::Get_Content(), CSG_Parameter_Choice::Get_Data(), CSG_MetaData::Get_Property(), CSG_File::Scan(), CSG_Colors::Serialize(), CSG_Parameters::Serialize_Compatibility(), CSG_DateTime::Set(), CSG_Table_Value_Int::Set_Value(), CSG_Table_Value_Long::Set_Value(), SG_Compare_SAGA_Version(), and SG_Compare_Version().

◆ asLongLong() [1/2]

bool CSG_String::asLongLong ( sLong & Value ) const

Definition at line 749 of file api_string.cpp.

References m_pString.

◆ asLongLong() [2/2]

sLong CSG_String::asLongLong ( void ) const

Definition at line 744 of file api_string.cpp.

Referenced by CSG_MetaData::Get_Content(), and CSG_MetaData::Get_Property().

◆ b_str()

const char * CSG_String::b_str ( void ) const

Definition at line 242 of file api_string.cpp.

References m_pString.

Referenced by CSG_MetaData::from_XML(), CSG_Table_DBase::Open_Write(), CSG_Table_DBase::Set_Value(), and SG_Color_From_Text().

◆ BeforeFirst() [1/2]

CSG_String CSG_String::BeforeFirst ( char Character ) const

Definition at line 666 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Parameter_Range::_Serialize(), CSG_Parameter_List::_Serialize(), CSG_Parameter_Range::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Tool_Chain::Create(), CSG_Shapes::Create(), CSG_Table::Create(), CSG_MetaData::from_JSON(), CSG_Shapes_OGIS_Converter::from_WKText(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Projections::Get_Names_List(), CSG_Parameters::Get_Parameter(), CSG_Translator::Get_Translation(), CSG_MetaData::Load(), CSG_Table::Serialize(), SG_Degree_To_Double(), SG_FTP_Download(), and CSG_Projections::WKT_from_Proj4().

◆ BeforeFirst() [2/2]

CSG_String CSG_String::BeforeFirst ( wchar_t Character ) const

Definition at line 671 of file api_string.cpp.

References CSG_String(), and m_pString.

◆ BeforeLast() [1/2]

CSG_String CSG_String::BeforeLast ( char Character ) const

Definition at line 677 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Parameter_Table_Fields::_Set_Value(), and SG_FTP_Download().

◆ BeforeLast() [2/2]

CSG_String CSG_String::BeforeLast ( wchar_t Character ) const

Definition at line 682 of file api_string.cpp.

References CSG_String(), and m_pString.

◆ c_str()

const SG_Char * CSG_String::c_str ( void ) const

Definition at line 236 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Font::_asPointer(), CSG_Parameter_File_Name::_Assign(), CSG_Tool_Library_Manager::Add_Directory(), CSG_File_Zip::Add_Directory(), CSG_File_Zip::Add_File(), CSG_Tool_Library_Manager::Add_Library(), CSG_Tool_Library::Add_Reference(), CSG_Parameters::Add_Reference(), CSG_PointCloud::Assign(), CSG_Table_Value_Int::asString(), CSG_Table_Value_Long::asString(), CSG_Table_Value_Double::asString(), Cmp(), CmpNoCase(), CSG_Translator::Create(), CSG_Shapes::Create(), CSG_Tool_Chain::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_HTTP::Create(), CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Parameters::DataObjects_Check(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_TimeSpan::Format(), CSG_DateTime::Format(), CSG_MetaData::from_JSON(), CSG_Bytes::fromHexString(), CSG_MetaData::Get_Content(), CSG_Parameter::Get_Description(), CSG_Projection::Get_Description(), CSG_File_Zip::Get_File(), CSG_Data_Object::Get_File_Name(), CSG_Parameter_File_Name::Get_Filter(), CSG_Projections::Get_Names_List(), CSG_Tool::Get_Summary(), CSG_Tool_Library::Get_Summary(), CSG_Data_Manager::Get_Summary(), CSG_Grids::Load(), CSG_MetaData::Load(), CSG_MetaData::Load_HTTP(), Mid(), CSG_Parameters::Msg_String(), CSG_File::Open(), CSG_File_Zip::Open(), CSG_DateTime::Parse_Date(), CSG_DateTime::Parse_DateTime(), CSG_DateTime::Parse_Format(), CSG_DateTime::Parse_ISOCombined(), CSG_DateTime::Parse_ISODate(), CSG_DateTime::Parse_ISOTime(), CSG_Grid_File_Info::Save(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), CSG_String_Tokenizer::Set_String(), CSG_Projection::Set_UTM_WGS84(), SG_Dir_Create(), SG_Dir_Delete(), SG_Dir_Exists(), SG_Dir_List_Files(), SG_Dir_List_Subdirectories(), SG_File_Delete(), SG_File_Exists(), SG_File_Get_Extension(), SG_File_Get_Name(), SG_File_Get_Name_Temp(), SG_File_Get_Path(), SG_File_Get_Path_Absolute(), SG_File_Get_Path_Relative(), SG_File_Make_Path(), SG_File_Set_Extension(), SG_FTP_Download(), SG_Initialize_Environment(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Msg_Add_Error(), SG_XML_Add_Parameter(), and CSG_Projections::WKT_from_Proj4().

◆ Clear()

void CSG_String::Clear ( void )

Definition at line 259 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Choices::_Set_String(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Regression::asString(), CSG_Grid_File_Info::Create(), CSG_Data_Object::CSG_Data_Object(), CSG_Data_Object::Destroy(), CSG_Projection::Destroy(), CSG_Grid::Destroy(), CSG_Classifier_Supervised::Destroy(), CSG_Tool::Execute(), CSG_Formula::Get_Used_Variables(), CSG_File::Read(), CSG_HTTP::Request(), CSG_File::Scan(), CSG_Parameters::Serialize_Compatibility(), CSG_Data_Object::Set_File_Name(), CSG_Colors::to_Text(), and CSG_Projections::WKT_to_Proj4().

◆ Cmp()

int CSG_String::Cmp ( const CSG_String & String ) const

Definition at line 515 of file api_string.cpp.

References c_str(), and m_pString.

Referenced by CSG_Table_Record::_Get_Field(), CSG_Parameter_List::_Serialize(), CSG_Parameter_Choice::_Set_Value(), CSG_Parameter_String::_Set_Value(), CSG_Unique_String_Statistics::Add_Value(), CSG_MetaData::Cmp_Content(), CSG_Parameter::Cmp_Identifier(), CSG_Parameters::Cmp_Identifier(), CSG_MetaData::Cmp_Name(), CSG_MetaData::Cmp_Property(), CSG_Shapes::Create(), CSG_Tool_Chain::Create(), CSG_Table::Create(), CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Parameters::Del_Parameter(), CSG_Table::Find_Field(), CSG_Table::Find_Record(), CSG_Data_Collection::Get(), CSG_Classifier_Supervised::Get_Class(), CSG_Unique_String_Statistics::Get_Class_Index(), CSG_Table::Get_Field(), CSG_Tool_Library_Manager::Get_Library(), CSG_Projections::Get_Names_List(), CSG_Projections::Get_Projection(), CSG_Tool_Library_Manager::Get_Tool(), CSG_Tool_Library::Get_Tool(), CSG_Parameter::is_Default(), CSG_Projection::is_Equal(), CSG_Table_Value_String::is_Equal(), CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Parameters_Grid_Target::On_Parameter_Changed(), CSG_Parameters_Point_Search::On_Parameters_Enable(), CSG_Parameters_Grid_Target::On_Parameters_Enable(), CSG_Parameters::Serialize_Compatibility(), CSG_Parameters_Grid_Target::Set_User_Defined(), CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels(), CSG_Table_Value_String::Set_Value(), SG_Data_Type_Get_Type(), and SG_Parameter_Type_Get_Type().

◆ CmpNoCase()

int CSG_String::CmpNoCase ( const CSG_String & String ) const

Definition at line 521 of file api_string.cpp.

References c_str(), and m_pString.

Referenced by CSG_Parameter_Bool::_Set_Value(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Projection::Assign(), CSG_MetaData::Cmp_Content(), CSG_MetaData::Cmp_Name(), CSG_MetaData::Cmp_Property(), CSG_Tool_Chain::Create(), CSG_MetaData::Del_Property(), CSG_Parameters::Get_Parameter(), CSG_Projections::Get_Projection(), CSG_Projection::is_Equal(), SG_Get_Projection_Type(), SG_Get_Projection_Unit(), CSG_Projections::WKT_from_Proj4(), and CSG_Projections::WKT_to_Proj4().

◆ Contains()

bool CSG_String::Contains ( const CSG_String & String ) const

Definition at line 633 of file api_string.cpp.

References m_pString.

◆ Create()

bool CSG_String::Create ( const class wxString * pString )

Definition at line 109 of file api_string.cpp.

References m_pString.

◆ Find() [1/3]

int CSG_String::Find | ( | char | Character,
 |  | bool | fromEnd = false
 | ) |  | const

Definition at line 616 of file api_string.cpp.

References m_pString.

Referenced by CSG_Tool_Chain::Create(), CSG_Tool_Library_Interface::Create(), CSG_Grid_File_Info::Create(), CSG_MetaData::from_JSON(), CSG_Parameters::Get_Parameter(), CSG_MetaData::Load(), CSG_Colors::Load(), SG_FTP_Download(), and CSG_Projections::WKT_from_Proj4().

◆ Find() [2/3]

int CSG_String::Find ( const CSG_String & String ) const

Definition at line 627 of file api_string.cpp.

References m_pString.

◆ Find() [3/3]

int CSG_String::Find | ( | wchar_t | Character,
 |  | bool | fromEnd = false
 | ) |  | const

Definition at line 621 of file api_string.cpp.

References m_pString.

◆ Format() [1/2]

CSG_String CSG_String::Format | ( | const char * | Format,
 |  |  | ...
 | ) |  |
static

Definition at line 270 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Font::_Serialize(), CSG_Parameter_Colors::_Serialize(), CSG_Parameter_Choices::_Set_String(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_MetaData::Add_Child(), CSG_Parameter_Table_Field::Add_Default(), CSG_Parameter_Grid::Add_Default(), CSG_Table::Add_Field(), CSG_Tool_Library_Manager::Add_Library(), CSG_Distance_Weighting::Add_Parameters(), CSG_Grid_Cell_Addressor::Add_Parameters(), CSG_MetaData::Add_Property(), CSG_Parameters::Add_Reference(), CSG_Tool_Library::Add_Reference(), CSG_Regression::asString(), CSG_Parameters_Point_Search::Create(), CSG_Shapes::Create(), CSG_Tool_Chain::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_Tool_Library_Interface::Create(), CSG_Parameters_Grid_Target::Create(), CSG_TIN::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Parameters::DataObjects_Check(), CSG_Tool::Error_Set(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), Format(), CSG_MetaData::from_JSON(), CSG_Parameter::Get_Description(), CSG_Projection::Get_Description(), CSG_Formula::Get_Error(), CSG_Trend::Get_Formula(), CSG_Regression_Multiple::Get_Info(), CSG_Projections::Get_Names_List(), CSG_Parameters::Get_String(), CSG_Tool::Get_Summary(), CSG_Tool_Library_Manager::Get_Summary(), CSG_Tool_Library::Get_Summary(), CSG_Data_Manager::Get_Summary(), CSG_Tool_Library_Manager::Get_Tool(), CSG_KDTree::Get_Version(), CSG_MetaData::Ins_Child(), CSG_Grids::Load(), CSG_Parameters::Msg_String(), CSG_Grids::On_Delete(), CSG_Classifier_Supervised::Print(), Printf(), CSG_Grid_File_Info::Save(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), CSG_Regression_Multiple::Set_Data(), CSG_MetaData::Set_Property(), CSG_Table_DBase::Set_Value(), CSG_Table_Value_String::Set_Value(), SG_FTP_Download(), SG_Get_Double_asString(), SG_Get_String(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Msg_Add_Error(), SG_UI_Process_Get_Okay(), SG_UI_Process_Set_Progress(), SG_XML_Add_Parameter(), CSG_Matrix::to_String(), CSG_Colors::to_Text(), CSG_Bytes::toHexString(), CSG_Projections::WKT_from_Proj4(), and CSG_Projections::WKT_to_Proj4().

◆ Format() [2/2]

CSG_String CSG_String::Format | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |
static

Definition at line 289 of file api_string.cpp.

References Format(), and m_pString.

◆ from_UTF8()

CSG_String CSG_String::from_UTF8 | ( | const char * | String,
 |  | size_t | Length = 0
 | ) |  |
static

Definition at line 787 of file api_string.cpp.

References Length(), and m_pString.

Referenced by CSG_Table_DBase::asString().

◆ Get_Char()

SG_Char CSG_String::Get_Char ( size_t i ) const

Definition at line 209 of file api_string.cpp.

References Length(), m_pString, and SG_T.

Referenced by SG_Color_From_Text().

◆ is_Empty()

bool CSG_String::is_Empty ( void ) const

Definition at line 178 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Choice::_Set_Value(), CSG_Parameter_Font::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Table::Add_Field(), CSG_Parameter_Choice::Add_Item(), CSG_MetaData::Add_Property(), CSG_Parameters::Add_Reference(), CSG_Tool_Library::Add_Reference(), CSG_Projection::Assign(), CSG_Parameters_Point_Search::Create(), CSG_Tool_Chain::Create(), CSG_Grid_File_Info::Create(), CSG_TimeSpan::Format(), CSG_MetaData::from_JSON(), CSG_MetaData::Get_Content(), CSG_Parameter_Choice::Get_Data(), CSG_Parameter::Get_Description(), CSG_Data_Object::Get_Description(), CSG_Tool::Get_Description(), CSG_Grids::Get_Grid_Name(), CSG_Formula::Get_Help_Operators(), CSG_Tool::Get_MenuPath(), CSG_Parameters::Get_Parameter(), CSG_Projections::Get_Projection(), CSG_Tool::Get_Summary(), CSG_Tool_Library::Get_Summary(), CSG_Data_Manager::Get_Summary(), CSG_Trend::Get_Trend(), CSG_Projection::is_Equal(), CSG_Parameter_String::is_Valid(), CSG_File::Read_Line(), CSG_Classifier_Supervised::Save(), CSG_Colors::Serialize(), CSG_Parameter_Data_Type::Set_Data_Types(), CSG_Data_Object::Set_File_Name(), CSG_Data_Object::Set_Name(), SG_Color_From_Text(), SG_Dir_List_Files(), SG_File_Make_Path(), SG_FTP_Download(), and SG_XML_Add_Parameter().

◆ is_Number()

bool CSG_String::is_Number ( void ) const

Definition at line 716 of file api_string.cpp.

References m_pString.

◆ is_Same_As() [1/3]

bool CSG_String::is_Same_As | ( | const char | Character,
 |  | bool | bCase = true
 | ) |  | const

Definition at line 532 of file api_string.cpp.

References m_pString.

◆ is_Same_As() [2/3]

bool CSG_String::is_Same_As | ( | const CSG_String & | String,
 |  | bool | bCase = true
 | ) |  | const

Definition at line 527 of file api_string.cpp.

References m_pString.

◆ is_Same_As() [3/3]

bool CSG_String::is_Same_As | ( | const wchar_t | Character,
 |  | bool | bCase = true
 | ) |  | const

Definition at line 537 of file api_string.cpp.

References m_pString.

◆ Left()

CSG_String CSG_String::Left ( size_t count ) const

Definition at line 705 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Formula::Get_Error(), CSG_DateTime::Set(), and SG_Get_String().

◆ Length()

size_t CSG_String::Length ( void ) const

Definition at line 172 of file api_string.cpp.

References m_pString.

Referenced by CSG_Table_Record::_Get_Field(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Table_DBase::asDouble(), CSG_Tool_Chain::Create(), CSG_Tool_Library_Interface::Create(), CSG_Parameters::Del_Parameter(), CSG_Colors::from_Text(), from_UTF8(), CSG_MetaData::from_XML(), CSG_Bytes::fromHexString(), Get_Char(), CSG_Parameter::Get_Description(), CSG_Projection::Get_Description(), CSG_Formula::Get_Error(), CSG_Table::Get_Field_Length(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Tool::Get_MenuPath(), CSG_Tool::Get_Summary(), CSG_MetaData::Load(), Mid(), CSG_Table_DBase::Open_Write(), operator[](), CSG_Projection::Save(), CSG_DateTime::Set(), CSG_Formula::Set_Formula(), CSG_Trend::Set_Formula(), CSG_Table_DBase::Set_Value(), SG_Color_From_Text(), SG_Date_To_JulianDayNumber(), SG_File_Set_Extension(), SG_Flip_Decimal_Separators(), SG_FTP_Download(), and SG_Get_String().

◆ Make_Lower()

CSG_String & CSG_String::Make_Lower ( void )

Definition at line 543 of file api_string.cpp.

References m_pString.

Referenced by CSG_Translator::Create(), CSG_Tool_Chain::Create(), CSG_Projection::is_Equal(), and SG_XML_Add_Parameter().

◆ Make_Upper()

CSG_String & CSG_String::Make_Upper ( void )

Definition at line 551 of file api_string.cpp.

References m_pString.

◆ Mid()

CSG_String CSG_String::Mid | ( | size_t | first,
 |  | size_t | count = 0
 | ) |  | const

Definition at line 699 of file api_string.cpp.

References c_str(), CSG_String(), Length(), and m_pString.

Referenced by CSG_Table_DBase::asDouble(), CSG_Colors::from_Text(), and CSG_DateTime::Set().

◆ operator const char *()

CSG_String::operator const char * ( void ) const
inline

Definition at line 592 of file api_core.h.

◆ operator const wchar_t *()

CSG_String::operator const wchar_t * ( void ) const
inline

Definition at line 593 of file api_core.h.

◆ operator+() [1/5]

CSG_String CSG_String::operator+ ( char Character ) const

Definition at line 454 of file api_string.cpp.

◆ operator+() [2/5]

CSG_String CSG_String::operator+ ( const char * String ) const

Definition at line 435 of file api_string.cpp.

◆ operator+() [3/5]

CSG_String CSG_String::operator+ ( const CSG_String & String ) const

Definition at line 426 of file api_string.cpp.

◆ operator+() [4/5]

CSG_String CSG_String::operator+ ( const wchar_t * String ) const

Definition at line 444 of file api_string.cpp.

◆ operator+() [5/5]

CSG_String CSG_String::operator+ ( wchar_t Character ) const

Definition at line 463 of file api_string.cpp.

◆ operator+=() [1/5]

void CSG_String::operator+= ( char Character )

Definition at line 410 of file api_string.cpp.

References m_pString.

◆ operator+=() [2/5]

void CSG_String::operator+= ( const char * String )

Definition at line 400 of file api_string.cpp.

References m_pString.

◆ operator+=() [3/5]

void CSG_String::operator+= ( const CSG_String & String )

Definition at line 395 of file api_string.cpp.

References m_pString.

◆ operator+=() [4/5]

void CSG_String::operator+= ( const wchar_t * String )

Definition at line 405 of file api_string.cpp.

References m_pString.

◆ operator+=() [5/5]

void CSG_String::operator+= ( wchar_t Character )

Definition at line 415 of file api_string.cpp.

References m_pString.

◆ operator=() [1/5]

CSG_String & CSG_String::operator= ( char Character )

Definition at line 152 of file api_string.cpp.

References m_pString.

◆ operator=() [2/5]

CSG_String & CSG_String::operator= ( const char * String )

Definition at line 138 of file api_string.cpp.

References m_pString.

◆ operator=() [3/5]

CSG_String & CSG_String::operator= ( const CSG_String & String )

Definition at line 131 of file api_string.cpp.

References m_pString.

◆ operator=() [4/5]

CSG_String & CSG_String::operator= ( const wchar_t * String )

Definition at line 145 of file api_string.cpp.

References m_pString.

◆ operator=() [5/5]

CSG_String & CSG_String::operator= ( wchar_t Character )

Definition at line 159 of file api_string.cpp.

References m_pString.

◆ operator[]() [1/2]

SG_Char CSG_String::operator[] ( int i ) const

Definition at line 189 of file api_string.cpp.

References Length(), m_pString, and SG_T.

◆ operator[]() [2/2]

SG_Char CSG_String::operator[] ( size_t i ) const

Definition at line 199 of file api_string.cpp.

References Length(), m_pString, and SG_T.

◆ Prepend()

CSG_String & CSG_String::Prepend ( const CSG_String & String )

Definition at line 347 of file api_string.cpp.

References m_pString.

Referenced by CSG_Tool_Chain::Create(), and CSG_Data_Manager::Get_Summary().

◆ Printf() [1/2]

int CSG_String::Printf | ( | const char * | Format,
 |  |  | ...
 | ) |  |

Definition at line 308 of file api_string.cpp.

References Format(), and m_pString.

Referenced by CSG_Parameter_Int::_Set_String(), CSG_Parameter_Double::_Set_String(), CSG_Parameter_Range::_Set_String(), CSG_Parameter_Colors::_Set_String(), CSG_Parameter_Fixed_Table::_Set_String(), CSG_Parameter_List::_Set_String(), CSG_Parameter_Parameters::_Set_String(), CSG_Tool_Library::Add_Reference(), CSG_Table_Value_Int::asString(), CSG_Table_Value_Long::asString(), CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Interface::Create_Tool(), CSG_Parameter_File_Name::CSG_Parameter_File_Name(), CSG_Projections::EPSG_to_Proj4(), CSG_Trend::Get_Error(), CSG_Grids::Get_Grid_Name(), CSG_DateTime::Get_Month_Choices(), CSG_Grid_System::Get_Name(), CSG_Parameter::Set_Default(), CSG_Parameter_File_Name::Set_Filter(), CSG_Projection::Set_UTM_WGS84(), SG_Color_To_Text(), SG_Double_To_Degree(), SG_Get_String(), and SG_JulianDayNumber_To_Date().

◆ Printf() [2/2]

int CSG_String::Printf | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |

Definition at line 325 of file api_string.cpp.

References Format(), and m_pString.

◆ Remove() [1/2]

CSG_String & CSG_String::Remove ( size_t pos )

Definition at line 569 of file api_string.cpp.

References m_pString.

◆ Remove() [2/2]

CSG_String & CSG_String::Remove | ( | size_t | pos,
 |  | size_t | len
 | ) |  |

Definition at line 577 of file api_string.cpp.

References m_pString.

◆ Replace()

size_t CSG_String::Replace | ( | const CSG_String & | sOld,
 |  | const CSG_String & | sNew,
 |  | bool | bReplaceAll = true
 | ) |  |

Definition at line 563 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Table_Fields::_Set_Value(), CSG_Table_DBase::asDouble(), CSG_Tool_Chain::Create(), CSG_Formula::Get_Help_Operators(), CSG_Tool::Get_Summary(), CSG_Tool_Library::Get_Summary(), SG_Get_String(), and to_ASCII().

◆ Right()

CSG_String CSG_String::Right ( size_t count ) const

Definition at line 693 of file api_string.cpp.

References CSG_String(), and m_pString.

Referenced by CSG_Tool_Chain::Create(), CSG_Tool_Library_Interface::Create(), CSG_Formula::Get_Error(), CSG_MetaData::Load(), CSG_DateTime::Set(), and SG_FTP_Download().

◆ Set_Char() [1/2]

void CSG_String::Set_Char | ( | size_t | i,
 |  | char | Character
 | ) |  |

Definition at line 220 of file api_string.cpp.

References m_pString.

Referenced by SG_Flip_Decimal_Separators().

◆ Set_Char() [2/2]

void CSG_String::Set_Char | ( | size_t | i,
 |  | wchar_t | Character
 | ) |  |

Definition at line 225 of file api_string.cpp.

References m_pString.

◆ to_ASCII() [1/2]

bool CSG_String::to_ASCII | ( | char ** | pString,
 |  | char | Replace = '_'
 | ) |  | const

This function creates a single char array and fills it with the ASCII representation of this string object. If successful pString will point to the address of the allocated memory. Freeing memory is in response of the calling function.

Definition at line 909 of file api_string.cpp.

References CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), and SG_Malloc().

Referenced by CSG_Table_DBase::Set_Value(), SG_UI_Console_Print_StdErr(), SG_UI_Console_Print_StdOut(), and CSG_File::Write().

◆ to_ASCII() [2/2]

CSG_Buffer CSG_String::to_ASCII ( char Replace = '_' ) const

Definition at line 926 of file api_string.cpp.

References m_pString, Replace(), and CSG_Buffer::Set_Data().

◆ to_MBChar() [1/2]

size_t CSG_String::to_MBChar | ( | char ** | pString,
 |  | int | Encoding
 | ) |  | const

This function creates a single char array and fills it with the multibyte representation of this string object. If successful pString will point to the address of the allocated memory. Freeing memory is in response of the calling function.

Definition at line 855 of file api_string.cpp.

References CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), and SG_Malloc().

◆ to_MBChar() [2/2]

CSG_Buffer CSG_String::to_MBChar ( int Encoding ) const

Definition at line 872 of file api_string.cpp.

References m_pString, CSG_Buffer::Set_Data(), SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF16BE, SG_FILE_ENCODING_UTF16LE, SG_FILE_ENCODING_UTF32BE, SG_FILE_ENCODING_UTF32LE, SG_FILE_ENCODING_UTF7, and SG_FILE_ENCODING_UTF8.

◆ to_StdString()

std::string CSG_String::to_StdString ( void ) const

This function returns the string as an std::string in the current locale encoding. Note that if the conversion of the string contents to the current locale fails, the return string will be empty.

Definition at line 954 of file api_string.cpp.

References m_pString.

◆ to_StdWstring()

std::wstring CSG_String::to_StdWstring ( void ) const

This function returns the string as an std::wstring.

Definition at line 964 of file api_string.cpp.

References m_pString.

◆ to_UTF8() [1/2]

size_t CSG_String::to_UTF8 ( char ** pString ) const

This function creates a single char array and fills it with the UTF-8 representation of this string object. If successful pString will point to the address of the allocated memory. Freeing memory is in response of the calling function.

Definition at line 813 of file api_string.cpp.

References CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), SG_Malloc(), and to_UTF8().

Referenced by CSG_Table::Get_Field_Length(), CSG_Table_DBase::Set_Value(), SG_UI_Console_Print_StdErr(), and SG_UI_Console_Print_StdOut().

◆ to_UTF8() [2/2]

CSG_Buffer CSG_String::to_UTF8 ( void ) const

Definition at line 830 of file api_string.cpp.

References m_pString, and CSG_Buffer::Set_Data().

Referenced by to_UTF8().

◆ Trim()

int CSG_String::Trim ( bool fromRight = false )

Definition at line 590 of file api_string.cpp.

References m_pString.

Referenced by CSG_Parameter_Table_Fields::_Set_Value(), CSG_Table_DBase::asString(), CSG_Parameter_Choice::Set_Items(), and SG_FTP_Download().

◆ Trim_Both()

int CSG_String::Trim_Both ( void )

Definition at line 600 of file api_string.cpp.

References m_pString.

Referenced by CSG_Shapes_OGIS_Converter::from_WKText(), and CSG_Projection::is_Equal().

◆ w_str()

const wchar_t * CSG_String::w_str ( void ) const

Definition at line 248 of file api_string.cpp.

References m_pString.

Referenced by SG_Get_Environment(), SG_Set_Environment(), and CSG_File::Write().

Member Data Documentation

◆ m_pString

class wxString* CSG_String::m_pString
protected

Definition at line 681 of file api_core.h.

Referenced by AfterFirst(), AfterLast(), Append(), asDouble(), asInt(), asLongLong(), b_str(), BeforeFirst(), BeforeLast(), c_str(), Clear(), Cmp(), CmpNoCase(), Contains(), Create(), CSG_String(), Find(), Format(), from_UTF8(), Get_Char(), is_Empty(), is_Number(), is_Same_As(), Left(), Length(), Make_Lower(), Make_Upper(), Mid(), operator+=(), operator=(), operator[](), Prepend(), Printf(), Remove(), Replace(), Right(), Set_Char(), to_ASCII(), to_MBChar(), to_StdString(), to_StdWstring(), to_UTF8(), Trim(), Trim_Both(), w_str(), and ~CSG_String().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_string.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_String Member List

This is the complete list of members for CSG_String, including all inherited members.

AfterFirst(char Character) const | CSG_String |
AfterFirst(wchar_t Character) const | CSG_String |
AfterLast(char Character) const | CSG_String |
AfterLast(wchar_t Character) const | CSG_String |
Append(const CSG_String &String) | CSG_String |
Append(const char *String) | CSG_String |
Append(const wchar_t *String) | CSG_String |
Append(char Character, size_t nRepeat=1) | CSG_String |
Append(wchar_t Character, size_t nRepeat=1) | CSG_String |
asDouble(void) const | CSG_String |
asDouble(double &Value) const | CSG_String |
asInt(void) const | CSG_String |
asInt(int &Value) const | CSG_String |
asLongLong(void) const | CSG_String |
asLongLong(sLong &Value) const | CSG_String |
b_str(void) const | CSG_String |
BeforeFirst(char Character) const | CSG_String |
BeforeFirst(wchar_t Character) const | CSG_String |
BeforeLast(char Character) const | CSG_String |
BeforeLast(wchar_t Character) const | CSG_String |
c_str(void) const | CSG_String |
Clear(void) | CSG_String |
Cmp(const CSG_String &String) const | CSG_String |
CmpNoCase(const CSG_String &String) const | CSG_String |
Contains(const CSG_String &String) const | CSG_String |
Create(const class wxString *pString) | CSG_String |
CSG_String(void) | CSG_String |
CSG_String(const CSG_String &String) | CSG_String |
CSG_String(const char *String) | CSG_String |
CSG_String(const wchar_t *String) | CSG_String |
CSG_String(char Character, size_t nRepeat=1) | CSG_String |
CSG_String(wchar_t Character, size_t nRepeat=1) | CSG_String |
CSG_String(const class wxString *pString) | CSG_String |
Find(char Character, bool fromEnd=false) const | CSG_String |
Find(wchar_t Character, bool fromEnd=false) const | CSG_String |
Find(const CSG_String &String) const | CSG_String |
Format(const char *Format,...) | CSG_String | static
Format(const wchar_t *Format,...) | CSG_String | static
from_UTF8(const char *String, size_t Length=0) | CSG_String | static
Get_Char(size_t i) const | CSG_String |
is_Empty(void) const | CSG_String |
is_Number(void) const | CSG_String |
is_Same_As(const CSG_String &String, bool bCase=true) const | CSG_String |
is_Same_As(const char Character, bool bCase=true) const | CSG_String |
is_Same_As(const wchar_t Character, bool bCase=true) const | CSG_String |
Left(size_t count) const | CSG_String |
Length(void) const | CSG_String |
m_pString | CSG_String | protected
Make_Lower(void) | CSG_String |
Make_Upper(void) | CSG_String |
Mid(size_t first, size_t count=0) const | CSG_String |
operator const char *(void) const | CSG_String | inline
operator const wchar_t *(void) const | CSG_String | inline
operator+(const CSG_String &String) const | CSG_String |
operator+(const char *String) const | CSG_String |
operator+(const wchar_t *String) const | CSG_String |
operator+(char Character) const | CSG_String |
operator+(wchar_t Character) const | CSG_String |
operator+=(const CSG_String &String) | CSG_String |
operator+=(const char *String) | CSG_String |
operator+=(const wchar_t *String) | CSG_String |
operator+=(char Character) | CSG_String |
operator+=(wchar_t Character) | CSG_String |
operator=(const CSG_String &String) | CSG_String |
operator=(const char *String) | CSG_String |
operator=(const wchar_t *String) | CSG_String |
operator=(char Character) | CSG_String |
operator=(wchar_t Character) | CSG_String |
operator[](int i) const | CSG_String |
operator[](size_t i) const | CSG_String |
Prepend(const CSG_String &String) | CSG_String |
Printf(const char *Format,...) | CSG_String |
Printf(const wchar_t *Format,...) | CSG_String |
Remove(size_t pos) | CSG_String |
Remove(size_t pos, size_t len) | CSG_String |
Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true) | CSG_String |
Right(size_t count) const | CSG_String |
Set_Char(size_t i, char Character) | CSG_String |
Set_Char(size_t i, wchar_t Character) | CSG_String |
to_ASCII(char **pString, char Replace='_') const | CSG_String |
to_ASCII(char Replace='_') const | CSG_String |
to_MBChar(char **pString, int Encoding) const | CSG_String |
to_MBChar(int Encoding) const | CSG_String |
to_StdString(void) const | CSG_String |
to_StdWstring(void) const | CSG_String |
to_UTF8(char **pString) const | CSG_String |
to_UTF8(void) const | CSG_String |
Trim(bool fromRight=false) | CSG_String |
Trim_Both(void) | CSG_String |
w_str(void) const | CSG_String |
~CSG_String(void) | CSG_String | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_String_Tokenizer Class Reference

Public Member Functions | List of all members
CSG_String_Tokenizer Class Reference

#include <api_core.h>

Public Member Functions

CSG_String_Tokenizer (void)
CSG_String_Tokenizer (const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
~CSG_String_Tokenizer (void)
size_t | Get_Tokens_Count (void) const
SG_Char | Get_Last_Delimiter (void) const
CSG_String | Get_Next_Token (void)
size_t | Get_Position (void) const
CSG_String | Get_String (void) const
bool | Has_More_Tokens (void) const
void | Set_String (const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)

Detailed Description

Definition at line 753 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_String_Tokenizer() [1/2]

CSG_String_Tokenizer::CSG_String_Tokenizer ( void )

Definition at line 1410 of file api_string.cpp.

◆ CSG_String_Tokenizer() [2/2]

CSG_String_Tokenizer::CSG_String_Tokenizer | ( | const CSG_String & | String,
 |  | const CSG_String & | Delimiters = SG_DEFAULT_DELIMITERS,
 |  | TSG_String_Tokenizer_Mode | Mode = SG_TOKEN_DEFAULT
 | ) |  |

Definition at line 1416 of file api_string.cpp.

References Set_String().

◆ ~CSG_String_Tokenizer()

CSG_String_Tokenizer::~CSG_String_Tokenizer ( void )

Definition at line 1424 of file api_string.cpp.

Member Function Documentation

◆ Get_Last_Delimiter()

SG_Char CSG_String_Tokenizer::Get_Last_Delimiter ( void ) const

Definition at line 1436 of file api_string.cpp.

◆ Get_Next_Token()

CSG_String CSG_String_Tokenizer::Get_Next_Token ( void )

Definition at line 1442 of file api_string.cpp.

Referenced by CSG_Parameter_Choices::_Set_Value(), CSG_Vector::from_String(), CSG_Matrix::from_String(), CSG_Parameter_Choices::Set_Items(), SG_Date_To_JulianDayNumber(), and SG_String_Tokenize().

◆ Get_Position()

size_t CSG_String_Tokenizer::Get_Position ( void ) const

Definition at line 1450 of file api_string.cpp.

◆ Get_String()

CSG_String CSG_String_Tokenizer::Get_String ( void ) const

Definition at line 1456 of file api_string.cpp.

◆ Get_Tokens_Count()

size_t CSG_String_Tokenizer::Get_Tokens_Count ( void ) const

Definition at line 1430 of file api_string.cpp.

Referenced by SG_Date_To_JulianDayNumber().

◆ Has_More_Tokens()

bool CSG_String_Tokenizer::Has_More_Tokens ( void ) const

Definition at line 1464 of file api_string.cpp.

Referenced by CSG_Parameter_Choices::_Set_Value(), CSG_Vector::from_String(), CSG_Matrix::from_String(), CSG_Parameter_Choices::Set_Items(), and SG_String_Tokenize().

◆ Set_String()

void CSG_String_Tokenizer::Set_String | ( | const CSG_String & | String,
 |  | const CSG_String & | Delimiters = SG_DEFAULT_DELIMITERS,
 |  | TSG_String_Tokenizer_Mode | Mode = SG_TOKEN_DEFAULT
 | ) |  |

Definition at line 1470 of file api_string.cpp.

References CSG_String::c_str(), SG_TOKEN_INVALID, SG_TOKEN_RET_DELIMS, SG_TOKEN_RET_EMPTY, SG_TOKEN_RET_EMPTY_ALL, and SG_TOKEN_STRTOK.

Referenced by CSG_String_Tokenizer().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_string.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_String_Tokenizer Member List

This is the complete list of members for CSG_String_Tokenizer, including all inherited members.

CSG_String_Tokenizer(void) | CSG_String_Tokenizer
CSG_String_Tokenizer(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT) | CSG_String_Tokenizer
Get_Last_Delimiter(void) const | CSG_String_Tokenizer
Get_Next_Token(void) | CSG_String_Tokenizer
Get_Position(void) const | CSG_String_Tokenizer
Get_String(void) const | CSG_String_Tokenizer
Get_Tokens_Count(void) const | CSG_String_Tokenizer
Has_More_Tokens(void) const | CSG_String_Tokenizer
Set_String(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT) | CSG_String_Tokenizer
~CSG_String_Tokenizer(void) | CSG_String_Tokenizer
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Strings Class Reference

Public Member Functions | Protected Attributes | List of all members
CSG_Strings Class Reference

#include <api_core.h>

Public Member Functions

CSG_Strings (void)
CSG_Strings (const CSG_Strings &Strings)
CSG_Strings (int nStrings, const SG_Char **Strings)
virtual | ~CSG_Strings (void)
bool | Create (const CSG_Strings &Strings)
bool | Destroy (void)
bool | Set_Count (int Count)
bool | Set_Count (size_t Count)
int | Get_Count (void) const
size_t | Get_Size (void) const
bool | Add (const CSG_Strings &Strings)
bool | Add (const CSG_String &String)
bool | Ins (const CSG_String &String, int Index)
bool | Ins (const CSG_String &String, size_t Index)
bool | Del (int Index)
bool | Del (size_t Index)
CSG_String & | Get_String (int Index) const
CSG_String & | Get_String (size_t Index) const
CSG_String & | operator[] (int Index) const
CSG_String & | operator[] (size_t Index) const
CSG_Strings & | operator= (const CSG_Strings &Strings)
CSG_Strings & | operator+= (const CSG_Strings &Strings)
CSG_Strings & | operator+= (const CSG_String &String)
bool | Sort (bool Ascending=true)
void | Clear (void)
bool | Assign (const CSG_Strings &Strings)

Protected Attributes

CSG_Array_Pointer m_Strings

Detailed Description

Definition at line 692 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Strings() [1/3]

CSG_Strings::CSG_Strings ( void )

Definition at line 977 of file api_string.cpp.

◆ CSG_Strings() [2/3]

CSG_Strings::CSG_Strings ( const CSG_Strings & Strings )

Definition at line 981 of file api_string.cpp.

References Create().

◆ CSG_Strings() [3/3]

CSG_Strings::CSG_Strings | ( | int | nStrings,
 |  | const SG_Char ** | Strings
 | ) |  |

Definition at line 994 of file api_string.cpp.

References Add().

◆ ~CSG_Strings()

CSG_Strings::~CSG_Strings ( void )
virtual

Definition at line 1003 of file api_string.cpp.

References Clear().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Strings::Add ( const CSG_String & String )

Definition at line 1033 of file api_string.cpp.

References Get_Size(), CSG_Array_Pointer::Inc_Array(), and m_Strings.

◆ Add() [2/2]

bool CSG_Strings::Add ( const CSG_Strings & Strings )

Definition at line 1022 of file api_string.cpp.

References Get_Size().

Referenced by CSG_Parameter_Choice::Add_Item(), CSG_MetaData::Add_Property(), CSG_Unique_String_Statistics::Add_Value(), Create(), CSG_Strings(), CSG_Parameter_File_Name::Get_FilePaths(), Ins(), Set_Count(), and CSG_MetaData::Set_Property().

◆ Assign()

bool CSG_Strings::Assign ( const CSG_Strings & Strings )
inline

Definition at line 729 of file api_core.h.

◆ Clear()

void CSG_Strings::Clear ( void )
inline

Definition at line 728 of file api_core.h.

Referenced by CSG_Unique_String_Statistics::Create(), CSG_Parameter_Choice::Del_Items(), CSG_Parameter_Choices::Del_Items(), CSG_Parameters::Del_References(), CSG_Tool_Library::Del_References(), CSG_Regression_Multiple::Destroy(), CSG_MetaData::Destroy(), CSG_Parameters::Destroy(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Parameter_Choice::Set_Items(), SG_Dir_List_Files(), SG_Dir_List_Subdirectories(), and ~CSG_Strings().

◆ Create()

bool CSG_Strings::Create ( const CSG_Strings & Strings )

Definition at line 986 of file api_string.cpp.

References Add(), and Destroy().

Referenced by CSG_Strings().

◆ Del() [1/2]

bool CSG_Strings::Del ( int Index )
inline

Definition at line 713 of file api_core.h.

References Del().

Referenced by Del(), CSG_MetaData::Del_Property(), and Set_Count().

◆ Del() [2/2]

bool CSG_Strings::Del ( size_t Index )

Definition at line 1071 of file api_string.cpp.

References CSG_Array_Pointer::Dec_Array(), Get_Size(), and m_Strings.

◆ Destroy()

bool CSG_Strings::Destroy ( void )

Definition at line 1009 of file api_string.cpp.

References CSG_Array_Pointer::Destroy(), Get_Size(), and m_Strings.

Referenced by Create().

◆ Get_Count()

int CSG_Strings::Get_Count ( void ) const
inline

Definition at line 706 of file api_core.h.

Referenced by CSG_Parameter_Choice::_Set_Value(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Parameter_File_Name::Get_FilePaths(), CSG_Parameter_Choices::Get_Items(), CSG_Tool::Get_Summary(), CSG_Tool_Library::Get_Summary(), CSG_Projection::is_Equal(), CSG_Regression_Multiple::Set_Data(), CSG_Parameter_Choices::Set_Items(), CSG_Parameter_Choice::Set_Items(), SG_Dir_List_Files(), SG_Dir_List_Subdirectories(), SG_Initialize_Environment(), and Sort().

◆ Get_Size()

size_t CSG_Strings::Get_Size ( void ) const
inline

Definition at line 707 of file api_core.h.

Referenced by Add(), Del(), Destroy(), Ins(), Set_Count(), and Sort().

◆ Get_String() [1/2]

CSG_String& CSG_Strings::Get_String ( int Index ) const
inline

Definition at line 716 of file api_core.h.

Referenced by CSG_Regression_Multiple::Set_Data().

◆ Get_String() [2/2]

CSG_String& CSG_Strings::Get_String ( size_t Index ) const
inline

Definition at line 717 of file api_core.h.

◆ Ins() [1/2]

bool CSG_Strings::Ins | ( | const CSG_String & | String,
 |  | int | Index
 | ) |  |
inline

Definition at line 711 of file api_core.h.

References Ins().

Referenced by Ins().

◆ Ins() [2/2]

bool CSG_Strings::Ins | ( | const CSG_String & | String,
 |  | size_t | Index
 | ) |  |

Definition at line 1048 of file api_string.cpp.

References Add(), Get_Size(), CSG_Array_Pointer::Inc_Array(), and m_Strings.

◆ operator+=() [1/2]

CSG_Strings& CSG_Strings::operator+= ( const CSG_String & String )
inline

Definition at line 724 of file api_core.h.

◆ operator+=() [2/2]

CSG_Strings& CSG_Strings::operator+= ( const CSG_Strings & Strings )
inline

Definition at line 723 of file api_core.h.

◆ operator=()

CSG_Strings& CSG_Strings::operator= ( const CSG_Strings & Strings )
inline

Definition at line 722 of file api_core.h.

◆ operator[]() [1/2]

CSG_String& CSG_Strings::operator[] ( int Index ) const
inline

Definition at line 719 of file api_core.h.

◆ operator[]() [2/2]

CSG_String& CSG_Strings::operator[] ( size_t Index ) const
inline

Definition at line 720 of file api_core.h.

◆ Set_Count() [1/2]

bool CSG_Strings::Set_Count ( int Count )
inline

Definition at line 704 of file api_core.h.

References Set_Count().

Referenced by CSG_Tool_Library_Interface::Create(), and Set_Count().

◆ Set_Count() [2/2]

bool CSG_Strings::Set_Count ( size_t Count )

Definition at line 1091 of file api_string.cpp.

References Add(), Del(), and Get_Size().

◆ Sort()

bool CSG_Strings::Sort ( bool Ascending = true )

Definition at line 1121 of file api_string.cpp.

References CSG_Array_Pointer::Get_Array(), Get_Count(), Get_Size(), and m_Strings.

Referenced by CSG_Parameters::Add_Reference(), and CSG_Tool_Library::Add_Reference().

Member Data Documentation

◆ m_Strings

CSG_Array_Pointer CSG_Strings::m_Strings
protected

Definition at line 734 of file api_core.h.

Referenced by Add(), Del(), Destroy(), Ins(), and Sort().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_string.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Strings Member List

This is the complete list of members for CSG_Strings, including all inherited members.

Add(const CSG_Strings &Strings) | CSG_Strings |
Add(const CSG_String &String) | CSG_Strings |
Assign(const CSG_Strings &Strings) | CSG_Strings | inline
Clear(void) | CSG_Strings | inline
Create(const CSG_Strings &Strings) | CSG_Strings |
CSG_Strings(void) | CSG_Strings |
CSG_Strings(const CSG_Strings &Strings) | CSG_Strings |
CSG_Strings(int nStrings, const SG_Char **Strings) | CSG_Strings |
Del(int Index) | CSG_Strings | inline
Del(size_t Index) | CSG_Strings |
Destroy(void) | CSG_Strings |
Get_Count(void) const | CSG_Strings | inline
Get_Size(void) const | CSG_Strings | inline
Get_String(int Index) const | CSG_Strings | inline
Get_String(size_t Index) const | CSG_Strings | inline
Ins(const CSG_String &String, int Index) | CSG_Strings | inline
Ins(const CSG_String &String, size_t Index) | CSG_Strings |
m_Strings | CSG_Strings | protected
operator+=(const CSG_Strings &Strings) | CSG_Strings | inline
operator+=(const CSG_String &String) | CSG_Strings | inline
operator=(const CSG_Strings &Strings) | CSG_Strings | inline
operator[](int Index) const | CSG_Strings | inline
operator[](size_t Index) const | CSG_Strings | inline
Set_Count(int Count) | CSG_Strings | inline
Set_Count(size_t Count) | CSG_Strings |
Sort(bool Ascending=true) | CSG_Strings |
~CSG_Strings(void) | CSG_Strings | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Table Class Reference

#include <table.h>

Inheritance diagram for CSG_Table:
CSG_Data_Object CSG_Shapes CSG_TIN CSG_PointCloud

Public Member Functions

CSG_Table (void)
CSG_Table (const CSG_Table &Table)
bool | Create (const CSG_Table &Table)
CSG_Table (const CSG_Table *pTemplate)
bool | Create (const CSG_Table *pTemplate)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual | ~CSG_Table (void)
virtual bool | Destroy (void)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking. More...
CSG_Table & | operator= (const CSG_Table &Table)
virtual bool | Assign (CSG_Data_Object *pTable)
bool | Assign_Values (const CSG_Table &Table)
bool | Assign_Values (CSG_Table *pTable)
bool | Assign_Values (const SG_Char *File)
bool | Load (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const CSG_String &File, int Format=0)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
bool | Set_File_Encoding (int Encoding)
int | Get_File_Encoding (void) const
bool | Serialize (CSG_File &Stream, bool bSave)
virtual bool | is_Valid (void) const
bool | is_Compatible (const CSG_Table &Table, bool bExactMatch=false) const
bool | is_Compatible (CSG_Table *pTable, bool bExactMatch=false) const
virtual const CSG_Rect & | Get_Extent (void)
virtual bool | Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const char *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const wchar_t *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Del_Field (int iField)
virtual bool | Mov_Field (int iField, int Position)
int | Get_Field_Count (void) const
const SG_Char * | Get_Field_Name (int iField) const
TSG_Data_Type | Get_Field_Type (int iField) const
int | Get_Field_Length (int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
int | Get_Field (const CSG_String &Name) const
bool | Set_Field_Name (int iField, const SG_Char *Name)
virtual bool | Set_Field_Type (int iField, TSG_Data_Type Type)
int | Find_Field (const CSG_String &Name) const
bool | Find_Field (const CSG_String &Name, int &Index) const
sLong | Get_N (int iField) const
double | Get_Minimum (int iField) const
double | Get_Maximum (int iField) const
double | Get_Range (int iField) const
double | Get_Sum (int iField) const
double | Get_Mean (int iField) const
double | Get_StdDev (int iField) const
double | Get_Variance (int iField) const
const CSG_Simple_Statistics & | Get_Statistics (int iField) const
virtual CSG_Table_Record * | Add_Record (CSG_Table_Record *pCopy=NULL)
virtual CSG_Table_Record * | Ins_Record (sLong Index, CSG_Table_Record *pCopy=NULL)
virtual bool | Set_Record (sLong Index, CSG_Table_Record *pCopy)
virtual bool | Del_Record (sLong Index)
virtual bool | Del_Records (void)
virtual bool | Set_Count (sLong nRecords)
sLong | Get_Count (void) const
virtual CSG_Table_Record * | Get_Record (sLong Index) const
virtual CSG_Table_Record & | operator[] (sLong Index) const
sLong | Get_Index (sLong Index) const
CSG_Table_Record * | Get_Record_byIndex (sLong Index) const
virtual bool | Find_Record (sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual bool | Find_Record (sLong &Index, int iField, double Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, double Value, bool bCreateIndex=false)
virtual bool | Set_Value (sLong Index, int iField, const SG_Char *Value)
virtual bool | Set_Value (sLong Index, int iField, double Value)
virtual bool | Get_Value (sLong Index, int iField, CSG_String &Value) const
virtual bool | Get_Value (sLong Index, int iField, double &Value) const
virtual void | Set_Modified (bool bModified=true)
sLong | Get_Selection_Count (void) const
sLong | Get_Selection_Index (sLong Index=0) const
virtual CSG_Table_Record * | Get_Selection (sLong Index=0) const
virtual bool | is_Selected (sLong Index) const
virtual bool | Select (sLong Index, bool bInvert=false)
virtual bool | Select (CSG_Table_Record *pRecord=NULL, bool bInvert=false)
virtual sLong | Del_Selection (void)
virtual sLong | Inv_Selection (void)
bool | Set_Index (CSG_Index &Index, int Field, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const
bool | is_Indexed (void) const
bool | Set_Index (int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None)
bool | Del_Index (void)
bool | Toggle_Index (int iField)
int | Get_Index_Field (int i) const
TSG_Table_Index_Order | Get_Index_Order (int i) const
int | Get_Index_Field (size_t i) const
TSG_Table_Index_Order | Get_Index_Order (size_t i) const
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Protected Member Functions

virtual void | _On_Construction (void)
virtual CSG_Table_Record * | _Get_New_Record (sLong Index)
bool | _Add_Selection (sLong Index)
bool | _Set_Selection (sLong Index, sLong Selected)
bool | _Del_Selection (sLong Index)
bool | _Stats_Invalidate (void) const
bool | _Stats_Invalidate (int iField) const
virtual bool | _Stats_Update (int iField) const
virtual bool | On_NoData_Changed (void)
virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)

Protected Attributes

int | m_nFields
int | m_Encoding
sLong m_nRecords
sLong m_nBuffer
TSG_Data_Type * m_Field_Type
CSG_String ** m_Field_Name
CSG_Simple_Statistics ** m_Field_Stats
CSG_Array m_Selection
CSG_Rect m_Extent
- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Friends

class | CSG_Table_Record
class | CSG_TIN

Detailed Description

Definition at line 282 of file table.h.

Constructor & Destructor Documentation

◆ CSG_Table() [1/9]

CSG_Table::CSG_Table ( void )

Definition at line 133 of file table.cpp.

References _On_Construction().

◆ CSG_Table() [2/9]

CSG_Table::CSG_Table ( const CSG_Table & Table )

Definition at line 140 of file table.cpp.

References _On_Construction(), and Create().

◆ CSG_Table() [3/9]

CSG_Table::CSG_Table ( const CSG_Table * pTemplate )

Definition at line 262 of file table.cpp.

References _On_Construction(), and Create().

◆ CSG_Table() [4/9]

CSG_Table::CSG_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 154 of file table.cpp.

References _On_Construction(), and Create().

◆ CSG_Table() [5/9]

CSG_Table::CSG_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 152 of file table.cpp.

◆ CSG_Table() [6/9]

CSG_Table::CSG_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 153 of file table.cpp.

◆ CSG_Table() [7/9]

CSG_Table::CSG_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 248 of file table.cpp.

References _On_Construction(), and Create().

◆ CSG_Table() [8/9]

CSG_Table::CSG_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 246 of file table.cpp.

◆ CSG_Table() [9/9]

CSG_Table::CSG_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 247 of file table.cpp.

◆ ~CSG_Table()

CSG_Table::~CSG_Table ( void )
virtual

Definition at line 321 of file table.cpp.

References Destroy().

Member Function Documentation

◆ _Add_Selection()

bool CSG_Table::_Add_Selection ( sLong Index )
protected

Definition at line 63 of file table_selection.cpp.

References _Set_Selection(), CSG_Array::Get_Size(), CSG_Array::Inc_Array(), and m_Selection.

Referenced by CSG_PointCloud::Select(), and Select().

◆ _Del_Selection()

bool CSG_Table::_Del_Selection ( sLong Index )
protected

Definition at line 87 of file table_selection.cpp.

References CSG_Array::Dec_Array(), CSG_Array::Get_Array(), Get_Selection_Index(), CSG_Array::Get_Size(), and m_Selection.

Referenced by Del_Record(), CSG_PointCloud::Select(), and Select().

◆ _Get_New_Record()

CSG_Table_Record * CSG_Table::_Get_New_Record ( sLong Index )
protectedvirtual

Reimplemented in CSG_TIN, and CSG_Shapes.

Definition at line 793 of file table.cpp.

References CSG_Table_Record.

Referenced by Ins_Record().

◆ _On_Construction()

void CSG_Table::_On_Construction ( void )
protectedvirtual

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 297 of file table.cpp.

References CSG_Array::Create(), m_Encoding, m_Field_Name, m_Field_Stats, m_Field_Type, m_nBuffer, m_nFields, m_nRecords, m_Selection, CSG_Data_Object::Set_Update_Flag(), and SG_FILE_ENCODING_UTF8.

Referenced by CSG_Shapes::_On_Construction(), CSG_TIN::_On_Construction(), CSG_Grid::CSG_Grid(), and CSG_Table().

◆ _Set_Selection()

bool CSG_Table::_Set_Selection | ( | sLong | Index,
 |  | sLong | Selected
 | ) |  |
protected

Definition at line 74 of file table_selection.cpp.

References CSG_Array::Get_Entry(), CSG_Array::Get_Size(), and m_Selection.

Referenced by _Add_Selection(), and CSG_PointCloud::Inv_Selection().

◆ _Stats_Invalidate() [1/2]

bool CSG_Table::_Stats_Invalidate ( int iField ) const
protected

Definition at line 1215 of file table.cpp.

References CSG_Simple_Statistics::Invalidate(), m_Field_Stats, and m_nFields.

◆ _Stats_Invalidate() [2/2]

bool CSG_Table::_Stats_Invalidate ( void ) const
protected

Definition at line 1204 of file table.cpp.

References CSG_Simple_Statistics::Invalidate(), m_Field_Stats, and m_nFields.

Referenced by CSG_PointCloud::Add_Point(), CSG_PointCloud::Del_Point(), CSG_PointCloud::Del_Points(), Del_Record(), CSG_PointCloud::Del_Selection(), Ins_Record(), On_NoData_Changed(), On_Update(), CSG_Table_Record::Set_NoData(), and CSG_Table_Record::Set_Value().

◆ _Stats_Update()

bool CSG_Table::_Stats_Update ( int iField ) const
protectedvirtual

Reimplemented in CSG_PointCloud.

Definition at line 1228 of file table.cpp.

References CSG_Table_Record::asDouble(), CSG_Simple_Statistics::Evaluate(), CSG_Simple_Statistics::Get_Count(), Get_Count(), CSG_Data_Object::Get_Max_Samples(), CSG_Simple_Statistics::is_Evaluated(), CSG_Table_Record::is_NoData(), m_Field_Stats, m_nFields, and CSG_Simple_Statistics::Set_Count().

Referenced by Get_Maximum(), Get_Mean(), Get_Minimum(), Get_N(), Get_Range(), Get_Statistics(), Get_StdDev(), Get_Sum(), and Get_Variance().

◆ Add_Field() [1/3]

virtual bool CSG_Table::Add_Field | ( | const char * | Name,
 |  | TSG_Data_Type | Type,
 |  | int | Position = -1
 | ) |  |
inlinevirtual

Definition at line 350 of file table.h.

References Add_Field().

Referenced by Add_Field().

◆ Add_Field() [2/3]

bool CSG_Table::Add_Field | ( | const CSG_String & | Name,
 |  | TSG_Data_Type | Type,
 |  | int | Position = -1
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 487 of file table.cpp.

References CSG_Table_Record::_Add_Field(), CSG_String::Format(), CSG_String::is_Empty(), m_Field_Name, m_Field_Stats, m_Field_Type, m_nFields, m_nRecords, Set_Modified(), and SG_Realloc().

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Grids::Add_Attribute(), Create(), CSG_Category_Statistics::Create(), CSG_Grid_Cell_Addressor::CSG_Grid_Cell_Addressor(), CSG_Regression_Multiple::CSG_Regression_Multiple(), CSG_Grids::Destroy(), CSG_Tool_Library_Manager::Get_Summary(), CSG_MetaData::Get_Table(), Mov_Field(), CSG_Table_DBase::Open_Read(), and Serialize().

◆ Add_Field() [3/3]

virtual bool CSG_Table::Add_Field | ( | const wchar_t * | Name,
 |  | TSG_Data_Type | Type,
 |  | int | Position = -1
 | ) |  |
inlinevirtual

Definition at line 351 of file table.h.

References Add_Field().

Referenced by Add_Field().

◆ Add_Record()

CSG_Table_Record * CSG_Table::Add_Record ( CSG_Table_Record * pCopy = NULL )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 799 of file table.cpp.

References Ins_Record(), and m_nRecords.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Regression_Multiple::_Set_Step_Info(), CSG_Projections::Add(), CSG_Grids::Add_Grid(), CSG_TIN::Add_Node(), CSG_Shapes::Add_Shape(), CSG_Category_Statistics::Add_Value(), Assign(), CSG_Regression_Multiple::CSG_Regression_Multiple(), CSG_Tool_Library_Manager::Get_Summary(), CSG_MetaData::Get_Table(), CSG_Projections::Load_DB(), CSG_Table_DBase::Open_Read(), Serialize(), and Set_Count().

◆ Assign()

bool CSG_Table::Assign ( CSG_Data_Object * pTable )
virtual

Reimplemented from CSG_Data_Object.

Reimplemented in CSG_PointCloud, CSG_TIN, and CSG_Shapes.

Definition at line 372 of file table.cpp.

References Add_Record(), Create(), Get_Count(), CSG_Data_Object::Get_MetaData(), CSG_Data_Object::Get_ObjectType(), Get_Record(), CSG_Data_Object::is_Valid(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_DATAOBJECT_TYPE_Table.

Referenced by CSG_Regression_Multiple::_Set_Step_Info(), Create(), Set_Record(), and CSG_Grids::Update_Z_Order().

◆ Assign_Values() [1/3]

bool CSG_Table::Assign_Values ( const CSG_Table & Table )

Definition at line 401 of file table.cpp.

References CSG_Table_Record::Assign(), Get_Count(), Get_Record(), is_Compatible(), and Set_Count().

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameters::Add_FixedTable(), Assign_Values(), and CSG_Parameters::Serialize_Compatibility().

◆ Assign_Values() [2/3]

bool CSG_Table::Assign_Values ( const SG_Char * File )

Definition at line 423 of file table.cpp.

References Assign_Values(), and Create().

◆ Assign_Values() [3/3]

bool CSG_Table::Assign_Values ( CSG_Table * pTable )

Definition at line 417 of file table.cpp.

References Assign_Values().

◆ Create() [1/8]

bool CSG_Table::Create | ( | const char * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 254 of file table.cpp.

References Create().

◆ Create() [2/8]

bool CSG_Table::Create | ( | const char * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 160 of file table.cpp.

References Create().

◆ Create() [3/8]

bool CSG_Table::Create | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 256 of file table.cpp.

References Load().

◆ Create() [4/8]

bool CSG_Table::Create | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 162 of file table.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::BeforeFirst(), CSG_String::c_str(), CSG_String::Cmp(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Delete_Tool(), Destroy(), CSG_Tool::Execute(), CSG_String::Format(), Get_Count(), Load(), CSG_Tool::On_Before_Execution(), CSG_Data_Object::Set_File_Name(), CSG_Tool::Set_Manager(), Set_Modified(), CSG_Data_Object::Set_Update_Flag(), SG_File_Exists(), SG_Get_Tool_Library_Manager(), SG_TOOL_PARAMETER_SET, SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, and SG_UI_ProgressAndMsg_Lock().

◆ Create() [5/8]

bool CSG_Table::Create ( const CSG_Table & Table )

Definition at line 146 of file table.cpp.

References Assign().

Referenced by CSG_Parameter_Fixed_Table::_Assign(), CSG_Parameters::Add_FixedTable(), CSG_TIN::Assign(), Assign(), Assign_Values(), Create(), CSG_Grids::Create(), CSG_Translator::Create(), CSG_TIN::Create(), CSG_Shapes::Create(), CSG_Table(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), On_Reload(), and operator=().

◆ Create() [6/8]

bool CSG_Table::Create ( const CSG_Table * pTemplate )

Definition at line 268 of file table.cpp.

References Add_Field(), Destroy(), CSG_Data_Object::Get_Description(), Get_Field_Count(), Get_Field_Name(), Get_Field_Type(), CSG_Data_Object::Get_Name(), CSG_Data_Object::Get_NoData_Value(), m_Encoding, CSG_Data_Object::Set_Description(), CSG_Data_Object::Set_Name(), and CSG_Data_Object::Set_NoData_Value_Range().

◆ Create() [7/8]

bool CSG_Table::Create | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 255 of file table.cpp.

References Create().

◆ Create() [8/8]

bool CSG_Table::Create | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 161 of file table.cpp.

References Create().

◆ Del_Field()

bool CSG_Table::Del_Field ( int iField )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 526 of file table.cpp.

References CSG_Table_Record::_Del_Field(), m_Field_Name, m_Field_Stats, m_Field_Type, m_nFields, m_nRecords, Set_Modified(), and SG_Realloc().

Referenced by CSG_Grids::Del_Attribute(), CSG_PointCloud::Del_Field(), and Mov_Field().

◆ Del_Index()

bool CSG_Table::Del_Index ( void )

Definition at line 1341 of file table.cpp.

References CSG_Array_Int::Destroy(), and CSG_Index::Destroy().

Referenced by Del_Records(), Set_Index(), and Toggle_Index().

◆ Del_Record()

bool CSG_Table::Del_Record ( sLong Index )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 873 of file table.cpp.

References _Del_Selection(), _Stats_Invalidate(), CSG_Index::Del_Entry(), CSG_Index::is_Okay(), is_Selected(), CSG_Table_Record::m_Index, m_nRecords, Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by CSG_Grids::Del_Grid(), CSG_TIN::Del_Node(), Del_Selection(), CSG_Shapes::Del_Shape(), and Set_Count().

◆ Del_Records()

bool CSG_Table::Del_Records ( void )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 912 of file table.cpp.

References Del_Index(), m_nBuffer, m_nRecords, and SG_FREE_SAFE.

Referenced by CSG_TIN::_Destroy_Nodes(), CSG_Grids::Del_Grids(), CSG_Shapes::Del_Shapes(), CSG_Projections::Destroy(), CSG_Grid_Cell_Addressor::Destroy(), CSG_Category_Statistics::Destroy(), CSG_Regression_Multiple::Destroy(), Destroy(), and CSG_Projections::Load_DB().

◆ Del_Selection()

sLong CSG_Table::Del_Selection ( void )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 178 of file table_selection.cpp.

References Del_Record(), Get_Selection_Count(), is_Selected(), m_nRecords, m_Selection, CSG_Array::Set_Array(), and CSG_Table_Record::Set_Selected().

◆ Destroy()

bool CSG_Table::Destroy ( void )
virtual

Reimplemented from CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 327 of file table.cpp.

References Del_Records(), CSG_Data_Object::Destroy(), m_Field_Name, m_Field_Stats, m_Field_Type, m_nFields, and SG_Free().

Referenced by Create(), CSG_Category_Statistics::Create(), CSG_Grids::Destroy(), CSG_Shapes::Destroy(), CSG_TIN::Destroy(), Load(), CSG_Table_DBase::Open_Read(), Serialize(), and ~CSG_Table().

◆ Find_Field() [1/2]

int CSG_Table::Find_Field ( const CSG_String & Name ) const

Returns the index of the field with the requested name or -1 if it does not exists.

Definition at line 717 of file table.cpp.

References CSG_String::Cmp(), Get_Field_Count(), and Get_Field_Name().

Referenced by Find_Field().

◆ Find_Field() [2/2]

bool CSG_Table::Find_Field | ( | const CSG_String & | Name,
 |  | int & | Index
 | ) |  | const

Returns true if a field with the requested name exists and sets the Index parameter to its position.

Definition at line 735 of file table.cpp.

References Find_Field().

◆ Find_Record() [1/4]

CSG_Table_Record * CSG_Table::Find_Record | ( | int | iField,
 |  | const CSG_String & | Value,
 |  | bool | bCreateIndex = false
 | ) |  |
virtual

Definition at line 1017 of file table.cpp.

References Find_Record(), and Get_Record().

◆ Find_Record() [2/4]

CSG_Table_Record * CSG_Table::Find_Record | ( | int | iField,
 |  | double | Value,
 |  | bool | bCreateIndex = false
 | ) |  |
virtual

Definition at line 1097 of file table.cpp.

References Find_Record(), and Get_Record().

◆ Find_Record() [3/4]

bool CSG_Table::Find_Record | ( | sLong & | Index,
 |  | int | iField,
 |  | const CSG_String & | Value,
 |  | bool | bCreateIndex = false
 | ) |  |
virtual

Definition at line 950 of file table.cpp.

References CSG_Table_Record::asString(), CSG_String::Cmp(), CSG_Table_Record::Get_Index(), Get_Index_Field(), Get_Index_Order(), GET_RECORD, Get_Record_byIndex(), m_nFields, m_nRecords, Set_Index(), and TABLE_INDEX_Ascending.

Referenced by Find_Record(), and CSG_Category_Statistics::Get_Category().

◆ Find_Record() [4/4]

bool CSG_Table::Find_Record | ( | sLong & | Index,
 |  | int | iField,
 |  | double | Value,
 |  | bool | bCreateIndex = false
 | ) |  |
virtual

Definition at line 1030 of file table.cpp.

References CSG_Table_Record::Get_Index(), Get_Index_Field(), Get_Index_Order(), GET_RECORD, Get_Record_byIndex(), m_nFields, m_nRecords, Set_Index(), and TABLE_INDEX_Ascending.

◆ Get_Count()

sLong CSG_Table::Get_Count ( void ) const
inline

Definition at line 385 of file table.h.

References m_nRecords.

Referenced by CSG_Regression_Multiple::_Initialize(), CSG_PointCloud::_On_Construction(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Regression_Multiple::_Set_Step_Info(), CSG_Parameter_Fixed_Table::_Set_String(), _Stats_Update(), CSG_Projections::Add(), CSG_Category_Statistics::Add_Value(), CSG_Shapes::Assign(), Assign(), Assign_Values(), CSG_Natural_Breaks::Create(), CSG_Translator::Create(), CSG_Grids::Create(), CSG_Shapes::Create(), Create(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), CSG_Histogram::Create(), CSG_Regression_Multiple::Destroy(), CSG_Projections::EPSG_to_Proj4(), CSG_Projections::EPSG_to_WKT(), CSG_Category_Statistics::Get_Category(), CSG_Projections::Get_Count(), CSG_Category_Statistics::Get_Count(), CSG_Regression_Multiple::Get_Info(), CSG_Category_Statistics::Get_Majority(), CSG_Category_Statistics::Get_Minority(), Get_N(), CSG_TIN::Get_Node_Count(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), CSG_Projections::Get_Projection(), CSG_Regression_Multiple::Get_RConst(), Get_Selection_Index(), CSG_Shapes::Get_Shape(), CSG_Tool_Library_Manager::Get_Summary(), CSG_Data_Manager::Get_Summary(), CSG_Grids::Get_Value(), CSG_Parameters_Point_Search_KDTree_2D::Initialize(), Inv_Selection(), CSG_Shape_Line::is_Valid(), CSG_Shape_Polygon::is_Valid(), CSG_Shapes::is_Valid(), CSG_TIN::is_Valid(), CSG_Parameter::is_Value_Equal(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), CSG_Shapes::Make_Clean(), CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Shapes::On_Update(), CSG_Table_DBase::Open_Write(), CSG_Shapes::Select(), Set_Index(), CSG_Parameters_Point_Search_KDTree_2D::Set_Location(), and CSG_Parameters_Grid_Target::Set_User_Defined().

◆ Get_Extent()

virtual const CSG_Rect& CSG_Table::Get_Extent ( void )
inlinevirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, and CSG_Shapes.

Definition at line 346 of file table.h.

References CSG_TIN::m_Extent.

◆ Get_Field()

int CSG_Table::Get_Field ( const CSG_String & Name ) const

Definition at line 699 of file table.cpp.

References CSG_String::Cmp(), Get_Field_Count(), and Get_Field_Name().

◆ Get_Field_Count()

int CSG_Table::Get_Field_Count ( void ) const
inline

Definition at line 355 of file table.h.

References m_nFields.

Referenced by CSG_Table_Record::_Add_Field(), CSG_Table_Record::_Del_Field(), CSG_Table_Record::_Get_Field(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Fixed_Table::_Set_String(), CSG_Parameter_Table_Field::_Set_String(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_Parameter_Table_Field::_Set_Value(), CSG_PointCloud::Add_Shape(), CSG_Table_Record::Assign(), CSG_Translator::Create(), Create(), CSG_Histogram::Create(), CSG_Table_Record::CSG_Table_Record(), CSG_Grids::Del_Attribute(), Find_Field(), CSG_Parameter_Table_Field::Get_Choices(), CSG_Parameter::Get_Description(), Get_Field(), CSG_Parameter_Table_Field::Get_Table(), CSG_Parameter_Table_Fields::Get_Table(), CSG_Grids::Get_Z_Name_Field(), is_Compatible(), CSG_Parameter::is_Value_Equal(), Load(), CSG_Projections::Load_Dictionary(), CSG_Table_DBase::Open_Write(), Save(), CSG_Grids::Set_Z_Attribute(), CSG_Grids::Set_Z_Name_Field(), and CSG_Table_Record::~CSG_Table_Record().

◆ Get_Field_Length()

int CSG_Table::Get_Field_Length | ( | int | iField,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  | const

Definition at line 665 of file table.cpp.

References CSG_String::Length(), m_Field_Type, m_nFields, m_nRecords, SG_DATATYPE_String, SG_FILE_ENCODING_UTF16BE, SG_FILE_ENCODING_UTF16LE, SG_FILE_ENCODING_UTF32BE, SG_FILE_ENCODING_UTF32LE, SG_FILE_ENCODING_UTF7, SG_FILE_ENCODING_UTF8, and CSG_String::to_UTF8().

Referenced by CSG_Table_DBase::Open_Write().

◆ Get_Field_Name()

const SG_Char* CSG_Table::Get_Field_Name ( int iField ) const
inline

Definition at line 356 of file table.h.

References m_Field_Name, and m_nFields.

Referenced by CSG_Table_Record::_Get_Field(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Table_Field::_Set_String(), CSG_Parameter_Table_Field::_Set_Value(), CSG_Parameter_Table_Fields::_Set_Value(), Create(), CSG_PointCloud::Create(), Find_Field(), CSG_Parameter_Table_Field::Get_Choices(), Get_Field(), CSG_PointCloud::Mov_Field(), Mov_Field(), CSG_Table_DBase::Open_Write(), Save(), Serialize(), CSG_PointCloud::Set_Field_Type(), and SG_XML_Add_Parameter().

◆ Get_Field_Type()

TSG_Data_Type CSG_Table::Get_Field_Type ( int iField ) const
inline

Definition at line 357 of file table.h.

References m_Field_Type, m_nFields, and SG_DATATYPE_Undefined.

Referenced by CSG_Table_Record::_Add_Field(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_PointCloud::Add_Shape(), Create(), CSG_PointCloud::Create(), CSG_Table_Record::CSG_Table_Record(), CSG_Category_Statistics::Get_Category_Type(), is_Compatible(), CSG_PointCloud::is_Compatible(), CSG_Table_Record::is_NoData(), CSG_PointCloud::Mov_Field(), Mov_Field(), CSG_Table_DBase::Open_Write(), Save(), Serialize(), CSG_Table_Record::Set_NoData(), and SG_XML_Add_Parameter().

◆ Get_File_Encoding()

int CSG_Table::Get_File_Encoding ( void ) const
inline

Definition at line 335 of file table.h.

References m_Encoding.

◆ Get_Index()

sLong CSG_Table::Get_Index ( sLong Index ) const
inline

Definition at line 390 of file table.h.

References is_Indexed(), and m_nRecords.

Referenced by CSG_TIN::_Triangulate().

◆ Get_Index_Field() [1/2]

int CSG_Table::Get_Index_Field ( int i ) const
inline

Definition at line 434 of file table.h.

Referenced by Find_Record(), and Toggle_Index().

◆ Get_Index_Field() [2/2]

int CSG_Table::Get_Index_Field ( size_t i ) const
inline

Definition at line 436 of file table.h.

References Get_Index_Field().

Referenced by Get_Index_Field().

◆ Get_Index_Order() [1/2]

TSG_Table_Index_Order CSG_Table::Get_Index_Order ( int i ) const
inline

Definition at line 435 of file table.h.

References TABLE_INDEX_Ascending, TABLE_INDEX_Descending, and TABLE_INDEX_None.

Referenced by Find_Record(), and Toggle_Index().

◆ Get_Index_Order() [2/2]

TSG_Table_Index_Order CSG_Table::Get_Index_Order ( size_t i ) const
inline

Definition at line 437 of file table.h.

References Get_Index_Order().

Referenced by Get_Index_Order().

◆ Get_Maximum()

double CSG_Table::Get_Maximum ( int iField ) const
inline

Definition at line 369 of file table.h.

References _Stats_Update(), and m_Field_Stats.

Referenced by CSG_PointCloud::On_Update().

◆ Get_Mean()

double CSG_Table::Get_Mean ( int iField ) const
inline

Definition at line 372 of file table.h.

References _Stats_Update(), and m_Field_Stats.

◆ Get_Minimum()

double CSG_Table::Get_Minimum ( int iField ) const
inline

Definition at line 368 of file table.h.

References _Stats_Update(), and m_Field_Stats.

Referenced by CSG_PointCloud::On_Update().

◆ Get_N()

sLong CSG_Table::Get_N ( int iField ) const
inline

Definition at line 367 of file table.h.

References _Stats_Update(), Get_Count(), and m_Field_Stats.

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_Table::Get_ObjectType ( void ) const
inlinevirtual

Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 315 of file table.h.

References SG_DATAOBJECT_TYPE_Table.

Referenced by CSG_Shape::Assign(), and SG_Create_Table().

◆ Get_Range()

double CSG_Table::Get_Range ( int iField ) const
inline

Definition at line 370 of file table.h.

References _Stats_Update(), and m_Field_Stats.

◆ Get_Record()

virtual CSG_Table_Record* CSG_Table::Get_Record ( sLong Index ) const
inlinevirtual

Reimplemented in CSG_PointCloud.

Definition at line 387 of file table.h.

References m_nRecords.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Initialize(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Regression_Multiple::_Set_Step_Info(), Assign(), Assign_Values(), CSG_Natural_Breaks::Create(), CSG_Translator::Create(), CSG_Histogram::Create(), CSG_Regression_Multiple::Destroy(), CSG_Projections::EPSG_to_Proj4(), CSG_Projections::EPSG_to_WKT(), Find_Record(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Regression_Multiple::Get_CV_NRMSE(), CSG_Regression_Multiple::Get_CV_nSamples(), CSG_Regression_Multiple::Get_CV_R2(), CSG_Regression_Multiple::Get_CV_RMSE(), CSG_Regression_Multiple::Get_F(), CSG_Regression_Multiple::Get_Info(), CSG_Regression_Multiple::Get_Name(), CSG_Projections::Get_Names_List(), CSG_TIN::Get_Node(), CSG_Regression_Multiple::Get_nPredictors(), CSG_Regression_Multiple::Get_nSamples(), CSG_Regression_Multiple::Get_P(), CSG_Regression_Multiple::Get_Parameter(), CSG_Projections::Get_Projection(), CSG_Regression_Multiple::Get_R2(), CSG_Regression_Multiple::Get_R2_Adj(), CSG_Regression_Multiple::Get_RConst(), Get_Record_byIndex(), Get_Selection(), CSG_Regression_Multiple::Get_StdError(), Get_Value(), Inv_Selection(), CSG_Parameter::is_Value_Equal(), CSG_Projections::Load_Dictionary(), CSG_Table_DBase::Open_Write(), Select(), Serialize(), and Set_Value().

◆ Get_Record_byIndex()

CSG_Table_Record* CSG_Table::Get_Record_byIndex ( sLong Index ) const
inline

Definition at line 392 of file table.h.

References Get_Record(), is_Indexed(), and m_nRecords.

Referenced by CSG_Category_Statistics::Add_Value(), CSG_Category_Statistics::asDouble(), CSG_Category_Statistics::asInt(), CSG_Category_Statistics::asString(), CSG_Translator::Create(), Find_Record(), CSG_Category_Statistics::Get_Count(), CSG_Category_Statistics::Get_Majority(), CSG_Category_Statistics::Get_Minority(), CSG_Shapes::Get_Shape_byIndex(), CSG_Projections::Load_DB(), and operator[]().

◆ Get_Selection()

virtual CSG_Table_Record* CSG_Table::Get_Selection ( sLong Index = 0 ) const
inlinevirtual

Definition at line 415 of file table.h.

References Get_Record(), Get_Selection_Index(), CSG_Array::Get_Size(), and m_Selection.

Referenced by CSG_Shapes::Get_Selection().

◆ Get_Selection_Count()

sLong CSG_Table::Get_Selection_Count ( void ) const
inline

Definition at line 413 of file table.h.

References CSG_Array::Get_Size(), and m_Selection.

Referenced by CSG_PointCloud::Del_Selection(), Del_Selection(), CSG_PointCloud::Get_Selection(), CSG_PointCloud::Get_Selection_Extent(), CSG_Shapes::Get_Selection_Extent(), Ins_Record(), CSG_PointCloud::Inv_Selection(), Inv_Selection(), CSG_Shapes::Select(), and CSG_PointCloud::Select().

◆ Get_Selection_Index()

sLong CSG_Table::Get_Selection_Index ( sLong Index = 0 ) const
inline

Definition at line 414 of file table.h.

References Get_Count(), CSG_Array::Get_Entry(), CSG_Array::Get_Size(), and m_Selection.

Referenced by _Del_Selection(), CSG_PointCloud::Get_Selection(), Get_Selection(), CSG_PointCloud::Get_Selection_Extent(), and CSG_PointCloud::Select().

◆ Get_Statistics()

const CSG_Simple_Statistics& CSG_Table::Get_Statistics ( int iField ) const
inline

Definition at line 375 of file table.h.

References _Stats_Update(), and m_Field_Stats.

◆ Get_StdDev()

double CSG_Table::Get_StdDev ( int iField ) const
inline

Definition at line 373 of file table.h.

References _Stats_Update(), and m_Field_Stats.

◆ Get_Sum()

double CSG_Table::Get_Sum ( int iField ) const
inline

Definition at line 371 of file table.h.

References _Stats_Update(), and m_Field_Stats.

◆ Get_Value() [1/2]

bool CSG_Table::Get_Value | ( | sLong | Index,
 |  | int | iField,
 |  | CSG_String & | Value
 | ) |  | const
 virtual

Reimplemented in CSG_PointCloud.

Definition at line 1161 of file table.cpp.

References CSG_Table_Record::asString(), Get_Record(), and m_nFields.

Referenced by CSG_PointCloud::Get_Attribute(), and CSG_PointCloud::is_NoData().

◆ Get_Value() [2/2]

bool CSG_Table::Get_Value | ( | sLong | Index,
 |  | int | iField,
 |  | double & | Value
 | ) |  | const
 virtual

Definition at line 1179 of file table.cpp.

References CSG_Table_Record::asDouble(), Get_Record(), and m_nFields.

◆ Get_Variance()

double CSG_Table::Get_Variance ( int iField ) const
inline

Definition at line 374 of file table.h.

References _Stats_Update(), Get_Variance(), and m_Field_Stats.

Referenced by Get_Variance().

◆ Ins_Record()

CSG_Table_Record * CSG_Table::Ins_Record | ( | sLong | Index,
 |  | CSG_Table_Record * | pCopy = NULL
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 805 of file table.cpp.

References _Get_New_Record(), _Stats_Invalidate(), CSG_Index::Add_Entry(), CSG_Table_Record::Assign(), CSG_Array::Get_Array(), Get_Selection_Count(), CSG_Array::Get_Size(), CSG_Index::is_Okay(), CSG_Table_Record::m_Index, m_nRecords, m_Selection, Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by Add_Record().

◆ Inv_Selection()

sLong CSG_Table::Inv_Selection ( void )
virtual

Reimplemented in CSG_PointCloud.

Definition at line 203 of file table_selection.cpp.

References Get_Count(), CSG_Array::Get_Entry(), Get_Record(), Get_Selection_Count(), CSG_Array::Get_Size(), CSG_Table_Record::is_Selected(), m_nRecords, m_Selection, CSG_Array::Set_Array(), and CSG_Table_Record::Set_Selected().

◆ is_Compatible() [1/2]

bool CSG_Table::is_Compatible | ( | const CSG_Table & | Table,
 |  | bool | bExactMatch = false
 | ) |  | const

Definition at line 436 of file table.cpp.

References Get_Field_Count(), Get_Field_Type(), and SG_DATATYPE_String.

Referenced by Assign_Values(), CSG_Parameter::is_Compatible(), is_Compatible(), and CSG_Parameter::is_Value_Equal().

◆ is_Compatible() [2/2]

bool CSG_Table::is_Compatible | ( | CSG_Table * | pTable,
 |  | bool | bExactMatch = false
 | ) |  | const

Definition at line 474 of file table.cpp.

References is_Compatible().

◆ is_Indexed()

bool CSG_Table::is_Indexed ( void ) const
inline

Definition at line 430 of file table.h.

References m_nRecords.

Referenced by Get_Index(), Get_Record_byIndex(), and Set_Index().

◆ is_Selected()

virtual bool CSG_Table::is_Selected ( sLong Index ) const
inlinevirtual

Reimplemented in CSG_PointCloud.

Definition at line 417 of file table.h.

References is_Selected(), and m_nRecords.

Referenced by Del_Record(), Del_Selection(), and is_Selected().

◆ is_Valid()

virtual bool CSG_Table::is_Valid ( void ) const
inlinevirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 340 of file table.h.

References m_nFields.

◆ Load()

bool CSG_Table::Load | ( | const CSG_String & | File,
 |  | int | Format,
 |  | SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Definition at line 99 of file table_io.cpp.

References Destroy(), CSG_MetaData::Get_Child(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), Get_Field_Count(), CSG_Data_Object::Get_MetaData_DB(), CSG_Data_Object::Load_MetaData(), Set_Field_Name(), Set_File_Encoding(), CSG_Data_Object::Set_Name(), SG_File_Cmp_Extension(), SG_File_Exists(), SG_File_Get_Name(), TABLE_FILETYPE_DBase, TABLE_FILETYPE_Text, TABLE_FILETYPE_Text_NoHeadLine, and TABLE_FILETYPE_Undefined.

Referenced by Create().

◆ Mov_Field()

bool CSG_Table::Mov_Field | ( | int | iField,
 |  | int | Position
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 564 of file table.cpp.

References Add_Field(), Del_Field(), Get_Field_Name(), Get_Field_Type(), CSG_Table_Record::Get_Value(), m_nFields, and m_nRecords.

◆ On_Delete()

bool CSG_Table::On_Delete ( void )
protectedvirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 70 of file table_io.cpp.

References CSG_Data_Object::Get_File_Name(), and SG_File_Delete().

◆ On_NoData_Changed()

bool CSG_Table::On_NoData_Changed ( void )
protectedvirtual

Reimplemented from CSG_Data_Object.

Definition at line 1284 of file table.cpp.

References _Stats_Invalidate(), and CSG_Data_Object::On_NoData_Changed().

◆ On_Reload()

bool CSG_Table::On_Reload ( void )
protectedvirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 64 of file table_io.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_Table::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 1292 of file table.cpp.

References _Stats_Invalidate(), CSG_Index::is_Okay(), and CSG_Data_Object::On_Update().

Referenced by CSG_Shapes::On_Update().

◆ operator=()

CSG_Table & CSG_Table::operator= ( const CSG_Table & Table )

Definition at line 364 of file table.cpp.

References Create().

◆ operator[]()

virtual CSG_Table_Record& CSG_Table::operator[] ( sLong Index ) const
inlinevirtual

Definition at line 388 of file table.h.

References Get_Record_byIndex().

◆ Save() [1/6]

virtual bool CSG_Table::Save | ( | const char * | File,
 |  | int | Format,
 |  | SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |
inlinevirtual

Definition at line 327 of file table.h.

References Save().

Referenced by Save().

◆ Save() [2/6]

virtual bool CSG_Table::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 331 of file table.h.

References Save().

Referenced by Save().

◆ Save() [3/6]

bool CSG_Table::Save | ( | const CSG_String & | File,
 |  | int | Format,
 |  | SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |
virtual

Definition at line 155 of file table_io.cpp.

References _TL, CSG_MetaData::Add_Child(), CSG_String::c_str(), CSG_MetaData::Del_Children(), CSG_String::Format(), CSG_MetaData::Get_Child(), Get_Field_Count(), Get_Field_Name(), Get_Field_Type(), CSG_Data_Object::Get_MetaData_DB(), gSG_Data_Type_Identifier, CSG_Data_Object::Save_MetaData(), Set_File_Encoding(), CSG_Data_Object::Set_File_Name(), CSG_Data_Object::Set_File_Type(), Set_Modified(), CSG_Data_Object::Set_Update_Flag(), SG_File_Cmp_Extension(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, TABLE_FILETYPE_DBase, TABLE_FILETYPE_Text, and TABLE_FILETYPE_Text_NoHeadLine.

Referenced by Save(), CSG_Projections::Save_DB(), and CSG_Projections::Save_Dictionary().

◆ Save() [4/6]

bool CSG_Table::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 149 of file table_io.cpp.

References m_Encoding, and Save().

◆ Save() [5/6]

virtual bool CSG_Table::Save | ( | const wchar_t * | File,
 |  | int | Format,
 |  | SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |
inlinevirtual

Definition at line 328 of file table.h.

References Save().

Referenced by Save().

◆ Save() [6/6]

virtual bool CSG_Table::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Implements CSG_Data_Object.

Reimplemented in CSG_TIN, CSG_Shapes, and CSG_PointCloud.

Definition at line 332 of file table.h.

References Save().

Referenced by Save().

◆ Select() [1/2]

bool CSG_Table::Select | ( | CSG_Table_Record * | pRecord = NULL,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented in CSG_Shapes, and CSG_PointCloud.

Definition at line 167 of file table_selection.cpp.

References CSG_Table_Record::Get_Index(), and Select().

◆ Select() [2/2]

bool CSG_Table::Select | ( | sLong | Index,
 |  | bool | bInvert = false
 | ) |  |
virtual

Reimplemented in CSG_Shapes, and CSG_PointCloud.

Definition at line 136 of file table_selection.cpp.

References _Add_Selection(), _Del_Selection(), Get_Record(), CSG_Table_Record::is_Selected(), and CSG_Table_Record::Set_Selected().

Referenced by Select(), CSG_PointCloud::Select(), CSG_Shapes::Select(), and CSG_Table_Record::~CSG_Table_Record().

◆ Serialize()

bool CSG_Table::Serialize | ( | CSG_File & | Stream,
 |  | bool | bSave
 | ) |  |

Definition at line 538 of file table_io.cpp.

References Add_Field(), Add_Record(), CSG_String::AfterFirst(), CSG_String::BeforeFirst(), Destroy(), Get_Field_Name(), Get_Field_Type(), Get_Record(), m_nFields, m_nRecords, CSG_File::Printf(), CSG_File::Read_Line(), CSG_Table_Record::Set_Value(), SG_Char, SG_SSCANF, and SG_T.

Referenced by CSG_Parameters::Serialize_Compatibility().

◆ Set_Count()

bool CSG_Table::Set_Count ( sLong nRecords )
virtual

Definition at line 930 of file table.cpp.

References Add_Record(), Del_Record(), and m_nRecords.

Referenced by CSG_PointCloud::_On_Construction(), Assign_Values(), and CSG_Grids::Set_Grid_Count().

◆ Set_Field_Name()

bool CSG_Table::Set_Field_Name | ( | int | iField,
 |  | const SG_Char * | Name
 | ) |  |

Definition at line 617 of file table.cpp.

References m_Field_Name, m_nFields, and Set_Modified().

Referenced by Load().

◆ Set_Field_Type()

bool CSG_Table::Set_Field_Type | ( | int | iField,
 |  | TSG_Data_Type | Type
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 632 of file table.cpp.

References CSG_Table_Record::_Create_Value(), m_Field_Type, m_nFields, m_nRecords, CSG_Table_Record::m_Values, and CSG_Table_Record::Set_Modified().

Referenced by CSG_PointCloud::Set_Field_Type().

◆ Set_File_Encoding()

bool CSG_Table::Set_File_Encoding ( int Encoding )

Definition at line 81 of file table_io.cpp.

References m_Encoding, and SG_FILE_ENCODING_UNDEFINED.

Referenced by Load(), and Save().

◆ Set_Index() [1/4]

bool CSG_Table::Set_Index | ( | CSG_Index & | Index,
 |  | const CSG_Array_Int & | Fields,
 |  | bool | bAscending = true
 | ) |  | const

Definition at line 1530 of file table.cpp.

References CSG_Array_Int::Get_Array(), CSG_Array_Int::Get_Size(), and Set_Index().

◆ Set_Index() [2/4]

bool CSG_Table::Set_Index | ( | CSG_Index & | Index,
 |  | int | Field,
 |  | bool | bAscending = true
 | ) |  | const

Definition at line 1430 of file table.cpp.

References CSG_Index::Create(), and Get_Count().

Referenced by CSG_Translator::Create(), Find_Record(), CSG_Tool_Library_Manager::Get_Summary(), CSG_Projections::Load_DB(), Set_Index(), CSG_Category_Statistics::Sort(), Toggle_Index(), and CSG_Grids::Update_Z_Order().

◆ Set_Index() [3/4]

bool CSG_Table::Set_Index | ( | CSG_Index & | Index,
 |  | int | Fields[],
 |  | int | nFields,
 |  | bool | bAscending = true
 | ) |  | const

Definition at line 1522 of file table.cpp.

References CSG_Index::Create(), and Get_Count().

◆ Set_Index() [4/4]

bool CSG_Table::Set_Index | ( | int | Field_1,
 |  | TSG_Table_Index_Order | Order_1 = TABLE_INDEX_Ascending,
 |  | int | Field_2 = -1,
 |  | TSG_Table_Index_Order | Order_2 = TABLE_INDEX_None,
 |  | int | Field_3 = -1,
 |  | TSG_Table_Index_Order | Order_3 = TABLE_INDEX_None
 | ) |  |

Definition at line 1312 of file table.cpp.

References Del_Index(), CSG_Array_Int::Destroy(), is_Indexed(), m_nFields, TABLE_INDEX_Ascending, and TABLE_INDEX_None.

◆ Set_Modified()

void CSG_Table::Set_Modified ( bool bModified = true )
virtual

Reimplemented from CSG_Data_Object.

Reimplemented in CSG_PointCloud.

Definition at line 1117 of file table.cpp.

References CSG_Data_Object::is_Modified(), m_nRecords, CSG_Data_Object::Set_Modified(), and CSG_Table_Record::Set_Modified().

Referenced by Add_Field(), CSG_Shapes::Create(), CSG_TIN::Create(), Create(), Del_Field(), Del_Record(), Ins_Record(), Save(), CSG_Shapes::Save(), CSG_TIN::Save(), Set_Field_Name(), and CSG_Table_Record::Set_Modified().

◆ Set_Record()

bool CSG_Table::Set_Record | ( | sLong | Index,
 |  | CSG_Table_Record * | pCopy
 | ) |  |
virtual

Definition at line 862 of file table.cpp.

References Assign(), and m_nRecords.

◆ Set_Value() [1/2]

bool CSG_Table::Set_Value | ( | sLong | Index,
 |  | int | iField,
 |  | const SG_Char * | Value
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 1135 of file table.cpp.

References Get_Record(), m_nFields, and CSG_Table_Record::Set_Value().

Referenced by CSG_Grids::Add_Grid(), CSG_Tool_Library_Manager::Get_Summary(), CSG_PointCloud::Set_Attribute(), and CSG_PointCloud::Set_NoData().

◆ Set_Value() [2/2]

bool CSG_Table::Set_Value | ( | sLong | Index,
 |  | int | iField,
 |  | double | Value
 | ) |  |
virtual

Reimplemented in CSG_PointCloud.

Definition at line 1148 of file table.cpp.

References Get_Record(), m_nFields, and CSG_Table_Record::Set_Value().

◆ Toggle_Index()

bool CSG_Table::Toggle_Index ( int iField )

Definition at line 1351 of file table.cpp.

References Del_Index(), Get_Index_Field(), Get_Index_Order(), m_nFields, Set_Index(), TABLE_INDEX_Ascending, and TABLE_INDEX_Descending.

Friends And Related Function Documentation

◆ CSG_Table_Record

friend class CSG_Table_Record
friend

Definition at line 284 of file table.h.

Referenced by _Get_New_Record().

◆ CSG_TIN

friend class CSG_TIN ( void )
friend

Definition at line 285 of file table.h.

Member Data Documentation

◆ m_Encoding

int CSG_Table::m_Encoding
protected

Definition at line 442 of file table.h.

Referenced by CSG_Shapes::_On_Construction(), _On_Construction(), Create(), CSG_Table_DBase::CSG_Table_DBase(), Get_File_Encoding(), CSG_Table_DBase::Open_Write(), Save(), and Set_File_Encoding().

◆ m_Extent

CSG_Rect CSG_Table::m_Extent
protected

Definition at line 454 of file table.h.

Referenced by CSG_PointCloud::On_Update(), and CSG_Shapes::On_Update().

◆ m_Field_Name

CSG_String** CSG_Table::m_Field_Name
protected

Definition at line 448 of file table.h.

Referenced by CSG_PointCloud::_On_Construction(), _On_Construction(), Add_Field(), CSG_PointCloud::Assign(), CSG_PointCloud::Del_Field(), Del_Field(), CSG_PointCloud::Destroy(), Destroy(), Get_Field_Name(), and Set_Field_Name().

◆ m_Field_Stats

CSG_Simple_Statistics** CSG_Table::m_Field_Stats
protected

Definition at line 450 of file table.h.

Referenced by CSG_PointCloud::_On_Construction(), _On_Construction(), _Stats_Invalidate(), CSG_PointCloud::_Stats_Update(), _Stats_Update(), Add_Field(), CSG_PointCloud::Del_Field(), Del_Field(), CSG_PointCloud::Destroy(), Destroy(), Get_Maximum(), Get_Mean(), Get_Minimum(), Get_N(), Get_Range(), Get_Statistics(), Get_StdDev(), Get_Sum(), Get_Variance(), and CSG_PointCloud::On_Update().

◆ m_Field_Type

TSG_Data_Type* CSG_Table::m_Field_Type
protected

Definition at line 446 of file table.h.

Referenced by CSG_PointCloud::_On_Construction(), _On_Construction(), Add_Field(), CSG_PointCloud::Assign(), CSG_PointCloud::Del_Field(), Del_Field(), CSG_PointCloud::Destroy(), Destroy(), Get_Field_Length(), Get_Field_Type(), CSG_PointCloud::Mov_Field(), CSG_PointCloud::Set_Field_Type(), and Set_Field_Type().

◆ m_nBuffer

sLong CSG_Table::m_nBuffer
protected

Definition at line 444 of file table.h.

Referenced by _On_Construction(), and Del_Records().

◆ m_nFields

int CSG_Table::m_nFields
protected

Definition at line 442 of file table.h.

Referenced by CSG_PointCloud::_On_Construction(), _On_Construction(), _Stats_Invalidate(), CSG_PointCloud::_Stats_Update(), _Stats_Update(), CSG_PointCloud::Add_Field(), Add_Field(), CSG_PointCloud::Add_Shape(), CSG_PointCloud::Assign(), CSG_Table_DBase::Close(), CSG_PointCloud::Create(), CSG_Table_DBase::CSG_Table_DBase(), CSG_PointCloud::Del_Field(), Del_Field(), CSG_PointCloud::Destroy(), Destroy(), Find_Record(), Get_Field_Count(), Get_Field_Length(), Get_Field_Name(), Get_Field_Type(), Get_Value(), CSG_PointCloud::is_Compatible(), is_Valid(), CSG_PointCloud::Mov_Field(), Mov_Field(), CSG_PointCloud::On_Update(), CSG_Table_DBase::Open_Write(), Serialize(), Set_Field_Name(), CSG_PointCloud::Set_Field_Type(), Set_Field_Type(), Set_Index(), Set_Value(), and Toggle_Index().

◆ m_nRecords

sLong CSG_Table::m_nRecords
protected

Definition at line 444 of file table.h.

Referenced by CSG_PointCloud::_On_Construction(), _On_Construction(), CSG_PointCloud::_Stats_Update(), Add_Field(), Add_Record(), CSG_PointCloud::Add_Shape(), CSG_PointCloud::Assign(), CSG_Table_DBase::Close(), CSG_PointCloud::Del_Field(), Del_Field(), CSG_PointCloud::Del_Point(), CSG_PointCloud::Del_Points(), Del_Record(), Del_Records(), CSG_PointCloud::Del_Selection(), Del_Selection(), Find_Record(), Get_Count(), Get_Field_Length(), Get_Index(), CSG_PointCloud::Get_Point(), Get_Record(), Get_Record_byIndex(), CSG_PointCloud::Get_Shape(), Ins_Record(), CSG_PointCloud::Inv_Selection(), Inv_Selection(), is_Indexed(), CSG_PointCloud::is_Selected(), is_Selected(), CSG_PointCloud::Mov_Field(), Mov_Field(), CSG_PointCloud::Select(), Serialize(), Set_Count(), CSG_PointCloud::Set_Field_Type(), Set_Field_Type(), Set_Modified(), CSG_PointCloud::Set_Point(), and Set_Record().

◆ m_Selection

CSG_Array CSG_Table::m_Selection
protected

Definition at line 452 of file table.h.

Referenced by _Add_Selection(), _Del_Selection(), _On_Construction(), _Set_Selection(), CSG_PointCloud::Del_Points(), CSG_PointCloud::Del_Selection(), Del_Selection(), Get_Selection(), Get_Selection_Count(), Get_Selection_Index(), Ins_Record(), CSG_PointCloud::Inv_Selection(), Inv_Selection(), and CSG_PointCloud::Select().

The documentation for this class was generated from the following files:
  • table.h
  • table.cpp
  • table_io.cpp
  • table_selection.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table Member List

This is the complete list of members for CSG_Table, including all inherited members.

_Add_Selection(sLong Index) | CSG_Table | protected
_Del_Selection(sLong Index) | CSG_Table | protected
_Get_New_Record(sLong Index) | CSG_Table | protectedvirtual
_On_Construction(void) | CSG_Table | protectedvirtual
_Set_Selection(sLong Index, sLong Selected) | CSG_Table | protected
_Stats_Invalidate(void) const | CSG_Table | protected
_Stats_Invalidate(int iField) const | CSG_Table | protected
_Stats_Update(int iField) const | CSG_Table | protectedvirtual
Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | virtual
Add_Field(const char *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Field(const wchar_t *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Record(CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
Assign(CSG_Data_Object *pTable) | CSG_Table | virtual
Assign_Values(const CSG_Table &Table) | CSG_Table |
Assign_Values(CSG_Table *pTable) | CSG_Table |
Assign_Values(const SG_Char *File) | CSG_Table |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(const CSG_Table &Table) | CSG_Table |
Create(const CSG_Table *pTemplate) | CSG_Table |
Create(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Create(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Create(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Create(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Create(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Create(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Data_Object(void) | CSG_Data_Object |
CSG_Table(void) | CSG_Table |
CSG_Table(const CSG_Table &Table) | CSG_Table |
CSG_Table(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table_Record class | CSG_Table | friend
CSG_TIN class | CSG_Table | friend
Del_Field(int iField) | CSG_Table | virtual
Del_Index(void) | CSG_Table |
Del_Record(sLong Index) | CSG_Table | virtual
Del_Records(void) | CSG_Table | virtual
Del_Selection(void) | CSG_Table | virtual
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_Table | virtual
Find_Field(const CSG_String &Name) const | CSG_Table |
Find_Field(const CSG_String &Name, int &Index) const | CSG_Table |
Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(sLong &Index, int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Count(void) const | CSG_Table | inline
Get_Description(void) const | CSG_Data_Object |
Get_Extent(void) | CSG_Table | inlinevirtual
Get_Field(const CSG_String &Name) const | CSG_Table |
Get_Field_Count(void) const | CSG_Table | inline
Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const | CSG_Table |
Get_Field_Name(int iField) const | CSG_Table | inline
Get_Field_Type(int iField) const | CSG_Table | inline
Get_File_Encoding(void) const | CSG_Table | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Index(sLong Index) const | CSG_Table | inline
Get_Index_Field(int i) const | CSG_Table | inline
Get_Index_Field(size_t i) const | CSG_Table | inline
Get_Index_Order(int i) const | CSG_Table | inline
Get_Index_Order(size_t i) const | CSG_Table | inline
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Maximum(int iField) const | CSG_Table | inline
Get_Mean(int iField) const | CSG_Table | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Minimum(int iField) const | CSG_Table | inline
Get_N(int iField) const | CSG_Table | inline
Get_Name(void) const | CSG_Data_Object |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_ObjectType(void) const | CSG_Table | inlinevirtual
Get_Owner(void) const | CSG_Data_Object | inline
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Range(int iField) const | CSG_Table | inline
Get_Record(sLong Index) const | CSG_Table | inlinevirtual
Get_Record_byIndex(sLong Index) const | CSG_Table | inline
Get_Selection(sLong Index=0) const | CSG_Table | inlinevirtual
Get_Selection_Count(void) const | CSG_Table | inline
Get_Selection_Index(sLong Index=0) const | CSG_Table | inline
Get_Statistics(int iField) const | CSG_Table | inline
Get_StdDev(int iField) const | CSG_Table | inline
Get_Sum(int iField) const | CSG_Table | inline
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(sLong Index, int iField, CSG_String &Value) const | CSG_Table | virtual
Get_Value(sLong Index, int iField, double &Value) const | CSG_Table | virtual
Get_Variance(int iField) const | CSG_Table | inline
Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
Inv_Selection(void) | CSG_Table | virtual
is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const | CSG_Table |
is_Compatible(CSG_Table *pTable, bool bExactMatch=false) const | CSG_Table |
is_File_Native(void) const | CSG_Data_Object | inline
is_Indexed(void) const | CSG_Table | inline
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Selected(sLong Index) const | CSG_Table | inlinevirtual
is_Valid(void) const | CSG_Table | inlinevirtual
Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_Encoding | CSG_Table | protected
m_Extent | CSG_Table | protected
m_Field_Name | CSG_Table | protected
m_Field_Stats | CSG_Table | protected
m_Field_Type | CSG_Table | protected
m_nBuffer | CSG_Table | protected
m_nFields | CSG_Table | protected
m_nRecords | CSG_Table | protected
m_pOwner | CSG_Data_Object | protected
m_Selection | CSG_Table | protected
Mov_Field(int iField, int Position) | CSG_Table | virtual
On_Delete(void) | CSG_Table | protectedvirtual
On_NoData_Changed(void) | CSG_Table | protectedvirtual
On_Reload(void) | CSG_Table | protectedvirtual
On_Update(void) | CSG_Table | protectedvirtual
operator=(const CSG_Table &Table) | CSG_Table |
operator[](sLong Index) const | CSG_Table | inlinevirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | virtual
Save(const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
Save(const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
Save(const CSG_String &File, int Format=0) | CSG_Table | virtual
Save(const char *File, int Format=0) | CSG_Table | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_Table | inlinevirtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Select(sLong Index, bool bInvert=false) | CSG_Table | virtual
Select(CSG_Table_Record *pRecord=NULL, bool bInvert=false) | CSG_Table | virtual
Serialize(CSG_File &Stream, bool bSave) | CSG_Table |
Set_Count(sLong nRecords) | CSG_Table | virtual
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_Field_Name(int iField, const SG_Char *Name) | CSG_Table |
Set_Field_Type(int iField, TSG_Data_Type Type) | CSG_Table | virtual
Set_File_Encoding(int Encoding) | CSG_Table |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const | CSG_Table |
Set_Index(int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None) | CSG_Table |
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bModified=true) | CSG_Table | virtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Record(sLong Index, CSG_Table_Record *pCopy) | CSG_Table | virtual
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(sLong Index, int iField, const SG_Char *Value) | CSG_Table | virtual
Set_Value(sLong Index, int iField, double Value) | CSG_Table | virtual
Toggle_Index(int iField) | CSG_Table |
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_Table(void) | CSG_Table | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_DBase Class Reference

Classes | Public Member Functions | List of all members
CSG_Table_DBase Class Reference

#include <table_dbase.h>

Public Member Functions

CSG_Table_DBase (int Encoding=SG_FILE_ENCODING_ANSI)
virtual | ~CSG_Table_DBase (void)
void | Close (void)
bool | Open_Read (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true)
bool | Open_Write (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
int | Get_Field_Count (void)
const char * | Get_Field_Name (int iField)
char | Get_Field_Type (int iField)
int | Get_Field_Width (int iField)
int | Get_Field_Decimals (int iField)
int | Get_File_Position (void)
int | Get_File_Length (void)
int | Get_Count (void)
bool | Move_First (void)
bool | Move_Next (void)
void | Add_Record (void)
void | Flush_Record (void)
bool | isDeleted (void)
bool | asInt (int iField, int &Value)
bool | asDouble (int iField, double &Value)
CSG_String | asString (int iField)
bool | Set_Value (int iField, double Value)
bool | Set_Value (int iField, const CSG_String &Value)
bool | Set_NoData (int iField)

Detailed Description

Definition at line 90 of file table_dbase.h.

Constructor & Destructor Documentation

◆ CSG_Table_DBase()

CSG_Table_DBase::CSG_Table_DBase ( int Encoding = SG_FILE_ENCODING_ANSI )

Definition at line 82 of file table_dbase.cpp.

References CSG_Table::m_Encoding, and CSG_Table::m_nFields.

◆ ~CSG_Table_DBase()

CSG_Table_DBase::~CSG_Table_DBase ( void )
virtual

Definition at line 92 of file table_dbase.cpp.

References Close().

Member Function Documentation

◆ Add_Record()

void CSG_Table_DBase::Add_Record ( void )

Definition at line 612 of file table_dbase.cpp.

Referenced by Open_Write().

◆ asDouble()

bool CSG_Table_DBase::asDouble | ( | int | iField,
 |  | double & | Value
 | ) |  |

Definition at line 667 of file table_dbase.cpp.

References CSG_String::asDouble(), CSG_String::asInt(), DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, CSG_String::Length(), CSG_String::Mid(), and CSG_String::Replace().

Referenced by asInt(), and Open_Read().

◆ asInt()

bool CSG_Table_DBase::asInt | ( | int | iField,
 |  | int & | Value
 | ) |  |

Definition at line 652 of file table_dbase.cpp.

References asDouble().

◆ asString()

CSG_String CSG_Table_DBase::asString ( int iField )

Definition at line 713 of file table_dbase.cpp.

References DBF_FT_DATE, CSG_String::from_UTF8(), SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF8, and CSG_String::Trim().

Referenced by Open_Read().

◆ Close()

void CSG_Table_DBase::Close ( void )

Definition at line 98 of file table_dbase.cpp.

References Flush_Record(), CSG_Table::m_nFields, CSG_Table::m_nRecords, and SG_FREE_SAFE.

Referenced by Open_Read(), Open_Write(), and ~CSG_Table_DBase().

◆ Flush_Record()

void CSG_Table_DBase::Flush_Record ( void )

Definition at line 630 of file table_dbase.cpp.

Referenced by Close(), Move_First(), Move_Next(), and Open_Write().

◆ Get_Count()

int CSG_Table_DBase::Get_Count ( void )
inline

Definition at line 122 of file table_dbase.h.

Referenced by Open_Read().

◆ Get_Field_Count()

int CSG_Table_DBase::Get_Field_Count ( void )
inline

Definition at line 103 of file table_dbase.h.

Referenced by Open_Read(), and Open_Write().

◆ Get_Field_Decimals()

int CSG_Table_DBase::Get_Field_Decimals ( int iField )
inline

Definition at line 115 of file table_dbase.h.

Referenced by Open_Read().

◆ Get_Field_Name()

const char* CSG_Table_DBase::Get_Field_Name ( int iField )
inline

Definition at line 106 of file table_dbase.h.

Referenced by Open_Read().

◆ Get_Field_Type()

char CSG_Table_DBase::Get_Field_Type ( int iField )
inline

Definition at line 109 of file table_dbase.h.

References DBF_FT_NONE.

Referenced by Open_Read(), and Open_Write().

◆ Get_Field_Width()

int CSG_Table_DBase::Get_Field_Width ( int iField )
inline

Definition at line 112 of file table_dbase.h.

◆ Get_File_Length()

int CSG_Table_DBase::Get_File_Length ( void )
inline

Definition at line 121 of file table_dbase.h.

◆ Get_File_Position()

int CSG_Table_DBase::Get_File_Position ( void )

Definition at line 552 of file table_dbase.cpp.

◆ isDeleted()

bool CSG_Table_DBase::isDeleted ( void )

Definition at line 646 of file table_dbase.cpp.

◆ Move_First()

bool CSG_Table_DBase::Move_First ( void )

Definition at line 563 of file table_dbase.cpp.

References Flush_Record().

Referenced by Open_Read().

◆ Move_Next()

bool CSG_Table_DBase::Move_Next ( void )

Definition at line 585 of file table_dbase.cpp.

References Flush_Record().

Referenced by Open_Read().

◆ Open_Read()

bool CSG_Table_DBase::Open_Read | ( | const SG_Char * | FileName,
 |  | class CSG_Table * | pTable,
 |  | bool | bRecords_Load = true
 | ) |  |

Definition at line 127 of file table_dbase.cpp.

References _TL, CSG_Table::Add_Field(), CSG_Table::Add_Record(), asDouble(), asString(), Close(), DBF_FT_CHARACTER, DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_LOGICAL, DBF_FT_NUMERIC, CSG_Table::Destroy(), Get_Count(), Get_Field_Count(), Get_Field_Decimals(), Get_Field_Name(), Get_Field_Type(), Move_First(), Move_Next(), CSG_Table_Record::Set_NoData(), CSG_Table_Record::Set_Value(), SG_DATATYPE_Char, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_Long, SG_DATATYPE_String, SG_UI_Msg_Add_Error(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().

◆ Open_Write()

bool CSG_Table_DBase::Open_Write | ( | const SG_Char * | FileName,
 |  | class CSG_Table * | pTable,
 |  | bool | bRecords_Save = true
 | ) |  |

Definition at line 307 of file table_dbase.cpp.

References _TL, Add_Record(), CSG_Table_Record::asDouble(), CSG_Table_Record::asString(), CSG_String::b_str(), Close(), DBF_FT_CHARACTER, DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, Flush_Record(), CSG_Table::Get_Count(), Get_Field_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Length(), CSG_Table::Get_Field_Name(), Get_Field_Type(), CSG_Table::Get_Field_Type(), CSG_Table::Get_Record(), CSG_Table_Record::is_NoData(), CSG_String::Length(), CSG_Table::m_Encoding, CSG_Table::m_nFields, Set_NoData(), Set_Value(), SG_Calloc(), SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Word, SG_UI_Msg_Add_Error(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().

◆ Set_NoData()

bool CSG_Table_DBase::Set_NoData ( int iField )

Definition at line 904 of file table_dbase.cpp.

Referenced by Open_Write().

◆ Set_Value() [1/2]

bool CSG_Table_DBase::Set_Value | ( | int | iField,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 834 of file table_dbase.cpp.

References CSG_String::b_str(), DBF_FT_CHARACTER, DBF_FT_DATE, CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), CSG_String::Length(), M_GET_MIN, SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().

◆ Set_Value() [2/2]

bool CSG_Table_DBase::Set_Value | ( | int | iField,
 |  | double | Value
 | ) |  |

Definition at line 771 of file table_dbase.cpp.

References DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, CSG_String::Format(), CSG_DateTime::Get_Day(), CSG_DateTime::Get_Month(), CSG_DateTime::Get_Year(), and M_GET_MIN.

Referenced by Open_Write().

The documentation for this class was generated from the following files:
  • table_dbase.h
  • table_dbase.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_DBase Member List

This is the complete list of members for CSG_Table_DBase, including all inherited members.

Add_Record(void) | CSG_Table_DBase |
asDouble(int iField, double &Value) | CSG_Table_DBase |
asInt(int iField, int &Value) | CSG_Table_DBase |
asString(int iField) | CSG_Table_DBase |
Close(void) | CSG_Table_DBase |
CSG_Table_DBase(int Encoding=SG_FILE_ENCODING_ANSI) | CSG_Table_DBase |
Flush_Record(void) | CSG_Table_DBase |
Get_Count(void) | CSG_Table_DBase | inline
Get_Field_Count(void) | CSG_Table_DBase | inline
Get_Field_Decimals(int iField) | CSG_Table_DBase | inline
Get_Field_Name(int iField) | CSG_Table_DBase | inline
Get_Field_Type(int iField) | CSG_Table_DBase | inline
Get_Field_Width(int iField) | CSG_Table_DBase | inline
Get_File_Length(void) | CSG_Table_DBase | inline
Get_File_Position(void) | CSG_Table_DBase |
isDeleted(void) | CSG_Table_DBase |
Move_First(void) | CSG_Table_DBase |
Move_Next(void) | CSG_Table_DBase |
Open_Read(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true) | CSG_Table_DBase |
Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true) | CSG_Table_DBase |
Set_NoData(int iField) | CSG_Table_DBase |
Set_Value(int iField, double Value) | CSG_Table_DBase |
Set_Value(int iField, const CSG_String &Value) | CSG_Table_DBase |
~CSG_Table_DBase(void) | CSG_Table_DBase | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Record Class Reference

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Table_Record Class Reference

#include <table.h>

Inheritance diagram for CSG_Table_Record:
CSG_Shape CSG_TIN_Node CSG_Shape_Point CSG_Shape_Points CSG_Shape_Point_Z CSG_Shape_Line CSG_Shape_Polygon CSG_Shape_Point_ZM

Public Member Functions

class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
virtual bool | Assign (CSG_Table_Record *pRecord)
bool | is_Selected (void) const
bool | is_Modified (void) const

Protected Member Functions

CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const

Static Protected Member Functions

static CSG_Table_Value * _Create_Value (TSG_Data_Type Type)

Protected Attributes

char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Friends

class | CSG_Table
class | CSG_PointCloud

Detailed Description

Definition at line 129 of file table.h.

Constructor & Destructor Documentation

◆ CSG_Table_Record()

CSG_Table_Record::CSG_Table_Record | ( | class CSG_Table * | pTable,
 |  | sLong | Index
 | ) |  |
protected

Definition at line 64 of file table_record.cpp.

References _Create_Value(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Type(), m_Flags, m_Index, m_pTable, m_Values, and SG_Malloc().

◆ ~CSG_Table_Record()

CSG_Table_Record::~CSG_Table_Record ( void )
protectedvirtual

Definition at line 86 of file table_record.cpp.

References CSG_Table::Get_Field_Count(), is_Selected(), m_Index, m_pTable, m_Values, CSG_Table::Select(), and SG_Free().

Member Function Documentation

◆ _Add_Field()

bool CSG_Table_Record::_Add_Field ( int add_Field )
protected

Definition at line 143 of file table_record.cpp.

References _Create_Value(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Type(), m_pTable, m_Values, and SG_Realloc().

Referenced by CSG_Table::Add_Field().

◆ _Create_Value()

CSG_Table_Value * CSG_Table_Record::_Create_Value ( TSG_Data_Type Type )
staticprotected

Definition at line 110 of file table_record.cpp.

References SG_DATATYPE_Binary, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by _Add_Field(), CSG_Table_Record(), and CSG_Table::Set_Field_Type().

◆ _Del_Field()

bool CSG_Table_Record::_Del_Field ( int del_Field )
protected

Definition at line 167 of file table_record.cpp.

References CSG_Table::Get_Field_Count(), m_pTable, m_Values, and SG_Realloc().

Referenced by CSG_Table::Del_Field().

◆ _Get_Field()

int CSG_Table_Record::_Get_Field ( const CSG_String & Field ) const
protected

Definition at line 182 of file table_record.cpp.

References CSG_String::Cmp(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Name(), CSG_String::Length(), and m_pTable.

Referenced by Add_Value(), asChar(), asDouble(), asFloat(), asInt(), asLong(), asShort(), asString(), is_NoData(), Mul_Value(), Set_NoData(), and Set_Value().

◆ Add_Value() [1/4]

bool CSG_Table_Record::Add_Value | ( | const char * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 184 of file table.h.

References Add_Value().

Referenced by Add_Value().

◆ Add_Value() [2/4]

bool CSG_Table_Record::Add_Value | ( | const CSG_String & | Field,
 |  | double | Value
 | ) |  |

Definition at line 339 of file table_record.cpp.

References _Get_Field(), and Add_Value().

◆ Add_Value() [3/4]

bool CSG_Table_Record::Add_Value | ( | const wchar_t * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 185 of file table.h.

References Add_Value().

Referenced by Add_Value().

◆ Add_Value() [4/4]

bool CSG_Table_Record::Add_Value | ( | int | Field,
 |  | double | Value
 | ) |  |

Definition at line 329 of file table_record.cpp.

References asDouble(), and Set_Value().

Referenced by Add_Value(), and CSG_Category_Statistics::Add_Value().

◆ asChar() [1/4]

SG_Char CSG_Table_Record::asChar ( const char * Field ) const
inline

Definition at line 209 of file table.h.

◆ asChar() [2/4]

SG_Char CSG_Table_Record::asChar ( const CSG_String & Field ) const

Definition at line 477 of file table_record.cpp.

References _Get_Field(), and asChar().

◆ asChar() [3/4]

SG_Char CSG_Table_Record::asChar ( const wchar_t * Field ) const
inline

Definition at line 210 of file table.h.

◆ asChar() [4/4]

SG_Char CSG_Table_Record::asChar ( int Field ) const

Definition at line 472 of file table_record.cpp.

References asInt(), and SG_Char.

Referenced by asChar().

◆ asDouble() [1/4]

double CSG_Table_Record::asDouble ( const char * Field ) const
inline

Definition at line 234 of file table.h.

References asDouble().

Referenced by asDouble().

◆ asDouble() [2/4]

double CSG_Table_Record::asDouble ( const CSG_String & Field ) const

Definition at line 532 of file table_record.cpp.

References _Get_Field(), and asDouble().

◆ asDouble() [3/4]

double CSG_Table_Record::asDouble ( const wchar_t * Field ) const
inline

Definition at line 235 of file table.h.

References asDouble().

Referenced by asDouble().

◆ asDouble() [4/4]

double CSG_Table_Record::asDouble ( int Field ) const

Definition at line 527 of file table_record.cpp.

References m_Values.

Referenced by CSG_Regression_Multiple::_Set_Step_Info(), CSG_Table::_Stats_Update(), CSG_PointCloud::Add_Shape(), Add_Value(), asDouble(), CSG_Category_Statistics::asDouble(), asFloat(), CSG_Natural_Breaks::Create(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_PRQuadTree::Create(), CSG_Histogram::Create(), CSG_Regression_Multiple::Get_CV_NRMSE(), CSG_Regression_Multiple::Get_CV_R2(), CSG_Regression_Multiple::Get_CV_RMSE(), CSG_Regression_Multiple::Get_F(), CSG_TIN_Node::Get_Gradient(), CSG_TIN_Triangle::Get_Gradient(), CSG_Regression_Multiple::Get_Info(), CSG_Regression_Multiple::Get_P(), CSG_Regression_Multiple::Get_Parameter(), CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), CSG_Regression_Multiple::Get_R2(), CSG_Regression_Multiple::Get_R2_Adj(), CSG_Regression_Multiple::Get_RConst(), CSG_Regression_Multiple::Get_StdError(), CSG_TIN_Triangle::Get_Value(), CSG_Table::Get_Value(), CSG_Grid_Cell_Addressor::Get_Values(), Mul_Value(), and CSG_Table_DBase::Open_Write().

◆ asFloat() [1/4]

float CSG_Table_Record::asFloat ( const char * Field ) const
inline

Definition at line 229 of file table.h.

◆ asFloat() [2/4]

float CSG_Table_Record::asFloat ( const CSG_String & Field ) const

Definition at line 521 of file table_record.cpp.

References _Get_Field(), and asFloat().

◆ asFloat() [3/4]

float CSG_Table_Record::asFloat ( const wchar_t * Field ) const
inline

Definition at line 230 of file table.h.

◆ asFloat() [4/4]

float CSG_Table_Record::asFloat ( int iField ) const

Definition at line 516 of file table_record.cpp.

References asDouble().

Referenced by asFloat().

◆ asInt() [1/4]

int CSG_Table_Record::asInt ( const char * Field ) const
inline

Definition at line 219 of file table.h.

◆ asInt() [2/4]

int CSG_Table_Record::asInt ( const CSG_String & Field ) const

Definition at line 499 of file table_record.cpp.

References _Get_Field(), and asInt().

◆ asInt() [3/4]

int CSG_Table_Record::asInt ( const wchar_t * Field ) const
inline

Definition at line 220 of file table.h.

◆ asInt() [4/4]

int CSG_Table_Record::asInt ( int Field ) const

Definition at line 494 of file table_record.cpp.

References m_Values.

Referenced by asChar(), asInt(), CSG_Category_Statistics::asInt(), asShort(), CSG_Projections::EPSG_to_Proj4(), CSG_Projections::EPSG_to_WKT(), CSG_Category_Statistics::Get_Count(), CSG_Regression_Multiple::Get_CV_nSamples(), CSG_Regression_Multiple::Get_Info(), CSG_Category_Statistics::Get_Majority(), CSG_Category_Statistics::Get_Minority(), CSG_Projections::Get_Names_List(), CSG_Regression_Multiple::Get_nPredictors(), CSG_Regression_Multiple::Get_nSamples(), CSG_Projections::Get_Projection(), and CSG_Grid_Cell_Addressor::Get_Values().

◆ asLong() [1/4]

sLong CSG_Table_Record::asLong ( const char * Field ) const
inline

Definition at line 224 of file table.h.

◆ asLong() [2/4]

sLong CSG_Table_Record::asLong ( const CSG_String & Field ) const

Definition at line 510 of file table_record.cpp.

References _Get_Field(), and asLong().

◆ asLong() [3/4]

sLong CSG_Table_Record::asLong ( const wchar_t * Field ) const
inline

Definition at line 225 of file table.h.

◆ asLong() [4/4]

sLong CSG_Table_Record::asLong ( int Field ) const

Definition at line 505 of file table_record.cpp.

References m_Values.

Referenced by asLong().

◆ asShort() [1/4]

short CSG_Table_Record::asShort ( const char * Field ) const
inline

Definition at line 214 of file table.h.

◆ asShort() [2/4]

short CSG_Table_Record::asShort ( const CSG_String & Field ) const

Definition at line 488 of file table_record.cpp.

References _Get_Field(), and asShort().

◆ asShort() [3/4]

short CSG_Table_Record::asShort ( const wchar_t * Field ) const
inline

Definition at line 215 of file table.h.

◆ asShort() [4/4]

short CSG_Table_Record::asShort ( int Field ) const

Definition at line 483 of file table_record.cpp.

References asInt().

Referenced by asShort().

◆ Assign()

bool CSG_Table_Record::Assign ( CSG_Table_Record * pRecord )
virtual

Reimplemented in CSG_Shape.

Definition at line 543 of file table_record.cpp.

References CSG_Table::Get_Field_Count(), m_pTable, m_Values, and Set_Modified().

Referenced by CSG_Shape::Assign(), CSG_Table::Assign_Values(), and CSG_Table::Ins_Record().

◆ asString() [1/4]

const SG_Char* CSG_Table_Record::asString | ( | const char * | Field,
 |  | int | Decimals = -99
 | ) |  | const
 inline

Definition at line 204 of file table.h.

References asString().

Referenced by asString().

◆ asString() [2/4]

const SG_Char * CSG_Table_Record::asString | ( | const CSG_String & | Field,
 |  | int | Decimals = -99
 | ) |  | const

Definition at line 466 of file table_record.cpp.

References _Get_Field(), and asString().

◆ asString() [3/4]

const SG_Char* CSG_Table_Record::asString | ( | const wchar_t * | Field,
 |  | int | Decimals = -99
 | ) |  | const
 inline

Definition at line 205 of file table.h.

References asString().

Referenced by asString().

◆ asString() [4/4]

const SG_Char * CSG_Table_Record::asString | ( | int | Field,
 |  | int | Decimals = -99
 | ) |  | const

Definition at line 461 of file table_record.cpp.

References m_Values.

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_PointCloud::Add_Shape(), asString(), CSG_Category_Statistics::asString(), CSG_Translator::Create(), CSG_Projections::EPSG_to_Proj4(), CSG_Projections::EPSG_to_WKT(), CSG_Table::Find_Record(), CSG_Regression_Multiple::Get_Info(), CSG_Regression_Multiple::Get_Name(), CSG_Projections::Get_Names_List(), CSG_Projections::Get_Projection(), CSG_Table::Get_Value(), is_NoData(), CSG_Parameter::is_Value_Equal(), and CSG_Table_DBase::Open_Write().

◆ Get_Index()

sLong CSG_Table_Record::Get_Index ( void ) const
inline

Definition at line 136 of file table.h.

Referenced by CSG_TIN::Assign(), CSG_Shapes::Del_Shape(), CSG_Table::Find_Record(), CSG_Category_Statistics::Get_Category(), and CSG_Table::Select().

◆ Get_Table()

class CSG_Table* CSG_Table_Record::Get_Table ( void )
inline

Definition at line 135 of file table.h.

Referenced by CSG_Shape_Part::_Alloc_Memory(), CSG_PointCloud::Add_Shape(), and CSG_Shape::Assign().

◆ Get_Value()

CSG_Table_Value* CSG_Table_Record::Get_Value ( int Field )
inline

Definition at line 237 of file table.h.

Referenced by CSG_Table::Mov_Field().

◆ is_Modified()

bool CSG_Table_Record::is_Modified ( void ) const
inline

Definition at line 243 of file table.h.

References SG_TABLE_REC_FLAG_Modified.

Referenced by Set_Modified().

◆ is_NoData() [1/4]

bool CSG_Table_Record::is_NoData ( const char * Field ) const
inline

Definition at line 199 of file table.h.

References is_NoData().

Referenced by is_NoData().

◆ is_NoData() [2/4]

bool CSG_Table_Record::is_NoData ( const CSG_String & Field ) const

Definition at line 450 of file table_record.cpp.

References _Get_Field(), and is_NoData().

◆ is_NoData() [3/4]

bool CSG_Table_Record::is_NoData ( const wchar_t * Field ) const
inline

Definition at line 200 of file table.h.

References is_NoData().

Referenced by is_NoData().

◆ is_NoData() [4/4]

bool CSG_Table_Record::is_NoData ( int Field ) const

Definition at line 416 of file table_record.cpp.

References CSG_Table_Value::asDouble(), CSG_Table_Value::asInt(), asString(), CSG_Table::Get_Field_Type(), CSG_Data_Object::is_NoData_Value(), m_pTable, m_Values, SG_DATATYPE_Binary, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by CSG_Table::_Stats_Update(), CSG_Natural_Breaks::Create(), CSG_Translator::Create(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), is_NoData(), and CSG_Table_DBase::Open_Write().

◆ is_Selected()

bool CSG_Table_Record::is_Selected ( void ) const
inline

Definition at line 242 of file table.h.

References SG_TABLE_REC_FLAG_Selected.

Referenced by CSG_Table::Inv_Selection(), CSG_Table::Select(), Set_Selected(), and ~CSG_Table_Record().

◆ Mul_Value() [1/4]

bool CSG_Table_Record::Mul_Value | ( | const char * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 189 of file table.h.

References Mul_Value().

Referenced by Mul_Value().

◆ Mul_Value() [2/4]

bool CSG_Table_Record::Mul_Value | ( | const CSG_String & | Field,
 |  | double | Value
 | ) |  |

Definition at line 355 of file table_record.cpp.

References _Get_Field(), and Mul_Value().

◆ Mul_Value() [3/4]

bool CSG_Table_Record::Mul_Value | ( | const wchar_t * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 190 of file table.h.

References Mul_Value().

Referenced by Mul_Value().

◆ Mul_Value() [4/4]

bool CSG_Table_Record::Mul_Value | ( | int | Field,
 |  | double | Value
 | ) |  |

Definition at line 345 of file table_record.cpp.

References asDouble(), and Set_Value().

Referenced by Mul_Value().

◆ operator[]()

CSG_Table_Value& CSG_Table_Record::operator[] ( int Field ) const
inline

Definition at line 238 of file table.h.

◆ Set_Modified()

void CSG_Table_Record::Set_Modified ( bool bOn = true )
protected

Definition at line 220 of file table_record.cpp.

References is_Modified(), m_Flags, m_pTable, CSG_Table::Set_Modified(), and SG_TABLE_REC_FLAG_Modified.

Referenced by CSG_Shape::_Invalidate(), Assign(), CSG_Table::Set_Field_Type(), CSG_Table::Set_Modified(), Set_NoData(), and Set_Value().

◆ Set_NoData() [1/4]

bool CSG_Table_Record::Set_NoData ( const char * Field )
inline

Definition at line 194 of file table.h.

References Set_NoData().

Referenced by Set_NoData().

◆ Set_NoData() [2/4]

bool CSG_Table_Record::Set_NoData ( const CSG_String & Field )

Definition at line 410 of file table_record.cpp.

References _Get_Field(), and Set_NoData().

◆ Set_NoData() [3/4]

bool CSG_Table_Record::Set_NoData ( const wchar_t * Field )
inline

Definition at line 195 of file table.h.

References Set_NoData().

Referenced by Set_NoData().

◆ Set_NoData() [4/4]

bool CSG_Table_Record::Set_NoData ( int Field )

Definition at line 366 of file table_record.cpp.

References CSG_Table::_Stats_Invalidate(), CSG_Table_Value::asBinary(), CSG_Bytes::Destroy(), CSG_Table::Get_Field_Type(), CSG_Data_Object::Get_NoData_Value(), m_pTable, m_Values, Set_Modified(), CSG_Data_Object::Set_Update_Flag(), Set_Value(), SG_DATATYPE_Binary, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Word, and SG_T.

Referenced by CSG_Regression_Multiple::_Initialize(), CSG_Regression_Multiple::Destroy(), CSG_Table_DBase::Open_Read(), and Set_NoData().

◆ Set_Selected()

void CSG_Table_Record::Set_Selected ( bool bOn = true )
protected

Definition at line 204 of file table_record.cpp.

References is_Selected(), m_Flags, and SG_TABLE_REC_FLAG_Selected.

Referenced by CSG_Table::Del_Selection(), CSG_Table::Inv_Selection(), and CSG_Table::Select().

◆ Set_Value() [1/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | const char * | Value
 | ) |  |
inline

Definition at line 144 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [2/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | const CSG_Bytes & | Value
 | ) |  |
inline

Definition at line 149 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [3/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | const CSG_String & | Value
 | ) |  |
inline

Definition at line 142 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [4/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 154 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [5/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | DWORD | Value
 | ) |  |
inline

Definition at line 169 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [6/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | int | Value
 | ) |  |
inline

Definition at line 179 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [7/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | long | Value
 | ) |  |
inline

Definition at line 174 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [8/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | size_t | Value
 | ) |  |
inline

Definition at line 164 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [9/36]

bool CSG_Table_Record::Set_Value | ( | const char * | Field,
 |  | sLong | Value
 | ) |  |
inline

Definition at line 159 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [10/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | const CSG_Bytes & | Value
 | ) |  |

Definition at line 264 of file table_record.cpp.

References _Get_Field(), and Set_Value().

◆ Set_Value() [11/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 288 of file table_record.cpp.

References _Get_Field(), and Set_Value().

◆ Set_Value() [12/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | double | Value
 | ) |  |

Definition at line 323 of file table_record.cpp.

References _Get_Field(), and Set_Value().

◆ Set_Value() [13/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | DWORD | Value
 | ) |  |
inline

Definition at line 168 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [14/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | int | Value
 | ) |  |
inline

Definition at line 178 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [15/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | long | Value
 | ) |  |
inline

Definition at line 173 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [16/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | size_t | Value
 | ) |  |
inline

Definition at line 163 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [17/36]

bool CSG_Table_Record::Set_Value | ( | const CSG_String & | Field,
 |  | sLong | Value
 | ) |  |

Definition at line 299 of file table_record.cpp.

References Set_Value().

◆ Set_Value() [18/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | const CSG_Bytes & | Value
 | ) |  |
inline

Definition at line 150 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [19/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | const CSG_String & | Value
 | ) |  |
inline

Definition at line 143 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [20/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | const wchar_t * | Value
 | ) |  |
inline

Definition at line 145 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [21/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | double | Value
 | ) |  |
inline

Definition at line 155 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [22/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | DWORD | Value
 | ) |  |
inline

Definition at line 170 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [23/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | int | Value
 | ) |  |
inline

Definition at line 180 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [24/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | long | Value
 | ) |  |
inline

Definition at line 175 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [25/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | size_t | Value
 | ) |  |
inline

Definition at line 165 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [26/36]

bool CSG_Table_Record::Set_Value | ( | const wchar_t * | Field,
 |  | sLong | Value
 | ) |  |
inline

Definition at line 160 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [27/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | const char * | Value
 | ) |  |
inline

Definition at line 139 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [28/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | const CSG_Bytes & | Value
 | ) |  |

Definition at line 246 of file table_record.cpp.

References CSG_Table::_Stats_Invalidate(), m_pTable, m_Values, Set_Modified(), CSG_Data_Object::Set_Update_Flag(), and Set_Value().

◆ Set_Value() [29/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 270 of file table_record.cpp.

References CSG_Table::_Stats_Invalidate(), m_pTable, m_Values, Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Parameter_Fixed_Table::_Serialize(), CSG_Regression_Multiple::_Set_Step_Info(), CSG_Projections::Add(), Add_Value(), CSG_Translator::Create(), CSG_Regression_Multiple::CSG_Regression_Multiple(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_MetaData::Get_Table(), Mul_Value(), CSG_Table_DBase::Open_Read(), CSG_Table::Serialize(), Set_NoData(), Set_Value(), and CSG_Table::Set_Value().

◆ Set_Value() [30/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | const wchar_t * | Value
 | ) |  |
inline

Definition at line 140 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [31/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | double | Value
 | ) |  |

Definition at line 305 of file table_record.cpp.

References CSG_Table::_Stats_Invalidate(), m_pTable, m_Values, Set_Modified(), CSG_Data_Object::Set_Update_Flag(), and Set_Value().

◆ Set_Value() [32/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | DWORD | Value
 | ) |  |
inline

Definition at line 167 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [33/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | int | Value
 | ) |  |
inline

Definition at line 177 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [34/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | long | Value
 | ) |  |
inline

Definition at line 172 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [35/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | size_t | Value
 | ) |  |
inline

Definition at line 162 of file table.h.

References Set_Value().

Referenced by Set_Value().

◆ Set_Value() [36/36]

bool CSG_Table_Record::Set_Value | ( | int | Field,
 |  | sLong | Value
 | ) |  |

Definition at line 294 of file table_record.cpp.

References Set_Value().

Friends And Related Function Documentation

◆ CSG_PointCloud

friend class CSG_PointCloud
friend

Definition at line 131 of file table.h.

◆ CSG_Table

friend class CSG_Table
friend

Definition at line 131 of file table.h.

Member Data Documentation

◆ m_Flags

char CSG_Table_Record::m_Flags
protected

Definition at line 252 of file table.h.

Referenced by CSG_Table_Record(), Set_Modified(), and Set_Selected().

◆ m_Index

sLong CSG_Table_Record::m_Index
protected

Definition at line 254 of file table.h.

Referenced by CSG_Table_Record(), CSG_Table::Del_Record(), CSG_Table::Ins_Record(), and ~CSG_Table_Record().

◆ m_pTable

class CSG_Table* CSG_Table_Record::m_pTable
protected

Definition at line 258 of file table.h.

Referenced by _Add_Field(), _Del_Field(), _Get_Field(), CSG_Shape::_Invalidate(), Assign(), CSG_Table_Record(), CSG_Shape::Get_Type(), CSG_Shape::Get_Vertex_Type(), is_NoData(), Set_Modified(), Set_NoData(), Set_Value(), and ~CSG_Table_Record().

◆ m_Values

class CSG_Table_Value** CSG_Table_Record::m_Values
protected

Definition at line 256 of file table.h.

Referenced by _Add_Field(), _Del_Field(), asDouble(), asInt(), asLong(), Assign(), asString(), CSG_Table_Record(), is_NoData(), CSG_Table::Set_Field_Type(), Set_NoData(), Set_Value(), and ~CSG_Table_Record().

The documentation for this class was generated from the following files:
  • table.h
  • table_record.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Record Member List

This is the complete list of members for CSG_Table_Record, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Table_Record | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_PointCloud class | CSG_Table_Record | friend
CSG_Table class | CSG_Table_Record | friend
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
Get_Index(void) const | CSG_Table_Record | inline
Get_Table(void) | CSG_Table_Record | inline
Get_Value(int Field) | CSG_Table_Record | inline
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
operator[](int Field) const | CSG_Table_Record | inline
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value Class Reference

Public Member Functions | List of all members
CSG_Table_Value Class Referenceabstract

#include <table_value.h>

Inheritance diagram for CSG_Table_Value:
CSG_Table_Value_Binary CSG_Table_Value_Date CSG_Table_Value_Double CSG_Table_Value_Int CSG_Table_Value_Long CSG_Table_Value_String

Public Member Functions

CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual TSG_Table_Value_Type | Get_Type (void) const =0
virtual bool | Set_Value (const CSG_Bytes &Value)=0
virtual bool | Set_Value (const SG_Char *Value)=0
virtual bool | Set_Value (int Value)=0
virtual bool | Set_Value (sLong Value)=0
virtual bool | Set_Value (double Value)=0
virtual CSG_Bytes | asBinary (void) const
virtual const SG_Char * | asString (int Decimals=-99) const =0
virtual int | asInt (void) const =0
virtual sLong | asLong (void) const =0
virtual double | asDouble (void) const =0
virtual bool | is_Equal (const CSG_Table_Value &Value) const =0
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)=0

Detailed Description

Definition at line 110 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value()

CSG_Table_Value::CSG_Table_Value ( void )
inline

Definition at line 113 of file table_value.h.

◆ ~CSG_Table_Value()

virtual CSG_Table_Value::~CSG_Table_Value ( void )
inlinevirtual

Definition at line 114 of file table_value.h.

Member Function Documentation

◆ asBinary()

virtual CSG_Bytes CSG_Table_Value::asBinary ( void ) const
inlinevirtual

Reimplemented in CSG_Table_Value_Binary.

Definition at line 126 of file table_value.h.

References asString(), SG_Char, and SG_STR_LEN.

Referenced by CSG_Table_Value_Binary::operator=(), and CSG_Table_Record::Set_NoData().

◆ asDouble()

virtual double CSG_Table_Value::asDouble ( void ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by CSG_Table_Value_Date::is_Equal(), CSG_Table_Value_Double::is_Equal(), CSG_Table_Record::is_NoData(), operator double(), CSG_Table_Value_Date::operator=(), and CSG_Table_Value_Double::operator=().

◆ asInt()

virtual int CSG_Table_Value::asInt ( void ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by CSG_Table_Value_Int::is_Equal(), CSG_Table_Record::is_NoData(), and CSG_Table_Value_Int::operator=().

◆ asLong()

virtual sLong CSG_Table_Value::asLong ( void ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by CSG_Table_Value_Long::is_Equal(), and CSG_Table_Value_Long::operator=().

◆ asString()

virtual const SG_Char* CSG_Table_Value::asString ( int Decimals = -99 ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by asBinary(), CSG_Table_Value_Binary::is_Equal(), CSG_Table_Value_String::is_Equal(), operator const SG_Char *(), CSG_Table_Value_String::operator=(), and CSG_Table_Value_Date::operator=().

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value::Get_Type ( void ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by CSG_Table_Value_Date::operator=().

◆ is_Equal()

virtual bool CSG_Table_Value::is_Equal ( const CSG_Table_Value & Value ) const
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by operator==().

◆ operator const SG_Char *()

CSG_Table_Value::operator const SG_Char * ( void ) const
inline

Definition at line 143 of file table_value.h.

References asString().

◆ operator double()

CSG_Table_Value::operator double ( void ) const
inline

Definition at line 144 of file table_value.h.

References asDouble().

◆ operator=() [1/3]

virtual CSG_Table_Value& CSG_Table_Value::operator= ( const CSG_Table_Value & Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

◆ operator=() [2/3]

virtual CSG_Table_Value& CSG_Table_Value::operator= ( const SG_Char * Value )
inlinevirtual

Definition at line 147 of file table_value.h.

References Set_Value().

◆ operator=() [3/3]

virtual CSG_Table_Value& CSG_Table_Value::operator= ( double Value )
inlinevirtual

Definition at line 148 of file table_value.h.

References Set_Value().

◆ operator==()

bool CSG_Table_Value::operator== ( const CSG_Table_Value & Value ) const
inline

Definition at line 140 of file table_value.h.

References is_Equal().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value::Set_Value ( const CSG_Bytes & Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

Referenced by operator=().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value::Set_Value ( const SG_Char * Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value::Set_Value ( double Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value::Set_Value ( int Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value::Set_Value ( sLong Value )
pure virtual

Implemented in CSG_Table_Value_Double, CSG_Table_Value_Long, CSG_Table_Value_Int, CSG_Table_Value_Date, CSG_Table_Value_String, and CSG_Table_Value_Binary.

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value Member List

This is the complete list of members for CSG_Table_Value, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const =0 | CSG_Table_Value | pure virtual
asInt(void) const =0 | CSG_Table_Value | pure virtual
asLong(void) const =0 | CSG_Table_Value | pure virtual
asString(int Decimals=-99) const =0 | CSG_Table_Value | pure virtual
CSG_Table_Value(void) | CSG_Table_Value | inline
Get_Type(void) const =0 | CSG_Table_Value | pure virtual
is_Equal(const CSG_Table_Value &Value) const =0 | CSG_Table_Value | pure virtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
operator=(double Value) | CSG_Table_Value | inlinevirtual
operator=(const CSG_Table_Value &Value)=0 | CSG_Table_Value | pure virtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value)=0 | CSG_Table_Value | pure virtual
Set_Value(const SG_Char *Value)=0 | CSG_Table_Value | pure virtual
Set_Value(int Value)=0 | CSG_Table_Value | pure virtual
Set_Value(sLong Value)=0 | CSG_Table_Value | pure virtual
Set_Value(double Value)=0 | CSG_Table_Value | pure virtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_Binary Class Reference

Public Member Functions | List of all members
CSG_Table_Value_Binary Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_Binary:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_Binary (void)
virtual | ~CSG_Table_Value_Binary (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual bool | Set_NoData (void)
virtual bool | is_NoData (void) const
virtual CSG_Bytes | asBinary (void) const
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
CSG_Bytes & | Get_Binary (void)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 159 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_Binary()

CSG_Table_Value_Binary::CSG_Table_Value_Binary ( void )
inline

Definition at line 162 of file table_value.h.

◆ ~CSG_Table_Value_Binary()

virtual CSG_Table_Value_Binary::~CSG_Table_Value_Binary ( void )
inlinevirtual

Definition at line 163 of file table_value.h.

Member Function Documentation

◆ asBinary()

virtual CSG_Bytes CSG_Table_Value_Binary::asBinary ( void ) const
inlinevirtual

Reimplemented from CSG_Table_Value.

Definition at line 198 of file table_value.h.

◆ asDouble()

virtual double CSG_Table_Value_Binary::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 202 of file table_value.h.

◆ asInt()

virtual int CSG_Table_Value_Binary::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 200 of file table_value.h.

References CSG_Bytes::Get_Count().

◆ asLong()

virtual sLong CSG_Table_Value_Binary::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 201 of file table_value.h.

References CSG_Bytes::Get_Count().

◆ asString()

virtual const SG_Char* CSG_Table_Value_Binary::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 199 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by is_Equal().

◆ Get_Binary()

CSG_Bytes& CSG_Table_Value_Binary::Get_Binary ( void )
inline

Definition at line 214 of file table_value.h.

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_Binary::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 165 of file table_value.h.

References SG_TABLE_VALUE_TYPE_Binary.

◆ is_Equal()

virtual bool CSG_Table_Value_Binary::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 205 of file table_value.h.

References asString(), CSG_Table_Value::asString(), and SG_STR_CMP.

◆ is_NoData()

virtual bool CSG_Table_Value_Binary::is_NoData ( void ) const
inlinevirtual

Definition at line 195 of file table_value.h.

References CSG_Bytes::Get_Count().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_Binary::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 211 of file table_value.h.

References CSG_Table_Value::asBinary(), and Set_Value().

◆ Set_NoData()

virtual bool CSG_Table_Value_Binary::Set_NoData ( void )
inlinevirtual

Definition at line 194 of file table_value.h.

References CSG_Bytes::Destroy().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_Binary::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 168 of file table_value.h.

References CSG_Bytes::Create().

Referenced by operator=().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_Binary::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 173 of file table_value.h.

References CSG_Bytes::Create(), SG_Char, and SG_STR_LEN.

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_Binary::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 188 of file table_value.h.

References CSG_Bytes::Create().

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_Binary::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 178 of file table_value.h.

References CSG_Bytes::Create().

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_Binary::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 183 of file table_value.h.

References CSG_Bytes::Create().

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_Binary Member List

This is the complete list of members for CSG_Table_Value_Binary, including all inherited members.

asBinary(void) const | CSG_Table_Value_Binary | inlinevirtual
asDouble(void) const | CSG_Table_Value_Binary | inlinevirtual
asInt(void) const | CSG_Table_Value_Binary | inlinevirtual
asLong(void) const | CSG_Table_Value_Binary | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_Binary | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_Binary(void) | CSG_Table_Value_Binary | inline
Get_Binary(void) | CSG_Table_Value_Binary | inline
Get_Type(void) const | CSG_Table_Value_Binary | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_Binary | inlinevirtual
is_NoData(void) const | CSG_Table_Value_Binary | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_Binary | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_NoData(void) | CSG_Table_Value_Binary | inlinevirtual
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_Binary | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_Binary | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_Binary | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_Binary | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_Binary | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_Binary(void) | CSG_Table_Value_Binary | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_Date Class Reference

Public Member Functions | List of all members
CSG_Table_Value_Date Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_Date:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_Date (void)
virtual | ~CSG_Table_Value_Date (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual CSG_Bytes | asBinary (void) const
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 298 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_Date()

CSG_Table_Value_Date::CSG_Table_Value_Date ( void )
inline

Definition at line 301 of file table_value.h.

◆ ~CSG_Table_Value_Date()

virtual CSG_Table_Value_Date::~CSG_Table_Value_Date ( void )
inlinevirtual

Definition at line 302 of file table_value.h.

Member Function Documentation

◆ asDouble()

virtual double CSG_Table_Value_Date::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 344 of file table_value.h.

◆ asInt()

virtual int CSG_Table_Value_Date::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 342 of file table_value.h.

◆ asLong()

virtual sLong CSG_Table_Value_Date::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 343 of file table_value.h.

◆ asString()

virtual const SG_Char* CSG_Table_Value_Date::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 341 of file table_value.h.

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_Date::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 304 of file table_value.h.

References SG_TABLE_VALUE_TYPE_Date.

◆ is_Equal()

virtual bool CSG_Table_Value_Date::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 347 of file table_value.h.

References CSG_Table_Value::asDouble().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_Date::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 353 of file table_value.h.

References CSG_Table_Value::asDouble(), CSG_Table_Value::asString(), CSG_Table_Value::Get_Type(), Set_Value(), SG_TABLE_VALUE_TYPE_Binary, and SG_TABLE_VALUE_TYPE_String.

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_Date::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 307 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by operator=(), and Set_Value().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_Date::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 312 of file table_value.h.

References Set_Value(), and SG_Date_To_JulianDayNumber().

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_Date::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 327 of file table_value.h.

References SG_JulianDayNumber_To_Date().

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_Date::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 317 of file table_value.h.

References Set_Value().

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_Date::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 322 of file table_value.h.

References Set_Value().

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_Date Member List

This is the complete list of members for CSG_Table_Value_Date, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const | CSG_Table_Value_Date | inlinevirtual
asInt(void) const | CSG_Table_Value_Date | inlinevirtual
asLong(void) const | CSG_Table_Value_Date | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_Date | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_Date(void) | CSG_Table_Value_Date | inline
Get_Type(void) const | CSG_Table_Value_Date | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_Date | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_Date | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_Date | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_Date | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_Date | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_Date | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_Date | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_Date(void) | CSG_Table_Value_Date | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_Double Class Reference

Public Member Functions | List of all members
CSG_Table_Value_Double Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_Double:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_Double (void)
virtual | ~CSG_Table_Value_Double (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual CSG_Bytes | asBinary (void) const
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 543 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_Double()

CSG_Table_Value_Double::CSG_Table_Value_Double ( void )
inline

Definition at line 546 of file table_value.h.

◆ ~CSG_Table_Value_Double()

virtual CSG_Table_Value_Double::~CSG_Table_Value_Double ( void )
inlinevirtual

Definition at line 547 of file table_value.h.

Member Function Documentation

◆ asDouble()

virtual double CSG_Table_Value_Double::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 599 of file table_value.h.

◆ asInt()

virtual int CSG_Table_Value_Double::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 597 of file table_value.h.

◆ asLong()

virtual sLong CSG_Table_Value_Double::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 598 of file table_value.h.

◆ asString()

virtual const SG_Char* CSG_Table_Value_Double::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 588 of file table_value.h.

References CSG_String::c_str(), and SG_Get_String().

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_Double::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 549 of file table_value.h.

References SG_TABLE_VALUE_TYPE_Double.

◆ is_Equal()

virtual bool CSG_Table_Value_Double::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 602 of file table_value.h.

References CSG_Table_Value::asDouble().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_Double::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 608 of file table_value.h.

References CSG_Table_Value::asDouble(), and Set_Value().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_Double::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 552 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by operator=(), and Set_Value().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_Double::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 557 of file table_value.h.

References CSG_String::asDouble(), and Set_Value().

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_Double::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 575 of file table_value.h.

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_Double::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 565 of file table_value.h.

References Set_Value().

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_Double::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 570 of file table_value.h.

References Set_Value().

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_Double Member List

This is the complete list of members for CSG_Table_Value_Double, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const | CSG_Table_Value_Double | inlinevirtual
asInt(void) const | CSG_Table_Value_Double | inlinevirtual
asLong(void) const | CSG_Table_Value_Double | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_Double | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_Double(void) | CSG_Table_Value_Double | inline
Get_Type(void) const | CSG_Table_Value_Double | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_Double | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_Double | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_Double | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_Double | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_Double | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_Double | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_Double | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_Double(void) | CSG_Table_Value_Double | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_Int Class Reference

Public Member Functions | List of all members
CSG_Table_Value_Int Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_Int:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_Int (void)
virtual | ~CSG_Table_Value_Int (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual CSG_Bytes | asBinary (void) const
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 383 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_Int()

CSG_Table_Value_Int::CSG_Table_Value_Int ( void )
inline

Definition at line 386 of file table_value.h.

◆ ~CSG_Table_Value_Int()

virtual CSG_Table_Value_Int::~CSG_Table_Value_Int ( void )
inlinevirtual

Definition at line 387 of file table_value.h.

Member Function Documentation

◆ asDouble()

virtual double CSG_Table_Value_Int::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 439 of file table_value.h.

◆ asInt()

virtual int CSG_Table_Value_Int::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 437 of file table_value.h.

◆ asLong()

virtual sLong CSG_Table_Value_Int::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 438 of file table_value.h.

◆ asString()

virtual const SG_Char* CSG_Table_Value_Int::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 428 of file table_value.h.

References CSG_String::c_str(), and CSG_String::Printf().

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_Int::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 389 of file table_value.h.

References SG_TABLE_VALUE_TYPE_Int.

◆ is_Equal()

virtual bool CSG_Table_Value_Int::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 442 of file table_value.h.

References CSG_Table_Value::asInt().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_Int::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 448 of file table_value.h.

References CSG_Table_Value::asInt(), and Set_Value().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_Int::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 392 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by operator=(), and Set_Value().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_Int::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 397 of file table_value.h.

References CSG_String::asInt(), and Set_Value().

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_Int::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 422 of file table_value.h.

References Set_Value().

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_Int::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 405 of file table_value.h.

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_Int::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 417 of file table_value.h.

References Set_Value().

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_Int Member List

This is the complete list of members for CSG_Table_Value_Int, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const | CSG_Table_Value_Int | inlinevirtual
asInt(void) const | CSG_Table_Value_Int | inlinevirtual
asLong(void) const | CSG_Table_Value_Int | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_Int | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_Int(void) | CSG_Table_Value_Int | inline
Get_Type(void) const | CSG_Table_Value_Int | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_Int | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_Int | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_Int | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_Int | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_Int | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_Int | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_Int | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_Int(void) | CSG_Table_Value_Int | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_Long Class Reference

Public Member Functions | List of all members
CSG_Table_Value_Long Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_Long:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_Long (void)
virtual | ~CSG_Table_Value_Long (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual CSG_Bytes | asBinary (void) const
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 463 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_Long()

CSG_Table_Value_Long::CSG_Table_Value_Long ( void )
inline

Definition at line 466 of file table_value.h.

◆ ~CSG_Table_Value_Long()

virtual CSG_Table_Value_Long::~CSG_Table_Value_Long ( void )
inlinevirtual

Definition at line 467 of file table_value.h.

Member Function Documentation

◆ asDouble()

virtual double CSG_Table_Value_Long::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 519 of file table_value.h.

◆ asInt()

virtual int CSG_Table_Value_Long::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 517 of file table_value.h.

◆ asLong()

virtual sLong CSG_Table_Value_Long::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 518 of file table_value.h.

◆ asString()

virtual const SG_Char* CSG_Table_Value_Long::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 508 of file table_value.h.

References CSG_String::c_str(), and CSG_String::Printf().

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_Long::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 469 of file table_value.h.

References SG_TABLE_VALUE_TYPE_Long.

◆ is_Equal()

virtual bool CSG_Table_Value_Long::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 522 of file table_value.h.

References CSG_Table_Value::asLong().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_Long::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 528 of file table_value.h.

References CSG_Table_Value::asLong(), and Set_Value().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_Long::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 472 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by operator=(), and Set_Value().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_Long::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 477 of file table_value.h.

References CSG_String::asInt(), and Set_Value().

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_Long::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 502 of file table_value.h.

References Set_Value().

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_Long::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 485 of file table_value.h.

References Set_Value().

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_Long::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 490 of file table_value.h.

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_Long Member List

This is the complete list of members for CSG_Table_Value_Long, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const | CSG_Table_Value_Long | inlinevirtual
asInt(void) const | CSG_Table_Value_Long | inlinevirtual
asLong(void) const | CSG_Table_Value_Long | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_Long | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_Long(void) | CSG_Table_Value_Long | inline
Get_Type(void) const | CSG_Table_Value_Long | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_Long | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_Long | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_Long | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_Long | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_Long | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_Long | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_Long | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_Long(void) | CSG_Table_Value_Long | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Table_Value_String Class Reference

Public Member Functions | List of all members
CSG_Table_Value_String Class Reference

#include <table_value.h>

Inheritance diagram for CSG_Table_Value_String:
CSG_Table_Value

Public Member Functions

CSG_Table_Value_String (void)
virtual | ~CSG_Table_Value_String (void)
virtual TSG_Table_Value_Type | Get_Type (void) const
virtual bool | Set_Value (const CSG_Bytes &Value)
virtual bool | Set_Value (const SG_Char *Value)
virtual bool | Set_Value (int Value)
virtual bool | Set_Value (sLong Value)
virtual bool | Set_Value (double Value)
virtual const SG_Char * | asString (int Decimals=-99) const
virtual int | asInt (void) const
virtual sLong | asLong (void) const
virtual double | asDouble (void) const
virtual bool | is_Equal (const CSG_Table_Value &Value) const
virtual CSG_Table_Value & | operator= (const CSG_Table_Value &Value)
- Public Member Functions inherited from CSG_Table_Value
CSG_Table_Value (void)
virtual | ~CSG_Table_Value (void)
virtual CSG_Bytes | asBinary (void) const
bool | operator== (const CSG_Table_Value &Value) const
operator const SG_Char * (void) const
operator double (void) const
virtual CSG_Table_Value & | operator= (const SG_Char *Value)
virtual CSG_Table_Value & | operator= (double Value)

Detailed Description

Definition at line 229 of file table_value.h.

Constructor & Destructor Documentation

◆ CSG_Table_Value_String()

CSG_Table_Value_String::CSG_Table_Value_String ( void )
inline

Definition at line 232 of file table_value.h.

◆ ~CSG_Table_Value_String()

virtual CSG_Table_Value_String::~CSG_Table_Value_String ( void )
inlinevirtual

Definition at line 233 of file table_value.h.

Member Function Documentation

◆ asDouble()

virtual double CSG_Table_Value_String::asDouble ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 274 of file table_value.h.

References CSG_String::asDouble().

◆ asInt()

virtual int CSG_Table_Value_String::asInt ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 272 of file table_value.h.

References CSG_String::asInt().

◆ asLong()

virtual sLong CSG_Table_Value_String::asLong ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 273 of file table_value.h.

References CSG_String::asInt().

◆ asString()

virtual const SG_Char* CSG_Table_Value_String::asString ( int Decimals = -99 ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 271 of file table_value.h.

◆ Get_Type()

virtual TSG_Table_Value_Type CSG_Table_Value_String::Get_Type ( void ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 235 of file table_value.h.

References SG_TABLE_VALUE_TYPE_String.

◆ is_Equal()

virtual bool CSG_Table_Value_String::is_Equal ( const CSG_Table_Value & Value ) const
inlinevirtual

Implements CSG_Table_Value.

Definition at line 277 of file table_value.h.

References CSG_Table_Value::asString(), and CSG_String::Cmp().

◆ operator=()

virtual CSG_Table_Value& CSG_Table_Value_String::operator= ( const CSG_Table_Value & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 283 of file table_value.h.

References CSG_Table_Value::asString(), and Set_Value().

◆ Set_Value() [1/5]

virtual bool CSG_Table_Value_String::Set_Value ( const CSG_Bytes & Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 238 of file table_value.h.

References CSG_Bytes::Get_Bytes(), and SG_Char.

Referenced by operator=(), and Set_Value().

◆ Set_Value() [2/5]

virtual bool CSG_Table_Value_String::Set_Value ( const SG_Char * Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 243 of file table_value.h.

References CSG_String::Cmp().

◆ Set_Value() [3/5]

virtual bool CSG_Table_Value_String::Set_Value ( double Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 265 of file table_value.h.

References CSG_String::Format(), and Set_Value().

◆ Set_Value() [4/5]

virtual bool CSG_Table_Value_String::Set_Value ( int Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 255 of file table_value.h.

References CSG_String::Format(), and Set_Value().

◆ Set_Value() [5/5]

virtual bool CSG_Table_Value_String::Set_Value ( sLong Value )
inlinevirtual

Implements CSG_Table_Value.

Definition at line 260 of file table_value.h.

References CSG_String::Format(), and Set_Value().

The documentation for this class was generated from the following file:
  • table_value.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Table_Value_String Member List

This is the complete list of members for CSG_Table_Value_String, including all inherited members.

asBinary(void) const | CSG_Table_Value | inlinevirtual
asDouble(void) const | CSG_Table_Value_String | inlinevirtual
asInt(void) const | CSG_Table_Value_String | inlinevirtual
asLong(void) const | CSG_Table_Value_String | inlinevirtual
asString(int Decimals=-99) const | CSG_Table_Value_String | inlinevirtual
CSG_Table_Value(void) | CSG_Table_Value | inline
CSG_Table_Value_String(void) | CSG_Table_Value_String | inline
Get_Type(void) const | CSG_Table_Value_String | inlinevirtual
is_Equal(const CSG_Table_Value &Value) const | CSG_Table_Value_String | inlinevirtual
operator const SG_Char *(void) const | CSG_Table_Value | inline
operator double(void) const | CSG_Table_Value | inline
operator=(const CSG_Table_Value &Value) | CSG_Table_Value_String | inlinevirtual
CSG_Table_Value::operator=(const SG_Char *Value) | CSG_Table_Value | inlinevirtual
CSG_Table_Value::operator=(double Value) | CSG_Table_Value | inlinevirtual
operator==(const CSG_Table_Value &Value) const | CSG_Table_Value | inline
Set_Value(const CSG_Bytes &Value) | CSG_Table_Value_String | inlinevirtual
Set_Value(const SG_Char *Value) | CSG_Table_Value_String | inlinevirtual
Set_Value(int Value) | CSG_Table_Value_String | inlinevirtual
Set_Value(sLong Value) | CSG_Table_Value_String | inlinevirtual
Set_Value(double Value) | CSG_Table_Value_String | inlinevirtual
~CSG_Table_Value(void) | CSG_Table_Value | inlinevirtual
~CSG_Table_Value_String(void) | CSG_Table_Value_String | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Test_Distribution Class Reference

Static Public Member Functions | List of all members
CSG_Test_Distribution Class Reference

#include <mat_tools.h>

Static Public Member Functions

static double | Get_F_Tail_from_R2 (double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
static double | Get_F_Tail (double F, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
static double | Get_F_Inverse (double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
static double | Get_T_Tail (double T, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
static double | Get_T_Inverse (double alpha, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
static double | Get_Norm_P (double Z)
static double | Get_Norm_Z (double P)

Detailed Description

Definition at line 1503 of file mat_tools.h.

Member Function Documentation

◆ Get_F_Inverse()

double CSG_Test_Distribution::Get_F_Inverse | ( | double | alpha,
 |  | int | dfn,
 |  | int | dfd,
 |  | TSG_Test_Distribution_Type | Type = TESTDIST_TYPE_Right
 | ) |  |
static

Definition at line 3306 of file mat_tools.cpp.

References EPSILON, Get_F_Tail(), and TESTDIST_TYPE_Right.

◆ Get_F_Tail()

double CSG_Test_Distribution::Get_F_Tail | ( | double | F,
 |  | int | dfn,
 |  | int | dfd,
 |  | TSG_Test_Distribution_Type | Type = TESTDIST_TYPE_Right
 | ) |  |
static

Definition at line 3279 of file mat_tools.cpp.

References TESTDIST_TYPE_Right.

Referenced by CSG_Regression_Multiple::_Get_P(), Get_F_Inverse(), and Get_F_Tail_from_R2().

◆ Get_F_Tail_from_R2()

double CSG_Test_Distribution::Get_F_Tail_from_R2 | ( | double | R2,
 |  | int | nPredictors,
 |  | int | nSamples,
 |  | TSG_Test_Distribution_Type | Type = TESTDIST_TYPE_Right
 | ) |  |
static

Definition at line 3271 of file mat_tools.cpp.

References Get_F_Tail().

Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Regression::Calculate().

◆ Get_Norm_P()

double CSG_Test_Distribution::Get_Norm_P ( double Z )
static

Definition at line 3140 of file mat_tools.cpp.

◆ Get_Norm_Z()

double CSG_Test_Distribution::Get_Norm_Z ( double P )
static

Definition at line 3155 of file mat_tools.cpp.

◆ Get_T_Inverse()

double CSG_Test_Distribution::Get_T_Inverse | ( | double | alpha,
 |  | int | df,
 |  | TSG_Test_Distribution_Type | Type = TESTDIST_TYPE_Right
 | ) |  |
static

Definition at line 3087 of file mat_tools.cpp.

References TESTDIST_TYPE_Left, TESTDIST_TYPE_Right, and TESTDIST_TYPE_TwoTail.

◆ Get_T_Tail()

double CSG_Test_Distribution::Get_T_Tail | ( | double | T,
 |  | int | df,
 |  | TSG_Test_Distribution_Type | Type = TESTDIST_TYPE_Right
 | ) |  |
static

Definition at line 3073 of file mat_tools.cpp.

References TESTDIST_TYPE_TwoTail.

Referenced by CSG_Regression_Multiple::_Get_Regression().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Test_Distribution Member List

This is the complete list of members for CSG_Test_Distribution, including all inherited members.

Get_F_Inverse(double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right) | CSG_Test_Distribution | static
Get_F_Tail(double F, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right) | CSG_Test_Distribution | static
Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right) | CSG_Test_Distribution | static
Get_Norm_P(double Z) | CSG_Test_Distribution | static
Get_Norm_Z(double P) | CSG_Test_Distribution | static
Get_T_Inverse(double alpha, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right) | CSG_Test_Distribution | static
Get_T_Tail(double T, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right) | CSG_Test_Distribution | static
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Thin_Plate_Spline Class Reference

Public Member Functions | List of all members
CSG_Thin_Plate_Spline Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Thin_Plate_Spline (void)
virtual | ~CSG_Thin_Plate_Spline (void)
bool | Destroy (void)
bool | Set_Point_Count (int Count)
int | Get_Point_Count (void)
CSG_Points_3D & | Get_Points (void)
bool | Add_Point (double x, double y, double z)
bool | Add_Point (const TSG_Point &p, double z)
bool | Set_Point (int Index, double x, double y, double z)
bool | Set_Point (int Index, const TSG_Point &p, double z)
bool | Create (double Regularization=0., bool bSilent=true)
bool | is_Okay (void)
double | Get_Value (double x, double y)

Detailed Description

Definition at line 1433 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Thin_Plate_Spline()

CSG_Thin_Plate_Spline::CSG_Thin_Plate_Spline ( void )

Definition at line 290 of file mat_spline.cpp.

◆ ~CSG_Thin_Plate_Spline()

CSG_Thin_Plate_Spline::~CSG_Thin_Plate_Spline ( void )
virtual

Definition at line 295 of file mat_spline.cpp.

References Destroy().

Member Function Documentation

◆ Add_Point() [1/2]

bool CSG_Thin_Plate_Spline::Add_Point | ( | const TSG_Point & | p,
 |  | double | z
 | ) |  |
inline

Definition at line 1447 of file mat_tools.h.

References SSG_Point::x, and SSG_Point::y.

◆ Add_Point() [2/2]

bool CSG_Thin_Plate_Spline::Add_Point | ( | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
inline

Definition at line 1446 of file mat_tools.h.

◆ Create()

bool CSG_Thin_Plate_Spline::Create | ( | double | Regularization = 0.,
 |  | bool | bSilent = true
 | ) |  |

Definition at line 353 of file mat_spline.cpp.

References _TL, CSG_Matrix::Create(), CSG_Vector::Create(), Destroy(), CSG_Points_3D::Get_Count(), SG_Matrix_Solve(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Text().

◆ Destroy()

bool CSG_Thin_Plate_Spline::Destroy ( void )

Definition at line 306 of file mat_spline.cpp.

References CSG_Points_3D::Clear(), and CSG_Vector::Destroy().

Referenced by Create(), and ~CSG_Thin_Plate_Spline().

◆ Get_Point_Count()

int CSG_Thin_Plate_Spline::Get_Point_Count ( void )
inline

Definition at line 1442 of file mat_tools.h.

◆ Get_Points()

CSG_Points_3D& CSG_Thin_Plate_Spline::Get_Points ( void )
inline

Definition at line 1444 of file mat_tools.h.

◆ Get_Value()

double CSG_Thin_Plate_Spline::Get_Value | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 442 of file mat_spline.cpp.

References CSG_Points_3D::Get_Count(), and CSG_Vector::Get_Size().

◆ is_Okay()

bool CSG_Thin_Plate_Spline::is_Okay ( void )
inline

Definition at line 1467 of file mat_tools.h.

◆ Set_Point() [1/2]

bool CSG_Thin_Plate_Spline::Set_Point | ( | int | Index,
 |  | const TSG_Point & | p,
 |  | double | z
 | ) |  |
inline

Definition at line 1463 of file mat_tools.h.

References Set_Point(), SSG_Point::x, and SSG_Point::y.

Referenced by Set_Point().

◆ Set_Point() [2/2]

bool CSG_Thin_Plate_Spline::Set_Point | ( | int | Index,
 |  | double | x,
 |  | double | y,
 |  | double | z
 | ) |  |
inline

Definition at line 1449 of file mat_tools.h.

◆ Set_Point_Count()

bool CSG_Thin_Plate_Spline::Set_Point_Count ( int Count )
inline

Definition at line 1441 of file mat_tools.h.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_spline.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Thin_Plate_Spline Member List

This is the complete list of members for CSG_Thin_Plate_Spline, including all inherited members.

Add_Point(double x, double y, double z) | CSG_Thin_Plate_Spline | inline
Add_Point(const TSG_Point &p, double z) | CSG_Thin_Plate_Spline | inline
Create(double Regularization=0., bool bSilent=true) | CSG_Thin_Plate_Spline |
CSG_Thin_Plate_Spline(void) | CSG_Thin_Plate_Spline |
Destroy(void) | CSG_Thin_Plate_Spline |
Get_Point_Count(void) | CSG_Thin_Plate_Spline | inline
Get_Points(void) | CSG_Thin_Plate_Spline | inline
Get_Value(double x, double y) | CSG_Thin_Plate_Spline |
is_Okay(void) | CSG_Thin_Plate_Spline | inline
Set_Point(int Index, double x, double y, double z) | CSG_Thin_Plate_Spline | inline
Set_Point(int Index, const TSG_Point &p, double z) | CSG_Thin_Plate_Spline | inline
Set_Point_Count(int Count) | CSG_Thin_Plate_Spline | inline
~CSG_Thin_Plate_Spline(void) | CSG_Thin_Plate_Spline | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TimeSpan Class Reference

Public Member Functions | Static Public Member Functions | Friends | List of all members
CSG_TimeSpan Class Reference

#include <datetime.h>

Public Member Functions

CSG_TimeSpan (void)
CSG_TimeSpan (const CSG_TimeSpan &ts)
CSG_TimeSpan (const sLong &diff)
CSG_TimeSpan (double hours)
CSG_TimeSpan (long hours, long min=0, sLong sec=0, sLong msec=0)
CSG_TimeSpan & | Add (const CSG_TimeSpan &ts)
CSG_TimeSpan & | Subtract (const CSG_TimeSpan &ts)
CSG_TimeSpan & | Multiply (int n)
CSG_TimeSpan & | operator+= (const CSG_TimeSpan &ts)
CSG_TimeSpan & | operator-= (const CSG_TimeSpan &ts)
CSG_TimeSpan & | operator*= (int n)
CSG_TimeSpan | Add (const CSG_TimeSpan &ts) const
CSG_TimeSpan | Subtract (const CSG_TimeSpan &ts) const
CSG_TimeSpan | Multiply (int n) const
CSG_TimeSpan | operator+ (const CSG_TimeSpan &ts) const
CSG_TimeSpan | operator- (const CSG_TimeSpan &ts) const
CSG_TimeSpan | operator* (int n) const
CSG_TimeSpan | Abs (void) const
CSG_TimeSpan | Negate (void) const
CSG_TimeSpan & | Neg (void)
CSG_TimeSpan & | operator- (void)
bool | is_Null (void) const
bool | is_Positive (void) const
bool | is_Negative (void) const
bool | operator! (void) const
bool | is_EqualTo (const CSG_TimeSpan &ts) const
bool | is_LongerThan (const CSG_TimeSpan &ts) const
bool | is_ShorterThan (const CSG_TimeSpan &ts) const
bool | operator< (const CSG_TimeSpan &ts) const
bool | operator<= (const CSG_TimeSpan &ts) const
bool | operator== (const CSG_TimeSpan &ts) const
bool | operator!= (const CSG_TimeSpan &ts) const
bool | operator>= (const CSG_TimeSpan &ts) const
bool | operator> (const CSG_TimeSpan &ts) const
int | Get_Weeks (void) const
int | Get_Days (void) const
int | Get_Hours (void) const
int | Get_Minutes (void) const
sLong | Get_Seconds (void) const
sLong | Get_Milliseconds (void) const
sLong | Get_Value (void) const
CSG_String | Format (const CSG_String &format="") const

Static Public Member Functions

static CSG_TimeSpan | Milliseconds (sLong ms)
static CSG_TimeSpan | Seconds (sLong sec)
static CSG_TimeSpan | Minutes (long min)
static CSG_TimeSpan | Hours (long hours)
static CSG_TimeSpan | Days (long days)
static CSG_TimeSpan | Weeks (long days)
static CSG_TimeSpan | Millisecond (void)
static CSG_TimeSpan | Second (void)
static CSG_TimeSpan | Minute (void)
static CSG_TimeSpan | Hour (void)
static CSG_TimeSpan | Day (void)
static CSG_TimeSpan | Week (void)

Friends

class CSG_DateTime

Detailed Description

Definition at line 90 of file datetime.h.

Constructor & Destructor Documentation

◆ CSG_TimeSpan() [1/5]

CSG_TimeSpan::CSG_TimeSpan ( void )
inline

Definition at line 96 of file datetime.h.

◆ CSG_TimeSpan() [2/5]

CSG_TimeSpan::CSG_TimeSpan ( const CSG_TimeSpan & ts )
inline

Definition at line 97 of file datetime.h.

◆ CSG_TimeSpan() [3/5]

CSG_TimeSpan::CSG_TimeSpan ( const sLong & diff )
inline

Definition at line 98 of file datetime.h.

◆ CSG_TimeSpan() [4/5]

CSG_TimeSpan::CSG_TimeSpan ( double hours )
inline

Definition at line 99 of file datetime.h.

◆ CSG_TimeSpan() [5/5]

CSG_TimeSpan::CSG_TimeSpan | ( | long | hours,
 |  | long | min = 0,
 |  | sLong | sec = 0,
 |  | sLong | msec = 0
 | ) |  |
inline

Definition at line 100 of file datetime.h.

Member Function Documentation

◆ Abs()

CSG_TimeSpan CSG_TimeSpan::Abs ( void ) const
inline

Definition at line 137 of file datetime.h.

◆ Add() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Add ( const CSG_TimeSpan & ts )
inline

Definition at line 121 of file datetime.h.

◆ Add() [2/2]

CSG_TimeSpan CSG_TimeSpan::Add ( const CSG_TimeSpan & ts ) const
inline

Definition at line 129 of file datetime.h.

◆ Day()

static CSG_TimeSpan CSG_TimeSpan::Day ( void )
inlinestatic

Definition at line 117 of file datetime.h.

◆ Days()

static CSG_TimeSpan CSG_TimeSpan::Days ( long days )
inlinestatic

Definition at line 110 of file datetime.h.

◆ Format()

CSG_String CSG_TimeSpan::Format ( const CSG_String & format = "" ) const

Definition at line 65 of file datetime.cpp.

References CSG_String::c_str(), and CSG_String::is_Empty().

Referenced by CSG_Tool::Execute().

◆ Get_Days()

int CSG_TimeSpan::Get_Days ( void ) const
inline

Definition at line 160 of file datetime.h.

◆ Get_Hours()

int CSG_TimeSpan::Get_Hours ( void ) const
inline

Definition at line 161 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Milliseconds()

sLong CSG_TimeSpan::Get_Milliseconds ( void ) const
inline

Definition at line 164 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Minutes()

int CSG_TimeSpan::Get_Minutes ( void ) const
inline

Definition at line 162 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Seconds()

sLong CSG_TimeSpan::Get_Seconds ( void ) const
inline

Definition at line 163 of file datetime.h.

Referenced by CSG_Tool::Execute().

◆ Get_Value()

sLong CSG_TimeSpan::Get_Value ( void ) const
inline

Definition at line 165 of file datetime.h.

◆ Get_Weeks()

int CSG_TimeSpan::Get_Weeks ( void ) const
inline

Definition at line 159 of file datetime.h.

◆ Hour()

static CSG_TimeSpan CSG_TimeSpan::Hour ( void )
inlinestatic

Definition at line 116 of file datetime.h.

◆ Hours()

static CSG_TimeSpan CSG_TimeSpan::Hours ( long hours )
inlinestatic

Definition at line 109 of file datetime.h.

◆ is_EqualTo()

bool CSG_TimeSpan::is_EqualTo ( const CSG_TimeSpan & ts ) const
inline

Definition at line 148 of file datetime.h.

◆ is_LongerThan()

bool CSG_TimeSpan::is_LongerThan ( const CSG_TimeSpan & ts ) const
inline

Definition at line 149 of file datetime.h.

◆ is_Negative()

bool CSG_TimeSpan::is_Negative ( void ) const
inline

Definition at line 144 of file datetime.h.

◆ is_Null()

bool CSG_TimeSpan::is_Null ( void ) const
inline

Definition at line 142 of file datetime.h.

◆ is_Positive()

bool CSG_TimeSpan::is_Positive ( void ) const
inline

Definition at line 143 of file datetime.h.

◆ is_ShorterThan()

bool CSG_TimeSpan::is_ShorterThan ( const CSG_TimeSpan & ts ) const
inline

Definition at line 150 of file datetime.h.

◆ Millisecond()

static CSG_TimeSpan CSG_TimeSpan::Millisecond ( void )
inlinestatic

Definition at line 113 of file datetime.h.

◆ Milliseconds()

static CSG_TimeSpan CSG_TimeSpan::Milliseconds ( sLong ms )
inlinestatic

Definition at line 106 of file datetime.h.

◆ Minute()

static CSG_TimeSpan CSG_TimeSpan::Minute ( void )
inlinestatic

Definition at line 115 of file datetime.h.

◆ Minutes()

static CSG_TimeSpan CSG_TimeSpan::Minutes ( long min )
inlinestatic

Definition at line 108 of file datetime.h.

◆ Multiply() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Multiply ( int n )
inline

Definition at line 123 of file datetime.h.

◆ Multiply() [2/2]

CSG_TimeSpan CSG_TimeSpan::Multiply ( int n ) const
inline

Definition at line 131 of file datetime.h.

◆ Neg()

CSG_TimeSpan& CSG_TimeSpan::Neg ( void )
inline

Definition at line 139 of file datetime.h.

◆ Negate()

CSG_TimeSpan CSG_TimeSpan::Negate ( void ) const
inline

Definition at line 138 of file datetime.h.

◆ operator!()

bool CSG_TimeSpan::operator! ( void ) const
inline

Definition at line 146 of file datetime.h.

◆ operator!=()

bool CSG_TimeSpan::operator!= ( const CSG_TimeSpan & ts ) const
inline

Definition at line 155 of file datetime.h.

◆ operator*()

CSG_TimeSpan CSG_TimeSpan::operator* ( int n ) const
inline

Definition at line 135 of file datetime.h.

◆ operator*=()

CSG_TimeSpan& CSG_TimeSpan::operator*= ( int n )
inline

Definition at line 127 of file datetime.h.

◆ operator+()

CSG_TimeSpan CSG_TimeSpan::operator+ ( const CSG_TimeSpan & ts ) const
inline

Definition at line 133 of file datetime.h.

◆ operator+=()

CSG_TimeSpan& CSG_TimeSpan::operator+= ( const CSG_TimeSpan & ts )
inline

Definition at line 125 of file datetime.h.

References CSG_DateTime::Add().

◆ operator-() [1/2]

CSG_TimeSpan CSG_TimeSpan::operator- ( const CSG_TimeSpan & ts ) const
inline

Definition at line 134 of file datetime.h.

◆ operator-() [2/2]

CSG_TimeSpan& CSG_TimeSpan::operator- ( void )
inline

Definition at line 140 of file datetime.h.

◆ operator-=()

CSG_TimeSpan& CSG_TimeSpan::operator-= ( const CSG_TimeSpan & ts )
inline

Definition at line 126 of file datetime.h.

References CSG_DateTime::Subtract().

◆ operator<()

bool CSG_TimeSpan::operator< ( const CSG_TimeSpan & ts ) const
inline

Definition at line 152 of file datetime.h.

◆ operator<=()

bool CSG_TimeSpan::operator<= ( const CSG_TimeSpan & ts ) const
inline

Definition at line 153 of file datetime.h.

◆ operator==()

bool CSG_TimeSpan::operator== ( const CSG_TimeSpan & ts ) const
inline

Definition at line 154 of file datetime.h.

◆ operator>()

bool CSG_TimeSpan::operator> ( const CSG_TimeSpan & ts ) const
inline

Definition at line 157 of file datetime.h.

◆ operator>=()

bool CSG_TimeSpan::operator>= ( const CSG_TimeSpan & ts ) const
inline

Definition at line 156 of file datetime.h.

◆ Second()

static CSG_TimeSpan CSG_TimeSpan::Second ( void )
inlinestatic

Definition at line 114 of file datetime.h.

◆ Seconds()

static CSG_TimeSpan CSG_TimeSpan::Seconds ( sLong sec )
inlinestatic

Definition at line 107 of file datetime.h.

◆ Subtract() [1/2]

CSG_TimeSpan& CSG_TimeSpan::Subtract ( const CSG_TimeSpan & ts )
inline

Definition at line 122 of file datetime.h.

◆ Subtract() [2/2]

CSG_TimeSpan CSG_TimeSpan::Subtract ( const CSG_TimeSpan & ts ) const
inline

Definition at line 130 of file datetime.h.

◆ Week()

static CSG_TimeSpan CSG_TimeSpan::Week ( void )
inlinestatic

Definition at line 118 of file datetime.h.

◆ Weeks()

static CSG_TimeSpan CSG_TimeSpan::Weeks ( long days )
inlinestatic

Definition at line 111 of file datetime.h.

Friends And Related Function Documentation

◆ CSG_DateTime

friend class CSG_DateTime
friend

Definition at line 92 of file datetime.h.

The documentation for this class was generated from the following files:
  • datetime.h
  • datetime.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_TimeSpan Member List

This is the complete list of members for CSG_TimeSpan, including all inherited members.

Abs(void) const | CSG_TimeSpan | inline
Add(const CSG_TimeSpan &ts) | CSG_TimeSpan | inline
Add(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
CSG_DateTime class | CSG_TimeSpan | friend
CSG_TimeSpan(void) | CSG_TimeSpan | inline
CSG_TimeSpan(const CSG_TimeSpan &ts) | CSG_TimeSpan | inline
CSG_TimeSpan(const sLong &diff) | CSG_TimeSpan | inline
CSG_TimeSpan(double hours) | CSG_TimeSpan | inline
CSG_TimeSpan(long hours, long min=0, sLong sec=0, sLong msec=0) | CSG_TimeSpan | inline
Day(void) | CSG_TimeSpan | inlinestatic
Days(long days) | CSG_TimeSpan | inlinestatic
Format(const CSG_String &format="") const | CSG_TimeSpan |
Get_Days(void) const | CSG_TimeSpan | inline
Get_Hours(void) const | CSG_TimeSpan | inline
Get_Milliseconds(void) const | CSG_TimeSpan | inline
Get_Minutes(void) const | CSG_TimeSpan | inline
Get_Seconds(void) const | CSG_TimeSpan | inline
Get_Value(void) const | CSG_TimeSpan | inline
Get_Weeks(void) const | CSG_TimeSpan | inline
Hour(void) | CSG_TimeSpan | inlinestatic
Hours(long hours) | CSG_TimeSpan | inlinestatic
is_EqualTo(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
is_LongerThan(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
is_Negative(void) const | CSG_TimeSpan | inline
is_Null(void) const | CSG_TimeSpan | inline
is_Positive(void) const | CSG_TimeSpan | inline
is_ShorterThan(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
Millisecond(void) | CSG_TimeSpan | inlinestatic
Milliseconds(sLong ms) | CSG_TimeSpan | inlinestatic
Minute(void) | CSG_TimeSpan | inlinestatic
Minutes(long min) | CSG_TimeSpan | inlinestatic
Multiply(int n) | CSG_TimeSpan | inline
Multiply(int n) const | CSG_TimeSpan | inline
Neg(void) | CSG_TimeSpan | inline
Negate(void) const | CSG_TimeSpan | inline
operator!(void) const | CSG_TimeSpan | inline
operator!=(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator*(int n) const | CSG_TimeSpan | inline
operator*=(int n) | CSG_TimeSpan | inline
operator+(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator+=(const CSG_TimeSpan &ts) | CSG_TimeSpan | inline
operator-(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator-(void) | CSG_TimeSpan | inline
operator-=(const CSG_TimeSpan &ts) | CSG_TimeSpan | inline
operator<(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator<=(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator==(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator>(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
operator>=(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
Second(void) | CSG_TimeSpan | inlinestatic
Seconds(sLong sec) | CSG_TimeSpan | inlinestatic
Subtract(const CSG_TimeSpan &ts) | CSG_TimeSpan | inline
Subtract(const CSG_TimeSpan &ts) const | CSG_TimeSpan | inline
Week(void) | CSG_TimeSpan | inlinestatic
Weeks(long days) | CSG_TimeSpan | inlinestatic
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN Class Reference

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSG_TIN Class Reference

#include <tin.h>

Inheritance diagram for CSG_TIN:
CSG_Table CSG_Data_Object

Classes

struct | TTIN_Edge
struct | TTIN_Triangle

Public Member Functions

CSG_TIN (void)
CSG_TIN (const CSG_TIN &TIN)
bool | Create (const CSG_TIN &TIN)
CSG_TIN (CSG_Shapes *pShapes)
bool | Create (CSG_Shapes *pShapes)
CSG_TIN (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_TIN (const char *File)
bool | Create (const char *File)
CSG_TIN (const wchar_t *File)
bool | Create (const wchar_t *File)
virtual | ~CSG_TIN (void)
virtual bool | Destroy (void)
virtual TSG_Data_Object_Type | Get_ObjectType (void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking. More...
virtual bool | Save (const CSG_String &File, int Format=0)
virtual bool | Save (const char *File, int Format=0)
virtual bool | Save (const wchar_t *File, int Format=0)
virtual bool | Assign (CSG_Data_Object *pObject)
virtual bool | is_Valid (void) const
const CSG_Rect & | Get_Extent (void)
CSG_TIN_Node * | Add_Node (TSG_Point Point, CSG_Table_Record *pRecord, bool bUpdateNow)
bool | Del_Node (sLong Index, bool bUpdateNow)
sLong | Get_Node_Count (void) const
CSG_TIN_Node * | Get_Node (sLong Index) const
sLong | Get_Edge_Count (void) const
CSG_TIN_Edge * | Get_Edge (sLong Index) const
sLong | Get_Triangle_Count (void) const
CSG_TIN_Triangle * | Get_Triangle (sLong Index) const
- Public Member Functions inherited from CSG_Table
CSG_Table (void)
CSG_Table (const CSG_Table &Table)
bool | Create (const CSG_Table &Table)
CSG_Table (const CSG_Table *pTemplate)
bool | Create (const CSG_Table *pTemplate)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
CSG_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Create (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual | ~CSG_Table (void)
CSG_Table & | operator= (const CSG_Table &Table)
bool | Assign_Values (const CSG_Table &Table)
bool | Assign_Values (CSG_Table *pTable)
bool | Assign_Values (const SG_Char *File)
bool | Load (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
virtual bool | Save (const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
bool | Set_File_Encoding (int Encoding)
int | Get_File_Encoding (void) const
bool | Serialize (CSG_File &Stream, bool bSave)
bool | is_Compatible (const CSG_Table &Table, bool bExactMatch=false) const
bool | is_Compatible (CSG_Table *pTable, bool bExactMatch=false) const
virtual bool | Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const char *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Add_Field (const wchar_t *Name, TSG_Data_Type Type, int Position=-1)
virtual bool | Del_Field (int iField)
virtual bool | Mov_Field (int iField, int Position)
int | Get_Field_Count (void) const
const SG_Char * | Get_Field_Name (int iField) const
TSG_Data_Type | Get_Field_Type (int iField) const
int | Get_Field_Length (int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
int | Get_Field (const CSG_String &Name) const
bool | Set_Field_Name (int iField, const SG_Char *Name)
virtual bool | Set_Field_Type (int iField, TSG_Data_Type Type)
int | Find_Field (const CSG_String &Name) const
bool | Find_Field (const CSG_String &Name, int &Index) const
sLong | Get_N (int iField) const
double | Get_Minimum (int iField) const
double | Get_Maximum (int iField) const
double | Get_Range (int iField) const
double | Get_Sum (int iField) const
double | Get_Mean (int iField) const
double | Get_StdDev (int iField) const
double | Get_Variance (int iField) const
const CSG_Simple_Statistics & | Get_Statistics (int iField) const
virtual CSG_Table_Record * | Add_Record (CSG_Table_Record *pCopy=NULL)
virtual CSG_Table_Record * | Ins_Record (sLong Index, CSG_Table_Record *pCopy=NULL)
virtual bool | Set_Record (sLong Index, CSG_Table_Record *pCopy)
virtual bool | Del_Record (sLong Index)
virtual bool | Del_Records (void)
virtual bool | Set_Count (sLong nRecords)
sLong | Get_Count (void) const
virtual CSG_Table_Record * | Get_Record (sLong Index) const
virtual CSG_Table_Record & | operator[] (sLong Index) const
sLong | Get_Index (sLong Index) const
CSG_Table_Record * | Get_Record_byIndex (sLong Index) const
virtual bool | Find_Record (sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, const CSG_String &Value, bool bCreateIndex=false)
virtual bool | Find_Record (sLong &Index, int iField, double Value, bool bCreateIndex=false)
virtual CSG_Table_Record * | Find_Record (int iField, double Value, bool bCreateIndex=false)
virtual bool | Set_Value (sLong Index, int iField, const SG_Char *Value)
virtual bool | Set_Value (sLong Index, int iField, double Value)
virtual bool | Get_Value (sLong Index, int iField, CSG_String &Value) const
virtual bool | Get_Value (sLong Index, int iField, double &Value) const
virtual void | Set_Modified (bool bModified=true)
sLong | Get_Selection_Count (void) const
sLong | Get_Selection_Index (sLong Index=0) const
virtual CSG_Table_Record * | Get_Selection (sLong Index=0) const
virtual bool | is_Selected (sLong Index) const
virtual bool | Select (sLong Index, bool bInvert=false)
virtual bool | Select (CSG_Table_Record *pRecord=NULL, bool bInvert=false)
virtual sLong | Del_Selection (void)
virtual sLong | Inv_Selection (void)
bool | Set_Index (CSG_Index &Index, int Field, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const
bool | Set_Index (CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const
bool | is_Indexed (void) const
bool | Set_Index (int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None)
bool | Del_Index (void)
bool | Toggle_Index (int iField)
int | Get_Index_Field (int i) const
TSG_Table_Index_Order | Get_Index_Order (int i) const
int | Get_Index_Field (size_t i) const
TSG_Table_Index_Order | Get_Index_Order (size_t i) const
- Public Member Functions inherited from CSG_Data_Object
CSG_Data_Object (void)
virtual | ~CSG_Data_Object (void)
bool | Reload (void)
If there is an associated file data can be reloaded with this command. More...
bool | Delete (void)
Deletes all files associated with this data object if possible. Works only with native SAGA files. Returns true on success. More...
void | Set_File_Name (const CSG_String &FileName)
const SG_Char * | Get_File_Name (bool bNative=true) const
int | Get_File_Type (void) const
bool | is_File_Native (void) const
void | Set_Name (const CSG_String &Name)
void | Fmt_Name (const char *Format,...)
void | Fmt_Name (const wchar_t *Format,...)
const SG_Char * | Get_Name (void) const
void | Set_Description (const CSG_String &Description)
const SG_Char * | Get_Description (void) const
virtual bool | is_Modified (void) const
bool | Update (bool bForce=false)
CSG_Data_Object * | Get_Owner (void) const
void | Set_Owner (CSG_Data_Object *pOwner)
CSG_MetaData & | Get_MetaData (void) const
CSG_MetaData & | Get_MetaData_DB (void) const
CSG_MetaData & | Get_History (void)
const CSG_MetaData & | Get_History (void) const
CSG_Projection & | Get_Projection (void)
const CSG_Projection & | Get_Projection (void) const
class CSG_Table * | asTable (bool bPolymorph=false) const
class CSG_Shapes * | asShapes (bool bPolymorph=false) const
class CSG_TIN * | asTIN (bool bPolymorph=false) const
class CSG_PointCloud * | asPointCloud (bool bPolymorph=false) const
class CSG_Grid * | asGrid (bool bPolymorph=false) const
class CSG_Grids * | asGrids (bool bPolymorph=false) const
virtual bool | Set_NoData_Value (double Value)
virtual bool | Set_NoData_Value_Range (double Lower, double Upper)
double | Get_NoData_Value (bool bUpper=false) const
bool | is_NoData_Value (double Value) const
bool | Save_History_to_Model (const CSG_String &File) const
virtual bool | Set_Max_Samples (sLong Max_Samples)
sLong | Get_Max_Samples (void) const

Protected Member Functions

virtual bool | On_Update (void)
virtual bool | On_Reload (void)
virtual bool | On_Delete (void)
void | _On_Construction (void)
virtual CSG_Table_Record * | _Get_New_Record (sLong Index)
bool | _Destroy_Nodes (void)
bool | _Destroy_Edges (void)
bool | _Destroy_Triangles (void)
bool | _Add_Edge (CSG_TIN_Node *a, CSG_TIN_Node *b)
bool | _Add_Triangle (CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c)
bool | _Triangulate (void)
bool | _Triangulate (CSG_TIN_Node **Nodes, int nNodes, TTIN_Triangle *Triangles, int &nTriangles)
int | _CircumCircle (double xp, double yp, double x1, double y1, double x2, double y2, double x3, double y3, double *xc, double *yc, double *r)
- Protected Member Functions inherited from CSG_Table
bool | _Add_Selection (sLong Index)
bool | _Set_Selection (sLong Index, sLong Selected)
bool | _Del_Selection (sLong Index)
bool | _Stats_Invalidate (void) const
bool | _Stats_Invalidate (int iField) const
virtual bool | _Stats_Update (int iField) const
virtual bool | On_NoData_Changed (void)
- Protected Member Functions inherited from CSG_Data_Object
void | Set_File_Name (const CSG_String &FileName, bool bNative)
void | Set_File_Type (int Type)
bool | Load_MetaData (const CSG_String &FileName)
bool | Load_MetaData (CSG_File &Stream)
bool | Save_MetaData (const CSG_String &FileName)
bool | Save_MetaData (CSG_File &Stream)
void | Set_Update_Flag (bool bOn=true)
bool | Get_Update_Flag (void)

Protected Attributes

sLong m_nEdges
sLong m_nTriangles
CSG_Rect m_Extent
CSG_TIN_Edge ** m_Edges
CSG_TIN_Triangle ** m_Triangles
- Protected Attributes inherited from CSG_Table
int | m_nFields
int | m_Encoding
sLong m_nRecords
sLong m_nBuffer
TSG_Data_Type * m_Field_Type
CSG_String ** m_Field_Name
CSG_Simple_Statistics ** m_Field_Stats
CSG_Array m_Selection
CSG_Rect m_Extent
- Protected Attributes inherited from CSG_Data_Object
CSG_Data_Object * m_pOwner

Detailed Description

Definition at line 221 of file tin.h.

Constructor & Destructor Documentation

◆ CSG_TIN() [1/6]

CSG_TIN::CSG_TIN ( void )

Definition at line 98 of file tin.cpp.

References _On_Construction().

◆ CSG_TIN() [2/6]

CSG_TIN::CSG_TIN ( const CSG_TIN & TIN )

Definition at line 105 of file tin.cpp.

References _On_Construction(), and Create().

◆ CSG_TIN() [3/6]

CSG_TIN::CSG_TIN ( CSG_Shapes * pShapes )

Definition at line 121 of file tin.cpp.

References _On_Construction(), and Create().

◆ CSG_TIN() [4/6]

CSG_TIN::CSG_TIN ( const CSG_String & File )

Definition at line 114 of file tin.cpp.

References _On_Construction(), and Create().

◆ CSG_TIN() [5/6]

CSG_TIN::CSG_TIN ( const char * File )

Definition at line 112 of file tin.cpp.

◆ CSG_TIN() [6/6]

CSG_TIN::CSG_TIN ( const wchar_t * File )

Definition at line 113 of file tin.cpp.

◆ ~CSG_TIN()

CSG_TIN::~CSG_TIN ( void )
virtual

Definition at line 225 of file tin.cpp.

References Destroy().

Member Function Documentation

◆ _Add_Edge()

bool CSG_TIN::_Add_Edge | ( | CSG_TIN_Node * | a,
 |  | CSG_TIN_Node * | b
 | ) |  |
inlineprotected

Definition at line 429 of file tin.cpp.

References m_Edges, m_nEdges, and SG_Realloc().

Referenced by _Add_Triangle().

◆ _Add_Triangle()

bool CSG_TIN::_Add_Triangle | ( | CSG_TIN_Node * | a,
 |  | CSG_TIN_Node * | b,
 |  | CSG_TIN_Node * | c
 | ) |  |
protected

Definition at line 438 of file tin.cpp.

References _Add_Edge(), m_nTriangles, m_Triangles, and SG_Realloc().

Referenced by _Triangulate(), and Assign().

◆ _CircumCircle()

int CSG_TIN::_CircumCircle | ( | double | xp,
 |  | double | yp,
 |  | double | x1,
 |  | double | y1,
 |  | double | x2,
 |  | double | y2,
 |  | double | x3,
 |  | double | y3,
 |  | double * | xc,
 |  | double * | yc,
 |  | double * | r
 | ) |  |
protected

Definition at line 373 of file tin_triangulation.cpp.

References IS_IDENTICAL.

Referenced by _Triangulate().

◆ _Destroy_Edges()

bool CSG_TIN::_Destroy_Edges ( void )
protected

Definition at line 254 of file tin.cpp.

References m_Edges, m_nEdges, and SG_Free().

Referenced by _Triangulate(), and Destroy().

◆ _Destroy_Nodes()

bool CSG_TIN::_Destroy_Nodes ( void )
protected

Definition at line 248 of file tin.cpp.

References CSG_Table::Del_Records().

Referenced by Destroy().

◆ _Destroy_Triangles()

bool CSG_TIN::_Destroy_Triangles ( void )
protected

Definition at line 272 of file tin.cpp.

References m_nTriangles, m_Triangles, and SG_Free().

Referenced by _Triangulate(), and Destroy().

◆ _Get_New_Record()

CSG_Table_Record * CSG_TIN::_Get_New_Record ( sLong Index )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 384 of file tin.cpp.

◆ _On_Construction()

void CSG_TIN::_On_Construction ( void )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 133 of file tin.cpp.

References CSG_Table::_On_Construction(), m_Edges, m_nEdges, m_nTriangles, and m_Triangles.

Referenced by CSG_TIN().

◆ _Triangulate() [1/2]

bool CSG_TIN::_Triangulate | ( | CSG_TIN_Node ** | Nodes,
 |  | int | nNodes,
 |  | TTIN_Triangle * | Triangles,
 |  | int & | nTriangles
 | ) |  |
protected

Definition at line 161 of file tin_triangulation.cpp.

References _CircumCircle(), CSG_Rect::Assign(), CSG_TIN_Node::Get_X(), CSG_Rect::Get_XCenter(), CSG_Rect::Get_XRange(), CSG_TIN_Node::Get_Y(), CSG_Rect::Get_YCenter(), CSG_Rect::Get_YRange(), m_Extent, CSG_TIN::TTIN_Edge::p1, CSG_TIN::TTIN_Triangle::p1, CSG_TIN::TTIN_Edge::p2, CSG_TIN::TTIN_Triangle::p2, CSG_TIN::TTIN_Triangle::p3, SG_Free(), SG_Malloc(), SG_Realloc(), SG_UI_Process_Set_Progress(), CSG_Rect::Union(), SSG_Point::x, and SSG_Point::y.

◆ _Triangulate() [2/2]

bool CSG_TIN::_Triangulate ( void )
protected

Definition at line 94 of file tin_triangulation.cpp.

References _Add_Triangle(), _Destroy_Edges(), _Destroy_Triangles(), Del_Node(), CSG_Table::Get_Index(), Get_Node(), Get_Node_Count(), SG_Free(), SG_Malloc(), SG_TIN_Compare(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().

Referenced by On_Update().

◆ Add_Node()

CSG_TIN_Node * CSG_TIN::Add_Node | ( | TSG_Point | Point,
 |  | CSG_Table_Record * | pRecord,
 |  | bool | bUpdateNow
 | ) |  |

Definition at line 390 of file tin.cpp.

References CSG_Table::Add_Record(), and CSG_Data_Object::Update().

Referenced by Assign(), and Create().

◆ Assign()

bool CSG_TIN::Assign ( CSG_Data_Object * pObject )
virtual

Reimplemented from CSG_Table.

Definition at line 295 of file tin.cpp.

References _Add_Triangle(), Add_Node(), CSG_Table::Create(), Destroy(), CSG_Data_Object::Get_History(), CSG_Table_Record::Get_Index(), CSG_Data_Object::Get_Name(), CSG_TIN_Triangle::Get_Node(), Get_Node(), Get_Node_Count(), Get_ObjectType(), CSG_Data_Object::Get_ObjectType(), CSG_TIN_Node::Get_Point(), Get_Triangle(), Get_Triangle_Count(), CSG_Data_Object::is_Valid(), and CSG_Data_Object::Set_Name().

Referenced by Create().

◆ Create() [1/5]

bool CSG_TIN::Create ( const char * File )

Definition at line 156 of file tin.cpp.

References Create().

◆ Create() [2/5]

bool CSG_TIN::Create ( const CSG_String & File )

Definition at line 158 of file tin.cpp.

References _TL, CSG_MetaData::Add_Child(), CSG_MetaData::Add_Children(), Create(), CSG_Data_Object::Get_History(), CSG_Data_Object::Set_File_Name(), CSG_Table::Set_Modified(), and CSG_Data_Object::Set_Update_Flag().

◆ Create() [3/5]

bool CSG_TIN::Create ( const CSG_TIN & TIN )

Definition at line 150 of file tin.cpp.

References Assign().

Referenced by Create(), CSG_TIN(), and On_Reload().

◆ Create() [4/5]

bool CSG_TIN::Create ( const wchar_t * File )

Definition at line 157 of file tin.cpp.

References Create().

◆ Create() [5/5]

bool CSG_TIN::Create ( CSG_Shapes * pShapes )

Definition at line 178 of file tin.cpp.

References _TL, Add_Node(), CSG_Table::Create(), Destroy(), CSG_String::Format(), CSG_Table::Get_Count(), CSG_Data_Object::Get_Name(), CSG_Shape::Get_Part_Count(), CSG_Shape::Get_Point(), CSG_Shape::Get_Point_Count(), CSG_Shapes::Get_Shape(), CSG_Shapes::is_Valid(), CSG_Data_Object::Set_Name(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Ready(), and CSG_Data_Object::Update().

◆ Del_Node()

bool CSG_TIN::Del_Node | ( | sLong | Index,
 |  | bool | bUpdateNow
 | ) |  |

Definition at line 408 of file tin.cpp.

References CSG_Table::Del_Record(), and CSG_Data_Object::Update().

Referenced by _Triangulate().

◆ Destroy()

bool CSG_TIN::Destroy ( void )
virtual

Reimplemented from CSG_Table.

Definition at line 231 of file tin.cpp.

References _Destroy_Edges(), _Destroy_Nodes(), _Destroy_Triangles(), and CSG_Table::Destroy().

Referenced by Assign(), Create(), and ~CSG_TIN().

◆ Get_Edge()

CSG_TIN_Edge* CSG_TIN::Get_Edge ( sLong Index ) const
inline

Definition at line 265 of file tin.h.

◆ Get_Edge_Count()

sLong CSG_TIN::Get_Edge_Count ( void ) const
inline

Definition at line 264 of file tin.h.

◆ Get_Extent()

const CSG_Rect& CSG_TIN::Get_Extent ( void )
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 254 of file tin.h.

References CSG_Data_Object::Update().

◆ Get_Node()

CSG_TIN_Node* CSG_TIN::Get_Node ( sLong Index ) const
inline

Definition at line 262 of file tin.h.

References CSG_Table::Get_Record().

Referenced by _Triangulate(), Assign(), and Save().

◆ Get_Node_Count()

sLong CSG_TIN::Get_Node_Count ( void ) const
inline

Definition at line 261 of file tin.h.

References CSG_Table::Get_Count().

Referenced by _Triangulate(), Assign(), and Save().

◆ Get_ObjectType()

virtual TSG_Data_Object_Type CSG_TIN::Get_ObjectType ( void ) const
inlinevirtual

Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.

Reimplemented from CSG_Table.

Definition at line 244 of file tin.h.

References SG_DATAOBJECT_TYPE_TIN.

Referenced by Assign().

◆ Get_Triangle()

CSG_TIN_Triangle* CSG_TIN::Get_Triangle ( sLong Index ) const
inline

Definition at line 268 of file tin.h.

Referenced by Assign().

◆ Get_Triangle_Count()

sLong CSG_TIN::Get_Triangle_Count ( void ) const
inline

Definition at line 267 of file tin.h.

Referenced by Assign(), and Save().

◆ is_Valid()

virtual bool CSG_TIN::is_Valid ( void ) const
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 252 of file tin.h.

References CSG_Table::Get_Count().

Referenced by SG_Create_TIN().

◆ On_Delete()

bool CSG_TIN::On_Delete ( void )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 493 of file tin.cpp.

◆ On_Reload()

bool CSG_TIN::On_Reload ( void )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 487 of file tin.cpp.

References Create(), and CSG_Data_Object::Get_File_Name().

◆ On_Update()

bool CSG_TIN::On_Update ( void )
protectedvirtual

Reimplemented from CSG_Table.

Definition at line 476 of file tin.cpp.

References _Triangulate().

◆ Save() [1/3]

virtual bool CSG_TIN::Save | ( | const char * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 247 of file tin.h.

References Save().

Referenced by Save().

◆ Save() [2/3]

bool CSG_TIN::Save | ( | const CSG_String & | File,
 |  | int | Format = 0
 | ) |  |
virtual

Reimplemented from CSG_Table.

Definition at line 341 of file tin.cpp.

References CSG_Shape::Add_Point(), CSG_Shapes::Add_Shape(), CSG_Shapes::Create(), CSG_Data_Object::Get_Name(), Get_Node(), Get_Node_Count(), CSG_TIN_Node::Get_Point(), Get_Triangle_Count(), CSG_Shapes::Save(), CSG_Data_Object::Set_File_Name(), CSG_Table::Set_Modified(), and SHAPE_TYPE_Point.

◆ Save() [3/3]

virtual bool CSG_TIN::Save | ( | const wchar_t * | File,
 |  | int | Format = 0
 | ) |  |
inlinevirtual

Reimplemented from CSG_Table.

Definition at line 248 of file tin.h.

References Save().

Referenced by Save().

Member Data Documentation

◆ m_Edges

CSG_TIN_Edge** CSG_TIN::m_Edges
protected

Definition at line 292 of file tin.h.

Referenced by _Add_Edge(), _Destroy_Edges(), and _On_Construction().

◆ m_Extent

CSG_Rect CSG_TIN::m_Extent
protected

Definition at line 290 of file tin.h.

Referenced by _Triangulate(), CSG_Table::Get_Extent(), and CSG_TIN_Triangle::Get_Extent().

◆ m_nEdges

sLong CSG_TIN::m_nEdges
protected

Definition at line 288 of file tin.h.

Referenced by _Add_Edge(), _Destroy_Edges(), and _On_Construction().

◆ m_nTriangles

sLong CSG_TIN::m_nTriangles
protected

Definition at line 288 of file tin.h.

Referenced by _Add_Triangle(), _Destroy_Triangles(), _On_Construction(), and CSG_TIN_Node::Get_Triangle_Count().

◆ m_Triangles

CSG_TIN_Triangle** CSG_TIN::m_Triangles
protected

Definition at line 294 of file tin.h.

Referenced by _Add_Triangle(), _Destroy_Triangles(), and _On_Construction().

The documentation for this class was generated from the following files:
  • tin.h
  • tin.cpp
  • tin_triangulation.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_TIN Member List

This is the complete list of members for CSG_TIN, including all inherited members.

_Add_Edge(CSG_TIN_Node *a, CSG_TIN_Node *b) | CSG_TIN | inlineprotected
_Add_Selection(sLong Index) | CSG_Table | protected
_Add_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c) | CSG_TIN | protected
_CircumCircle(double xp, double yp, double x1, double y1, double x2, double y2, double x3, double y3, double *xc, double *yc, double *r) | CSG_TIN | protected
_Del_Selection(sLong Index) | CSG_Table | protected
_Destroy_Edges(void) | CSG_TIN | protected
_Destroy_Nodes(void) | CSG_TIN | protected
_Destroy_Triangles(void) | CSG_TIN | protected
_Get_New_Record(sLong Index) | CSG_TIN | protectedvirtual
_On_Construction(void) | CSG_TIN | protectedvirtual
_Set_Selection(sLong Index, sLong Selected) | CSG_Table | protected
_Stats_Invalidate(void) const | CSG_Table | protected
_Stats_Invalidate(int iField) const | CSG_Table | protected
_Stats_Update(int iField) const | CSG_Table | protectedvirtual
_Triangulate(void) | CSG_TIN | protected
_Triangulate(CSG_TIN_Node **Nodes, int nNodes, TTIN_Triangle *Triangles, int &nTriangles) | CSG_TIN | protected
Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | virtual
Add_Field(const char *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Field(const wchar_t *Name, TSG_Data_Type Type, int Position=-1) | CSG_Table | inlinevirtual
Add_Node(TSG_Point Point, CSG_Table_Record *pRecord, bool bUpdateNow) | CSG_TIN |
Add_Record(CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
asGrid(bool bPolymorph=false) const | CSG_Data_Object |
asGrids(bool bPolymorph=false) const | CSG_Data_Object |
asPointCloud(bool bPolymorph=false) const | CSG_Data_Object |
asShapes(bool bPolymorph=false) const | CSG_Data_Object |
Assign(CSG_Data_Object *pObject) | CSG_TIN | virtual
Assign_Values(const CSG_Table &Table) | CSG_Table |
Assign_Values(CSG_Table *pTable) | CSG_Table |
Assign_Values(const SG_Char *File) | CSG_Table |
asTable(bool bPolymorph=false) const | CSG_Data_Object |
asTIN(bool bPolymorph=false) const | CSG_Data_Object |
Create(const CSG_TIN &TIN) | CSG_TIN |
Create(CSG_Shapes *pShapes) | CSG_TIN |
Create(const CSG_String &File) | CSG_TIN |
Create(const char *File) | CSG_TIN |
Create(const wchar_t *File) | CSG_TIN |
CSG_Table::Create(const CSG_Table &Table) | CSG_Table |
CSG_Table::Create(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Data_Object(void) | CSG_Data_Object |
CSG_Table(void) | CSG_Table |
CSG_Table(const CSG_Table &Table) | CSG_Table |
CSG_Table(const CSG_Table *pTemplate) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
CSG_TIN(void) | CSG_TIN |
CSG_TIN(const CSG_TIN &TIN) | CSG_TIN |
CSG_TIN(CSG_Shapes *pShapes) | CSG_TIN |
CSG_TIN(const CSG_String &File) | CSG_TIN |
CSG_TIN(const char *File) | CSG_TIN |
CSG_TIN(const wchar_t *File) | CSG_TIN |
Del_Field(int iField) | CSG_Table | virtual
Del_Index(void) | CSG_Table |
Del_Node(sLong Index, bool bUpdateNow) | CSG_TIN |
Del_Record(sLong Index) | CSG_Table | virtual
Del_Records(void) | CSG_Table | virtual
Del_Selection(void) | CSG_Table | virtual
Delete(void) | CSG_Data_Object |
Destroy(void) | CSG_TIN | virtual
Find_Field(const CSG_String &Name) const | CSG_Table |
Find_Field(const CSG_String &Name, int &Index) const | CSG_Table |
Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, const CSG_String &Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(sLong &Index, int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Find_Record(int iField, double Value, bool bCreateIndex=false) | CSG_Table | virtual
Fmt_Name(const char *Format,...) | CSG_Data_Object |
Fmt_Name(const wchar_t *Format,...) | CSG_Data_Object |
Get_Count(void) const | CSG_Table | inline
Get_Description(void) const | CSG_Data_Object |
Get_Edge(sLong Index) const | CSG_TIN | inline
Get_Edge_Count(void) const | CSG_TIN | inline
Get_Extent(void) | CSG_TIN | inlinevirtual
Get_Field(const CSG_String &Name) const | CSG_Table |
Get_Field_Count(void) const | CSG_Table | inline
Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const | CSG_Table |
Get_Field_Name(int iField) const | CSG_Table | inline
Get_Field_Type(int iField) const | CSG_Table | inline
Get_File_Encoding(void) const | CSG_Table | inline
Get_File_Name(bool bNative=true) const | CSG_Data_Object |
Get_File_Type(void) const | CSG_Data_Object |
Get_History(void) | CSG_Data_Object | inline
Get_History(void) const | CSG_Data_Object | inline
Get_Index(sLong Index) const | CSG_Table | inline
Get_Index_Field(int i) const | CSG_Table | inline
Get_Index_Field(size_t i) const | CSG_Table | inline
Get_Index_Order(int i) const | CSG_Table | inline
Get_Index_Order(size_t i) const | CSG_Table | inline
Get_Max_Samples(void) const | CSG_Data_Object | inline
Get_Maximum(int iField) const | CSG_Table | inline
Get_Mean(int iField) const | CSG_Table | inline
Get_MetaData(void) const | CSG_Data_Object | inline
Get_MetaData_DB(void) const | CSG_Data_Object | inline
Get_Minimum(int iField) const | CSG_Table | inline
Get_N(int iField) const | CSG_Table | inline
Get_Name(void) const | CSG_Data_Object |
Get_NoData_Value(bool bUpper=false) const | CSG_Data_Object | inline
Get_Node(sLong Index) const | CSG_TIN | inline
Get_Node_Count(void) const | CSG_TIN | inline
Get_ObjectType(void) const | CSG_TIN | inlinevirtual
Get_Owner(void) const | CSG_Data_Object | inline
Get_Projection(void) | CSG_Data_Object |
Get_Projection(void) const | CSG_Data_Object |
Get_Range(int iField) const | CSG_Table | inline
Get_Record(sLong Index) const | CSG_Table | inlinevirtual
Get_Record_byIndex(sLong Index) const | CSG_Table | inline
Get_Selection(sLong Index=0) const | CSG_Table | inlinevirtual
Get_Selection_Count(void) const | CSG_Table | inline
Get_Selection_Index(sLong Index=0) const | CSG_Table | inline
Get_Statistics(int iField) const | CSG_Table | inline
Get_StdDev(int iField) const | CSG_Table | inline
Get_Sum(int iField) const | CSG_Table | inline
Get_Triangle(sLong Index) const | CSG_TIN | inline
Get_Triangle_Count(void) const | CSG_TIN | inline
Get_Update_Flag(void) | CSG_Data_Object | inlineprotected
Get_Value(sLong Index, int iField, CSG_String &Value) const | CSG_Table | virtual
Get_Value(sLong Index, int iField, double &Value) const | CSG_Table | virtual
Get_Variance(int iField) const | CSG_Table | inline
Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL) | CSG_Table | virtual
Inv_Selection(void) | CSG_Table | virtual
is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const | CSG_Table |
is_Compatible(CSG_Table *pTable, bool bExactMatch=false) const | CSG_Table |
is_File_Native(void) const | CSG_Data_Object | inline
is_Indexed(void) const | CSG_Table | inline
is_Modified(void) const | CSG_Data_Object | inlinevirtual
is_NoData_Value(double Value) const | CSG_Data_Object | inline
is_Selected(sLong Index) const | CSG_Table | inlinevirtual
is_Valid(void) const | CSG_TIN | inlinevirtual
Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table |
Load_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Load_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
m_Edges | CSG_TIN | protected
m_Encoding | CSG_Table | protected
m_Extent | CSG_TIN | protected
m_Field_Name | CSG_Table | protected
m_Field_Stats | CSG_Table | protected
m_Field_Type | CSG_Table | protected
m_nBuffer | CSG_Table | protected
m_nEdges | CSG_TIN | protected
m_nFields | CSG_Table | protected
m_nRecords | CSG_Table | protected
m_nTriangles | CSG_TIN | protected
m_pOwner | CSG_Data_Object | protected
m_Selection | CSG_Table | protected
m_Triangles | CSG_TIN | protected
Mov_Field(int iField, int Position) | CSG_Table | virtual
On_Delete(void) | CSG_TIN | protectedvirtual
On_NoData_Changed(void) | CSG_Table | protectedvirtual
On_Reload(void) | CSG_TIN | protectedvirtual
On_Update(void) | CSG_TIN | protectedvirtual
operator=(const CSG_Table &Table) | CSG_Table |
operator[](sLong Index) const | CSG_Table | inlinevirtual
Reload(void) | CSG_Data_Object |
Save(const CSG_String &File, int Format=0) | CSG_TIN | virtual
Save(const char *File, int Format=0) | CSG_TIN | inlinevirtual
Save(const wchar_t *File, int Format=0) | CSG_TIN | inlinevirtual
CSG_Table::Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | virtual
CSG_Table::Save(const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
CSG_Table::Save(const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED) | CSG_Table | inlinevirtual
Save_History_to_Model(const CSG_String &File) const | CSG_Data_Object |
Save_MetaData(const CSG_String &FileName) | CSG_Data_Object | protected
Save_MetaData(CSG_File &Stream) | CSG_Data_Object | protected
Select(sLong Index, bool bInvert=false) | CSG_Table | virtual
Select(CSG_Table_Record *pRecord=NULL, bool bInvert=false) | CSG_Table | virtual
Serialize(CSG_File &Stream, bool bSave) | CSG_Table |
Set_Count(sLong nRecords) | CSG_Table | virtual
Set_Description(const CSG_String &Description) | CSG_Data_Object |
Set_Field_Name(int iField, const SG_Char *Name) | CSG_Table |
Set_Field_Type(int iField, TSG_Data_Type Type) | CSG_Table | virtual
Set_File_Encoding(int Encoding) | CSG_Table |
Set_File_Name(const CSG_String &FileName) | CSG_Data_Object |
Set_File_Name(const CSG_String &FileName, bool bNative) | CSG_Data_Object | protected
Set_File_Type(int Type) | CSG_Data_Object | inlineprotected
Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, int Fields[], int nFields, bool bAscending=true) const | CSG_Table |
Set_Index(CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending=true) const | CSG_Table |
Set_Index(int Field_1, TSG_Table_Index_Order Order_1=TABLE_INDEX_Ascending, int Field_2=-1, TSG_Table_Index_Order Order_2=TABLE_INDEX_None, int Field_3=-1, TSG_Table_Index_Order Order_3=TABLE_INDEX_None) | CSG_Table |
Set_Max_Samples(sLong Max_Samples) | CSG_Data_Object | virtual
Set_Modified(bool bModified=true) | CSG_Table | virtual
Set_Name(const CSG_String &Name) | CSG_Data_Object |
Set_NoData_Value(double Value) | CSG_Data_Object | virtual
Set_NoData_Value_Range(double Lower, double Upper) | CSG_Data_Object | virtual
Set_Owner(CSG_Data_Object *pOwner) | CSG_Data_Object | inline
Set_Record(sLong Index, CSG_Table_Record *pCopy) | CSG_Table | virtual
Set_Update_Flag(bool bOn=true) | CSG_Data_Object | inlineprotected
Set_Value(sLong Index, int iField, const SG_Char *Value) | CSG_Table | virtual
Set_Value(sLong Index, int iField, double Value) | CSG_Table | virtual
Toggle_Index(int iField) | CSG_Table |
Update(bool bForce=false) | CSG_Data_Object |
~CSG_Data_Object(void) | CSG_Data_Object | virtual
~CSG_Table(void) | CSG_Table | virtual
~CSG_TIN(void) | CSG_TIN | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN::TTIN_Edge Struct Reference

  • CSG_TIN
  • TTIN_Edge
Public Attributes | List of all members
CSG_TIN::TTIN_Edge Struct Reference

#include <tin.h>

Public Attributes

int | p1
int | p2

Detailed Description

Definition at line 273 of file tin.h.

Member Data Documentation

◆ p1

int CSG_TIN::TTIN_Edge::p1

Definition at line 275 of file tin.h.

Referenced by CSG_TIN::_Triangulate().

◆ p2

int CSG_TIN::TTIN_Edge::p2

Definition at line 275 of file tin.h.

Referenced by CSG_TIN::_Triangulate().

The documentation for this struct was generated from the following file:
  • tin.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

  • CSG_TIN
  • TTIN_Edge
CSG_TIN::TTIN_Edge Member List

This is the complete list of members for CSG_TIN::TTIN_Edge, including all inherited members.

p1 | CSG_TIN::TTIN_Edge
p2 | CSG_TIN::TTIN_Edge
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN::TTIN_Triangle Struct Reference

  • CSG_TIN
  • TTIN_Triangle
Public Attributes | List of all members
CSG_TIN::TTIN_Triangle Struct Reference

#include <tin.h>

Public Attributes

int | p1
int | p2
int | p3

Detailed Description

Definition at line 279 of file tin.h.

Member Data Documentation

◆ p1

int CSG_TIN::TTIN_Triangle::p1

Definition at line 281 of file tin.h.

Referenced by CSG_TIN::_Triangulate().

◆ p2

int CSG_TIN::TTIN_Triangle::p2

Definition at line 281 of file tin.h.

Referenced by CSG_TIN::_Triangulate().

◆ p3

int CSG_TIN::TTIN_Triangle::p3

Definition at line 281 of file tin.h.

Referenced by CSG_TIN::_Triangulate().

The documentation for this struct was generated from the following file:
  • tin.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

  • CSG_TIN
  • TTIN_Triangle
CSG_TIN::TTIN_Triangle Member List

This is the complete list of members for CSG_TIN::TTIN_Triangle, including all inherited members.

p1 | CSG_TIN::TTIN_Triangle
p2 | CSG_TIN::TTIN_Triangle
p3 | CSG_TIN::TTIN_Triangle
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN_Edge Class Reference

Public Member Functions | Friends | List of all members
CSG_TIN_Edge Class Reference

#include <tin.h>

Public Member Functions

CSG_TIN_Node * Get_Node (int iNode)

Friends

class CSG_TIN

Detailed Description

Definition at line 145 of file tin.h.

Member Function Documentation

◆ Get_Node()

CSG_TIN_Node* CSG_TIN_Edge::Get_Node ( int iNode )
inline

Definition at line 151 of file tin.h.

Friends And Related Function Documentation

◆ CSG_TIN

friend class CSG_TIN ( void )
friend

Definition at line 147 of file tin.h.

The documentation for this class was generated from the following files:
  • tin.h
  • tin_elements.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_TIN_Edge Member List

This is the complete list of members for CSG_TIN_Edge, including all inherited members.

CSG_TIN class | CSG_TIN_Edge | friend
Get_Node(int iNode) | CSG_TIN_Edge | inline
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN_Node Class Reference

Public Member Functions | Friends | List of all members
CSG_TIN_Node Class Reference

#include <tin.h>

Inheritance diagram for CSG_TIN_Node:
CSG_Table_Record

Public Member Functions

int | Get_ID (void)
const TSG_Point & | Get_Point (void)
double | Get_X (void)
double | Get_Y (void)
int | Get_Neighbor_Count (void)
CSG_TIN_Node * | Get_Neighbor (int iNeighbor)
double | Get_Gradient (int iNeighbor, int iField)
int | Get_Triangle_Count (void)
class CSG_TIN_Triangle * | Get_Triangle (int iTriangle)
bool | Get_Polygon (CSG_Points &Points)
double | Get_Polygon_Area (void)
- Public Member Functions inherited from CSG_Table_Record
class CSG_Table * | Get_Table (void)
sLong | Get_Index (void) const
bool | Set_Value (int Field, const CSG_String &Value)
bool | Set_Value (int Field, const char *Value)
bool | Set_Value (int Field, const wchar_t *Value)
bool | Set_Value (const CSG_String &Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const CSG_String &Value)
bool | Set_Value (const wchar_t *Field, const CSG_String &Value)
bool | Set_Value (const char *Field, const char *Value)
bool | Set_Value (const wchar_t *Field, const wchar_t *Value)
bool | Set_Value (int Field, const CSG_Bytes &Value)
bool | Set_Value (const CSG_String &Field, const CSG_Bytes &Value)
bool | Set_Value (const char *Field, const CSG_Bytes &Value)
bool | Set_Value (const wchar_t *Field, const CSG_Bytes &Value)
bool | Set_Value (int Field, double Value)
bool | Set_Value (const CSG_String &Field, double Value)
bool | Set_Value (const char *Field, double Value)
bool | Set_Value (const wchar_t *Field, double Value)
bool | Set_Value (int Field, sLong Value)
bool | Set_Value (const CSG_String &Field, sLong Value)
bool | Set_Value (const char *Field, sLong Value)
bool | Set_Value (const wchar_t *Field, sLong Value)
bool | Set_Value (int Field, size_t Value)
bool | Set_Value (const CSG_String &Field, size_t Value)
bool | Set_Value (const char *Field, size_t Value)
bool | Set_Value (const wchar_t *Field, size_t Value)
bool | Set_Value (int Field, DWORD Value)
bool | Set_Value (const CSG_String &Field, DWORD Value)
bool | Set_Value (const char *Field, DWORD Value)
bool | Set_Value (const wchar_t *Field, DWORD Value)
bool | Set_Value (int Field, long Value)
bool | Set_Value (const CSG_String &Field, long Value)
bool | Set_Value (const char *Field, long Value)
bool | Set_Value (const wchar_t *Field, long Value)
bool | Set_Value (int Field, int Value)
bool | Set_Value (const CSG_String &Field, int Value)
bool | Set_Value (const char *Field, int Value)
bool | Set_Value (const wchar_t *Field, int Value)
bool | Add_Value (int Field, double Value)
bool | Add_Value (const CSG_String &Field, double Value)
bool | Add_Value (const char *Field, double Value)
bool | Add_Value (const wchar_t *Field, double Value)
bool | Mul_Value (int Field, double Value)
bool | Mul_Value (const CSG_String &Field, double Value)
bool | Mul_Value (const char *Field, double Value)
bool | Mul_Value (const wchar_t *Field, double Value)
bool | Set_NoData (int Field)
bool | Set_NoData (const CSG_String &Field)
bool | Set_NoData (const char *Field)
bool | Set_NoData (const wchar_t *Field)
bool | is_NoData (int Field) const
bool | is_NoData (const CSG_String &Field) const
bool | is_NoData (const char *Field) const
bool | is_NoData (const wchar_t *Field) const
const SG_Char * | asString (int Field, int Decimals=-99) const
const SG_Char * | asString (const CSG_String &Field, int Decimals=-99) const
const SG_Char * | asString (const char *Field, int Decimals=-99) const
const SG_Char * | asString (const wchar_t *Field, int Decimals=-99) const
SG_Char | asChar (int Field) const
SG_Char | asChar (const CSG_String &Field) const
SG_Char | asChar (const char *Field) const
SG_Char | asChar (const wchar_t *Field) const
short | asShort (int Field) const
short | asShort (const CSG_String &Field) const
short | asShort (const char *Field) const
short | asShort (const wchar_t *Field) const
int | asInt (int Field) const
int | asInt (const CSG_String &Field) const
int | asInt (const char *Field) const
int | asInt (const wchar_t *Field) const
sLong | asLong (int Field) const
sLong | asLong (const CSG_String &Field) const
sLong | asLong (const char *Field) const
sLong | asLong (const wchar_t *Field) const
float | asFloat (int iField) const
float | asFloat (const CSG_String &Field) const
float | asFloat (const char *Field) const
float | asFloat (const wchar_t *Field) const
double | asDouble (int Field) const
double | asDouble (const CSG_String &Field) const
double | asDouble (const char *Field) const
double | asDouble (const wchar_t *Field) const
CSG_Table_Value * | Get_Value (int Field)
CSG_Table_Value & | operator[] (int Field) const
virtual bool | Assign (CSG_Table_Record *pRecord)
bool | is_Selected (void) const
bool | is_Modified (void) const

Friends

class CSG_TIN

Additional Inherited Members

- Protected Member Functions inherited from CSG_Table_Record
CSG_Table_Record (class CSG_Table *pTable, sLong Index)
virtual | ~CSG_Table_Record (void)
void | Set_Selected (bool bOn=true)
void | Set_Modified (bool bOn=true)
bool | _Add_Field (int add_Field)
bool | _Del_Field (int del_Field)
int | _Get_Field (const CSG_String &Field) const
- Static Protected Member Functions inherited from CSG_Table_Record
static CSG_Table_Value * | _Create_Value (TSG_Data_Type Type)
- Protected Attributes inherited from CSG_Table_Record
char | m_Flags
sLong m_Index
class CSG_Table_Value ** | m_Values
class CSG_Table * | m_pTable

Detailed Description

Definition at line 92 of file tin.h.

Member Function Documentation

◆ Get_Gradient()

double CSG_TIN_Node::Get_Gradient | ( | int | iNeighbor,
 |  | int | iField
 | ) |  |

Definition at line 145 of file tin_elements.cpp.

References CSG_Table_Record::asDouble(), Get_Neighbor(), Get_X(), and Get_Y().

◆ Get_ID()

int CSG_TIN_Node::Get_ID ( void )
inline

Definition at line 98 of file tin.h.

◆ Get_Neighbor()

CSG_TIN_Node* CSG_TIN_Node::Get_Neighbor ( int iNeighbor )
inline

Definition at line 105 of file tin.h.

Referenced by Get_Gradient().

◆ Get_Neighbor_Count()

int CSG_TIN_Node::Get_Neighbor_Count ( void )
inline

Definition at line 104 of file tin.h.

◆ Get_Point()

const TSG_Point& CSG_TIN_Node::Get_Point ( void )
inline

Definition at line 100 of file tin.h.

Referenced by CSG_TIN::Assign(), and CSG_TIN::Save().

◆ Get_Polygon()

bool CSG_TIN_Node::Get_Polygon ( CSG_Points & Points )

Definition at line 175 of file tin_elements.cpp.

References CSG_Points::Add(), CSG_Points_3D::Add(), CSG_Points::Clear(), CSG_TIN_Triangle::Get_CircumCircle_Point(), CSG_Points_3D::Get_Count(), SG_TIN_Compare_Triangle_Center(), SSG_Point::x, and SSG_Point::y.

Referenced by Get_Polygon_Area().

◆ Get_Polygon_Area()

double CSG_TIN_Node::Get_Polygon_Area ( void )

Definition at line 204 of file tin_elements.cpp.

References Get_Polygon(), and SG_Get_Polygon_Area().

◆ Get_Triangle()

class CSG_TIN_Triangle* CSG_TIN_Node::Get_Triangle ( int iTriangle )
inline

Definition at line 109 of file tin.h.

◆ Get_Triangle_Count()

int CSG_TIN_Node::Get_Triangle_Count ( void )
inline

Definition at line 108 of file tin.h.

References CSG_TIN::m_nTriangles.

◆ Get_X()

double CSG_TIN_Node::Get_X ( void )
inline

Definition at line 101 of file tin.h.

Referenced by CSG_TIN::_Triangulate(), Get_Gradient(), CSG_TIN_Triangle::Get_Gradient(), CSG_TIN_Triangle::Get_Value(), and SG_TIN_Compare().

◆ Get_Y()

double CSG_TIN_Node::Get_Y ( void )
inline

Definition at line 102 of file tin.h.

Referenced by CSG_TIN::_Triangulate(), Get_Gradient(), CSG_TIN_Triangle::Get_Gradient(), CSG_TIN_Triangle::Get_Value(), and SG_TIN_Compare().

Friends And Related Function Documentation

◆ CSG_TIN

friend class CSG_TIN ( void )
friend

Definition at line 94 of file tin.h.

The documentation for this class was generated from the following files:
  • tin.h
  • tin_elements.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_TIN_Node Member List

This is the complete list of members for CSG_TIN_Node, including all inherited members.

_Add_Field(int add_Field) | CSG_Table_Record | protected
_Create_Value(TSG_Data_Type Type) | CSG_Table_Record | protectedstatic
_Del_Field(int del_Field) | CSG_Table_Record | protected
_Get_Field(const CSG_String &Field) const | CSG_Table_Record | protected
Add_Value(int Field, double Value) | CSG_Table_Record |
Add_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Add_Value(const char *Field, double Value) | CSG_Table_Record | inline
Add_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
asChar(int Field) const | CSG_Table_Record |
asChar(const CSG_String &Field) const | CSG_Table_Record |
asChar(const char *Field) const | CSG_Table_Record | inline
asChar(const wchar_t *Field) const | CSG_Table_Record | inline
asDouble(int Field) const | CSG_Table_Record |
asDouble(const CSG_String &Field) const | CSG_Table_Record |
asDouble(const char *Field) const | CSG_Table_Record | inline
asDouble(const wchar_t *Field) const | CSG_Table_Record | inline
asFloat(int iField) const | CSG_Table_Record |
asFloat(const CSG_String &Field) const | CSG_Table_Record |
asFloat(const char *Field) const | CSG_Table_Record | inline
asFloat(const wchar_t *Field) const | CSG_Table_Record | inline
asInt(int Field) const | CSG_Table_Record |
asInt(const CSG_String &Field) const | CSG_Table_Record |
asInt(const char *Field) const | CSG_Table_Record | inline
asInt(const wchar_t *Field) const | CSG_Table_Record | inline
asLong(int Field) const | CSG_Table_Record |
asLong(const CSG_String &Field) const | CSG_Table_Record |
asLong(const char *Field) const | CSG_Table_Record | inline
asLong(const wchar_t *Field) const | CSG_Table_Record | inline
asShort(int Field) const | CSG_Table_Record |
asShort(const CSG_String &Field) const | CSG_Table_Record |
asShort(const char *Field) const | CSG_Table_Record | inline
asShort(const wchar_t *Field) const | CSG_Table_Record | inline
Assign(CSG_Table_Record *pRecord) | CSG_Table_Record | virtual
asString(int Field, int Decimals=-99) const | CSG_Table_Record |
asString(const CSG_String &Field, int Decimals=-99) const | CSG_Table_Record |
asString(const char *Field, int Decimals=-99) const | CSG_Table_Record | inline
asString(const wchar_t *Field, int Decimals=-99) const | CSG_Table_Record | inline
CSG_Table_Record(class CSG_Table *pTable, sLong Index) | CSG_Table_Record | protected
CSG_TIN class | CSG_TIN_Node | friend
Get_Gradient(int iNeighbor, int iField) | CSG_TIN_Node |
Get_ID(void) | CSG_TIN_Node | inline
Get_Index(void) const | CSG_Table_Record | inline
Get_Neighbor(int iNeighbor) | CSG_TIN_Node | inline
Get_Neighbor_Count(void) | CSG_TIN_Node | inline
Get_Point(void) | CSG_TIN_Node | inline
Get_Polygon(CSG_Points &Points) | CSG_TIN_Node |
Get_Polygon_Area(void) | CSG_TIN_Node |
Get_Table(void) | CSG_Table_Record | inline
Get_Triangle(int iTriangle) | CSG_TIN_Node | inline
Get_Triangle_Count(void) | CSG_TIN_Node | inline
Get_Value(int Field) | CSG_Table_Record | inline
Get_X(void) | CSG_TIN_Node | inline
Get_Y(void) | CSG_TIN_Node | inline
is_Modified(void) const | CSG_Table_Record | inline
is_NoData(int Field) const | CSG_Table_Record |
is_NoData(const CSG_String &Field) const | CSG_Table_Record |
is_NoData(const char *Field) const | CSG_Table_Record | inline
is_NoData(const wchar_t *Field) const | CSG_Table_Record | inline
is_Selected(void) const | CSG_Table_Record | inline
m_Flags | CSG_Table_Record | protected
m_Index | CSG_Table_Record | protected
m_pTable | CSG_Table_Record | protected
m_Values | CSG_Table_Record | protected
Mul_Value(int Field, double Value) | CSG_Table_Record |
Mul_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Mul_Value(const char *Field, double Value) | CSG_Table_Record | inline
Mul_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
operator[](int Field) const | CSG_Table_Record | inline
Set_Modified(bool bOn=true) | CSG_Table_Record | protected
Set_NoData(int Field) | CSG_Table_Record |
Set_NoData(const CSG_String &Field) | CSG_Table_Record |
Set_NoData(const char *Field) | CSG_Table_Record | inline
Set_NoData(const wchar_t *Field) | CSG_Table_Record | inline
Set_Selected(bool bOn=true) | CSG_Table_Record | protected
Set_Value(int Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(int Field, const char *Value) | CSG_Table_Record | inline
Set_Value(int Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, const CSG_String &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_String &Value) | CSG_Table_Record | inline
Set_Value(const char *Field, const char *Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const wchar_t *Value) | CSG_Table_Record | inline
Set_Value(int Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, const CSG_Bytes &Value) | CSG_Table_Record |
Set_Value(const char *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, const CSG_Bytes &Value) | CSG_Table_Record | inline
Set_Value(int Field, double Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, double Value) | CSG_Table_Record |
Set_Value(const char *Field, double Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, double Value) | CSG_Table_Record | inline
Set_Value(int Field, sLong Value) | CSG_Table_Record |
Set_Value(const CSG_String &Field, sLong Value) | CSG_Table_Record |
Set_Value(const char *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, sLong Value) | CSG_Table_Record | inline
Set_Value(int Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const char *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, size_t Value) | CSG_Table_Record | inline
Set_Value(int Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const char *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, DWORD Value) | CSG_Table_Record | inline
Set_Value(int Field, long Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, long Value) | CSG_Table_Record | inline
Set_Value(const char *Field, long Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, long Value) | CSG_Table_Record | inline
Set_Value(int Field, int Value) | CSG_Table_Record | inline
Set_Value(const CSG_String &Field, int Value) | CSG_Table_Record | inline
Set_Value(const char *Field, int Value) | CSG_Table_Record | inline
Set_Value(const wchar_t *Field, int Value) | CSG_Table_Record | inline
~CSG_Table_Record(void) | CSG_Table_Record | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_TIN_Triangle Class Reference

Public Member Functions | Friends | List of all members
CSG_TIN_Triangle Class Reference

#include <tin.h>

Public Member Functions

CSG_TIN_Node * | Get_Node (int iNode)
const CSG_Rect & | Get_Extent (void)
double | Get_Area (void)
bool | is_Containing (const TSG_Point &p)
bool | is_Containing (double x, double y)
bool | Get_Value (int zField, const TSG_Point &p, double &z)
bool | Get_Value (int zField, double x, double y, double &z)
bool | Get_Gradient (int zField, double &Decline, double &Azimuth)
void | Get_CircumCircle (TSG_Point &Point, double &Radius)
double | Get_CircumCircle_Radius (void)
TSG_Point | Get_CircumCircle_Point (void)

Friends

class CSG_TIN

Detailed Description

Definition at line 172 of file tin.h.

Member Function Documentation

◆ Get_Area()

double CSG_TIN_Triangle::Get_Area ( void )
inline

Definition at line 182 of file tin.h.

◆ Get_CircumCircle()

void CSG_TIN_Triangle::Get_CircumCircle | ( | TSG_Point & | Point,
 |  | double & | Radius
 | ) |  |
inline

Definition at line 192 of file tin.h.

◆ Get_CircumCircle_Point()

TSG_Point CSG_TIN_Triangle::Get_CircumCircle_Point ( void )
inline

Definition at line 194 of file tin.h.

Referenced by CSG_TIN_Node::Get_Polygon().

◆ Get_CircumCircle_Radius()

double CSG_TIN_Triangle::Get_CircumCircle_Radius ( void )
inline

Definition at line 193 of file tin.h.

◆ Get_Extent()

const CSG_Rect& CSG_TIN_Triangle::Get_Extent ( void )
inline

Definition at line 180 of file tin.h.

References CSG_TIN::m_Extent.

◆ Get_Gradient()

bool CSG_TIN_Triangle::Get_Gradient | ( | int | zField,
 |  | double & | Decline,
 |  | double & | Azimuth
 | ) |  |

Definition at line 381 of file tin_elements.cpp.

References A, CSG_Table_Record::asDouble(), B, C, CSG_TIN_Node::Get_X(), CSG_TIN_Node::Get_Y(), M_PI_090, M_PI_180, and M_PI_270.

◆ Get_Node()

CSG_TIN_Node* CSG_TIN_Triangle::Get_Node ( int iNode )
inline

Definition at line 178 of file tin.h.

Referenced by CSG_TIN::Assign().

◆ Get_Value() [1/2]

bool CSG_TIN_Triangle::Get_Value | ( | int | zField,
 |  | const TSG_Point & | p,
 |  | double & | z
 | ) |  |

Definition at line 354 of file tin_elements.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ Get_Value() [2/2]

bool CSG_TIN_Triangle::Get_Value | ( | int | zField,
 |  | double | x,
 |  | double | y,
 |  | double & | z
 | ) |  |

Definition at line 359 of file tin_elements.cpp.

References CSG_Table_Record::asDouble(), B, CSG_Matrix::Get_Transpose(), CSG_TIN_Node::Get_X(), and CSG_TIN_Node::Get_Y().

◆ is_Containing() [1/2]

bool CSG_TIN_Triangle::is_Containing ( const TSG_Point & p )

Definition at line 298 of file tin_elements.cpp.

References SSG_Point::x, and SSG_Point::y.

◆ is_Containing() [2/2]

bool CSG_TIN_Triangle::is_Containing | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 307 of file tin_elements.cpp.

References A, B, C, CSG_Rect::Contains(), CSG_Rect::Get_YMax(), CSG_Rect::Get_YMin(), IS_ONLINE, SG_Get_Crossing(), and SSG_Rect::xMin.

Friends And Related Function Documentation

◆ CSG_TIN

friend class CSG_TIN ( void )
friend

Definition at line 174 of file tin.h.

The documentation for this class was generated from the following files:
  • tin.h
  • tin_elements.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_TIN_Triangle Member List

This is the complete list of members for CSG_TIN_Triangle, including all inherited members.

CSG_TIN class | CSG_TIN_Triangle | friend
Get_Area(void) | CSG_TIN_Triangle | inline
Get_CircumCircle(TSG_Point &Point, double &Radius) | CSG_TIN_Triangle | inline
Get_CircumCircle_Point(void) | CSG_TIN_Triangle | inline
Get_CircumCircle_Radius(void) | CSG_TIN_Triangle | inline
Get_Extent(void) | CSG_TIN_Triangle | inline
Get_Gradient(int zField, double &Decline, double &Azimuth) | CSG_TIN_Triangle |
Get_Node(int iNode) | CSG_TIN_Triangle | inline
Get_Value(int zField, const TSG_Point &p, double &z) | CSG_TIN_Triangle |
Get_Value(int zField, double x, double y, double &z) | CSG_TIN_Triangle |
is_Containing(const TSG_Point &p) | CSG_TIN_Triangle |
is_Containing(double x, double y) | CSG_TIN_Triangle |
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Tool Class Referenceabstract

#include <tool.h>

Inheritance diagram for CSG_Tool:
CSG_Tool_Chain CSG_Tool_Grid CSG_Tool_Interactive CSG_Tool_Grid_Interactive

Public Member Functions

CSG_Tool (void)
virtual | ~CSG_Tool (void)
virtual void | Destroy (void)
virtual TSG_Tool_Type | Get_Type (void) const
const CSG_String & | Get_ID (void) const
const CSG_String & | Get_Library (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_Author (void) const
const CSG_String & | Get_Version (void) const
const CSG_String & | Get_Description (void) const
const CSG_Strings & | Get_References (void) const
const SG_Char * | Get_Icon (void)
CSG_String | Get_Summary (bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
virtual CSG_String | Get_MenuPath (void)
virtual CSG_String | Get_MenuPath (bool bSolved)
int | Get_Parameters_Count (void)
CSG_Parameters * | Get_Parameters (void)
CSG_Parameters * | Get_Parameters (int i)
CSG_Parameters * | Get_Parameters (const CSG_String &Identifier)
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | Get_Parameter (const char *ID) const
CSG_Parameter * | Get_Parameter (const wchar_t *ID) const
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Reset (bool bManager=true)
bool | Reset_Manager (void)
bool | Reset_Grid_System (void)
bool | Update_Parameter_States (void)
void | Set_Callback (bool bActive=true)
bool | Set_Manager (class CSG_Data_Manager *pManager)
class CSG_Data_Manager * | Get_Manager (void) const
class CSG_Data_Manager * | Create_Manager (void)
bool | Delete_Manager (bool bDetachData=false, bool bReset=true)
bool | Set_Grid_System (const CSG_Grid_System &System)
CSG_Grid_System * | Get_Grid_System (void) const
bool | Settings_Push (class CSG_Data_Manager *pManager=NULL)
bool | Settings_Pop (void)
virtual bool | do_Sync_Projections (void) const
virtual bool | needs_GUI (void) const
bool | has_GUI (void) const
virtual bool | is_Grid (void) const
virtual bool | is_Interactive (void) const
bool | is_Progress (void) const
bool | is_Executing (void) const
void | Set_Show_Progress (bool bOn=true)
virtual bool | On_Before_Execution (void)
virtual bool | On_After_Execution (void)
bool | Execute (bool bAddHistory=false)
const SG_Char * | Get_Execution_Info (void) const
CSG_String | Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)

Static Public Member Functions

static bool | Process_Get_Okay (bool bBlink=false)
static void | Process_Set_Text (const CSG_String &Text)
static void | Process_Set_Text (const char *Format,...)
static void | Process_Set_Text (const wchar_t *Format,...)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
static bool | DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
static CSG_Parameter * | DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal)

Protected Member Functions

void | Set_Name (const CSG_String &String)
void | Set_Author (const CSG_String &String)
void | Set_Version (const CSG_String &String)
void | Set_Description (const CSG_String &String)
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
virtual bool | On_Execute (void)=0
virtual int | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
virtual int | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
TSG_PFNC_Parameter_Changed | Get_Parameter_Changed (void)
CSG_Parameters * | Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
bool | Dlg_Parameters (const CSG_String &Identifier)
bool | Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
virtual bool | Set_Progress (int Position, int Range) const
virtual bool | Set_Progress (sLong Position, sLong Range) const
virtual bool | Set_Progress (double Position, double Range=1.) const
bool | Stop_Execution (bool bDialog=true)
void | Message_Dlg (const CSG_String &Text, const SG_Char *Caption=NULL)
bool | Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption=NULL)
void | Message_Add (const CSG_String &Text, bool bNewLine=true)
void | Message_Fmt (const char *Format,...)
void | Message_Fmt (const wchar_t *Format,...)
bool | Error_Set (TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
bool | Error_Set (const CSG_String &Text)
bool | Error_Fmt (const char *Format,...)
bool | Error_Fmt (const wchar_t *Format,...)
bool | DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate=false)
void | DataObject_Update_All (void)
bool | DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
bool | Get_Projection (CSG_Projection &Projection) const

Protected Attributes

CSG_Parameters Parameters
CSG_MetaData History_Supplement

Friends

class | CSG_Tool_Interactive_Base
class | CSG_Tool_Library_Interface
class | CSG_Tool_Chain

Detailed Description

CSG_Tool is the base class for all executable SAGA tools.

See also
CSG_Parameters
CSG_Tool_Interactive
CSG_Tool_Grid
CSG_Tool_Grid_Interactive

Definition at line 148 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool()

CSG_Tool::CSG_Tool ( void )

Definition at line 66 of file tool.cpp.

References CSG_Parameters::Create(), Parameters, CSG_Parameters::Set_Callback_On_Parameter_Changed(), Set_Show_Progress(), and SG_T.

◆ ~CSG_Tool()

CSG_Tool::~CSG_Tool ( void )
virtual

Definition at line 86 of file tool.cpp.

References Destroy(), CSG_Array::Get_Array(), CSG_Array::Get_Size(), CSG_Array::Get_uSize(), and SG_Free().

Member Function Documentation

◆ Add_Parameters()

CSG_Parameters * CSG_Tool::Add_Parameters | ( | const CSG_String & | Identifier,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Description
 | ) |  |
protected

Definition at line 483 of file tool.cpp.

References CSG_Parameters::Create(), CSG_Parameters::Set_Callback_On_Parameter_Changed(), and SG_Realloc().

◆ Add_Reference() [1/2]

void CSG_Tool::Add_Reference | ( | const CSG_String & | Authors,
 |  | const CSG_String & | Year,
 |  | const CSG_String & | Title,
 |  | const CSG_String & | Where,
 |  | const SG_Char * | Link = NULL,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |
protected

Definition at line 184 of file tool.cpp.

References CSG_Parameters::Add_Reference(), and Parameters.

◆ Add_Reference() [2/2]

void CSG_Tool::Add_Reference | ( | const CSG_String & | Link,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |
protected

Definition at line 189 of file tool.cpp.

References CSG_Parameters::Add_Reference(), and Parameters.

◆ Create_Manager()

CSG_Data_Manager * CSG_Tool::Create_Manager ( void )

Definition at line 568 of file tool.cpp.

References Get_Manager(), and Set_Manager().

◆ DataObject_Add()

bool CSG_Tool::DataObject_Add | ( | CSG_Data_Object * | pDataObject,
 |  | bool | bUpdate = false
 | ) |  |
protected

Definition at line 803 of file tool.cpp.

References CSG_Data_Manager::Add(), CSG_Parameters::Get_Manager(), Parameters, SG_Get_Data_Manager(), and SG_UI_DataObject_Add().

◆ DataObject_Get_Colors()

bool CSG_Tool::DataObject_Get_Colors | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Colors & | Colors
 | ) |  |
static

Definition at line 999 of file tool.cpp.

References SG_UI_DataObject_Colors_Get().

◆ DataObject_Get_Parameter()

CSG_Parameter * CSG_Tool::DataObject_Get_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID
 | ) |  |
static

Definition at line 1051 of file tool.cpp.

References DataObject_Get_Parameters().

Referenced by DataObject_Set_Parameter().

◆ DataObject_Get_Parameters()

bool CSG_Tool::DataObject_Get_Parameters | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Parameters & | Parameters
 | ) |  |
static

Definition at line 1019 of file tool.cpp.

References Parameters, and SG_UI_DataObject_Params_Get().

Referenced by DataObject_Get_Parameter(), DataObject_Set_Parameter(), DataObject_Set_Parameters(), and DataObject_Update().

◆ DataObject_Set_Colors() [1/2]

bool CSG_Tool::DataObject_Set_Colors | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_Colors & | Colors
 | ) |  |
static

Definition at line 1004 of file tool.cpp.

References SG_UI_DataObject_Colors_Set().

◆ DataObject_Set_Colors() [2/2]

bool CSG_Tool::DataObject_Set_Colors | ( | CSG_Data_Object * | pDataObject,
 |  | int | nColors,
 |  | int | Palette = SG_COLORS_DEFAULT,
 |  | bool | bRevert = false
 | ) |  |
static

Definition at line 1011 of file tool.cpp.

References SG_UI_DataObject_Colors_Set().

◆ DataObject_Set_History()

bool CSG_Tool::DataObject_Set_History | ( | CSG_Parameter * | pParameter,
 |  | CSG_MetaData * | pHistory = NULL
 | ) |  |
protected

Definition at line 2212 of file tool.cpp.

References CSG_Parameter::asDataObject(), CSG_Parameter::asList(), CSG_MetaData::Assign(), CSG_MetaData::Get_Child(), CSG_Data_Object::Get_History(), CSG_Parameter::Get_Identifier(), CSG_Parameter_List::Get_Item(), CSG_Data_Object::Get_Name(), CSG_Parameter::Get_Name(), CSG_Parameter::Get_Type_Identifier(), CSG_Parameter::is_DataObject(), CSG_Parameter::is_DataObject_List(), CSG_MetaData::Set_Content(), and CSG_MetaData::Set_Property().

◆ DataObject_Set_Parameter() [1/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID,
 |  | const SG_Char * | Value
 | ) |  |
static

Definition at line 1108 of file tool.cpp.

References DataObject_Get_Parameters(), and DataObject_Set_Parameter().

◆ DataObject_Set_Parameter() [2/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID,
 |  | double | loVal,
 |  | double | hiVal
 | ) |  |
static

Definition at line 1120 of file tool.cpp.

References DataObject_Get_Parameters(), DataObject_Set_Parameter(), Get_Type(), and PARAMETER_TYPE_Range.

◆ DataObject_Set_Parameter() [3/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID,
 |  | double | Value
 | ) |  |
static

Definition at line 1084 of file tool.cpp.

References DataObject_Get_Parameters(), and DataObject_Set_Parameter().

◆ DataObject_Set_Parameter() [4/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID,
 |  | int | Value
 | ) |  |
static

Definition at line 1072 of file tool.cpp.

References DataObject_Get_Parameters(), and DataObject_Set_Parameter().

◆ DataObject_Set_Parameter() [5/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | const CSG_String & | ID,
 |  | void * | Value
 | ) |  |
static

Definition at line 1096 of file tool.cpp.

References DataObject_Get_Parameters(), and DataObject_Set_Parameter().

◆ DataObject_Set_Parameter() [6/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Data_Object * | pCopy,
 |  | const CSG_String & | ID
 | ) |  |
static

Definition at line 1065 of file tool.cpp.

References DataObject_Get_Parameter(), and DataObject_Set_Parameter().

◆ DataObject_Set_Parameter() [7/7]

bool CSG_Tool::DataObject_Set_Parameter | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Parameter * | pParameter
 | ) |  |
static

Definition at line 1058 of file tool.cpp.

References DataObject_Set_Parameters().

Referenced by DataObject_Set_Parameter().

◆ DataObject_Set_Parameters() [1/2]

bool CSG_Tool::DataObject_Set_Parameters | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Data_Object * | pCopy
 | ) |  |
static

Definition at line 1029 of file tool.cpp.

References DataObject_Get_Parameters(), DataObject_Set_Parameters(), and CSG_Parameters::Del_Parameter().

◆ DataObject_Set_Parameters() [2/2]

bool CSG_Tool::DataObject_Set_Parameters | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Parameters & | Parameters
 | ) |  |
static

Definition at line 1024 of file tool.cpp.

References Parameters, and SG_UI_DataObject_Params_Set().

Referenced by DataObject_Set_Parameter(), and DataObject_Set_Parameters().

◆ DataObject_Update() [1/2]

bool CSG_Tool::DataObject_Update | ( | CSG_Data_Object * | pDataObject,
 |  | double | Minimum,
 |  | double | Maximum,
 |  | int | Show = SG_UI_DATAOBJECT_UPDATE
 | ) |  |
static

Definition at line 985 of file tool.cpp.

References DataObject_Get_Parameters(), CSG_Parameters::Set_Parameter(), and SG_UI_DataObject_Update().

◆ DataObject_Update() [2/2]

bool CSG_Tool::DataObject_Update | ( | CSG_Data_Object * | pDataObject,
 |  | int | Show = SG_UI_DATAOBJECT_UPDATE
 | ) |  |
static

Definition at line 980 of file tool.cpp.

References SG_UI_DataObject_Update().

Referenced by DataObject_Update_All().

◆ DataObject_Update_All()

void CSG_Tool::DataObject_Update_All ( void )
protected

Definition at line 819 of file tool.cpp.

References DataObject_Update(), CSG_Parameters::Get_Count(), and Parameters.

◆ Delete_Manager()

bool CSG_Tool::Delete_Manager | ( | bool | bDetachData = false,
 |  | bool | bReset = true
 | ) |  |

Definition at line 576 of file tool.cpp.

References CSG_Data_Manager::Delete_All(), Get_Manager(), Set_Manager(), and SG_Get_Data_Manager().

◆ Destroy()

void CSG_Tool::Destroy ( void )
virtual

Definition at line 115 of file tool.cpp.

References CSG_MetaData::Destroy(), and History_Supplement.

Referenced by ~CSG_Tool().

◆ Dlg_Parameters() [1/2]

bool CSG_Tool::Dlg_Parameters ( const CSG_String & Identifier )
protected

Definition at line 512 of file tool.cpp.

References Get_Name(), Get_Parameters(), History_Supplement, CSG_Parameters::is_Managed(), and CSG_Parameters::Set_History().

◆ Dlg_Parameters() [2/2]

bool CSG_Tool::Dlg_Parameters | ( | CSG_Parameters * | pParameters,
 |  | const CSG_String & | Caption
 | ) |  |
protected

Definition at line 527 of file tool.cpp.

References SG_UI_Dlg_Parameters().

◆ do_Sync_Projections()

virtual bool CSG_Tool::do_Sync_Projections ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Chain.

Definition at line 227 of file tool.h.

◆ Error_Fmt() [1/2]

bool CSG_Tool::Error_Fmt | ( | const char * | Format,
 |  |  | ...
 | ) |  |
protected

Definition at line 746 of file tool.cpp.

References Error_Set().

Referenced by CSG_Tool_Chain::Create().

◆ Error_Fmt() [2/2]

bool CSG_Tool::Error_Fmt | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |
protected

Definition at line 771 of file tool.cpp.

References Error_Set().

◆ Error_Set() [1/2]

bool CSG_Tool::Error_Set ( const CSG_String & Text )
protected

Definition at line 722 of file tool.cpp.

References _TL, CSG_String::Format(), SG_UI_Dlg_Error(), SG_UI_Msg_Add_Error(), SG_UI_Process_Get_Okay(), and SG_UI_Process_Set_Okay().

◆ Error_Set() [2/2]

bool CSG_Tool::Error_Set ( TSG_Tool_Error Error_ID = TOOL_ERROR_Unknown )
protected

Definition at line 709 of file tool.cpp.

References _TL, and TOOL_ERROR_Calculation.

Referenced by Error_Fmt().

◆ Execute()

bool CSG_Tool::Execute ( bool bAddHistory = false )

Definition at line 246 of file tool.cpp.

References _TL, ADD_MESSAGE_EXECUTION, CSG_String::c_str(), CSG_String::Clear(), CSG_MetaData::Destroy(), CSG_String::Format(), CSG_TimeSpan::Format(), CSG_TimeSpan::Get_Hours(), CSG_Parameters::Get_Manager(), CSG_TimeSpan::Get_Milliseconds(), CSG_TimeSpan::Get_Minutes(), Get_Name(), CSG_TimeSpan::Get_Seconds(), History_Supplement, is_Interactive(), Message_Dlg(), CSG_Parameters::Msg_String(), CSG_DateTime::Now(), On_Execute(), Parameters, Process_Get_Okay(), SG_Get_Data_Manager(), SG_UI_Msg_Add(), SG_UI_Msg_Add_Execution(), SG_UI_MSG_STYLE_BOLD, SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_NORMAL, SG_UI_MSG_STYLE_SUCCESS, SG_UI_Process_Set_Okay(), SG_UI_Process_Set_Ready(), and Update_Parameter_States().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), and SG_Get_Projected().

◆ Get_Author()

const CSG_String & CSG_Tool::Get_Author ( void ) const

Definition at line 156 of file tool.cpp.

Referenced by Get_Summary().

◆ Get_Description()

const CSG_String & CSG_Tool::Get_Description ( void ) const

Definition at line 178 of file tool.cpp.

References CSG_Parameters::Get_Description(), Get_Name(), CSG_String::is_Empty(), and Parameters.

Referenced by CSG_Tool_Chain::Create(), and Get_Summary().

◆ Get_Execution_Info()

const SG_Char* CSG_Tool::Get_Execution_Info ( void ) const
inline

Definition at line 244 of file tool.h.

◆ Get_File_Name()

const CSG_String & CSG_Tool::Get_File_Name ( void ) const

Definition at line 134 of file tool.cpp.

Referenced by Get_Summary().

◆ Get_Grid_System()

CSG_Grid_System * CSG_Tool::Get_Grid_System ( void ) const

Gets the tools' grid system, if it has one, which is typically the case for all derivatives of CSG_Tool_Grid.

Definition at line 1272 of file tool.cpp.

References CSG_Parameters::Get_Grid_System(), and Parameters.

◆ Get_Icon()

const SG_Char* CSG_Tool::Get_Icon ( void )
inline

Definition at line 172 of file tool.h.

◆ Get_ID()

const CSG_String& CSG_Tool::Get_ID ( void ) const
inline

Definition at line 163 of file tool.h.

Referenced by Get_Summary(), CSG_Tool_Library::Get_Summary(), and CSG_Tool_Library::Get_Tool().

◆ Get_Library()

const CSG_String & CSG_Tool::Get_Library ( void ) const

Definition at line 128 of file tool.cpp.

Referenced by Get_Summary().

◆ Get_Manager()

CSG_Data_Manager * CSG_Tool::Get_Manager ( void ) const

Definition at line 562 of file tool.cpp.

References CSG_Parameters::Get_Manager(), and Parameters.

Referenced by Create_Manager(), Delete_Manager(), and Settings_Pop().

◆ Get_MenuPath() [1/2]

CSG_String CSG_Tool::Get_MenuPath ( bool bSolved )
virtual

Definition at line 200 of file tool.cpp.

References CSG_String::AfterFirst(), Get_MenuPath(), CSG_String::is_Empty(), and CSG_String::Length().

◆ Get_MenuPath() [2/2]

virtual CSG_String CSG_Tool::Get_MenuPath ( void )
inlinevirtual

Reimplemented in CSG_Tool_Chain.

Definition at line 175 of file tool.h.

References SG_T.

Referenced by Get_MenuPath(), and Get_Summary().

◆ Get_Name()

const CSG_String & CSG_Tool::Get_Name ( void ) const

Definition at line 145 of file tool.cpp.

References CSG_Parameters::Get_Name(), and Parameters.

Referenced by Dlg_Parameters(), Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), Get_Description(), Get_Summary(), CSG_Tool_Library::Get_Summary(), CSG_Tool_Library::Get_Tool(), Message_Dlg(), and Message_Dlg_Confirm().

◆ Get_Parameter() [1/3]

CSG_Parameter* CSG_Tool::Get_Parameter ( const char * ID ) const
inline

Definition at line 184 of file tool.h.

References Parameters.

◆ Get_Parameter() [2/3]

CSG_Parameter* CSG_Tool::Get_Parameter ( const CSG_String & ID ) const
inline

Definition at line 183 of file tool.h.

References Parameters.

Referenced by SG_Get_Projected().

◆ Get_Parameter() [3/3]

CSG_Parameter* CSG_Tool::Get_Parameter ( const wchar_t * ID ) const
inline

Definition at line 185 of file tool.h.

References Parameters.

◆ Get_Parameter_Changed()

TSG_PFNC_Parameter_Changed CSG_Tool::Get_Parameter_Changed ( void )
inlineprotected

Definition at line 271 of file tool.h.

◆ Get_Parameters() [1/3]

CSG_Parameters * CSG_Tool::Get_Parameters ( const CSG_String & Identifier )

Definition at line 498 of file tool.cpp.

◆ Get_Parameters() [2/3]

CSG_Parameters* CSG_Tool::Get_Parameters ( int i )
inline

Definition at line 180 of file tool.h.

◆ Get_Parameters() [3/3]

CSG_Parameters* CSG_Tool::Get_Parameters ( void )
inline

Definition at line 179 of file tool.h.

References Parameters.

Referenced by Dlg_Parameters(), and Update_Parameter_States().

◆ Get_Parameters_Count()

int CSG_Tool::Get_Parameters_Count ( void )
inline

Definition at line 178 of file tool.h.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), and Update_Parameter_States().

◆ Get_Projection()

bool CSG_Tool::Get_Projection ( CSG_Projection & Projection ) const
protected

Definition at line 418 of file tool.cpp.

References CSG_Projection::Destroy(), CSG_Projection::is_Okay(), and Parameters.

◆ Get_References()

const CSG_Strings & CSG_Tool::Get_References ( void ) const

Definition at line 194 of file tool.cpp.

References CSG_Parameters::Get_References(), and Parameters.

Referenced by Get_Summary().

◆ Get_Script()

CSG_String CSG_Tool::Get_Script | ( | TSG_Tool_Script_Type | Type,
 |  | bool | bHeader,
 |  | bool | bAllParameters = false
 | ) |  |

Definition at line 1326 of file tool.cpp.

References CSG_Tool_Chain::Get_Script(), TOOL_SCRIPT_CHAIN, TOOL_SCRIPT_CMD_BATCH, TOOL_SCRIPT_CMD_SHELL, TOOL_SCRIPT_PYTHON, TOOL_SCRIPT_PYTHON_WRAP_ID, TOOL_SCRIPT_PYTHON_WRAP_ID_CALL, TOOL_SCRIPT_PYTHON_WRAP_NAME, and TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Get_Summary()

CSG_String CSG_Tool::Get_Summary | ( | bool | bParameters = true,
 |  | const CSG_String & | Menu = "",
 |  | const CSG_String & | Description = "",
 |  | int | Format = SG_SUMMARY_FMT_HTML
 | ) |  |

Definition at line 258 of file tool_summary.cpp.

References _TL, CSG_MetaData::Add_Child(), CSG_MetaData::Add_Property(), CSG_MetaData::asText(), CSG_String::c_str(), CSG_String::Format(), Get_Author(), CSG_Strings::Get_Count(), CSG_Parameters::Get_Count(), CSG_Parameter::Get_Description(), Get_Description(), Get_File_Name(), Get_ID(), CSG_Parameter::Get_Identifier(), Get_Library(), Get_MenuPath(), CSG_Parameter::Get_Name(), Get_Name(), Get_References(), Get_Type(), CSG_Parameter::Get_Type(), Get_Version(), CSG_String::is_Empty(), is_Grid(), CSG_Parameter::is_Input(), is_Interactive(), CSG_Parameter::is_Option(), CSG_Parameter::is_Output(), CSG_String::Length(), PARAMETER_DESCRIPTION_PROPERTIES, PARAMETER_DESCRIPTION_TYPE, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Node, Parameters, CSG_String::Replace(), CSG_MetaData::Set_Name(), SG_SUMMARY_FMT_FLAT, SG_SUMMARY_FMT_HTML, SG_SUMMARY_FMT_XML, SG_XML_Add_Parameter(), SG_XML_DESCRIPTION, SG_XML_MENU, SG_XML_SPEC_ATT_GRID, SG_XML_SPEC_ATT_INTERA, SG_XML_TOOL, SG_XML_TOOL_ATT_AUTHOR, SG_XML_TOOL_ATT_ID, SG_XML_TOOL_ATT_NAME, SG_XML_TOOL_ATT_VERSION, SUMMARY_ADD_STR, and TOOL_TYPE_Chain.

Referenced by CSG_Tool_Library::Get_Summary().

◆ Get_Type()

virtual TSG_Tool_Type CSG_Tool::Get_Type ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Chain, CSG_Tool_Grid_Interactive, CSG_Tool_Interactive, and CSG_Tool_Grid.

Definition at line 161 of file tool.h.

References TOOL_TYPE_Base.

Referenced by DataObject_Set_Parameter(), Get_Summary(), and CSG_Tool_Library::Get_Tool().

◆ Get_Version()

const CSG_String & CSG_Tool::Get_Version ( void ) const

Definition at line 167 of file tool.cpp.

Referenced by Get_Summary().

◆ has_GUI()

bool CSG_Tool::has_GUI ( void ) const

Definition at line 233 of file tool.cpp.

References SG_UI_Get_Window_Main().

Referenced by CSG_Parameters_Grid_Target::Add_Grid(), CSG_Parameters_Grid_Target::Add_Grids(), CSG_Tool_Chain::Create(), CSG_Parameters_Grid_Target::Get_Grid(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ is_Executing()

bool CSG_Tool::is_Executing ( void ) const
inline

Definition at line 235 of file tool.h.

◆ is_Grid()

virtual bool CSG_Tool::is_Grid ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Grid.

Definition at line 232 of file tool.h.

Referenced by Get_Summary().

◆ is_Interactive()

virtual bool CSG_Tool::is_Interactive ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Grid_Interactive, and CSG_Tool_Interactive.

Definition at line 233 of file tool.h.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), Execute(), and Get_Summary().

◆ is_Progress()

bool CSG_Tool::is_Progress ( void ) const
inline

Definition at line 234 of file tool.h.

References SG_UI_Process_Get_Okay().

Referenced by CSG_Tool_Grid::Set_Progress_Cells().

◆ Message_Add()

void CSG_Tool::Message_Add | ( | const CSG_String & | Text,
 |  | bool | bNewLine = true
 | ) |  |
protected

Definition at line 910 of file tool.cpp.

References SG_UI_Msg_Add_Execution().

Referenced by Message_Fmt().

◆ Message_Dlg()

void CSG_Tool::Message_Dlg | ( | const CSG_String & | Text,
 |  | const SG_Char * | Caption = NULL
 | ) |  |
protected

Definition at line 697 of file tool.cpp.

References Get_Name(), and SG_UI_Dlg_Message().

Referenced by Execute().

◆ Message_Dlg_Confirm()

bool CSG_Tool::Message_Dlg_Confirm | ( | const CSG_String & | Text,
 |  | const SG_Char * | Caption = NULL
 | ) |  |
protected

Definition at line 703 of file tool.cpp.

References Get_Name(), and SG_UI_Dlg_Continue().

◆ Message_Fmt() [1/2]

void CSG_Tool::Message_Fmt | ( | const char * | Format,
 |  |  | ...
 | ) |  |
protected

Definition at line 923 of file tool.cpp.

References Message_Add().

◆ Message_Fmt() [2/2]

void CSG_Tool::Message_Fmt | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |
protected

Definition at line 948 of file tool.cpp.

References Message_Add().

◆ needs_GUI()

virtual bool CSG_Tool::needs_GUI ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Grid_Interactive, and CSG_Tool_Interactive.

Definition at line 229 of file tool.h.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), and CSG_Tool_Library::Get_Summary().

◆ On_After_Execution()

virtual bool CSG_Tool::On_After_Execution ( void )
inlinevirtual

Definition at line 240 of file tool.h.

◆ On_Before_Execution()

virtual bool CSG_Tool::On_Before_Execution ( void )
inlinevirtual

Definition at line 239 of file tool.h.

Referenced by CSG_Shapes::Create(), and CSG_Table::Create().

◆ On_Execute()

virtual bool CSG_Tool::On_Execute ( void )
protectedpure virtual

Implemented in CSG_Tool_Chain.

Referenced by Execute().

◆ On_Parameter_Changed()

int CSG_Tool::On_Parameter_Changed | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter
 | ) |  |
protectedvirtual

Definition at line 464 of file tool.cpp.

◆ On_Parameters_Enable()

int CSG_Tool::On_Parameters_Enable | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter
 | ) |  |
protectedvirtual

Reimplemented in CSG_Tool_Chain.

Definition at line 470 of file tool.cpp.

◆ Process_Get_Okay()

bool CSG_Tool::Process_Get_Okay ( bool bBlink = false )
static

Definition at line 848 of file tool.cpp.

References SG_UI_Process_Get_Okay().

Referenced by Execute(), and Set_Progress().

◆ Process_Set_Text() [1/3]

void CSG_Tool::Process_Set_Text | ( | const char * | Format,
 |  |  | ...
 | ) |  |
static

Definition at line 860 of file tool.cpp.

References SG_UI_Process_Set_Text().

◆ Process_Set_Text() [2/3]

void CSG_Tool::Process_Set_Text ( const CSG_String & Text )
static

Definition at line 854 of file tool.cpp.

References SG_UI_Process_Set_Text().

◆ Process_Set_Text() [3/3]

void CSG_Tool::Process_Set_Text | ( | const wchar_t * | Format,
 |  |  | ...
 | ) |  |
static

Definition at line 885 of file tool.cpp.

References SG_UI_Process_Set_Text().

◆ Reset()

bool CSG_Tool::Reset ( bool bManager = true )

Resets the tools' parameters list. All input and output data objects and object lists are cleared and parameter defaults are restored.

Definition at line 1215 of file tool.cpp.

References Parameters, Reset_Grid_System(), Reset_Manager(), and CSG_Parameters::Restore_Defaults().

◆ Reset_Grid_System()

bool CSG_Tool::Reset_Grid_System ( void )

Resets the tools' grid system, if it has one, which is typically the case for all derivatives of CSG_Tool_Grid.

Definition at line 1247 of file tool.cpp.

References Parameters, and CSG_Parameters::Reset_Grid_System().

Referenced by Reset().

◆ Reset_Manager()

bool CSG_Tool::Reset_Manager ( void )

Resets the tools' data manager so it will be the SAGA API's default manager as can be requested by SG_Get_Data_Manager().

Definition at line 1237 of file tool.cpp.

References Set_Manager(), and SG_Get_Data_Manager().

Referenced by Reset().

◆ Set_Author()

void CSG_Tool::Set_Author ( const CSG_String & String )
protected

Definition at line 151 of file tool.cpp.

Referenced by CSG_Tool_Chain::Create().

◆ Set_Callback()

void CSG_Tool::Set_Callback ( bool bActive = true )

Definition at line 538 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Callback().

◆ Set_Description()

void CSG_Tool::Set_Description ( const CSG_String & String )
protected

Definition at line 173 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Description().

Referenced by CSG_Tool_Chain::Create().

◆ Set_Grid_System()

bool CSG_Tool::Set_Grid_System ( const CSG_Grid_System & System )

Sets the tools' grid system, if it has one, which is typically the case for all derivatives of CSG_Tool_Grid.

Definition at line 1262 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Grid_System().

◆ Set_Manager()

bool CSG_Tool::Set_Manager ( class CSG_Data_Manager * pManager )

Definition at line 549 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Manager().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), Create_Manager(), Delete_Manager(), Reset_Manager(), and SG_Get_Projected().

◆ Set_Name()

void CSG_Tool::Set_Name ( const CSG_String & String )
protected

Definition at line 140 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Name().

Referenced by CSG_Tool_Chain::Create().

◆ Set_Parameter() [1/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1190 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [2/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1181 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [3/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1199 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [4/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Definition at line 1145 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [5/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1163 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [6/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1154 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [7/21]

bool CSG_Tool::Set_Parameter | ( | const char * | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1172 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [8/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1189 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [9/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1180 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [10/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1198 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [11/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1144 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

Referenced by SG_Get_Projected().

◆ Set_Parameter() [12/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1162 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [13/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1153 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [14/21]

bool CSG_Tool::Set_Parameter | ( | const CSG_String & | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Direct 'set a value' access to this tool's default parameters list.

Definition at line 1171 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [15/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | const char * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1191 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [16/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | const CSG_String & | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1182 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [17/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | const wchar_t * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1200 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [18/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | CSG_Parameter * | pValue
 | ) |  |

Definition at line 1146 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [19/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | double | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1164 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [20/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | int | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1155 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Parameter() [21/21]

bool CSG_Tool::Set_Parameter | ( | const wchar_t * | ID,
 |  | void * | Value,
 |  | int | Type = PARAMETER_TYPE_Undefined
 | ) |  |

Definition at line 1173 of file tool.cpp.

References Parameters, and CSG_Parameters::Set_Parameter().

◆ Set_Progress() [1/3]

bool CSG_Tool::Set_Progress | ( | double | Position,
 |  | double | Range = 1.
 | ) |  | const
 protectedvirtual

Definition at line 676 of file tool.cpp.

References Process_Get_Okay(), and SG_UI_Process_Set_Progress().

◆ Set_Progress() [2/3]

bool CSG_Tool::Set_Progress | ( | int | Position,
 |  | int | Range
 | ) |  | const
 protectedvirtual

Definition at line 664 of file tool.cpp.

Referenced by Set_Progress(), CSG_Tool_Grid::Set_Progress_Cells(), and CSG_Tool_Grid::Set_Progress_Rows().

◆ Set_Progress() [3/3]

bool CSG_Tool::Set_Progress | ( | sLong | Position,
 |  | sLong | Range
 | ) |  | const
 protectedvirtual

Definition at line 670 of file tool.cpp.

References Set_Progress().

◆ Set_Show_Progress()

void CSG_Tool::Set_Show_Progress ( bool bOn = true )

Definition at line 658 of file tool.cpp.

Referenced by CSG_Tool().

◆ Set_Version()

void CSG_Tool::Set_Version ( const CSG_String & String )
protected

Definition at line 162 of file tool.cpp.

◆ Settings_Pop()

bool CSG_Tool::Settings_Pop ( void )

Definition at line 627 of file tool.cpp.

References CSG_Parameters::Assign_Values(), CSG_Array::Get_Array(), Get_Manager(), CSG_Array::Get_Size(), Parameters, CSG_Array::Set_Array(), and CSG_Parameters::Set_Manager().

◆ Settings_Push()

bool CSG_Tool::Settings_Push ( class CSG_Data_Manager * pManager = NULL )

Definition at line 600 of file tool.cpp.

References CSG_Array::Create(), CSG_Array::Get_Array(), CSG_Array::Get_Size(), CSG_Array::Get_Value_Size(), Parameters, CSG_Parameters::Restore_Defaults(), and CSG_Parameters::Set_Manager().

◆ Stop_Execution()

bool CSG_Tool::Stop_Execution ( bool bDialog = true )
protected

Definition at line 682 of file tool.cpp.

References SG_UI_Stop_Execution().

◆ Update_Parameter_States()

bool CSG_Tool::Update_Parameter_States ( void )

Definition at line 1285 of file tool.cpp.

References Get_Parameters(), Get_Parameters_Count(), and Parameters.

Referenced by Execute().

Friends And Related Function Documentation

◆ CSG_Tool_Chain

friend class CSG_Tool_Chain ( void )
friend

Definition at line 152 of file tool.h.

◆ CSG_Tool_Interactive_Base

friend class CSG_Tool_Interactive_Base
friend

Definition at line 150 of file tool.h.

◆ CSG_Tool_Library_Interface

friend class CSG_Tool_Library_Interface
friend

Definition at line 151 of file tool.h.

Member Data Documentation

◆ History_Supplement

CSG_MetaData CSG_Tool::History_Supplement
protected

Definition at line 253 of file tool.h.

Referenced by Destroy(), Dlg_Parameters(), and Execute().

◆ Parameters

CSG_Parameters CSG_Tool::Parameters
protected

Definition at line 251 of file tool.h.

Referenced by Add_Reference(), CSG_Tool_Chain::Create(), CSG_Tool(), CSG_Tool_Grid::CSG_Tool_Grid(), DataObject_Add(), DataObject_Get_Parameters(), DataObject_Set_Parameters(), DataObject_Update_All(), Execute(), Get_Description(), Get_Grid_System(), Get_Manager(), Get_Name(), Get_Parameter(), Get_Parameters(), Get_Projection(), Get_References(), Get_Summary(), Reset(), Reset_Grid_System(), Set_Callback(), Set_Description(), Set_Grid_System(), Set_Manager(), Set_Name(), Set_Parameter(), CSG_Tool_Grid::Set_System(), Settings_Pop(), Settings_Push(), and Update_Parameter_States().

The documentation for this class was generated from the following files:
  • tool.h
  • tool.cpp
  • tool_summary.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool Member List

This is the complete list of members for CSG_Tool, including all inherited members.

Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) | CSG_Tool | protected
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Create_Manager(void) | CSG_Tool |
CSG_Tool(void) | CSG_Tool |
CSG_Tool_Chain class | CSG_Tool | friend
CSG_Tool_Interactive_Base class | CSG_Tool | friend
CSG_Tool_Library_Interface class | CSG_Tool | friend
DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false) | CSG_Tool | protected
DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors) | CSG_Tool | static
DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID) | CSG_Tool | static
DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Tool | static
DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL) | CSG_Tool | protected
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, int Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update_All(void) | CSG_Tool | protected
Delete_Manager(bool bDetachData=false, bool bReset=true) | CSG_Tool |
Destroy(void) | CSG_Tool | virtual
Dlg_Parameters(const CSG_String &Identifier) | CSG_Tool | protected
Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption) | CSG_Tool | protected
do_Sync_Projections(void) const | CSG_Tool | inlinevirtual
Error_Fmt(const char *Format,...) | CSG_Tool | protected
Error_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown) | CSG_Tool | protected
Error_Set(const CSG_String &Text) | CSG_Tool | protected
Execute(bool bAddHistory=false) | CSG_Tool |
Get_Author(void) const | CSG_Tool |
Get_Description(void) const | CSG_Tool |
Get_Execution_Info(void) const | CSG_Tool | inline
Get_File_Name(void) const | CSG_Tool |
Get_Grid_System(void) const | CSG_Tool |
Get_Icon(void) | CSG_Tool | inline
Get_ID(void) const | CSG_Tool | inline
Get_Library(void) const | CSG_Tool |
Get_Manager(void) const | CSG_Tool |
Get_MenuPath(void) | CSG_Tool | inlinevirtual
Get_MenuPath(bool bSolved) | CSG_Tool | virtual
Get_Name(void) const | CSG_Tool |
Get_Parameter(const CSG_String &ID) const | CSG_Tool | inline
Get_Parameter(const char *ID) const | CSG_Tool | inline
Get_Parameter(const wchar_t *ID) const | CSG_Tool | inline
Get_Parameter_Changed(void) | CSG_Tool | inlineprotected
Get_Parameters(void) | CSG_Tool | inline
Get_Parameters(int i) | CSG_Tool | inline
Get_Parameters(const CSG_String &Identifier) | CSG_Tool |
Get_Parameters_Count(void) | CSG_Tool | inline
Get_Projection(CSG_Projection &Projection) const | CSG_Tool | protected
Get_References(void) const | CSG_Tool |
Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false) | CSG_Tool |
Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML) | CSG_Tool |
Get_Type(void) const | CSG_Tool | inlinevirtual
Get_Version(void) const | CSG_Tool |
has_GUI(void) const | CSG_Tool |
History_Supplement | CSG_Tool | protected
is_Executing(void) const | CSG_Tool | inline
is_Grid(void) const | CSG_Tool | inlinevirtual
is_Interactive(void) const | CSG_Tool | inlinevirtual
is_Progress(void) const | CSG_Tool | inline
Message_Add(const CSG_String &Text, bool bNewLine=true) | CSG_Tool | protected
Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Fmt(const char *Format,...) | CSG_Tool | protected
Message_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
needs_GUI(void) const | CSG_Tool | inlinevirtual
On_After_Execution(void) | CSG_Tool | inlinevirtual
On_Before_Execution(void) | CSG_Tool | inlinevirtual
On_Execute(void)=0 | CSG_Tool | protectedpure virtual
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
Parameters | CSG_Tool | protected
Process_Get_Okay(bool bBlink=false) | CSG_Tool | static
Process_Set_Text(const CSG_String &Text) | CSG_Tool | static
Process_Set_Text(const char *Format,...) | CSG_Tool | static
Process_Set_Text(const wchar_t *Format,...) | CSG_Tool | static
Reset(bool bManager=true) | CSG_Tool |
Reset_Grid_System(void) | CSG_Tool |
Reset_Manager(void) | CSG_Tool |
Set_Author(const CSG_String &String) | CSG_Tool | protected
Set_Callback(bool bActive=true) | CSG_Tool |
Set_Description(const CSG_String &String) | CSG_Tool | protected
Set_Grid_System(const CSG_Grid_System &System) | CSG_Tool |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Tool |
Set_Name(const CSG_String &String) | CSG_Tool | protected
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Progress(int Position, int Range) const | CSG_Tool | protectedvirtual
Set_Progress(sLong Position, sLong Range) const | CSG_Tool | protectedvirtual
Set_Progress(double Position, double Range=1.) const | CSG_Tool | protectedvirtual
Set_Show_Progress(bool bOn=true) | CSG_Tool |
Set_Version(const CSG_String &String) | CSG_Tool | protected
Settings_Pop(void) | CSG_Tool |
Settings_Push(class CSG_Data_Manager *pManager=NULL) | CSG_Tool |
Stop_Execution(bool bDialog=true) | CSG_Tool | protected
Update_Parameter_States(void) | CSG_Tool |
~CSG_Tool(void) | CSG_Tool | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Chain Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CSG_Tool_Chain Class Reference

#include <tool_chain.h>

Inheritance diagram for CSG_Tool_Chain:
CSG_Tool

Public Member Functions

CSG_Tool_Chain (void)
virtual | ~CSG_Tool_Chain (void)
CSG_Tool_Chain (const CSG_Tool_Chain &Tool, bool bWithGUI)
bool | Create (const CSG_Tool_Chain &Tool, bool bWithGUI)
CSG_Tool_Chain (const CSG_String &File)
bool | Create (const CSG_String &File)
CSG_Tool_Chain (const CSG_MetaData &Chain)
bool | Create (const CSG_MetaData &Chain)
virtual TSG_Tool_Type | Get_Type (void) const
virtual bool | do_Sync_Projections (void) const
bool | is_Okay (void) const
void | Set_Library_Menu (const CSG_String &Menu)
virtual CSG_String | Get_MenuPath (void)
const CSG_String & | Get_Library_Name (void) const
- Public Member Functions inherited from CSG_Tool
CSG_Tool (void)
virtual | ~CSG_Tool (void)
virtual void | Destroy (void)
const CSG_String & | Get_ID (void) const
const CSG_String & | Get_Library (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_Author (void) const
const CSG_String & | Get_Version (void) const
const CSG_String & | Get_Description (void) const
const CSG_Strings & | Get_References (void) const
const SG_Char * | Get_Icon (void)
CSG_String | Get_Summary (bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
virtual CSG_String | Get_MenuPath (bool bSolved)
int | Get_Parameters_Count (void)
CSG_Parameters * | Get_Parameters (void)
CSG_Parameters * | Get_Parameters (int i)
CSG_Parameters * | Get_Parameters (const CSG_String &Identifier)
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | Get_Parameter (const char *ID) const
CSG_Parameter * | Get_Parameter (const wchar_t *ID) const
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Reset (bool bManager=true)
bool | Reset_Manager (void)
bool | Reset_Grid_System (void)
bool | Update_Parameter_States (void)
void | Set_Callback (bool bActive=true)
bool | Set_Manager (class CSG_Data_Manager *pManager)
class CSG_Data_Manager * | Get_Manager (void) const
class CSG_Data_Manager * | Create_Manager (void)
bool | Delete_Manager (bool bDetachData=false, bool bReset=true)
bool | Set_Grid_System (const CSG_Grid_System &System)
CSG_Grid_System * | Get_Grid_System (void) const
bool | Settings_Push (class CSG_Data_Manager *pManager=NULL)
bool | Settings_Pop (void)
virtual bool | needs_GUI (void) const
bool | has_GUI (void) const
virtual bool | is_Grid (void) const
virtual bool | is_Interactive (void) const
bool | is_Progress (void) const
bool | is_Executing (void) const
void | Set_Show_Progress (bool bOn=true)
virtual bool | On_Before_Execution (void)
virtual bool | On_After_Execution (void)
bool | Execute (bool bAddHistory=false)
const SG_Char * | Get_Execution_Info (void) const
CSG_String | Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)

Static Public Member Functions

static CSG_String | Get_Script (CSG_Tool *pTool, bool bHeader, bool bAllParameters=true)
static bool | Save_History_to_Model (const CSG_MetaData &History, const CSG_String &File)
- Static Public Member Functions inherited from CSG_Tool
static bool | Process_Get_Okay (bool bBlink=false)
static void | Process_Set_Text (const CSG_String &Text)
static void | Process_Set_Text (const char *Format,...)
static void | Process_Set_Text (const wchar_t *Format,...)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
static bool | DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
static CSG_Parameter * | DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal)

Protected Member Functions

virtual int | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
virtual bool | On_Execute (void)
- Protected Member Functions inherited from CSG_Tool
void | Set_Name (const CSG_String &String)
void | Set_Author (const CSG_String &String)
void | Set_Version (const CSG_String &String)
void | Set_Description (const CSG_String &String)
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
virtual int | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
TSG_PFNC_Parameter_Changed | Get_Parameter_Changed (void)
CSG_Parameters * | Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
bool | Dlg_Parameters (const CSG_String &Identifier)
bool | Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
virtual bool | Set_Progress (int Position, int Range) const
virtual bool | Set_Progress (sLong Position, sLong Range) const
virtual bool | Set_Progress (double Position, double Range=1.) const
bool | Stop_Execution (bool bDialog=true)
void | Message_Dlg (const CSG_String &Text, const SG_Char *Caption=NULL)
bool | Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption=NULL)
void | Message_Add (const CSG_String &Text, bool bNewLine=true)
void | Message_Fmt (const char *Format,...)
void | Message_Fmt (const wchar_t *Format,...)
bool | Error_Set (TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
bool | Error_Set (const CSG_String &Text)
bool | Error_Fmt (const char *Format,...)
bool | Error_Fmt (const wchar_t *Format,...)
bool | DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate=false)
void | DataObject_Update_All (void)
bool | DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
bool | Get_Projection (CSG_Projection &Projection) const

Additional Inherited Members

- Protected Attributes inherited from CSG_Tool
CSG_Parameters Parameters
CSG_MetaData History_Supplement

Detailed Description

CSG_Tool_Chain, the SAGA Model class.

Definition at line 77 of file tool_chain.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Chain() [1/4]

CSG_Tool_Chain::CSG_Tool_Chain ( void )

Definition at line 79 of file tool_chain.cpp.

◆ ~CSG_Tool_Chain()

CSG_Tool_Chain::~CSG_Tool_Chain ( void )
virtual

Definition at line 103 of file tool_chain.cpp.

◆ CSG_Tool_Chain() [2/4]

CSG_Tool_Chain::CSG_Tool_Chain | ( | const CSG_Tool_Chain & | Tool,
 |  | bool | bWithGUI
 | ) |  |

Definition at line 85 of file tool_chain.cpp.

References Create().

◆ CSG_Tool_Chain() [3/4]

CSG_Tool_Chain::CSG_Tool_Chain ( const CSG_String & File )

Definition at line 91 of file tool_chain.cpp.

References Create().

◆ CSG_Tool_Chain() [4/4]

CSG_Tool_Chain::CSG_Tool_Chain ( const CSG_MetaData & Chain )

Definition at line 97 of file tool_chain.cpp.

References Create().

Member Function Documentation

◆ Create() [1/3]

bool CSG_Tool_Chain::Create ( const CSG_MetaData & Chain )

Definition at line 198 of file tool_chain.cpp.

References _TL, CSG_Parameters::Add_Bool(), CSG_MetaData::Add_Child(), CSG_Parameters::Add_Choice(), CSG_Parameters::Add_Choices(), CSG_Parameters::Add_Color(), CSG_Parameters::Add_Colors(), CSG_Parameters::Add_Date(), CSG_Parameters::Add_Degree(), CSG_Parameters::Add_Double(), CSG_Parameters::Add_FilePath(), CSG_Parameters::Add_FixedTable(), CSG_Parameters::Add_Grid(), CSG_Parameters::Add_Grid_List(), CSG_Parameters::Add_Grid_Output(), CSG_Parameters::Add_Grid_System(), CSG_Parameters::Add_Grids(), CSG_Parameters::Add_Grids_List(), CSG_Parameters::Add_Grids_Output(), CSG_Parameters::Add_Int(), CSG_Parameters::Add_Node(), CSG_Parameters::Add_PointCloud(), CSG_Parameters::Add_PointCloud_List(), CSG_Parameters::Add_Range(), CSG_Parameters::Add_Shapes(), CSG_Parameters::Add_Shapes_List(), CSG_Parameters::Add_String(), CSG_Parameters::Add_Table(), CSG_Parameters::Add_Table_Field(), CSG_Parameters::Add_Table_Fields(), CSG_Parameters::Add_Table_List(), CSG_Parameters::Add_TIN(), CSG_Parameters::Add_TIN_List(), CSG_String::AfterFirst(), CSG_String::asDouble(), CSG_String::asInt(), CSG_String::BeforeFirst(), CSG_MetaData::Cmp_Name(), CSG_MetaData::Cmp_Property(), CSG_String::CmpNoCase(), CSG_Tool::Error_Fmt(), CSG_MetaData::Get_Children_Count(), CSG_MetaData::Get_Content(), CSG_Tool::Get_Description(), CSG_Parameter::Get_Identifier(), CSG_MetaData::Get_Property(), GET_XML_CONTENT, CSG_Tool::has_GUI(), CSG_String::is_Empty(), is_Okay(), IS_TRUE_PROPERTY, IS_TRUE_STRING, CSG_String::Length(), PARAMETER_INPUT, PARAMETER_INPUT_OPTIONAL, PARAMETER_OUTPUT, PARAMETER_OUTPUT_OPTIONAL, PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, PARAMETER_TYPE_TIN_List, CSG_Tool::Parameters, CSG_String::Prepend(), CSG_String::Replace(), CSG_Parameter::Serialize(), CSG_Tool::Set_Author(), CSG_Tool::Set_Description(), CSG_Tool::Set_Name(), CSG_Parameter::Set_Value(), SG_Compare_Version(), SG_Parameter_Type_Get_Type(), SG_T, SG_Translate(), SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, SHAPE_TYPE_Polygon, and SHAPE_TYPE_Undefined.

◆ Create() [2/3]

bool CSG_Tool_Chain::Create ( const CSG_String & File )

Definition at line 150 of file tool_chain.cpp.

References _TL, CSG_String::c_str(), CSG_String::Cmp(), CSG_MetaData::Cmp_Name(), Create(), CSG_Tool::Error_Fmt(), CSG_String::Find(), CSG_String::Format(), CSG_MetaData::Load(), CSG_String::Make_Lower(), CSG_String::Right(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, and SG_UI_MSG_STYLE_SUCCESS.

◆ Create() [3/3]

bool CSG_Tool_Chain::Create | ( | const CSG_Tool_Chain & | Tool,
 |  | bool | bWithGUI
 | ) |  |

Definition at line 133 of file tool_chain.cpp.

Referenced by Create(), and CSG_Tool_Chain().

◆ do_Sync_Projections()

virtual bool CSG_Tool_Chain::do_Sync_Projections ( void ) const
virtual

Reimplemented from CSG_Tool.

◆ Get_Library_Name()

const CSG_String& CSG_Tool_Chain::Get_Library_Name ( void ) const
inline

Definition at line 100 of file tool_chain.h.

◆ Get_MenuPath()

virtual CSG_String CSG_Tool_Chain::Get_MenuPath ( void )
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 99 of file tool_chain.h.

◆ Get_Script()

static CSG_String CSG_Tool_Chain::Get_Script | ( | CSG_Tool * | pTool,
 |  | bool | bHeader,
 |  | bool | bAllParameters = true
 | ) |  |
static

Referenced by CSG_Tool::Get_Script().

◆ Get_Type()

virtual TSG_Tool_Type CSG_Tool_Chain::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 92 of file tool_chain.h.

References TOOL_TYPE_Chain.

◆ is_Okay()

bool CSG_Tool_Chain::is_Okay ( void ) const
inline

Definition at line 96 of file tool_chain.h.

Referenced by Create().

◆ On_Execute()

virtual bool CSG_Tool_Chain::On_Execute ( void )
protectedvirtual

Implements CSG_Tool.

◆ On_Parameters_Enable()

virtual int CSG_Tool_Chain::On_Parameters_Enable | ( | CSG_Parameters * | pParameters,
 |  | CSG_Parameter * | pParameter
 | ) |  |
protectedvirtual

Reimplemented from CSG_Tool.

◆ Save_History_to_Model()

static bool CSG_Tool_Chain::Save_History_to_Model | ( | const CSG_MetaData & | History,
 |  | const CSG_String & | File
 | ) |  |
static

Referenced by CSG_Data_Object::Save_History_to_Model().

◆ Set_Library_Menu()

void CSG_Tool_Chain::Set_Library_Menu ( const CSG_String & Menu )

Definition at line 122 of file tool_chain.cpp.

The documentation for this class was generated from the following files:
  • tool_chain.h
  • tool_chain.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Chain Member List

This is the complete list of members for CSG_Tool_Chain, including all inherited members.

Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) | CSG_Tool | protected
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Create(const CSG_Tool_Chain &Tool, bool bWithGUI) | CSG_Tool_Chain |
Create(const CSG_String &File) | CSG_Tool_Chain |
Create(const CSG_MetaData &Chain) | CSG_Tool_Chain |
Create_Manager(void) | CSG_Tool |
CSG_Tool(void) | CSG_Tool |
CSG_Tool_Chain(void) | CSG_Tool_Chain |
CSG_Tool_Chain(const CSG_Tool_Chain &Tool, bool bWithGUI) | CSG_Tool_Chain |
CSG_Tool_Chain(const CSG_String &File) | CSG_Tool_Chain |
CSG_Tool_Chain(const CSG_MetaData &Chain) | CSG_Tool_Chain |
DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false) | CSG_Tool | protected
DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors) | CSG_Tool | static
DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID) | CSG_Tool | static
DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Tool | static
DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL) | CSG_Tool | protected
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, int Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update_All(void) | CSG_Tool | protected
Delete_Manager(bool bDetachData=false, bool bReset=true) | CSG_Tool |
Destroy(void) | CSG_Tool | virtual
Dlg_Parameters(const CSG_String &Identifier) | CSG_Tool | protected
Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption) | CSG_Tool | protected
do_Sync_Projections(void) const | CSG_Tool_Chain | virtual
Error_Fmt(const char *Format,...) | CSG_Tool | protected
Error_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown) | CSG_Tool | protected
Error_Set(const CSG_String &Text) | CSG_Tool | protected
Execute(bool bAddHistory=false) | CSG_Tool |
Get_Author(void) const | CSG_Tool |
Get_Description(void) const | CSG_Tool |
Get_Execution_Info(void) const | CSG_Tool | inline
Get_File_Name(void) const | CSG_Tool |
Get_Grid_System(void) const | CSG_Tool |
Get_Icon(void) | CSG_Tool | inline
Get_ID(void) const | CSG_Tool | inline
Get_Library(void) const | CSG_Tool |
Get_Library_Name(void) const | CSG_Tool_Chain | inline
Get_Manager(void) const | CSG_Tool |
Get_MenuPath(void) | CSG_Tool_Chain | inlinevirtual
CSG_Tool::Get_MenuPath(bool bSolved) | CSG_Tool | virtual
Get_Name(void) const | CSG_Tool |
Get_Parameter(const CSG_String &ID) const | CSG_Tool | inline
Get_Parameter(const char *ID) const | CSG_Tool | inline
Get_Parameter(const wchar_t *ID) const | CSG_Tool | inline
Get_Parameter_Changed(void) | CSG_Tool | inlineprotected
Get_Parameters(void) | CSG_Tool | inline
Get_Parameters(int i) | CSG_Tool | inline
Get_Parameters(const CSG_String &Identifier) | CSG_Tool |
Get_Parameters_Count(void) | CSG_Tool | inline
Get_Projection(CSG_Projection &Projection) const | CSG_Tool | protected
Get_References(void) const | CSG_Tool |
Get_Script(CSG_Tool *pTool, bool bHeader, bool bAllParameters=true) | CSG_Tool_Chain | static
CSG_Tool::Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false) | CSG_Tool |
Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML) | CSG_Tool |
Get_Type(void) const | CSG_Tool_Chain | inlinevirtual
Get_Version(void) const | CSG_Tool |
has_GUI(void) const | CSG_Tool |
History_Supplement | CSG_Tool | protected
is_Executing(void) const | CSG_Tool | inline
is_Grid(void) const | CSG_Tool | inlinevirtual
is_Interactive(void) const | CSG_Tool | inlinevirtual
is_Okay(void) const | CSG_Tool_Chain | inline
is_Progress(void) const | CSG_Tool | inline
Message_Add(const CSG_String &Text, bool bNewLine=true) | CSG_Tool | protected
Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Fmt(const char *Format,...) | CSG_Tool | protected
Message_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
needs_GUI(void) const | CSG_Tool | inlinevirtual
On_After_Execution(void) | CSG_Tool | inlinevirtual
On_Before_Execution(void) | CSG_Tool | inlinevirtual
On_Execute(void) | CSG_Tool_Chain | protectedvirtual
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool_Chain | protectedvirtual
Parameters | CSG_Tool | protected
Process_Get_Okay(bool bBlink=false) | CSG_Tool | static
Process_Set_Text(const CSG_String &Text) | CSG_Tool | static
Process_Set_Text(const char *Format,...) | CSG_Tool | static
Process_Set_Text(const wchar_t *Format,...) | CSG_Tool | static
CSG_Tool::Reset(bool bManager=true) | CSG_Tool |
Reset_Grid_System(void) | CSG_Tool |
Reset_Manager(void) | CSG_Tool |
Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File) | CSG_Tool_Chain | static
Set_Author(const CSG_String &String) | CSG_Tool | protected
Set_Callback(bool bActive=true) | CSG_Tool |
Set_Description(const CSG_String &String) | CSG_Tool | protected
Set_Grid_System(const CSG_Grid_System &System) | CSG_Tool |
Set_Library_Menu(const CSG_String &Menu) | CSG_Tool_Chain |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Tool |
Set_Name(const CSG_String &String) | CSG_Tool | protected
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Progress(int Position, int Range) const | CSG_Tool | protectedvirtual
Set_Progress(sLong Position, sLong Range) const | CSG_Tool | protectedvirtual
Set_Progress(double Position, double Range=1.) const | CSG_Tool | protectedvirtual
Set_Show_Progress(bool bOn=true) | CSG_Tool |
Set_Version(const CSG_String &String) | CSG_Tool | protected
Settings_Pop(void) | CSG_Tool |
Settings_Push(class CSG_Data_Manager *pManager=NULL) | CSG_Tool |
Stop_Execution(bool bDialog=true) | CSG_Tool | protected
Update_Parameter_States(void) | CSG_Tool |
~CSG_Tool(void) | CSG_Tool | virtual
~CSG_Tool_Chain(void) | CSG_Tool_Chain | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Chains Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Tool_Chains Class Reference

#include <tool_chain.h>

Inheritance diagram for CSG_Tool_Chains:
CSG_Tool_Library

Public Member Functions

virtual TSG_Tool_Library_Type | Get_Type (void) const
virtual CSG_String | Get_Info (int Type) const
bool | Add_Tool (CSG_Tool_Chain *pTool)
virtual int | Get_Count (void) const
virtual CSG_Tool * | Get_Tool (int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Create_Tool (const CSG_String &Name, bool bWithGUI=false)
virtual bool | Delete_Tool (CSG_Tool *pTool)
virtual bool | Delete_Tools (void)
virtual CSG_String | Get_File_Name (int Index) const
- Public Member Functions inherited from CSG_Tool_Library
bool | is_Valid (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Library_Name (void) const
CSG_String | Get_Name (void) const
CSG_String | Get_Description (void) const
CSG_String | Get_Author (void) const
CSG_String | Get_Version (void) const
CSG_String | Get_Menu (void) const
CSG_String | Get_Category (void) const
CSG_String | Get_Summary (int Format=SG_SUMMARY_FMT_HTML, bool bInteractive=true) const
bool | Get_Summary (const CSG_String &Path) const
virtual CSG_Tool * | Get_Tool (const CSG_String &Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Get_Tool (const char *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Get_Tool (const wchar_t *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Create_Tool (int Index, bool bWithGUI=false)
virtual CSG_Tool * | Create_Tool (const char *Name, bool bWithGUI=false)
virtual CSG_Tool * | Create_Tool (const wchar_t *Name, bool bWithGUI=false)
virtual CSG_String | Get_Menu (int i) const
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
void | Del_References (void)
const CSG_Strings & | Get_References (void) const

Protected Member Functions

CSG_Tool_Chains (const CSG_String &Library_Name, const CSG_String &Path)
virtual | ~CSG_Tool_Chains (void)
- Protected Member Functions inherited from CSG_Tool_Library
CSG_Tool_Library (void)
CSG_Tool_Library (const CSG_String &File)
virtual | ~CSG_Tool_Library (void)

Friends

class CSG_Tool_Library_Manager

Additional Inherited Members

- Protected Attributes inherited from CSG_Tool_Library
CSG_String m_File_Name
CSG_String m_Library_Name

Detailed Description

Definition at line 171 of file tool_chain.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Chains()

CSG_Tool_Chains::CSG_Tool_Chains | ( | const CSG_String & | Library_Name,
 |  | const CSG_String & | Path
 | ) |  |
protected

◆ ~CSG_Tool_Chains()

virtual CSG_Tool_Chains::~CSG_Tool_Chains ( void )
protectedvirtual

Member Function Documentation

◆ Add_Tool()

bool CSG_Tool_Chains::Add_Tool ( CSG_Tool_Chain * pTool )

◆ Create_Tool()

virtual CSG_Tool* CSG_Tool_Chains::Create_Tool | ( | const CSG_String & | Name,
 |  | bool | bWithGUI = false
 | ) |  |
virtual

Reimplemented from CSG_Tool_Library.

◆ Delete_Tool()

virtual bool CSG_Tool_Chains::Delete_Tool ( CSG_Tool * pTool )
virtual

Deletes a tool that has been created previously with a call to the 'Create_Tool()' function.

Reimplemented from CSG_Tool_Library.

◆ Delete_Tools()

virtual bool CSG_Tool_Chains::Delete_Tools ( void )
virtual

Reimplemented from CSG_Tool_Library.

◆ Get_Count()

virtual int CSG_Tool_Chains::Get_Count ( void ) const
inlinevirtual

Reimplemented from CSG_Tool_Library.

Definition at line 183 of file tool_chain.h.

◆ Get_File_Name()

virtual CSG_String CSG_Tool_Chains::Get_File_Name ( int Index ) const
inlinevirtual

Reimplemented from CSG_Tool_Library.

Definition at line 191 of file tool_chain.h.

References CSG_Tool_Library::Get_Count(), and Get_File_Name().

Referenced by Get_File_Name().

◆ Get_Info()

virtual CSG_String CSG_Tool_Chains::Get_Info ( int Type ) const
virtual

Reimplemented from CSG_Tool_Library.

◆ Get_Tool()

virtual CSG_Tool* CSG_Tool_Chains::Get_Tool | ( | int | Index,
 |  | TSG_Tool_Type | Type = TOOL_TYPE_Base
 | ) |  | const
 virtual

Reimplemented from CSG_Tool_Library.

◆ Get_Type()

virtual TSG_Tool_Library_Type CSG_Tool_Chains::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Tool_Library.

Definition at line 177 of file tool_chain.h.

References TOOL_CHAINS.

Friends And Related Function Documentation

◆ CSG_Tool_Library_Manager

friend class CSG_Tool_Library_Manager
friend

Definition at line 173 of file tool_chain.h.

The documentation for this class was generated from the following file:
  • tool_chain.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Chains Member List

This is the complete list of members for CSG_Tool_Chains, including all inherited members.

Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool_Library |
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool_Library |
Add_Tool(CSG_Tool_Chain *pTool) | CSG_Tool_Chains |
Create_Tool(const CSG_String &Name, bool bWithGUI=false) | CSG_Tool_Chains | virtual
CSG_Tool_Library::Create_Tool(int Index, bool bWithGUI=false) | CSG_Tool_Library | virtual
CSG_Tool_Library::Create_Tool(const char *Name, bool bWithGUI=false) | CSG_Tool_Library | virtual
CSG_Tool_Library::Create_Tool(const wchar_t *Name, bool bWithGUI=false) | CSG_Tool_Library | virtual
CSG_Tool_Chains(const CSG_String &Library_Name, const CSG_String &Path) | CSG_Tool_Chains | protected
CSG_Tool_Library(void) | CSG_Tool_Library | protected
CSG_Tool_Library(const CSG_String &File) | CSG_Tool_Library | protected
CSG_Tool_Library_Manager class | CSG_Tool_Chains | friend
Del_References(void) | CSG_Tool_Library |
Delete_Tool(CSG_Tool *pTool) | CSG_Tool_Chains | virtual
Delete_Tools(void) | CSG_Tool_Chains | virtual
Get_Author(void) const | CSG_Tool_Library | inline
Get_Category(void) const | CSG_Tool_Library | inline
Get_Count(void) const | CSG_Tool_Chains | inlinevirtual
Get_Description(void) const | CSG_Tool_Library | inline
Get_File_Name(int Index) const | CSG_Tool_Chains | inlinevirtual
CSG_Tool_Library::Get_File_Name(void) const | CSG_Tool_Library | inline
Get_Info(int Type) const | CSG_Tool_Chains | virtual
Get_Library_Name(void) const | CSG_Tool_Library | inline
Get_Menu(void) const | CSG_Tool_Library | inline
Get_Menu(int i) const | CSG_Tool_Library | virtual
Get_Name(void) const | CSG_Tool_Library | inline
Get_References(void) const | CSG_Tool_Library | inline
Get_Summary(int Format=SG_SUMMARY_FMT_HTML, bool bInteractive=true) const | CSG_Tool_Library |
Get_Summary(const CSG_String &Path) const | CSG_Tool_Library |
Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Chains | virtual
CSG_Tool_Library::Get_Tool(const CSG_String &Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
CSG_Tool_Library::Get_Tool(const char *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
CSG_Tool_Library::Get_Tool(const wchar_t *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
Get_Type(void) const | CSG_Tool_Chains | inlinevirtual
Get_Version(void) const | CSG_Tool_Library | inline
is_Valid(void) const | CSG_Tool_Library | inline
m_File_Name | CSG_Tool_Library | protected
m_Library_Name | CSG_Tool_Library | protected
~CSG_Tool_Chains(void) | CSG_Tool_Chains | protectedvirtual
~CSG_Tool_Library(void) | CSG_Tool_Library | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Grid Class Reference

Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
CSG_Tool_Grid Class Reference

#include <tool.h>

Inheritance diagram for CSG_Tool_Grid:
CSG_Tool CSG_Tool_Grid_Interactive

Public Member Functions

CSG_Tool_Grid (void)
virtual | ~CSG_Tool_Grid (void)
virtual TSG_Tool_Type | Get_Type (void) const
const CSG_Grid_System & | Get_System (void) const
bool | Set_System (const CSG_Grid_System &System)
virtual bool | is_Grid (void) const
- Public Member Functions inherited from CSG_Tool
CSG_Tool (void)
virtual | ~CSG_Tool (void)
virtual void | Destroy (void)
const CSG_String & | Get_ID (void) const
const CSG_String & | Get_Library (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_Author (void) const
const CSG_String & | Get_Version (void) const
const CSG_String & | Get_Description (void) const
const CSG_Strings & | Get_References (void) const
const SG_Char * | Get_Icon (void)
CSG_String | Get_Summary (bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
virtual CSG_String | Get_MenuPath (void)
virtual CSG_String | Get_MenuPath (bool bSolved)
int | Get_Parameters_Count (void)
CSG_Parameters * | Get_Parameters (void)
CSG_Parameters * | Get_Parameters (int i)
CSG_Parameters * | Get_Parameters (const CSG_String &Identifier)
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | Get_Parameter (const char *ID) const
CSG_Parameter * | Get_Parameter (const wchar_t *ID) const
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Reset (bool bManager=true)
bool | Reset_Manager (void)
bool | Reset_Grid_System (void)
bool | Update_Parameter_States (void)
void | Set_Callback (bool bActive=true)
bool | Set_Manager (class CSG_Data_Manager *pManager)
class CSG_Data_Manager * | Get_Manager (void) const
class CSG_Data_Manager * | Create_Manager (void)
bool | Delete_Manager (bool bDetachData=false, bool bReset=true)
bool | Set_Grid_System (const CSG_Grid_System &System)
CSG_Grid_System * | Get_Grid_System (void) const
bool | Settings_Push (class CSG_Data_Manager *pManager=NULL)
bool | Settings_Pop (void)
virtual bool | do_Sync_Projections (void) const
virtual bool | needs_GUI (void) const
bool | has_GUI (void) const
virtual bool | is_Interactive (void) const
bool | is_Progress (void) const
bool | is_Executing (void) const
void | Set_Show_Progress (bool bOn=true)
virtual bool | On_Before_Execution (void)
virtual bool | On_After_Execution (void)
bool | Execute (bool bAddHistory=false)
const SG_Char * | Get_Execution_Info (void) const
CSG_String | Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)

Protected Member Functions

virtual bool | Set_Progress_Cells (sLong Cell) const
virtual bool | Set_Progress_Rows (int Row) const
int | Get_NX (void) const
int | Get_NY (void) const
sLong | Get_NCells (void) const
double | Get_XMin (void) const
double | Get_YMin (void) const
double | Get_XMax (void) const
double | Get_YMax (void) const
double | Get_Cellsize (void) const
double | Get_Cellarea (void) const
double | Get_Length (int i) const
double | Get_UnitLength (int i) const
bool | is_InGrid (int x, int y) const
bool | is_InGrid (int x, int y, int Rand) const
void | Lock_Create (void)
void | Lock_Destroy (void)
bool | is_Locked (int x, int y)
char | Lock_Get (int x, int y)
void | Lock_Set (int x, int y, char Value=1)
- Protected Member Functions inherited from CSG_Tool
void | Set_Name (const CSG_String &String)
void | Set_Author (const CSG_String &String)
void | Set_Version (const CSG_String &String)
void | Set_Description (const CSG_String &String)
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
virtual bool | On_Execute (void)=0
virtual int | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
virtual int | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
TSG_PFNC_Parameter_Changed | Get_Parameter_Changed (void)
CSG_Parameters * | Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
bool | Dlg_Parameters (const CSG_String &Identifier)
bool | Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
virtual bool | Set_Progress (int Position, int Range) const
virtual bool | Set_Progress (sLong Position, sLong Range) const
virtual bool | Set_Progress (double Position, double Range=1.) const
bool | Stop_Execution (bool bDialog=true)
void | Message_Dlg (const CSG_String &Text, const SG_Char *Caption=NULL)
bool | Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption=NULL)
void | Message_Add (const CSG_String &Text, bool bNewLine=true)
void | Message_Fmt (const char *Format,...)
void | Message_Fmt (const wchar_t *Format,...)
bool | Error_Set (TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
bool | Error_Set (const CSG_String &Text)
bool | Error_Fmt (const char *Format,...)
bool | Error_Fmt (const wchar_t *Format,...)
bool | DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate=false)
void | DataObject_Update_All (void)
bool | DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
bool | Get_Projection (CSG_Projection &Projection) const

Static Protected Member Functions

static int | Get_xTo (int i, int x=0)
static int | Get_yTo (int i, int y=0)
static int | Get_xFrom (int i, int x=0)
static int | Get_yFrom (int i, int y=0)

Additional Inherited Members

- Static Public Member Functions inherited from CSG_Tool
static bool | Process_Get_Okay (bool bBlink=false)
static void | Process_Set_Text (const CSG_String &Text)
static void | Process_Set_Text (const char *Format,...)
static void | Process_Set_Text (const wchar_t *Format,...)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
static bool | DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
static CSG_Parameter * | DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal)
- Protected Attributes inherited from CSG_Tool
CSG_Parameters Parameters
CSG_MetaData History_Supplement

Detailed Description

CSG_Tool_Grid.

Definition at line 380 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Grid()

CSG_Tool_Grid::CSG_Tool_Grid ( void )

Definition at line 63 of file tool_grid.cpp.

References CSG_Tool::Parameters, and CSG_Parameters::Use_Grid_System().

◆ ~CSG_Tool_Grid()

CSG_Tool_Grid::~CSG_Tool_Grid ( void )
virtual

Definition at line 72 of file tool_grid.cpp.

References Lock_Destroy().

Member Function Documentation

◆ Get_Cellarea()

double CSG_Tool_Grid::Get_Cellarea ( void ) const
inlineprotected

Definition at line 408 of file tool.h.

References Get_Cellarea().

Referenced by Get_Cellarea().

◆ Get_Cellsize()

double CSG_Tool_Grid::Get_Cellsize ( void ) const
inlineprotected

Definition at line 407 of file tool.h.

References Get_Cellsize().

Referenced by Get_Cellsize(), CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_xGrid(), CSG_Tool_Grid_Interactive::Get_yGrid(), and Lock_Create().

◆ Get_Length()

double CSG_Tool_Grid::Get_Length ( int i ) const
inlineprotected

Definition at line 410 of file tool.h.

◆ Get_NCells()

sLong CSG_Tool_Grid::Get_NCells ( void ) const
inlineprotected

Definition at line 402 of file tool.h.

Referenced by Set_Progress_Cells().

◆ Get_NX()

int CSG_Tool_Grid::Get_NX ( void ) const
inlineprotected

Definition at line 400 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_xGrid(), and Lock_Create().

◆ Get_NY()

int CSG_Tool_Grid::Get_NY ( void ) const
inlineprotected

Definition at line 401 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_yGrid(), Lock_Create(), and Set_Progress_Rows().

◆ Get_System()

const CSG_Grid_System& CSG_Tool_Grid::Get_System ( void ) const
inline

Definition at line 388 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_xGrid(), CSG_Tool_Grid_Interactive::Get_yGrid(), Lock_Create(), and Set_Progress_Cells().

◆ Get_Type()

virtual TSG_Tool_Type CSG_Tool_Grid::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Reimplemented in CSG_Tool_Grid_Interactive.

Definition at line 386 of file tool.h.

References TOOL_TYPE_Grid.

◆ Get_UnitLength()

double CSG_Tool_Grid::Get_UnitLength ( int i ) const
inlineprotected

Definition at line 411 of file tool.h.

References Get_UnitLength().

Referenced by Get_UnitLength().

◆ Get_xFrom()

static int CSG_Tool_Grid::Get_xFrom | ( | int | i,
 |  | int | x = 0
 | ) |  |
inlinestaticprotected

Definition at line 417 of file tool.h.

References CSG_Grid_System::Get_xFrom().

◆ Get_XMax()

double CSG_Tool_Grid::Get_XMax ( void ) const
inlineprotected

Definition at line 405 of file tool.h.

◆ Get_XMin()

double CSG_Tool_Grid::Get_XMin ( void ) const
inlineprotected

Definition at line 403 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_xGrid(), and Lock_Create().

◆ Get_xTo()

static int CSG_Tool_Grid::Get_xTo | ( | int | i,
 |  | int | x = 0
 | ) |  |
inlinestaticprotected

Definition at line 415 of file tool.h.

References CSG_Grid_System::Get_xTo().

◆ Get_yFrom()

static int CSG_Tool_Grid::Get_yFrom | ( | int | i,
 |  | int | y = 0
 | ) |  |
inlinestaticprotected

Definition at line 418 of file tool.h.

References CSG_Grid_System::Get_yFrom().

◆ Get_YMax()

double CSG_Tool_Grid::Get_YMax ( void ) const
inlineprotected

Definition at line 406 of file tool.h.

◆ Get_YMin()

double CSG_Tool_Grid::Get_YMin ( void ) const
inlineprotected

Definition at line 404 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), CSG_Tool_Grid_Interactive::Get_yGrid(), and Lock_Create().

◆ Get_yTo()

static int CSG_Tool_Grid::Get_yTo | ( | int | i,
 |  | int | y = 0
 | ) |  |
inlinestaticprotected

Definition at line 416 of file tool.h.

References CSG_Grid_System::Get_yTo().

◆ is_Grid()

virtual bool CSG_Tool_Grid::is_Grid ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 391 of file tool.h.

◆ is_InGrid() [1/2]

bool CSG_Tool_Grid::is_InGrid | ( | int | x,
 |  | int | y
 | ) |  | const
 inlineprotected

Definition at line 412 of file tool.h.

References is_InGrid().

Referenced by is_InGrid().

◆ is_InGrid() [2/2]

bool CSG_Tool_Grid::is_InGrid | ( | int | x,
 |  | int | y,
 |  | int | Rand
 | ) |  | const
 inlineprotected

Definition at line 413 of file tool.h.

References is_InGrid().

Referenced by is_InGrid().

◆ is_Locked()

bool CSG_Tool_Grid::is_Locked | ( | int | x,
 |  | int | y
 | ) |  |
inlineprotected

Definition at line 424 of file tool.h.

◆ Lock_Create()

void CSG_Tool_Grid::Lock_Create ( void )
protected

Definition at line 121 of file tool_grid.cpp.

References CSG_Grid::Assign(), Get_Cellsize(), Get_NX(), Get_NY(), CSG_Grid::Get_System(), Get_System(), Get_XMin(), Get_YMin(), Lock_Destroy(), and SG_DATATYPE_Char.

◆ Lock_Destroy()

void CSG_Tool_Grid::Lock_Destroy ( void )
protected

Definition at line 141 of file tool_grid.cpp.

Referenced by Lock_Create(), and ~CSG_Tool_Grid().

◆ Lock_Get()

char CSG_Tool_Grid::Lock_Get | ( | int | x,
 |  | int | y
 | ) |  |
inlineprotected

Definition at line 425 of file tool.h.

◆ Lock_Set()

void CSG_Tool_Grid::Lock_Set | ( | int | x,
 |  | int | y,
 |  | char | Value = 1
 | ) |  |
inlineprotected

Definition at line 427 of file tool.h.

◆ Set_Progress_Cells()

bool CSG_Tool_Grid::Set_Progress_Cells ( sLong Cell ) const
protectedvirtual

Definition at line 99 of file tool_grid.cpp.

References Get_NCells(), Get_System(), CSG_Tool::is_Progress(), and CSG_Tool::Set_Progress().

◆ Set_Progress_Rows()

bool CSG_Tool_Grid::Set_Progress_Rows ( int Row ) const
protectedvirtual

Definition at line 110 of file tool_grid.cpp.

References Get_NY(), and CSG_Tool::Set_Progress().

◆ Set_System()

bool CSG_Tool_Grid::Set_System ( const CSG_Grid_System & System )

Definition at line 83 of file tool_grid.cpp.

References CSG_Grid_System::Create(), CSG_Parameters::Get_Grid_System(), and CSG_Tool::Parameters.

The documentation for this class was generated from the following files:
  • tool.h
  • tool_grid.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Grid Member List

This is the complete list of members for CSG_Tool_Grid, including all inherited members.

Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) | CSG_Tool | protected
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Create_Manager(void) | CSG_Tool |
CSG_Tool(void) | CSG_Tool |
CSG_Tool_Grid(void) | CSG_Tool_Grid |
DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false) | CSG_Tool | protected
DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors) | CSG_Tool | static
DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID) | CSG_Tool | static
DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Tool | static
DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL) | CSG_Tool | protected
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, int Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update_All(void) | CSG_Tool | protected
Delete_Manager(bool bDetachData=false, bool bReset=true) | CSG_Tool |
Destroy(void) | CSG_Tool | virtual
Dlg_Parameters(const CSG_String &Identifier) | CSG_Tool | protected
Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption) | CSG_Tool | protected
do_Sync_Projections(void) const | CSG_Tool | inlinevirtual
Error_Fmt(const char *Format,...) | CSG_Tool | protected
Error_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown) | CSG_Tool | protected
Error_Set(const CSG_String &Text) | CSG_Tool | protected
Execute(bool bAddHistory=false) | CSG_Tool |
Get_Author(void) const | CSG_Tool |
Get_Cellarea(void) const | CSG_Tool_Grid | inlineprotected
Get_Cellsize(void) const | CSG_Tool_Grid | inlineprotected
Get_Description(void) const | CSG_Tool |
Get_Execution_Info(void) const | CSG_Tool | inline
Get_File_Name(void) const | CSG_Tool |
Get_Grid_System(void) const | CSG_Tool |
Get_Icon(void) | CSG_Tool | inline
Get_ID(void) const | CSG_Tool | inline
Get_Length(int i) const | CSG_Tool_Grid | inlineprotected
Get_Library(void) const | CSG_Tool |
Get_Manager(void) const | CSG_Tool |
Get_MenuPath(void) | CSG_Tool | inlinevirtual
Get_MenuPath(bool bSolved) | CSG_Tool | virtual
Get_Name(void) const | CSG_Tool |
Get_NCells(void) const | CSG_Tool_Grid | inlineprotected
Get_NX(void) const | CSG_Tool_Grid | inlineprotected
Get_NY(void) const | CSG_Tool_Grid | inlineprotected
Get_Parameter(const CSG_String &ID) const | CSG_Tool | inline
Get_Parameter(const char *ID) const | CSG_Tool | inline
Get_Parameter(const wchar_t *ID) const | CSG_Tool | inline
Get_Parameter_Changed(void) | CSG_Tool | inlineprotected
Get_Parameters(void) | CSG_Tool | inline
Get_Parameters(int i) | CSG_Tool | inline
Get_Parameters(const CSG_String &Identifier) | CSG_Tool |
Get_Parameters_Count(void) | CSG_Tool | inline
Get_Projection(CSG_Projection &Projection) const | CSG_Tool | protected
Get_References(void) const | CSG_Tool |
Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false) | CSG_Tool |
Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML) | CSG_Tool |
Get_System(void) const | CSG_Tool_Grid | inline
Get_Type(void) const | CSG_Tool_Grid | inlinevirtual
Get_UnitLength(int i) const | CSG_Tool_Grid | inlineprotected
Get_Version(void) const | CSG_Tool |
Get_xFrom(int i, int x=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_XMax(void) const | CSG_Tool_Grid | inlineprotected
Get_XMin(void) const | CSG_Tool_Grid | inlineprotected
Get_xTo(int i, int x=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_yFrom(int i, int y=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_YMax(void) const | CSG_Tool_Grid | inlineprotected
Get_YMin(void) const | CSG_Tool_Grid | inlineprotected
Get_yTo(int i, int y=0) | CSG_Tool_Grid | inlineprotectedstatic
has_GUI(void) const | CSG_Tool |
History_Supplement | CSG_Tool | protected
is_Executing(void) const | CSG_Tool | inline
is_Grid(void) const | CSG_Tool_Grid | inlinevirtual
is_InGrid(int x, int y) const | CSG_Tool_Grid | inlineprotected
is_InGrid(int x, int y, int Rand) const | CSG_Tool_Grid | inlineprotected
is_Interactive(void) const | CSG_Tool | inlinevirtual
is_Locked(int x, int y) | CSG_Tool_Grid | inlineprotected
is_Progress(void) const | CSG_Tool | inline
Lock_Create(void) | CSG_Tool_Grid | protected
Lock_Destroy(void) | CSG_Tool_Grid | protected
Lock_Get(int x, int y) | CSG_Tool_Grid | inlineprotected
Lock_Set(int x, int y, char Value=1) | CSG_Tool_Grid | inlineprotected
Message_Add(const CSG_String &Text, bool bNewLine=true) | CSG_Tool | protected
Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Fmt(const char *Format,...) | CSG_Tool | protected
Message_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
needs_GUI(void) const | CSG_Tool | inlinevirtual
On_After_Execution(void) | CSG_Tool | inlinevirtual
On_Before_Execution(void) | CSG_Tool | inlinevirtual
On_Execute(void)=0 | CSG_Tool | protectedpure virtual
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
Parameters | CSG_Tool | protected
Process_Get_Okay(bool bBlink=false) | CSG_Tool | static
Process_Set_Text(const CSG_String &Text) | CSG_Tool | static
Process_Set_Text(const char *Format,...) | CSG_Tool | static
Process_Set_Text(const wchar_t *Format,...) | CSG_Tool | static
Reset(bool bManager=true) | CSG_Tool |
Reset_Grid_System(void) | CSG_Tool |
Reset_Manager(void) | CSG_Tool |
Set_Author(const CSG_String &String) | CSG_Tool | protected
Set_Callback(bool bActive=true) | CSG_Tool |
Set_Description(const CSG_String &String) | CSG_Tool | protected
Set_Grid_System(const CSG_Grid_System &System) | CSG_Tool |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Tool |
Set_Name(const CSG_String &String) | CSG_Tool | protected
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Progress(int Position, int Range) const | CSG_Tool | protectedvirtual
Set_Progress(sLong Position, sLong Range) const | CSG_Tool | protectedvirtual
Set_Progress(double Position, double Range=1.) const | CSG_Tool | protectedvirtual
Set_Progress_Cells(sLong Cell) const | CSG_Tool_Grid | protectedvirtual
Set_Progress_Rows(int Row) const | CSG_Tool_Grid | protectedvirtual
Set_Show_Progress(bool bOn=true) | CSG_Tool |
Set_System(const CSG_Grid_System &System) | CSG_Tool_Grid |
Set_Version(const CSG_String &String) | CSG_Tool | protected
Settings_Pop(void) | CSG_Tool |
Settings_Push(class CSG_Data_Manager *pManager=NULL) | CSG_Tool |
Stop_Execution(bool bDialog=true) | CSG_Tool | protected
Update_Parameter_States(void) | CSG_Tool |
~CSG_Tool(void) | CSG_Tool | virtual
~CSG_Tool_Grid(void) | CSG_Tool_Grid | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Grid_Interactive Class Reference

Public Member Functions | Protected Member Functions | List of all members
CSG_Tool_Grid_Interactive Class Reference

#include <tool.h>

Inheritance diagram for CSG_Tool_Grid_Interactive:
CSG_Tool_Interactive_Base CSG_Tool_Grid CSG_Tool

Public Member Functions

CSG_Tool_Grid_Interactive (void)
virtual | ~CSG_Tool_Grid_Interactive (void)
virtual TSG_Tool_Type | Get_Type (void) const
virtual bool | needs_GUI (void) const
virtual bool | is_Interactive (void) const
- Public Member Functions inherited from CSG_Tool_Interactive_Base
CSG_Tool_Interactive_Base (void)
virtual | ~CSG_Tool_Interactive_Base (void)
bool | Set_Projection (const CSG_Projection &Projection)
bool | Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
bool | Execute_Keyboard (int Character, int Keys)
bool | Execute_Finish (void)
int | Get_Drag_Mode (void) const
- Public Member Functions inherited from CSG_Tool_Grid
CSG_Tool_Grid (void)
virtual | ~CSG_Tool_Grid (void)
const CSG_Grid_System & | Get_System (void) const
bool | Set_System (const CSG_Grid_System &System)
virtual bool | is_Grid (void) const
- Public Member Functions inherited from CSG_Tool
CSG_Tool (void)
virtual | ~CSG_Tool (void)
virtual void | Destroy (void)
const CSG_String & | Get_ID (void) const
const CSG_String & | Get_Library (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_Author (void) const
const CSG_String & | Get_Version (void) const
const CSG_String & | Get_Description (void) const
const CSG_Strings & | Get_References (void) const
const SG_Char * | Get_Icon (void)
CSG_String | Get_Summary (bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
virtual CSG_String | Get_MenuPath (void)
virtual CSG_String | Get_MenuPath (bool bSolved)
int | Get_Parameters_Count (void)
CSG_Parameters * | Get_Parameters (void)
CSG_Parameters * | Get_Parameters (int i)
CSG_Parameters * | Get_Parameters (const CSG_String &Identifier)
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | Get_Parameter (const char *ID) const
CSG_Parameter * | Get_Parameter (const wchar_t *ID) const
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Reset (bool bManager=true)
bool | Reset_Manager (void)
bool | Reset_Grid_System (void)
bool | Update_Parameter_States (void)
void | Set_Callback (bool bActive=true)
bool | Set_Manager (class CSG_Data_Manager *pManager)
class CSG_Data_Manager * | Get_Manager (void) const
class CSG_Data_Manager * | Create_Manager (void)
bool | Delete_Manager (bool bDetachData=false, bool bReset=true)
bool | Set_Grid_System (const CSG_Grid_System &System)
CSG_Grid_System * | Get_Grid_System (void) const
bool | Settings_Push (class CSG_Data_Manager *pManager=NULL)
bool | Settings_Pop (void)
virtual bool | do_Sync_Projections (void) const
bool | has_GUI (void) const
bool | is_Progress (void) const
bool | is_Executing (void) const
void | Set_Show_Progress (bool bOn=true)
virtual bool | On_Before_Execution (void)
virtual bool | On_After_Execution (void)
bool | Execute (bool bAddHistory=false)
const SG_Char * | Get_Execution_Info (void) const
CSG_String | Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)

Protected Member Functions

bool | Get_Grid_Pos (int &x, int &y) const
int | Get_xGrid (void) const
int | Get_yGrid (void) const
- Protected Member Functions inherited from CSG_Tool_Interactive_Base
const CSG_Projection & | Get_Projection (void) const
virtual bool | On_Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
virtual bool | On_Execute_Keyboard (int Character)
virtual bool | On_Execute_Finish (void)
const CSG_Point & | Get_Position (void) const
double | Get_xPosition (void) const
double | Get_yPosition (void) const
const CSG_Point & | Get_Position_Last (void) const
double | Get_xPosition_Last (void) const
double | Get_yPosition_Last (void) const
bool | is_Shift (void) const
bool | is_Alt (void) const
bool | is_Ctrl (void) const
void | Set_Drag_Mode (int Drag_Mode)
- Protected Member Functions inherited from CSG_Tool_Grid
virtual bool | Set_Progress_Cells (sLong Cell) const
virtual bool | Set_Progress_Rows (int Row) const
int | Get_NX (void) const
int | Get_NY (void) const
sLong | Get_NCells (void) const
double | Get_XMin (void) const
double | Get_YMin (void) const
double | Get_XMax (void) const
double | Get_YMax (void) const
double | Get_Cellsize (void) const
double | Get_Cellarea (void) const
double | Get_Length (int i) const
double | Get_UnitLength (int i) const
bool | is_InGrid (int x, int y) const
bool | is_InGrid (int x, int y, int Rand) const
void | Lock_Create (void)
void | Lock_Destroy (void)
bool | is_Locked (int x, int y)
char | Lock_Get (int x, int y)
void | Lock_Set (int x, int y, char Value=1)
- Protected Member Functions inherited from CSG_Tool
void | Set_Name (const CSG_String &String)
void | Set_Author (const CSG_String &String)
void | Set_Version (const CSG_String &String)
void | Set_Description (const CSG_String &String)
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
virtual bool | On_Execute (void)=0
virtual int | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
virtual int | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
TSG_PFNC_Parameter_Changed | Get_Parameter_Changed (void)
CSG_Parameters * | Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
bool | Dlg_Parameters (const CSG_String &Identifier)
bool | Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
virtual bool | Set_Progress (int Position, int Range) const
virtual bool | Set_Progress (sLong Position, sLong Range) const
virtual bool | Set_Progress (double Position, double Range=1.) const
bool | Stop_Execution (bool bDialog=true)
void | Message_Dlg (const CSG_String &Text, const SG_Char *Caption=NULL)
bool | Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption=NULL)
void | Message_Add (const CSG_String &Text, bool bNewLine=true)
void | Message_Fmt (const char *Format,...)
void | Message_Fmt (const wchar_t *Format,...)
bool | Error_Set (TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
bool | Error_Set (const CSG_String &Text)
bool | Error_Fmt (const char *Format,...)
bool | Error_Fmt (const wchar_t *Format,...)
bool | DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate=false)
void | DataObject_Update_All (void)
bool | DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
bool | Get_Projection (CSG_Projection &Projection) const

Additional Inherited Members

- Static Public Member Functions inherited from CSG_Tool
static bool | Process_Get_Okay (bool bBlink=false)
static void | Process_Set_Text (const CSG_String &Text)
static void | Process_Set_Text (const char *Format,...)
static void | Process_Set_Text (const wchar_t *Format,...)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
static bool | DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
static CSG_Parameter * | DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal)
- Static Protected Member Functions inherited from CSG_Tool_Grid
static int | Get_xTo (int i, int x=0)
static int | Get_yTo (int i, int y=0)
static int | Get_xFrom (int i, int x=0)
static int | Get_yFrom (int i, int y=0)
- Protected Attributes inherited from CSG_Tool
CSG_Parameters Parameters
CSG_MetaData History_Supplement

Detailed Description

CSG_Tool_Grid_Interactive.

Definition at line 583 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Grid_Interactive()

CSG_Tool_Grid_Interactive::CSG_Tool_Grid_Interactive ( void )

Definition at line 63 of file tool_grid_interactive.cpp.

◆ ~CSG_Tool_Grid_Interactive()

CSG_Tool_Grid_Interactive::~CSG_Tool_Grid_Interactive ( void )
virtual

Definition at line 69 of file tool_grid_interactive.cpp.

Member Function Documentation

◆ Get_Grid_Pos()

bool CSG_Tool_Grid_Interactive::Get_Grid_Pos | ( | int & | x,
 |  | int & | y
 | ) |  | const
 protected

Definition at line 79 of file tool_grid_interactive.cpp.

References CSG_Tool_Grid::Get_Cellsize(), CSG_Tool_Grid::Get_NX(), CSG_Tool_Grid::Get_NY(), CSG_Tool_Grid::Get_System(), CSG_Tool_Grid::Get_XMin(), CSG_Tool_Interactive_Base::Get_xPosition(), CSG_Tool_Grid::Get_YMin(), and CSG_Tool_Interactive_Base::Get_yPosition().

◆ Get_Type()

virtual TSG_Tool_Type CSG_Tool_Grid_Interactive::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Tool_Grid.

Definition at line 589 of file tool.h.

References TOOL_TYPE_Grid_Interactive.

◆ Get_xGrid()

int CSG_Tool_Grid_Interactive::Get_xGrid ( void ) const
protected

Definition at line 100 of file tool_grid_interactive.cpp.

References CSG_Tool_Grid::Get_Cellsize(), CSG_Tool_Grid::Get_NX(), CSG_Tool_Grid::Get_System(), CSG_Tool_Grid::Get_XMin(), and CSG_Tool_Interactive_Base::Get_xPosition().

◆ Get_yGrid()

int CSG_Tool_Grid_Interactive::Get_yGrid ( void ) const
protected

Definition at line 113 of file tool_grid_interactive.cpp.

References CSG_Tool_Grid::Get_Cellsize(), CSG_Tool_Grid::Get_NY(), CSG_Tool_Grid::Get_System(), CSG_Tool_Grid::Get_YMin(), and CSG_Tool_Interactive_Base::Get_yPosition().

◆ is_Interactive()

virtual bool CSG_Tool_Grid_Interactive::is_Interactive ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 593 of file tool.h.

◆ needs_GUI()

virtual bool CSG_Tool_Grid_Interactive::needs_GUI ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 591 of file tool.h.

The documentation for this class was generated from the following files:
  • tool.h
  • tool_grid_interactive.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Grid_Interactive Member List

This is the complete list of members for CSG_Tool_Grid_Interactive, including all inherited members.

Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) | CSG_Tool | protected
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Create_Manager(void) | CSG_Tool |
CSG_Tool(void) | CSG_Tool |
CSG_Tool_Grid(void) | CSG_Tool_Grid |
CSG_Tool_Grid_Interactive(void) | CSG_Tool_Grid_Interactive |
CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base |
DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false) | CSG_Tool | protected
DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors) | CSG_Tool | static
DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID) | CSG_Tool | static
DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Tool | static
DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL) | CSG_Tool | protected
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, int Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update_All(void) | CSG_Tool | protected
Delete_Manager(bool bDetachData=false, bool bReset=true) | CSG_Tool |
Destroy(void) | CSG_Tool | virtual
Dlg_Parameters(const CSG_String &Identifier) | CSG_Tool | protected
Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption) | CSG_Tool | protected
do_Sync_Projections(void) const | CSG_Tool | inlinevirtual
Error_Fmt(const char *Format,...) | CSG_Tool | protected
Error_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown) | CSG_Tool | protected
Error_Set(const CSG_String &Text) | CSG_Tool | protected
Execute(bool bAddHistory=false) | CSG_Tool |
Execute_Finish(void) | CSG_Tool_Interactive_Base |
Execute_Keyboard(int Character, int Keys) | CSG_Tool_Interactive_Base |
Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys) | CSG_Tool_Interactive_Base |
Get_Author(void) const | CSG_Tool |
Get_Cellarea(void) const | CSG_Tool_Grid | inlineprotected
Get_Cellsize(void) const | CSG_Tool_Grid | inlineprotected
Get_Description(void) const | CSG_Tool |
Get_Drag_Mode(void) const | CSG_Tool_Interactive_Base | inline
Get_Execution_Info(void) const | CSG_Tool | inline
Get_File_Name(void) const | CSG_Tool |
Get_Grid_Pos(int &x, int &y) const | CSG_Tool_Grid_Interactive | protected
Get_Grid_System(void) const | CSG_Tool |
Get_Icon(void) | CSG_Tool | inline
Get_ID(void) const | CSG_Tool | inline
Get_Length(int i) const | CSG_Tool_Grid | inlineprotected
Get_Library(void) const | CSG_Tool |
Get_Manager(void) const | CSG_Tool |
Get_MenuPath(void) | CSG_Tool | inlinevirtual
Get_MenuPath(bool bSolved) | CSG_Tool | virtual
Get_Name(void) const | CSG_Tool |
Get_NCells(void) const | CSG_Tool_Grid | inlineprotected
Get_NX(void) const | CSG_Tool_Grid | inlineprotected
Get_NY(void) const | CSG_Tool_Grid | inlineprotected
Get_Parameter(const CSG_String &ID) const | CSG_Tool | inline
Get_Parameter(const char *ID) const | CSG_Tool | inline
Get_Parameter(const wchar_t *ID) const | CSG_Tool | inline
Get_Parameter_Changed(void) | CSG_Tool | inlineprotected
Get_Parameters(void) | CSG_Tool | inline
Get_Parameters(int i) | CSG_Tool | inline
Get_Parameters(const CSG_String &Identifier) | CSG_Tool |
Get_Parameters_Count(void) | CSG_Tool | inline
Get_Position(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_Position_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
CSG_Tool_Interactive_Base::Get_Projection(void) const | CSG_Tool_Interactive_Base | inlineprotected
CSG_Tool_Grid::Get_Projection(CSG_Projection &Projection) const | CSG_Tool | protected
Get_References(void) const | CSG_Tool |
Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false) | CSG_Tool |
Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML) | CSG_Tool |
Get_System(void) const | CSG_Tool_Grid | inline
Get_Type(void) const | CSG_Tool_Grid_Interactive | inlinevirtual
Get_UnitLength(int i) const | CSG_Tool_Grid | inlineprotected
Get_Version(void) const | CSG_Tool |
Get_xFrom(int i, int x=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_xGrid(void) const | CSG_Tool_Grid_Interactive | protected
Get_XMax(void) const | CSG_Tool_Grid | inlineprotected
Get_XMin(void) const | CSG_Tool_Grid | inlineprotected
Get_xPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_xPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_xTo(int i, int x=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_yFrom(int i, int y=0) | CSG_Tool_Grid | inlineprotectedstatic
Get_yGrid(void) const | CSG_Tool_Grid_Interactive | protected
Get_YMax(void) const | CSG_Tool_Grid | inlineprotected
Get_YMin(void) const | CSG_Tool_Grid | inlineprotected
Get_yPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yTo(int i, int y=0) | CSG_Tool_Grid | inlineprotectedstatic
has_GUI(void) const | CSG_Tool |
History_Supplement | CSG_Tool | protected
is_Alt(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Ctrl(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Executing(void) const | CSG_Tool | inline
is_Grid(void) const | CSG_Tool_Grid | inlinevirtual
is_InGrid(int x, int y) const | CSG_Tool_Grid | inlineprotected
is_InGrid(int x, int y, int Rand) const | CSG_Tool_Grid | inlineprotected
is_Interactive(void) const | CSG_Tool_Grid_Interactive | inlinevirtual
is_Locked(int x, int y) | CSG_Tool_Grid | inlineprotected
is_Progress(void) const | CSG_Tool | inline
is_Shift(void) const | CSG_Tool_Interactive_Base | inlineprotected
Lock_Create(void) | CSG_Tool_Grid | protected
Lock_Destroy(void) | CSG_Tool_Grid | protected
Lock_Get(int x, int y) | CSG_Tool_Grid | inlineprotected
Lock_Set(int x, int y, char Value=1) | CSG_Tool_Grid | inlineprotected
Message_Add(const CSG_String &Text, bool bNewLine=true) | CSG_Tool | protected
Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Fmt(const char *Format,...) | CSG_Tool | protected
Message_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
needs_GUI(void) const | CSG_Tool_Grid_Interactive | inlinevirtual
On_After_Execution(void) | CSG_Tool | inlinevirtual
On_Before_Execution(void) | CSG_Tool | inlinevirtual
On_Execute(void)=0 | CSG_Tool | protectedpure virtual
On_Execute_Finish(void) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Keyboard(int Character) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode) | CSG_Tool_Interactive_Base | protectedvirtual
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
Parameters | CSG_Tool | protected
Process_Get_Okay(bool bBlink=false) | CSG_Tool | static
Process_Set_Text(const CSG_String &Text) | CSG_Tool | static
Process_Set_Text(const char *Format,...) | CSG_Tool | static
Process_Set_Text(const wchar_t *Format,...) | CSG_Tool | static
Reset(bool bManager=true) | CSG_Tool |
Reset_Grid_System(void) | CSG_Tool |
Reset_Manager(void) | CSG_Tool |
Set_Author(const CSG_String &String) | CSG_Tool | protected
Set_Callback(bool bActive=true) | CSG_Tool |
Set_Description(const CSG_String &String) | CSG_Tool | protected
Set_Drag_Mode(int Drag_Mode) | CSG_Tool_Interactive_Base | protected
Set_Grid_System(const CSG_Grid_System &System) | CSG_Tool |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Tool |
Set_Name(const CSG_String &String) | CSG_Tool | protected
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Progress(int Position, int Range) const | CSG_Tool | protectedvirtual
Set_Progress(sLong Position, sLong Range) const | CSG_Tool | protectedvirtual
Set_Progress(double Position, double Range=1.) const | CSG_Tool | protectedvirtual
Set_Progress_Cells(sLong Cell) const | CSG_Tool_Grid | protectedvirtual
Set_Progress_Rows(int Row) const | CSG_Tool_Grid | protectedvirtual
Set_Projection(const CSG_Projection &Projection) | CSG_Tool_Interactive_Base |
Set_Show_Progress(bool bOn=true) | CSG_Tool |
Set_System(const CSG_Grid_System &System) | CSG_Tool_Grid |
Set_Version(const CSG_String &String) | CSG_Tool | protected
Settings_Pop(void) | CSG_Tool |
Settings_Push(class CSG_Data_Manager *pManager=NULL) | CSG_Tool |
Stop_Execution(bool bDialog=true) | CSG_Tool | protected
Update_Parameter_States(void) | CSG_Tool |
~CSG_Tool(void) | CSG_Tool | virtual
~CSG_Tool_Grid(void) | CSG_Tool_Grid | virtual
~CSG_Tool_Grid_Interactive(void) | CSG_Tool_Grid_Interactive | virtual
~CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Interactive Class Reference

Public Member Functions | List of all members
CSG_Tool_Interactive Class Reference

#include <tool.h>

Inheritance diagram for CSG_Tool_Interactive:
CSG_Tool_Interactive_Base CSG_Tool

Public Member Functions

CSG_Tool_Interactive (void)
virtual | ~CSG_Tool_Interactive (void)
virtual TSG_Tool_Type | Get_Type (void) const
virtual bool | needs_GUI (void) const
virtual bool | is_Interactive (void) const
- Public Member Functions inherited from CSG_Tool_Interactive_Base
CSG_Tool_Interactive_Base (void)
virtual | ~CSG_Tool_Interactive_Base (void)
bool | Set_Projection (const CSG_Projection &Projection)
bool | Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
bool | Execute_Keyboard (int Character, int Keys)
bool | Execute_Finish (void)
int | Get_Drag_Mode (void) const
- Public Member Functions inherited from CSG_Tool
CSG_Tool (void)
virtual | ~CSG_Tool (void)
virtual void | Destroy (void)
const CSG_String & | Get_ID (void) const
const CSG_String & | Get_Library (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Name (void) const
const CSG_String & | Get_Author (void) const
const CSG_String & | Get_Version (void) const
const CSG_String & | Get_Description (void) const
const CSG_Strings & | Get_References (void) const
const SG_Char * | Get_Icon (void)
CSG_String | Get_Summary (bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
virtual CSG_String | Get_MenuPath (void)
virtual CSG_String | Get_MenuPath (bool bSolved)
int | Get_Parameters_Count (void)
CSG_Parameters * | Get_Parameters (void)
CSG_Parameters * | Get_Parameters (int i)
CSG_Parameters * | Get_Parameters (const CSG_String &Identifier)
CSG_Parameter * | Get_Parameter (const CSG_String &ID) const
CSG_Parameter * | Get_Parameter (const char *ID) const
CSG_Parameter * | Get_Parameter (const wchar_t *ID) const
bool | Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue)
bool | Set_Parameter (const char *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue)
bool | Set_Parameter (const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined)
bool | Reset (bool bManager=true)
bool | Reset_Manager (void)
bool | Reset_Grid_System (void)
bool | Update_Parameter_States (void)
void | Set_Callback (bool bActive=true)
bool | Set_Manager (class CSG_Data_Manager *pManager)
class CSG_Data_Manager * | Get_Manager (void) const
class CSG_Data_Manager * | Create_Manager (void)
bool | Delete_Manager (bool bDetachData=false, bool bReset=true)
bool | Set_Grid_System (const CSG_Grid_System &System)
CSG_Grid_System * | Get_Grid_System (void) const
bool | Settings_Push (class CSG_Data_Manager *pManager=NULL)
bool | Settings_Pop (void)
virtual bool | do_Sync_Projections (void) const
bool | has_GUI (void) const
virtual bool | is_Grid (void) const
bool | is_Progress (void) const
bool | is_Executing (void) const
void | Set_Show_Progress (bool bOn=true)
virtual bool | On_Before_Execution (void)
virtual bool | On_After_Execution (void)
bool | Execute (bool bAddHistory=false)
const SG_Char * | Get_Execution_Info (void) const
CSG_String | Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)

Additional Inherited Members

- Static Public Member Functions inherited from CSG_Tool
static bool | Process_Get_Okay (bool bBlink=false)
static void | Process_Set_Text (const CSG_String &Text)
static void | Process_Set_Text (const char *Format,...)
static void | Process_Set_Text (const wchar_t *Format,...)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE)
static bool | DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
static bool | DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
static bool | DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
static bool | DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
static CSG_Parameter * | DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
static bool | DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal)
- Protected Member Functions inherited from CSG_Tool_Interactive_Base
const CSG_Projection & | Get_Projection (void) const
virtual bool | On_Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
virtual bool | On_Execute_Keyboard (int Character)
virtual bool | On_Execute_Finish (void)
const CSG_Point & | Get_Position (void) const
double | Get_xPosition (void) const
double | Get_yPosition (void) const
const CSG_Point & | Get_Position_Last (void) const
double | Get_xPosition_Last (void) const
double | Get_yPosition_Last (void) const
bool | is_Shift (void) const
bool | is_Alt (void) const
bool | is_Ctrl (void) const
void | Set_Drag_Mode (int Drag_Mode)
- Protected Member Functions inherited from CSG_Tool
void | Set_Name (const CSG_String &String)
void | Set_Author (const CSG_String &String)
void | Set_Version (const CSG_String &String)
void | Set_Description (const CSG_String &String)
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
virtual bool | On_Execute (void)=0
virtual int | On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
virtual int | On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter)
TSG_PFNC_Parameter_Changed | Get_Parameter_Changed (void)
CSG_Parameters * | Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
bool | Dlg_Parameters (const CSG_String &Identifier)
bool | Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
virtual bool | Set_Progress (int Position, int Range) const
virtual bool | Set_Progress (sLong Position, sLong Range) const
virtual bool | Set_Progress (double Position, double Range=1.) const
bool | Stop_Execution (bool bDialog=true)
void | Message_Dlg (const CSG_String &Text, const SG_Char *Caption=NULL)
bool | Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption=NULL)
void | Message_Add (const CSG_String &Text, bool bNewLine=true)
void | Message_Fmt (const char *Format,...)
void | Message_Fmt (const wchar_t *Format,...)
bool | Error_Set (TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
bool | Error_Set (const CSG_String &Text)
bool | Error_Fmt (const char *Format,...)
bool | Error_Fmt (const wchar_t *Format,...)
bool | DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate=false)
void | DataObject_Update_All (void)
bool | DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
bool | Get_Projection (CSG_Projection &Projection) const
- Protected Attributes inherited from CSG_Tool
CSG_Parameters Parameters
CSG_MetaData History_Supplement

Detailed Description

CSG_Tool_Interactive.

Definition at line 557 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Interactive()

CSG_Tool_Interactive::CSG_Tool_Interactive ( void )

Definition at line 63 of file tool_interactive.cpp.

◆ ~CSG_Tool_Interactive()

CSG_Tool_Interactive::~CSG_Tool_Interactive ( void )
virtual

Definition at line 69 of file tool_interactive.cpp.

Member Function Documentation

◆ Get_Type()

virtual TSG_Tool_Type CSG_Tool_Interactive::Get_Type ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 563 of file tool.h.

References TOOL_TYPE_Interactive.

◆ is_Interactive()

virtual bool CSG_Tool_Interactive::is_Interactive ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 567 of file tool.h.

◆ needs_GUI()

virtual bool CSG_Tool_Interactive::needs_GUI ( void ) const
inlinevirtual

Reimplemented from CSG_Tool.

Definition at line 565 of file tool.h.

The documentation for this class was generated from the following files:
  • tool.h
  • tool_interactive.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Interactive Member List

This is the complete list of members for CSG_Tool_Interactive, including all inherited members.

Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) | CSG_Tool | protected
Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool | protected
Create_Manager(void) | CSG_Tool |
CSG_Tool(void) | CSG_Tool |
CSG_Tool_Interactive(void) | CSG_Tool_Interactive |
CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base |
DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false) | CSG_Tool | protected
DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors) | CSG_Tool | static
DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID) | CSG_Tool | static
DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors) | CSG_Tool | static
DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false) | CSG_Tool | static
DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL) | CSG_Tool | protected
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, int Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value) | CSG_Tool | static
DataObject_Set_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters) | CSG_Tool | static
DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show=SG_UI_DATAOBJECT_UPDATE) | CSG_Tool | static
DataObject_Update_All(void) | CSG_Tool | protected
Delete_Manager(bool bDetachData=false, bool bReset=true) | CSG_Tool |
Destroy(void) | CSG_Tool | virtual
Dlg_Parameters(const CSG_String &Identifier) | CSG_Tool | protected
Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption) | CSG_Tool | protected
do_Sync_Projections(void) const | CSG_Tool | inlinevirtual
Error_Fmt(const char *Format,...) | CSG_Tool | protected
Error_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown) | CSG_Tool | protected
Error_Set(const CSG_String &Text) | CSG_Tool | protected
Execute(bool bAddHistory=false) | CSG_Tool |
Execute_Finish(void) | CSG_Tool_Interactive_Base |
Execute_Keyboard(int Character, int Keys) | CSG_Tool_Interactive_Base |
Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys) | CSG_Tool_Interactive_Base |
Get_Author(void) const | CSG_Tool |
Get_Description(void) const | CSG_Tool |
Get_Drag_Mode(void) const | CSG_Tool_Interactive_Base | inline
Get_Execution_Info(void) const | CSG_Tool | inline
Get_File_Name(void) const | CSG_Tool |
Get_Grid_System(void) const | CSG_Tool |
Get_Icon(void) | CSG_Tool | inline
Get_ID(void) const | CSG_Tool | inline
Get_Library(void) const | CSG_Tool |
Get_Manager(void) const | CSG_Tool |
Get_MenuPath(void) | CSG_Tool | inlinevirtual
Get_MenuPath(bool bSolved) | CSG_Tool | virtual
Get_Name(void) const | CSG_Tool |
Get_Parameter(const CSG_String &ID) const | CSG_Tool | inline
Get_Parameter(const char *ID) const | CSG_Tool | inline
Get_Parameter(const wchar_t *ID) const | CSG_Tool | inline
Get_Parameter_Changed(void) | CSG_Tool | inlineprotected
Get_Parameters(void) | CSG_Tool | inline
Get_Parameters(int i) | CSG_Tool | inline
Get_Parameters(const CSG_String &Identifier) | CSG_Tool |
Get_Parameters_Count(void) | CSG_Tool | inline
Get_Position(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_Position_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
CSG_Tool_Interactive_Base::Get_Projection(void) const | CSG_Tool_Interactive_Base | inlineprotected
CSG_Tool::Get_Projection(CSG_Projection &Projection) const | CSG_Tool | protected
Get_References(void) const | CSG_Tool |
Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false) | CSG_Tool |
Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML) | CSG_Tool |
Get_Type(void) const | CSG_Tool_Interactive | inlinevirtual
Get_Version(void) const | CSG_Tool |
Get_xPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_xPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
has_GUI(void) const | CSG_Tool |
History_Supplement | CSG_Tool | protected
is_Alt(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Ctrl(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Executing(void) const | CSG_Tool | inline
is_Grid(void) const | CSG_Tool | inlinevirtual
is_Interactive(void) const | CSG_Tool_Interactive | inlinevirtual
is_Progress(void) const | CSG_Tool | inline
is_Shift(void) const | CSG_Tool_Interactive_Base | inlineprotected
Message_Add(const CSG_String &Text, bool bNewLine=true) | CSG_Tool | protected
Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL) | CSG_Tool | protected
Message_Fmt(const char *Format,...) | CSG_Tool | protected
Message_Fmt(const wchar_t *Format,...) | CSG_Tool | protected
needs_GUI(void) const | CSG_Tool_Interactive | inlinevirtual
On_After_Execution(void) | CSG_Tool | inlinevirtual
On_Before_Execution(void) | CSG_Tool | inlinevirtual
On_Execute(void)=0 | CSG_Tool | protectedpure virtual
On_Execute_Finish(void) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Keyboard(int Character) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode) | CSG_Tool_Interactive_Base | protectedvirtual
On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) | CSG_Tool | protectedvirtual
Parameters | CSG_Tool | protected
Process_Get_Okay(bool bBlink=false) | CSG_Tool | static
Process_Set_Text(const CSG_String &Text) | CSG_Tool | static
Process_Set_Text(const char *Format,...) | CSG_Tool | static
Process_Set_Text(const wchar_t *Format,...) | CSG_Tool | static
Reset(bool bManager=true) | CSG_Tool |
Reset_Grid_System(void) | CSG_Tool |
Reset_Manager(void) | CSG_Tool |
Set_Author(const CSG_String &String) | CSG_Tool | protected
Set_Callback(bool bActive=true) | CSG_Tool |
Set_Description(const CSG_String &String) | CSG_Tool | protected
Set_Drag_Mode(int Drag_Mode) | CSG_Tool_Interactive_Base | protected
Set_Grid_System(const CSG_Grid_System &System) | CSG_Tool |
Set_Manager(class CSG_Data_Manager *pManager) | CSG_Tool |
Set_Name(const CSG_String &String) | CSG_Tool | protected
Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const char *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) | CSG_Tool |
Set_Parameter(const CSG_String &ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, int Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, double Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, void *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const char *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const char *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type=PARAMETER_TYPE_Undefined) | CSG_Tool |
Set_Progress(int Position, int Range) const | CSG_Tool | protectedvirtual
Set_Progress(sLong Position, sLong Range) const | CSG_Tool | protectedvirtual
Set_Progress(double Position, double Range=1.) const | CSG_Tool | protectedvirtual
Set_Projection(const CSG_Projection &Projection) | CSG_Tool_Interactive_Base |
Set_Show_Progress(bool bOn=true) | CSG_Tool |
Set_Version(const CSG_String &String) | CSG_Tool | protected
Settings_Pop(void) | CSG_Tool |
Settings_Push(class CSG_Data_Manager *pManager=NULL) | CSG_Tool |
Stop_Execution(bool bDialog=true) | CSG_Tool | protected
Update_Parameter_States(void) | CSG_Tool |
~CSG_Tool(void) | CSG_Tool | virtual
~CSG_Tool_Interactive(void) | CSG_Tool_Interactive | virtual
~CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Interactive_Base Class Reference

Public Member Functions | Protected Member Functions | Friends | List of all members
CSG_Tool_Interactive_Base Class Reference

#include <tool.h>

Inheritance diagram for CSG_Tool_Interactive_Base:
CSG_Tool_Grid_Interactive CSG_Tool_Interactive

Public Member Functions

CSG_Tool_Interactive_Base (void)
virtual | ~CSG_Tool_Interactive_Base (void)
bool | Set_Projection (const CSG_Projection &Projection)
bool | Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
bool | Execute_Keyboard (int Character, int Keys)
bool | Execute_Finish (void)
int | Get_Drag_Mode (void) const

Protected Member Functions

const CSG_Projection & | Get_Projection (void) const
virtual bool | On_Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
virtual bool | On_Execute_Keyboard (int Character)
virtual bool | On_Execute_Finish (void)
const CSG_Point & | Get_Position (void) const
double | Get_xPosition (void) const
double | Get_yPosition (void) const
const CSG_Point & | Get_Position_Last (void) const
double | Get_xPosition_Last (void) const
double | Get_yPosition_Last (void) const
bool | is_Shift (void) const
bool | is_Alt (void) const
bool | is_Ctrl (void) const
void | Set_Drag_Mode (int Drag_Mode)

Friends

class | CSG_Tool_Interactive
class | CSG_Tool_Grid_Interactive

Detailed Description

CSG_Tool_Interactive_Base.

Definition at line 492 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Interactive_Base()

CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base ( void )

Definition at line 81 of file tool_interactive_base.cpp.

References CSG_Point::Assign(), and TOOL_INTERACTIVE_DRAG_BOX.

◆ ~CSG_Tool_Interactive_Base()

CSG_Tool_Interactive_Base::~CSG_Tool_Interactive_Base ( void )
virtual

Definition at line 93 of file tool_interactive_base.cpp.

Member Function Documentation

◆ Execute_Finish()

bool CSG_Tool_Interactive_Base::Execute_Finish ( void )

Definition at line 172 of file tool_interactive_base.cpp.

References _TL, ADD_MESSAGE_EXECUTION, ADD_MESSAGE_TIME, CSG_String::c_str(), CSG_String::Format(), CSG_Tool::Get_Name(), CSG_DateTime::Now(), On_Execute_Finish(), SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_SUCCESS, SG_UI_Process_Set_Okay(), and SG_UI_Process_Set_Ready().

◆ Execute_Keyboard()

bool CSG_Tool_Interactive_Base::Execute_Keyboard | ( | int | Character,
 |  | int | Keys
 | ) |  |

Definition at line 141 of file tool_interactive_base.cpp.

References ADD_MESSAGE_TIME, CSG_DateTime::Now(), On_Execute_Keyboard(), SG_UI_Process_Set_Okay(), and SG_UI_Process_Set_Ready().

◆ Execute_Position()

bool CSG_Tool_Interactive_Base::Execute_Position | ( | CSG_Point | ptWorld,
 |  | TSG_Tool_Interactive_Mode | Mode,
 |  | int | Keys
 | ) |  |

Definition at line 108 of file tool_interactive_base.cpp.

References ADD_MESSAGE_TIME, CSG_DateTime::Now(), On_Execute_Position(), SG_UI_Process_Set_Okay(), and SG_UI_Process_Set_Ready().

◆ Get_Drag_Mode()

int CSG_Tool_Interactive_Base::Get_Drag_Mode ( void ) const
inline

Definition at line 507 of file tool.h.

◆ Get_Position()

const CSG_Point& CSG_Tool_Interactive_Base::Get_Position ( void ) const
inlineprotected

Definition at line 518 of file tool.h.

◆ Get_Position_Last()

const CSG_Point& CSG_Tool_Interactive_Base::Get_Position_Last ( void ) const
inlineprotected

Definition at line 522 of file tool.h.

◆ Get_Projection()

const CSG_Projection& CSG_Tool_Interactive_Base::Get_Projection ( void ) const
inlineprotected

Definition at line 512 of file tool.h.

◆ Get_xPosition()

double CSG_Tool_Interactive_Base::Get_xPosition ( void ) const
inlineprotected

Definition at line 519 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), and CSG_Tool_Grid_Interactive::Get_xGrid().

◆ Get_xPosition_Last()

double CSG_Tool_Interactive_Base::Get_xPosition_Last ( void ) const
inlineprotected

Definition at line 523 of file tool.h.

◆ Get_yPosition()

double CSG_Tool_Interactive_Base::Get_yPosition ( void ) const
inlineprotected

Definition at line 520 of file tool.h.

Referenced by CSG_Tool_Grid_Interactive::Get_Grid_Pos(), and CSG_Tool_Grid_Interactive::Get_yGrid().

◆ Get_yPosition_Last()

double CSG_Tool_Interactive_Base::Get_yPosition_Last ( void ) const
inlineprotected

Definition at line 524 of file tool.h.

◆ is_Alt()

bool CSG_Tool_Interactive_Base::is_Alt ( void ) const
inlineprotected

Definition at line 527 of file tool.h.

References TOOL_INTERACTIVE_KEY_ALT.

◆ is_Ctrl()

bool CSG_Tool_Interactive_Base::is_Ctrl ( void ) const
inlineprotected

Definition at line 528 of file tool.h.

References TOOL_INTERACTIVE_KEY_CTRL.

◆ is_Shift()

bool CSG_Tool_Interactive_Base::is_Shift ( void ) const
inlineprotected

Definition at line 526 of file tool.h.

References TOOL_INTERACTIVE_KEY_SHIFT.

◆ On_Execute_Finish()

bool CSG_Tool_Interactive_Base::On_Execute_Finish ( void )
protectedvirtual

Definition at line 201 of file tool_interactive_base.cpp.

Referenced by Execute_Finish().

◆ On_Execute_Keyboard()

bool CSG_Tool_Interactive_Base::On_Execute_Keyboard ( int Character )
protectedvirtual

Definition at line 166 of file tool_interactive_base.cpp.

Referenced by Execute_Keyboard().

◆ On_Execute_Position()

bool CSG_Tool_Interactive_Base::On_Execute_Position | ( | CSG_Point | ptWorld,
 |  | TSG_Tool_Interactive_Mode | Mode
 | ) |  |
protectedvirtual

Definition at line 135 of file tool_interactive_base.cpp.

Referenced by Execute_Position().

◆ Set_Drag_Mode()

void CSG_Tool_Interactive_Base::Set_Drag_Mode ( int Drag_Mode )
protected

Definition at line 212 of file tool_interactive_base.cpp.

◆ Set_Projection()

bool CSG_Tool_Interactive_Base::Set_Projection ( const CSG_Projection & Projection )

Definition at line 102 of file tool_interactive_base.cpp.

References CSG_Projection::Create().

Friends And Related Function Documentation

◆ CSG_Tool_Grid_Interactive

friend class CSG_Tool_Grid_Interactive ( void )
friend

Definition at line 495 of file tool.h.

◆ CSG_Tool_Interactive

friend class CSG_Tool_Interactive ( void )
friend

Definition at line 494 of file tool.h.

The documentation for this class was generated from the following files:
  • tool.h
  • tool_interactive_base.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Interactive_Base Member List

This is the complete list of members for CSG_Tool_Interactive_Base, including all inherited members.

CSG_Tool_Grid_Interactive class | CSG_Tool_Interactive_Base | friend
CSG_Tool_Interactive class | CSG_Tool_Interactive_Base | friend
CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base |
Execute_Finish(void) | CSG_Tool_Interactive_Base |
Execute_Keyboard(int Character, int Keys) | CSG_Tool_Interactive_Base |
Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys) | CSG_Tool_Interactive_Base |
Get_Drag_Mode(void) const | CSG_Tool_Interactive_Base | inline
Get_Position(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_Position_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_Projection(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_xPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_xPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yPosition(void) const | CSG_Tool_Interactive_Base | inlineprotected
Get_yPosition_Last(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Alt(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Ctrl(void) const | CSG_Tool_Interactive_Base | inlineprotected
is_Shift(void) const | CSG_Tool_Interactive_Base | inlineprotected
On_Execute_Finish(void) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Keyboard(int Character) | CSG_Tool_Interactive_Base | protectedvirtual
On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode) | CSG_Tool_Interactive_Base | protectedvirtual
Set_Drag_Mode(int Drag_Mode) | CSG_Tool_Interactive_Base | protected
Set_Projection(const CSG_Projection &Projection) | CSG_Tool_Interactive_Base |
~CSG_Tool_Interactive_Base(void) | CSG_Tool_Interactive_Base | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Library Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CSG_Tool_Library Class Reference

#include <tool_library.h>

Inheritance diagram for CSG_Tool_Library:
CSG_Tool_Chains

Public Member Functions

virtual TSG_Tool_Library_Type | Get_Type (void) const
bool | is_Valid (void) const
const CSG_String & | Get_File_Name (void) const
const CSG_String & | Get_Library_Name (void) const
virtual CSG_String | Get_Info (int Type) const
CSG_String | Get_Name (void) const
CSG_String | Get_Description (void) const
CSG_String | Get_Author (void) const
CSG_String | Get_Version (void) const
CSG_String | Get_Menu (void) const
CSG_String | Get_Category (void) const
CSG_String | Get_Summary (int Format=SG_SUMMARY_FMT_HTML, bool bInteractive=true) const
bool | Get_Summary (const CSG_String &Path) const
virtual int | Get_Count (void) const
virtual CSG_Tool * | Get_Tool (int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Get_Tool (const CSG_String &Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Get_Tool (const char *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Get_Tool (const wchar_t *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const
virtual CSG_Tool * | Create_Tool (int Index, bool bWithGUI=false)
virtual CSG_Tool * | Create_Tool (const CSG_String &Name, bool bWithGUI=false)
virtual CSG_Tool * | Create_Tool (const char *Name, bool bWithGUI=false)
virtual CSG_Tool * | Create_Tool (const wchar_t *Name, bool bWithGUI=false)
virtual bool | Delete_Tool (CSG_Tool *pTool)
virtual bool | Delete_Tools (void)
virtual CSG_String | Get_File_Name (int i) const
virtual CSG_String | Get_Menu (int i) const
void | Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
void | Add_Reference (const CSG_String &Link, const SG_Char *Link_Text=NULL)
void | Del_References (void)
const CSG_Strings & | Get_References (void) const

Protected Member Functions

CSG_Tool_Library (void)
CSG_Tool_Library (const CSG_String &File)
virtual ~CSG_Tool_Library (void)

Protected Attributes

CSG_String m_File_Name
CSG_String m_Library_Name

Friends

class CSG_Tool_Library_Manager

Detailed Description

Definition at line 106 of file tool_library.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Library() [1/2]

CSG_Tool_Library::CSG_Tool_Library ( void )
protected

Definition at line 68 of file tool_library.cpp.

◆ CSG_Tool_Library() [2/2]

CSG_Tool_Library::CSG_Tool_Library ( const CSG_String & File )
protected

Definition at line 75 of file tool_library.cpp.

References CSG_Tool_Library_Interface::Get_Count(), CSG_Tool_Library_Interface::Get_Info(), m_File_Name, m_Library_Name, SG_File_Get_Path_Absolute(), SYMBOL_TLB_Finalize, SYMBOL_TLB_Get_Interface, SYMBOL_TLB_Initialize, TLB_INFO_File, and TLB_INFO_Library.

◆ ~CSG_Tool_Library()

CSG_Tool_Library::~CSG_Tool_Library ( void )
protectedvirtual

Definition at line 100 of file tool_library.cpp.

Member Function Documentation

◆ Add_Reference() [1/2]

void CSG_Tool_Library::Add_Reference | ( | const CSG_String & | Authors,
 |  | const CSG_String & | Year,
 |  | const CSG_String & | Title,
 |  | const CSG_String & | Where,
 |  | const SG_Char * | Link = NULL,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |

Definition at line 242 of file tool_library.cpp.

References CSG_String::c_str(), CSG_String::Format(), CSG_String::is_Empty(), CSG_String::Printf(), and CSG_Strings::Sort().

◆ Add_Reference() [2/2]

void CSG_Tool_Library::Add_Reference | ( | const CSG_String & | Link,
 |  | const SG_Char * | Link_Text = NULL
 | ) |  |

Definition at line 262 of file tool_library.cpp.

References CSG_String::c_str(), CSG_String::Format(), and CSG_Strings::Sort().

◆ Create_Tool() [1/4]

CSG_Tool * CSG_Tool_Library::Create_Tool | ( | const char * | Name,
 |  | bool | bWithGUI = false
 | ) |  |
virtual

Definition at line 196 of file tool_library.cpp.

References Create_Tool().

◆ Create_Tool() [2/4]

CSG_Tool * CSG_Tool_Library::Create_Tool | ( | const CSG_String & | Name,
 |  | bool | bWithGUI = false
 | ) |  |
virtual

Reimplemented in CSG_Tool_Chains.

Definition at line 198 of file tool_library.cpp.

References CSG_String::asInt(), and Create_Tool().

◆ Create_Tool() [3/4]

CSG_Tool * CSG_Tool_Library::Create_Tool | ( | const wchar_t * | Name,
 |  | bool | bWithGUI = false
 | ) |  |
virtual

Definition at line 197 of file tool_library.cpp.

References Create_Tool().

◆ Create_Tool() [4/4]

CSG_Tool * CSG_Tool_Library::Create_Tool | ( | int | Index,
 |  | bool | bWithGUI = false
 | ) |  |
virtual

Creates a new instance of the requested tool in addition to the standard-wise created instance that you can request with the 'Get_Tool() functions. Tools created with this function are collected in a separate internal list and can be removed from memory with the 'Delete_Tool()' function. This way of tool creation is necessary, if you want to run a tool simultaneously with different settings.

Definition at line 190 of file tool_library.cpp.

References CSG_Tool_Library_Interface::Create_Tool().

Referenced by Create_Tool(), and CSG_Tool_Library_Manager::Create_Tool().

◆ Del_References()

void CSG_Tool_Library::Del_References ( void )

Definition at line 270 of file tool_library.cpp.

References CSG_Strings::Clear().

◆ Delete_Tool()

bool CSG_Tool_Library::Delete_Tool ( CSG_Tool * pTool )
virtual

Deletes a tool that has been created previously with a call to the 'Create_Tool()' function.

Reimplemented in CSG_Tool_Chains.

Definition at line 209 of file tool_library.cpp.

References CSG_Tool_Library_Interface::Delete_Tool().

Referenced by CSG_Tool_Library_Manager::Delete_Tool().

◆ Delete_Tools()

bool CSG_Tool_Library::Delete_Tools ( void )
virtual

Reimplemented in CSG_Tool_Chains.

Definition at line 215 of file tool_library.cpp.

References CSG_Tool_Library_Interface::Delete_Tools().

◆ Get_Author()

CSG_String CSG_Tool_Library::Get_Author ( void ) const
inline

Definition at line 122 of file tool_library.h.

References TLB_INFO_Author.

◆ Get_Category()

CSG_String CSG_Tool_Library::Get_Category ( void ) const
inline

Definition at line 125 of file tool_library.h.

References TLB_INFO_Category.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Get_Count()

virtual int CSG_Tool_Library::Get_Count ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Chains.

Definition at line 130 of file tool_library.h.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Chains::Get_File_Name(), CSG_Tool_Library_Manager::Get_Summary(), Get_Summary(), Get_Tool(), and CSG_Tool_Library_Manager::Get_Tool_Count().

◆ Get_Description()

CSG_String CSG_Tool_Library::Get_Description ( void ) const
inline

Definition at line 121 of file tool_library.h.

References TLB_INFO_Description.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Get_File_Name() [1/2]

virtual CSG_String CSG_Tool_Library::Get_File_Name ( int i ) const
inlinevirtual

Reimplemented in CSG_Tool_Chains.

Definition at line 145 of file tool_library.h.

◆ Get_File_Name() [2/2]

const CSG_String& CSG_Tool_Library::Get_File_Name ( void ) const
inline

Definition at line 116 of file tool_library.h.

Referenced by CSG_Tool_Library_Manager::Add_Library(), and Get_Summary().

◆ Get_Info()

CSG_String CSG_Tool_Library::Get_Info ( int Type ) const
virtual

Reimplemented in CSG_Tool_Chains.

Definition at line 133 of file tool_library.cpp.

References CSG_Tool_Library_Interface::Get_Info().

Referenced by Get_Summary().

◆ Get_Library_Name()

const CSG_String& CSG_Tool_Library::Get_Library_Name ( void ) const
inline

Definition at line 117 of file tool_library.h.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Get_Library(), CSG_Tool_Library_Manager::Get_Summary(), Get_Summary(), and CSG_Tool_Library_Manager::Get_Tool().

◆ Get_Menu() [1/2]

CSG_String CSG_Tool_Library::Get_Menu ( int i ) const
virtual

Definition at line 226 of file tool_library.cpp.

References Get_Tool().

◆ Get_Menu() [2/2]

CSG_String CSG_Tool_Library::Get_Menu ( void ) const
inline

Definition at line 124 of file tool_library.h.

References TLB_INFO_Menu_Path.

◆ Get_Name()

CSG_String CSG_Tool_Library::Get_Name ( void ) const
inline

Definition at line 120 of file tool_library.h.

References TLB_INFO_Name.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library_Manager::Get_Library(), and Get_Summary().

◆ Get_References()

const CSG_Strings& CSG_Tool_Library::Get_References ( void ) const
inline

Definition at line 151 of file tool_library.h.

Referenced by Get_Summary().

◆ Get_Summary() [1/2]

bool CSG_Tool_Library::Get_Summary ( const CSG_String & Path ) const

Definition at line 766 of file tool_summary.cpp.

References Get_Count(), Get_Library_Name(), CSG_Tool::Get_Summary(), Get_Summary(), Get_Tool(), CSG_File::Open(), SG_File_Make_Path(), SG_FILE_W, and CSG_File::Write().

◆ Get_Summary() [2/2]

CSG_String CSG_Tool_Library::Get_Summary | ( | int | Format = SG_SUMMARY_FMT_HTML,
 |  | bool | bInteractive = true
 | ) |  | const

Definition at line 624 of file tool_summary.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), CSG_Strings::Get_Count(), Get_Count(), Get_File_Name(), CSG_Tool::Get_ID(), Get_Info(), Get_Library_Name(), CSG_Tool::Get_Name(), Get_Name(), Get_References(), Get_Tool(), CSG_String::is_Empty(), CSG_Tool::needs_GUI(), CSG_String::Replace(), SG_SUMMARY_FMT_FLAT, SG_SUMMARY_FMT_HTML, SG_SUMMARY_FMT_XML, SG_T, SG_XML_LIBRARY, SG_XML_LIBRARY_CATEGORY, SG_XML_LIBRARY_NAME, SG_XML_LIBRARY_PATH, SG_XML_TOOL, SG_XML_TOOL_ATT_ID, SG_XML_TOOL_ATT_NAME, SUMMARY_ADD_STR, TLB_INFO_Author, TLB_INFO_Category, TLB_INFO_Description, and TLB_INFO_Name.

Referenced by Get_Summary(), and CSG_Tool_Library_Manager::Get_Summary().

◆ Get_Tool() [1/4]

CSG_Tool * CSG_Tool_Library::Get_Tool | ( | const char * | Name,
 |  | TSG_Tool_Type | Type = TOOL_TYPE_Base
 | ) |  | const
 virtual

Definition at line 157 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool() [2/4]

CSG_Tool * CSG_Tool_Library::Get_Tool | ( | const CSG_String & | Name,
 |  | TSG_Tool_Type | Type = TOOL_TYPE_Base
 | ) |  | const
 virtual

Definition at line 159 of file tool_library.cpp.

References CSG_String::Cmp(), Get_Count(), CSG_Tool::Get_ID(), CSG_Tool::Get_Name(), and Get_Tool().

◆ Get_Tool() [3/4]

CSG_Tool * CSG_Tool_Library::Get_Tool | ( | const wchar_t * | Name,
 |  | TSG_Tool_Type | Type = TOOL_TYPE_Base
 | ) |  | const
 virtual

Definition at line 158 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool() [4/4]

CSG_Tool * CSG_Tool_Library::Get_Tool | ( | int | Index,
 |  | TSG_Tool_Type | Type = TOOL_TYPE_Base
 | ) |  | const
 virtual

Reimplemented in CSG_Tool_Chains.

Definition at line 149 of file tool_library.cpp.

References Get_Count(), CSG_Tool_Library_Interface::Get_Tool(), CSG_Tool::Get_Type(), and TOOL_TYPE_Base.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), Get_Menu(), Get_Summary(), Get_Tool(), and CSG_Tool_Library_Manager::Get_Tool().

◆ Get_Type()

virtual TSG_Tool_Library_Type CSG_Tool_Library::Get_Type ( void ) const
inlinevirtual

Reimplemented in CSG_Tool_Chains.

Definition at line 112 of file tool_library.h.

References TOOL_LIBRARY.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Get_Version()

CSG_String CSG_Tool_Library::Get_Version ( void ) const
inline

Definition at line 123 of file tool_library.h.

References TLB_INFO_Version.

◆ is_Valid()

bool CSG_Tool_Library::is_Valid ( void ) const
inline

Definition at line 114 of file tool_library.h.

References CSG_Tool_Library_Manager::Get_Count().

Referenced by CSG_Tool_Library_Manager::Add_Library().

Friends And Related Function Documentation

◆ CSG_Tool_Library_Manager

friend class CSG_Tool_Library_Manager
friend

Definition at line 108 of file tool_library.h.

Member Data Documentation

◆ m_File_Name

CSG_String CSG_Tool_Library::m_File_Name
protected

Definition at line 161 of file tool_library.h.

Referenced by CSG_Tool_Library().

◆ m_Library_Name

CSG_String CSG_Tool_Library::m_Library_Name
protected

Definition at line 161 of file tool_library.h.

Referenced by CSG_Tool_Library().

The documentation for this class was generated from the following files:
  • tool_library.h
  • tool_library.cpp
  • tool_summary.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Library Member List

This is the complete list of members for CSG_Tool_Library, including all inherited members.

Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL) | CSG_Tool_Library |
Add_Reference(const CSG_String &Link, const SG_Char *Link_Text=NULL) | CSG_Tool_Library |
Create_Tool(int Index, bool bWithGUI=false) | CSG_Tool_Library | virtual
Create_Tool(const CSG_String &Name, bool bWithGUI=false) | CSG_Tool_Library | virtual
Create_Tool(const char *Name, bool bWithGUI=false) | CSG_Tool_Library | virtual
Create_Tool(const wchar_t *Name, bool bWithGUI=false) | CSG_Tool_Library | virtual
CSG_Tool_Library(void) | CSG_Tool_Library | protected
CSG_Tool_Library(const CSG_String &File) | CSG_Tool_Library | protected
CSG_Tool_Library_Manager class | CSG_Tool_Library | friend
Del_References(void) | CSG_Tool_Library |
Delete_Tool(CSG_Tool *pTool) | CSG_Tool_Library | virtual
Delete_Tools(void) | CSG_Tool_Library | virtual
Get_Author(void) const | CSG_Tool_Library | inline
Get_Category(void) const | CSG_Tool_Library | inline
Get_Count(void) const | CSG_Tool_Library | inlinevirtual
Get_Description(void) const | CSG_Tool_Library | inline
Get_File_Name(void) const | CSG_Tool_Library | inline
Get_File_Name(int i) const | CSG_Tool_Library | inlinevirtual
Get_Info(int Type) const | CSG_Tool_Library | virtual
Get_Library_Name(void) const | CSG_Tool_Library | inline
Get_Menu(void) const | CSG_Tool_Library | inline
Get_Menu(int i) const | CSG_Tool_Library | virtual
Get_Name(void) const | CSG_Tool_Library | inline
Get_References(void) const | CSG_Tool_Library | inline
Get_Summary(int Format=SG_SUMMARY_FMT_HTML, bool bInteractive=true) const | CSG_Tool_Library |
Get_Summary(const CSG_String &Path) const | CSG_Tool_Library |
Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
Get_Tool(const CSG_String &Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
Get_Tool(const char *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
Get_Tool(const wchar_t *Name, TSG_Tool_Type Type=TOOL_TYPE_Base) const | CSG_Tool_Library | virtual
Get_Type(void) const | CSG_Tool_Library | inlinevirtual
Get_Version(void) const | CSG_Tool_Library | inline
is_Valid(void) const | CSG_Tool_Library | inline
m_File_Name | CSG_Tool_Library | protected
m_Library_Name | CSG_Tool_Library | protected
~CSG_Tool_Library(void) | CSG_Tool_Library | protectedvirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Library_Interface Class Reference

Public Member Functions | List of all members
CSG_Tool_Library_Interface Class Reference

#include <tool.h>

Public Member Functions

CSG_Tool_Library_Interface (void)
virtual | ~CSG_Tool_Library_Interface (void)
bool | Create (const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool)
bool | Destroy (void)
const CSG_String & | Get_Info (int ID)
int | Get_Count (void)
CSG_Tool * | Get_Tool (int i)
CSG_Tool * | Create_Tool (int i, bool bWithGUI=false)
bool | Delete_Tool (CSG_Tool *pTool)
bool | Delete_Tools (void)

Detailed Description

Definition at line 634 of file tool.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Library_Interface()

CSG_Tool_Library_Interface::CSG_Tool_Library_Interface ( void )

Definition at line 63 of file tool_library_interface.cpp.

◆ ~CSG_Tool_Library_Interface()

CSG_Tool_Library_Interface::~CSG_Tool_Library_Interface ( void )
virtual

Definition at line 69 of file tool_library_interface.cpp.

References Destroy().

Member Function Documentation

◆ Create()

bool CSG_Tool_Library_Interface::Create | ( | const CSG_String & | Version,
 |  | const CSG_String & | TLB_Path,
 |  | TSG_PFNC_TLB_Get_Info | Fnc_Info,
 |  | TSG_PFNC_TLB_Create_Tool | Fnc_Create_Tool
 | ) |  |

Definition at line 80 of file tool_library_interface.cpp.

References _TL, CSG_Array_Pointer::Add(), CSG_String::c_str(), CSG_String::Cmp(), Destroy(), CSG_String::Find(), CSG_String::Format(), Get_Count(), CSG_String::Length(), CSG_String::Printf(), CSG_String::Right(), SAGA_VERSION, CSG_Strings::Set_Count(), SG_File_Get_Name(), SG_File_Get_Path_Absolute(), SG_UI_Msg_Add_Error(), TLB_INFO_Count, TLB_INFO_File, TLB_INFO_Library, TLB_INFO_Menu_Path, TLB_INFO_SAGA_Version, TLB_INFO_User, and TLB_INTERFACE_SKIP_TOOL.

◆ Create_Tool()

CSG_Tool * CSG_Tool_Library_Interface::Create_Tool | ( | int | i,
 |  | bool | bWithGUI = false
 | ) |  |

Definition at line 189 of file tool_library_interface.cpp.

References CSG_Array_Pointer::Add(), CSG_String::Printf(), TLB_INFO_File, TLB_INFO_Library, TLB_INFO_Menu_Path, and TLB_INTERFACE_SKIP_TOOL.

Referenced by CSG_Tool_Library::Create_Tool().

◆ Delete_Tool()

bool CSG_Tool_Library_Interface::Delete_Tool ( CSG_Tool * pTool )

Definition at line 210 of file tool_library_interface.cpp.

References CSG_Array_Pointer::Del(), CSG_Array_Pointer::Get(), and CSG_Array_Pointer::Get_uSize().

Referenced by CSG_Tool_Library::Delete_Tool().

◆ Delete_Tools()

bool CSG_Tool_Library_Interface::Delete_Tools ( void )

Definition at line 226 of file tool_library_interface.cpp.

References CSG_Array_Pointer::Destroy(), and CSG_Array_Pointer::Get_uSize().

Referenced by CSG_Tool_Library::Delete_Tools(), and Destroy().

◆ Destroy()

bool CSG_Tool_Library_Interface::Destroy ( void )

Definition at line 136 of file tool_library_interface.cpp.

References Delete_Tools(), CSG_Array_Pointer::Destroy(), and CSG_Array_Pointer::Get_uSize().

Referenced by Create(), and ~CSG_Tool_Library_Interface().

◆ Get_Count()

int CSG_Tool_Library_Interface::Get_Count ( void )

Definition at line 167 of file tool_library_interface.cpp.

References CSG_Array_Pointer::Get_Size().

Referenced by Create(), CSG_Tool_Library::CSG_Tool_Library(), and Get_Tool().

◆ Get_Info()

const CSG_String & CSG_Tool_Library_Interface::Get_Info ( int ID )

Definition at line 156 of file tool_library_interface.cpp.

Referenced by CSG_Tool_Library::CSG_Tool_Library(), and CSG_Tool_Library::Get_Info().

◆ Get_Tool()

CSG_Tool * CSG_Tool_Library_Interface::Get_Tool ( int i )

Definition at line 173 of file tool_library_interface.cpp.

References Get_Count().

Referenced by CSG_Tool_Library::Get_Tool().

The documentation for this class was generated from the following files:
  • tool.h
  • tool_library_interface.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Library_Interface Member List

This is the complete list of members for CSG_Tool_Library_Interface, including all inherited members.

Create(const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool) | CSG_Tool_Library_Interface |
Create_Tool(int i, bool bWithGUI=false) | CSG_Tool_Library_Interface |
CSG_Tool_Library_Interface(void) | CSG_Tool_Library_Interface |
Delete_Tool(CSG_Tool *pTool) | CSG_Tool_Library_Interface |
Delete_Tools(void) | CSG_Tool_Library_Interface |
Destroy(void) | CSG_Tool_Library_Interface |
Get_Count(void) | CSG_Tool_Library_Interface |
Get_Info(int ID) | CSG_Tool_Library_Interface |
Get_Tool(int i) | CSG_Tool_Library_Interface |
~CSG_Tool_Library_Interface(void) | CSG_Tool_Library_Interface | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Tool_Library_Manager Class Reference

Public Member Functions | List of all members
CSG_Tool_Library_Manager Class Reference

#include <tool_library.h>

Public Member Functions

CSG_Tool_Library_Manager (void)
virtual | ~CSG_Tool_Library_Manager (void)
bool | Destroy (void)
int | Get_Count (void) const
int | Get_Tool_Count (void) const
CSG_Tool_Library * | Add_Library (const CSG_String &File)
CSG_Tool_Library * | Add_Library (const char *File)
CSG_Tool_Library * | Add_Library (const wchar_t *File)
int | Add_Directory (const CSG_String &Directory, bool bOnlySubDirectories=false)
int | Add_Directory (const char *Directory, bool bOnlySubDirectories=false)
int | Add_Directory (const wchar_t *Directory, bool bOnlySubDirectories=false)
bool | Del_Library (int i)
bool | Del_Library (CSG_Tool_Library *pLibrary)
CSG_Tool_Library * | Get_Library (int i) const
CSG_Tool_Library * | Get_Library (const CSG_String &Name, bool bLibrary) const
CSG_Tool_Library * | Get_Library (const char *Name, bool bLibrary) const
CSG_Tool_Library * | Get_Library (const wchar_t *Name, bool bLibrary) const
bool | is_Loaded (CSG_Tool_Library *pLibrary) const
CSG_Tool * | Get_Tool (const CSG_String &Library, int Index) const
CSG_Tool * | Get_Tool (const char *Library, int Index) const
CSG_Tool * | Get_Tool (const wchar_t *Library, int Index) const
CSG_Tool * | Get_Tool (const CSG_String &Library, const CSG_String &Name) const
CSG_Tool * | Get_Tool (const char *Library, const char *Name) const
CSG_Tool * | Get_Tool (const wchar_t *Library, const wchar_t *Name) const
CSG_Tool * | Create_Tool (const CSG_String &Library, int Index, bool bWithGUI=false) const
CSG_Tool * | Create_Tool (const char *Library, int Index, bool bWithGUI=false) const
CSG_Tool * | Create_Tool (const wchar_t *Library, int Index, bool bWithGUI=false) const
CSG_Tool * | Create_Tool (const CSG_String &Library, const CSG_String &Name, bool bWithGUI=false) const
CSG_Tool * | Create_Tool (const char *Library, const char *Name, bool bWithGUI=false) const
CSG_Tool * | Create_Tool (const wchar_t *Library, const wchar_t *Name, bool bWithGUI=false) const
bool | Delete_Tool (CSG_Tool *pTool) const
CSG_String | Get_Summary (int Format=SG_SUMMARY_FMT_HTML) const
bool | Get_Summary (const CSG_String &Path) const
bool | Create_Python_ToolBox (const CSG_String &Destination, bool bClean=true, bool bName=true, bool bSingleFile=false) const

Detailed Description

Definition at line 185 of file tool_library.h.

Constructor & Destructor Documentation

◆ CSG_Tool_Library_Manager()

CSG_Tool_Library_Manager::CSG_Tool_Library_Manager ( void )

Definition at line 297 of file tool_library.cpp.

References g_Tool_Library_Manager, and CSG_Random::Initialize().

◆ ~CSG_Tool_Library_Manager()

CSG_Tool_Library_Manager::~CSG_Tool_Library_Manager ( void )
virtual

Definition at line 309 of file tool_library.cpp.

References Destroy().

Member Function Documentation

◆ Add_Directory() [1/3]

int CSG_Tool_Library_Manager::Add_Directory | ( | const char * | Directory,
 |  | bool | bOnlySubDirectories = false
 | ) |  |

Definition at line 431 of file tool_library.cpp.

References Add_Directory().

◆ Add_Directory() [2/3]

int CSG_Tool_Library_Manager::Add_Directory | ( | const CSG_String & | Directory,
 |  | bool | bOnlySubDirectories = false
 | ) |  |

Definition at line 394 of file tool_library.cpp.

References Add_Library(), CSG_String::c_str(), and SG_File_Make_Path().

Referenced by Add_Directory(), and SG_Initialize_Environment().

◆ Add_Directory() [3/3]

int CSG_Tool_Library_Manager::Add_Directory | ( | const wchar_t * | Directory,
 |  | bool | bOnlySubDirectories = false
 | ) |  |

Definition at line 436 of file tool_library.cpp.

References Add_Directory().

◆ Add_Library() [1/3]

CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library ( const char * File )

Definition at line 383 of file tool_library.cpp.

References Add_Library().

◆ Add_Library() [2/3]

CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library ( const CSG_String & File )

Definition at line 338 of file tool_library.cpp.

References _TL, CSG_String::c_str(), CSG_String::Format(), Get_Count(), CSG_Tool_Library::Get_File_Name(), Get_Library(), CSG_Tool_Library::is_Valid(), SG_File_Cmp_Extension(), SG_Realloc(), SG_UI_Msg_Add(), SG_UI_MSG_STYLE_FAILURE, and SG_UI_MSG_STYLE_SUCCESS.

Referenced by Add_Directory(), and Add_Library().

◆ Add_Library() [3/3]

CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library ( const wchar_t * File )

Definition at line 388 of file tool_library.cpp.

References Add_Library().

◆ Create_Python_ToolBox()

bool CSG_Tool_Library_Manager::Create_Python_ToolBox | ( | const CSG_String & | Destination,
 |  | bool | bClean = true,
 |  | bool | bName = true,
 |  | bool | bSingleFile = false
 | ) |  | const

Definition at line 745 of file tool_library.cpp.

References _TL, CSG_String::c_str(), CSG_String::Cmp(), CSG_String::Format(), CSG_Tool_Library::Get_Category(), CSG_Strings::Get_Count(), CSG_Tool_Library::Get_Count(), Get_Count(), CSG_Tool_Library::Get_Description(), Get_Library(), CSG_Tool_Library::Get_Library_Name(), CSG_Tool_Library::Get_Name(), CSG_Tool::Get_Parameters_Count(), CSG_Tool::Get_Script(), CSG_Tool_Library::Get_Tool(), CSG_Tool_Library::Get_Type(), CSG_Tool::is_Interactive(), CSG_Tool::needs_GUI(), CSG_File::Open(), CSG_File::Printf(), CSG_File::Seek_End(), SG_Dir_Create(), SG_Dir_Exists(), SG_Dir_List_Files(), SG_File_Delete(), SG_FILE_ENCODING_UTF8, SG_File_Exists(), SG_File_Make_Path(), SG_FILE_RW, SG_FILE_W, SG_T, SG_UI_Msg_Add_Error(), SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Text(), TLB_INTERFACE_SKIP_TOOL, TOOL_CHAINS, TOOL_SCRIPT_PYTHON_WRAP_ID, TOOL_SCRIPT_PYTHON_WRAP_NAME, and CSG_File::Write().

◆ Create_Tool() [1/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const char * | Library,
 |  | const char * | Name,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 703 of file tool_library.cpp.

References Create_Tool().

◆ Create_Tool() [2/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const char * | Library,
 |  | int | Index,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 695 of file tool_library.cpp.

References Create_Tool().

◆ Create_Tool() [3/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const CSG_String & | Library,
 |  | const CSG_String & | Name,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 705 of file tool_library.cpp.

References CSG_String::Cmp(), CSG_Tool_Library::Create_Tool(), Get_Count(), Get_Library(), and CSG_Tool_Library::Get_Library_Name().

◆ Create_Tool() [4/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const CSG_String & | Library,
 |  | int | Index,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 697 of file tool_library.cpp.

References CSG_String::Format().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), Create_Tool(), and SG_Get_Projected().

◆ Create_Tool() [5/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const wchar_t * | Library,
 |  | const wchar_t * | Name,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 704 of file tool_library.cpp.

References Create_Tool().

◆ Create_Tool() [6/6]

CSG_Tool * CSG_Tool_Library_Manager::Create_Tool | ( | const wchar_t * | Library,
 |  | int | Index,
 |  | bool | bWithGUI = false
 | ) |  | const

Definition at line 696 of file tool_library.cpp.

References Create_Tool().

◆ Del_Library() [1/2]

bool CSG_Tool_Library_Manager::Del_Library ( CSG_Tool_Library * pLibrary )

Definition at line 575 of file tool_library.cpp.

References Del_Library(), Get_Count(), and Get_Library().

◆ Del_Library() [2/2]

bool CSG_Tool_Library_Manager::Del_Library ( int i )

Definition at line 589 of file tool_library.cpp.

References Get_Count(), and SG_Realloc().

Referenced by Del_Library().

◆ Delete_Tool()

bool CSG_Tool_Library_Manager::Delete_Tool ( CSG_Tool * pTool ) const

Definition at line 726 of file tool_library.cpp.

References CSG_Tool_Library::Delete_Tool(), Get_Count(), and Get_Library().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), and SG_Get_Projected().

◆ Destroy()

bool CSG_Tool_Library_Manager::Destroy ( void )

Definition at line 544 of file tool_library.cpp.

References Get_Count(), SG_Free(), and SG_UI_Get_Window_Main().

Referenced by ~CSG_Tool_Library_Manager().

◆ Get_Count()

int CSG_Tool_Library_Manager::Get_Count ( void ) const
inline

Definition at line 193 of file tool_library.h.

Referenced by Add_Library(), Create_Python_ToolBox(), Create_Tool(), Del_Library(), Delete_Tool(), Destroy(), Get_Library(), Get_Summary(), Get_Tool(), is_Loaded(), and CSG_Tool_Library::is_Valid().

◆ Get_Library() [1/4]

CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library | ( | const char * | Name,
 |  | bool | bLibrary
 | ) |  | const

Definition at line 629 of file tool_library.cpp.

References Get_Library().

◆ Get_Library() [2/4]

CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library | ( | const CSG_String & | Name,
 |  | bool | bLibrary
 | ) |  | const

Definition at line 614 of file tool_library.cpp.

References CSG_String::Cmp(), Get_Count(), Get_Library(), CSG_Tool_Library::Get_Library_Name(), and CSG_Tool_Library::Get_Name().

◆ Get_Library() [3/4]

CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library | ( | const wchar_t * | Name,
 |  | bool | bLibrary
 | ) |  | const

Definition at line 634 of file tool_library.cpp.

References Get_Library().

◆ Get_Library() [4/4]

CSG_Tool_Library* CSG_Tool_Library_Manager::Get_Library ( int i ) const
inline

Definition at line 207 of file tool_library.h.

Referenced by Add_Library(), Create_Python_ToolBox(), Create_Tool(), Del_Library(), Delete_Tool(), Get_Library(), Get_Summary(), Get_Tool(), and is_Loaded().

◆ Get_Summary() [1/2]

bool CSG_Tool_Library_Manager::Get_Summary ( const CSG_String & Path ) const

Definition at line 912 of file tool_summary.cpp.

References Get_Count(), Get_Library(), CSG_Tool_Library::Get_Library_Name(), CSG_Tool_Library::Get_Summary(), SG_Dir_Create(), and SG_File_Make_Path().

◆ Get_Summary() [2/2]

CSG_String CSG_Tool_Library_Manager::Get_Summary ( int Format = SG_SUMMARY_FMT_HTML ) const

Definition at line 794 of file tool_summary.cpp.

References _TL, CSG_Table::Add_Field(), CSG_Table::Add_Record(), CSG_String::Format(), CSG_Table::Get_Count(), CSG_Tool_Library::Get_Count(), Get_Count(), Get_Library(), SAGA_VERSION, CSG_Table::Set_Index(), CSG_Table::Set_Value(), SG_DATATYPE_Int, SG_DATATYPE_String, SG_File_Get_Path(), SG_SUMMARY_FMT_FLAT, SG_SUMMARY_FMT_HTML, SG_SUMMARY_FMT_XML, SG_XML_LIBRARY, SG_XML_LIBRARY_NAME, SG_XML_SYSTEM, SG_XML_SYSTEM_VER, SUMMARY_ADD_INT, and TABLE_INDEX_Ascending.

◆ Get_Tool() [1/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const char * | Library,
 |  | const char * | Name
 | ) |  | const

Definition at line 667 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool() [2/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const char * | Library,
 |  | int | Index
 | ) |  | const

Definition at line 659 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool() [3/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const CSG_String & | Library,
 |  | const CSG_String & | Name
 | ) |  | const

Definition at line 669 of file tool_library.cpp.

References CSG_String::Cmp(), Get_Count(), Get_Library(), CSG_Tool_Library::Get_Library_Name(), and CSG_Tool_Library::Get_Tool().

◆ Get_Tool() [4/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const CSG_String & | Library,
 |  | int | Index
 | ) |  | const

Definition at line 661 of file tool_library.cpp.

References CSG_String::Format().

Referenced by Get_Tool().

◆ Get_Tool() [5/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const wchar_t * | Library,
 |  | const wchar_t * | Name
 | ) |  | const

Definition at line 668 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool() [6/6]

CSG_Tool * CSG_Tool_Library_Manager::Get_Tool | ( | const wchar_t * | Library,
 |  | int | Index
 | ) |  | const

Definition at line 660 of file tool_library.cpp.

References Get_Tool().

◆ Get_Tool_Count()

int CSG_Tool_Library_Manager::Get_Tool_Count ( void ) const

Definition at line 320 of file tool_library.cpp.

References CSG_Tool_Library::Get_Count().

◆ is_Loaded()

bool CSG_Tool_Library_Manager::is_Loaded ( CSG_Tool_Library * pLibrary ) const

Definition at line 640 of file tool_library.cpp.

References Get_Count(), and Get_Library().

The documentation for this class was generated from the following files:
  • tool_library.h
  • tool_library.cpp
  • tool_summary.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Tool_Library_Manager Member List

This is the complete list of members for CSG_Tool_Library_Manager, including all inherited members.

Add_Directory(const CSG_String &Directory, bool bOnlySubDirectories=false) | CSG_Tool_Library_Manager |
Add_Directory(const char *Directory, bool bOnlySubDirectories=false) | CSG_Tool_Library_Manager |
Add_Directory(const wchar_t *Directory, bool bOnlySubDirectories=false) | CSG_Tool_Library_Manager |
Add_Library(const CSG_String &File) | CSG_Tool_Library_Manager |
Add_Library(const char *File) | CSG_Tool_Library_Manager |
Add_Library(const wchar_t *File) | CSG_Tool_Library_Manager |
Create_Python_ToolBox(const CSG_String &Destination, bool bClean=true, bool bName=true, bool bSingleFile=false) const | CSG_Tool_Library_Manager |
Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
Create_Tool(const char *Library, int Index, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
Create_Tool(const wchar_t *Library, int Index, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
Create_Tool(const CSG_String &Library, const CSG_String &Name, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
Create_Tool(const char *Library, const char *Name, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
Create_Tool(const wchar_t *Library, const wchar_t *Name, bool bWithGUI=false) const | CSG_Tool_Library_Manager |
CSG_Tool_Library_Manager(void) | CSG_Tool_Library_Manager |
Del_Library(int i) | CSG_Tool_Library_Manager |
Del_Library(CSG_Tool_Library *pLibrary) | CSG_Tool_Library_Manager |
Delete_Tool(CSG_Tool *pTool) const | CSG_Tool_Library_Manager |
Destroy(void) | CSG_Tool_Library_Manager |
Get_Count(void) const | CSG_Tool_Library_Manager | inline
Get_Library(int i) const | CSG_Tool_Library_Manager | inline
Get_Library(const CSG_String &Name, bool bLibrary) const | CSG_Tool_Library_Manager |
Get_Library(const char *Name, bool bLibrary) const | CSG_Tool_Library_Manager |
Get_Library(const wchar_t *Name, bool bLibrary) const | CSG_Tool_Library_Manager |
Get_Summary(int Format=SG_SUMMARY_FMT_HTML) const | CSG_Tool_Library_Manager |
Get_Summary(const CSG_String &Path) const | CSG_Tool_Library_Manager |
Get_Tool(const CSG_String &Library, int Index) const | CSG_Tool_Library_Manager |
Get_Tool(const char *Library, int Index) const | CSG_Tool_Library_Manager |
Get_Tool(const wchar_t *Library, int Index) const | CSG_Tool_Library_Manager |
Get_Tool(const CSG_String &Library, const CSG_String &Name) const | CSG_Tool_Library_Manager |
Get_Tool(const char *Library, const char *Name) const | CSG_Tool_Library_Manager |
Get_Tool(const wchar_t *Library, const wchar_t *Name) const | CSG_Tool_Library_Manager |
Get_Tool_Count(void) const | CSG_Tool_Library_Manager |
is_Loaded(CSG_Tool_Library *pLibrary) const | CSG_Tool_Library_Manager |
~CSG_Tool_Library_Manager(void) | CSG_Tool_Library_Manager | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Translator Class Reference

Classes | Public Member Functions | List of all members
CSG_Translator Class Reference

#include <api_core.h>

Public Member Functions

CSG_Translator (void)
virtual | ~CSG_Translator (void)
CSG_Translator (const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
bool | Create (const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
CSG_Translator (class CSG_Table *pTranslations, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
bool | Create (class CSG_Table *pTranslations, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
void | Destroy (void)
bool | is_CaseSensitive (void) const
int | Get_Count (void) const
const SG_Char * | Get_Text (int i) const
const SG_Char * | Get_Translation (int i) const
const SG_Char * | Get_Translation (const SG_Char *Text, bool bReturnNullOnNotFound=false) const
bool | Get_Translation (const SG_Char *Text, CSG_String &Translation) const

Detailed Description

Definition at line 1423 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Translator() [1/3]

CSG_Translator::CSG_Translator ( void )

Definition at line 106 of file api_translator.cpp.

◆ ~CSG_Translator()

CSG_Translator::~CSG_Translator ( void )
virtual

Definition at line 129 of file api_translator.cpp.

References Destroy().

◆ CSG_Translator() [2/3]

CSG_Translator::CSG_Translator | ( | const CSG_String & | File_Name,
 |  | bool | bSetExtension = true,
 |  | int | iText = 0,
 |  | int | iTranslation = 1,
 |  | bool | bCmpNoCase = false
 | ) |  |

Definition at line 112 of file api_translator.cpp.

References Create().

◆ CSG_Translator() [3/3]

CSG_Translator::CSG_Translator | ( | class CSG_Table * | pTranslations,
 |  | int | iText = 0,
 |  | int | iTranslation = 1,
 |  | bool | bCmpNoCase = false
 | ) |  |

Definition at line 120 of file api_translator.cpp.

References Create().

Member Function Documentation

◆ Create() [1/2]

bool CSG_Translator::Create | ( | class CSG_Table * | pTranslations,
 |  | int | iText = 0,
 |  | int | iTranslation = 1,
 |  | bool | bCmpNoCase = false
 | ) |  |

Definition at line 177 of file api_translator.cpp.

References CSG_Table_Record::asString(), CSG_String::c_str(), Destroy(), Get_Count(), CSG_Table::Get_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Record(), CSG_Table::Get_Record_byIndex(), CSG_Table_Record::is_NoData(), CSG_String::Make_Lower(), CSG_Table::Set_Index(), CSG_Table_Record::Set_Value(), SG_Malloc(), SG_Realloc(), SG_UI_Msg_Lock(), and TABLE_INDEX_Ascending.

◆ Create() [2/2]

bool CSG_Translator::Create | ( | const CSG_String & | File_Name,
 |  | bool | bSetExtension = true,
 |  | int | iText = 0,
 |  | int | iTranslation = 1,
 |  | bool | bCmpNoCase = false
 | ) |  |

Definition at line 157 of file api_translator.cpp.

References CSG_Table::Create(), Destroy(), SG_FILE_ENCODING_UTF8, SG_File_Exists(), SG_File_Make_Path(), SG_UI_Msg_Lock(), and TABLE_FILETYPE_Text.

Referenced by CSG_Translator(), and CSG_Projections::Load_Dictionary().

◆ Destroy()

void CSG_Translator::Destroy ( void )

Definition at line 135 of file api_translator.cpp.

References SG_Free().

Referenced by Create(), and ~CSG_Translator().

◆ Get_Count()

int CSG_Translator::Get_Count ( void ) const
inline

Definition at line 1439 of file api_core.h.

Referenced by Create().

◆ Get_Text()

const SG_Char* CSG_Translator::Get_Text ( int i ) const
inline

Definition at line 1440 of file api_core.h.

References SG_T.

◆ Get_Translation() [1/3]

const SG_Char * CSG_Translator::Get_Translation | ( | const SG_Char * | Text,
 |  | bool | bReturnNullOnNotFound = false
 | ) |  | const

Definition at line 295 of file api_translator.cpp.

References CSG_String::AfterFirst(), CSG_String::BeforeFirst(), and COMPARE.

◆ Get_Translation() [2/3]

bool CSG_Translator::Get_Translation | ( | const SG_Char * | Text,
 |  | CSG_String & | Translation
 | ) |  | const

Definition at line 332 of file api_translator.cpp.

References CSG_String::AfterFirst(), CSG_String::BeforeFirst(), and COMPARE.

◆ Get_Translation() [3/3]

const SG_Char* CSG_Translator::Get_Translation ( int i ) const
inline

Definition at line 1441 of file api_core.h.

References SG_T.

Referenced by SG_Translate(), CSG_Projections::WKT_from_Proj4(), and CSG_Projections::WKT_to_Proj4().

◆ is_CaseSensitive()

bool CSG_Translator::is_CaseSensitive ( void ) const
inline

Definition at line 1437 of file api_core.h.

The documentation for this class was generated from the following files:
  • api_core.h
  • api_translator.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Translator Member List

This is the complete list of members for CSG_Translator, including all inherited members.

Create(const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false) | CSG_Translator |
Create(class CSG_Table *pTranslations, int iText=0, int iTranslation=1, bool bCmpNoCase=false) | CSG_Translator |
CSG_Translator(void) | CSG_Translator |
CSG_Translator(const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false) | CSG_Translator |
CSG_Translator(class CSG_Table *pTranslations, int iText=0, int iTranslation=1, bool bCmpNoCase=false) | CSG_Translator |
Destroy(void) | CSG_Translator |
Get_Count(void) const | CSG_Translator | inline
Get_Text(int i) const | CSG_Translator | inline
Get_Translation(int i) const | CSG_Translator | inline
Get_Translation(const SG_Char *Text, bool bReturnNullOnNotFound=false) const | CSG_Translator |
Get_Translation(const SG_Char *Text, CSG_String &Translation) const | CSG_Translator |
is_CaseSensitive(void) const | CSG_Translator | inline
~CSG_Translator(void) | CSG_Translator | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Trend Class Reference

Classes | Public Member Functions | List of all members
CSG_Trend Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Trend (void)
bool | Set_Formula (const CSG_String &Formula)
CSG_String | Get_Formula (int Type=SG_TREND_STRING_Complete)
int | Get_Parameter_Count (void) const
double * | Get_Parameters (void) const
bool | Init_Parameter (const SG_Char &Variable, double Value)
void | Clr_Data (void)
bool | Add_Data (double x, double y)
void | Set_Data (double *x, double *y, int n, bool bAdd=false)
void | Set_Data (const CSG_Points &Data, bool bAdd=false)
int | Get_Data_Count (void) const
double | Get_Data_X (int i) const
double | Get_Data_XMin (void)
double | Get_Data_XMax (void)
CSG_Simple_Statistics & | Get_Data_XStats (void)
double | Get_Data_Y (int i) const
double | Get_Data_YMin (void)
double | Get_Data_YMax (void)
CSG_Simple_Statistics & | Get_Data_YStats (void)
bool | Set_Max_Iterations (int Iterations)
int | Get_Max_Iterations (void) const
bool | Set_Max_Lambda (double Lambda)
double | Get_Max_Lambda (void) const
bool | Get_Trend (double *x, double *y, int n, const CSG_String &Formula)
bool | Get_Trend (const CSG_Points &Data, const CSG_String &Formula)
bool | Get_Trend (const CSG_String &Formula)
bool | Get_Trend (void)
bool | is_Okay (void) const
CSG_String | Get_Error (void)
double | Get_ChiSquare (void) const
double | Get_R2 (void) const
double | Get_Value (double x) const

Detailed Description

Definition at line 1960 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Trend()

CSG_Trend::CSG_Trend ( void )

Definition at line 128 of file mat_trend.cpp.

Member Function Documentation

◆ Add_Data()

bool CSG_Trend::Add_Data | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 226 of file mat_trend.cpp.

Referenced by Set_Data().

◆ Clr_Data()

void CSG_Trend::Clr_Data ( void )

Definition at line 189 of file mat_trend.cpp.

References CSG_Simple_Statistics::Create().

Referenced by Set_Data().

◆ Get_ChiSquare()

double CSG_Trend::Get_ChiSquare ( void ) const
inline

Definition at line 2000 of file mat_tools.h.

◆ Get_Data_Count()

int CSG_Trend::Get_Data_Count ( void ) const
inline

Definition at line 1976 of file mat_tools.h.

Referenced by Get_Formula(), and Get_Trend().

◆ Get_Data_X()

double CSG_Trend::Get_Data_X ( int i ) const
inline

Definition at line 1977 of file mat_tools.h.

Referenced by Get_Trend().

◆ Get_Data_XMax()

double CSG_Trend::Get_Data_XMax ( void )
inline

Definition at line 1979 of file mat_tools.h.

◆ Get_Data_XMin()

double CSG_Trend::Get_Data_XMin ( void )
inline

Definition at line 1978 of file mat_tools.h.

◆ Get_Data_XStats()

CSG_Simple_Statistics& CSG_Trend::Get_Data_XStats ( void )
inline

Definition at line 1980 of file mat_tools.h.

◆ Get_Data_Y()

double CSG_Trend::Get_Data_Y ( int i ) const
inline

Definition at line 1981 of file mat_tools.h.

Referenced by Get_Trend().

◆ Get_Data_YMax()

double CSG_Trend::Get_Data_YMax ( void )
inline

Definition at line 1983 of file mat_tools.h.

◆ Get_Data_YMin()

double CSG_Trend::Get_Data_YMin ( void )
inline

Definition at line 1982 of file mat_tools.h.

◆ Get_Data_YStats()

CSG_Simple_Statistics& CSG_Trend::Get_Data_YStats ( void )
inline

Definition at line 1984 of file mat_tools.h.

◆ Get_Error()

CSG_String CSG_Trend::Get_Error ( void )

Definition at line 367 of file mat_trend.cpp.

References _TL, CSG_Formula::Get_Error(), and CSG_String::Printf().

◆ Get_Formula()

CSG_String CSG_Trend::Get_Formula ( int Type = SG_TREND_STRING_Complete )

Definition at line 383 of file mat_trend.cpp.

References CSG_String::Format(), Get_Data_Count(), CSG_Formula::Get_Formula(), Get_R2(), SG_T, SG_TREND_STRING_Compact, SG_TREND_STRING_Complete, SG_TREND_STRING_Formula, SG_TREND_STRING_Formula_Parameters, and SG_TREND_STRING_Function.

◆ Get_Max_Iterations()

int CSG_Trend::Get_Max_Iterations ( void ) const
inline

Definition at line 1987 of file mat_tools.h.

◆ Get_Max_Lambda()

double CSG_Trend::Get_Max_Lambda ( void ) const
inline

Definition at line 1989 of file mat_tools.h.

◆ Get_Parameter_Count()

int CSG_Trend::Get_Parameter_Count ( void ) const
inline

Definition at line 1968 of file mat_tools.h.

◆ Get_Parameters()

double* CSG_Trend::Get_Parameters ( void ) const
inline

Definition at line 1969 of file mat_tools.h.

◆ Get_R2()

double CSG_Trend::Get_R2 ( void ) const
inline

Definition at line 2001 of file mat_tools.h.

Referenced by Get_Formula().

◆ Get_Trend() [1/4]

bool CSG_Trend::Get_Trend | ( | const CSG_Points & | Data,
 |  | const CSG_String & | Formula
 | ) |  |

Definition at line 281 of file mat_trend.cpp.

References Get_Trend(), CSG_String::is_Empty(), Set_Data(), and Set_Formula().

◆ Get_Trend() [2/4]

bool CSG_Trend::Get_Trend ( const CSG_String & Formula )

Definition at line 289 of file mat_trend.cpp.

References Get_Trend(), CSG_String::is_Empty(), and Set_Formula().

◆ Get_Trend() [3/4]

bool CSG_Trend::Get_Trend | ( | double * | x,
 |  | double * | y,
 |  | int | n,
 |  | const CSG_String & | Formula
 | ) |  |

Definition at line 273 of file mat_trend.cpp.

References Get_Trend(), CSG_String::is_Empty(), Set_Data(), and Set_Formula().

◆ Get_Trend() [4/4]

bool CSG_Trend::Get_Trend ( void )

Definition at line 295 of file mat_trend.cpp.

References Get_Data_Count(), Get_Data_X(), Get_Data_Y(), CSG_Formula::Get_Error(), CSG_Formula::Get_Value(), CSG_Formula::Set_Variable(), SG_Get_Square(), and SG_UI_Process_Get_Okay().

Referenced by Get_Trend().

◆ Get_Value()

double CSG_Trend::Get_Value ( double x ) const
inline

Definition at line 2003 of file mat_tools.h.

◆ Init_Parameter()

bool CSG_Trend::Init_Parameter | ( | const SG_Char & | Variable,
 |  | double | Value
 | ) |  |

Definition at line 168 of file mat_trend.cpp.

◆ is_Okay()

bool CSG_Trend::is_Okay ( void ) const
inline

Definition at line 1996 of file mat_tools.h.

◆ Set_Data() [1/2]

void CSG_Trend::Set_Data | ( | const CSG_Points & | Data,
 |  | bool | bAdd = false
 | ) |  |

Definition at line 212 of file mat_trend.cpp.

References Add_Data(), Clr_Data(), and CSG_Points::Get_Count().

◆ Set_Data() [2/2]

void CSG_Trend::Set_Data | ( | double * | x,
 |  | double * | y,
 |  | int | n,
 |  | bool | bAdd = false
 | ) |  |

Definition at line 198 of file mat_trend.cpp.

References Add_Data(), and Clr_Data().

Referenced by Get_Trend().

◆ Set_Formula()

bool CSG_Trend::Set_Formula ( const CSG_String & Formula )

Definition at line 143 of file mat_trend.cpp.

References CSG_Formula::Get_Used_Variables(), CSG_String::Length(), and CSG_Formula::Set_Formula().

Referenced by Get_Trend().

◆ Set_Max_Iterations()

bool CSG_Trend::Set_Max_Iterations ( int Iterations )

Definition at line 242 of file mat_trend.cpp.

◆ Set_Max_Lambda()

bool CSG_Trend::Set_Max_Lambda ( double Lambda )

Definition at line 255 of file mat_trend.cpp.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_trend.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Trend Member List

This is the complete list of members for CSG_Trend, including all inherited members.

Add_Data(double x, double y) | CSG_Trend |
Clr_Data(void) | CSG_Trend |
CSG_Trend(void) | CSG_Trend |
Get_ChiSquare(void) const | CSG_Trend | inline
Get_Data_Count(void) const | CSG_Trend | inline
Get_Data_X(int i) const | CSG_Trend | inline
Get_Data_XMax(void) | CSG_Trend | inline
Get_Data_XMin(void) | CSG_Trend | inline
Get_Data_XStats(void) | CSG_Trend | inline
Get_Data_Y(int i) const | CSG_Trend | inline
Get_Data_YMax(void) | CSG_Trend | inline
Get_Data_YMin(void) | CSG_Trend | inline
Get_Data_YStats(void) | CSG_Trend | inline
Get_Error(void) | CSG_Trend |
Get_Formula(int Type=SG_TREND_STRING_Complete) | CSG_Trend |
Get_Max_Iterations(void) const | CSG_Trend | inline
Get_Max_Lambda(void) const | CSG_Trend | inline
Get_Parameter_Count(void) const | CSG_Trend | inline
Get_Parameters(void) const | CSG_Trend | inline
Get_R2(void) const | CSG_Trend | inline
Get_Trend(double *x, double *y, int n, const CSG_String &Formula) | CSG_Trend |
Get_Trend(const CSG_Points &Data, const CSG_String &Formula) | CSG_Trend |
Get_Trend(const CSG_String &Formula) | CSG_Trend |
Get_Trend(void) | CSG_Trend |
Get_Value(double x) const | CSG_Trend | inline
Init_Parameter(const SG_Char &Variable, double Value) | CSG_Trend |
is_Okay(void) const | CSG_Trend | inline
Set_Data(double *x, double *y, int n, bool bAdd=false) | CSG_Trend |
Set_Data(const CSG_Points &Data, bool bAdd=false) | CSG_Trend |
Set_Formula(const CSG_String &Formula) | CSG_Trend |
Set_Max_Iterations(int Iterations) | CSG_Trend |
Set_Max_Lambda(double Lambda) | CSG_Trend |
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Trend_Polynom Class Reference

Public Member Functions | List of all members
CSG_Trend_Polynom Class Reference

#include <mat_tools.h>

Public Member Functions

CSG_Trend_Polynom (void)
bool | Destroy (void)
bool | Set_Order (int Order=1)
bool | Clr_Data (void)
bool | Set_Data (double *x, double *y, int n, bool bAdd=false)
bool | Add_Data (double x, double y)
int | Get_Data_Count (void) const
double | Get_Data_X (int i) const
double | Get_Data_Y (int i) const
bool | Get_Trend (void)
int | Get_Order (void) const
int | Get_nCoefficients (void) const
double | Get_Coefficient (int i) const
double | Get_R2 (void) const
double | Get_Value (double x) const

Detailed Description

Definition at line 2059 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Trend_Polynom()

CSG_Trend_Polynom::CSG_Trend_Polynom ( void )

Definition at line 748 of file mat_trend.cpp.

References Destroy().

Member Function Documentation

◆ Add_Data()

bool CSG_Trend_Polynom::Add_Data | ( | double | x,
 |  | double | y
 | ) |  |

Definition at line 809 of file mat_trend.cpp.

References CSG_Vector::Add_Row().

◆ Clr_Data()

bool CSG_Trend_Polynom::Clr_Data ( void )

Definition at line 779 of file mat_trend.cpp.

References CSG_Vector::Destroy().

Referenced by Destroy(), and Set_Data().

◆ Destroy()

bool CSG_Trend_Polynom::Destroy ( void )

Definition at line 754 of file mat_trend.cpp.

References Clr_Data().

Referenced by CSG_Trend_Polynom().

◆ Get_Coefficient()

double CSG_Trend_Polynom::Get_Coefficient ( int i ) const
inline

Definition at line 2079 of file mat_tools.h.

◆ Get_Data_Count()

int CSG_Trend_Polynom::Get_Data_Count ( void ) const
inline

Definition at line 2071 of file mat_tools.h.

◆ Get_Data_X()

double CSG_Trend_Polynom::Get_Data_X ( int i ) const
inline

Definition at line 2072 of file mat_tools.h.

◆ Get_Data_Y()

double CSG_Trend_Polynom::Get_Data_Y ( int i ) const
inline

Definition at line 2073 of file mat_tools.h.

◆ Get_nCoefficients()

int CSG_Trend_Polynom::Get_nCoefficients ( void ) const
inline

Definition at line 2078 of file mat_tools.h.

◆ Get_Order()

int CSG_Trend_Polynom::Get_Order ( void ) const
inline

Definition at line 2077 of file mat_tools.h.

◆ Get_R2()

double CSG_Trend_Polynom::Get_R2 ( void ) const
inline

Definition at line 2080 of file mat_tools.h.

◆ Get_Trend()

bool CSG_Trend_Polynom::Get_Trend ( void )

Definition at line 815 of file mat_trend.cpp.

References C, CSG_Matrix::Create(), CSG_Vector::Get_N(), CSG_Vector::Get_Size(), and SG_Get_Square().

◆ Get_Value()

double CSG_Trend_Polynom::Get_Value ( double x ) const

Definition at line 862 of file mat_trend.cpp.

References CSG_Vector::Get_N().

◆ Set_Data()

bool CSG_Trend_Polynom::Set_Data | ( | double * | x,
 |  | double * | y,
 |  | int | n,
 |  | bool | bAdd = false
 | ) |  |

Definition at line 789 of file mat_trend.cpp.

References CSG_Vector::Add_Rows(), Clr_Data(), and CSG_Vector::Get_N().

◆ Set_Order()

bool CSG_Trend_Polynom::Set_Order ( int Order = 1 )

Definition at line 764 of file mat_trend.cpp.

References CSG_Vector::Destroy().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_trend.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Trend_Polynom Member List

This is the complete list of members for CSG_Trend_Polynom, including all inherited members.

Add_Data(double x, double y) | CSG_Trend_Polynom |
Clr_Data(void) | CSG_Trend_Polynom |
CSG_Trend_Polynom(void) | CSG_Trend_Polynom |
Destroy(void) | CSG_Trend_Polynom |
Get_Coefficient(int i) const | CSG_Trend_Polynom | inline
Get_Data_Count(void) const | CSG_Trend_Polynom | inline
Get_Data_X(int i) const | CSG_Trend_Polynom | inline
Get_Data_Y(int i) const | CSG_Trend_Polynom | inline
Get_nCoefficients(void) const | CSG_Trend_Polynom | inline
Get_Order(void) const | CSG_Trend_Polynom | inline
Get_R2(void) const | CSG_Trend_Polynom | inline
Get_Trend(void) | CSG_Trend_Polynom |
Get_Value(double x) const | CSG_Trend_Polynom |
Set_Data(double *x, double *y, int n, bool bAdd=false) | CSG_Trend_Polynom |
Set_Order(int Order=1) | CSG_Trend_Polynom |
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_UI_Parameter Class Reference

Public Member Functions | Public Attributes | List of all members
CSG_UI_Parameter Class Reference

#include <api_core.h>

Public Member Functions

CSG_UI_Parameter (void)
CSG_UI_Parameter (bool Value)
CSG_UI_Parameter (int Value)
CSG_UI_Parameter (double Value)
CSG_UI_Parameter (const CSG_String &Value)
CSG_UI_Parameter (void *Value)
CSG_UI_Parameter (const CSG_UI_Parameter &Copy)

Public Attributes

bool | Boolean
double | Number
void * | Pointer
CSG_String String

Detailed Description

Definition at line 1588 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_UI_Parameter() [1/7]

CSG_UI_Parameter::CSG_UI_Parameter ( void )
inline

Definition at line 1591 of file api_core.h.

◆ CSG_UI_Parameter() [2/7]

CSG_UI_Parameter::CSG_UI_Parameter ( bool Value )
inline

Definition at line 1592 of file api_core.h.

◆ CSG_UI_Parameter() [3/7]

CSG_UI_Parameter::CSG_UI_Parameter ( int Value )
inline

Definition at line 1593 of file api_core.h.

◆ CSG_UI_Parameter() [4/7]

CSG_UI_Parameter::CSG_UI_Parameter ( double Value )
inline

Definition at line 1594 of file api_core.h.

◆ CSG_UI_Parameter() [5/7]

CSG_UI_Parameter::CSG_UI_Parameter ( const CSG_String & Value )
inline

Definition at line 1595 of file api_core.h.

◆ CSG_UI_Parameter() [6/7]

CSG_UI_Parameter::CSG_UI_Parameter ( void * Value )
inline

Definition at line 1596 of file api_core.h.

◆ CSG_UI_Parameter() [7/7]

CSG_UI_Parameter::CSG_UI_Parameter ( const CSG_UI_Parameter & Copy )

Definition at line 157 of file api_callback.cpp.

References Boolean, Number, Pointer, and String.

Member Data Documentation

◆ Boolean

bool CSG_UI_Parameter::Boolean

Definition at line 1599 of file api_core.h.

Referenced by CSG_UI_Parameter().

◆ Number

double CSG_UI_Parameter::Number

Definition at line 1601 of file api_core.h.

Referenced by CSG_UI_Parameter().

◆ Pointer

void* CSG_UI_Parameter::Pointer

Definition at line 1603 of file api_core.h.

Referenced by CSG_UI_Parameter(), and SG_UI_Get_Window_Main().

◆ String

CSG_String CSG_UI_Parameter::String

Definition at line 1605 of file api_core.h.

Referenced by CSG_UI_Parameter().

The documentation for this class was generated from the following files:
  • api_core.h
  • api_callback.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_UI_Parameter Member List

This is the complete list of members for CSG_UI_Parameter, including all inherited members.

Boolean | CSG_UI_Parameter |
CSG_UI_Parameter(void) | CSG_UI_Parameter | inline
CSG_UI_Parameter(bool Value) | CSG_UI_Parameter | inline
CSG_UI_Parameter(int Value) | CSG_UI_Parameter | inline
CSG_UI_Parameter(double Value) | CSG_UI_Parameter | inline
CSG_UI_Parameter(const CSG_String &Value) | CSG_UI_Parameter | inline
CSG_UI_Parameter(void *Value) | CSG_UI_Parameter | inline
CSG_UI_Parameter(const CSG_UI_Parameter &Copy) | CSG_UI_Parameter |
Number | CSG_UI_Parameter |
Pointer | CSG_UI_Parameter |
String | CSG_UI_Parameter |
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Unique_Number_Statistics Class Reference

Public Member Functions | List of all members
CSG_Unique_Number_Statistics Class Reference

#include <mat_tools.h>

Inheritance diagram for CSG_Unique_Number_Statistics:
CSG_Unique_Value_Statistics

Public Member Functions

CSG_Unique_Number_Statistics (bool bWeights=false)
virtual | ~CSG_Unique_Number_Statistics (void)
virtual void | Create (bool bWeights=false)
void | operator+= (double Value)
void | Add_Value (double Value, double Weight=1.)
double | Get_Value (int Index) const
int | Get_Class_Index (double Value) const
bool | Get_Class (int Index, double &Value, int &Count) const
bool | Get_Majority (double &Value) const
bool | Get_Majority (double &Value, int &Count) const
bool | Get_Minority (double &Value) const
bool | Get_Minority (double &Value, int &Count) const
- Public Member Functions inherited from CSG_Unique_Value_Statistics
CSG_Unique_Value_Statistics (void)
virtual | ~CSG_Unique_Value_Statistics (void)
int | Get_Count (void) const
int | Get_Count (int i) const
double | Get_Weight (int i) const
virtual int | Get_Majority (bool bWeighted=false) const
virtual int | Get_Minority (bool bWeighted=false) const

Additional Inherited Members

- Protected Attributes inherited from CSG_Unique_Value_Statistics
bool m_bWeights {false}
CSG_Array_Int m_Count
CSG_Vector m_Weight

Detailed Description

Definition at line 821 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Unique_Number_Statistics()

CSG_Unique_Number_Statistics::CSG_Unique_Number_Statistics ( bool bWeights = false )
inline

Definition at line 824 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Create().

◆ ~CSG_Unique_Number_Statistics()

virtual CSG_Unique_Number_Statistics::~CSG_Unique_Number_Statistics ( void )
inlinevirtual

Definition at line 825 of file mat_tools.h.

Member Function Documentation

◆ Add_Value()

void CSG_Unique_Number_Statistics::Add_Value | ( | double | Value,
 |  | double | Weight = 1.
 | ) |  |

Definition at line 875 of file mat_tools.cpp.

References CSG_Array_Int::Add(), CSG_Vector::Add_Row(), CSG_Unique_Value_Statistics::Get_Count(), CSG_Unique_Value_Statistics::m_bWeights, CSG_Unique_Value_Statistics::m_Count, and CSG_Unique_Value_Statistics::m_Weight.

◆ Create()

void CSG_Unique_Number_Statistics::Create ( bool bWeights = false )
virtual

Reimplemented from CSG_Unique_Value_Statistics.

Definition at line 866 of file mat_tools.cpp.

References CSG_Array_Int::Destroy(), CSG_Vector::Destroy(), CSG_Unique_Value_Statistics::m_bWeights, and CSG_Unique_Value_Statistics::m_Count.

◆ Get_Class()

bool CSG_Unique_Number_Statistics::Get_Class | ( | int | Index,
 |  | double & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 833 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Count().

◆ Get_Class_Index()

int CSG_Unique_Number_Statistics::Get_Class_Index ( double Value ) const

Definition at line 902 of file mat_tools.cpp.

References CSG_Unique_Value_Statistics::Get_Count().

◆ Get_Majority() [1/2]

bool CSG_Unique_Number_Statistics::Get_Majority ( double & Value ) const
inline

Definition at line 843 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Majority().

◆ Get_Majority() [2/2]

bool CSG_Unique_Number_Statistics::Get_Majority | ( | double & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 844 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Majority().

◆ Get_Minority() [1/2]

bool CSG_Unique_Number_Statistics::Get_Minority ( double & Value ) const
inline

Definition at line 845 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Minority().

◆ Get_Minority() [2/2]

bool CSG_Unique_Number_Statistics::Get_Minority | ( | double & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 846 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Minority().

◆ Get_Value()

double CSG_Unique_Number_Statistics::Get_Value ( int Index ) const
inline

Definition at line 831 of file mat_tools.h.

◆ operator+=()

void CSG_Unique_Number_Statistics::operator+= ( double Value )
inline

Definition at line 829 of file mat_tools.h.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Unique_Number_Statistics Member List

This is the complete list of members for CSG_Unique_Number_Statistics, including all inherited members.

Add_Value(double Value, double Weight=1.) | CSG_Unique_Number_Statistics |
Create(bool bWeights=false) | CSG_Unique_Number_Statistics | virtual
CSG_Unique_Number_Statistics(bool bWeights=false) | CSG_Unique_Number_Statistics | inline
CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inline
Get_Class(int Index, double &Value, int &Count) const | CSG_Unique_Number_Statistics | inline
Get_Class_Index(double Value) const | CSG_Unique_Number_Statistics |
Get_Count(void) const | CSG_Unique_Value_Statistics | inline
Get_Count(int i) const | CSG_Unique_Value_Statistics | inline
Get_Majority(double &Value) const | CSG_Unique_Number_Statistics | inline
Get_Majority(double &Value, int &Count) const | CSG_Unique_Number_Statistics | inline
CSG_Unique_Value_Statistics::Get_Majority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Minority(double &Value) const | CSG_Unique_Number_Statistics | inline
Get_Minority(double &Value, int &Count) const | CSG_Unique_Number_Statistics | inline
CSG_Unique_Value_Statistics::Get_Minority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Value(int Index) const | CSG_Unique_Number_Statistics | inline
Get_Weight(int i) const | CSG_Unique_Value_Statistics | inline
m_bWeights | CSG_Unique_Value_Statistics | protected
m_Count | CSG_Unique_Value_Statistics | protected
m_Weight | CSG_Unique_Value_Statistics | protected
operator+=(double Value) | CSG_Unique_Number_Statistics | inline
~CSG_Unique_Number_Statistics(void) | CSG_Unique_Number_Statistics | inlinevirtual
~CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Unique_String_Statistics Class Reference

Public Member Functions | List of all members
CSG_Unique_String_Statistics Class Reference

#include <mat_tools.h>

Inheritance diagram for CSG_Unique_String_Statistics:
CSG_Unique_Value_Statistics

Public Member Functions

CSG_Unique_String_Statistics (bool bWeights=false)
virtual | ~CSG_Unique_String_Statistics (void)
virtual void | Create (bool bWeights=false)
void | operator+= (const CSG_String &Value)
void | Add_Value (const CSG_String &Value, double Weight=1.)
const SG_Char * | Get_Value (int Index) const
int | Get_Class_Index (const CSG_String &Value) const
bool | Get_Class (int Index, CSG_String &Value, int &Count) const
bool | Get_Majority (CSG_String &Value) const
bool | Get_Majority (CSG_String &Value, int &Count) const
bool | Get_Minority (CSG_String &Value) const
bool | Get_Minority (CSG_String &Value, int &Count) const
- Public Member Functions inherited from CSG_Unique_Value_Statistics
CSG_Unique_Value_Statistics (void)
virtual | ~CSG_Unique_Value_Statistics (void)
int | Get_Count (void) const
int | Get_Count (int i) const
double | Get_Weight (int i) const
virtual int | Get_Majority (bool bWeighted=false) const
virtual int | Get_Minority (bool bWeighted=false) const

Additional Inherited Members

- Protected Attributes inherited from CSG_Unique_Value_Statistics
bool m_bWeights {false}
CSG_Array_Int m_Count
CSG_Vector m_Weight

Detailed Description

Definition at line 856 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Unique_String_Statistics()

CSG_Unique_String_Statistics::CSG_Unique_String_Statistics ( bool bWeights = false )
inline

Definition at line 859 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Create().

◆ ~CSG_Unique_String_Statistics()

virtual CSG_Unique_String_Statistics::~CSG_Unique_String_Statistics ( void )
inlinevirtual

Definition at line 860 of file mat_tools.h.

Member Function Documentation

◆ Add_Value()

void CSG_Unique_String_Statistics::Add_Value | ( | const CSG_String & | Value,
 |  | double | Weight = 1.
 | ) |  |

Definition at line 930 of file mat_tools.cpp.

References CSG_Strings::Add(), CSG_Array_Int::Add(), CSG_Vector::Add_Row(), CSG_String::Cmp(), CSG_Unique_Value_Statistics::Get_Count(), CSG_Unique_Value_Statistics::m_bWeights, CSG_Unique_Value_Statistics::m_Count, and CSG_Unique_Value_Statistics::m_Weight.

◆ Create()

void CSG_Unique_String_Statistics::Create ( bool bWeights = false )
virtual

Reimplemented from CSG_Unique_Value_Statistics.

Definition at line 921 of file mat_tools.cpp.

References CSG_Strings::Clear(), CSG_Array_Int::Destroy(), CSG_Unique_Value_Statistics::m_bWeights, and CSG_Unique_Value_Statistics::m_Count.

◆ Get_Class()

bool CSG_Unique_String_Statistics::Get_Class | ( | int | Index,
 |  | CSG_String & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 868 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Count().

◆ Get_Class_Index()

int CSG_Unique_String_Statistics::Get_Class_Index ( const CSG_String & Value ) const

Definition at line 957 of file mat_tools.cpp.

References CSG_String::Cmp(), and CSG_Unique_Value_Statistics::Get_Count().

◆ Get_Majority() [1/2]

bool CSG_Unique_String_Statistics::Get_Majority ( CSG_String & Value ) const
inline

Definition at line 878 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Majority().

◆ Get_Majority() [2/2]

bool CSG_Unique_String_Statistics::Get_Majority | ( | CSG_String & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 879 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Majority().

◆ Get_Minority() [1/2]

bool CSG_Unique_String_Statistics::Get_Minority ( CSG_String & Value ) const
inline

Definition at line 880 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Minority().

◆ Get_Minority() [2/2]

bool CSG_Unique_String_Statistics::Get_Minority | ( | CSG_String & | Value,
 |  | int & | Count
 | ) |  | const
 inline

Definition at line 881 of file mat_tools.h.

References CSG_Unique_Value_Statistics::Get_Minority().

◆ Get_Value()

const SG_Char* CSG_Unique_String_Statistics::Get_Value ( int Index ) const
inline

Definition at line 866 of file mat_tools.h.

◆ operator+=()

void CSG_Unique_String_Statistics::operator+= ( const CSG_String & Value )
inline

Definition at line 864 of file mat_tools.h.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Unique_String_Statistics Member List

This is the complete list of members for CSG_Unique_String_Statistics, including all inherited members.

Add_Value(const CSG_String &Value, double Weight=1.) | CSG_Unique_String_Statistics |
Create(bool bWeights=false) | CSG_Unique_String_Statistics | virtual
CSG_Unique_String_Statistics(bool bWeights=false) | CSG_Unique_String_Statistics | inline
CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inline
Get_Class(int Index, CSG_String &Value, int &Count) const | CSG_Unique_String_Statistics | inline
Get_Class_Index(const CSG_String &Value) const | CSG_Unique_String_Statistics |
Get_Count(void) const | CSG_Unique_Value_Statistics | inline
Get_Count(int i) const | CSG_Unique_Value_Statistics | inline
Get_Majority(CSG_String &Value) const | CSG_Unique_String_Statistics | inline
Get_Majority(CSG_String &Value, int &Count) const | CSG_Unique_String_Statistics | inline
CSG_Unique_Value_Statistics::Get_Majority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Minority(CSG_String &Value) const | CSG_Unique_String_Statistics | inline
Get_Minority(CSG_String &Value, int &Count) const | CSG_Unique_String_Statistics | inline
CSG_Unique_Value_Statistics::Get_Minority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Value(int Index) const | CSG_Unique_String_Statistics | inline
Get_Weight(int i) const | CSG_Unique_Value_Statistics | inline
m_bWeights | CSG_Unique_Value_Statistics | protected
m_Count | CSG_Unique_Value_Statistics | protected
m_Weight | CSG_Unique_Value_Statistics | protected
operator+=(const CSG_String &Value) | CSG_Unique_String_Statistics | inline
~CSG_Unique_String_Statistics(void) | CSG_Unique_String_Statistics | inlinevirtual
~CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Unique_Value_Statistics Class Reference

Public Member Functions | Protected Attributes | List of all members
CSG_Unique_Value_Statistics Class Reference

#include <mat_tools.h>

Inheritance diagram for CSG_Unique_Value_Statistics:
CSG_Unique_Number_Statistics CSG_Unique_String_Statistics

Public Member Functions

CSG_Unique_Value_Statistics (void)
virtual | ~CSG_Unique_Value_Statistics (void)
virtual void | Create (bool bWeights=false)
int | Get_Count (void) const
int | Get_Count (int i) const
double | Get_Weight (int i) const
virtual int | Get_Majority (bool bWeighted=false) const
virtual int | Get_Minority (bool bWeighted=false) const

Protected Attributes

bool m_bWeights {false}
CSG_Array_Int m_Count
CSG_Vector m_Weight

Detailed Description

Definition at line 794 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Unique_Value_Statistics()

CSG_Unique_Value_Statistics::CSG_Unique_Value_Statistics ( void )
inline

Definition at line 797 of file mat_tools.h.

◆ ~CSG_Unique_Value_Statistics()

virtual CSG_Unique_Value_Statistics::~CSG_Unique_Value_Statistics ( void )
inlinevirtual

Definition at line 798 of file mat_tools.h.

Member Function Documentation

◆ Create()

virtual void CSG_Unique_Value_Statistics::Create ( bool bWeights = false )
inlinevirtual

Reimplemented in CSG_Unique_String_Statistics, and CSG_Unique_Number_Statistics.

Definition at line 800 of file mat_tools.h.

Referenced by CSG_Unique_Number_Statistics::CSG_Unique_Number_Statistics(), and CSG_Unique_String_Statistics::CSG_Unique_String_Statistics().

◆ Get_Count() [1/2]

int CSG_Unique_Value_Statistics::Get_Count ( int i ) const
inline

Definition at line 803 of file mat_tools.h.

◆ Get_Count() [2/2]

int CSG_Unique_Value_Statistics::Get_Count ( void ) const
inline

Definition at line 802 of file mat_tools.h.

Referenced by CSG_Unique_String_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Add_Value(), CSG_Unique_String_Statistics::Get_Class(), CSG_Unique_Number_Statistics::Get_Class(), CSG_Unique_String_Statistics::Get_Class_Index(), CSG_Unique_Number_Statistics::Get_Class_Index(), Get_Majority(), and Get_Minority().

◆ Get_Majority()

int CSG_Unique_Value_Statistics::Get_Majority ( bool bWeighted = false ) const
virtual

Definition at line 805 of file mat_tools.cpp.

References Get_Count(), m_bWeights, m_Count, and m_Weight.

Referenced by CSG_Unique_String_Statistics::Get_Majority(), and CSG_Unique_Number_Statistics::Get_Majority().

◆ Get_Minority()

int CSG_Unique_Value_Statistics::Get_Minority ( bool bWeighted = false ) const
virtual

Definition at line 833 of file mat_tools.cpp.

References Get_Count(), m_bWeights, m_Count, and m_Weight.

Referenced by CSG_Unique_String_Statistics::Get_Minority(), and CSG_Unique_Number_Statistics::Get_Minority().

◆ Get_Weight()

double CSG_Unique_Value_Statistics::Get_Weight ( int i ) const
inline

Definition at line 804 of file mat_tools.h.

Member Data Documentation

◆ m_bWeights

bool CSG_Unique_Value_Statistics::m_bWeights {false}
protected

Definition at line 812 of file mat_tools.h.

Referenced by CSG_Unique_String_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Create(), CSG_Unique_String_Statistics::Create(), Get_Majority(), and Get_Minority().

◆ m_Count

CSG_Array_Int CSG_Unique_Value_Statistics::m_Count
protected

Definition at line 814 of file mat_tools.h.

Referenced by CSG_Unique_String_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Create(), CSG_Unique_String_Statistics::Create(), Get_Majority(), and Get_Minority().

◆ m_Weight

CSG_Vector CSG_Unique_Value_Statistics::m_Weight
protected

Definition at line 816 of file mat_tools.h.

Referenced by CSG_Unique_String_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Add_Value(), Get_Majority(), and Get_Minority().

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_tools.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Unique_Value_Statistics Member List

This is the complete list of members for CSG_Unique_Value_Statistics, including all inherited members.

Create(bool bWeights=false) | CSG_Unique_Value_Statistics | inlinevirtual
CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inline
Get_Count(void) const | CSG_Unique_Value_Statistics | inline
Get_Count(int i) const | CSG_Unique_Value_Statistics | inline
Get_Majority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Minority(bool bWeighted=false) const | CSG_Unique_Value_Statistics | virtual
Get_Weight(int i) const | CSG_Unique_Value_Statistics | inline
m_bWeights | CSG_Unique_Value_Statistics | protected
m_Count | CSG_Unique_Value_Statistics | protected
m_Weight | CSG_Unique_Value_Statistics | protected
~CSG_Unique_Value_Statistics(void) | CSG_Unique_Value_Statistics | inlinevirtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: CSG_Vector Class Reference

Public Types | Public Member Functions | List of all members
CSG_Vector Class Reference

#include <mat_tools.h>

Public Types

typedef double const * const_iterator

Public Member Functions

CSG_Vector (void)
virtual | ~CSG_Vector (void)
CSG_Vector (const CSG_Vector &Vector)
bool | Create (const CSG_Vector &Vector)
CSG_Vector (sLong n, const double *Data=NULL)
bool | Create (sLong n, const double *Data=NULL)
bool | Destroy (void)
bool | Set_Rows (sLong nRows)
bool | Add_Rows (sLong nRows)
bool | Del_Rows (sLong nRows)
bool | Add_Row (double Value=0.)
bool | Del_Row (sLong Row=-1)
sLong | Get_Row_Count (void) const
sLong | Get_Size (void) const
size_t | Get_uSize (void) const
int | Get_N (void) const
double * | Get_Data (void) const
double | Get_Data (sLong x) const
double | operator() (sLong x) const
double & | operator[] (sLong x)
double & | operator[] (size_t x)
double & | operator[] (int x)
const double & | operator[] (sLong x) const
const double & | operator[] (size_t x) const
const double & | operator[] (int x) const
operator const double * (void) const
CSG_String | to_String (int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
bool | from_String (const CSG_String &String)
bool | is_Null (void) const
bool | is_Equal (const CSG_Vector &Vector) const
bool | is_Collinear (const CSG_Vector &Vector) const
bool | Assign (double Scalar)
bool | Assign (const CSG_Vector &Vector)
bool | Add (double Scalar)
bool | Add (const CSG_Vector &Vector)
bool | Subtract (const CSG_Vector &Vector)
bool | Multiply (double Scalar)
bool | Multiply (const CSG_Vector &Vector)
bool | Multiply_Cross (const CSG_Vector &Vector)
double | Multiply_Scalar (const CSG_Vector &Vector) const
bool | Multiply (const class CSG_Matrix &Matrix)
bool | operator== (const CSG_Vector &Vector) const
bool | operator!= (const CSG_Vector &Vector) const
CSG_Vector & | operator= (double Scalar)
CSG_Vector & | operator= (const CSG_Vector &Vector)
CSG_Vector & | operator+= (double Scalar)
CSG_Vector & | operator+= (const CSG_Vector &Vector)
CSG_Vector & | operator-= (double Scalar)
CSG_Vector & | operator-= (const CSG_Vector &Vector)
CSG_Vector & | operator*= (double Scalar)
CSG_Vector & | operator*= (const CSG_Vector &Vector)
CSG_Vector & | operator*= (const class CSG_Matrix &Matrix)
CSG_Vector | operator+ (double Scalar) const
CSG_Vector | operator+ (const CSG_Vector &Vector) const
CSG_Vector | operator- (double Scalar) const
CSG_Vector | operator- (const CSG_Vector &Vector) const
CSG_Vector | operator* (double Scalar) const
double | operator* (const CSG_Vector &Vector) const
bool | Set_Zero (void)
bool | Set_Unity (void)
bool | Flip_Values (void)
bool | Sort (bool bAscending=true)
double | Get_Length (void) const
CSG_Vector | Get_Scalar_Product (const CSG_Vector &Vector) const
CSG_Vector | Get_Cross_Product (const CSG_Vector &Vector) const
double | Get_Angle (const CSG_Vector &Vector) const
CSG_Vector | Get_Unity (void) const
const_iterator | begin (void) const
const_iterator | end (void) const
const_iterator | cbegin (void) const
const_iterator | cend (void) const

Detailed Description

Definition at line 344 of file mat_tools.h.

Member Typedef Documentation

◆ const_iterator

typedef double const* CSG_Vector::const_iterator

Definition at line 429 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Vector() [1/3]

CSG_Vector::CSG_Vector ( void )

Definition at line 74 of file mat_matrix.cpp.

References CSG_Array::Create().

◆ ~CSG_Vector()

CSG_Vector::~CSG_Vector ( void )
virtual

Definition at line 125 of file mat_matrix.cpp.

References Destroy().

◆ CSG_Vector() [2/3]

CSG_Vector::CSG_Vector ( const CSG_Vector & Vector )

Definition at line 80 of file mat_matrix.cpp.

References CSG_Array::Create(), and Create().

◆ CSG_Vector() [3/3]

CSG_Vector::CSG_Vector | ( | sLong | n,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 93 of file mat_matrix.cpp.

References CSG_Array::Create(), and Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Vector::Add ( const CSG_Vector & Vector )

Definition at line 362 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

◆ Add() [2/2]

bool CSG_Vector::Add ( double Scalar )

Definition at line 346 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator+(), operator+=(), operator-(), and operator-=().

◆ Add_Row()

bool CSG_Vector::Add_Row ( double Value = 0. )

Definition at line 188 of file mat_matrix.cpp.

References Get_Data(), Get_Size(), and CSG_Array::Inc_Array().

Referenced by CSG_Spline::Add(), CSG_Trend_Polynom::Add_Data(), CSG_Regression_Weighted::Add_Sample(), CSG_Unique_String_Statistics::Add_Value(), CSG_Unique_Number_Statistics::Add_Value(), CSG_Regression::Add_Values(), CSG_Natural_Breaks::Create(), from_String(), and CSG_Matrix::from_String().

◆ Add_Rows()

bool CSG_Vector::Add_Rows ( sLong nRows )

Definition at line 156 of file mat_matrix.cpp.

References Get_Data(), Get_Size(), and CSG_Array::Set_Array().

Referenced by CSG_Trend_Polynom::Set_Data(), and Set_Rows().

◆ Assign() [1/2]

bool CSG_Vector::Assign ( const CSG_Vector & Vector )

Definition at line 333 of file mat_matrix.cpp.

References Create(), Get_Data(), and Get_Size().

◆ Assign() [2/2]

bool CSG_Vector::Assign ( double Scalar )

Definition at line 317 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Create(), Multiply(), and operator=().

◆ begin()

const_iterator CSG_Vector::begin ( void ) const
inline

Definition at line 431 of file mat_tools.h.

◆ cbegin()

const_iterator CSG_Vector::cbegin ( void ) const
inline

Definition at line 433 of file mat_tools.h.

◆ cend()

const_iterator CSG_Vector::cend ( void ) const
inline

Definition at line 434 of file mat_tools.h.

◆ Create() [1/2]

bool CSG_Vector::Create ( const CSG_Vector & Vector )

Definition at line 87 of file mat_matrix.cpp.

References Assign().

Referenced by CSG_Spline::_Create(), CSG_Regression_Multiple::_Get_Regression(), Assign(), CSG_Natural_Breaks::Create(), CSG_Thin_Plate_Spline::Create(), CSG_Vector(), CSG_Cluster_Analysis::Execute(), CSG_Matrix::Get_Col(), CSG_KDTree_2D::Get_Duplicates(), CSG_KDTree_3D::Get_Duplicates(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_KDTree_3D::Get_Nearest_Points(), CSG_Regression_Multiple::Get_Residuals(), CSG_Grid::Get_Row(), CSG_Matrix::Get_Row(), CSG_Matrix::Multiply(), CSG_Regression::Set_Values(), Set_Zero(), and SG_Matrix_Triangular_Decomposition().

◆ Create() [2/2]

bool CSG_Vector::Create | ( | sLong | n,
 |  | const double * | Data = NULL
 | ) |  |

Definition at line 100 of file mat_matrix.cpp.

References Destroy(), Get_Data(), and CSG_Array::Set_Array().

◆ Del_Row()

bool CSG_Vector::Del_Row ( sLong Row = -1 )

Definition at line 201 of file mat_matrix.cpp.

References CSG_Array::Dec_Array(), Get_Data(), and Get_Size().

◆ Del_Rows()

bool CSG_Vector::Del_Rows ( sLong nRows )

Deletes last nRows rows. Sets size to zero if nRows is greater than current number of rows Returns true if successful.

Definition at line 177 of file mat_matrix.cpp.

References Destroy(), Get_Size(), and CSG_Array::Set_Array().

Referenced by Set_Rows().

◆ Destroy()

bool CSG_Vector::Destroy ( void )

Definition at line 130 of file mat_matrix.cpp.

References CSG_Array::Set_Array().

Referenced by CSG_Trend_Polynom::Clr_Data(), CSG_Unique_Number_Statistics::Create(), CSG_Natural_Breaks::Create(), Create(), Del_Rows(), CSG_Cluster_Analysis::Destroy(), CSG_Spline::Destroy(), CSG_Thin_Plate_Spline::Destroy(), CSG_Regression::Destroy(), CSG_Regression_Weighted::Destroy(), CSG_KDTree::Destroy(), from_String(), CSG_Trend_Polynom::Set_Order(), and ~CSG_Vector().

◆ end()

const_iterator CSG_Vector::end ( void ) const
inline

Definition at line 432 of file mat_tools.h.

◆ Flip_Values()

bool CSG_Vector::Flip_Values ( void )

Definition at line 619 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Sort().

◆ from_String()

bool CSG_Vector::from_String ( const CSG_String & String )

Definition at line 238 of file mat_matrix.cpp.

References Add_Row(), CSG_String::asDouble(), Destroy(), CSG_String_Tokenizer::Get_Next_Token(), Get_Size(), and CSG_String_Tokenizer::Has_More_Tokens().

◆ Get_Angle()

double CSG_Vector::Get_Angle ( const CSG_Vector & Vector ) const

Definition at line 703 of file mat_matrix.cpp.

References A, B, Get_Angle(), Get_Data(), Get_Length(), and Get_Size().

Referenced by Get_Angle().

◆ Get_Cross_Product()

CSG_Vector CSG_Vector::Get_Cross_Product ( const CSG_Vector & Vector ) const

Definition at line 675 of file mat_matrix.cpp.

References Multiply_Cross().

◆ Get_Data() [1/2]

double CSG_Vector::Get_Data ( sLong x ) const
inline

Definition at line 370 of file mat_tools.h.

References Get_Data().

Referenced by Get_Data().

◆ Get_Data() [2/2]

double* CSG_Vector::Get_Data ( void ) const
inline

Definition at line 369 of file mat_tools.h.

Referenced by CSG_Spline::_Create(), Add(), CSG_Matrix::Add_Col(), CSG_Matrix::Add_Row(), Add_Row(), Add_Rows(), Assign(), Create(), Del_Row(), Flip_Values(), Get_Angle(), Get_Length(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_KDTree_3D::Get_Nearest_Points(), CSG_Formula::Get_Value(), CSG_Matrix::Ins_Col(), CSG_Matrix::Ins_Row(), is_Collinear(), is_Equal(), is_Null(), Multiply(), Multiply_Cross(), Multiply_Scalar(), CSG_Matrix::Set_Col(), CSG_Matrix::Set_Inverse(), CSG_Matrix::Set_Row(), Set_Unity(), SG_Matrix_Solve(), SG_VectorR3_Rotate(), Sort(), Subtract(), and to_String().

◆ Get_Length()

double CSG_Vector::Get_Length ( void ) const

Definition at line 685 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Angle(), is_Collinear(), and Set_Unity().

◆ Get_N()

int CSG_Vector::Get_N ( void ) const
inline

Definition at line 367 of file mat_tools.h.

Referenced by CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Add_Sample(), CSG_Regression_Weighted::Calculate(), CSG_Histogram::Create(), CSG_Classifier_Supervised::Get_Class(), CSG_KDTree_2D::Get_Nearest_Points(), CSG_KDTree_3D::Get_Nearest_Points(), CSG_Regression_Multiple::Get_Residuals(), CSG_Trend_Polynom::Get_Trend(), CSG_Regression_Multiple::Get_Value(), CSG_Formula::Get_Value(), CSG_Trend_Polynom::Get_Value(), is_Collinear(), is_Equal(), is_Null(), CSG_Trend_Polynom::Set_Data(), CSG_Grid::Set_Row(), SG_Matrix_Solve(), SG_Matrix_Tridiagonal_QL(), and CSG_Classifier_Supervised::Train_Add_Sample().

◆ Get_Row_Count()

sLong CSG_Vector::Get_Row_Count ( void ) const
inline

Definition at line 364 of file mat_tools.h.

◆ Get_Scalar_Product()

CSG_Vector CSG_Vector::Get_Scalar_Product ( const CSG_Vector & Vector ) const

Definition at line 665 of file mat_matrix.cpp.

References Multiply_Scalar().

◆ Get_Size()

sLong CSG_Vector::Get_Size ( void ) const
inline

Definition at line 365 of file mat_tools.h.

Referenced by Add(), CSG_Matrix::Add_Col(), CSG_Matrix::Add_Row(), Add_Row(), Add_Rows(), Assign(), CSG_Regression_Weighted::Calculate(), CSG_Simple_Statistics::Create(), Del_Row(), Del_Rows(), Flip_Values(), from_String(), Get_Angle(), Get_Length(), CSG_Trend_Polynom::Get_Trend(), CSG_Thin_Plate_Spline::Get_Value(), CSG_Matrix::Ins_Col(), CSG_Matrix::Ins_Row(), is_Collinear(), is_Equal(), CSG_Matrix::Multiply(), Multiply(), Multiply_Cross(), Multiply_Scalar(), CSG_Matrix::Set_Col(), CSG_Matrix::Set_Row(), Set_Rows(), Set_Unity(), Set_Zero(), SG_VectorR2_Rotate(), SG_VectorR3_Rotate(), Sort(), Subtract(), and to_String().

◆ Get_Unity()

CSG_Vector CSG_Vector::Get_Unity ( void ) const

Definition at line 733 of file mat_matrix.cpp.

References Set_Unity().

◆ Get_uSize()

size_t CSG_Vector::Get_uSize ( void ) const
inline

Definition at line 366 of file mat_tools.h.

◆ is_Collinear()

bool CSG_Vector::is_Collinear ( const CSG_Vector & Vector ) const

Definition at line 296 of file mat_matrix.cpp.

References Get_Data(), Get_Length(), Get_N(), Get_Size(), and is_Null().

◆ is_Equal()

bool CSG_Vector::is_Equal ( const CSG_Vector & Vector ) const

Definition at line 277 of file mat_matrix.cpp.

References Get_Data(), Get_N(), and Get_Size().

◆ is_Null()

bool CSG_Vector::is_Null ( void ) const

Definition at line 263 of file mat_matrix.cpp.

References Get_Data(), and Get_N().

Referenced by is_Collinear().

◆ Multiply() [1/3]

bool CSG_Vector::Multiply ( const class CSG_Matrix & Matrix )

Definition at line 449 of file mat_matrix.cpp.

References Assign(), and CSG_Matrix::Multiply().

◆ Multiply() [2/3]

bool CSG_Vector::Multiply ( const CSG_Vector & Vector )

Definition at line 410 of file mat_matrix.cpp.

References Multiply_Cross().

◆ Multiply() [3/3]

bool CSG_Vector::Multiply ( double Scalar )

Definition at line 394 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator*(), and operator*=().

◆ Multiply_Cross()

bool CSG_Vector::Multiply_Cross ( const CSG_Vector & Vector )

Definition at line 416 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Cross_Product(), and Multiply().

◆ Multiply_Scalar()

double CSG_Vector::Multiply_Scalar ( const CSG_Vector & Vector ) const

Definition at line 433 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by Get_Scalar_Product(), and operator*().

◆ operator const double *()

CSG_Vector::operator const double * ( void ) const
inline

Definition at line 378 of file mat_tools.h.

◆ operator!=()

bool CSG_Vector::operator!= ( const CSG_Vector & Vector ) const
inline

Definition at line 399 of file mat_tools.h.

◆ operator()()

double CSG_Vector::operator() ( sLong x ) const
inline

Definition at line 371 of file mat_tools.h.

◆ operator*() [1/2]

double CSG_Vector::operator* ( const CSG_Vector & Vector ) const

Definition at line 574 of file mat_matrix.cpp.

References Multiply_Scalar().

◆ operator*() [2/2]

CSG_Vector CSG_Vector::operator* ( double Scalar ) const

Definition at line 565 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [1/3]

CSG_Vector & CSG_Vector::operator*= ( const class CSG_Matrix & Matrix )

Definition at line 519 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [2/3]

CSG_Vector & CSG_Vector::operator*= ( const CSG_Vector & Vector )

Definition at line 512 of file mat_matrix.cpp.

References Multiply().

◆ operator*=() [3/3]

CSG_Vector & CSG_Vector::operator*= ( double Scalar )

Definition at line 505 of file mat_matrix.cpp.

References Multiply().

◆ operator+() [1/2]

CSG_Vector CSG_Vector::operator+ ( const CSG_Vector & Vector ) const

Definition at line 536 of file mat_matrix.cpp.

References Add().

◆ operator+() [2/2]

CSG_Vector CSG_Vector::operator+ ( double Scalar ) const

Definition at line 527 of file mat_matrix.cpp.

References Add().

◆ operator+=() [1/2]

CSG_Vector & CSG_Vector::operator+= ( const CSG_Vector & Vector )

Definition at line 482 of file mat_matrix.cpp.

References Add().

◆ operator+=() [2/2]

CSG_Vector & CSG_Vector::operator+= ( double Scalar )

Definition at line 475 of file mat_matrix.cpp.

References Add().

◆ operator-() [1/2]

CSG_Vector CSG_Vector::operator- ( const CSG_Vector & Vector ) const

Definition at line 555 of file mat_matrix.cpp.

References Subtract().

◆ operator-() [2/2]

CSG_Vector CSG_Vector::operator- ( double Scalar ) const

Definition at line 546 of file mat_matrix.cpp.

References Add().

◆ operator-=() [1/2]

CSG_Vector & CSG_Vector::operator-= ( const CSG_Vector & Vector )

Definition at line 497 of file mat_matrix.cpp.

References Subtract().

◆ operator-=() [2/2]

CSG_Vector & CSG_Vector::operator-= ( double Scalar )

Definition at line 490 of file mat_matrix.cpp.

References Add().

◆ operator=() [1/2]

CSG_Vector & CSG_Vector::operator= ( const CSG_Vector & Vector )

Definition at line 467 of file mat_matrix.cpp.

References Assign().

◆ operator=() [2/2]

CSG_Vector & CSG_Vector::operator= ( double Scalar )

Definition at line 460 of file mat_matrix.cpp.

References Assign().

◆ operator==()

bool CSG_Vector::operator== ( const CSG_Vector & Vector ) const
inline

Definition at line 398 of file mat_tools.h.

◆ operator[]() [1/6]

double& CSG_Vector::operator[] ( int x )
inline

Definition at line 374 of file mat_tools.h.

◆ operator[]() [2/6]

const double& CSG_Vector::operator[] ( int x ) const
inline

Definition at line 377 of file mat_tools.h.

◆ operator[]() [3/6]

double& CSG_Vector::operator[] ( size_t x )
inline

Definition at line 373 of file mat_tools.h.

◆ operator[]() [4/6]

const double& CSG_Vector::operator[] ( size_t x ) const
inline

Definition at line 376 of file mat_tools.h.

◆ operator[]() [5/6]

double& CSG_Vector::operator[] ( sLong x )
inline

Definition at line 372 of file mat_tools.h.

◆ operator[]() [6/6]

const double& CSG_Vector::operator[] ( sLong x ) const
inline

Definition at line 375 of file mat_tools.h.

◆ Set_Rows()

bool CSG_Vector::Set_Rows ( sLong nRows )

Sets the number of rows to nRows. Values will be preserved. Returns true if successful.

Definition at line 140 of file mat_matrix.cpp.

References Add_Rows(), Del_Rows(), and Get_Size().

Referenced by CSG_KDTree_2D::Get_Nearest_Points(), and CSG_KDTree_3D::Get_Nearest_Points().

◆ Set_Unity()

bool CSG_Vector::Set_Unity ( void )

Definition at line 596 of file mat_matrix.cpp.

References Get_Data(), Get_Length(), and Get_Size().

Referenced by Get_Unity().

◆ Set_Zero()

bool CSG_Vector::Set_Zero ( void )

Definition at line 590 of file mat_matrix.cpp.

References Create(), and Get_Size().

Referenced by CSG_Matrix::Set_Inverse().

◆ Sort()

bool CSG_Vector::Sort ( bool bAscending = true )

Definition at line 642 of file mat_matrix.cpp.

References Flip_Values(), Get_Data(), Get_Size(), and SG_Compare_Double().

Referenced by CSG_Natural_Breaks::Create().

◆ Subtract()

bool CSG_Vector::Subtract ( const CSG_Vector & Vector )

Definition at line 378 of file mat_matrix.cpp.

References Get_Data(), and Get_Size().

Referenced by operator-(), and operator-=().

◆ to_String()

CSG_String CSG_Vector::to_String | ( | int | Width = -1,
 |  | int | Precision = -1,
 |  | bool | bScientific = false,
 |  | const SG_Char * | Separator = NULL
 | ) |  | const

Definition at line 225 of file mat_matrix.cpp.

References Get_Data(), Get_Size(), SG_Get_Double_asString(), and SG_T.

The documentation for this class was generated from the following files:
  • mat_tools.h
  • mat_matrix.cpp
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

CSG_Vector Member List

This is the complete list of members for CSG_Vector, including all inherited members.

Add(double Scalar) | CSG_Vector |
Add(const CSG_Vector &Vector) | CSG_Vector |
Add_Row(double Value=0.) | CSG_Vector |
Add_Rows(sLong nRows) | CSG_Vector |
Assign(double Scalar) | CSG_Vector |
Assign(const CSG_Vector &Vector) | CSG_Vector |
begin(void) const | CSG_Vector | inline
cbegin(void) const | CSG_Vector | inline
cend(void) const | CSG_Vector | inline
const_iterator typedef | CSG_Vector |
Create(const CSG_Vector &Vector) | CSG_Vector |
Create(sLong n, const double *Data=NULL) | CSG_Vector |
CSG_Vector(void) | CSG_Vector |
CSG_Vector(const CSG_Vector &Vector) | CSG_Vector |
CSG_Vector(sLong n, const double *Data=NULL) | CSG_Vector |
Del_Row(sLong Row=-1) | CSG_Vector |
Del_Rows(sLong nRows) | CSG_Vector |
Destroy(void) | CSG_Vector |
end(void) const | CSG_Vector | inline
Flip_Values(void) | CSG_Vector |
from_String(const CSG_String &String) | CSG_Vector |
Get_Angle(const CSG_Vector &Vector) const | CSG_Vector |
Get_Cross_Product(const CSG_Vector &Vector) const | CSG_Vector |
Get_Data(void) const | CSG_Vector | inline
Get_Data(sLong x) const | CSG_Vector | inline
Get_Length(void) const | CSG_Vector |
Get_N(void) const | CSG_Vector | inline
Get_Row_Count(void) const | CSG_Vector | inline
Get_Scalar_Product(const CSG_Vector &Vector) const | CSG_Vector |
Get_Size(void) const | CSG_Vector | inline
Get_Unity(void) const | CSG_Vector |
Get_uSize(void) const | CSG_Vector | inline
is_Collinear(const CSG_Vector &Vector) const | CSG_Vector |
is_Equal(const CSG_Vector &Vector) const | CSG_Vector |
is_Null(void) const | CSG_Vector |
Multiply(double Scalar) | CSG_Vector |
Multiply(const CSG_Vector &Vector) | CSG_Vector |
Multiply(const class CSG_Matrix &Matrix) | CSG_Vector |
Multiply_Cross(const CSG_Vector &Vector) | CSG_Vector |
Multiply_Scalar(const CSG_Vector &Vector) const | CSG_Vector |
operator const double *(void) const | CSG_Vector | inline
operator!=(const CSG_Vector &Vector) const | CSG_Vector | inline
operator()(sLong x) const | CSG_Vector | inline
operator*(double Scalar) const | CSG_Vector |
operator*(const CSG_Vector &Vector) const | CSG_Vector |
operator*=(double Scalar) | CSG_Vector |
operator*=(const CSG_Vector &Vector) | CSG_Vector |
operator*=(const class CSG_Matrix &Matrix) | CSG_Vector |
operator+(double Scalar) const | CSG_Vector |
operator+(const CSG_Vector &Vector) const | CSG_Vector |
operator+=(double Scalar) | CSG_Vector |
operator+=(const CSG_Vector &Vector) | CSG_Vector |
operator-(double Scalar) const | CSG_Vector |
operator-(const CSG_Vector &Vector) const | CSG_Vector |
operator-=(double Scalar) | CSG_Vector |
operator-=(const CSG_Vector &Vector) | CSG_Vector |
operator=(double Scalar) | CSG_Vector |
operator=(const CSG_Vector &Vector) | CSG_Vector |
operator==(const CSG_Vector &Vector) const | CSG_Vector | inline
operator[](sLong x) | CSG_Vector | inline
operator[](size_t x) | CSG_Vector | inline
operator[](int x) | CSG_Vector | inline
operator[](sLong x) const | CSG_Vector | inline
operator[](size_t x) const | CSG_Vector | inline
operator[](int x) const | CSG_Vector | inline
Set_Rows(sLong nRows) | CSG_Vector |
Set_Unity(void) | CSG_Vector |
Set_Zero(void) | CSG_Vector |
Sort(bool bAscending=true) | CSG_Vector |
Subtract(const CSG_Vector &Vector) | CSG_Vector |
to_String(int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const | CSG_Vector |
~CSG_Vector(void) | CSG_Vector | virtual
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Point Struct Reference

Public Attributes | List of all members
SSG_Point Struct Reference

#include <geo_tools.h>

Inheritance diagram for SSG_Point:
CSG_Point

Public Attributes

double | x
double | y

Detailed Description

Definition at line 127 of file geo_tools.h.

Member Data Documentation

◆ x

double SSG_Point::x

Definition at line 129 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_Point::Add(), CSG_Points::Add(), CSG_Thin_Plate_Spline::Add_Point(), CSG_PRQuadTree::Add_Point(), CSG_Point::Assign(), CSG_Shape_Polygon_Part::Contains(), CSG_Shape_Polygon::Contains(), CSG_Rect::Contains(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Grid_System::Create(), CSG_Point::CSG_Point(), CSG_Point::Divide(), CSG_Grid_System::Fit_to_Grid_System(), CSG_Shape_Points::Get_Centroid(), CSG_Shape_Polygon::Get_Centroid(), CSG_Shape_Point::Get_Extent(), CSG_Grid::Get_Gradient(), CSG_Grid_System::Get_Grid_to_World(), CSG_Point::Get_Length(), CSG_PRQuadTree::Get_Nearest_Leaf(), CSG_PRQuadTree::Get_Nearest_Point(), CSG_PRQuadTree::Get_Nearest_Points(), CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), CSG_Shape_Polygon_Part::Get_Point_Relation(), CSG_Shape_Polygon::Get_Point_Relation(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), CSG_TIN_Node::Get_Polygon(), CSG_PRQuadTree_Item::Get_Quadrant(), CSG_PointCloud::Get_Shape(), CSG_Shapes::Get_Shape(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Grid::Get_Value(), CSG_TIN_Triangle::Get_Value(), CSG_Grid_System::Get_World_to_Grid(), CSG_Shape_Points::Ins_Point(), CSG_Shape_Part::Ins_Point(), CSG_TIN_Triangle::is_Containing(), CSG_Point::is_Equal(), CSG_Grid::is_InGrid_byPos(), CSG_Shape_Polygon_Part::is_OnEdge(), CSG_Shape_Polygon::is_OnEdge(), CSG_Rect::Move(), CSG_Point::Multiply(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Point::operator+(), CSG_Rect::operator+=(), CSG_Point::operator-(), CSG_PointCloud::Select(), CSG_PRQuadTree::Select_Nearest_Points(), CSG_Rect::Set_BottomLeft(), CSG_Parameters_Point_Search_KDTree_2D::Set_Location(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), CSG_Shape_Part::Set_Point(), CSG_Thin_Plate_Spline::Set_Point(), CSG_Rect::Set_TopRight(), SG_Get_Crossing(), SG_Get_Crossing_InRegion(), SG_Get_Nearest_Point_On_Line(), SG_Get_Polygon_Area(), SG_Get_Projected(), SG_Get_Triangle_CircumCircle(), SG_Is_Between(), SG_Is_Point_On_Line(), CSG_Point::Subtract(), and CSG_Rect::Union().

◆ y

double SSG_Point::y

Definition at line 129 of file geo_tools.h.

Referenced by CSG_TIN::_Triangulate(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_Point::Add(), CSG_Points::Add(), CSG_Thin_Plate_Spline::Add_Point(), CSG_PRQuadTree::Add_Point(), CSG_Point::Assign(), CSG_Shape_Polygon_Part::Contains(), CSG_Shape_Polygon::Contains(), CSG_Rect::Contains(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Grid_System::Create(), CSG_Point::CSG_Point(), CSG_Point::Divide(), CSG_Grid_System::Fit_to_Grid_System(), CSG_Shape_Points::Get_Centroid(), CSG_Shape_Polygon::Get_Centroid(), CSG_Shape_Point::Get_Extent(), CSG_Grid::Get_Gradient(), CSG_Grid_System::Get_Grid_to_World(), CSG_Point::Get_Length(), CSG_PRQuadTree::Get_Nearest_Leaf(), CSG_PRQuadTree::Get_Nearest_Point(), CSG_PRQuadTree::Get_Nearest_Points(), CSG_Parameters_Point_Search_KDTree_2D::Get_Point(), CSG_Shape_Polygon_Part::Get_Point_Relation(), CSG_Shape_Polygon::Get_Point_Relation(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Parameters_Point_Search_KDTree_2D::Get_Points(), CSG_TIN_Node::Get_Polygon(), CSG_PRQuadTree_Item::Get_Quadrant(), CSG_PointCloud::Get_Shape(), CSG_Shapes::Get_Shape(), CSG_Shape_Polygon_Part::Get_Shared_Edges(), CSG_Grid::Get_Value(), CSG_TIN_Triangle::Get_Value(), CSG_Grid_System::Get_World_to_Grid(), CSG_Shape_Points::Ins_Point(), CSG_Shape_Part::Ins_Point(), CSG_TIN_Triangle::is_Containing(), CSG_Point::is_Equal(), CSG_Grid::is_InGrid_byPos(), CSG_Shape_Polygon_Part::is_OnEdge(), CSG_Shape_Polygon::is_OnEdge(), CSG_Rect::Move(), CSG_Point::Multiply(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Point::operator+(), CSG_Rect::operator+=(), CSG_Point::operator-(), CSG_Rect::operator-=(), CSG_PointCloud::Select(), CSG_PRQuadTree::Select_Nearest_Points(), CSG_Rect::Set_BottomLeft(), CSG_Parameters_Point_Search_KDTree_2D::Set_Location(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), CSG_Shape_Part::Set_Point(), CSG_Thin_Plate_Spline::Set_Point(), CSG_Rect::Set_TopRight(), SG_Get_Crossing(), SG_Get_Crossing_InRegion(), SG_Get_Nearest_Point_On_Line(), SG_Get_Polygon_Area(), SG_Get_Projected(), SG_Get_Triangle_CircumCircle(), SG_Is_Between(), SG_Is_Point_On_Line(), CSG_Point::Subtract(), and CSG_Rect::Union().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Point Member List

This is the complete list of members for SSG_Point, including all inherited members.

x | SSG_Point
y | SSG_Point
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Point_3D Struct Reference

Public Attributes | List of all members
SSG_Point_3D Struct Reference

#include <geo_tools.h>

Inheritance diagram for SSG_Point_3D:
CSG_Point_3D

Public Attributes

double | x
double | y
double | z

Detailed Description

Definition at line 263 of file geo_tools.h.

Member Data Documentation

◆ x

double SSG_Point_3D::x

Definition at line 265 of file geo_tools.h.

Referenced by CSG_Point_3D::Add(), CSG_Points_3D::Add(), CSG_Point_3D::Assign(), CSG_Point_3D::CSG_Point_3D(), CSG_Point_3D::Divide(), CSG_Point_3D::Get_Length(), CSG_PointCloud::Get_Point(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Grids::Get_Value(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_3D::is_Equal(), CSG_Grids::is_InGrid_byPos(), CSG_Point_3D::Multiply(), CSG_Point_3D::operator+(), CSG_Point_3D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), CSG_PointCloud::Set_Point(), and CSG_Point_3D::Subtract().

◆ y

double SSG_Point_3D::y

Definition at line 265 of file geo_tools.h.

Referenced by CSG_Point_3D::Add(), CSG_Points_3D::Add(), CSG_Point_3D::Assign(), CSG_Point_3D::CSG_Point_3D(), CSG_Point_3D::Divide(), CSG_Point_3D::Get_Length(), CSG_PointCloud::Get_Point(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Grids::Get_Value(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_3D::is_Equal(), CSG_Grids::is_InGrid_byPos(), CSG_Point_3D::Multiply(), CSG_Point_3D::operator+(), CSG_Point_3D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), CSG_PointCloud::Set_Point(), and CSG_Point_3D::Subtract().

◆ z

double SSG_Point_3D::z

Definition at line 265 of file geo_tools.h.

Referenced by CSG_Point_3D::Add(), CSG_Points_3D::Add(), CSG_Point_3D::Assign(), CSG_Point_3D::CSG_Point_3D(), CSG_Point_3D::Divide(), CSG_Point_3D::Get_Length(), CSG_PointCloud::Get_Point(), CSG_Shape_Part::Get_Point_Z(), CSG_Shape::Get_Point_Z(), CSG_Grids::Get_Value(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Grids::is_InGrid_byPos(), CSG_Point_3D::Multiply(), CSG_Point_3D::operator+(), CSG_Point_3D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), CSG_PointCloud::Set_Point(), and CSG_Point_3D::Subtract().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Point_3D Member List

This is the complete list of members for SSG_Point_3D, including all inherited members.

x | SSG_Point_3D
y | SSG_Point_3D
z | SSG_Point_3D
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Point_4D Struct Reference

Public Attributes | List of all members
SSG_Point_4D Struct Reference

#include <geo_tools.h>

Inheritance diagram for SSG_Point_4D:
CSG_Point_4D

Public Attributes

double | x
double | y
double | z
double | m

Detailed Description

Definition at line 356 of file geo_tools.h.

Member Data Documentation

◆ m

double SSG_Point_4D::m

Definition at line 358 of file geo_tools.h.

Referenced by CSG_Point_4D::Add(), CSG_Point_4D::Assign(), CSG_Point_4D::CSG_Point_4D(), CSG_Point_4D::Divide(), CSG_Point_4D::Get_Length(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_4D::is_Equal(), CSG_Point_4D::Multiply(), CSG_Point_4D::operator+(), CSG_Point_4D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), and CSG_Point_4D::Subtract().

◆ x

double SSG_Point_4D::x

Definition at line 358 of file geo_tools.h.

Referenced by CSG_Point_4D::Add(), CSG_Point_4D::Assign(), CSG_Point_4D::CSG_Point_4D(), CSG_Point_4D::Divide(), CSG_Point_4D::Get_Length(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_4D::is_Equal(), CSG_Point_4D::Multiply(), CSG_Point_4D::operator+(), CSG_Point_4D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), and CSG_Point_4D::Subtract().

◆ y

double SSG_Point_4D::y

Definition at line 358 of file geo_tools.h.

Referenced by CSG_Point_4D::Add(), CSG_Point_4D::Assign(), CSG_Point_4D::CSG_Point_4D(), CSG_Point_4D::Divide(), CSG_Point_4D::Get_Length(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_4D::is_Equal(), CSG_Point_4D::Multiply(), CSG_Point_4D::operator+(), CSG_Point_4D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), and CSG_Point_4D::Subtract().

◆ z

double SSG_Point_4D::z

Definition at line 358 of file geo_tools.h.

Referenced by CSG_Point_4D::Add(), CSG_Point_4D::Assign(), CSG_Point_4D::CSG_Point_4D(), CSG_Point_4D::Divide(), CSG_Point_4D::Get_Length(), CSG_Shape_Part::Get_Point_ZM(), CSG_Shape::Get_Point_ZM(), CSG_Shape_Part::Ins_Point(), CSG_Shape_Points::Ins_Point(), CSG_Point_4D::Multiply(), CSG_Point_4D::operator+(), CSG_Point_4D::operator-(), CSG_Shape_Part::Set_Point(), CSG_Shape_Point::Set_Point(), CSG_Shape_Points::Set_Point(), and CSG_Point_4D::Subtract().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Point_4D Member List

This is the complete list of members for SSG_Point_4D, including all inherited members.

m | SSG_Point_4D
x | SSG_Point_4D
y | SSG_Point_4D
z | SSG_Point_4D
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Point_Int Struct Reference

Public Attributes | List of all members
SSG_Point_Int Struct Reference

#include <geo_tools.h>

Public Attributes

int | x
int | y

Detailed Description

Definition at line 417 of file geo_tools.h.

Member Data Documentation

◆ x

int SSG_Point_Int::x

Definition at line 419 of file geo_tools.h.

Referenced by CSG_Points_Int::Add(), CSG_Rect_Int::Contains(), CSG_Rect_Int::Get_BottomRight(), CSG_Rect_Int::Get_TopLeft(), CSG_Rect_Int::Move(), CSG_Rect_Int::operator+=(), CSG_Grid_Stack::Pop(), CSG_Grid_Stack::Push(), CSG_Rect_Int::Set_BottomLeft(), CSG_Rect_Int::Set_TopRight(), and CSG_Rect_Int::Union().

◆ y

int SSG_Point_Int::y

Definition at line 419 of file geo_tools.h.

Referenced by CSG_Points_Int::Add(), CSG_Rect_Int::Contains(), CSG_Rect_Int::Get_BottomRight(), CSG_Rect_Int::Get_TopLeft(), CSG_Rect_Int::Move(), CSG_Rect_Int::operator+=(), CSG_Rect_Int::operator-=(), CSG_Grid_Stack::Pop(), CSG_Grid_Stack::Push(), CSG_Rect_Int::Set_BottomLeft(), CSG_Rect_Int::Set_TopRight(), and CSG_Rect_Int::Union().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Point_Int Member List

This is the complete list of members for SSG_Point_Int, including all inherited members.

x | SSG_Point_Int
y | SSG_Point_Int
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Rect Struct Reference

Public Attributes | List of all members
SSG_Rect Struct Reference

#include <geo_tools.h>

Inheritance diagram for SSG_Rect:
CSG_Rect

Public Attributes

double | xMin
double | yMin
double | xMax
double | yMax

Detailed Description

Definition at line 463 of file geo_tools.h.

Member Data Documentation

◆ xMax

double SSG_Rect::xMax

Definition at line 465 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Rect::Assign(), CSG_Rect::Contains(), CSG_Grid_System::Create(), CSG_Rect::CSG_Rect(), CSG_PointCloud::Get_Selection_Extent(), CSG_Rect::Inflate(), CSG_Rect::Intersect(), CSG_Rect::Intersects(), CSG_Rect::is_Equal(), CSG_Rect::Move(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_PointCloud::Select(), CSG_Rect::Set_BottomLeft(), CSG_Parameters_Grid_Target::Set_User_Defined(), SG_Get_Crossing_InRegion(), SG_Get_Projected(), and CSG_Rect::Union().

◆ xMin

double SSG_Rect::xMin

Definition at line 465 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Rect::Assign(), CSG_Rect::Contains(), CSG_Grid_System::Create(), CSG_Rect::CSG_Rect(), CSG_PointCloud::Get_Selection_Extent(), CSG_Rect::Inflate(), CSG_Rect::Intersect(), CSG_Rect::Intersects(), CSG_TIN_Triangle::is_Containing(), CSG_Grid_System::is_Equal(), CSG_Rect::is_Equal(), CSG_Rect::Move(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), CSG_PointCloud::Select(), CSG_Rect::Set_TopRight(), CSG_Parameters_Grid_Target::Set_User_Defined(), SG_Get_Crossing_InRegion(), SG_Get_Projected(), and CSG_Rect::Union().

◆ yMax

double SSG_Rect::yMax

Definition at line 465 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Rect::Assign(), CSG_Rect::Contains(), CSG_Grid_System::Create(), CSG_Rect::CSG_Rect(), CSG_PointCloud::Get_Selection_Extent(), CSG_Rect::Inflate(), CSG_Rect::Intersect(), CSG_Rect::Intersects(), CSG_Rect::is_Equal(), CSG_Rect::Move(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_PointCloud::Select(), CSG_Rect::Set_BottomLeft(), CSG_Parameters_Grid_Target::Set_User_Defined(), SG_Get_Crossing_InRegion(), SG_Get_Projected(), and CSG_Rect::Union().

◆ yMin

double SSG_Rect::yMin

Definition at line 465 of file geo_tools.h.

Referenced by CSG_Parameter_Grid_System::_Serialize(), CSG_Rect::Assign(), CSG_Rect::Contains(), CSG_Grid_System::Create(), CSG_Rect::CSG_Rect(), CSG_PointCloud::Get_Selection_Extent(), CSG_Rect::Inflate(), CSG_Rect::Intersect(), CSG_Rect::Intersects(), CSG_Grid_System::is_Equal(), CSG_Rect::is_Equal(), CSG_Rect::Move(), CSG_Shape_Point::On_Intersects(), CSG_Shape_Points::On_Intersects(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), CSG_PointCloud::Select(), CSG_Rect::Set_TopRight(), CSG_Parameters_Grid_Target::Set_User_Defined(), SG_Get_Crossing_InRegion(), SG_Get_Projected(), and CSG_Rect::Union().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Rect Member List

This is the complete list of members for SSG_Rect, including all inherited members.

xMax | SSG_Rect
xMin | SSG_Rect
yMax | SSG_Rect
yMin | SSG_Rect
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: SSG_Rect_Int Struct Reference

Public Attributes | List of all members
SSG_Rect_Int Struct Reference

#include <geo_tools.h>

Inheritance diagram for SSG_Rect_Int:
CSG_Rect_Int

Public Attributes

int | xMin
int | yMin
int | xMax
int | yMax

Detailed Description

Definition at line 575 of file geo_tools.h.

Member Data Documentation

◆ xMax

int SSG_Rect_Int::xMax

Definition at line 577 of file geo_tools.h.

Referenced by CSG_Rect_Int::Assign(), CSG_Rect_Int::Contains(), CSG_Rect_Int::CSG_Rect_Int(), CSG_Rect_Int::Get_BottomRight(), CSG_Rect_Int::Inflate(), CSG_Rect_Int::Intersect(), CSG_Rect_Int::Intersects(), CSG_Rect_Int::is_Equal(), CSG_Rect_Int::Move(), CSG_Rect_Int::Set_BottomLeft(), and CSG_Rect_Int::Union().

◆ xMin

int SSG_Rect_Int::xMin

Definition at line 577 of file geo_tools.h.

Referenced by CSG_Rect_Int::Assign(), CSG_Rect_Int::Contains(), CSG_Rect_Int::CSG_Rect_Int(), CSG_Rect_Int::Get_TopLeft(), CSG_Rect_Int::Inflate(), CSG_Rect_Int::Intersect(), CSG_Rect_Int::Intersects(), CSG_Rect_Int::is_Equal(), CSG_Rect_Int::Move(), CSG_Rect_Int::Set_TopRight(), and CSG_Rect_Int::Union().

◆ yMax

int SSG_Rect_Int::yMax

Definition at line 577 of file geo_tools.h.

Referenced by CSG_Rect_Int::Assign(), CSG_Rect_Int::Contains(), CSG_Rect_Int::CSG_Rect_Int(), CSG_Rect_Int::Get_TopLeft(), CSG_Rect_Int::Inflate(), CSG_Rect_Int::Intersect(), CSG_Rect_Int::Intersects(), CSG_Rect_Int::is_Equal(), CSG_Rect_Int::Move(), CSG_Rect_Int::Set_BottomLeft(), and CSG_Rect_Int::Union().

◆ yMin

int SSG_Rect_Int::yMin

Definition at line 577 of file geo_tools.h.

Referenced by CSG_Rect_Int::Assign(), CSG_Rect_Int::Contains(), CSG_Rect_Int::CSG_Rect_Int(), CSG_Rect_Int::Get_BottomRight(), CSG_Rect_Int::Get_Diameter(), CSG_Rect_Int::Inflate(), CSG_Rect_Int::Intersect(), CSG_Rect_Int::Intersects(), CSG_Rect_Int::is_Equal(), CSG_Rect_Int::Move(), CSG_Rect_Int::Set_TopRight(), and CSG_Rect_Int::Union().

The documentation for this struct was generated from the following file:
  • geo_tools.h
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Member List

SSG_Rect_Int Member List

This is the complete list of members for SSG_Rect_Int, including all inherited members.

xMax | SSG_Rect_Int
xMin | SSG_Rect_Int
yMax | SSG_Rect_Int
yMin | SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12345]
C CSG_Array
C CSG_Array_Int
C CSG_Array_Pointer
C CSG_Array_sLong
C CSG_Buffer
C CSG_Bytes
C CSG_Bytes_Array
C CSG_Category_Statistics
C CSG_Classifier_Supervised
C CSG_Cluster_Analysis
C CSG_Colors
►C CSG_Data_Collection
C CSG_Grid_Collection
C CSG_Data_Manager
►C CSG_Data_Object
C CSG_Grid
C CSG_Grids
►C CSG_Table
►C CSG_Shapes
C CSG_PointCloud
C CSG_TIN
C CSG_DateTime
C CSG_Distance_Weighting
►C CSG_File
C CSG_File_Zip
C CSG_Formula
C CSG_Grid_Cell_Addressor
C CSG_Grid_File_Info
C CSG_Grid_OGIS_Converter
C CSG_Grid_Pyramid
C CSG_Grid_Radius
C CSG_Grid_System
C CSG_Histogram
C CSG_HTTP
C CSG_Index
C CSG_Index::CSG_Index_Compare
►C CSG_KDTree
C CSG_KDTree_2D
C CSG_KDTree_3D
C CSG_Lines
C CSG_Matrix
C CSG_MetaData
C CSG_Natural_Breaks
►C CSG_Parameter
C CSG_Parameter_Bool
►C CSG_Parameter_Choice
C CSG_Parameter_Data_Type
C CSG_Parameter_Choices
C CSG_Parameter_Colors
►C CSG_Parameter_Data_Object
C CSG_Parameter_Data_Object_Output
►C CSG_Parameter_Grid
C CSG_Parameter_Grids
C CSG_Parameter_PointCloud
C CSG_Parameter_Shapes
C CSG_Parameter_Table
C CSG_Parameter_TIN
C CSG_Parameter_Date
C CSG_Parameter_Fixed_Table
C CSG_Parameter_Font
C CSG_Parameter_Grid_System
►C CSG_Parameter_List
C CSG_Parameter_Grid_List
C CSG_Parameter_Grids_List
C CSG_Parameter_PointCloud_List
C CSG_Parameter_Shapes_List
C CSG_Parameter_Table_List
C CSG_Parameter_TIN_List
C CSG_Parameter_Node
C CSG_Parameter_Parameters
C CSG_Parameter_Range
►C CSG_Parameter_String
C CSG_Parameter_File_Name
C CSG_Parameter_Text
C CSG_Parameter_Table_Fields
►C CSG_Parameter_Value
►C CSG_Parameter_Double
C CSG_Parameter_Degree
►C CSG_Parameter_Int
C CSG_Parameter_Color
C CSG_Parameter_Table_Field
C CSG_Parameters
C CSG_Parameters_Grid_Target
►C CSG_Parameters_Point_Search
C CSG_Parameters_Point_Search_KDTree_2D
C CSG_Points
C CSG_Points_3D
C CSG_Points_Int
C CSG_PriorityQueue
C CSG_PriorityQueue::CSG_PriorityQueueItem
C CSG_Projection
C CSG_Projections
C CSG_PRQuadTree
►C CSG_PRQuadTree_Item
►C CSG_PRQuadTree_Leaf
C CSG_PRQuadTree_Leaf_List
►C CSG_PRQuadTree_Node
C CSG_PRQuadTree_Node_Statistics
C CSG_Random
C CSG_Rects
C CSG_Rects_Int
C CSG_Regression
C CSG_Regression_Multiple
C CSG_Regression_Weighted
►C CSG_Shape_Part
C CSG_Shape_Polygon_Part
C CSG_Shapes_OGIS_Converter
C CSG_Simple_Statistics
C CSG_Spline
►C CSG_Stack
C CSG_Grid_Stack
C CSG_String
C CSG_String_Tokenizer
C CSG_Strings
C CSG_Table_DBase
►C CSG_Table_Record
►C CSG_Shape
►C CSG_Shape_Point
►C CSG_Shape_Point_Z
C CSG_Shape_Point_ZM
►C CSG_Shape_Points
C CSG_Shape_Line
C CSG_Shape_Polygon
C CSG_TIN_Node
►C CSG_Table_Value
C CSG_Table_Value_Binary
C CSG_Table_Value_Date
C CSG_Table_Value_Double
C CSG_Table_Value_Int
C CSG_Table_Value_Long
C CSG_Table_Value_String
C CSG_Test_Distribution
C CSG_Thin_Plate_Spline
C CSG_TimeSpan
C CSG_TIN_Edge
C CSG_TIN_Triangle
►C CSG_Tool
C CSG_Tool_Chain
►C CSG_Tool_Grid
C CSG_Tool_Grid_Interactive
C CSG_Tool_Interactive
►C CSG_Tool_Interactive_Base
C CSG_Tool_Grid_Interactive
C CSG_Tool_Interactive
►C CSG_Tool_Library
C CSG_Tool_Chains
C CSG_Tool_Library_Interface
C CSG_Tool_Library_Manager
C CSG_Translator
C CSG_Trend
C CSG_Trend_Polynom
C CSG_UI_Parameter
►C CSG_Unique_Value_Statistics
C CSG_Unique_Number_Statistics
C CSG_Unique_String_Statistics
C CSG_Vector
C CSG_Formula::SSG_Function
►C SSG_Point
C CSG_Point
►C SSG_Point_3D
C CSG_Point_3D
►C SSG_Point_4D
C CSG_Point_4D
C SSG_Point_Int
►C SSG_Rect
C CSG_Rect
►C SSG_Rect_Int
C CSG_Rect_Int
C CSG_TIN::TTIN_Edge
C CSG_TIN::TTIN_Triangle
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- _ -

  • _Add_Edge() : CSG_TIN
  • _Add_Edge_Points() : CSG_Shape_Polygon_Part
  • _Add_Field() : CSG_Table_Record
  • _Add_Part() : CSG_Shape_Points
  • _Add_Selection() : CSG_Table
  • _Add_Triangle() : CSG_TIN
  • _Alloc_Memory() : CSG_Shape_Part
  • _asDouble() : CSG_Parameter , CSG_Parameter_Choice , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Grid , CSG_Parameter_Int , CSG_Parameter_Table_Field
  • _asInt() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Colors , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Table_Fields
  • _asPointer() : CSG_Parameter , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid_System , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Table_Fields
  • _Assign() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Value
  • _asString() : CSG_Parameter
  • _CircumCircle() : CSG_TIN
  • _Create() : CSG_Spline
  • _Create_Value() : CSG_Table_Record
  • _Del_Field() : CSG_Table_Record
  • _Del_Selection() : CSG_Table
  • _Destroy_Edges() : CSG_TIN
  • _Destroy_Nodes() : CSG_TIN
  • _Destroy_Triangles() : CSG_TIN
  • _Evaluate() : CSG_Simple_Statistics
  • _Get_F() : CSG_Regression_Multiple
  • _Get_Field() : CSG_Table_Record
  • _Get_New_Record() : CSG_Shapes , CSG_Table , CSG_TIN
  • _Get_P() : CSG_Regression_Multiple
  • _Get_Part() : CSG_Shape_Points , CSG_Shape_Polygon
  • _Get_Regression() : CSG_Regression_Multiple
  • _Get_Step_In() : CSG_Regression_Multiple
  • _Get_Step_Out() : CSG_Regression_Multiple
  • _Initialize() : CSG_Regression_Multiple
  • _Invalidate() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • _is_OnEdge() : CSG_Shape_Polygon_Part
  • _On_Construction() : CSG_KDTree , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • _Serialize() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Range , CSG_Parameter_String , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields
  • _Set_Selection() : CSG_Table
  • _Set_Step_Info() : CSG_Regression_Multiple
  • _Set_String() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_Fixed_Table , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Range , CSG_Parameter_Table_Field
  • _Set_Value() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Object_Output , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_PointCloud , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_TIN
  • _Stats_Invalidate() : CSG_Table
  • _Stats_Update() : CSG_PointCloud , CSG_Table
  • _Triangulate() : CSG_TIN
  • _Update_Area() : CSG_Shape_Polygon_Part
  • _Update_Extent() : CSG_Shape_Part , CSG_Shape_Points
  • _X_Transform() : CSG_Regression
  • _Y_Transform() : CSG_Regression
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- a -

  • Abs() : CSG_TimeSpan
  • Add() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Bytes , CSG_Bytes_Array , CSG_Data_Collection , CSG_Data_Manager , CSG_DateTime , CSG_Grid , CSG_Grid_Collection , CSG_Grids , CSG_Lines , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_PriorityQueue , CSG_Projections , CSG_Rects , CSG_Rects_Int , CSG_Simple_Statistics , CSG_Spline , CSG_Strings , CSG_TimeSpan , CSG_Vector
  • Add_Attribute() : CSG_Grids
  • Add_Bool() : CSG_Parameters
  • Add_Child() : CSG_MetaData
  • Add_Children() : CSG_MetaData
  • Add_Choice() : CSG_Parameters
  • Add_Choices() : CSG_Parameters
  • Add_Class() : CSG_Classifier_Supervised
  • Add_Col() : CSG_Matrix
  • Add_Color() : CSG_Parameters
  • Add_Colors() : CSG_Parameters
  • Add_Cols() : CSG_Matrix
  • Add_Data() : CSG_Trend , CSG_Trend_Polynom
  • Add_Data_Type() : CSG_Parameters
  • Add_Date() : CSG_Parameters
  • Add_Default() : CSG_Parameter_Grid , CSG_Parameter_Table_Field
  • Add_Degree() : CSG_Parameters
  • Add_Directory() : CSG_File_Zip , CSG_Tool_Library_Manager
  • Add_Double() : CSG_Parameters
  • Add_Element() : CSG_Cluster_Analysis
  • Add_Entry() : CSG_Index
  • Add_Field() : CSG_PointCloud , CSG_Table
  • Add_File() : CSG_File_Zip
  • Add_FilePath() : CSG_Parameters
  • Add_FixedTable() : CSG_Parameters
  • Add_Font() : CSG_Parameters
  • Add_Function() : CSG_Formula
  • Add_Grid() : CSG_Data_Manager , CSG_Grids , CSG_Parameters , CSG_Parameters_Grid_Target
  • Add_Grid_List() : CSG_Parameters
  • Add_Grid_or_Const() : CSG_Parameters
  • Add_Grid_Output() : CSG_Parameters
  • Add_Grid_System() : CSG_Parameters
  • Add_Grids() : CSG_Data_Manager , CSG_Parameters , CSG_Parameters_Grid_Target
  • Add_Grids_List() : CSG_Parameters
  • Add_Grids_Output() : CSG_Parameters
  • Add_Info_Range() : CSG_Parameters
  • Add_Info_String() : CSG_Parameters
  • Add_Info_Value() : CSG_Parameters
  • Add_Int() : CSG_Parameters
  • Add_Item() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Grid_List , CSG_Parameter_Grids_List , CSG_Parameter_List
  • Add_Library() : CSG_Tool_Library_Manager
  • Add_Node() : CSG_Parameters , CSG_TIN
  • Add_Parameter() : CSG_Parameters
  • Add_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor , CSG_Parameters , CSG_Tool
  • Add_Part() : CSG_Shape , CSG_Shape_Points
  • Add_Point() : CSG_PointCloud , CSG_PRQuadTree , CSG_PRQuadTree_Node , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Add_PointCloud() : CSG_Data_Manager , CSG_Parameters
  • Add_PointCloud_List() : CSG_Parameters
  • Add_PointCloud_Output() : CSG_Parameters
  • Add_Property() : CSG_MetaData
  • Add_Range() : CSG_Parameters
  • Add_Record() : CSG_PointCloud , CSG_Table , CSG_Table_DBase
  • Add_Reference() : CSG_Parameters , CSG_Tool , CSG_Tool_Library
  • Add_Row() : CSG_Matrix , CSG_Vector
  • Add_Rows() : CSG_Matrix , CSG_Vector
  • Add_Sample() : CSG_Regression_Weighted
  • Add_Shape() : CSG_PointCloud , CSG_Shapes
  • Add_Shapes() : CSG_Data_Manager , CSG_Parameters
  • Add_Shapes_List() : CSG_Parameters
  • Add_Shapes_Output() : CSG_Parameters
  • Add_String() : CSG_Parameters
  • Add_Table() : CSG_Data_Manager , CSG_Parameters
  • Add_Table_Field() : CSG_Parameters
  • Add_Table_Field_or_Const() : CSG_Parameters
  • Add_Table_Fields() : CSG_Parameters
  • Add_Table_List() : CSG_Parameters
  • Add_Table_Output() : CSG_Parameters
  • Add_TIN() : CSG_Data_Manager , CSG_Parameters
  • Add_TIN_List() : CSG_Parameters
  • Add_TIN_Output() : CSG_Parameters
  • Add_Tool() : CSG_Tool_Chains
  • Add_Value() : CSG_Buffer , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Parameters , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table_Record , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Add_Values() : CSG_Regression
  • AfterFirst() : CSG_String
  • AfterLast() : CSG_String
  • Append() : CSG_String
  • Apr : CSG_DateTime
  • asBinary() : CSG_Table_Value , CSG_Table_Value_Binary
  • asBool() : CSG_Parameter
  • asByte() : CSG_Bytes , CSG_Grid , CSG_Grids
  • asChar() : CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • asChoice() : CSG_Parameter
  • asChoices() : CSG_Parameter
  • asColor() : CSG_Parameter
  • asColors() : CSG_Parameter
  • asDataObject() : CSG_Parameter
  • asDataType() : CSG_Parameter
  • asDate() : CSG_Parameter
  • asDouble() : CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_String , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asDWord() : CSG_Bytes
  • asFilePath() : CSG_Parameter
  • asFloat() : CSG_Buffer , CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • asFont() : CSG_Parameter
  • asGrid() : CSG_Data_Object , CSG_Parameter
  • asGrid_System() : CSG_Parameter
  • asGridList() : CSG_Parameter
  • asGrids() : CSG_Data_Object , CSG_Parameter
  • asGridsList() : CSG_Parameter
  • asInt() : CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_String , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asLeaf() : CSG_PRQuadTree_Item
  • asLine() : CSG_Shape
  • asList() : CSG_Parameter
  • asLong() : CSG_Grid , CSG_Grids , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asLongLong() : CSG_String
  • asNode() : CSG_PRQuadTree_Item
  • asParameters() : CSG_Parameter
  • asPoint() : CSG_Shape
  • asPointCloud() : CSG_Data_Object , CSG_Parameter
  • asPointCloudList() : CSG_Parameter
  • asPointer() : CSG_Parameter
  • asPoints() : CSG_Shape
  • asPolygon() : CSG_Shape
  • asRange() : CSG_Parameter
  • asShapes() : CSG_Data_Object , CSG_Parameter
  • asShapesList() : CSG_Parameter
  • asShort() : CSG_Buffer , CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • Assign() : CSG_Array_Int , CSG_Array_sLong , CSG_Bytes , CSG_Colors , CSG_Data_Object , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_PointCloud , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Rects , CSG_Rects_Int , CSG_Shape , CSG_Shape_Part , CSG_Shapes , CSG_Strings , CSG_Table , CSG_Table_Record , CSG_TIN , CSG_Vector
  • Assign_NoData() : CSG_Grid , CSG_Grids
  • Assign_Parameters() : CSG_Parameters
  • Assign_Values() : CSG_Parameters , CSG_Table
  • asString() : CSG_Category_Statistics , CSG_Parameter , CSG_Regression , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asTable() : CSG_Data_Object , CSG_Parameter
  • asTableFields() : CSG_Parameter
  • asTableList() : CSG_Parameter
  • asText() : CSG_MetaData
  • asTIN() : CSG_Data_Manager , CSG_Data_Object , CSG_Parameter , CSG_Parameter_TIN_List
  • asTINList() : CSG_Parameter
  • asValue() : CSG_Parameter
  • asWord() : CSG_Bytes
  • Aug : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- b -

  • b_str() : CSG_String
  • BeforeFirst() : CSG_String
  • BeforeLast() : CSG_String
  • begin() : CSG_Vector
  • Boolean : CSG_UI_Parameter
  • bVarying : CSG_Formula::SSG_Function
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- c -

  • c_str() : CSG_String
  • Calculate() : CSG_Regression , CSG_Regression_Weighted
  • cbegin() : CSG_Vector
  • cend() : CSG_Vector
  • Check() : CSG_Parameter
  • Clear() : CSG_Bytes , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Rects , CSG_Rects_Int , CSG_Stack , CSG_String , CSG_Strings
  • Close() : CSG_File , CSG_File_Zip , CSG_Table_DBase
  • Clr_Data() : CSG_Trend , CSG_Trend_Polynom
  • Clr_Selection() : CSG_Parameter_Choices
  • Cmp() : CSG_String
  • Cmp_Content() : CSG_MetaData
  • Cmp_Identifier() : CSG_Parameter , CSG_Parameters
  • Cmp_Name() : CSG_MetaData
  • Cmp_Property() : CSG_MetaData
  • CmpNoCase() : CSG_String
  • Compare()
: CSG_Index::CSG_Index_Compare
, CSG_PriorityQueue::CSG_PriorityQueueItem
  • const_iterator : CSG_Vector
  • Contains() : CSG_PRQuadTree_Item , CSG_Rect , CSG_Rect_Int , CSG_Shape_Polygon , CSG_Shape_Polygon_Part , CSG_String
  • Count() : CSG_Data_Collection
  • Create() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Classifier_Supervised , CSG_Cluster_Analysis , CSG_Colors , CSG_Grid , CSG_Grid_File_Info , CSG_Grid_Pyramid , CSG_Grid_Radius , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_HTTP , CSG_Index , CSG_KDTree_2D , CSG_KDTree_3D , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Natural_Breaks , CSG_Parameters , CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_PointCloud , CSG_PriorityQueue , CSG_Projection , CSG_Projections , CSG_PRQuadTree , CSG_Shapes , CSG_Simple_Statistics , CSG_Spline , CSG_String , CSG_Strings , CSG_Table , CSG_Thin_Plate_Spline , CSG_TIN , CSG_Tool_Chain , CSG_Tool_Library_Interface , CSG_Translator , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics , CSG_Vector
  • Create_Manager() : CSG_Tool
  • Create_Parameters() : CSG_Distance_Weighting
  • Create_Python_ToolBox() : CSG_Tool_Library_Manager
  • Create_Tool() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • CSG_Array() : CSG_Array
  • CSG_Array_Int() : CSG_Array_Int
  • CSG_Array_Pointer() : CSG_Array_Pointer
  • CSG_Array_sLong() : CSG_Array_sLong
  • CSG_Buffer() : CSG_Buffer
  • CSG_Bytes() : CSG_Bytes
  • CSG_Bytes_Array() : CSG_Bytes_Array
  • CSG_Category_Statistics() : CSG_Category_Statistics
  • CSG_Classifier_Supervised() : CSG_Classifier_Supervised
  • CSG_Cluster_Analysis() : CSG_Cluster_Analysis
  • CSG_Colors() : CSG_Colors
  • CSG_Data_Collection() : CSG_Data_Collection
  • CSG_Data_Manager : CSG_Data_Collection , CSG_Data_Manager , CSG_Grid_Collection
  • CSG_Data_Object() : CSG_Data_Object
  • CSG_DateTime() : CSG_DateTime , CSG_TimeSpan
  • CSG_Distance_Weighting() : CSG_Distance_Weighting
  • CSG_File() : CSG_File
  • CSG_File_Zip() : CSG_File_Zip
  • CSG_Formula() : CSG_Formula
  • CSG_Grid() : CSG_Grid
  • CSG_Grid_Cell_Addressor() : CSG_Grid_Cell_Addressor
  • CSG_Grid_Collection() : CSG_Grid_Collection
  • CSG_Grid_File_Info() : CSG_Grid_File_Info
  • CSG_Grid_OGIS_Converter() : CSG_Grid_OGIS_Converter
  • CSG_Grid_Pyramid() : CSG_Grid_Pyramid
  • CSG_Grid_Radius() : CSG_Grid_Radius
  • CSG_Grid_Stack() : CSG_Grid_Stack
  • CSG_Grid_System() : CSG_Grid_System
  • CSG_Grids() : CSG_Grids
  • CSG_Histogram() : CSG_Histogram
  • CSG_HTTP() : CSG_HTTP , CSG_MetaData
  • CSG_Index() : CSG_Index
  • CSG_Index_Compare() : CSG_Index::CSG_Index_Compare
  • CSG_KDTree() : CSG_KDTree
  • CSG_KDTree_2D() : CSG_KDTree_2D
  • CSG_KDTree_3D() : CSG_KDTree_3D
  • CSG_Lines() : CSG_Lines
  • CSG_Matrix() : CSG_Matrix
  • CSG_MetaData() : CSG_MetaData
  • CSG_Natural_Breaks() : CSG_Natural_Breaks
  • CSG_Parameter() : CSG_Parameter , CSG_Parameters
  • CSG_Parameter_Bool() : CSG_Parameter_Bool
  • CSG_Parameter_Choice() : CSG_Parameter_Choice
  • CSG_Parameter_Choices() : CSG_Parameter_Choices
  • CSG_Parameter_Color() : CSG_Parameter_Color
  • CSG_Parameter_Colors() : CSG_Parameter_Colors
  • CSG_Parameter_Data_Object() : CSG_Parameter_Data_Object
  • CSG_Parameter_Data_Object_Output() : CSG_Parameter_Data_Object_Output
  • CSG_Parameter_Data_Type() : CSG_Parameter_Data_Type
  • CSG_Parameter_Date() : CSG_Parameter_Date
  • CSG_Parameter_Degree() : CSG_Parameter_Degree
  • CSG_Parameter_Double() : CSG_Parameter_Double
  • CSG_Parameter_File_Name() : CSG_Parameter_File_Name
  • CSG_Parameter_Fixed_Table() : CSG_Parameter_Fixed_Table
  • CSG_Parameter_Font() : CSG_Parameter_Font
  • CSG_Parameter_Grid() : CSG_Parameter_Grid
  • CSG_Parameter_Grid_List() : CSG_Parameter_Grid_List
  • CSG_Parameter_Grid_System() : CSG_Parameter_Grid_System
  • CSG_Parameter_Grids() : CSG_Parameter_Grids
  • CSG_Parameter_Grids_List() : CSG_Parameter_Grids_List
  • CSG_Parameter_Int() : CSG_Parameter_Int
  • CSG_Parameter_List() : CSG_Parameter_List
  • CSG_Parameter_Node() : CSG_Parameter_Node
  • CSG_Parameter_Parameters() : CSG_Parameter_Parameters
  • CSG_Parameter_PointCloud() : CSG_Parameter_PointCloud
  • CSG_Parameter_PointCloud_List() : CSG_Parameter_PointCloud_List
  • CSG_Parameter_Range() : CSG_Parameter_Range
  • CSG_Parameter_Shapes() : CSG_Parameter_Shapes
  • CSG_Parameter_Shapes_List() : CSG_Parameter_Shapes_List
  • CSG_Parameter_String() : CSG_Parameter_String
  • CSG_Parameter_Table() : CSG_Parameter_Table
  • CSG_Parameter_Table_Field() : CSG_Parameter_Table_Field
  • CSG_Parameter_Table_Fields() : CSG_Parameter_Table_Fields
  • CSG_Parameter_Table_List() : CSG_Parameter_Table_List
  • CSG_Parameter_Text() : CSG_Parameter_Text
  • CSG_Parameter_TIN() : CSG_Parameter_TIN
  • CSG_Parameter_TIN_List() : CSG_Parameter_TIN_List
  • CSG_Parameter_Value() : CSG_Parameter_Value
  • CSG_Parameters : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Object_Output , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grid_System , CSG_Parameter_Grids , CSG_Parameter_Grids_List , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Node , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_PointCloud_List , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Parameter_Text , CSG_Parameter_TIN , CSG_Parameter_TIN_List , CSG_Parameter_Value , CSG_Parameters
  • CSG_Parameters_Grid_Target() : CSG_Parameters_Grid_Target
  • CSG_Parameters_Point_Search() : CSG_Parameters_Point_Search
  • CSG_Parameters_Point_Search_KDTree_2D() : CSG_Parameters_Point_Search_KDTree_2D
  • CSG_Point() : CSG_Point
  • CSG_Point_3D() : CSG_Point_3D
  • CSG_Point_4D() : CSG_Point_4D
  • CSG_PointCloud() : CSG_PointCloud , CSG_Table_Record
  • CSG_Points() : CSG_Points
  • CSG_Points_3D() : CSG_Points_3D
  • CSG_Points_Int() : CSG_Points_Int
  • CSG_PriorityQueue() : CSG_PriorityQueue
  • CSG_PriorityQueueItem() : CSG_PriorityQueue::CSG_PriorityQueueItem
  • CSG_Projection() : CSG_Projection , CSG_Projections
  • CSG_Projections : CSG_Projection , CSG_Projections
  • CSG_PRQuadTree() : CSG_PRQuadTree , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • CSG_PRQuadTree_Item() : CSG_PRQuadTree_Item
  • CSG_PRQuadTree_Leaf() : CSG_PRQuadTree_Leaf
  • CSG_PRQuadTree_Leaf_List() : CSG_PRQuadTree_Leaf_List
  • CSG_PRQuadTree_Node : CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Leaf_List , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • CSG_PRQuadTree_Node_Statistics() : CSG_PRQuadTree_Node_Statistics
  • CSG_Random() : CSG_Random
  • CSG_Rect() : CSG_Rect
  • CSG_Rect_Int() : CSG_Rect_Int
  • CSG_Rects() : CSG_Rects
  • CSG_Rects_Int() : CSG_Rects_Int
  • CSG_Regression() : CSG_Regression
  • CSG_Regression_Multiple() : CSG_Regression_Multiple
  • CSG_Regression_Weighted() : CSG_Regression_Weighted
  • CSG_Shape() : CSG_Shape , CSG_Shapes
  • CSG_Shape_Line() : CSG_Shape_Line , CSG_Shape_Part
  • CSG_Shape_Part() : CSG_Shape_Part , CSG_Shape_Points
  • CSG_Shape_Point() : CSG_Shape_Point
  • CSG_Shape_Point_Z() : CSG_Shape_Point_Z
  • CSG_Shape_Point_ZM() : CSG_Shape_Point_ZM
  • CSG_Shape_Points : CSG_Shape_Part , CSG_Shape_Points
  • CSG_Shape_Polygon : CSG_Shape_Part , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • CSG_Shape_Polygon_Part() : CSG_Shape_Polygon_Part
  • CSG_Shapes : CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Point_Z , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shapes
  • CSG_Shapes_OGIS_Converter() : CSG_Shapes_OGIS_Converter
  • CSG_Simple_Statistics() : CSG_Simple_Statistics
  • CSG_Spline() : CSG_Spline
  • CSG_Stack() : CSG_Stack
  • CSG_String() : CSG_String
  • CSG_String_Tokenizer() : CSG_String_Tokenizer
  • CSG_Strings() : CSG_Strings
  • CSG_Table() : CSG_Table , CSG_Table_Record
  • CSG_Table_DBase() : CSG_Table_DBase
  • CSG_Table_Record : CSG_Table , CSG_Table_Record
  • CSG_Table_Value() : CSG_Table_Value
  • CSG_Table_Value_Binary() : CSG_Table_Value_Binary
  • CSG_Table_Value_Date() : CSG_Table_Value_Date
  • CSG_Table_Value_Double() : CSG_Table_Value_Double
  • CSG_Table_Value_Int() : CSG_Table_Value_Int
  • CSG_Table_Value_Long() : CSG_Table_Value_Long
  • CSG_Table_Value_String() : CSG_Table_Value_String
  • CSG_Thin_Plate_Spline() : CSG_Thin_Plate_Spline
  • CSG_TimeSpan() : CSG_TimeSpan
  • CSG_TIN : CSG_Table , CSG_TIN , CSG_TIN_Edge , CSG_TIN_Node , CSG_TIN_Triangle
  • CSG_Tool : CSG_Parameters , CSG_Tool
  • CSG_Tool_Chain : CSG_Tool , CSG_Tool_Chain
  • CSG_Tool_Chains() : CSG_Tool_Chains
  • CSG_Tool_Grid() : CSG_Tool_Grid
  • CSG_Tool_Grid_Interactive() : CSG_Tool_Grid_Interactive , CSG_Tool_Interactive_Base
  • CSG_Tool_Interactive() : CSG_Tool_Interactive , CSG_Tool_Interactive_Base
  • CSG_Tool_Interactive_Base : CSG_Tool , CSG_Tool_Interactive_Base
  • CSG_Tool_Library() : CSG_Tool_Library
  • CSG_Tool_Library_Interface : CSG_Tool , CSG_Tool_Library_Interface
  • CSG_Tool_Library_Manager : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Manager
  • CSG_Translator() : CSG_Translator
  • CSG_Trend() : CSG_Trend
  • CSG_Trend_Polynom() : CSG_Trend_Polynom
  • CSG_UI_Parameter() : CSG_UI_Parameter
  • CSG_Unique_Number_Statistics() : CSG_Unique_Number_Statistics
  • CSG_Unique_String_Statistics() : CSG_Unique_String_Statistics
  • CSG_Unique_Value_Statistics() : CSG_Unique_Value_Statistics
  • CSG_Vector() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- d -

  • DataObject_Add() : CSG_Tool
  • DataObject_Get_Colors() : CSG_Tool
  • DataObject_Get_Parameter() : CSG_Tool
  • DataObject_Get_Parameters() : CSG_Tool
  • DataObject_Set_Colors() : CSG_Tool
  • DataObject_Set_History() : CSG_Tool
  • DataObject_Set_Parameter() : CSG_Tool
  • DataObject_Set_Parameters() : CSG_Tool
  • DataObject_Update() : CSG_Tool
  • DataObject_Update_All() : CSG_Tool
  • DataObjects_Check() : CSG_Parameters
  • Day() : CSG_TimeSpan
  • Days() : CSG_TimeSpan
  • Dec : CSG_DateTime
  • Dec_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Deflate() : CSG_Rect , CSG_Rect_Int
  • Del() : CSG_Array_Pointer , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Strings
  • Del_Attribute() : CSG_Grids
  • Del_Child() : CSG_MetaData
  • Del_Children() : CSG_MetaData
  • Del_Col() : CSG_Matrix
  • Del_Cols() : CSG_Matrix
  • Del_Entry() : CSG_Array , CSG_Index
  • Del_Field() : CSG_PointCloud , CSG_Table
  • Del_Grid() : CSG_Grids
  • Del_Grids() : CSG_Grids
  • Del_Index() : CSG_Table
  • Del_Item() : CSG_Parameter_Grid_List , CSG_Parameter_List
  • Del_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Grid_List , CSG_Parameter_List
  • Del_Library() : CSG_Tool_Library_Manager
  • Del_Node() : CSG_TIN
  • Del_Parameter() : CSG_Parameters
  • Del_Parameters() : CSG_Parameters
  • Del_Part() : CSG_Shape , CSG_Shape_Points
  • Del_Parts() : CSG_Shape , CSG_Shape_Points
  • Del_Point() : CSG_PointCloud , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points
  • Del_Points() : CSG_PointCloud
  • Del_Property() : CSG_MetaData
  • Del_Record() : CSG_PointCloud , CSG_Table
  • Del_Records() : CSG_PointCloud , CSG_Table
  • Del_References() : CSG_Parameters , CSG_Tool_Library
  • Del_Row() : CSG_Matrix , CSG_Vector
  • Del_Rows() : CSG_Matrix , CSG_Vector
  • Del_Selection() : CSG_PointCloud , CSG_Table
  • Del_Shape() : CSG_PointCloud , CSG_Shapes
  • Del_Shapes() : CSG_PointCloud , CSG_Shapes
  • Delete() : CSG_Data_Collection , CSG_Data_Manager , CSG_Data_Object
  • Delete_All() : CSG_Data_Collection , CSG_Data_Manager
  • Delete_Manager() : CSG_Tool
  • Delete_Tool() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • Delete_Tools() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface
  • Delete_Unsaved() : CSG_Data_Collection , CSG_Data_Manager
  • DeNormalise() : CSG_Grid
  • DeStandardise() : CSG_Grid
  • Destroy() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Bytes_Array , CSG_Category_Statistics , CSG_Classifier_Supervised , CSG_Cluster_Analysis , CSG_Colors , CSG_Data_Object , CSG_Formula , CSG_Grid , CSG_Grid_Cell_Addressor , CSG_Grid_Pyramid , CSG_Grid_Radius , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_HTTP , CSG_Index , CSG_KDTree , CSG_KDTree_2D , CSG_KDTree_3D , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_PointCloud , CSG_PriorityQueue , CSG_Projection , CSG_Projections , CSG_PRQuadTree , CSG_Regression , CSG_Regression_Multiple , CSG_Regression_Weighted , CSG_Shape , CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes , CSG_Spline , CSG_Stack , CSG_Strings , CSG_Table , CSG_Thin_Plate_Spline , CSG_TIN , CSG_Tool , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager , CSG_Translator , CSG_Trend_Polynom , CSG_Vector
  • Divide() : CSG_Grid , CSG_Grids , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • Dlg_Parameters() : CSG_Tool
  • do_Sync_Projections() : CSG_Tool , CSG_Tool_Chain
  • Do_Use_All() : CSG_Parameters_Point_Search
  • do_UseInCMD() : CSG_Parameter
  • do_UseInGUI() : CSG_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- e -

  • Enable_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • end() : CSG_Vector
  • EPSG_to_Proj4() : CSG_Projections
  • EPSG_to_WKT() : CSG_Projections
  • Error_Fmt() : CSG_Tool
  • Error_Set() : CSG_Tool
  • Evaluate() : CSG_Simple_Statistics
  • Execute() : CSG_Cluster_Analysis , CSG_Tool
  • Execute_Finish() : CSG_Tool_Interactive_Base
  • Execute_Keyboard() : CSG_Tool_Interactive_Base
  • Execute_Position() : CSG_Tool_Interactive_Base
  • Exists() : CSG_Data_Collection , CSG_Data_Manager , CSG_Grid_Collection
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- f -

  • Feb : CSG_DateTime
  • Finalize() : CSG_Parameters_Point_Search_KDTree_2D
  • Find() : CSG_Data_Manager , CSG_String
  • Find_Field() : CSG_Table
  • Find_Record() : CSG_Table
  • Fit_to_Grid_System() : CSG_Grid_System
  • Fit_xto_Grid_System() : CSG_Grid_System
  • Fit_yto_Grid_System() : CSG_Grid_System
  • Flip() : CSG_Grid
  • Flip_Values() : CSG_Vector
  • Flush_Record() : CSG_Table_DBase
  • Fmt_Content() : CSG_MetaData
  • Fmt_Name() : CSG_Data_Object
  • Format() : CSG_DateTime , CSG_String , CSG_TimeSpan
  • Format_Date() : CSG_DateTime
  • Format_ISOCombined() : CSG_DateTime
  • Format_ISODate() : CSG_DateTime
  • Format_ISOTime() : CSG_DateTime
  • Format_Time() : CSG_DateTime
  • Fri : CSG_DateTime
  • from_JSON() : CSG_MetaData
  • from_ShapeType() : CSG_Shapes_OGIS_Converter
  • from_String() : CSG_Matrix , CSG_Vector
  • from_Text() : CSG_Colors
  • From_UTC() : CSG_DateTime
  • from_UTF8() : CSG_String
  • from_WKBinary() : CSG_Grid_OGIS_Converter , CSG_Shapes_OGIS_Converter
  • from_WKT() : CSG_MetaData
  • from_WKText() : CSG_Shapes_OGIS_Converter
  • from_XML() : CSG_MetaData
  • fromHexString() : CSG_Bytes
  • Function : CSG_Formula::SSG_Function
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- g -

  • Get() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Data_Collection
  • Get_Angle() : CSG_Vector
  • Get_Area() : CSG_Rect , CSG_Rect_Int , CSG_Shape_Polygon , CSG_Shape_Polygon_Part , CSG_TIN_Triangle
  • Get_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Get_Attribute() : CSG_PointCloud
  • Get_Attribute_Count() : CSG_PointCloud
  • Get_Attribute_Name() : CSG_PointCloud
  • Get_Attribute_Type() : CSG_PointCloud
  • Get_Attributes() : CSG_Grids
  • Get_Attributes_Ptr() : CSG_Grids
  • Get_Author() : CSG_Tool , CSG_Tool_Library
  • Get_Authority() : CSG_Projection
  • Get_Authority_ID() : CSG_Projection
  • Get_BandWidth() : CSG_Distance_Weighting
  • Get_Binary() : CSG_Table_Value_Binary
  • Get_Blue() : CSG_Colors
  • Get_BottomRight() : CSG_Rect , CSG_Rect_Int
  • Get_Break() : CSG_Histogram , CSG_Natural_Breaks
  • Get_Brightness() : CSG_Colors
  • Get_Byte() : CSG_Bytes
  • Get_Bytes() : CSG_Bytes , CSG_Bytes_Array
  • Get_Category() : CSG_Category_Statistics , CSG_Tool_Library
  • Get_Category_Type() : CSG_Category_Statistics
  • Get_Cellarea() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_Cellsize() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_Center() : CSG_Histogram , CSG_Rect
  • Get_Centroid() : CSG_Cluster_Analysis , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Char() : CSG_String
  • Get_Child() : CSG_MetaData , CSG_Parameter , CSG_PRQuadTree_Node
  • Get_Children_Count() : CSG_MetaData , CSG_Parameter
  • Get_ChiSquare() : CSG_Trend
  • Get_Choices() : CSG_Parameter_Table_Field
  • Get_CircumCircle() : CSG_TIN_Triangle
  • Get_CircumCircle_Point() : CSG_TIN_Triangle
  • Get_CircumCircle_Radius() : CSG_TIN_Triangle
  • Get_Class() : CSG_Classifier_Supervised , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Class_Count() : CSG_Classifier_Supervised , CSG_Histogram
  • Get_Class_ID() : CSG_Classifier_Supervised
  • Get_Class_Index() : CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Class_Maximum() : CSG_Classifier_Supervised
  • Get_Class_Mean() : CSG_Classifier_Supervised
  • Get_Class_Minimum() : CSG_Classifier_Supervised
  • Get_Cluster() : CSG_Cluster_Analysis
  • Get_Coefficient() : CSG_Regression , CSG_Trend_Polynom
  • Get_Col() : CSG_Matrix
  • Get_Color() : CSG_Colors
  • Get_Constant() : CSG_Regression
  • Get_Content() : CSG_MetaData
  • Get_Count() : CSG_Bytes , CSG_Bytes_Array , CSG_Category_Statistics , CSG_Colors , CSG_Grid_Cell_Addressor , CSG_Grid_Pyramid , CSG_Index , CSG_Lines , CSG_Natural_Breaks , CSG_Parameter_Choice , CSG_Parameter_Table_Fields , CSG_Parameters , CSG_Parameters_Point_Search_KDTree_2D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projections , CSG_PRQuadTree_Leaf_List , CSG_Rects , CSG_Rects_Int , CSG_Regression , CSG_Shape_Part , CSG_Simple_Statistics , CSG_Spline , CSG_Strings , CSG_Table , CSG_Table_DBase , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager , CSG_Translator , CSG_Unique_Value_Statistics
  • Get_Cross_Product() : CSG_Vector
  • Get_CrossValidation() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_Cumulative() : CSG_Histogram
  • Get_Current_Day() : CSG_DateTime
  • Get_Current_Month() : CSG_DateTime
  • Get_Current_Year() : CSG_DateTime
  • Get_CV_NRMSE() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_nSamples() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_R2() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_RMSE() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_Data() : CSG_Buffer , CSG_Matrix , CSG_Parameter_Choice , CSG_Vector
  • Get_Data_Count() : CSG_Grid , CSG_Grids , CSG_Trend , CSG_Trend_Polynom
  • Get_Data_Type() : CSG_Parameter_Data_Type
  • Get_Data_X() : CSG_Trend , CSG_Trend_Polynom
  • Get_Data_XMax() : CSG_Trend
  • Get_Data_XMin() : CSG_Trend
  • Get_Data_XStats() : CSG_Trend
  • Get_Data_Y() : CSG_Trend , CSG_Trend_Polynom
  • Get_Data_YMax() : CSG_Trend
  • Get_Data_YMin() : CSG_Trend
  • Get_Data_YStats() : CSG_Trend
  • Get_DataObject_Type() : CSG_Parameter , CSG_Parameter_Data_Object_Output
  • Get_Date() : CSG_Parameter_Date
  • Get_Day() : CSG_DateTime
  • Get_DayOfYear() : CSG_DateTime
  • Get_Days() : CSG_TimeSpan
  • Get_Default() : CSG_Parameter
  • Get_DegFreedom() : CSG_Regression_Multiple
  • Get_Description() : CSG_Data_Object , CSG_Parameter , CSG_Parameters , CSG_Projection , CSG_Tool , CSG_Tool_Library
  • Get_Determinant() : CSG_Matrix
  • Get_Diameter() : CSG_Rect , CSG_Rect_Int
  • Get_Direction() : CSG_Grid_Cell_Addressor
  • Get_Distance() : CSG_Grid_Cell_Addressor , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Drag_Mode() : CSG_Tool_Interactive_Base
  • Get_Duplicates() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Edge() : CSG_TIN
  • Get_Edge_Count() : CSG_TIN
  • Get_Element_Count() : CSG_Histogram
  • Get_Element_Maximum() : CSG_Histogram
  • Get_Elements() : CSG_Histogram
  • Get_Encoding() : CSG_File
  • Get_EnglishMonthName() : CSG_DateTime
  • Get_EnglishWeekDayName() : CSG_DateTime
  • Get_Entry() : CSG_Array
  • Get_EPSG() : CSG_Projection
  • Get_Error() : CSG_Formula , CSG_Trend
  • Get_Execution_Info() : CSG_Tool
  • Get_Extent() : CSG_Data_Object , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_PRQuadTree_Item , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Shapes , CSG_Table , CSG_TIN , CSG_TIN_Triangle
  • Get_F() : CSG_Regression_Multiple
  • Get_F_Inverse() : CSG_Test_Distribution
  • Get_F_Tail() : CSG_Test_Distribution
  • Get_F_Tail_from_R2() : CSG_Test_Distribution
  • Get_Feature_Count() : CSG_Classifier_Supervised
  • Get_Field() : CSG_Table
  • Get_Field_Count() : CSG_Table , CSG_Table_DBase
  • Get_Field_Decimals() : CSG_Table_DBase
  • Get_Field_Length() : CSG_Table
  • Get_Field_Name() : CSG_Table , CSG_Table_DBase
  • Get_Field_Type() : CSG_Table , CSG_Table_DBase
  • Get_Field_Width() : CSG_Table_DBase
  • Get_File() : CSG_File_Zip
  • Get_File_Count() : CSG_File_Zip
  • Get_File_Encoding() : CSG_Table
  • Get_File_Length() : CSG_Table_DBase
  • Get_File_Name() : CSG_Data_Object , CSG_File , CSG_File_Zip , CSG_Tool , CSG_Tool_Chains , CSG_Tool_Library
  • Get_File_Position() : CSG_Table_DBase
  • Get_File_Type() : CSG_Data_Object , CSG_File , CSG_File_Zip
  • Get_FilePaths() : CSG_Parameter_File_Name
  • Get_Filter() : CSG_Parameter_File_Name
  • Get_Formula() : CSG_Formula , CSG_Trend
  • Get_Gaussian() : CSG_Random
  • Get_GCS_WGS84() : CSG_Projections
  • Get_Gini() : CSG_Simple_Statistics
  • Get_Gradient() : CSG_Grid , CSG_TIN_Node , CSG_TIN_Triangle
  • Get_Gradient_NeighborDir() : CSG_Grid
  • Get_Green() : CSG_Colors
  • Get_Grid() : CSG_Grid_Pyramid , CSG_Grids , CSG_Parameter_Grid_List , CSG_Parameters_Grid_Target
  • Get_Grid_Count() : CSG_Grids , CSG_Parameter_Grid_List
  • Get_Grid_Name() : CSG_Grids
  • Get_Grid_Pos() : CSG_Tool_Grid_Interactive
  • Get_Grid_Ptr() : CSG_Grids
  • Get_Grid_System() : CSG_Data_Manager , CSG_Parameters , CSG_Tool
  • Get_Grid_System_Parameter() : CSG_Parameters
  • Get_Grid_to_World() : CSG_Grid_System
  • Get_Grids() : CSG_Parameter_Grids_List , CSG_Parameters_Grid_Target
  • Get_Growth() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Get_Header_Content() : CSG_PointCloud
  • Get_Help_Operators() : CSG_Formula
  • Get_Histogram() : CSG_Grid , CSG_Grids
  • Get_History() : CSG_Data_Object
  • Get_Hour() : CSG_DateTime
  • Get_Hours() : CSG_TimeSpan
  • Get_Icon() : CSG_Tool
  • Get_ID() : CSG_Regression_Multiple , CSG_TIN_Node , CSG_Tool
  • Get_Identifier() : CSG_Parameter , CSG_Parameters
  • Get_IDW_Offset() : CSG_Distance_Weighting
  • Get_IDW_Power() : CSG_Distance_Weighting
  • Get_Index() : CSG_Index , CSG_Parameter_Table_Fields , CSG_Table , CSG_Table_Record
  • Get_Index_Field() : CSG_Table
  • Get_Index_Order() : CSG_Table
  • Get_IndexFromRowCol() : CSG_Grid_System
  • Get_IndexOfMaximum() : CSG_Simple_Statistics
  • Get_IndexOfMinimum() : CSG_Simple_Statistics
  • Get_Info() : CSG_Regression_Multiple , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface
  • Get_Info_Model() : CSG_Regression_Multiple
  • Get_Info_Regression() : CSG_Regression_Multiple
  • Get_Info_Steps() : CSG_Regression_Multiple
  • Get_Interpolated() : CSG_Colors
  • Get_Inverse() : CSG_Matrix
  • Get_Item() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_List , CSG_PriorityQueue
  • Get_Item_Count() : CSG_Parameter_Choices , CSG_Parameter_List
  • Get_Item_Data() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Get_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Get_Iteration() : CSG_Cluster_Analysis
  • Get_JDN() : CSG_DateTime
  • Get_Kurtosis() : CSG_Simple_Statistics
  • Get_Last_Delimiter() : CSG_String_Tokenizer
  • Get_Length() : CSG_Grid_System , CSG_Lines , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Shape_Line , CSG_Tool_Grid , CSG_Vector
  • Get_Library() : CSG_Tool , CSG_Tool_Library_Manager
  • Get_Library_Name() : CSG_Tool_Chain , CSG_Tool_Library
  • Get_Line() : CSG_Lines
  • Get_Log_Difference() : CSG_Regression_Weighted
  • Get_Log_Epsilon() : CSG_Regression_Weighted
  • Get_Log_maxIter() : CSG_Regression_Weighted
  • Get_M() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points
  • Get_Majority() : CSG_Category_Statistics , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics
  • Get_Manager() : CSG_Parameter , CSG_Parameters , CSG_Tool
  • Get_Match_Count() : CSG_KDTree
  • Get_Match_Distance() : CSG_KDTree
  • Get_Match_Index() : CSG_KDTree
  • Get_Match_Shape() : CSG_KDTree
  • Get_Max() : CSG_Grid , CSG_Grids , CSG_Parameter_Range
  • Get_Max_Iterations() : CSG_Trend
  • Get_Max_Lambda() : CSG_Trend
  • Get_Max_Parameter() : CSG_Parameter_Range
  • Get_Max_Points() : CSG_Parameters_Point_Search
  • Get_Max_Samples() : CSG_Data_Object
  • Get_Maximum() : CSG_Grid_Radius , CSG_Parameter_Value , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Mean() : CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Median() : CSG_Simple_Statistics
  • Get_Memory_Size() : CSG_Grid , CSG_Grids
  • Get_Memory_Size_MB() : CSG_Grid
  • Get_Menu() : CSG_Tool_Library
  • Get_MenuPath() : CSG_Tool , CSG_Tool_Chain
  • Get_MetaData() : CSG_Data_Object
  • Get_MetaData_DB() : CSG_Data_Object
  • Get_Millisecond() : CSG_DateTime
  • Get_Milliseconds() : CSG_TimeSpan
  • Get_Min() : CSG_Grid , CSG_Grids , CSG_Parameter_Range
  • Get_Min_Parameter() : CSG_Parameter_Range
  • Get_Min_Points() : CSG_Parameters_Point_Search
  • Get_Minimum() : CSG_Parameter_Value , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Minority() : CSG_Category_Statistics , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics
  • Get_Minute() : CSG_DateTime
  • Get_Minutes() : CSG_TimeSpan
  • Get_MJD() : CSG_DateTime
  • Get_MMax() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shapes
  • Get_MMin() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shapes
  • Get_Model() : CSG_Regression_Multiple
  • Get_Model_Backward() : CSG_Regression_Multiple
  • Get_Model_Forward() : CSG_Regression_Multiple
  • Get_Model_Stepwise() : CSG_Regression_Multiple
  • Get_Month() : CSG_DateTime
  • Get_Month_Choices() : CSG_DateTime
  • Get_MonthName() : CSG_DateTime
  • Get_N() : CSG_Table , CSG_Vector
  • Get_Name() : CSG_Data_Object , CSG_Grid_System , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Projection , CSG_Regression_Multiple , CSG_Tool , CSG_Tool_Library
  • Get_Name_of_Method() : CSG_Classifier_Supervised
  • Get_Name_of_Quality() : CSG_Classifier_Supervised
  • Get_Names_List() : CSG_Projections
  • Get_NCells() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_nClusters() : CSG_Cluster_Analysis
  • Get_nCoefficients() : CSG_Trend_Polynom
  • Get_NCols() : CSG_Matrix
  • Get_Nearest_Leaf() : CSG_PRQuadTree
  • Get_Nearest_Point() : CSG_KDTree_2D , CSG_KDTree_3D , CSG_PRQuadTree
  • Get_Nearest_Points() : CSG_KDTree_2D , CSG_KDTree_3D , CSG_PRQuadTree
  • Get_Nearest_Shape() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Nearest_Value() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Neighbor() : CSG_TIN_Node
  • Get_Neighbor_Count() : CSG_TIN_Node
  • Get_Neighbor_Pos() : CSG_Grid_System
  • Get_nElements() : CSG_Cluster_Analysis
  • Get_Next_Token() : CSG_String_Tokenizer
  • Get_nFeatures() : CSG_Cluster_Analysis
  • Get_nLineBytes() : CSG_Grid , CSG_Grids
  • Get_nMembers() : CSG_Cluster_Analysis
  • Get_NoData_Count() : CSG_Grid , CSG_Grids
  • Get_NoData_Value() : CSG_Data_Object
  • Get_Node() : CSG_TIN , CSG_TIN_Edge , CSG_TIN_Triangle
  • Get_Node_Count() : CSG_TIN
  • Get_Norm_P() : CSG_Test_Distribution
  • Get_Norm_Z() : CSG_Test_Distribution
  • Get_nPoints() : CSG_Grid_Radius
  • Get_nPredictors() : CSG_Regression_Multiple
  • Get_NRows() : CSG_Matrix
  • Get_nSamples() : CSG_Regression_Multiple
  • Get_NumberOfDays() : CSG_DateTime
  • Get_nValueBytes() : CSG_Grid , CSG_Grids
  • Get_nValues_Above() : CSG_Simple_Statistics
  • Get_nValues_Below() : CSG_Simple_Statistics
  • Get_NX() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Matrix , CSG_Tool_Grid
  • Get_NY() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Matrix , CSG_Tool_Grid
  • Get_NZ() : CSG_Grids
  • Get_ObjectType() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • Get_Offset() : CSG_Grid , CSG_Grids
  • Get_Order() : CSG_Trend_Polynom
  • Get_Owner() : CSG_Data_Object , CSG_Parameters , CSG_Shape_Part
  • Get_P() : CSG_Regression , CSG_Regression_Multiple
  • Get_Parameter() : CSG_Parameters , CSG_Regression_Multiple , CSG_Tool
  • Get_Parameter_Changed() : CSG_Tool
  • Get_Parameter_Count() : CSG_Trend
  • Get_Parameters() : CSG_Parameter , CSG_Tool , CSG_Trend
  • Get_Parameters_Count() : CSG_Tool
  • Get_Parent() : CSG_MetaData , CSG_Parameter
  • Get_Part() : CSG_Shape , CSG_Shape_Points
  • Get_Part_Count() : CSG_Shape , CSG_Shape_Point , CSG_Shape_Points
  • Get_Percentile() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Simple_Statistics
  • Get_Percentile_Value() : CSG_Histogram
  • Get_Perimeter() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Point() : CSG_Grid_Radius , CSG_KDTree , CSG_Parameters_Point_Search_KDTree_2D , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_TIN_Node
  • Get_Point_Cloud() : CSG_Data_Manager
  • Get_Point_Count() : CSG_KDTree , CSG_PRQuadTree , CSG_Shape , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Get_Point_Relation() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Point_Value() : CSG_KDTree , CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Point_Z() : CSG_Shape , CSG_Shape_Part
  • Get_Point_ZM() : CSG_Shape , CSG_Shape_Part
  • Get_PointCloud() : CSG_Parameter_PointCloud_List
  • Get_Points() : CSG_Parameters_Point_Search_KDTree_2D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Thin_Plate_Spline
  • Get_Polygon() : CSG_TIN_Node
  • Get_Polygon_Area() : CSG_TIN_Node
  • Get_Polygon_Part() : CSG_Shape_Polygon
  • Get_Position() : CSG_String_Tokenizer , CSG_Tool_Interactive_Base
  • Get_Position_Last() : CSG_Tool_Interactive_Base
  • Get_Precision() : CSG_Grid_System
  • Get_Predefined_Count() : CSG_Colors
  • Get_Predefined_Name() : CSG_Colors
  • Get_Predictor() : CSG_Regression_Multiple
  • Get_Predictor_Count() : CSG_Regression_Weighted
  • Get_Preferred_Type() : CSG_Parameter_Grid
  • Get_Probability_Relative() : CSG_Classifier_Supervised
  • Get_Proj4() : CSG_Projection
  • Get_Projection() : CSG_Data_Object , CSG_Projections , CSG_Tool , CSG_Tool_Interactive_Base
  • Get_Property() : CSG_MetaData
  • Get_Property_Count() : CSG_MetaData
  • Get_Property_Name() : CSG_MetaData
  • Get_Quadrant() : CSG_PRQuadTree_Item
  • Get_Quantile() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Simple_Statistics
  • Get_Quantile_Value() : CSG_Histogram
  • Get_R() : CSG_Regression
  • Get_R2() : CSG_Regression , CSG_Regression_Multiple , CSG_Regression_Weighted , CSG_Trend , CSG_Trend_Polynom
  • Get_R2_Adj() : CSG_Regression , CSG_Regression_Multiple
  • Get_R2_Partial() : CSG_Regression_Multiple
  • Get_R2_Partial_Adj() : CSG_Regression_Multiple
  • Get_Radius() : CSG_Grid_Cell_Addressor , CSG_Parameters_Point_Search
  • Get_Radius_Inner() : CSG_Grid_Cell_Addressor
  • Get_Radius_Outer() : CSG_Grid_Cell_Addressor
  • Get_Range() : CSG_Grid , CSG_Grids , CSG_Parameter_Range , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_RCoeff() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_RConst() : CSG_Regression_Multiple
  • Get_Record() : CSG_PointCloud , CSG_Stack , CSG_Table
  • Get_Record_byIndex() : CSG_Table
  • Get_Record_Pop() : CSG_Stack
  • Get_Record_Push() : CSG_Stack
  • Get_RecordSize() : CSG_Stack
  • Get_Rect() : CSG_Rects , CSG_Rects_Int
  • Get_Red() : CSG_Colors
  • Get_References() : CSG_Parameters , CSG_Tool , CSG_Tool_Library
  • Get_Residual() : CSG_Regression_Multiple
  • Get_Residuals() : CSG_Regression_Multiple
  • Get_Root() : CSG_PRQuadTree
  • Get_Root_Pointer() : CSG_PRQuadTree
  • Get_Row() : CSG_Grid , CSG_Matrix
  • Get_Row_Count() : CSG_Vector
  • Get_RowColFromIndex() : CSG_Grid_System
  • Get_Sample_Count() : CSG_Regression_Weighted
  • Get_Scalar_Product() : CSG_Vector
  • Get_Scaling() : CSG_Grid , CSG_Grids
  • Get_Script() : CSG_Tool , CSG_Tool_Chain
  • Get_Second() : CSG_DateTime
  • Get_Seconds() : CSG_TimeSpan
  • Get_Selected_Count() : CSG_PRQuadTree
  • Get_Selected_Distance() : CSG_PRQuadTree
  • Get_Selected_Leaf() : CSG_PRQuadTree
  • Get_Selected_Point() : CSG_PRQuadTree
  • Get_Selected_Z() : CSG_PRQuadTree
  • Get_Selection() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Shapes , CSG_Table
  • Get_Selection_Count() : CSG_Parameter_Choices , CSG_Table
  • Get_Selection_Data() : CSG_Parameter_Choices
  • Get_Selection_Extent() : CSG_PointCloud , CSG_Shapes
  • Get_Selection_Index() : CSG_Parameter_Choices , CSG_Table
  • Get_Shape() : CSG_PointCloud , CSG_Shapes
  • Get_Shape_byIndex() : CSG_Shapes
  • Get_Shape_Type() : CSG_Parameter_Shapes , CSG_Parameter_Shapes_List
  • Get_Shapes() : CSG_Data_Manager , CSG_Parameter_Shapes_List
  • Get_Shared_Edges() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Shared_Length() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Size() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_PriorityQueue , CSG_PRQuadTree_Item , CSG_Stack , CSG_Strings , CSG_Vector
  • Get_Skewness() : CSG_Simple_Statistics
  • Get_SkewnessPearson() : CSG_Simple_Statistics
  • Get_Sorted() : CSG_Grid , CSG_Grids
  • Get_SP() : CSG_Cluster_Analysis
  • Get_Statistics() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Table
  • Get_StdDev() : CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_StdError() : CSG_Regression , CSG_Regression_Multiple
  • Get_Stream() : CSG_File
  • Get_String() : CSG_Parameters , CSG_String_Tokenizer , CSG_Strings
  • Get_Sum() : CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Sum_Of_Squares() : CSG_Simple_Statistics
  • Get_Summary() : CSG_Data_Manager , CSG_Tool , CSG_Tool_Library , CSG_Tool_Library_Manager
  • Get_System() : CSG_Grid , CSG_Grid_Collection , CSG_Grids , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grids_List , CSG_Parameters_Grid_Target , CSG_Tool_Grid
  • Get_T() : CSG_Regression_Multiple
  • Get_T_Inverse() : CSG_Test_Distribution
  • Get_T_Tail() : CSG_Test_Distribution
  • Get_Table() : CSG_Data_Manager , CSG_MetaData , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Table_Record
  • Get_Text() : CSG_Translator
  • Get_Threshold_Angle() : CSG_Classifier_Supervised
  • Get_Threshold_Distance() : CSG_Classifier_Supervised
  • Get_Threshold_Probability() : CSG_Classifier_Supervised
  • Get_Tokens_Count() : CSG_String_Tokenizer
  • Get_Tolerance() : CSG_Grid_Cell_Addressor
  • Get_Tool() : CSG_Parameters , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • Get_Tool_Count() : CSG_Tool_Library_Manager
  • Get_TopLeft() : CSG_Rect , CSG_Rect_Int
  • Get_Translation() : CSG_Translator
  • Get_Transpose() : CSG_Matrix
  • Get_Trend() : CSG_Trend , CSG_Trend_Polynom
  • Get_Triangle() : CSG_TIN , CSG_TIN_Node
  • Get_Triangle_Count() : CSG_TIN , CSG_TIN_Node
  • Get_Type() : CSG_Grid , CSG_Grids , CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object_Output , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grid_System , CSG_Parameter_Grids , CSG_Parameter_Grids_List , CSG_Parameter_Int , CSG_Parameter_Node , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_PointCloud_List , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Parameter_Text , CSG_Parameter_TIN , CSG_Parameter_TIN_List , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Regression , CSG_Shape , CSG_Shapes , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Tool , CSG_Tool_Chain , CSG_Tool_Chains , CSG_Tool_Grid , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive , CSG_Tool_Library
  • Get_Type_Identifier() : CSG_Parameter , CSG_Projection
  • Get_Type_Name() : CSG_Parameter , CSG_Projection
  • Get_Uniform() : CSG_Random
  • Get_Unit() : CSG_Grid , CSG_Grids , CSG_Projection
  • Get_Unit_Identifier() : CSG_Projection
  • Get_Unit_Name() : CSG_Projection
  • Get_Unit_To_Meter() : CSG_Projection
  • Get_UnitLength() : CSG_Grid_System , CSG_Tool_Grid
  • Get_Unity() : CSG_Vector
  • Get_Update_Flag() : CSG_Data_Object
  • Get_Used_Variables() : CSG_Formula
  • Get_uSize() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Vector
  • Get_UTM_WGS84() : CSG_Projections
  • Get_Value() : CSG_DateTime , CSG_Formula , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_PointCloud , CSG_PRQuadTree_Leaf_List , CSG_Regression_Multiple , CSG_Simple_Statistics , CSG_Spline , CSG_Table , CSG_Table_Record , CSG_Thin_Plate_Spline , CSG_TimeSpan , CSG_TIN_Triangle , CSG_Trend , CSG_Trend_Polynom , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Value_Size() : CSG_Array
  • Get_Values() : CSG_Grid_Cell_Addressor , CSG_Regression , CSG_Simple_Statistics
  • Get_Variance() : CSG_Cluster_Analysis , CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Version() : CSG_KDTree , CSG_Tool , CSG_Tool_Library
  • Get_Vertex_Type() : CSG_Shape , CSG_Shapes
  • Get_WeekDay() : CSG_DateTime
  • Get_WeekDayName() : CSG_DateTime
  • Get_WeekOfMonth() : CSG_DateTime
  • Get_WeekOfYear() : CSG_DateTime
  • Get_Weeks() : CSG_TimeSpan
  • Get_Weight() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor , CSG_Unique_Value_Statistics
  • Get_Weighting() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • Get_Weights() : CSG_Simple_Statistics
  • Get_With_Intercept() : CSG_Regression_Multiple
  • Get_WKT() : CSG_Projection
  • Get_World_to_Grid() : CSG_Grid_System
  • Get_WTA() : CSG_Classifier_Supervised
  • Get_X() : CSG_Grid_Cell_Addressor , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • Get_x() : CSG_Regression , CSG_Spline
  • Get_X() : CSG_TIN_Node
  • Get_xCenter() : CSG_PRQuadTree_Item
  • Get_XCenter() : CSG_Rect
  • Get_xFrom() : CSG_Grid_System , CSG_Tool_Grid
  • Get_xFromSave() : CSG_Grid_System
  • Get_xGrid() : CSG_Tool_Grid_Interactive
  • Get_xGrid_to_World() : CSG_Grid_System
  • Get_XMax() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_xMax() : CSG_PRQuadTree_Item
  • Get_XMax() : CSG_Rect , CSG_Rect_Int
  • Get_xMax() : CSG_Regression , CSG_Spline
  • Get_XMax() : CSG_Tool_Grid
  • Get_xMean() : CSG_Regression
  • Get_XMin() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_xMin() : CSG_PRQuadTree_Item
  • Get_XMin() : CSG_Rect , CSG_Rect_Int
  • Get_xMin() : CSG_Regression , CSG_Spline
  • Get_XMin() : CSG_Tool_Grid
  • Get_xPosition() : CSG_Tool_Interactive_Base
  • Get_xPosition_Last() : CSG_Tool_Interactive_Base
  • Get_XRange() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Rect , CSG_Rect_Int
  • Get_xTo() : CSG_Grid_System , CSG_Tool_Grid
  • Get_xToSave() : CSG_Grid_System
  • Get_xValue() : CSG_Regression
  • Get_xVariance() : CSG_Regression
  • Get_xWorld_to_Grid() : CSG_Grid_System
  • Get_Y() : CSG_Grid_Cell_Addressor , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • Get_y() : CSG_Regression , CSG_Spline
  • Get_Y() : CSG_TIN_Node
  • Get_yCenter() : CSG_PRQuadTree_Item
  • Get_YCenter() : CSG_Rect
  • Get_Year() : CSG_DateTime
  • Get_yFrom() : CSG_Grid_System , CSG_Tool_Grid
  • Get_yFromSave() : CSG_Grid_System
  • Get_yGrid() : CSG_Tool_Grid_Interactive
  • Get_yGrid_to_World() : CSG_Grid_System
  • Get_YMax() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_yMax() : CSG_PRQuadTree_Item
  • Get_YMax() : CSG_Rect , CSG_Rect_Int
  • Get_yMax() : CSG_Regression
  • Get_YMax() : CSG_Tool_Grid
  • Get_yMean() : CSG_Regression
  • Get_YMin() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_yMin() : CSG_PRQuadTree_Item
  • Get_YMin() : CSG_Rect , CSG_Rect_Int
  • Get_yMin() : CSG_Regression
  • Get_YMin() : CSG_Tool_Grid
  • Get_yPosition() : CSG_Tool_Interactive_Base
  • Get_yPosition_Last() : CSG_Tool_Interactive_Base
  • Get_YRange() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Rect , CSG_Rect_Int
  • Get_yTo() : CSG_Grid_System , CSG_Tool_Grid
  • Get_yToSave() : CSG_Grid_System
  • Get_yValue() : CSG_Regression
  • Get_yVariance() : CSG_Regression
  • Get_yWorld_to_Grid() : CSG_Grid_System
  • Get_Z() : CSG_Grids , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points
  • Get_Z_Attribute() : CSG_Grids
  • Get_Z_Name_Field() : CSG_Grids
  • Get_ZMax() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points , CSG_Shapes
  • Get_ZMin() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points , CSG_Shapes
  • Get_ZRange() : CSG_Grids
  • Greyscale() : CSG_Colors
  • Grid_System_Count() : CSG_Data_Manager
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- h -

  • has_Changed() : CSG_Parameter
  • has_GUI() : CSG_Parameters , CSG_Tool
  • has_Maximum() : CSG_Parameter_Value
  • has_Minimum() : CSG_Parameter_Value
  • Has_More_Tokens() : CSG_String_Tokenizer
  • has_Statistics() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Leaf_List , CSG_PRQuadTree_Node_Statistics
  • History_Supplement : CSG_Tool
  • Hour() : CSG_TimeSpan
  • Hours() : CSG_TimeSpan
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- i -

  • ignore_Projection() : CSG_Parameter
  • Inc_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Inc_Size() : CSG_Buffer
  • Inflate() : CSG_Rect , CSG_Rect_Int
  • Init_Parameter() : CSG_Trend
  • Initialize() : CSG_Parameters_Point_Search_KDTree_2D , CSG_Random
  • Ins() : CSG_Strings
  • Ins_Child() : CSG_MetaData
  • Ins_Col() : CSG_Matrix
  • Ins_Point() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points
  • Ins_Record() : CSG_PointCloud , CSG_Table
  • Ins_Row() : CSG_Matrix
  • Intersect() : CSG_Rect , CSG_Rect_Int
  • Intersects() : CSG_Rect , CSG_Rect_Int , CSG_Shape
  • Inv_Month : CSG_DateTime
  • Inv_Selection() : CSG_PointCloud , CSG_Table
  • Inv_WeekDay : CSG_DateTime
  • Inv_Year : CSG_DateTime
  • Invalidate() : CSG_Simple_Statistics
  • Invert() : CSG_Colors , CSG_Grid
  • is_Alt() : CSG_Tool_Interactive_Base
  • is_Annulus() : CSG_Grid_Cell_Addressor
  • is_Between() : CSG_DateTime
  • is_Cached() : CSG_Grid
  • is_CaseSensitive() : CSG_Translator
  • is_Circle() : CSG_Grid_Cell_Addressor
  • is_Clockwise() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_Collinear() : CSG_Vector
  • is_Compatible() : CSG_Grid , CSG_Grids , CSG_Parameter , CSG_PointCloud , CSG_Table
  • is_Connected() : CSG_HTTP
  • is_Containing() : CSG_TIN_Triangle
  • is_Ctrl() : CSG_Tool_Interactive_Base
  • is_DataObject() : CSG_Parameter
  • is_DataObject_List() : CSG_Parameter
  • is_Default() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Double , CSG_Parameter_Int , CSG_Parameter_Range
  • is_Directory() : CSG_File_Zip , CSG_Parameter_File_Name
  • is_DST() : CSG_DateTime
  • is_EarlierThan() : CSG_DateTime
  • is_Empty() : CSG_PriorityQueue , CSG_String
  • is_Enabled() : CSG_Parameter
  • is_EOF() : CSG_Bytes , CSG_File
  • is_Equal() : CSG_Grid_Collection , CSG_Grid_System , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Vector
  • is_EqualTo() : CSG_DateTime , CSG_TimeSpan
  • is_Evaluated() : CSG_Simple_Statistics
  • is_Executing() : CSG_Tool
  • is_File_Native() : CSG_Data_Object
  • is_Geocentric() : CSG_Projection
  • is_Geographic() : CSG_Projection
  • is_Grid() : CSG_Tool , CSG_Tool_Grid
  • is_Indexed() : CSG_Table
  • is_Information() : CSG_Parameter
  • is_InGrid() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • is_InGrid_byPos() : CSG_Grid , CSG_Grids
  • is_Input() : CSG_Parameter
  • is_Interactive() : CSG_Tool , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive
  • is_Intersecting() : CSG_Grid , CSG_Grids
  • is_Lake() : CSG_Shape_Polygon
  • is_LaterThan() : CSG_DateTime
  • is_Leaf() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Leaf
  • is_LeapYear() : CSG_DateTime
  • is_Loaded() : CSG_Tool_Library_Manager
  • is_Locked() : CSG_Tool_Grid
  • is_LongerThan() : CSG_TimeSpan
  • is_Managed() : CSG_Parameters
  • is_Modified() : CSG_Data_Object , CSG_Grids , CSG_Table_Record
  • is_Multiple() : CSG_Parameter_File_Name
  • is_Negative() : CSG_TimeSpan
  • is_Neighbour() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_NoData() : CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table_Record , CSG_Table_Value_Binary
  • is_NoData_Value() : CSG_Data_Object
  • is_Node() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Node
  • is_Null() : CSG_TimeSpan , CSG_Vector
  • is_Number() : CSG_String
  • is_Okay() : CSG_Index , CSG_KDTree , CSG_Projection , CSG_PRQuadTree , CSG_Thin_Plate_Spline , CSG_Tool_Chain , CSG_Trend
  • is_OnEdge() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_Open() : CSG_File
  • is_Option() : CSG_Parameter
  • is_Optional() : CSG_Parameter
  • is_Output() : CSG_Parameter
  • is_Parameters() : CSG_Parameter
  • is_Password() : CSG_Parameter_String
  • is_Polar() : CSG_PRQuadTree
  • is_Positive() : CSG_TimeSpan
  • is_Progress() : CSG_Tool
  • is_Projection() : CSG_Projection
  • is_Reading() : CSG_File
  • is_Same_As() : CSG_String
  • is_SameDate() : CSG_DateTime
  • is_SameTime() : CSG_DateTime
  • is_Save() : CSG_Parameter_File_Name
  • is_Scaled() : CSG_Grid , CSG_Grids
  • is_Sector() : CSG_Grid_Cell_Addressor
  • is_Selected() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Table , CSG_Table_Record
  • is_Serializable() : CSG_Parameter
  • is_Shift() : CSG_Tool_Interactive_Base
  • is_ShorterThan() : CSG_TimeSpan
  • is_Square() : CSG_Grid_Cell_Addressor , CSG_Matrix
  • is_StrictlyBetween() : CSG_DateTime
  • is_Valid() : CSG_Data_Object , CSG_DateTime , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Parameter , CSG_Parameter_Data_Object , CSG_Parameter_String , CSG_PointCloud , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shapes , CSG_Table , CSG_TIN , CSG_Tool_Library
  • is_Value_Equal() : CSG_Parameter
  • is_Writing() : CSG_File
  • isDeleted() : CSG_Table_DBase
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- j -

  • Jan : CSG_DateTime
  • Jul : CSG_DateTime
  • Jun : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- l -

  • Left() : CSG_String
  • Length() : CSG_File , CSG_String
  • Load() : CSG_Classifier_Supervised , CSG_Colors , CSG_Grids , CSG_MetaData , CSG_Parameters , CSG_Projection , CSG_Table
  • Load_DB() : CSG_Projections
  • Load_Dictionary() : CSG_Projections
  • Load_HTTP() : CSG_MetaData
  • Load_JSON() : CSG_MetaData
  • Load_MetaData() : CSG_Data_Object
  • Lock_Create() : CSG_Tool_Grid
  • Lock_Destroy() : CSG_Tool_Grid
  • Lock_Get() : CSG_Tool_Grid
  • Lock_Set() : CSG_Tool_Grid
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- m -

  • m : SSG_Point_4D
  • m_Area : CSG_Shape_Polygon_Part
  • m_bClockwise : CSG_Shape_Polygon_Part
  • m_bCreated : CSG_Spline
  • m_bDirectory : CSG_Parameter_File_Name
  • m_bEvaluated : CSG_Simple_Statistics
  • m_bFlip : CSG_Grid_File_Info
  • m_bIncluded : CSG_Regression_Multiple
  • m_bIntercept : CSG_Regression_Multiple
  • m_bLake : CSG_Shape_Polygon_Part
  • m_bMaximum : CSG_Parameter_Value
  • m_bMinimum : CSG_Parameter_Value
  • m_bMultiple : CSG_Parameter_File_Name
  • m_bPassword : CSG_Parameter_String
  • m_bSave : CSG_Parameter_File_Name
  • m_bSorted : CSG_Simple_Statistics
  • m_bSwapBytes : CSG_Grid_File_Info
  • m_bUpdate : CSG_Shape_Part , CSG_Shape_Points
  • m_bUpdate_Lakes : CSG_Shape_Polygon
  • m_bWeights : CSG_Unique_Value_Statistics
  • m_Centroid : CSG_Shape_Polygon_Part
  • m_Color : CSG_Parameter_Font
  • m_Colors : CSG_Parameter_Colors
  • m_Count : CSG_Unique_Value_Statistics
  • m_Data : CSG_Parameter_Choice
  • m_Data_File : CSG_Grid_File_Info
  • m_Date : CSG_Parameter_Date
  • m_Default : CSG_Parameter_Grid , CSG_Parameter_Table_Field
  • m_Description : CSG_Grid_File_Info
  • m_Distances : CSG_KDTree
  • m_Edges : CSG_TIN
  • m_Encoding : CSG_File , CSG_Table
  • m_Extent : CSG_PRQuadTree_Item , CSG_Shape_Part , CSG_Shape_Points , CSG_Table , CSG_TIN
  • m_Extent_Selected : CSG_Shapes
  • m_Field_Name : CSG_Table
  • m_Field_Stats : CSG_Table
  • m_Field_Type : CSG_Table
  • m_Fields : CSG_Parameter_Table_Fields
  • m_File_Name : CSG_Tool_Library
  • m_FileName : CSG_File
  • m_Files : CSG_File_Zip
  • m_Filter : CSG_Parameter_File_Name
  • m_Flags : CSG_Table_Record
  • m_Gini : CSG_Simple_Statistics
  • m_Grids : CSG_Parameter_Grid_List
  • m_Index : CSG_Table_Record
  • m_Indices : CSG_KDTree
  • m_Items : CSG_Parameter_Choice , CSG_Parameter_Choices
  • m_Kurtosis : CSG_Simple_Statistics
  • m_Library_Name : CSG_Tool_Library
  • m_M : CSG_Shape_Part
  • m_Maximum : CSG_Parameter_Value , CSG_Simple_Statistics
  • m_maxPoints : CSG_Parameters_Point_Search
  • m_Mean : CSG_Simple_Statistics
  • m_Minimum : CSG_Parameter_Value , CSG_Simple_Statistics
  • m_minPoints : CSG_Parameters_Point_Search
  • m_MMax : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_MMin : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_Mode : CSG_File
  • m_Name : CSG_Grid_File_Info
  • m_Names : CSG_Regression_Multiple
  • m_nBuffer : CSG_Shape_Part , CSG_Table
  • m_nEdges : CSG_TIN
  • m_nFields : CSG_Parameter_Table_Fields , CSG_Table
  • m_NoData : CSG_Grid_File_Info
  • m_nParts : CSG_Shape_Points
  • m_nPoints : CSG_Shape_Part , CSG_Shape_Points
  • m_nPredictors : CSG_Regression_Multiple
  • m_nRecords : CSG_Table
  • m_nTriangles : CSG_TIN
  • m_nValues : CSG_Simple_Statistics
  • m_Objects : CSG_Data_Collection
  • m_Offset : CSG_Grid_File_Info
  • m_P : CSG_Regression
  • m_pAdaptor : CSG_KDTree
  • m_pChildren : CSG_PRQuadTree_Node
  • m_pConvert : CSG_File
  • m_pDataObject : CSG_Parameter_Data_Object
  • m_Perimeter : CSG_Shape_Polygon_Part
  • m_pHTTP : CSG_HTTP
  • m_pKDTree : CSG_KDTree
  • m_pManager : CSG_Data_Collection
  • m_pMax : CSG_Parameter_Range
  • m_pMin : CSG_Parameter_Range
  • m_pModel : CSG_Regression_Multiple
  • m_Point : CSG_PRQuadTree_Leaf , CSG_Shape_Point
  • m_Points : CSG_KDTree , CSG_Shape_Part
  • m_pOwner : CSG_Data_Object , CSG_Shape_Part
  • m_pParameters : CSG_Parameter_Parameters , CSG_Parameters_Point_Search
  • m_pParts : CSG_Shape_Points
  • m_pRange : CSG_Parameter_Range
  • m_Predictor : CSG_Regression_Multiple
  • m_pRegression : CSG_Regression_Multiple
  • m_Projection : CSG_Grid_File_Info
  • m_pSteps : CSG_Regression_Multiple
  • m_pStream : CSG_File
  • m_pString : CSG_String
  • m_pTable : CSG_Table_Record
  • m_R : CSG_Regression
  • m_R2 : CSG_Regression
  • m_R2_Adj : CSG_Regression
  • m_Radius : CSG_Parameters_Point_Search
  • m_Range : CSG_Simple_Statistics
  • m_RCoeff : CSG_Regression
  • m_RConst : CSG_Regression
  • m_Samples : CSG_Regression_Multiple
  • m_Samples_Model : CSG_Regression_Multiple
  • m_SE : CSG_Regression
  • m_Selection : CSG_Parameter_Choices , CSG_Table
  • m_Skewness : CSG_Simple_Statistics
  • m_StdDev : CSG_Simple_Statistics
  • m_String : CSG_Parameter
  • m_Strings : CSG_Strings
  • m_Sum : CSG_Simple_Statistics
  • m_Sum2 : CSG_Simple_Statistics
  • m_System : CSG_Grid_Collection , CSG_Grid_File_Info , CSG_Parameter_Grid_System
  • m_Table : CSG_Parameter_Fixed_Table
  • m_Triangles : CSG_TIN
  • m_Type : CSG_Data_Collection , CSG_Grid_File_Info , CSG_Parameter_Data_Object_Output , CSG_Parameter_Grid , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Regression , CSG_Shapes
  • m_Unit : CSG_Grid_File_Info
  • m_Value : CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Double , CSG_Parameter_Int
  • m_Values : CSG_Simple_Statistics , CSG_Table_Record
  • m_Variance : CSG_Simple_Statistics
  • m_Vertex_Type : CSG_Shapes
  • m_Weight : CSG_Unique_Value_Statistics
  • m_Weights : CSG_Simple_Statistics
  • m_x : CSG_PRQuadTree_Node_Statistics , CSG_Regression , CSG_Spline
  • m_xMax : CSG_Regression
  • m_xMean : CSG_Regression
  • m_xMin : CSG_Regression
  • m_xVar : CSG_Regression
  • m_y : CSG_PRQuadTree_Node_Statistics , CSG_Regression , CSG_Spline
  • m_yMax : CSG_Regression
  • m_yMean : CSG_Regression
  • m_yMin : CSG_Regression
  • m_yVar : CSG_Regression
  • m_z : CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node_Statistics
  • m_Z : CSG_Shape_Part
  • m_z : CSG_Spline
  • m_ZMax : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_ZMin : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_zOffset : CSG_Grid_File_Info
  • m_zScale : CSG_Grid_File_Info
  • Make_Clean() : CSG_Shapes
  • Make_Lower() : CSG_String
  • Make_Upper() : CSG_String
  • Make_UTC() : CSG_DateTime
  • Mar : CSG_DateTime
  • Maximum() : CSG_PriorityQueue
  • May : CSG_DateTime
  • Message_Add() : CSG_Tool
  • Message_Dlg() : CSG_Tool
  • Message_Dlg_Confirm() : CSG_Tool
  • Message_Fmt() : CSG_Tool
  • Mid() : CSG_String
  • Millisecond() : CSG_TimeSpan
  • Milliseconds() : CSG_TimeSpan
  • Minimum() : CSG_PriorityQueue
  • Minute() : CSG_TimeSpan
  • Minutes() : CSG_TimeSpan
  • Mirror() : CSG_Grid
  • Mon : CSG_DateTime
  • Month : CSG_DateTime
  • Mov_Child() : CSG_MetaData
  • Mov_Field() : CSG_PointCloud , CSG_Table
  • Move() : CSG_Rect , CSG_Rect_Int
  • Move_First() : CSG_Table_DBase
  • Move_Next() : CSG_Table_DBase
  • Msg_String() : CSG_Parameters
  • Mul_Value() : CSG_Grid , CSG_Grids , CSG_Table_Record
  • Multiply() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • Multiply_Cross() : CSG_Vector
  • Multiply_Scalar() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- n -

  • Name : CSG_Formula::SSG_Function
  • Name_Abbr : CSG_DateTime
  • Name_Full : CSG_DateTime
  • NameFlags : CSG_DateTime
  • needs_GUI() : CSG_Tool , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive
  • Neg() : CSG_TimeSpan
  • Negate() : CSG_TimeSpan
  • Normalise() : CSG_Grid
  • Nov : CSG_DateTime
  • Now() : CSG_DateTime
  • nParameters : CSG_Formula::SSG_Function
  • Number : CSG_UI_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- o -

  • Oct : CSG_DateTime
  • On_After_Execution() : CSG_Tool
  • On_Assign() : CSG_Shape , CSG_Shape_Point , CSG_Shape_Points
  • On_Before_Execution() : CSG_Tool
  • On_Construction() : CSG_File
  • On_Delete() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • On_Execute() : CSG_Tool , CSG_Tool_Chain
  • On_Execute_Finish() : CSG_Tool_Interactive_Base
  • On_Execute_Keyboard() : CSG_Tool_Interactive_Base
  • On_Execute_Position() : CSG_Tool_Interactive_Base
  • On_Intersects() : CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon
  • On_NoData_Changed() : CSG_Data_Object , CSG_Table
  • On_Parameter_Changed() : CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_Tool
  • On_Parameters_Enable() : CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_Tool , CSG_Tool_Chain
  • On_Reload() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • On_Update() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • Open() : CSG_File , CSG_File_Zip
  • Open_Read() : CSG_Table_DBase
  • Open_Write() : CSG_Table_DBase
  • operator const char *() : CSG_String
  • operator const double *() : CSG_Vector
  • operator const double **() : CSG_Matrix
  • operator const SG_Char *() : CSG_Table_Value
  • operator const wchar_t *() : CSG_String
  • operator double() : CSG_Table_Value
  • operator!() : CSG_TimeSpan
  • operator!=() : CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_TimeSpan , CSG_Vector
  • operator()() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_Vector
  • operator*() : CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator*=() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator+() : CSG_Bytes , CSG_DateTime , CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_String , CSG_TimeSpan , CSG_Vector
  • operator+=() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Matrix , CSG_MetaData , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Rect , CSG_Rect_Int , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_TimeSpan , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Vector
  • operator-() : CSG_DateTime , CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator-=() : CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Rect , CSG_Rect_Int , CSG_TimeSpan , CSG_Vector
  • operator/() : CSG_Grid , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • operator/=() : CSG_Grid , CSG_Grids , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • operator<() : CSG_DateTime , CSG_TimeSpan
  • operator<=() : CSG_DateTime , CSG_TimeSpan
  • operator=() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Colors , CSG_DateTime , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Rects , CSG_Rects_Int , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_Table , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Vector
  • operator==() : CSG_DateTime , CSG_Grid_System , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Table_Value , CSG_TimeSpan , CSG_Vector
  • operator>() : CSG_DateTime , CSG_TimeSpan
  • operator>=() : CSG_DateTime , CSG_TimeSpan
  • operator[]() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Bytes_Array , CSG_Colors , CSG_Grid_Stack , CSG_Grids , CSG_Histogram , CSG_Index , CSG_KDTree , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Natural_Breaks , CSG_Parameters , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projections , CSG_Rects , CSG_Rects_Int , CSG_Regression_Weighted , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_Table , CSG_Table_Record , CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- p -

  • p1 : CSG_TIN::TTIN_Edge , CSG_TIN::TTIN_Triangle
  • p2 : CSG_TIN::TTIN_Edge , CSG_TIN::TTIN_Triangle
  • p3 : CSG_TIN::TTIN_Triangle
  • Parameters : CSG_Tool
  • Parse_Date() : CSG_DateTime
  • Parse_DateTime() : CSG_DateTime
  • Parse_Format() : CSG_DateTime
  • Parse_ISOCombined() : CSG_DateTime
  • Parse_ISODate() : CSG_DateTime
  • Parse_ISOTime() : CSG_DateTime
  • Peek() : CSG_PriorityQueue
  • Pointer : CSG_UI_Parameter
  • Poll() : CSG_PriorityQueue
  • Pop() : CSG_Grid_Stack
  • Prepend() : CSG_String
  • Print() : CSG_Classifier_Supervised
  • Printf() : CSG_File , CSG_String
  • Process_Get_Okay() : CSG_Tool
  • Process_Set_Text() : CSG_Tool
  • Push() : CSG_Grid_Stack
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- r -

  • Random() : CSG_Colors
  • Read() : CSG_File
  • Read_Byte() : CSG_Bytes
  • Read_Char() : CSG_Bytes , CSG_File
  • Read_Double() : CSG_Bytes , CSG_File
  • Read_DWord() : CSG_Bytes
  • Read_Float() : CSG_Bytes
  • Read_Int() : CSG_Bytes , CSG_File
  • Read_Line() : CSG_File
  • Read_Short() : CSG_Bytes
  • Read_Word() : CSG_Bytes
  • Reload() : CSG_Data_Object
  • Remove() : CSG_String
  • Replace() : CSG_String
  • Request() : CSG_HTTP
  • Reset() : CSG_Tool
  • Reset_Dictionary() : CSG_Projections
  • Reset_Grid_System() : CSG_Parameters , CSG_Tool
  • Reset_Manager() : CSG_Tool
  • Reset_Time() : CSG_DateTime
  • Restore_Default() : CSG_Parameter , CSG_Parameter_Font , CSG_Parameter_Parameters , CSG_Parameter_Range
  • Restore_Defaults() : CSG_Parameters
  • Revert() : CSG_Colors
  • Revert_Points() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Points
  • Rewind() : CSG_Bytes
  • Right() : CSG_String
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- s -

  • s_z : CSG_PRQuadTree_Leaf_List
  • Sat : CSG_DateTime
  • Save() : CSG_Classifier_Supervised , CSG_Colors , CSG_Data_Object , CSG_Grid , CSG_Grid_File_Info , CSG_Grids , CSG_MetaData , CSG_Parameters , CSG_PointCloud , CSG_Projection , CSG_Shapes , CSG_Table , CSG_TIN
  • Save_AUX_XML() : CSG_Grid_File_Info
  • Save_DB() : CSG_Projections
  • Save_Dictionary() : CSG_Projections
  • Save_History_to_Model() : CSG_Data_Object , CSG_Tool_Chain
  • Save_JSON() : CSG_MetaData
  • Save_MetaData() : CSG_Data_Object
  • Scale_Element_Count() : CSG_Histogram
  • Scan() : CSG_File
  • Scan_Double() : CSG_File
  • Scan_Int() : CSG_File
  • Scan_String() : CSG_File
  • Second() : CSG_TimeSpan
  • Seconds() : CSG_TimeSpan
  • Seek() : CSG_File
  • Seek_End() : CSG_File
  • Seek_Start() : CSG_File
  • Select() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Shapes , CSG_Table
  • Select_Nearest_Points() : CSG_PRQuadTree
  • Sep : CSG_DateTime
  • Serialize() : CSG_Colors , CSG_Parameter , CSG_Parameters , CSG_Table
  • Serialize_Compatibility() : CSG_Parameters
  • Set() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_DateTime
  • Set_Annulus() : CSG_Grid_Cell_Addressor
  • Set_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Set_Attribute() : CSG_PointCloud
  • Set_Author() : CSG_Tool
  • Set_BandWidth() : CSG_Distance_Weighting
  • Set_Blue() : CSG_Colors
  • Set_BottomLeft() : CSG_Rect , CSG_Rect_Int
  • Set_Brightness() : CSG_Colors
  • Set_Cache() : CSG_Grid
  • Set_Callback() : CSG_Parameters , CSG_Tool
  • Set_Callback_On_Parameter_Changed() : CSG_Parameters
  • Set_Char() : CSG_String
  • Set_Children_Enabled() : CSG_Parameter
  • Set_Circle() : CSG_Grid_Cell_Addressor
  • Set_Col() : CSG_Matrix
  • Set_Color() : CSG_Colors
  • Set_Cols() : CSG_Matrix
  • Set_Content() : CSG_MetaData
  • Set_Count() : CSG_Colors , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Simple_Statistics , CSG_Strings , CSG_Table
  • Set_Cursor() : CSG_PointCloud
  • Set_Data() : CSG_Buffer , CSG_Regression_Multiple , CSG_Trend , CSG_Trend_Polynom
  • Set_Data_Type() : CSG_Parameter_Data_Type
  • Set_Data_Types() : CSG_Parameter_Data_Type
  • Set_DataObject_Type() : CSG_Parameter_Data_Object_Output
  • Set_Date() : CSG_Parameter_Date
  • Set_Day() : CSG_DateTime
  • Set_DayOfYear() : CSG_DateTime
  • Set_Default() : CSG_Colors , CSG_Parameter
  • Set_Description() : CSG_Data_Object , CSG_Parameter , CSG_Parameters , CSG_Tool
  • Set_Drag_Mode() : CSG_Tool_Interactive_Base
  • Set_Enabled() : CSG_Parameter , CSG_Parameters
  • Set_Encoding() : CSG_File
  • Set_Extent() : CSG_PRQuadTree_Item
  • Set_Feature() : CSG_Cluster_Analysis
  • Set_Field_Name() : CSG_Table
  • Set_Field_Type() : CSG_PointCloud , CSG_Table
  • Set_File_Encoding() : CSG_Table
  • Set_File_Name() : CSG_Data_Object
  • Set_File_Type() : CSG_Data_Object
  • Set_Filter() : CSG_Parameter_File_Name
  • Set_Flag_Directory() : CSG_Parameter_File_Name
  • Set_Flag_Multiple() : CSG_Parameter_File_Name
  • Set_Flag_Save() : CSG_Parameter_File_Name
  • Set_Formula() : CSG_Formula , CSG_Trend
  • Set_GCS_WGS84() : CSG_Projection
  • Set_Green() : CSG_Colors
  • Set_Grid_Count() : CSG_Grids
  • Set_Grid_System() : CSG_Parameters , CSG_Tool
  • Set_Growth() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Set_History() : CSG_Parameters
  • Set_Hour() : CSG_DateTime
  • Set_Hours_AD() : CSG_DateTime
  • Set_Identifier() : CSG_Parameters
  • Set_Identity() : CSG_Matrix
  • Set_IDW_Offset() : CSG_Distance_Weighting
  • Set_IDW_Power() : CSG_Distance_Weighting
  • Set_Index() : CSG_Grid , CSG_Grids , CSG_Table
  • Set_Inverse() : CSG_Matrix
  • Set_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Set_Library_Menu() : CSG_Tool_Chain
  • Set_Location() : CSG_Parameters_Point_Search_KDTree_2D
  • Set_Log_Difference() : CSG_Regression_Weighted
  • Set_Log_Epsilon() : CSG_Regression_Weighted
  • Set_Log_maxIter() : CSG_Regression_Weighted
  • Set_M() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points
  • Set_Manager() : CSG_Parameters , CSG_Tool
  • Set_Max() : CSG_Parameter_Range
  • Set_Max_Iterations() : CSG_Trend
  • Set_Max_Lambda() : CSG_Trend
  • Set_Max_Samples() : CSG_Data_Object , CSG_Grids
  • Set_Maximum() : CSG_Parameter_Value
  • Set_Millisecond() : CSG_DateTime
  • Set_Min() : CSG_Parameter_Range
  • Set_Minimum() : CSG_Parameter_Value
  • Set_Minute() : CSG_DateTime
  • Set_Modified() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table , CSG_Table_Record
  • Set_Month() : CSG_DateTime
  • Set_Name() : CSG_Data_Object , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Tool
  • Set_NoData() : CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value_Binary
  • Set_NoData_Value() : CSG_Data_Object
  • Set_NoData_Value_Range() : CSG_Data_Object , CSG_Grids
  • Set_Order() : CSG_Trend_Polynom
  • Set_Owner() : CSG_Data_Object
  • Set_Palette() : CSG_Colors
  • Set_Parameter() : CSG_Parameters , CSG_Tool
  • Set_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • Set_Password() : CSG_Parameter_String
  • Set_Point() : CSG_PointCloud , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Set_Point_Count() : CSG_Thin_Plate_Spline
  • Set_Polar_Search() : CSG_PRQuadTree
  • Set_Precision() : CSG_Grid_System
  • Set_Predefined() : CSG_Colors
  • Set_Preferred_Type() : CSG_Parameter_Grid
  • Set_Probability_Relative() : CSG_Classifier_Supervised
  • Set_Progress() : CSG_Tool
  • Set_Progress_Cells() : CSG_Tool_Grid
  • Set_Progress_Rows() : CSG_Tool_Grid
  • Set_Projection() : CSG_Tool_Interactive_Base
  • Set_Property() : CSG_MetaData
  • Set_Radius() : CSG_Grid_Cell_Addressor
  • Set_Ramp() : CSG_Colors
  • Set_Ramp_Brighness() : CSG_Colors
  • Set_Range() : CSG_Parameter_Range
  • Set_Record() : CSG_Table
  • Set_Red() : CSG_Colors
  • Set_Row() : CSG_Grid , CSG_Matrix
  • Set_Rows() : CSG_Matrix , CSG_Vector
  • Set_Scaling() : CSG_Grid , CSG_Grids
  • Set_Second() : CSG_DateTime
  • Set_Sector() : CSG_Grid_Cell_Addressor
  • Set_Selected() : CSG_Table_Record
  • Set_Shape_Type() : CSG_Parameter_Shapes , CSG_Parameter_Shapes_List
  • Set_Show_Progress() : CSG_Tool
  • Set_Size() : CSG_Buffer , CSG_Matrix
  • Set_Square() : CSG_Grid_Cell_Addressor
  • Set_String() : CSG_String_Tokenizer
  • Set_System() : CSG_Tool_Grid
  • Set_Threshold_Angle() : CSG_Classifier_Supervised
  • Set_Threshold_Distance() : CSG_Classifier_Supervised
  • Set_Threshold_Probability() : CSG_Classifier_Supervised
  • Set_To_Current() : CSG_DateTime
  • Set_TopRight() : CSG_Rect , CSG_Rect_Int
  • Set_Transpose() : CSG_Matrix
  • Set_Unit() : CSG_Grid , CSG_Grids
  • Set_Unity() : CSG_Vector
  • Set_Unix_Time() : CSG_DateTime
  • Set_Update_Flag() : CSG_Data_Object
  • Set_UseInCMD() : CSG_Parameter
  • Set_UseInGUI() : CSG_Parameter
  • Set_User_Defined() : CSG_Parameters_Grid_Target
  • Set_User_Defined_ZLevels() : CSG_Parameters_Grid_Target
  • Set_UTM_WGS84() : CSG_Projection
  • Set_Valid_Range() : CSG_Parameter_Value
  • Set_Value() : CSG_Buffer , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_PointCloud , CSG_Table , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • Set_Values() : CSG_Regression
  • Set_Variable() : CSG_Formula
  • Set_Version() : CSG_Tool
  • Set_Weighting() : CSG_Distance_Weighting
  • Set_With_Intercept() : CSG_Regression_Multiple
  • Set_WTA() : CSG_Classifier_Supervised
  • Set_XYZ_Precision() : CSG_PointCloud
  • Set_Year() : CSG_DateTime
  • Set_Z() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points
  • Set_Z_Attribute() : CSG_Grids
  • Set_Z_Name_Field() : CSG_Grids
  • Set_Zero() : CSG_Matrix , CSG_Vector
  • Settings_Pop() : CSG_Tool
  • Settings_Push() : CSG_Tool
  • Show_Progress() : CSG_Index
  • Sort() : CSG_Category_Statistics , CSG_Strings , CSG_Vector
  • Standardise() : CSG_Grid
  • Stop_Execution() : CSG_Tool
  • String : CSG_UI_Parameter
  • Subtract() : CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • Sun : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- t -

  • Tell() : CSG_File
  • Thu : CSG_DateTime
  • to_ASCII() : CSG_String
  • to_JSON() : CSG_MetaData
  • to_MBChar() : CSG_String
  • to_ShapeType() : CSG_Shapes_OGIS_Converter
  • to_StdString() : CSG_String
  • to_StdWstring() : CSG_String
  • to_String() : CSG_Matrix , CSG_Vector
  • to_Text() : CSG_Colors
  • To_UTC() : CSG_DateTime
  • to_UTF8() : CSG_String
  • to_VertexType() : CSG_Shapes_OGIS_Converter
  • to_WKBinary() : CSG_Grid_OGIS_Converter , CSG_Shapes_OGIS_Converter
  • to_WKT() : CSG_MetaData
  • to_WKText() : CSG_Shapes_OGIS_Converter
  • to_XML() : CSG_MetaData
  • Toggle_Index() : CSG_Table
  • Toggle_Value() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice
  • toHexString() : CSG_Bytes
  • Train() : CSG_Classifier_Supervised
  • Train_Add_Sample() : CSG_Classifier_Supervised
  • Train_Clr_Samples() : CSG_Classifier_Supervised
  • Trim() : CSG_String
  • Trim_Both() : CSG_String
  • TSG_DateTime : CSG_DateTime
  • TSG_Function : CSG_Formula
  • Tue : CSG_DateTime
  • Type_asWKBinary() : CSG_Shapes_OGIS_Converter
  • Type_asWKText() : CSG_Shapes_OGIS_Converter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- u -

  • Union() : CSG_Rect , CSG_Rect_Int
  • Update() : CSG_Data_Object , CSG_Histogram , CSG_Parameters_Point_Search
  • Update_Data() : CSG_Parameter_Grid_List , CSG_Parameter_List
  • Update_Parameter_States() : CSG_Tool
  • Update_Z_Order() : CSG_Grids
  • Use_Grid_System() : CSG_Parameters
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- w -

  • w_str() : CSG_String
  • Wed : CSG_DateTime
  • Week() : CSG_TimeSpan
  • WeekDay : CSG_DateTime
  • Weeks() : CSG_TimeSpan
  • WKT_from_Proj4() : CSG_Projections
  • WKT_to_MetaData() : CSG_Projections
  • WKT_to_Proj4() : CSG_Projections
  • Write() : CSG_File
  • Write_Double() : CSG_File
  • Write_Int() : CSG_File
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- x -

  • x : SSG_Point , SSG_Point_3D , SSG_Point_4D , SSG_Point_Int
  • xMax : SSG_Rect , SSG_Rect_Int
  • xMin : SSG_Rect , SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- y -

  • y : SSG_Point , SSG_Point_3D , SSG_Point_4D , SSG_Point_Int
  • Year : CSG_DateTime
  • yMax : SSG_Rect , SSG_Rect_Int
  • yMin : SSG_Rect , SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- z -

  • z : SSG_Point_3D , SSG_Point_4D
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members

Here is a list of all class members with links to the classes they belong to:

- ~ -

  • ~CSG_Array() : CSG_Array
  • ~CSG_Buffer() : CSG_Buffer
  • ~CSG_Bytes() : CSG_Bytes
  • ~CSG_Bytes_Array() : CSG_Bytes_Array
  • ~CSG_Category_Statistics() : CSG_Category_Statistics
  • ~CSG_Classifier_Supervised() : CSG_Classifier_Supervised
  • ~CSG_Cluster_Analysis() : CSG_Cluster_Analysis
  • ~CSG_Colors() : CSG_Colors
  • ~CSG_Data_Collection() : CSG_Data_Collection
  • ~CSG_Data_Manager() : CSG_Data_Manager
  • ~CSG_Data_Object() : CSG_Data_Object
  • ~CSG_DateTime() : CSG_DateTime
  • ~CSG_Distance_Weighting() : CSG_Distance_Weighting
  • ~CSG_File() : CSG_File
  • ~CSG_File_Zip() : CSG_File_Zip
  • ~CSG_Formula() : CSG_Formula
  • ~CSG_Grid() : CSG_Grid
  • ~CSG_Grid_Pyramid() : CSG_Grid_Pyramid
  • ~CSG_Grid_Radius() : CSG_Grid_Radius
  • ~CSG_Grid_System() : CSG_Grid_System
  • ~CSG_Grids() : CSG_Grids
  • ~CSG_Histogram() : CSG_Histogram
  • ~CSG_HTTP() : CSG_HTTP
  • ~CSG_Index() : CSG_Index
  • ~CSG_Index_Compare() : CSG_Index::CSG_Index_Compare
  • ~CSG_KDTree() : CSG_KDTree
  • ~CSG_KDTree_2D() : CSG_KDTree_2D
  • ~CSG_KDTree_3D() : CSG_KDTree_3D
  • ~CSG_Lines() : CSG_Lines
  • ~CSG_Matrix() : CSG_Matrix
  • ~CSG_MetaData() : CSG_MetaData
  • ~CSG_Natural_Breaks() : CSG_Natural_Breaks
  • ~CSG_Parameter() : CSG_Parameter
  • ~CSG_Parameter_Parameters() : CSG_Parameter_Parameters
  • ~CSG_Parameter_Range() : CSG_Parameter_Range
  • ~CSG_Parameter_Table_Fields() : CSG_Parameter_Table_Fields
  • ~CSG_Parameters() : CSG_Parameters
  • ~CSG_Parameters_Point_Search() : CSG_Parameters_Point_Search
  • ~CSG_Parameters_Point_Search_KDTree_2D() : CSG_Parameters_Point_Search_KDTree_2D
  • ~CSG_Point() : CSG_Point
  • ~CSG_Point_3D() : CSG_Point_3D
  • ~CSG_Point_4D() : CSG_Point_4D
  • ~CSG_PointCloud() : CSG_PointCloud
  • ~CSG_PriorityQueue() : CSG_PriorityQueue
  • ~CSG_Projection() : CSG_Projection
  • ~CSG_Projections() : CSG_Projections
  • ~CSG_PRQuadTree() : CSG_PRQuadTree
  • ~CSG_PRQuadTree_Item() : CSG_PRQuadTree_Item
  • ~CSG_PRQuadTree_Leaf() : CSG_PRQuadTree_Leaf
  • ~CSG_PRQuadTree_Leaf_List() : CSG_PRQuadTree_Leaf_List
  • ~CSG_PRQuadTree_Node() : CSG_PRQuadTree_Node
  • ~CSG_PRQuadTree_Node_Statistics() : CSG_PRQuadTree_Node_Statistics
  • ~CSG_Rect() : CSG_Rect
  • ~CSG_Rect_Int() : CSG_Rect_Int
  • ~CSG_Rects() : CSG_Rects
  • ~CSG_Rects_Int() : CSG_Rects_Int
  • ~CSG_Regression() : CSG_Regression
  • ~CSG_Regression_Multiple() : CSG_Regression_Multiple
  • ~CSG_Regression_Weighted() : CSG_Regression_Weighted
  • ~CSG_Shape() : CSG_Shape
  • ~CSG_Shape_Line() : CSG_Shape_Line
  • ~CSG_Shape_Part() : CSG_Shape_Part
  • ~CSG_Shape_Point() : CSG_Shape_Point
  • ~CSG_Shape_Points() : CSG_Shape_Points
  • ~CSG_Shape_Polygon() : CSG_Shape_Polygon
  • ~CSG_Shape_Polygon_Part() : CSG_Shape_Polygon_Part
  • ~CSG_Shapes() : CSG_Shapes
  • ~CSG_Spline() : CSG_Spline
  • ~CSG_Stack() : CSG_Stack
  • ~CSG_String() : CSG_String
  • ~CSG_String_Tokenizer() : CSG_String_Tokenizer
  • ~CSG_Strings() : CSG_Strings
  • ~CSG_Table() : CSG_Table
  • ~CSG_Table_DBase() : CSG_Table_DBase
  • ~CSG_Table_Record() : CSG_Table_Record
  • ~CSG_Table_Value() : CSG_Table_Value
  • ~CSG_Table_Value_Binary() : CSG_Table_Value_Binary
  • ~CSG_Table_Value_Date() : CSG_Table_Value_Date
  • ~CSG_Table_Value_Double() : CSG_Table_Value_Double
  • ~CSG_Table_Value_Int() : CSG_Table_Value_Int
  • ~CSG_Table_Value_Long() : CSG_Table_Value_Long
  • ~CSG_Table_Value_String() : CSG_Table_Value_String
  • ~CSG_Thin_Plate_Spline() : CSG_Thin_Plate_Spline
  • ~CSG_TIN() : CSG_TIN
  • ~CSG_Tool() : CSG_Tool
  • ~CSG_Tool_Chain() : CSG_Tool_Chain
  • ~CSG_Tool_Chains() : CSG_Tool_Chains
  • ~CSG_Tool_Grid() : CSG_Tool_Grid
  • ~CSG_Tool_Grid_Interactive() : CSG_Tool_Grid_Interactive
  • ~CSG_Tool_Interactive() : CSG_Tool_Interactive
  • ~CSG_Tool_Interactive_Base() : CSG_Tool_Interactive_Base
  • ~CSG_Tool_Library() : CSG_Tool_Library
  • ~CSG_Tool_Library_Interface() : CSG_Tool_Library_Interface
  • ~CSG_Tool_Library_Manager() : CSG_Tool_Library_Manager
  • ~CSG_Translator() : CSG_Translator
  • ~CSG_Unique_Number_Statistics() : CSG_Unique_Number_Statistics
  • ~CSG_Unique_String_Statistics() : CSG_Unique_String_Statistics
  • ~CSG_Unique_Value_Statistics() : CSG_Unique_Value_Statistics
  • ~CSG_Vector() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- _ -

  • _Add_Edge() : CSG_TIN
  • _Add_Edge_Points() : CSG_Shape_Polygon_Part
  • _Add_Field() : CSG_Table_Record
  • _Add_Part() : CSG_Shape_Points
  • _Add_Selection() : CSG_Table
  • _Add_Triangle() : CSG_TIN
  • _Alloc_Memory() : CSG_Shape_Part
  • _asDouble() : CSG_Parameter , CSG_Parameter_Choice , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Grid , CSG_Parameter_Int , CSG_Parameter_Table_Field
  • _asInt() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Colors , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Table_Fields
  • _asPointer() : CSG_Parameter , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid_System , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Table_Fields
  • _Assign() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Value
  • _asString() : CSG_Parameter
  • _CircumCircle() : CSG_TIN
  • _Create() : CSG_Spline
  • _Create_Value() : CSG_Table_Record
  • _Del_Field() : CSG_Table_Record
  • _Del_Selection() : CSG_Table
  • _Destroy_Edges() : CSG_TIN
  • _Destroy_Nodes() : CSG_TIN
  • _Destroy_Triangles() : CSG_TIN
  • _Evaluate() : CSG_Simple_Statistics
  • _Get_F() : CSG_Regression_Multiple
  • _Get_Field() : CSG_Table_Record
  • _Get_New_Record() : CSG_Shapes , CSG_Table , CSG_TIN
  • _Get_P() : CSG_Regression_Multiple
  • _Get_Part() : CSG_Shape_Points , CSG_Shape_Polygon
  • _Get_Regression() : CSG_Regression_Multiple
  • _Get_Step_In() : CSG_Regression_Multiple
  • _Get_Step_Out() : CSG_Regression_Multiple
  • _Initialize() : CSG_Regression_Multiple
  • _Invalidate() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • _is_OnEdge() : CSG_Shape_Polygon_Part
  • _On_Construction() : CSG_KDTree , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • _Serialize() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Double , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Range , CSG_Parameter_String , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields
  • _Set_Selection() : CSG_Table
  • _Set_Step_Info() : CSG_Regression_Multiple
  • _Set_String() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_Fixed_Table , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Parameters , CSG_Parameter_Range , CSG_Parameter_Table_Field
  • _Set_Value() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Object_Output , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_System , CSG_Parameter_Int , CSG_Parameter_PointCloud , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_TIN
  • _Stats_Invalidate() : CSG_Table
  • _Stats_Update() : CSG_PointCloud , CSG_Table
  • _Triangulate() : CSG_TIN
  • _Update_Area() : CSG_Shape_Polygon_Part
  • _Update_Extent() : CSG_Shape_Part , CSG_Shape_Points
  • _X_Transform() : CSG_Regression
  • _Y_Transform() : CSG_Regression
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- a -

  • Abs() : CSG_TimeSpan
  • Add() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Bytes , CSG_Bytes_Array , CSG_Data_Collection , CSG_Data_Manager , CSG_DateTime , CSG_Grid , CSG_Grid_Collection , CSG_Grids , CSG_Lines , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_PriorityQueue , CSG_Projections , CSG_Rects , CSG_Rects_Int , CSG_Simple_Statistics , CSG_Spline , CSG_Strings , CSG_TimeSpan , CSG_Vector
  • Add_Attribute() : CSG_Grids
  • Add_Bool() : CSG_Parameters
  • Add_Child() : CSG_MetaData
  • Add_Children() : CSG_MetaData
  • Add_Choice() : CSG_Parameters
  • Add_Choices() : CSG_Parameters
  • Add_Class() : CSG_Classifier_Supervised
  • Add_Col() : CSG_Matrix
  • Add_Color() : CSG_Parameters
  • Add_Colors() : CSG_Parameters
  • Add_Cols() : CSG_Matrix
  • Add_Data() : CSG_Trend , CSG_Trend_Polynom
  • Add_Data_Type() : CSG_Parameters
  • Add_Date() : CSG_Parameters
  • Add_Default() : CSG_Parameter_Grid , CSG_Parameter_Table_Field
  • Add_Degree() : CSG_Parameters
  • Add_Directory() : CSG_File_Zip , CSG_Tool_Library_Manager
  • Add_Double() : CSG_Parameters
  • Add_Element() : CSG_Cluster_Analysis
  • Add_Entry() : CSG_Index
  • Add_Field() : CSG_PointCloud , CSG_Table
  • Add_File() : CSG_File_Zip
  • Add_FilePath() : CSG_Parameters
  • Add_FixedTable() : CSG_Parameters
  • Add_Font() : CSG_Parameters
  • Add_Function() : CSG_Formula
  • Add_Grid() : CSG_Data_Manager , CSG_Grids , CSG_Parameters , CSG_Parameters_Grid_Target
  • Add_Grid_List() : CSG_Parameters
  • Add_Grid_or_Const() : CSG_Parameters
  • Add_Grid_Output() : CSG_Parameters
  • Add_Grid_System() : CSG_Parameters
  • Add_Grids() : CSG_Data_Manager , CSG_Parameters , CSG_Parameters_Grid_Target
  • Add_Grids_List() : CSG_Parameters
  • Add_Grids_Output() : CSG_Parameters
  • Add_Info_Range() : CSG_Parameters
  • Add_Info_String() : CSG_Parameters
  • Add_Info_Value() : CSG_Parameters
  • Add_Int() : CSG_Parameters
  • Add_Item() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Grid_List , CSG_Parameter_Grids_List , CSG_Parameter_List
  • Add_Library() : CSG_Tool_Library_Manager
  • Add_Node() : CSG_Parameters , CSG_TIN
  • Add_Parameter() : CSG_Parameters
  • Add_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor , CSG_Parameters , CSG_Tool
  • Add_Part() : CSG_Shape , CSG_Shape_Points
  • Add_Point() : CSG_PointCloud , CSG_PRQuadTree , CSG_PRQuadTree_Node , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Add_PointCloud() : CSG_Data_Manager , CSG_Parameters
  • Add_PointCloud_List() : CSG_Parameters
  • Add_PointCloud_Output() : CSG_Parameters
  • Add_Property() : CSG_MetaData
  • Add_Range() : CSG_Parameters
  • Add_Record() : CSG_PointCloud , CSG_Table , CSG_Table_DBase
  • Add_Reference() : CSG_Parameters , CSG_Tool , CSG_Tool_Library
  • Add_Row() : CSG_Matrix , CSG_Vector
  • Add_Rows() : CSG_Matrix , CSG_Vector
  • Add_Sample() : CSG_Regression_Weighted
  • Add_Shape() : CSG_PointCloud , CSG_Shapes
  • Add_Shapes() : CSG_Data_Manager , CSG_Parameters
  • Add_Shapes_List() : CSG_Parameters
  • Add_Shapes_Output() : CSG_Parameters
  • Add_String() : CSG_Parameters
  • Add_Table() : CSG_Data_Manager , CSG_Parameters
  • Add_Table_Field() : CSG_Parameters
  • Add_Table_Field_or_Const() : CSG_Parameters
  • Add_Table_Fields() : CSG_Parameters
  • Add_Table_List() : CSG_Parameters
  • Add_Table_Output() : CSG_Parameters
  • Add_TIN() : CSG_Data_Manager , CSG_Parameters
  • Add_TIN_List() : CSG_Parameters
  • Add_TIN_Output() : CSG_Parameters
  • Add_Tool() : CSG_Tool_Chains
  • Add_Value() : CSG_Buffer , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Parameters , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table_Record , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Add_Values() : CSG_Regression
  • AfterFirst() : CSG_String
  • AfterLast() : CSG_String
  • Append() : CSG_String
  • asBinary() : CSG_Table_Value , CSG_Table_Value_Binary
  • asBool() : CSG_Parameter
  • asByte() : CSG_Bytes , CSG_Grid , CSG_Grids
  • asChar() : CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • asChoice() : CSG_Parameter
  • asChoices() : CSG_Parameter
  • asColor() : CSG_Parameter
  • asColors() : CSG_Parameter
  • asDataObject() : CSG_Parameter
  • asDataType() : CSG_Parameter
  • asDate() : CSG_Parameter
  • asDouble() : CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_String , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asDWord() : CSG_Bytes
  • asFilePath() : CSG_Parameter
  • asFloat() : CSG_Buffer , CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • asFont() : CSG_Parameter
  • asGrid() : CSG_Data_Object , CSG_Parameter
  • asGrid_System() : CSG_Parameter
  • asGridList() : CSG_Parameter
  • asGrids() : CSG_Data_Object , CSG_Parameter
  • asGridsList() : CSG_Parameter
  • asInt() : CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_String , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asLeaf() : CSG_PRQuadTree_Item
  • asLine() : CSG_Shape
  • asList() : CSG_Parameter
  • asLong() : CSG_Grid , CSG_Grids , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asLongLong() : CSG_String
  • asNode() : CSG_PRQuadTree_Item
  • asParameters() : CSG_Parameter
  • asPoint() : CSG_Shape
  • asPointCloud() : CSG_Data_Object , CSG_Parameter
  • asPointCloudList() : CSG_Parameter
  • asPointer() : CSG_Parameter
  • asPoints() : CSG_Shape
  • asPolygon() : CSG_Shape
  • asRange() : CSG_Parameter
  • asShapes() : CSG_Data_Object , CSG_Parameter
  • asShapesList() : CSG_Parameter
  • asShort() : CSG_Buffer , CSG_Bytes , CSG_Grid , CSG_Grids , CSG_Table_Record
  • Assign() : CSG_Array_Int , CSG_Array_sLong , CSG_Bytes , CSG_Colors , CSG_Data_Object , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_PointCloud , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Rects , CSG_Rects_Int , CSG_Shape , CSG_Shape_Part , CSG_Shapes , CSG_Strings , CSG_Table , CSG_Table_Record , CSG_TIN , CSG_Vector
  • Assign_NoData() : CSG_Grid , CSG_Grids
  • Assign_Parameters() : CSG_Parameters
  • Assign_Values() : CSG_Parameters , CSG_Table
  • asString() : CSG_Category_Statistics , CSG_Parameter , CSG_Regression , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • asTable() : CSG_Data_Object , CSG_Parameter
  • asTableFields() : CSG_Parameter
  • asTableList() : CSG_Parameter
  • asText() : CSG_MetaData
  • asTIN() : CSG_Data_Manager , CSG_Data_Object , CSG_Parameter , CSG_Parameter_TIN_List
  • asTINList() : CSG_Parameter
  • asValue() : CSG_Parameter
  • asWord() : CSG_Bytes
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- b -

  • b_str() : CSG_String
  • BeforeFirst() : CSG_String
  • BeforeLast() : CSG_String
  • begin() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- c -

  • c_str() : CSG_String
  • Calculate() : CSG_Regression , CSG_Regression_Weighted
  • cbegin() : CSG_Vector
  • cend() : CSG_Vector
  • Check() : CSG_Parameter
  • Clear() : CSG_Bytes , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Rects , CSG_Rects_Int , CSG_Stack , CSG_String , CSG_Strings
  • Close() : CSG_File , CSG_File_Zip , CSG_Table_DBase
  • Clr_Data() : CSG_Trend , CSG_Trend_Polynom
  • Clr_Selection() : CSG_Parameter_Choices
  • Cmp() : CSG_String
  • Cmp_Content() : CSG_MetaData
  • Cmp_Identifier() : CSG_Parameter , CSG_Parameters
  • Cmp_Name() : CSG_MetaData
  • Cmp_Property() : CSG_MetaData
  • CmpNoCase() : CSG_String
  • Compare()
: CSG_Index::CSG_Index_Compare
, CSG_PriorityQueue::CSG_PriorityQueueItem
  • Contains() : CSG_PRQuadTree_Item , CSG_Rect , CSG_Rect_Int , CSG_Shape_Polygon , CSG_Shape_Polygon_Part , CSG_String
  • Count() : CSG_Data_Collection
  • Create() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_Classifier_Supervised , CSG_Cluster_Analysis , CSG_Colors , CSG_Grid , CSG_Grid_File_Info , CSG_Grid_Pyramid , CSG_Grid_Radius , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_HTTP , CSG_Index , CSG_KDTree_2D , CSG_KDTree_3D , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Natural_Breaks , CSG_Parameters , CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_PointCloud , CSG_PriorityQueue , CSG_Projection , CSG_Projections , CSG_PRQuadTree , CSG_Shapes , CSG_Simple_Statistics , CSG_Spline , CSG_String , CSG_Strings , CSG_Table , CSG_Thin_Plate_Spline , CSG_TIN , CSG_Tool_Chain , CSG_Tool_Library_Interface , CSG_Translator , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics , CSG_Vector
  • Create_Manager() : CSG_Tool
  • Create_Parameters() : CSG_Distance_Weighting
  • Create_Python_ToolBox() : CSG_Tool_Library_Manager
  • Create_Tool() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • CSG_Array() : CSG_Array
  • CSG_Array_Int() : CSG_Array_Int
  • CSG_Array_Pointer() : CSG_Array_Pointer
  • CSG_Array_sLong() : CSG_Array_sLong
  • CSG_Buffer() : CSG_Buffer
  • CSG_Bytes() : CSG_Bytes
  • CSG_Bytes_Array() : CSG_Bytes_Array
  • CSG_Category_Statistics() : CSG_Category_Statistics
  • CSG_Classifier_Supervised() : CSG_Classifier_Supervised
  • CSG_Cluster_Analysis() : CSG_Cluster_Analysis
  • CSG_Colors() : CSG_Colors
  • CSG_Data_Collection() : CSG_Data_Collection
  • CSG_Data_Manager() : CSG_Data_Manager
  • CSG_Data_Object() : CSG_Data_Object
  • CSG_DateTime() : CSG_DateTime
  • CSG_Distance_Weighting() : CSG_Distance_Weighting
  • CSG_File() : CSG_File
  • CSG_File_Zip() : CSG_File_Zip
  • CSG_Formula() : CSG_Formula
  • CSG_Grid() : CSG_Grid
  • CSG_Grid_Cell_Addressor() : CSG_Grid_Cell_Addressor
  • CSG_Grid_Collection() : CSG_Grid_Collection
  • CSG_Grid_File_Info() : CSG_Grid_File_Info
  • CSG_Grid_OGIS_Converter() : CSG_Grid_OGIS_Converter
  • CSG_Grid_Pyramid() : CSG_Grid_Pyramid
  • CSG_Grid_Radius() : CSG_Grid_Radius
  • CSG_Grid_Stack() : CSG_Grid_Stack
  • CSG_Grid_System() : CSG_Grid_System
  • CSG_Grids() : CSG_Grids
  • CSG_Histogram() : CSG_Histogram
  • CSG_HTTP() : CSG_HTTP
  • CSG_Index() : CSG_Index
  • CSG_Index_Compare() : CSG_Index::CSG_Index_Compare
  • CSG_KDTree() : CSG_KDTree
  • CSG_KDTree_2D() : CSG_KDTree_2D
  • CSG_KDTree_3D() : CSG_KDTree_3D
  • CSG_Lines() : CSG_Lines
  • CSG_Matrix() : CSG_Matrix
  • CSG_MetaData() : CSG_MetaData
  • CSG_Natural_Breaks() : CSG_Natural_Breaks
  • CSG_Parameter() : CSG_Parameter
  • CSG_Parameter_Bool() : CSG_Parameter_Bool
  • CSG_Parameter_Choice() : CSG_Parameter_Choice
  • CSG_Parameter_Choices() : CSG_Parameter_Choices
  • CSG_Parameter_Color() : CSG_Parameter_Color
  • CSG_Parameter_Colors() : CSG_Parameter_Colors
  • CSG_Parameter_Data_Object() : CSG_Parameter_Data_Object
  • CSG_Parameter_Data_Object_Output() : CSG_Parameter_Data_Object_Output
  • CSG_Parameter_Data_Type() : CSG_Parameter_Data_Type
  • CSG_Parameter_Date() : CSG_Parameter_Date
  • CSG_Parameter_Degree() : CSG_Parameter_Degree
  • CSG_Parameter_Double() : CSG_Parameter_Double
  • CSG_Parameter_File_Name() : CSG_Parameter_File_Name
  • CSG_Parameter_Fixed_Table() : CSG_Parameter_Fixed_Table
  • CSG_Parameter_Font() : CSG_Parameter_Font
  • CSG_Parameter_Grid() : CSG_Parameter_Grid
  • CSG_Parameter_Grid_List() : CSG_Parameter_Grid_List
  • CSG_Parameter_Grid_System() : CSG_Parameter_Grid_System
  • CSG_Parameter_Grids() : CSG_Parameter_Grids
  • CSG_Parameter_Grids_List() : CSG_Parameter_Grids_List
  • CSG_Parameter_Int() : CSG_Parameter_Int
  • CSG_Parameter_List() : CSG_Parameter_List
  • CSG_Parameter_Node() : CSG_Parameter_Node
  • CSG_Parameter_Parameters() : CSG_Parameter_Parameters
  • CSG_Parameter_PointCloud() : CSG_Parameter_PointCloud
  • CSG_Parameter_PointCloud_List() : CSG_Parameter_PointCloud_List
  • CSG_Parameter_Range() : CSG_Parameter_Range
  • CSG_Parameter_Shapes() : CSG_Parameter_Shapes
  • CSG_Parameter_Shapes_List() : CSG_Parameter_Shapes_List
  • CSG_Parameter_String() : CSG_Parameter_String
  • CSG_Parameter_Table() : CSG_Parameter_Table
  • CSG_Parameter_Table_Field() : CSG_Parameter_Table_Field
  • CSG_Parameter_Table_Fields() : CSG_Parameter_Table_Fields
  • CSG_Parameter_Table_List() : CSG_Parameter_Table_List
  • CSG_Parameter_Text() : CSG_Parameter_Text
  • CSG_Parameter_TIN() : CSG_Parameter_TIN
  • CSG_Parameter_TIN_List() : CSG_Parameter_TIN_List
  • CSG_Parameter_Value() : CSG_Parameter_Value
  • CSG_Parameters() : CSG_Parameters
  • CSG_Parameters_Grid_Target() : CSG_Parameters_Grid_Target
  • CSG_Parameters_Point_Search() : CSG_Parameters_Point_Search
  • CSG_Parameters_Point_Search_KDTree_2D() : CSG_Parameters_Point_Search_KDTree_2D
  • CSG_Point() : CSG_Point
  • CSG_Point_3D() : CSG_Point_3D
  • CSG_Point_4D() : CSG_Point_4D
  • CSG_PointCloud() : CSG_PointCloud
  • CSG_Points() : CSG_Points
  • CSG_Points_3D() : CSG_Points_3D
  • CSG_Points_Int() : CSG_Points_Int
  • CSG_PriorityQueue() : CSG_PriorityQueue
  • CSG_PriorityQueueItem() : CSG_PriorityQueue::CSG_PriorityQueueItem
  • CSG_Projection() : CSG_Projection
  • CSG_Projections() : CSG_Projections
  • CSG_PRQuadTree() : CSG_PRQuadTree
  • CSG_PRQuadTree_Item() : CSG_PRQuadTree_Item
  • CSG_PRQuadTree_Leaf() : CSG_PRQuadTree_Leaf
  • CSG_PRQuadTree_Leaf_List() : CSG_PRQuadTree_Leaf_List
  • CSG_PRQuadTree_Node() : CSG_PRQuadTree_Node
  • CSG_PRQuadTree_Node_Statistics() : CSG_PRQuadTree_Node_Statistics
  • CSG_Random() : CSG_Random
  • CSG_Rect() : CSG_Rect
  • CSG_Rect_Int() : CSG_Rect_Int
  • CSG_Rects() : CSG_Rects
  • CSG_Rects_Int() : CSG_Rects_Int
  • CSG_Regression() : CSG_Regression
  • CSG_Regression_Multiple() : CSG_Regression_Multiple
  • CSG_Regression_Weighted() : CSG_Regression_Weighted
  • CSG_Shape() : CSG_Shape
  • CSG_Shape_Line() : CSG_Shape_Line
  • CSG_Shape_Part() : CSG_Shape_Part
  • CSG_Shape_Point() : CSG_Shape_Point
  • CSG_Shape_Point_Z() : CSG_Shape_Point_Z
  • CSG_Shape_Point_ZM() : CSG_Shape_Point_ZM
  • CSG_Shape_Points() : CSG_Shape_Points
  • CSG_Shape_Polygon() : CSG_Shape_Polygon
  • CSG_Shape_Polygon_Part() : CSG_Shape_Polygon_Part
  • CSG_Shapes() : CSG_Shapes
  • CSG_Shapes_OGIS_Converter() : CSG_Shapes_OGIS_Converter
  • CSG_Simple_Statistics() : CSG_Simple_Statistics
  • CSG_Spline() : CSG_Spline
  • CSG_Stack() : CSG_Stack
  • CSG_String() : CSG_String
  • CSG_String_Tokenizer() : CSG_String_Tokenizer
  • CSG_Strings() : CSG_Strings
  • CSG_Table() : CSG_Table
  • CSG_Table_DBase() : CSG_Table_DBase
  • CSG_Table_Record() : CSG_Table_Record
  • CSG_Table_Value() : CSG_Table_Value
  • CSG_Table_Value_Binary() : CSG_Table_Value_Binary
  • CSG_Table_Value_Date() : CSG_Table_Value_Date
  • CSG_Table_Value_Double() : CSG_Table_Value_Double
  • CSG_Table_Value_Int() : CSG_Table_Value_Int
  • CSG_Table_Value_Long() : CSG_Table_Value_Long
  • CSG_Table_Value_String() : CSG_Table_Value_String
  • CSG_Thin_Plate_Spline() : CSG_Thin_Plate_Spline
  • CSG_TimeSpan() : CSG_TimeSpan
  • CSG_TIN() : CSG_TIN
  • CSG_Tool() : CSG_Tool
  • CSG_Tool_Chain() : CSG_Tool_Chain
  • CSG_Tool_Chains() : CSG_Tool_Chains
  • CSG_Tool_Grid() : CSG_Tool_Grid
  • CSG_Tool_Grid_Interactive() : CSG_Tool_Grid_Interactive
  • CSG_Tool_Interactive() : CSG_Tool_Interactive
  • CSG_Tool_Interactive_Base() : CSG_Tool_Interactive_Base
  • CSG_Tool_Library() : CSG_Tool_Library
  • CSG_Tool_Library_Interface() : CSG_Tool_Library_Interface
  • CSG_Tool_Library_Manager() : CSG_Tool_Library_Manager
  • CSG_Translator() : CSG_Translator
  • CSG_Trend() : CSG_Trend
  • CSG_Trend_Polynom() : CSG_Trend_Polynom
  • CSG_UI_Parameter() : CSG_UI_Parameter
  • CSG_Unique_Number_Statistics() : CSG_Unique_Number_Statistics
  • CSG_Unique_String_Statistics() : CSG_Unique_String_Statistics
  • CSG_Unique_Value_Statistics() : CSG_Unique_Value_Statistics
  • CSG_Vector() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- d -

  • DataObject_Add() : CSG_Tool
  • DataObject_Get_Colors() : CSG_Tool
  • DataObject_Get_Parameter() : CSG_Tool
  • DataObject_Get_Parameters() : CSG_Tool
  • DataObject_Set_Colors() : CSG_Tool
  • DataObject_Set_History() : CSG_Tool
  • DataObject_Set_Parameter() : CSG_Tool
  • DataObject_Set_Parameters() : CSG_Tool
  • DataObject_Update() : CSG_Tool
  • DataObject_Update_All() : CSG_Tool
  • DataObjects_Check() : CSG_Parameters
  • Day() : CSG_TimeSpan
  • Days() : CSG_TimeSpan
  • Dec_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Deflate() : CSG_Rect , CSG_Rect_Int
  • Del() : CSG_Array_Pointer , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Strings
  • Del_Attribute() : CSG_Grids
  • Del_Child() : CSG_MetaData
  • Del_Children() : CSG_MetaData
  • Del_Col() : CSG_Matrix
  • Del_Cols() : CSG_Matrix
  • Del_Entry() : CSG_Array , CSG_Index
  • Del_Field() : CSG_PointCloud , CSG_Table
  • Del_Grid() : CSG_Grids
  • Del_Grids() : CSG_Grids
  • Del_Index() : CSG_Table
  • Del_Item() : CSG_Parameter_Grid_List , CSG_Parameter_List
  • Del_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Grid_List , CSG_Parameter_List
  • Del_Library() : CSG_Tool_Library_Manager
  • Del_Node() : CSG_TIN
  • Del_Parameter() : CSG_Parameters
  • Del_Parameters() : CSG_Parameters
  • Del_Part() : CSG_Shape , CSG_Shape_Points
  • Del_Parts() : CSG_Shape , CSG_Shape_Points
  • Del_Point() : CSG_PointCloud , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points
  • Del_Points() : CSG_PointCloud
  • Del_Property() : CSG_MetaData
  • Del_Record() : CSG_PointCloud , CSG_Table
  • Del_Records() : CSG_PointCloud , CSG_Table
  • Del_References() : CSG_Parameters , CSG_Tool_Library
  • Del_Row() : CSG_Matrix , CSG_Vector
  • Del_Rows() : CSG_Matrix , CSG_Vector
  • Del_Selection() : CSG_PointCloud , CSG_Table
  • Del_Shape() : CSG_PointCloud , CSG_Shapes
  • Del_Shapes() : CSG_PointCloud , CSG_Shapes
  • Delete() : CSG_Data_Collection , CSG_Data_Manager , CSG_Data_Object
  • Delete_All() : CSG_Data_Collection , CSG_Data_Manager
  • Delete_Manager() : CSG_Tool
  • Delete_Tool() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • Delete_Tools() : CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface
  • Delete_Unsaved() : CSG_Data_Collection , CSG_Data_Manager
  • DeNormalise() : CSG_Grid
  • DeStandardise() : CSG_Grid
  • Destroy() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Bytes_Array , CSG_Category_Statistics , CSG_Classifier_Supervised , CSG_Cluster_Analysis , CSG_Colors , CSG_Data_Object , CSG_Formula , CSG_Grid , CSG_Grid_Cell_Addressor , CSG_Grid_Pyramid , CSG_Grid_Radius , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_HTTP , CSG_Index , CSG_KDTree , CSG_KDTree_2D , CSG_KDTree_3D , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_PointCloud , CSG_PriorityQueue , CSG_Projection , CSG_Projections , CSG_PRQuadTree , CSG_Regression , CSG_Regression_Multiple , CSG_Regression_Weighted , CSG_Shape , CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes , CSG_Spline , CSG_Stack , CSG_Strings , CSG_Table , CSG_Thin_Plate_Spline , CSG_TIN , CSG_Tool , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager , CSG_Translator , CSG_Trend_Polynom , CSG_Vector
  • Divide() : CSG_Grid , CSG_Grids , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • Dlg_Parameters() : CSG_Tool
  • do_Sync_Projections() : CSG_Tool , CSG_Tool_Chain
  • Do_Use_All() : CSG_Parameters_Point_Search
  • do_UseInCMD() : CSG_Parameter
  • do_UseInGUI() : CSG_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- e -

  • Enable_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • end() : CSG_Vector
  • EPSG_to_Proj4() : CSG_Projections
  • EPSG_to_WKT() : CSG_Projections
  • Error_Fmt() : CSG_Tool
  • Error_Set() : CSG_Tool
  • Evaluate() : CSG_Simple_Statistics
  • Execute() : CSG_Cluster_Analysis , CSG_Tool
  • Execute_Finish() : CSG_Tool_Interactive_Base
  • Execute_Keyboard() : CSG_Tool_Interactive_Base
  • Execute_Position() : CSG_Tool_Interactive_Base
  • Exists() : CSG_Data_Collection , CSG_Data_Manager , CSG_Grid_Collection
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- f -

  • Finalize() : CSG_Parameters_Point_Search_KDTree_2D
  • Find() : CSG_Data_Manager , CSG_String
  • Find_Field() : CSG_Table
  • Find_Record() : CSG_Table
  • Fit_to_Grid_System() : CSG_Grid_System
  • Fit_xto_Grid_System() : CSG_Grid_System
  • Fit_yto_Grid_System() : CSG_Grid_System
  • Flip() : CSG_Grid
  • Flip_Values() : CSG_Vector
  • Flush_Record() : CSG_Table_DBase
  • Fmt_Content() : CSG_MetaData
  • Fmt_Name() : CSG_Data_Object
  • Format() : CSG_DateTime , CSG_String , CSG_TimeSpan
  • Format_Date() : CSG_DateTime
  • Format_ISOCombined() : CSG_DateTime
  • Format_ISODate() : CSG_DateTime
  • Format_ISOTime() : CSG_DateTime
  • Format_Time() : CSG_DateTime
  • from_JSON() : CSG_MetaData
  • from_ShapeType() : CSG_Shapes_OGIS_Converter
  • from_String() : CSG_Matrix , CSG_Vector
  • from_Text() : CSG_Colors
  • From_UTC() : CSG_DateTime
  • from_UTF8() : CSG_String
  • from_WKBinary() : CSG_Grid_OGIS_Converter , CSG_Shapes_OGIS_Converter
  • from_WKT() : CSG_MetaData
  • from_WKText() : CSG_Shapes_OGIS_Converter
  • from_XML() : CSG_MetaData
  • fromHexString() : CSG_Bytes
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- g -

  • Get() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Data_Collection
  • Get_Angle() : CSG_Vector
  • Get_Area() : CSG_Rect , CSG_Rect_Int , CSG_Shape_Polygon , CSG_Shape_Polygon_Part , CSG_TIN_Triangle
  • Get_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Get_Attribute() : CSG_PointCloud
  • Get_Attribute_Count() : CSG_PointCloud
  • Get_Attribute_Name() : CSG_PointCloud
  • Get_Attribute_Type() : CSG_PointCloud
  • Get_Attributes() : CSG_Grids
  • Get_Attributes_Ptr() : CSG_Grids
  • Get_Author() : CSG_Tool , CSG_Tool_Library
  • Get_Authority() : CSG_Projection
  • Get_Authority_ID() : CSG_Projection
  • Get_BandWidth() : CSG_Distance_Weighting
  • Get_Binary() : CSG_Table_Value_Binary
  • Get_Blue() : CSG_Colors
  • Get_BottomRight() : CSG_Rect , CSG_Rect_Int
  • Get_Break() : CSG_Histogram , CSG_Natural_Breaks
  • Get_Brightness() : CSG_Colors
  • Get_Byte() : CSG_Bytes
  • Get_Bytes() : CSG_Bytes , CSG_Bytes_Array
  • Get_Category() : CSG_Category_Statistics , CSG_Tool_Library
  • Get_Category_Type() : CSG_Category_Statistics
  • Get_Cellarea() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_Cellsize() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_Center() : CSG_Histogram , CSG_Rect
  • Get_Centroid() : CSG_Cluster_Analysis , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Char() : CSG_String
  • Get_Child() : CSG_MetaData , CSG_Parameter , CSG_PRQuadTree_Node
  • Get_Children_Count() : CSG_MetaData , CSG_Parameter
  • Get_ChiSquare() : CSG_Trend
  • Get_Choices() : CSG_Parameter_Table_Field
  • Get_CircumCircle() : CSG_TIN_Triangle
  • Get_CircumCircle_Point() : CSG_TIN_Triangle
  • Get_CircumCircle_Radius() : CSG_TIN_Triangle
  • Get_Class() : CSG_Classifier_Supervised , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Class_Count() : CSG_Classifier_Supervised , CSG_Histogram
  • Get_Class_ID() : CSG_Classifier_Supervised
  • Get_Class_Index() : CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Class_Maximum() : CSG_Classifier_Supervised
  • Get_Class_Mean() : CSG_Classifier_Supervised
  • Get_Class_Minimum() : CSG_Classifier_Supervised
  • Get_Cluster() : CSG_Cluster_Analysis
  • Get_Coefficient() : CSG_Regression , CSG_Trend_Polynom
  • Get_Col() : CSG_Matrix
  • Get_Color() : CSG_Colors
  • Get_Constant() : CSG_Regression
  • Get_Content() : CSG_MetaData
  • Get_Count() : CSG_Bytes , CSG_Bytes_Array , CSG_Category_Statistics , CSG_Colors , CSG_Grid_Cell_Addressor , CSG_Grid_Pyramid , CSG_Index , CSG_Lines , CSG_Natural_Breaks , CSG_Parameter_Choice , CSG_Parameter_Table_Fields , CSG_Parameters , CSG_Parameters_Point_Search_KDTree_2D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projections , CSG_PRQuadTree_Leaf_List , CSG_Rects , CSG_Rects_Int , CSG_Regression , CSG_Shape_Part , CSG_Simple_Statistics , CSG_Spline , CSG_Strings , CSG_Table , CSG_Table_DBase , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager , CSG_Translator , CSG_Unique_Value_Statistics
  • Get_Cross_Product() : CSG_Vector
  • Get_CrossValidation() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_Cumulative() : CSG_Histogram
  • Get_Current_Day() : CSG_DateTime
  • Get_Current_Month() : CSG_DateTime
  • Get_Current_Year() : CSG_DateTime
  • Get_CV_NRMSE() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_nSamples() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_R2() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_CV_RMSE() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_Data() : CSG_Buffer , CSG_Matrix , CSG_Parameter_Choice , CSG_Vector
  • Get_Data_Count() : CSG_Grid , CSG_Grids , CSG_Trend , CSG_Trend_Polynom
  • Get_Data_Type() : CSG_Parameter_Data_Type
  • Get_Data_X() : CSG_Trend , CSG_Trend_Polynom
  • Get_Data_XMax() : CSG_Trend
  • Get_Data_XMin() : CSG_Trend
  • Get_Data_XStats() : CSG_Trend
  • Get_Data_Y() : CSG_Trend , CSG_Trend_Polynom
  • Get_Data_YMax() : CSG_Trend
  • Get_Data_YMin() : CSG_Trend
  • Get_Data_YStats() : CSG_Trend
  • Get_DataObject_Type() : CSG_Parameter , CSG_Parameter_Data_Object_Output
  • Get_Date() : CSG_Parameter_Date
  • Get_Day() : CSG_DateTime
  • Get_DayOfYear() : CSG_DateTime
  • Get_Days() : CSG_TimeSpan
  • Get_Default() : CSG_Parameter
  • Get_DegFreedom() : CSG_Regression_Multiple
  • Get_Description() : CSG_Data_Object , CSG_Parameter , CSG_Parameters , CSG_Projection , CSG_Tool , CSG_Tool_Library
  • Get_Determinant() : CSG_Matrix
  • Get_Diameter() : CSG_Rect , CSG_Rect_Int
  • Get_Direction() : CSG_Grid_Cell_Addressor
  • Get_Distance() : CSG_Grid_Cell_Addressor , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Drag_Mode() : CSG_Tool_Interactive_Base
  • Get_Duplicates() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Edge() : CSG_TIN
  • Get_Edge_Count() : CSG_TIN
  • Get_Element_Count() : CSG_Histogram
  • Get_Element_Maximum() : CSG_Histogram
  • Get_Elements() : CSG_Histogram
  • Get_Encoding() : CSG_File
  • Get_EnglishMonthName() : CSG_DateTime
  • Get_EnglishWeekDayName() : CSG_DateTime
  • Get_Entry() : CSG_Array
  • Get_EPSG() : CSG_Projection
  • Get_Error() : CSG_Formula , CSG_Trend
  • Get_Execution_Info() : CSG_Tool
  • Get_Extent() : CSG_Data_Object , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_PRQuadTree_Item , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Shapes , CSG_Table , CSG_TIN , CSG_TIN_Triangle
  • Get_F() : CSG_Regression_Multiple
  • Get_F_Inverse() : CSG_Test_Distribution
  • Get_F_Tail() : CSG_Test_Distribution
  • Get_F_Tail_from_R2() : CSG_Test_Distribution
  • Get_Feature_Count() : CSG_Classifier_Supervised
  • Get_Field() : CSG_Table
  • Get_Field_Count() : CSG_Table , CSG_Table_DBase
  • Get_Field_Decimals() : CSG_Table_DBase
  • Get_Field_Length() : CSG_Table
  • Get_Field_Name() : CSG_Table , CSG_Table_DBase
  • Get_Field_Type() : CSG_Table , CSG_Table_DBase
  • Get_Field_Width() : CSG_Table_DBase
  • Get_File() : CSG_File_Zip
  • Get_File_Count() : CSG_File_Zip
  • Get_File_Encoding() : CSG_Table
  • Get_File_Length() : CSG_Table_DBase
  • Get_File_Name() : CSG_Data_Object , CSG_File , CSG_File_Zip , CSG_Tool , CSG_Tool_Chains , CSG_Tool_Library
  • Get_File_Position() : CSG_Table_DBase
  • Get_File_Type() : CSG_Data_Object , CSG_File , CSG_File_Zip
  • Get_FilePaths() : CSG_Parameter_File_Name
  • Get_Filter() : CSG_Parameter_File_Name
  • Get_Formula() : CSG_Formula , CSG_Trend
  • Get_Gaussian() : CSG_Random
  • Get_GCS_WGS84() : CSG_Projections
  • Get_Gini() : CSG_Simple_Statistics
  • Get_Gradient() : CSG_Grid , CSG_TIN_Node , CSG_TIN_Triangle
  • Get_Gradient_NeighborDir() : CSG_Grid
  • Get_Green() : CSG_Colors
  • Get_Grid() : CSG_Grid_Pyramid , CSG_Grids , CSG_Parameter_Grid_List , CSG_Parameters_Grid_Target
  • Get_Grid_Count() : CSG_Grids , CSG_Parameter_Grid_List
  • Get_Grid_Name() : CSG_Grids
  • Get_Grid_Pos() : CSG_Tool_Grid_Interactive
  • Get_Grid_Ptr() : CSG_Grids
  • Get_Grid_System() : CSG_Data_Manager , CSG_Parameters , CSG_Tool
  • Get_Grid_System_Parameter() : CSG_Parameters
  • Get_Grid_to_World() : CSG_Grid_System
  • Get_Grids() : CSG_Parameter_Grids_List , CSG_Parameters_Grid_Target
  • Get_Growth() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Get_Header_Content() : CSG_PointCloud
  • Get_Help_Operators() : CSG_Formula
  • Get_Histogram() : CSG_Grid , CSG_Grids
  • Get_History() : CSG_Data_Object
  • Get_Hour() : CSG_DateTime
  • Get_Hours() : CSG_TimeSpan
  • Get_Icon() : CSG_Tool
  • Get_ID() : CSG_Regression_Multiple , CSG_TIN_Node , CSG_Tool
  • Get_Identifier() : CSG_Parameter , CSG_Parameters
  • Get_IDW_Offset() : CSG_Distance_Weighting
  • Get_IDW_Power() : CSG_Distance_Weighting
  • Get_Index() : CSG_Index , CSG_Parameter_Table_Fields , CSG_Table , CSG_Table_Record
  • Get_Index_Field() : CSG_Table
  • Get_Index_Order() : CSG_Table
  • Get_IndexFromRowCol() : CSG_Grid_System
  • Get_IndexOfMaximum() : CSG_Simple_Statistics
  • Get_IndexOfMinimum() : CSG_Simple_Statistics
  • Get_Info() : CSG_Regression_Multiple , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface
  • Get_Info_Model() : CSG_Regression_Multiple
  • Get_Info_Regression() : CSG_Regression_Multiple
  • Get_Info_Steps() : CSG_Regression_Multiple
  • Get_Interpolated() : CSG_Colors
  • Get_Inverse() : CSG_Matrix
  • Get_Item() : CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_List , CSG_PriorityQueue
  • Get_Item_Count() : CSG_Parameter_Choices , CSG_Parameter_List
  • Get_Item_Data() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Get_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Get_Iteration() : CSG_Cluster_Analysis
  • Get_JDN() : CSG_DateTime
  • Get_Kurtosis() : CSG_Simple_Statistics
  • Get_Last_Delimiter() : CSG_String_Tokenizer
  • Get_Length() : CSG_Grid_System , CSG_Lines , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Shape_Line , CSG_Tool_Grid , CSG_Vector
  • Get_Library() : CSG_Tool , CSG_Tool_Library_Manager
  • Get_Library_Name() : CSG_Tool_Chain , CSG_Tool_Library
  • Get_Line() : CSG_Lines
  • Get_Log_Difference() : CSG_Regression_Weighted
  • Get_Log_Epsilon() : CSG_Regression_Weighted
  • Get_Log_maxIter() : CSG_Regression_Weighted
  • Get_M() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points
  • Get_Majority() : CSG_Category_Statistics , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics
  • Get_Manager() : CSG_Parameter , CSG_Parameters , CSG_Tool
  • Get_Match_Count() : CSG_KDTree
  • Get_Match_Distance() : CSG_KDTree
  • Get_Match_Index() : CSG_KDTree
  • Get_Match_Shape() : CSG_KDTree
  • Get_Max() : CSG_Grid , CSG_Grids , CSG_Parameter_Range
  • Get_Max_Iterations() : CSG_Trend
  • Get_Max_Lambda() : CSG_Trend
  • Get_Max_Parameter() : CSG_Parameter_Range
  • Get_Max_Points() : CSG_Parameters_Point_Search
  • Get_Max_Samples() : CSG_Data_Object
  • Get_Maximum() : CSG_Grid_Radius , CSG_Parameter_Value , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Mean() : CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Median() : CSG_Simple_Statistics
  • Get_Memory_Size() : CSG_Grid , CSG_Grids
  • Get_Memory_Size_MB() : CSG_Grid
  • Get_Menu() : CSG_Tool_Library
  • Get_MenuPath() : CSG_Tool , CSG_Tool_Chain
  • Get_MetaData() : CSG_Data_Object
  • Get_MetaData_DB() : CSG_Data_Object
  • Get_Millisecond() : CSG_DateTime
  • Get_Milliseconds() : CSG_TimeSpan
  • Get_Min() : CSG_Grid , CSG_Grids , CSG_Parameter_Range
  • Get_Min_Parameter() : CSG_Parameter_Range
  • Get_Min_Points() : CSG_Parameters_Point_Search
  • Get_Minimum() : CSG_Parameter_Value , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Minority() : CSG_Category_Statistics , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Unique_Value_Statistics
  • Get_Minute() : CSG_DateTime
  • Get_Minutes() : CSG_TimeSpan
  • Get_MJD() : CSG_DateTime
  • Get_MMax() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shapes
  • Get_MMin() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shapes
  • Get_Model() : CSG_Regression_Multiple
  • Get_Model_Backward() : CSG_Regression_Multiple
  • Get_Model_Forward() : CSG_Regression_Multiple
  • Get_Model_Stepwise() : CSG_Regression_Multiple
  • Get_Month() : CSG_DateTime
  • Get_Month_Choices() : CSG_DateTime
  • Get_MonthName() : CSG_DateTime
  • Get_N() : CSG_Table , CSG_Vector
  • Get_Name() : CSG_Data_Object , CSG_Grid_System , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Projection , CSG_Regression_Multiple , CSG_Tool , CSG_Tool_Library
  • Get_Name_of_Method() : CSG_Classifier_Supervised
  • Get_Name_of_Quality() : CSG_Classifier_Supervised
  • Get_Names_List() : CSG_Projections
  • Get_NCells() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • Get_nClusters() : CSG_Cluster_Analysis
  • Get_nCoefficients() : CSG_Trend_Polynom
  • Get_NCols() : CSG_Matrix
  • Get_Nearest_Leaf() : CSG_PRQuadTree
  • Get_Nearest_Point() : CSG_KDTree_2D , CSG_KDTree_3D , CSG_PRQuadTree
  • Get_Nearest_Points() : CSG_KDTree_2D , CSG_KDTree_3D , CSG_PRQuadTree
  • Get_Nearest_Shape() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Nearest_Value() : CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Neighbor() : CSG_TIN_Node
  • Get_Neighbor_Count() : CSG_TIN_Node
  • Get_Neighbor_Pos() : CSG_Grid_System
  • Get_nElements() : CSG_Cluster_Analysis
  • Get_Next_Token() : CSG_String_Tokenizer
  • Get_nFeatures() : CSG_Cluster_Analysis
  • Get_nLineBytes() : CSG_Grid , CSG_Grids
  • Get_nMembers() : CSG_Cluster_Analysis
  • Get_NoData_Count() : CSG_Grid , CSG_Grids
  • Get_NoData_Value() : CSG_Data_Object
  • Get_Node() : CSG_TIN , CSG_TIN_Edge , CSG_TIN_Triangle
  • Get_Node_Count() : CSG_TIN
  • Get_Norm_P() : CSG_Test_Distribution
  • Get_Norm_Z() : CSG_Test_Distribution
  • Get_nPoints() : CSG_Grid_Radius
  • Get_nPredictors() : CSG_Regression_Multiple
  • Get_NRows() : CSG_Matrix
  • Get_nSamples() : CSG_Regression_Multiple
  • Get_NumberOfDays() : CSG_DateTime
  • Get_nValueBytes() : CSG_Grid , CSG_Grids
  • Get_nValues_Above() : CSG_Simple_Statistics
  • Get_nValues_Below() : CSG_Simple_Statistics
  • Get_NX() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Matrix , CSG_Tool_Grid
  • Get_NY() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Matrix , CSG_Tool_Grid
  • Get_NZ() : CSG_Grids
  • Get_ObjectType() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • Get_Offset() : CSG_Grid , CSG_Grids
  • Get_Order() : CSG_Trend_Polynom
  • Get_Owner() : CSG_Data_Object , CSG_Parameters , CSG_Shape_Part
  • Get_P() : CSG_Regression , CSG_Regression_Multiple
  • Get_Parameter() : CSG_Parameters , CSG_Regression_Multiple , CSG_Tool
  • Get_Parameter_Changed() : CSG_Tool
  • Get_Parameter_Count() : CSG_Trend
  • Get_Parameters() : CSG_Parameter , CSG_Tool , CSG_Trend
  • Get_Parameters_Count() : CSG_Tool
  • Get_Parent() : CSG_MetaData , CSG_Parameter
  • Get_Part() : CSG_Shape , CSG_Shape_Points
  • Get_Part_Count() : CSG_Shape , CSG_Shape_Point , CSG_Shape_Points
  • Get_Percentile() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Simple_Statistics
  • Get_Percentile_Value() : CSG_Histogram
  • Get_Perimeter() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Point() : CSG_Grid_Radius , CSG_KDTree , CSG_Parameters_Point_Search_KDTree_2D , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_TIN_Node
  • Get_Point_Cloud() : CSG_Data_Manager
  • Get_Point_Count() : CSG_KDTree , CSG_PRQuadTree , CSG_Shape , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Get_Point_Relation() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Point_Value() : CSG_KDTree , CSG_KDTree_2D , CSG_KDTree_3D
  • Get_Point_Z() : CSG_Shape , CSG_Shape_Part
  • Get_Point_ZM() : CSG_Shape , CSG_Shape_Part
  • Get_PointCloud() : CSG_Parameter_PointCloud_List
  • Get_Points() : CSG_Parameters_Point_Search_KDTree_2D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Thin_Plate_Spline
  • Get_Polygon() : CSG_TIN_Node
  • Get_Polygon_Area() : CSG_TIN_Node
  • Get_Polygon_Part() : CSG_Shape_Polygon
  • Get_Position() : CSG_String_Tokenizer , CSG_Tool_Interactive_Base
  • Get_Position_Last() : CSG_Tool_Interactive_Base
  • Get_Precision() : CSG_Grid_System
  • Get_Predefined_Count() : CSG_Colors
  • Get_Predefined_Name() : CSG_Colors
  • Get_Predictor() : CSG_Regression_Multiple
  • Get_Predictor_Count() : CSG_Regression_Weighted
  • Get_Preferred_Type() : CSG_Parameter_Grid
  • Get_Probability_Relative() : CSG_Classifier_Supervised
  • Get_Proj4() : CSG_Projection
  • Get_Projection() : CSG_Data_Object , CSG_Projections , CSG_Tool , CSG_Tool_Interactive_Base
  • Get_Property() : CSG_MetaData
  • Get_Property_Count() : CSG_MetaData
  • Get_Property_Name() : CSG_MetaData
  • Get_Quadrant() : CSG_PRQuadTree_Item
  • Get_Quantile() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Simple_Statistics
  • Get_Quantile_Value() : CSG_Histogram
  • Get_R() : CSG_Regression
  • Get_R2() : CSG_Regression , CSG_Regression_Multiple , CSG_Regression_Weighted , CSG_Trend , CSG_Trend_Polynom
  • Get_R2_Adj() : CSG_Regression , CSG_Regression_Multiple
  • Get_R2_Partial() : CSG_Regression_Multiple
  • Get_R2_Partial_Adj() : CSG_Regression_Multiple
  • Get_Radius() : CSG_Grid_Cell_Addressor , CSG_Parameters_Point_Search
  • Get_Radius_Inner() : CSG_Grid_Cell_Addressor
  • Get_Radius_Outer() : CSG_Grid_Cell_Addressor
  • Get_Range() : CSG_Grid , CSG_Grids , CSG_Parameter_Range , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_RCoeff() : CSG_Regression_Multiple , CSG_Regression_Weighted
  • Get_RConst() : CSG_Regression_Multiple
  • Get_Record() : CSG_PointCloud , CSG_Stack , CSG_Table
  • Get_Record_byIndex() : CSG_Table
  • Get_Record_Pop() : CSG_Stack
  • Get_Record_Push() : CSG_Stack
  • Get_RecordSize() : CSG_Stack
  • Get_Rect() : CSG_Rects , CSG_Rects_Int
  • Get_Red() : CSG_Colors
  • Get_References() : CSG_Parameters , CSG_Tool , CSG_Tool_Library
  • Get_Residual() : CSG_Regression_Multiple
  • Get_Residuals() : CSG_Regression_Multiple
  • Get_Root() : CSG_PRQuadTree
  • Get_Root_Pointer() : CSG_PRQuadTree
  • Get_Row() : CSG_Grid , CSG_Matrix
  • Get_Row_Count() : CSG_Vector
  • Get_RowColFromIndex() : CSG_Grid_System
  • Get_Sample_Count() : CSG_Regression_Weighted
  • Get_Scalar_Product() : CSG_Vector
  • Get_Scaling() : CSG_Grid , CSG_Grids
  • Get_Script() : CSG_Tool , CSG_Tool_Chain
  • Get_Second() : CSG_DateTime
  • Get_Seconds() : CSG_TimeSpan
  • Get_Selected_Count() : CSG_PRQuadTree
  • Get_Selected_Distance() : CSG_PRQuadTree
  • Get_Selected_Leaf() : CSG_PRQuadTree
  • Get_Selected_Point() : CSG_PRQuadTree
  • Get_Selected_Z() : CSG_PRQuadTree
  • Get_Selection() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Shapes , CSG_Table
  • Get_Selection_Count() : CSG_Parameter_Choices , CSG_Table
  • Get_Selection_Data() : CSG_Parameter_Choices
  • Get_Selection_Extent() : CSG_PointCloud , CSG_Shapes
  • Get_Selection_Index() : CSG_Parameter_Choices , CSG_Table
  • Get_Shape() : CSG_PointCloud , CSG_Shapes
  • Get_Shape_byIndex() : CSG_Shapes
  • Get_Shape_Type() : CSG_Parameter_Shapes , CSG_Parameter_Shapes_List
  • Get_Shapes() : CSG_Data_Manager , CSG_Parameter_Shapes_List
  • Get_Shared_Edges() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Shared_Length() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • Get_Size() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_PriorityQueue , CSG_PRQuadTree_Item , CSG_Stack , CSG_Strings , CSG_Vector
  • Get_Skewness() : CSG_Simple_Statistics
  • Get_SkewnessPearson() : CSG_Simple_Statistics
  • Get_Sorted() : CSG_Grid , CSG_Grids
  • Get_SP() : CSG_Cluster_Analysis
  • Get_Statistics() : CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Table
  • Get_StdDev() : CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_StdError() : CSG_Regression , CSG_Regression_Multiple
  • Get_Stream() : CSG_File
  • Get_String() : CSG_Parameters , CSG_String_Tokenizer , CSG_Strings
  • Get_Sum() : CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Sum_Of_Squares() : CSG_Simple_Statistics
  • Get_Summary() : CSG_Data_Manager , CSG_Tool , CSG_Tool_Library , CSG_Tool_Library_Manager
  • Get_System() : CSG_Grid , CSG_Grid_Collection , CSG_Grids , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grids_List , CSG_Parameters_Grid_Target , CSG_Tool_Grid
  • Get_T() : CSG_Regression_Multiple
  • Get_T_Inverse() : CSG_Test_Distribution
  • Get_T_Tail() : CSG_Test_Distribution
  • Get_Table() : CSG_Data_Manager , CSG_MetaData , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Table_Record
  • Get_Text() : CSG_Translator
  • Get_Threshold_Angle() : CSG_Classifier_Supervised
  • Get_Threshold_Distance() : CSG_Classifier_Supervised
  • Get_Threshold_Probability() : CSG_Classifier_Supervised
  • Get_Tokens_Count() : CSG_String_Tokenizer
  • Get_Tolerance() : CSG_Grid_Cell_Addressor
  • Get_Tool() : CSG_Parameters , CSG_Tool_Chains , CSG_Tool_Library , CSG_Tool_Library_Interface , CSG_Tool_Library_Manager
  • Get_Tool_Count() : CSG_Tool_Library_Manager
  • Get_TopLeft() : CSG_Rect , CSG_Rect_Int
  • Get_Translation() : CSG_Translator
  • Get_Transpose() : CSG_Matrix
  • Get_Trend() : CSG_Trend , CSG_Trend_Polynom
  • Get_Triangle() : CSG_TIN , CSG_TIN_Node
  • Get_Triangle_Count() : CSG_TIN , CSG_TIN_Node
  • Get_Type() : CSG_Grid , CSG_Grids , CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object_Output , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grid_System , CSG_Parameter_Grids , CSG_Parameter_Grids_List , CSG_Parameter_Int , CSG_Parameter_Node , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_PointCloud_List , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Parameter_Text , CSG_Parameter_TIN , CSG_Parameter_TIN_List , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Regression , CSG_Shape , CSG_Shapes , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Tool , CSG_Tool_Chain , CSG_Tool_Chains , CSG_Tool_Grid , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive , CSG_Tool_Library
  • Get_Type_Identifier() : CSG_Parameter , CSG_Projection
  • Get_Type_Name() : CSG_Parameter , CSG_Projection
  • Get_Uniform() : CSG_Random
  • Get_Unit() : CSG_Grid , CSG_Grids , CSG_Projection
  • Get_Unit_Identifier() : CSG_Projection
  • Get_Unit_Name() : CSG_Projection
  • Get_Unit_To_Meter() : CSG_Projection
  • Get_UnitLength() : CSG_Grid_System , CSG_Tool_Grid
  • Get_Unity() : CSG_Vector
  • Get_Update_Flag() : CSG_Data_Object
  • Get_Used_Variables() : CSG_Formula
  • Get_uSize() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Vector
  • Get_UTM_WGS84() : CSG_Projections
  • Get_Value() : CSG_DateTime , CSG_Formula , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_PointCloud , CSG_PRQuadTree_Leaf_List , CSG_Regression_Multiple , CSG_Simple_Statistics , CSG_Spline , CSG_Table , CSG_Table_Record , CSG_Thin_Plate_Spline , CSG_TimeSpan , CSG_TIN_Triangle , CSG_Trend , CSG_Trend_Polynom , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics
  • Get_Value_Size() : CSG_Array
  • Get_Values() : CSG_Grid_Cell_Addressor , CSG_Regression , CSG_Simple_Statistics
  • Get_Variance() : CSG_Cluster_Analysis , CSG_Grid , CSG_Grids , CSG_PRQuadTree_Leaf_List , CSG_Simple_Statistics , CSG_Table
  • Get_Version() : CSG_KDTree , CSG_Tool , CSG_Tool_Library
  • Get_Vertex_Type() : CSG_Shape , CSG_Shapes
  • Get_WeekDay() : CSG_DateTime
  • Get_WeekDayName() : CSG_DateTime
  • Get_WeekOfMonth() : CSG_DateTime
  • Get_WeekOfYear() : CSG_DateTime
  • Get_Weeks() : CSG_TimeSpan
  • Get_Weight() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor , CSG_Unique_Value_Statistics
  • Get_Weighting() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • Get_Weights() : CSG_Simple_Statistics
  • Get_With_Intercept() : CSG_Regression_Multiple
  • Get_WKT() : CSG_Projection
  • Get_World_to_Grid() : CSG_Grid_System
  • Get_WTA() : CSG_Classifier_Supervised
  • Get_X() : CSG_Grid_Cell_Addressor , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • Get_x() : CSG_Regression , CSG_Spline
  • Get_X() : CSG_TIN_Node
  • Get_xCenter() : CSG_PRQuadTree_Item
  • Get_XCenter() : CSG_Rect
  • Get_xFrom() : CSG_Grid_System , CSG_Tool_Grid
  • Get_xFromSave() : CSG_Grid_System
  • Get_xGrid() : CSG_Tool_Grid_Interactive
  • Get_xGrid_to_World() : CSG_Grid_System
  • Get_XMax() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_xMax() : CSG_PRQuadTree_Item
  • Get_XMax() : CSG_Rect , CSG_Rect_Int
  • Get_xMax() : CSG_Regression , CSG_Spline
  • Get_XMax() : CSG_Tool_Grid
  • Get_xMean() : CSG_Regression
  • Get_XMin() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_xMin() : CSG_PRQuadTree_Item
  • Get_XMin() : CSG_Rect , CSG_Rect_Int
  • Get_xMin() : CSG_Regression , CSG_Spline
  • Get_XMin() : CSG_Tool_Grid
  • Get_xPosition() : CSG_Tool_Interactive_Base
  • Get_xPosition_Last() : CSG_Tool_Interactive_Base
  • Get_XRange() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Rect , CSG_Rect_Int
  • Get_xTo() : CSG_Grid_System , CSG_Tool_Grid
  • Get_xToSave() : CSG_Grid_System
  • Get_xValue() : CSG_Regression
  • Get_xVariance() : CSG_Regression
  • Get_xWorld_to_Grid() : CSG_Grid_System
  • Get_Y() : CSG_Grid_Cell_Addressor , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • Get_y() : CSG_Regression , CSG_Spline
  • Get_Y() : CSG_TIN_Node
  • Get_yCenter() : CSG_PRQuadTree_Item
  • Get_YCenter() : CSG_Rect
  • Get_Year() : CSG_DateTime
  • Get_yFrom() : CSG_Grid_System , CSG_Tool_Grid
  • Get_yFromSave() : CSG_Grid_System
  • Get_yGrid() : CSG_Tool_Grid_Interactive
  • Get_yGrid_to_World() : CSG_Grid_System
  • Get_YMax() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_yMax() : CSG_PRQuadTree_Item
  • Get_YMax() : CSG_Rect , CSG_Rect_Int
  • Get_yMax() : CSG_Regression
  • Get_YMax() : CSG_Tool_Grid
  • Get_yMean() : CSG_Regression
  • Get_YMin() : CSG_Grid , CSG_Grid_System , CSG_Grids
  • Get_yMin() : CSG_PRQuadTree_Item
  • Get_YMin() : CSG_Rect , CSG_Rect_Int
  • Get_yMin() : CSG_Regression
  • Get_YMin() : CSG_Tool_Grid
  • Get_yPosition() : CSG_Tool_Interactive_Base
  • Get_yPosition_Last() : CSG_Tool_Interactive_Base
  • Get_YRange() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Rect , CSG_Rect_Int
  • Get_yTo() : CSG_Grid_System , CSG_Tool_Grid
  • Get_yToSave() : CSG_Grid_System
  • Get_yValue() : CSG_Regression
  • Get_yVariance() : CSG_Regression
  • Get_yWorld_to_Grid() : CSG_Grid_System
  • Get_Z() : CSG_Grids , CSG_PointCloud , CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points
  • Get_Z_Attribute() : CSG_Grids
  • Get_Z_Name_Field() : CSG_Grids
  • Get_ZMax() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points , CSG_Shapes
  • Get_ZMin() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points , CSG_Shapes
  • Get_ZRange() : CSG_Grids
  • Greyscale() : CSG_Colors
  • Grid_System_Count() : CSG_Data_Manager
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- h -

  • has_Changed() : CSG_Parameter
  • has_GUI() : CSG_Parameters , CSG_Tool
  • has_Maximum() : CSG_Parameter_Value
  • has_Minimum() : CSG_Parameter_Value
  • Has_More_Tokens() : CSG_String_Tokenizer
  • has_Statistics() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Leaf_List , CSG_PRQuadTree_Node_Statistics
  • Hour() : CSG_TimeSpan
  • Hours() : CSG_TimeSpan
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- i -

  • ignore_Projection() : CSG_Parameter
  • Inc_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Inc_Size() : CSG_Buffer
  • Inflate() : CSG_Rect , CSG_Rect_Int
  • Init_Parameter() : CSG_Trend
  • Initialize() : CSG_Parameters_Point_Search_KDTree_2D , CSG_Random
  • Ins() : CSG_Strings
  • Ins_Child() : CSG_MetaData
  • Ins_Col() : CSG_Matrix
  • Ins_Point() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points
  • Ins_Record() : CSG_PointCloud , CSG_Table
  • Ins_Row() : CSG_Matrix
  • Intersect() : CSG_Rect , CSG_Rect_Int
  • Intersects() : CSG_Rect , CSG_Rect_Int , CSG_Shape
  • Inv_Selection() : CSG_PointCloud , CSG_Table
  • Invalidate() : CSG_Simple_Statistics
  • Invert() : CSG_Colors , CSG_Grid
  • is_Alt() : CSG_Tool_Interactive_Base
  • is_Annulus() : CSG_Grid_Cell_Addressor
  • is_Between() : CSG_DateTime
  • is_Cached() : CSG_Grid
  • is_CaseSensitive() : CSG_Translator
  • is_Circle() : CSG_Grid_Cell_Addressor
  • is_Clockwise() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_Collinear() : CSG_Vector
  • is_Compatible() : CSG_Grid , CSG_Grids , CSG_Parameter , CSG_PointCloud , CSG_Table
  • is_Connected() : CSG_HTTP
  • is_Containing() : CSG_TIN_Triangle
  • is_Ctrl() : CSG_Tool_Interactive_Base
  • is_DataObject() : CSG_Parameter
  • is_DataObject_List() : CSG_Parameter
  • is_Default() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Double , CSG_Parameter_Int , CSG_Parameter_Range
  • is_Directory() : CSG_File_Zip , CSG_Parameter_File_Name
  • is_DST() : CSG_DateTime
  • is_EarlierThan() : CSG_DateTime
  • is_Empty() : CSG_PriorityQueue , CSG_String
  • is_Enabled() : CSG_Parameter
  • is_EOF() : CSG_Bytes , CSG_File
  • is_Equal() : CSG_Grid_Collection , CSG_Grid_System , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Vector
  • is_EqualTo() : CSG_DateTime , CSG_TimeSpan
  • is_Evaluated() : CSG_Simple_Statistics
  • is_Executing() : CSG_Tool
  • is_File_Native() : CSG_Data_Object
  • is_Geocentric() : CSG_Projection
  • is_Geographic() : CSG_Projection
  • is_Grid() : CSG_Tool , CSG_Tool_Grid
  • is_Indexed() : CSG_Table
  • is_Information() : CSG_Parameter
  • is_InGrid() : CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Tool_Grid
  • is_InGrid_byPos() : CSG_Grid , CSG_Grids
  • is_Input() : CSG_Parameter
  • is_Interactive() : CSG_Tool , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive
  • is_Intersecting() : CSG_Grid , CSG_Grids
  • is_Lake() : CSG_Shape_Polygon
  • is_LaterThan() : CSG_DateTime
  • is_Leaf() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Leaf
  • is_LeapYear() : CSG_DateTime
  • is_Loaded() : CSG_Tool_Library_Manager
  • is_Locked() : CSG_Tool_Grid
  • is_LongerThan() : CSG_TimeSpan
  • is_Managed() : CSG_Parameters
  • is_Modified() : CSG_Data_Object , CSG_Grids , CSG_Table_Record
  • is_Multiple() : CSG_Parameter_File_Name
  • is_Negative() : CSG_TimeSpan
  • is_Neighbour() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_NoData() : CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table_Record , CSG_Table_Value_Binary
  • is_NoData_Value() : CSG_Data_Object
  • is_Node() : CSG_PRQuadTree_Item , CSG_PRQuadTree_Node
  • is_Null() : CSG_TimeSpan , CSG_Vector
  • is_Number() : CSG_String
  • is_Okay() : CSG_Index , CSG_KDTree , CSG_Projection , CSG_PRQuadTree , CSG_Thin_Plate_Spline , CSG_Tool_Chain , CSG_Trend
  • is_OnEdge() : CSG_Shape_Polygon , CSG_Shape_Polygon_Part
  • is_Open() : CSG_File
  • is_Option() : CSG_Parameter
  • is_Optional() : CSG_Parameter
  • is_Output() : CSG_Parameter
  • is_Parameters() : CSG_Parameter
  • is_Password() : CSG_Parameter_String
  • is_Polar() : CSG_PRQuadTree
  • is_Positive() : CSG_TimeSpan
  • is_Progress() : CSG_Tool
  • is_Projection() : CSG_Projection
  • is_Reading() : CSG_File
  • is_Same_As() : CSG_String
  • is_SameDate() : CSG_DateTime
  • is_SameTime() : CSG_DateTime
  • is_Save() : CSG_Parameter_File_Name
  • is_Scaled() : CSG_Grid , CSG_Grids
  • is_Sector() : CSG_Grid_Cell_Addressor
  • is_Selected() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Table , CSG_Table_Record
  • is_Serializable() : CSG_Parameter
  • is_Shift() : CSG_Tool_Interactive_Base
  • is_ShorterThan() : CSG_TimeSpan
  • is_Square() : CSG_Grid_Cell_Addressor , CSG_Matrix
  • is_StrictlyBetween() : CSG_DateTime
  • is_Valid() : CSG_Data_Object , CSG_DateTime , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Parameter , CSG_Parameter_Data_Object , CSG_Parameter_String , CSG_PointCloud , CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon , CSG_Shapes , CSG_Table , CSG_TIN , CSG_Tool_Library
  • is_Value_Equal() : CSG_Parameter
  • is_Writing() : CSG_File
  • isDeleted() : CSG_Table_DBase
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- l -

  • Left() : CSG_String
  • Length() : CSG_File , CSG_String
  • Load() : CSG_Classifier_Supervised , CSG_Colors , CSG_Grids , CSG_MetaData , CSG_Parameters , CSG_Projection , CSG_Table
  • Load_DB() : CSG_Projections
  • Load_Dictionary() : CSG_Projections
  • Load_HTTP() : CSG_MetaData
  • Load_JSON() : CSG_MetaData
  • Load_MetaData() : CSG_Data_Object
  • Lock_Create() : CSG_Tool_Grid
  • Lock_Destroy() : CSG_Tool_Grid
  • Lock_Get() : CSG_Tool_Grid
  • Lock_Set() : CSG_Tool_Grid
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- m -

  • Make_Clean() : CSG_Shapes
  • Make_Lower() : CSG_String
  • Make_Upper() : CSG_String
  • Make_UTC() : CSG_DateTime
  • Maximum() : CSG_PriorityQueue
  • Message_Add() : CSG_Tool
  • Message_Dlg() : CSG_Tool
  • Message_Dlg_Confirm() : CSG_Tool
  • Message_Fmt() : CSG_Tool
  • Mid() : CSG_String
  • Millisecond() : CSG_TimeSpan
  • Milliseconds() : CSG_TimeSpan
  • Minimum() : CSG_PriorityQueue
  • Minute() : CSG_TimeSpan
  • Minutes() : CSG_TimeSpan
  • Mirror() : CSG_Grid
  • Mov_Child() : CSG_MetaData
  • Mov_Field() : CSG_PointCloud , CSG_Table
  • Move() : CSG_Rect , CSG_Rect_Int
  • Move_First() : CSG_Table_DBase
  • Move_Next() : CSG_Table_DBase
  • Msg_String() : CSG_Parameters
  • Mul_Value() : CSG_Grid , CSG_Grids , CSG_Table_Record
  • Multiply() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • Multiply_Cross() : CSG_Vector
  • Multiply_Scalar() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- n -

  • needs_GUI() : CSG_Tool , CSG_Tool_Grid_Interactive , CSG_Tool_Interactive
  • Neg() : CSG_TimeSpan
  • Negate() : CSG_TimeSpan
  • Normalise() : CSG_Grid
  • Now() : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- o -

  • On_After_Execution() : CSG_Tool
  • On_Assign() : CSG_Shape , CSG_Shape_Point , CSG_Shape_Points
  • On_Before_Execution() : CSG_Tool
  • On_Construction() : CSG_File
  • On_Delete() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • On_Execute() : CSG_Tool , CSG_Tool_Chain
  • On_Execute_Finish() : CSG_Tool_Interactive_Base
  • On_Execute_Keyboard() : CSG_Tool_Interactive_Base
  • On_Execute_Position() : CSG_Tool_Interactive_Base
  • On_Intersects() : CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Points , CSG_Shape_Polygon
  • On_NoData_Changed() : CSG_Data_Object , CSG_Table
  • On_Parameter_Changed() : CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_Tool
  • On_Parameters_Enable() : CSG_Parameters_Grid_Target , CSG_Parameters_Point_Search , CSG_Tool , CSG_Tool_Chain
  • On_Reload() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • On_Update() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Shapes , CSG_Table , CSG_TIN
  • Open() : CSG_File , CSG_File_Zip
  • Open_Read() : CSG_Table_DBase
  • Open_Write() : CSG_Table_DBase
  • operator const char *() : CSG_String
  • operator const double *() : CSG_Vector
  • operator const double **() : CSG_Matrix
  • operator const SG_Char *() : CSG_Table_Value
  • operator const wchar_t *() : CSG_String
  • operator double() : CSG_Table_Value
  • operator!() : CSG_TimeSpan
  • operator!=() : CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_TimeSpan , CSG_Vector
  • operator()() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_Vector
  • operator*() : CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator*=() : CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator+() : CSG_Bytes , CSG_DateTime , CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_String , CSG_TimeSpan , CSG_Vector
  • operator+=() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Category_Statistics , CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Histogram , CSG_Matrix , CSG_MetaData , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Rect , CSG_Rect_Int , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_TimeSpan , CSG_Unique_Number_Statistics , CSG_Unique_String_Statistics , CSG_Vector
  • operator-() : CSG_DateTime , CSG_Grid , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
  • operator-=() : CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Rect , CSG_Rect_Int , CSG_TimeSpan , CSG_Vector
  • operator/() : CSG_Grid , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • operator/=() : CSG_Grid , CSG_Grids , CSG_Point , CSG_Point_3D , CSG_Point_4D
  • operator<() : CSG_DateTime , CSG_TimeSpan
  • operator<=() : CSG_DateTime , CSG_TimeSpan
  • operator=() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Colors , CSG_DateTime , CSG_Grid , CSG_Grid_System , CSG_Grids , CSG_Histogram , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Parameters , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Rects , CSG_Rects_Int , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_Table , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String , CSG_Vector
  • operator==() : CSG_DateTime , CSG_Grid_System , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_Projection , CSG_Rect , CSG_Rect_Int , CSG_Table_Value , CSG_TimeSpan , CSG_Vector
  • operator>() : CSG_DateTime , CSG_TimeSpan
  • operator>=() : CSG_DateTime , CSG_TimeSpan
  • operator[]() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_Buffer , CSG_Bytes , CSG_Bytes_Array , CSG_Colors , CSG_Grid_Stack , CSG_Grids , CSG_Histogram , CSG_Index , CSG_KDTree , CSG_Lines , CSG_Matrix , CSG_MetaData , CSG_Natural_Breaks , CSG_Parameters , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Projections , CSG_Rects , CSG_Rects_Int , CSG_Regression_Weighted , CSG_Simple_Statistics , CSG_String , CSG_Strings , CSG_Table , CSG_Table_Record , CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- p -

  • Parse_Date() : CSG_DateTime
  • Parse_DateTime() : CSG_DateTime
  • Parse_Format() : CSG_DateTime
  • Parse_ISOCombined() : CSG_DateTime
  • Parse_ISODate() : CSG_DateTime
  • Parse_ISOTime() : CSG_DateTime
  • Peek() : CSG_PriorityQueue
  • Poll() : CSG_PriorityQueue
  • Pop() : CSG_Grid_Stack
  • Prepend() : CSG_String
  • Print() : CSG_Classifier_Supervised
  • Printf() : CSG_File , CSG_String
  • Process_Get_Okay() : CSG_Tool
  • Process_Set_Text() : CSG_Tool
  • Push() : CSG_Grid_Stack
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- r -

  • Random() : CSG_Colors
  • Read() : CSG_File
  • Read_Byte() : CSG_Bytes
  • Read_Char() : CSG_Bytes , CSG_File
  • Read_Double() : CSG_Bytes , CSG_File
  • Read_DWord() : CSG_Bytes
  • Read_Float() : CSG_Bytes
  • Read_Int() : CSG_Bytes , CSG_File
  • Read_Line() : CSG_File
  • Read_Short() : CSG_Bytes
  • Read_Word() : CSG_Bytes
  • Reload() : CSG_Data_Object
  • Remove() : CSG_String
  • Replace() : CSG_String
  • Request() : CSG_HTTP
  • Reset() : CSG_Tool
  • Reset_Dictionary() : CSG_Projections
  • Reset_Grid_System() : CSG_Parameters , CSG_Tool
  • Reset_Manager() : CSG_Tool
  • Reset_Time() : CSG_DateTime
  • Restore_Default() : CSG_Parameter , CSG_Parameter_Font , CSG_Parameter_Parameters , CSG_Parameter_Range
  • Restore_Defaults() : CSG_Parameters
  • Revert() : CSG_Colors
  • Revert_Points() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Points
  • Rewind() : CSG_Bytes
  • Right() : CSG_String
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- s -

  • Save() : CSG_Classifier_Supervised , CSG_Colors , CSG_Data_Object , CSG_Grid , CSG_Grid_File_Info , CSG_Grids , CSG_MetaData , CSG_Parameters , CSG_PointCloud , CSG_Projection , CSG_Shapes , CSG_Table , CSG_TIN
  • Save_AUX_XML() : CSG_Grid_File_Info
  • Save_DB() : CSG_Projections
  • Save_Dictionary() : CSG_Projections
  • Save_History_to_Model() : CSG_Data_Object , CSG_Tool_Chain
  • Save_JSON() : CSG_MetaData
  • Save_MetaData() : CSG_Data_Object
  • Scale_Element_Count() : CSG_Histogram
  • Scan() : CSG_File
  • Scan_Double() : CSG_File
  • Scan_Int() : CSG_File
  • Scan_String() : CSG_File
  • Second() : CSG_TimeSpan
  • Seconds() : CSG_TimeSpan
  • Seek() : CSG_File
  • Seek_End() : CSG_File
  • Seek_Start() : CSG_File
  • Select() : CSG_Parameter_Choices , CSG_PointCloud , CSG_Shapes , CSG_Table
  • Select_Nearest_Points() : CSG_PRQuadTree
  • Serialize() : CSG_Colors , CSG_Parameter , CSG_Parameters , CSG_Table
  • Serialize_Compatibility() : CSG_Parameters
  • Set() : CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong , CSG_DateTime
  • Set_Annulus() : CSG_Grid_Cell_Addressor
  • Set_Array() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Set_Attribute() : CSG_PointCloud
  • Set_Author() : CSG_Tool
  • Set_BandWidth() : CSG_Distance_Weighting
  • Set_Blue() : CSG_Colors
  • Set_BottomLeft() : CSG_Rect , CSG_Rect_Int
  • Set_Brightness() : CSG_Colors
  • Set_Cache() : CSG_Grid
  • Set_Callback() : CSG_Parameters , CSG_Tool
  • Set_Callback_On_Parameter_Changed() : CSG_Parameters
  • Set_Char() : CSG_String
  • Set_Children_Enabled() : CSG_Parameter
  • Set_Circle() : CSG_Grid_Cell_Addressor
  • Set_Col() : CSG_Matrix
  • Set_Color() : CSG_Colors
  • Set_Cols() : CSG_Matrix
  • Set_Content() : CSG_MetaData
  • Set_Count() : CSG_Colors , CSG_Lines , CSG_Points , CSG_Points_3D , CSG_Points_Int , CSG_Simple_Statistics , CSG_Strings , CSG_Table
  • Set_Cursor() : CSG_PointCloud
  • Set_Data() : CSG_Buffer , CSG_Regression_Multiple , CSG_Trend , CSG_Trend_Polynom
  • Set_Data_Type() : CSG_Parameter_Data_Type
  • Set_Data_Types() : CSG_Parameter_Data_Type
  • Set_DataObject_Type() : CSG_Parameter_Data_Object_Output
  • Set_Date() : CSG_Parameter_Date
  • Set_Day() : CSG_DateTime
  • Set_DayOfYear() : CSG_DateTime
  • Set_Default() : CSG_Colors , CSG_Parameter
  • Set_Description() : CSG_Data_Object , CSG_Parameter , CSG_Parameters , CSG_Tool
  • Set_Drag_Mode() : CSG_Tool_Interactive_Base
  • Set_Enabled() : CSG_Parameter , CSG_Parameters
  • Set_Encoding() : CSG_File
  • Set_Extent() : CSG_PRQuadTree_Item
  • Set_Feature() : CSG_Cluster_Analysis
  • Set_Field_Name() : CSG_Table
  • Set_Field_Type() : CSG_PointCloud , CSG_Table
  • Set_File_Encoding() : CSG_Table
  • Set_File_Name() : CSG_Data_Object
  • Set_File_Type() : CSG_Data_Object
  • Set_Filter() : CSG_Parameter_File_Name
  • Set_Flag_Directory() : CSG_Parameter_File_Name
  • Set_Flag_Multiple() : CSG_Parameter_File_Name
  • Set_Flag_Save() : CSG_Parameter_File_Name
  • Set_Formula() : CSG_Formula , CSG_Trend
  • Set_GCS_WGS84() : CSG_Projection
  • Set_Green() : CSG_Colors
  • Set_Grid_Count() : CSG_Grids
  • Set_Grid_System() : CSG_Parameters , CSG_Tool
  • Set_Growth() : CSG_Array , CSG_Array_Int , CSG_Array_Pointer , CSG_Array_sLong
  • Set_History() : CSG_Parameters
  • Set_Hour() : CSG_DateTime
  • Set_Hours_AD() : CSG_DateTime
  • Set_Identifier() : CSG_Parameters
  • Set_Identity() : CSG_Matrix
  • Set_IDW_Offset() : CSG_Distance_Weighting
  • Set_IDW_Power() : CSG_Distance_Weighting
  • Set_Index() : CSG_Grid , CSG_Grids , CSG_Table
  • Set_Inverse() : CSG_Matrix
  • Set_Items() : CSG_Parameter_Choice , CSG_Parameter_Choices
  • Set_Library_Menu() : CSG_Tool_Chain
  • Set_Location() : CSG_Parameters_Point_Search_KDTree_2D
  • Set_Log_Difference() : CSG_Regression_Weighted
  • Set_Log_Epsilon() : CSG_Regression_Weighted
  • Set_Log_maxIter() : CSG_Regression_Weighted
  • Set_M() : CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_ZM , CSG_Shape_Points
  • Set_Manager() : CSG_Parameters , CSG_Tool
  • Set_Max() : CSG_Parameter_Range
  • Set_Max_Iterations() : CSG_Trend
  • Set_Max_Lambda() : CSG_Trend
  • Set_Max_Samples() : CSG_Data_Object , CSG_Grids
  • Set_Maximum() : CSG_Parameter_Value
  • Set_Millisecond() : CSG_DateTime
  • Set_Min() : CSG_Parameter_Range
  • Set_Minimum() : CSG_Parameter_Value
  • Set_Minute() : CSG_DateTime
  • Set_Modified() : CSG_Data_Object , CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table , CSG_Table_Record
  • Set_Month() : CSG_DateTime
  • Set_Name() : CSG_Data_Object , CSG_MetaData , CSG_Parameter , CSG_Parameters , CSG_Tool
  • Set_NoData() : CSG_Grid , CSG_Grids , CSG_PointCloud , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value_Binary
  • Set_NoData_Value() : CSG_Data_Object
  • Set_NoData_Value_Range() : CSG_Data_Object , CSG_Grids
  • Set_Order() : CSG_Trend_Polynom
  • Set_Owner() : CSG_Data_Object
  • Set_Palette() : CSG_Colors
  • Set_Parameter() : CSG_Parameters , CSG_Tool
  • Set_Parameters() : CSG_Distance_Weighting , CSG_Grid_Cell_Addressor
  • Set_Password() : CSG_Parameter_String
  • Set_Point() : CSG_PointCloud , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point , CSG_Shape_Points , CSG_Thin_Plate_Spline
  • Set_Point_Count() : CSG_Thin_Plate_Spline
  • Set_Polar_Search() : CSG_PRQuadTree
  • Set_Precision() : CSG_Grid_System
  • Set_Predefined() : CSG_Colors
  • Set_Preferred_Type() : CSG_Parameter_Grid
  • Set_Probability_Relative() : CSG_Classifier_Supervised
  • Set_Progress() : CSG_Tool
  • Set_Progress_Cells() : CSG_Tool_Grid
  • Set_Progress_Rows() : CSG_Tool_Grid
  • Set_Projection() : CSG_Tool_Interactive_Base
  • Set_Property() : CSG_MetaData
  • Set_Radius() : CSG_Grid_Cell_Addressor
  • Set_Ramp() : CSG_Colors
  • Set_Ramp_Brighness() : CSG_Colors
  • Set_Range() : CSG_Parameter_Range
  • Set_Record() : CSG_Table
  • Set_Red() : CSG_Colors
  • Set_Row() : CSG_Grid , CSG_Matrix
  • Set_Rows() : CSG_Matrix , CSG_Vector
  • Set_Scaling() : CSG_Grid , CSG_Grids
  • Set_Second() : CSG_DateTime
  • Set_Sector() : CSG_Grid_Cell_Addressor
  • Set_Selected() : CSG_Table_Record
  • Set_Shape_Type() : CSG_Parameter_Shapes , CSG_Parameter_Shapes_List
  • Set_Show_Progress() : CSG_Tool
  • Set_Size() : CSG_Buffer , CSG_Matrix
  • Set_Square() : CSG_Grid_Cell_Addressor
  • Set_String() : CSG_String_Tokenizer
  • Set_System() : CSG_Tool_Grid
  • Set_Threshold_Angle() : CSG_Classifier_Supervised
  • Set_Threshold_Distance() : CSG_Classifier_Supervised
  • Set_Threshold_Probability() : CSG_Classifier_Supervised
  • Set_To_Current() : CSG_DateTime
  • Set_TopRight() : CSG_Rect , CSG_Rect_Int
  • Set_Transpose() : CSG_Matrix
  • Set_Unit() : CSG_Grid , CSG_Grids
  • Set_Unity() : CSG_Vector
  • Set_Unix_Time() : CSG_DateTime
  • Set_Update_Flag() : CSG_Data_Object
  • Set_UseInCMD() : CSG_Parameter
  • Set_UseInGUI() : CSG_Parameter
  • Set_User_Defined() : CSG_Parameters_Grid_Target
  • Set_User_Defined_ZLevels() : CSG_Parameters_Grid_Target
  • Set_UTM_WGS84() : CSG_Projection
  • Set_Valid_Range() : CSG_Parameter_Value
  • Set_Value() : CSG_Buffer , CSG_Grid , CSG_Grids , CSG_Parameter , CSG_PointCloud , CSG_Table , CSG_Table_DBase , CSG_Table_Record , CSG_Table_Value , CSG_Table_Value_Binary , CSG_Table_Value_Date , CSG_Table_Value_Double , CSG_Table_Value_Int , CSG_Table_Value_Long , CSG_Table_Value_String
  • Set_Values() : CSG_Regression
  • Set_Variable() : CSG_Formula
  • Set_Version() : CSG_Tool
  • Set_Weighting() : CSG_Distance_Weighting
  • Set_With_Intercept() : CSG_Regression_Multiple
  • Set_WTA() : CSG_Classifier_Supervised
  • Set_XYZ_Precision() : CSG_PointCloud
  • Set_Year() : CSG_DateTime
  • Set_Z() : CSG_Grids , CSG_Shape , CSG_Shape_Part , CSG_Shape_Point_Z , CSG_Shape_Points
  • Set_Z_Attribute() : CSG_Grids
  • Set_Z_Name_Field() : CSG_Grids
  • Set_Zero() : CSG_Matrix , CSG_Vector
  • Settings_Pop() : CSG_Tool
  • Settings_Push() : CSG_Tool
  • Show_Progress() : CSG_Index
  • Sort() : CSG_Category_Statistics , CSG_Strings , CSG_Vector
  • Standardise() : CSG_Grid
  • Stop_Execution() : CSG_Tool
  • Subtract() : CSG_DateTime , CSG_Grid , CSG_Grids , CSG_Matrix , CSG_Point , CSG_Point_3D , CSG_Point_4D , CSG_TimeSpan , CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- t -

  • Tell() : CSG_File
  • to_ASCII() : CSG_String
  • to_JSON() : CSG_MetaData
  • to_MBChar() : CSG_String
  • to_ShapeType() : CSG_Shapes_OGIS_Converter
  • to_StdString() : CSG_String
  • to_StdWstring() : CSG_String
  • to_String() : CSG_Matrix , CSG_Vector
  • to_Text() : CSG_Colors
  • To_UTC() : CSG_DateTime
  • to_UTF8() : CSG_String
  • to_VertexType() : CSG_Shapes_OGIS_Converter
  • to_WKBinary() : CSG_Grid_OGIS_Converter , CSG_Shapes_OGIS_Converter
  • to_WKT() : CSG_MetaData
  • to_WKText() : CSG_Shapes_OGIS_Converter
  • to_XML() : CSG_MetaData
  • Toggle_Index() : CSG_Table
  • Toggle_Value() : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice
  • toHexString() : CSG_Bytes
  • Train() : CSG_Classifier_Supervised
  • Train_Add_Sample() : CSG_Classifier_Supervised
  • Train_Clr_Samples() : CSG_Classifier_Supervised
  • Trim() : CSG_String
  • Trim_Both() : CSG_String
  • Type_asWKBinary() : CSG_Shapes_OGIS_Converter
  • Type_asWKText() : CSG_Shapes_OGIS_Converter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- u -

  • Union() : CSG_Rect , CSG_Rect_Int
  • Update() : CSG_Data_Object , CSG_Histogram , CSG_Parameters_Point_Search
  • Update_Data() : CSG_Parameter_Grid_List , CSG_Parameter_List
  • Update_Parameter_States() : CSG_Tool
  • Update_Z_Order() : CSG_Grids
  • Use_Grid_System() : CSG_Parameters
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- w -

  • w_str() : CSG_String
  • Week() : CSG_TimeSpan
  • Weeks() : CSG_TimeSpan
  • WKT_from_Proj4() : CSG_Projections
  • WKT_to_MetaData() : CSG_Projections
  • WKT_to_Proj4() : CSG_Projections
  • Write() : CSG_File
  • Write_Double() : CSG_File
  • Write_Int() : CSG_File
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Functions

- ~ -

  • ~CSG_Array() : CSG_Array
  • ~CSG_Buffer() : CSG_Buffer
  • ~CSG_Bytes() : CSG_Bytes
  • ~CSG_Bytes_Array() : CSG_Bytes_Array
  • ~CSG_Category_Statistics() : CSG_Category_Statistics
  • ~CSG_Classifier_Supervised() : CSG_Classifier_Supervised
  • ~CSG_Cluster_Analysis() : CSG_Cluster_Analysis
  • ~CSG_Colors() : CSG_Colors
  • ~CSG_Data_Collection() : CSG_Data_Collection
  • ~CSG_Data_Manager() : CSG_Data_Manager
  • ~CSG_Data_Object() : CSG_Data_Object
  • ~CSG_DateTime() : CSG_DateTime
  • ~CSG_Distance_Weighting() : CSG_Distance_Weighting
  • ~CSG_File() : CSG_File
  • ~CSG_File_Zip() : CSG_File_Zip
  • ~CSG_Formula() : CSG_Formula
  • ~CSG_Grid() : CSG_Grid
  • ~CSG_Grid_Pyramid() : CSG_Grid_Pyramid
  • ~CSG_Grid_Radius() : CSG_Grid_Radius
  • ~CSG_Grid_System() : CSG_Grid_System
  • ~CSG_Grids() : CSG_Grids
  • ~CSG_Histogram() : CSG_Histogram
  • ~CSG_HTTP() : CSG_HTTP
  • ~CSG_Index() : CSG_Index
  • ~CSG_Index_Compare() : CSG_Index::CSG_Index_Compare
  • ~CSG_KDTree() : CSG_KDTree
  • ~CSG_KDTree_2D() : CSG_KDTree_2D
  • ~CSG_KDTree_3D() : CSG_KDTree_3D
  • ~CSG_Lines() : CSG_Lines
  • ~CSG_Matrix() : CSG_Matrix
  • ~CSG_MetaData() : CSG_MetaData
  • ~CSG_Natural_Breaks() : CSG_Natural_Breaks
  • ~CSG_Parameter() : CSG_Parameter
  • ~CSG_Parameter_Parameters() : CSG_Parameter_Parameters
  • ~CSG_Parameter_Range() : CSG_Parameter_Range
  • ~CSG_Parameter_Table_Fields() : CSG_Parameter_Table_Fields
  • ~CSG_Parameters() : CSG_Parameters
  • ~CSG_Parameters_Point_Search() : CSG_Parameters_Point_Search
  • ~CSG_Parameters_Point_Search_KDTree_2D() : CSG_Parameters_Point_Search_KDTree_2D
  • ~CSG_Point() : CSG_Point
  • ~CSG_Point_3D() : CSG_Point_3D
  • ~CSG_Point_4D() : CSG_Point_4D
  • ~CSG_PointCloud() : CSG_PointCloud
  • ~CSG_PriorityQueue() : CSG_PriorityQueue
  • ~CSG_Projection() : CSG_Projection
  • ~CSG_Projections() : CSG_Projections
  • ~CSG_PRQuadTree() : CSG_PRQuadTree
  • ~CSG_PRQuadTree_Item() : CSG_PRQuadTree_Item
  • ~CSG_PRQuadTree_Leaf() : CSG_PRQuadTree_Leaf
  • ~CSG_PRQuadTree_Leaf_List() : CSG_PRQuadTree_Leaf_List
  • ~CSG_PRQuadTree_Node() : CSG_PRQuadTree_Node
  • ~CSG_PRQuadTree_Node_Statistics() : CSG_PRQuadTree_Node_Statistics
  • ~CSG_Rect() : CSG_Rect
  • ~CSG_Rect_Int() : CSG_Rect_Int
  • ~CSG_Rects() : CSG_Rects
  • ~CSG_Rects_Int() : CSG_Rects_Int
  • ~CSG_Regression() : CSG_Regression
  • ~CSG_Regression_Multiple() : CSG_Regression_Multiple
  • ~CSG_Regression_Weighted() : CSG_Regression_Weighted
  • ~CSG_Shape() : CSG_Shape
  • ~CSG_Shape_Line() : CSG_Shape_Line
  • ~CSG_Shape_Part() : CSG_Shape_Part
  • ~CSG_Shape_Point() : CSG_Shape_Point
  • ~CSG_Shape_Points() : CSG_Shape_Points
  • ~CSG_Shape_Polygon() : CSG_Shape_Polygon
  • ~CSG_Shape_Polygon_Part() : CSG_Shape_Polygon_Part
  • ~CSG_Shapes() : CSG_Shapes
  • ~CSG_Spline() : CSG_Spline
  • ~CSG_Stack() : CSG_Stack
  • ~CSG_String() : CSG_String
  • ~CSG_String_Tokenizer() : CSG_String_Tokenizer
  • ~CSG_Strings() : CSG_Strings
  • ~CSG_Table() : CSG_Table
  • ~CSG_Table_DBase() : CSG_Table_DBase
  • ~CSG_Table_Record() : CSG_Table_Record
  • ~CSG_Table_Value() : CSG_Table_Value
  • ~CSG_Table_Value_Binary() : CSG_Table_Value_Binary
  • ~CSG_Table_Value_Date() : CSG_Table_Value_Date
  • ~CSG_Table_Value_Double() : CSG_Table_Value_Double
  • ~CSG_Table_Value_Int() : CSG_Table_Value_Int
  • ~CSG_Table_Value_Long() : CSG_Table_Value_Long
  • ~CSG_Table_Value_String() : CSG_Table_Value_String
  • ~CSG_Thin_Plate_Spline() : CSG_Thin_Plate_Spline
  • ~CSG_TIN() : CSG_TIN
  • ~CSG_Tool() : CSG_Tool
  • ~CSG_Tool_Chain() : CSG_Tool_Chain
  • ~CSG_Tool_Chains() : CSG_Tool_Chains
  • ~CSG_Tool_Grid() : CSG_Tool_Grid
  • ~CSG_Tool_Grid_Interactive() : CSG_Tool_Grid_Interactive
  • ~CSG_Tool_Interactive() : CSG_Tool_Interactive
  • ~CSG_Tool_Interactive_Base() : CSG_Tool_Interactive_Base
  • ~CSG_Tool_Library() : CSG_Tool_Library
  • ~CSG_Tool_Library_Interface() : CSG_Tool_Library_Interface
  • ~CSG_Tool_Library_Manager() : CSG_Tool_Library_Manager
  • ~CSG_Translator() : CSG_Translator
  • ~CSG_Unique_Number_Statistics() : CSG_Unique_Number_Statistics
  • ~CSG_Unique_String_Statistics() : CSG_Unique_String_Statistics
  • ~CSG_Unique_Value_Statistics() : CSG_Unique_Value_Statistics
  • ~CSG_Vector() : CSG_Vector
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- b -

  • Boolean : CSG_UI_Parameter
  • bVarying : CSG_Formula::SSG_Function
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- f -

  • Function : CSG_Formula::SSG_Function
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- h -

  • History_Supplement : CSG_Tool
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- m -

  • m : SSG_Point_4D
  • m_Area : CSG_Shape_Polygon_Part
  • m_bClockwise : CSG_Shape_Polygon_Part
  • m_bCreated : CSG_Spline
  • m_bDirectory : CSG_Parameter_File_Name
  • m_bEvaluated : CSG_Simple_Statistics
  • m_bFlip : CSG_Grid_File_Info
  • m_bIncluded : CSG_Regression_Multiple
  • m_bIntercept : CSG_Regression_Multiple
  • m_bLake : CSG_Shape_Polygon_Part
  • m_bMaximum : CSG_Parameter_Value
  • m_bMinimum : CSG_Parameter_Value
  • m_bMultiple : CSG_Parameter_File_Name
  • m_bPassword : CSG_Parameter_String
  • m_bSave : CSG_Parameter_File_Name
  • m_bSorted : CSG_Simple_Statistics
  • m_bSwapBytes : CSG_Grid_File_Info
  • m_bUpdate : CSG_Shape_Part , CSG_Shape_Points
  • m_bUpdate_Lakes : CSG_Shape_Polygon
  • m_bWeights : CSG_Unique_Value_Statistics
  • m_Centroid : CSG_Shape_Polygon_Part
  • m_Color : CSG_Parameter_Font
  • m_Colors : CSG_Parameter_Colors
  • m_Count : CSG_Unique_Value_Statistics
  • m_Data : CSG_Parameter_Choice
  • m_Data_File : CSG_Grid_File_Info
  • m_Date : CSG_Parameter_Date
  • m_Default : CSG_Parameter_Grid , CSG_Parameter_Table_Field
  • m_Description : CSG_Grid_File_Info
  • m_Distances : CSG_KDTree
  • m_Edges : CSG_TIN
  • m_Encoding : CSG_File , CSG_Table
  • m_Extent : CSG_PRQuadTree_Item , CSG_Shape_Part , CSG_Shape_Points , CSG_Table , CSG_TIN
  • m_Extent_Selected : CSG_Shapes
  • m_Field_Name : CSG_Table
  • m_Field_Stats : CSG_Table
  • m_Field_Type : CSG_Table
  • m_Fields : CSG_Parameter_Table_Fields
  • m_File_Name : CSG_Tool_Library
  • m_FileName : CSG_File
  • m_Files : CSG_File_Zip
  • m_Filter : CSG_Parameter_File_Name
  • m_Flags : CSG_Table_Record
  • m_Gini : CSG_Simple_Statistics
  • m_Grids : CSG_Parameter_Grid_List
  • m_Index : CSG_Table_Record
  • m_Indices : CSG_KDTree
  • m_Items : CSG_Parameter_Choice , CSG_Parameter_Choices
  • m_Kurtosis : CSG_Simple_Statistics
  • m_Library_Name : CSG_Tool_Library
  • m_M : CSG_Shape_Part
  • m_Maximum : CSG_Parameter_Value , CSG_Simple_Statistics
  • m_maxPoints : CSG_Parameters_Point_Search
  • m_Mean : CSG_Simple_Statistics
  • m_Minimum : CSG_Parameter_Value , CSG_Simple_Statistics
  • m_minPoints : CSG_Parameters_Point_Search
  • m_MMax : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_MMin : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_Mode : CSG_File
  • m_Name : CSG_Grid_File_Info
  • m_Names : CSG_Regression_Multiple
  • m_nBuffer : CSG_Shape_Part , CSG_Table
  • m_nEdges : CSG_TIN
  • m_nFields : CSG_Parameter_Table_Fields , CSG_Table
  • m_NoData : CSG_Grid_File_Info
  • m_nParts : CSG_Shape_Points
  • m_nPoints : CSG_Shape_Part , CSG_Shape_Points
  • m_nPredictors : CSG_Regression_Multiple
  • m_nRecords : CSG_Table
  • m_nTriangles : CSG_TIN
  • m_nValues : CSG_Simple_Statistics
  • m_Objects : CSG_Data_Collection
  • m_Offset : CSG_Grid_File_Info
  • m_P : CSG_Regression
  • m_pAdaptor : CSG_KDTree
  • m_pChildren : CSG_PRQuadTree_Node
  • m_pConvert : CSG_File
  • m_pDataObject : CSG_Parameter_Data_Object
  • m_Perimeter : CSG_Shape_Polygon_Part
  • m_pHTTP : CSG_HTTP
  • m_pKDTree : CSG_KDTree
  • m_pManager : CSG_Data_Collection
  • m_pMax : CSG_Parameter_Range
  • m_pMin : CSG_Parameter_Range
  • m_pModel : CSG_Regression_Multiple
  • m_Point : CSG_PRQuadTree_Leaf , CSG_Shape_Point
  • m_Points : CSG_KDTree , CSG_Shape_Part
  • m_pOwner : CSG_Data_Object , CSG_Shape_Part
  • m_pParameters : CSG_Parameter_Parameters , CSG_Parameters_Point_Search
  • m_pParts : CSG_Shape_Points
  • m_pRange : CSG_Parameter_Range
  • m_Predictor : CSG_Regression_Multiple
  • m_pRegression : CSG_Regression_Multiple
  • m_Projection : CSG_Grid_File_Info
  • m_pSteps : CSG_Regression_Multiple
  • m_pStream : CSG_File
  • m_pString : CSG_String
  • m_pTable : CSG_Table_Record
  • m_R : CSG_Regression
  • m_R2 : CSG_Regression
  • m_R2_Adj : CSG_Regression
  • m_Radius : CSG_Parameters_Point_Search
  • m_Range : CSG_Simple_Statistics
  • m_RCoeff : CSG_Regression
  • m_RConst : CSG_Regression
  • m_Samples : CSG_Regression_Multiple
  • m_Samples_Model : CSG_Regression_Multiple
  • m_SE : CSG_Regression
  • m_Selection : CSG_Parameter_Choices , CSG_Table
  • m_Skewness : CSG_Simple_Statistics
  • m_StdDev : CSG_Simple_Statistics
  • m_String : CSG_Parameter
  • m_Strings : CSG_Strings
  • m_Sum : CSG_Simple_Statistics
  • m_Sum2 : CSG_Simple_Statistics
  • m_System : CSG_Grid_Collection , CSG_Grid_File_Info , CSG_Parameter_Grid_System
  • m_Table : CSG_Parameter_Fixed_Table
  • m_Triangles : CSG_TIN
  • m_Type : CSG_Data_Collection , CSG_Grid_File_Info , CSG_Parameter_Data_Object_Output , CSG_Parameter_Grid , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Regression , CSG_Shapes
  • m_Unit : CSG_Grid_File_Info
  • m_Value : CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Double , CSG_Parameter_Int
  • m_Values : CSG_Simple_Statistics , CSG_Table_Record
  • m_Variance : CSG_Simple_Statistics
  • m_Vertex_Type : CSG_Shapes
  • m_Weight : CSG_Unique_Value_Statistics
  • m_Weights : CSG_Simple_Statistics
  • m_x : CSG_PRQuadTree_Node_Statistics , CSG_Regression , CSG_Spline
  • m_xMax : CSG_Regression
  • m_xMean : CSG_Regression
  • m_xMin : CSG_Regression
  • m_xVar : CSG_Regression
  • m_y : CSG_PRQuadTree_Node_Statistics , CSG_Regression , CSG_Spline
  • m_yMax : CSG_Regression
  • m_yMean : CSG_Regression
  • m_yMin : CSG_Regression
  • m_yVar : CSG_Regression
  • m_z : CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Node_Statistics
  • m_Z : CSG_Shape_Part
  • m_z : CSG_Spline
  • m_ZMax : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_ZMin : CSG_Shape_Part , CSG_Shape_Points , CSG_Shapes
  • m_zOffset : CSG_Grid_File_Info
  • m_zScale : CSG_Grid_File_Info
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- n -

  • Name : CSG_Formula::SSG_Function
  • nParameters : CSG_Formula::SSG_Function
  • Number : CSG_UI_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- p -

  • p1 : CSG_TIN::TTIN_Edge , CSG_TIN::TTIN_Triangle
  • p2 : CSG_TIN::TTIN_Edge , CSG_TIN::TTIN_Triangle
  • p3 : CSG_TIN::TTIN_Triangle
  • Parameters : CSG_Tool
  • Pointer : CSG_UI_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- s -

  • s_z : CSG_PRQuadTree_Leaf_List
  • String : CSG_UI_Parameter
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- x -

  • x : SSG_Point , SSG_Point_3D , SSG_Point_4D , SSG_Point_Int
  • xMax : SSG_Rect , SSG_Rect_Int
  • xMin : SSG_Rect , SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- y -

  • y : SSG_Point , SSG_Point_3D , SSG_Point_4D , SSG_Point_Int
  • yMax : SSG_Rect , SSG_Rect_Int
  • yMin : SSG_Rect , SSG_Rect_Int
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Variables

- z -

  • z : SSG_Point_3D , SSG_Point_4D
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Typedefs

  • const_iterator : CSG_Vector
  • TSG_DateTime : CSG_DateTime
  • TSG_Function : CSG_Formula
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Enumerations

  • Month : CSG_DateTime
  • NameFlags : CSG_DateTime
  • WeekDay : CSG_DateTime
  • Year : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Enumerator

  • Apr : CSG_DateTime
  • Aug : CSG_DateTime
  • Dec : CSG_DateTime
  • Feb : CSG_DateTime
  • Fri : CSG_DateTime
  • Inv_Month : CSG_DateTime
  • Inv_WeekDay : CSG_DateTime
  • Inv_Year : CSG_DateTime
  • Jan : CSG_DateTime
  • Jul : CSG_DateTime
  • Jun : CSG_DateTime
  • Mar : CSG_DateTime
  • May : CSG_DateTime
  • Mon : CSG_DateTime
  • Name_Abbr : CSG_DateTime
  • Name_Full : CSG_DateTime
  • Nov : CSG_DateTime
  • Oct : CSG_DateTime
  • Sat : CSG_DateTime
  • Sep : CSG_DateTime
  • Sun : CSG_DateTime
  • Thu : CSG_DateTime
  • Tue : CSG_DateTime
  • Wed : CSG_DateTime
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Members - Related Functions

- c -

  • CSG_Data_Manager : CSG_Data_Collection , CSG_Grid_Collection
  • CSG_DateTime : CSG_TimeSpan
  • CSG_HTTP : CSG_MetaData
  • CSG_Parameter : CSG_Parameters
  • CSG_Parameters : CSG_Parameter , CSG_Parameter_Bool , CSG_Parameter_Choice , CSG_Parameter_Choices , CSG_Parameter_Color , CSG_Parameter_Colors , CSG_Parameter_Data_Object , CSG_Parameter_Data_Object_Output , CSG_Parameter_Data_Type , CSG_Parameter_Date , CSG_Parameter_Degree , CSG_Parameter_Double , CSG_Parameter_File_Name , CSG_Parameter_Fixed_Table , CSG_Parameter_Font , CSG_Parameter_Grid , CSG_Parameter_Grid_List , CSG_Parameter_Grid_System , CSG_Parameter_Grids , CSG_Parameter_Grids_List , CSG_Parameter_Int , CSG_Parameter_List , CSG_Parameter_Node , CSG_Parameter_Parameters , CSG_Parameter_PointCloud , CSG_Parameter_PointCloud_List , CSG_Parameter_Range , CSG_Parameter_Shapes , CSG_Parameter_Shapes_List , CSG_Parameter_String , CSG_Parameter_Table , CSG_Parameter_Table_Field , CSG_Parameter_Table_Fields , CSG_Parameter_Table_List , CSG_Parameter_Text , CSG_Parameter_TIN , CSG_Parameter_TIN_List , CSG_Parameter_Value
  • CSG_PointCloud : CSG_Table_Record
  • CSG_Projection : CSG_Projections
  • CSG_Projections : CSG_Projection
  • CSG_PRQuadTree : CSG_PRQuadTree_Node , CSG_PRQuadTree_Node_Statistics
  • CSG_PRQuadTree_Node : CSG_PRQuadTree_Leaf , CSG_PRQuadTree_Leaf_List , CSG_PRQuadTree_Node_Statistics
  • CSG_Shape : CSG_Shapes
  • CSG_Shape_Line : CSG_Shape_Part
  • CSG_Shape_Part : CSG_Shape_Points
  • CSG_Shape_Points : CSG_Shape_Part
  • CSG_Shape_Polygon : CSG_Shape_Part , CSG_Shape_Polygon_Part
  • CSG_Shapes : CSG_Shape , CSG_Shape_Line , CSG_Shape_Point , CSG_Shape_Point_Z , CSG_Shape_Point_ZM , CSG_Shape_Points , CSG_Shape_Polygon
  • CSG_Table : CSG_Table_Record
  • CSG_Table_Record : CSG_Table
  • CSG_TIN : CSG_Table , CSG_TIN_Edge , CSG_TIN_Node , CSG_TIN_Triangle
  • CSG_Tool : CSG_Parameters
  • CSG_Tool_Chain : CSG_Tool
  • CSG_Tool_Grid_Interactive : CSG_Tool_Interactive_Base
  • CSG_Tool_Interactive : CSG_Tool_Interactive_Base
  • CSG_Tool_Interactive_Base : CSG_Tool
  • CSG_Tool_Library_Interface : CSG_Tool
  • CSG_Tool_Library_Manager : CSG_Tool_Chains , CSG_Tool_Library
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File List

File List
Here is a list of all files with brief descriptions:
api_callback.cpp
api_colors.cpp
api_core.cpp
api_core.h
api_file.cpp
api_memory.cpp
api_string.cpp
api_translator.cpp
data_manager.cpp
data_manager.h
dataobject.cpp
dataobject.h
datetime.cpp
datetime.h
geo_classes.cpp
geo_functions.cpp
geo_tools.h
grid.cpp
grid.h
grid_io.cpp
grid_memory.cpp
grid_operation.cpp
grid_pyramid.cpp
grid_pyramid.h
grid_system.cpp
grids.cpp
grids.h
kdtree.cpp
mat_formula.cpp
mat_grid_radius.cpp
mat_indexing.cpp
mat_matrix.cpp
mat_mRMR.cpp
mat_regression.cpp
mat_regression_multiple.cpp
mat_regression_weighted.cpp
mat_spline.cpp
mat_tools.cpp
mat_tools.h
mat_trend.cpp
metadata.cpp
metadata.h
parameter.cpp
parameter_data.cpp
parameters.cpp
parameters.h
pointcloud.cpp
pointcloud.h
projections.cpp
quadtree.cpp
saga_api.cpp
saga_api.h
shape.cpp
shape_line.cpp
shape_part.cpp
shape_point.cpp
shape_points.cpp
shape_polygon.cpp
shapes.cpp
shapes.h
shapes_clipper.cpp
shapes_io.cpp
shapes_ogis.cpp
shapes_polygons.cpp
shapes_selection.cpp
table.cpp
table.h
table_dbase.cpp
table_dbase.h
table_io.cpp
table_record.cpp
table_selection.cpp
table_value.h
tin.cpp
tin.h
tin_elements.cpp
tin_triangulation.cpp
tool.cpp
tool.h
tool_chain.cpp
tool_chain.h
tool_grid.cpp
tool_grid_interactive.cpp
tool_interactive.cpp
tool_interactive_base.cpp
tool_library.cpp
tool_library.h
tool_library_interface.cpp
tool_summary.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: api_callback.cpp File Reference

  • saga_core
  • saga_api
Functions | Variables
api_callback.cpp File Reference
#include <wx/stdpaths.h>
#include "api_core.h"
#include "grid.h"
#include "parameters.h"

Go to the source code of this file.

Functions

void | SG_UI_Console_Set_UTF8 (bool bOn)
bool | SG_UI_Console_Get_UTF8 (void)
void | SG_UI_Console_Print_StdOut (const char *Text, SG_Char End, bool bFlush)
void | SG_UI_Console_Print_StdOut (const wchar_t *Text, SG_Char End, bool bFlush)
void | SG_UI_Console_Print_StdOut (const CSG_String &Text, SG_Char End, bool bFlush)
void | SG_UI_Console_Print_StdErr (const char *Text, SG_Char End, bool bFlush)
void | SG_UI_Console_Print_StdErr (const wchar_t *Text, SG_Char End, bool bFlush)
void | SG_UI_Console_Print_StdErr (const CSG_String &Text, SG_Char End, bool bFlush)
bool | SG_Set_UI_Callback (TSG_PFNC_UI_Callback Function)
TSG_PFNC_UI_Callback | SG_Get_UI_Callback (void)
int | SG_UI_Progress_Lock (bool bOn)
int | SG_UI_Progress_Reset (void)
bool | SG_UI_Process_Get_Okay (bool bBlink)
bool | SG_UI_Process_Set_Okay (bool bOkay)
bool | SG_UI_Process_Set_Busy (bool bOn, const CSG_String &Message)
bool | SG_UI_Process_Set_Progress (int Position, int Range)
bool | SG_UI_Process_Set_Progress (sLong Position, sLong Range)
bool | SG_UI_Process_Set_Progress (double Position, double Range)
bool | SG_UI_Process_Set_Ready (void)
void | SG_UI_Process_Set_Text (const CSG_String &Text)
bool | SG_UI_Stop_Execution (bool bDialog)
void | SG_UI_Dlg_Message (const CSG_String &Message, const CSG_String &Caption)
bool | SG_UI_Dlg_Continue (const CSG_String &Message, const CSG_String &Caption)
int | SG_UI_Dlg_Error (const CSG_String &Message, const CSG_String &Caption)
void | SG_UI_Dlg_Info (const CSG_String &Message, const CSG_String &Caption)
bool | SG_UI_Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption)
int | SG_UI_Msg_Lock (bool bOn)
int | SG_UI_Msg_Reset (void)
void | SG_UI_Msg_Add (const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add (const wchar_t *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add (const CSG_String &Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add_Execution (const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add_Execution (const wchar_t *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add_Execution (const CSG_String &Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
void | SG_UI_Msg_Add_Error (const char *Message)
void | SG_UI_Msg_Add_Error (const wchar_t *Message)
void | SG_UI_Msg_Add_Error (const CSG_String &Message)
void | SG_UI_Msg_Flush (void)
void | SG_UI_ProgressAndMsg_Lock (bool bOn)
void | SG_UI_ProgressAndMsg_Reset (void)
bool | SG_UI_DataObject_Add (CSG_Data_Object *pDataObject, int Show)
bool | SG_UI_DataObject_Update (CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
bool | SG_UI_DataObject_Show (CSG_Data_Object *pDataObject, int Show)
bool | SG_UI_DataObject_asImage (CSG_Data_Object *pDataObject, CSG_Grid *pGrid)
bool | SG_UI_DataObject_Colors_Get (CSG_Data_Object *pDataObject, CSG_Colors *pColors)
bool | SG_UI_DataObject_Colors_Set (CSG_Data_Object *pDataObject, CSG_Colors *pColors)
bool | SG_UI_DataObject_Params_Get (CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
bool | SG_UI_DataObject_Params_Set (CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
bool | SG_UI_Set_Map_Extent (double xMin, double yMin, double xMax, double yMax, int Maps)
bool | SG_UI_Diagram_Show (class CSG_Table *pTable, class CSG_Parameters *pParameters)
bool | SG_UI_ODBC_Update (const CSG_String &Server)
int | SG_UI_Window_Arrange (int Arrange)
void * | SG_UI_Get_Window_Main (void)
CSG_String | SG_UI_Get_Application_Path (bool bPathOnly)

Variables

static bool | gSG_UI_Console_bUTF8 = true
TSG_PFNC_UI_Callback | gSG_UI_Callback = NULL
int | gSG_UI_Progress_Lock = 0
int | gSG_UI_Msg_Lock = 0

Function Documentation

◆ SG_Get_UI_Callback()

TSG_PFNC_UI_Callback SG_Get_UI_Callback ( void )

Definition at line 145 of file api_callback.cpp.

References gSG_UI_Callback.

◆ SG_Set_UI_Callback()

bool SG_Set_UI_Callback ( TSG_PFNC_UI_Callback Function )

Definition at line 137 of file api_callback.cpp.

References gSG_UI_Callback.

◆ SG_UI_Console_Get_UTF8()

bool SG_UI_Console_Get_UTF8 ( void )

Definition at line 74 of file api_callback.cpp.

References gSG_UI_Console_bUTF8.

◆ SG_UI_Console_Print_StdErr() [1/3]

void SG_UI_Console_Print_StdErr | ( | const char * | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 102 of file api_callback.cpp.

References SG_UI_Console_Print_StdErr().

Referenced by SG_UI_Console_Print_StdErr(), and SG_UI_Msg_Add_Error().

◆ SG_UI_Console_Print_StdErr() [2/3]

void SG_UI_Console_Print_StdErr | ( | const CSG_String & | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 104 of file api_callback.cpp.

References gSG_UI_Console_bUTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().

◆ SG_UI_Console_Print_StdErr() [3/3]

void SG_UI_Console_Print_StdErr | ( | const wchar_t * | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 103 of file api_callback.cpp.

References SG_UI_Console_Print_StdErr().

◆ SG_UI_Console_Print_StdOut() [1/3]

void SG_UI_Console_Print_StdOut | ( | const char * | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 77 of file api_callback.cpp.

References SG_UI_Console_Print_StdOut().

Referenced by SG_UI_Console_Print_StdOut(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Msg_Add(), SG_UI_Msg_Add_Execution(), SG_UI_Process_Get_Okay(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Text().

◆ SG_UI_Console_Print_StdOut() [2/3]

void SG_UI_Console_Print_StdOut | ( | const CSG_String & | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 79 of file api_callback.cpp.

References gSG_UI_Console_bUTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().

◆ SG_UI_Console_Print_StdOut() [3/3]

void SG_UI_Console_Print_StdOut | ( | const wchar_t * | Text,
 |  | SG_Char | End,
 |  | bool | bFlush
 | ) |  |

Definition at line 78 of file api_callback.cpp.

References SG_UI_Console_Print_StdOut().

◆ SG_UI_Console_Set_UTF8()

void SG_UI_Console_Set_UTF8 ( bool bOn )

Definition at line 73 of file api_callback.cpp.

References gSG_UI_Console_bUTF8.

◆ SG_UI_DataObject_Add()

bool SG_UI_DataObject_Add | ( | CSG_Data_Object * | pDataObject,
 |  | int | Show
 | ) |  |

Definition at line 598 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_ADD, and gSG_UI_Callback.

Referenced by CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Data_Collection::Add(), and CSG_Tool::DataObject_Add().

◆ SG_UI_DataObject_asImage()

bool SG_UI_DataObject_asImage | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Grid * | pGrid
 | ) |  |

Definition at line 645 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_ASIMAGE, and gSG_UI_Callback.

◆ SG_UI_DataObject_Colors_Get()

bool SG_UI_DataObject_Colors_Get | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Colors * | pColors
 | ) |  |

Definition at line 658 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_COLORS_GET, and gSG_UI_Callback.

Referenced by CSG_Tool::DataObject_Get_Colors().

◆ SG_UI_DataObject_Colors_Set()

bool SG_UI_DataObject_Colors_Set | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Colors * | pColors
 | ) |  |

Definition at line 671 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_COLORS_SET, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::DataObject_Set_Colors().

◆ SG_UI_DataObject_Params_Get()

bool SG_UI_DataObject_Params_Get | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Parameters * | pParameters
 | ) |  |

Definition at line 684 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_PARAMS_GET, and gSG_UI_Callback.

Referenced by CSG_Tool::DataObject_Get_Parameters().

◆ SG_UI_DataObject_Params_Set()

bool SG_UI_DataObject_Params_Set | ( | CSG_Data_Object * | pDataObject,
 |  | CSG_Parameters * | pParameters
 | ) |  |

Definition at line 697 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_PARAMS_SET, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::DataObject_Set_Parameters().

◆ SG_UI_DataObject_Show()

bool SG_UI_DataObject_Show | ( | CSG_Data_Object * | pDataObject,
 |  | int | Show
 | ) |  |

Definition at line 632 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_SHOW, and gSG_UI_Callback.

Referenced by SG_UI_DataObject_Update().

◆ SG_UI_DataObject_Update()

bool SG_UI_DataObject_Update | ( | CSG_Data_Object * | pDataObject,
 |  | int | Show,
 |  | CSG_Parameters * | pParameters
 | ) |  |

Definition at line 611 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_UPDATE, CSG_Data_Object::Get_Owner(), gSG_UI_Callback, SG_UI_DataObject_Show(), and SG_UI_DATAOBJECT_UPDATE.

Referenced by CSG_Tool::DataObject_Update(), and SG_UI_Diagram_Show().

◆ SG_UI_Diagram_Show()

bool SG_UI_Diagram_Show | ( | class CSG_Table * | pTable,
 |  | class CSG_Parameters * | pParameters
 | ) |  |

Definition at line 723 of file api_callback.cpp.

References CALLBACK_DIAGRAM_SHOW, gSG_UI_Callback, SG_UI_DataObject_Update(), and SG_UI_DATAOBJECT_UPDATE.

◆ SG_UI_Dlg_Continue()

bool SG_UI_Dlg_Continue | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 380 of file api_callback.cpp.

References CALLBACK_DLG_CONTINUE, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::Message_Dlg_Confirm().

◆ SG_UI_Dlg_Error()

int SG_UI_Dlg_Error | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 396 of file api_callback.cpp.

References CALLBACK_DLG_ERROR, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Msg_Add_Error().

Referenced by CSG_Tool::Error_Set().

◆ SG_UI_Dlg_Info()

void SG_UI_Dlg_Info | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 417 of file api_callback.cpp.

References CSG_String::c_str(), CALLBACK_DLG_INFO, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Dlg_Message()

void SG_UI_Dlg_Message | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 362 of file api_callback.cpp.

References CSG_String::c_str(), CALLBACK_DLG_MESSAGE, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Parameters::DataObjects_Check(), and CSG_Tool::Message_Dlg().

◆ SG_UI_Dlg_Parameters()

bool SG_UI_Dlg_Parameters | ( | CSG_Parameters * | pParameters,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 442 of file api_callback.cpp.

References CALLBACK_DLG_PARAMETERS, and gSG_UI_Callback.

Referenced by CSG_Tool::Dlg_Parameters().

◆ SG_UI_Get_Application_Path()

CSG_String SG_UI_Get_Application_Path ( bool bPathOnly )

Definition at line 786 of file api_callback.cpp.

References SG_File_Get_Path(), and SG_File_Get_Path_Absolute().

Referenced by CSG_Projections::Create(), and SG_Initialize_Environment().

◆ SG_UI_Get_Window_Main()

void* SG_UI_Get_Window_Main ( void )

Definition at line 771 of file api_callback.cpp.

References CALLBACK_GET_APP_WINDOW, gSG_UI_Callback, and CSG_UI_Parameter::Pointer.

Referenced by CSG_Tool_Library_Manager::Destroy(), CSG_Parameters::has_GUI(), and CSG_Tool::has_GUI().

◆ SG_UI_Msg_Add() [1/3]

void SG_UI_Msg_Add | ( | const char * | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 490 of file api_callback.cpp.

References SG_UI_Msg_Add().

Referenced by CSG_Tool_Library_Manager::Add_Library(), CSG_Shapes::Create(), CSG_Tool_Chain::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_TIN::Create(), CSG_Tool::Execute(), CSG_Grids::Load(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), and SG_UI_Msg_Add().

◆ SG_UI_Msg_Add() [2/3]

void SG_UI_Msg_Add | ( | const CSG_String & | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 492 of file api_callback.cpp.

References CALLBACK_MESSAGE_ADD, gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Msg_Add() [3/3]

void SG_UI_Msg_Add | ( | const wchar_t * | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 491 of file api_callback.cpp.

References SG_UI_Msg_Add().

◆ SG_UI_Msg_Add_Error() [1/3]

void SG_UI_Msg_Add_Error ( const char * Message )

Definition at line 544 of file api_callback.cpp.

References SG_UI_Msg_Add_Error().

Referenced by CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool::Error_Set(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), SG_FTP_Download(), SG_UI_Dlg_Error(), SG_UI_Msg_Add_Error(), CSG_Projections::WKT_from_Proj4(), and CSG_Projections::WKT_to_Proj4().

◆ SG_UI_Msg_Add_Error() [2/3]

void SG_UI_Msg_Add_Error ( const CSG_String & Message )

Definition at line 546 of file api_callback.cpp.

References _TL, CSG_String::c_str(), CALLBACK_MESSAGE_ADD_ERROR, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdErr().

◆ SG_UI_Msg_Add_Error() [3/3]

void SG_UI_Msg_Add_Error ( const wchar_t * Message )

Definition at line 545 of file api_callback.cpp.

References SG_UI_Msg_Add_Error().

◆ SG_UI_Msg_Add_Execution() [1/3]

void SG_UI_Msg_Add_Execution | ( | const char * | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 517 of file api_callback.cpp.

References SG_UI_Msg_Add_Execution().

Referenced by CSG_Tool::Execute(), CSG_Tool::Message_Add(), CSG_Parameters::Msg_String(), and SG_UI_Msg_Add_Execution().

◆ SG_UI_Msg_Add_Execution() [2/3]

void SG_UI_Msg_Add_Execution | ( | const CSG_String & | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 519 of file api_callback.cpp.

References CALLBACK_MESSAGE_ADD_EXECUTION, gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Msg_Add_Execution() [3/3]

void SG_UI_Msg_Add_Execution | ( | const wchar_t * | Message,
 |  | bool | bNewLine,
 |  | TSG_UI_MSG_STYLE | Style
 | ) |  |

Definition at line 518 of file api_callback.cpp.

References SG_UI_Msg_Add_Execution().

◆ SG_UI_Msg_Flush()

void SG_UI_Msg_Flush ( void )

Definition at line 564 of file api_callback.cpp.

◆ SG_UI_Msg_Lock()

int SG_UI_Msg_Lock ( bool bOn )

Definition at line 465 of file api_callback.cpp.

References gSG_UI_Msg_Lock.

Referenced by CSG_Projections::Create(), CSG_Translator::Create(), CSG_Grid::Save(), and SG_UI_ProgressAndMsg_Lock().

◆ SG_UI_Msg_Reset()

int SG_UI_Msg_Reset ( void )

Definition at line 480 of file api_callback.cpp.

References gSG_UI_Msg_Lock.

Referenced by SG_UI_ProgressAndMsg_Reset().

◆ SG_UI_ODBC_Update()

bool SG_UI_ODBC_Update ( const CSG_String & Server )

Definition at line 736 of file api_callback.cpp.

References CALLBACK_DATABASE_UPDATE, and gSG_UI_Callback.

◆ SG_UI_Process_Get_Okay()

bool SG_UI_Process_Get_Okay ( bool bBlink )

Definition at line 201 of file api_callback.cpp.

References CALLBACK_PROCESS_GET_OKAY, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, SG_Char, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Shapes::Assign(), CSG_Tool::Error_Set(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Regression_Multiple::Get_Model_Stepwise(), CSG_Trend::Get_Trend(), CSG_Tool::is_Progress(), CSG_Tool::Process_Get_Okay(), SG_Matrix_LU_Decomposition(), and SG_UI_Process_Set_Progress().

◆ SG_UI_Process_Set_Busy()

bool SG_UI_Process_Set_Busy | ( | bool | bOn,
 |  | const CSG_String & | Message
 | ) |  |

Definition at line 236 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_BUSY, and gSG_UI_Callback.

◆ SG_UI_Process_Set_Okay()

bool SG_UI_Process_Set_Okay ( bool bOkay )

Definition at line 223 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_OKAY, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::Error_Set(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), and CSG_Tool_Interactive_Base::Execute_Position().

◆ SG_UI_Process_Set_Progress() [1/3]

bool SG_UI_Process_Set_Progress | ( | double | Position,
 |  | double | Range
 | ) |  |

Definition at line 261 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_PROGRESS, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, SG_UI_Console_Print_StdOut(), and SG_UI_Process_Get_Okay().

◆ SG_UI_Process_Set_Progress() [2/3]

bool SG_UI_Process_Set_Progress | ( | int | Position,
 |  | int | Range
 | ) |  |

Definition at line 249 of file api_callback.cpp.

References SG_UI_Process_Set_Progress().

Referenced by CSG_TIN::_Triangulate(), CSG_Grid::Assign(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), CSG_Thin_Plate_Spline::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Grid_OGIS_Converter::from_WKBinary(), CSG_Projections::Load_DB(), CSG_Shapes::Make_Clean(), CSG_Grid::On_Update(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), CSG_Matrix::Set_Inverse(), CSG_Tool::Set_Progress(), SG_Matrix_LU_Decomposition(), SG_Matrix_LU_Solve(), SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Ready(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ SG_UI_Process_Set_Progress() [3/3]

bool SG_UI_Process_Set_Progress | ( | sLong | Position,
 |  | sLong | Range
 | ) |  |

Definition at line 255 of file api_callback.cpp.

References SG_UI_Process_Set_Progress().

◆ SG_UI_Process_Set_Ready()

bool SG_UI_Process_Set_Ready ( void )

Definition at line 299 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_READY, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Process_Set_Progress().

Referenced by CSG_TIN::_Triangulate(), CSG_Grid::Assign(), CSG_Shapes::Create(), CSG_Grid::Create(), CSG_TIN::Create(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), CSG_Tool_Interactive_Base::Execute_Position(), CSG_Grids::Load(), CSG_Grid::On_Update(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), and CSG_Shapes::Save().

◆ SG_UI_Process_Set_Text()

void SG_UI_Process_Set_Text ( const CSG_String & Text )

Definition at line 317 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_TEXT, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Thin_Plate_Spline::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), and CSG_Tool::Process_Set_Text().

◆ SG_UI_Progress_Lock()

int SG_UI_Progress_Lock ( bool bOn )

Definition at line 176 of file api_callback.cpp.

References gSG_UI_Progress_Lock.

Referenced by SG_UI_ProgressAndMsg_Lock().

◆ SG_UI_Progress_Reset()

int SG_UI_Progress_Reset ( void )

Definition at line 191 of file api_callback.cpp.

References gSG_UI_Progress_Lock.

Referenced by SG_UI_ProgressAndMsg_Reset().

◆ SG_UI_ProgressAndMsg_Lock()

void SG_UI_ProgressAndMsg_Lock ( bool bOn )

Definition at line 577 of file api_callback.cpp.

References SG_UI_Msg_Lock(), and SG_UI_Progress_Lock().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), SG_Get_Projected(), and SG_Initialize_Environment().

◆ SG_UI_ProgressAndMsg_Reset()

void SG_UI_ProgressAndMsg_Reset ( void )

Definition at line 584 of file api_callback.cpp.

References SG_UI_Msg_Reset(), and SG_UI_Progress_Reset().

◆ SG_UI_Set_Map_Extent()

bool SG_UI_Set_Map_Extent | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax,
 |  | int | Maps
 | ) |  |

Definition at line 710 of file api_callback.cpp.

References CALLBACK_SET_MAP_EXTENT, and gSG_UI_Callback.

◆ SG_UI_Stop_Execution()

bool SG_UI_Stop_Execution ( bool bDialog )

Definition at line 342 of file api_callback.cpp.

References CALLBACK_STOP_EXECUTION, and gSG_UI_Callback.

Referenced by CSG_Tool::Stop_Execution().

◆ SG_UI_Window_Arrange()

int SG_UI_Window_Arrange ( int Arrange )

Definition at line 756 of file api_callback.cpp.

References CALLBACK_WINDOW_ARRANGE, and gSG_UI_Callback.

Variable Documentation

◆ gSG_UI_Callback

TSG_PFNC_UI_Callback gSG_UI_Callback = NULL

Definition at line 134 of file api_callback.cpp.

Referenced by SG_Get_UI_Callback(), SG_Set_UI_Callback(), SG_UI_DataObject_Add(), SG_UI_DataObject_asImage(), SG_UI_DataObject_Colors_Get(), SG_UI_DataObject_Colors_Set(), SG_UI_DataObject_Params_Get(), SG_UI_DataObject_Params_Set(), SG_UI_DataObject_Show(), SG_UI_DataObject_Update(), SG_UI_Diagram_Show(), SG_UI_Dlg_Continue(), SG_UI_Dlg_Error(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Dlg_Parameters(), SG_UI_Get_Window_Main(), SG_UI_Msg_Add(), SG_UI_Msg_Add_Error(), SG_UI_Msg_Add_Execution(), SG_UI_ODBC_Update(), SG_UI_Process_Get_Okay(), SG_UI_Process_Set_Busy(), SG_UI_Process_Set_Okay(), SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Ready(), SG_UI_Process_Set_Text(), SG_UI_Set_Map_Extent(), SG_UI_Stop_Execution(), and SG_UI_Window_Arrange().

◆ gSG_UI_Console_bUTF8

bool gSG_UI_Console_bUTF8 = true
static

Definition at line 70 of file api_callback.cpp.

Referenced by SG_UI_Console_Get_UTF8(), SG_UI_Console_Print_StdErr(), SG_UI_Console_Print_StdOut(), and SG_UI_Console_Set_UTF8().

◆ gSG_UI_Msg_Lock

int gSG_UI_Msg_Lock = 0

Definition at line 462 of file api_callback.cpp.

Referenced by SG_UI_Msg_Add(), SG_UI_Msg_Add_Error(), SG_UI_Msg_Add_Execution(), SG_UI_Msg_Lock(), and SG_UI_Msg_Reset().

◆ gSG_UI_Progress_Lock

int gSG_UI_Progress_Lock = 0

Definition at line 173 of file api_callback.cpp.

Referenced by SG_UI_DataObject_Colors_Set(), SG_UI_DataObject_Params_Set(), SG_UI_Dlg_Continue(), SG_UI_Dlg_Error(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Process_Get_Okay(), SG_UI_Process_Set_Okay(), SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Ready(), SG_UI_Process_Set_Text(), SG_UI_Progress_Lock(), and SG_UI_Progress_Reset().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_callback.cpp Source File

  • saga_core
  • saga_api
api_callback.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_callback.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <wx/stdpaths.h>
54
55 #include "api_core.h"
56 #include "grid.h"
57 #include "parameters.h"
58
59
61 // //
62 // //
63 // //
65
66 //---------------------------------------------------------
67 #ifdef _SAGA_MSW
68 static bool gSG_UI_Console_bUTF8 = false;
69 #else
70 static bool gSG_UI_Console_bUTF8 = true;
71 #endif
72
73 void SG_UI_Console_Set_UTF8(bool bOn) { gSG_UI_Console_bUTF8 = bOn; }
74 bool SG_UI_Console_Get_UTF8(void) { return( gSG_UI_Console_bUTF8 ); }
75
76 //---------------------------------------------------------
77 void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End, bool bFlush) { SG_UI_Console_Print_StdOut(CSG_String(Text), End, bFlush); }
78 void SG_UI_Console_Print_StdOut(const wchar_t *Text, SG_Char End, bool bFlush) { SG_UI_Console_Print_StdOut(CSG_String(Text), End, bFlush); }
79 void SG_UI_Console_Print_StdOut(const CSG_String &Text, SG_Char End, bool bFlush)
80 {
81 if( gSG_UI_Console_bUTF8 )
82 {
83 printf("%s", Text.to_UTF8 ().Get_Data());
84 }
85 else
86 {
87 printf("%s", Text.to_ASCII().Get_Data());
88 }
89
90 if( End )
91 {
92 printf("%c", End);
93 }
94
95 if( bFlush )
96 {
97 fflush(stdout);
98 }
99 }
100
101 //---------------------------------------------------------
102 void SG_UI_Console_Print_StdErr(const char *Text, SG_Char End, bool bFlush) { SG_UI_Console_Print_StdErr(CSG_String(Text), End, bFlush); }
103 void SG_UI_Console_Print_StdErr(const wchar_t *Text, SG_Char End, bool bFlush) { SG_UI_Console_Print_StdErr(CSG_String(Text), End, bFlush); }
104 void SG_UI_Console_Print_StdErr(const CSG_String &Text, SG_Char End, bool bFlush)
105 {
106 if( gSG_UI_Console_bUTF8 )
107 {
108 fprintf(stderr, "%s", Text.to_UTF8 ().Get_Data());
109 }
110 else
111 {
112 fprintf(stderr, "%s", Text.to_ASCII().Get_Data());
113 }
114
115 if( End )
116 {
117 printf("%c", End);
118 }
119
120 if( bFlush )
121 {
122 fflush(stderr);
123 }
124 }
125
126
128 // //
129 // //
130 // //
132
133 //---------------------------------------------------------
134 TSG_PFNC_UI_Callback gSG_UI_Callback = NULL;
135
136 //---------------------------------------------------------
137 bool SG_Set_UI_Callback(TSG_PFNC_UI_Callback Function)
138 {
139 gSG_UI_Callback = Function;
140
141 return( true );
142 }
143
144 //---------------------------------------------------------
145 TSG_PFNC_UI_Callback SG_Get_UI_Callback(void)
146 {
147 return( gSG_UI_Callback );
148 }
149
150
152 // //
153 // //
154 // //
156
157 CSG_UI_Parameter::CSG_UI_Parameter(const CSG_UI_Parameter &Copy)
158 {
159 Boolean = Copy.Boolean;
160 Number = Copy.Number ;
161 Pointer = Copy.Pointer;
162 String = Copy.String ;
163 }
164
165
167 // //
168 // //
169 // //
171
172 //---------------------------------------------------------
173 int gSG_UI_Progress_Lock = 0;
174
175 //---------------------------------------------------------
176 int SG_UI_Progress_Lock(bool bOn)
177 {
178 if( bOn )
179 {
180 gSG_UI_Progress_Lock++;
181 }
182 else if( gSG_UI_Progress_Lock > 0 )
183 {
184 gSG_UI_Progress_Lock--;
185 }
186
187 return( gSG_UI_Progress_Lock );
188 }
189
190 //---------------------------------------------------------
191 int SG_UI_Progress_Reset(void)
192 {
193 int Locked = gSG_UI_Progress_Lock;
194
195 gSG_UI_Progress_Lock = 0;
196
197 return( Locked );
198 }
199
200 //---------------------------------------------------------
201 bool SG_UI_Process_Get_Okay(bool bBlink)
202 {
203 if( gSG_UI_Callback )
204 {
205 CSG_UI_Parameter p1(gSG_UI_Progress_Lock == 0 && bBlink), p2;
206
207 return( gSG_UI_Callback(CALLBACK_PROCESS_GET_OKAY, p1, p2) != 0 );
208 }
209
210 if( gSG_UI_Progress_Lock == 0 && bBlink )
211 {
212 static int iBuisy = 0; static const SG_Char Buisy[4] = { '|', '/', '-', '\\' };
213
214 SG_UI_Console_Print_StdOut(CSG_String::Format("\r%c", Buisy[iBuisy++]), '\0', true);
215
216 iBuisy %= 4;
217 }
218
219 return( true );
220 }
221
222 //---------------------------------------------------------
223 bool SG_UI_Process_Set_Okay(bool bOkay)
224 {
225 if( gSG_UI_Progress_Lock == 0 && gSG_UI_Callback )
226 {
227 CSG_UI_Parameter p1(bOkay), p2;
228
229 return( gSG_UI_Callback(CALLBACK_PROCESS_SET_OKAY, p1, p2) != 0 );
230 }
231
232 return( true );
233 }
234
235 //---------------------------------------------------------
236 bool SG_UI_Process_Set_Busy(bool bOn, const CSG_String &Message)
237 {
238 if( gSG_UI_Callback )
239 {
240 CSG_UI_Parameter p1(bOn), p2(Message);
241
242 return( gSG_UI_Callback(CALLBACK_PROCESS_SET_BUSY, p1, p2) != 0 );
243 }
244
245 return( true );
246 }
247
248 //---------------------------------------------------------
249 bool SG_UI_Process_Set_Progress(int Position, int Range)
250 {
251 return( SG_UI_Process_Set_Progress((double)Position, (double)Range) );
252 }
253
254 //---------------------------------------------------------
255 bool SG_UI_Process_Set_Progress(sLong Position, sLong Range)
256 {
257 return( SG_UI_Process_Set_Progress((double)Position, (double)Range) );
258 }
259
260 //---------------------------------------------------------
261 bool SG_UI_Process_Set_Progress(double Position, double Range)
262 {
263 if( gSG_UI_Progress_Lock > 0 )
264 {
265 return( SG_UI_Process_Get_Okay() );
266 }
267
268 if( gSG_UI_Callback )
269 {
270 CSG_UI_Parameter p1(Position), p2(Range);
271
272 return( gSG_UI_Callback(CALLBACK_PROCESS_SET_PROGRESS, p1, p2) != 0 );
273 }
274
275 //-----------------------------------------------------
276 static int Progress = -1;
277
278 int i = Position < 0. ? -1 : Range > 0. ? 1 + (int)(100. * Position / Range) : 100;
279
280 if( Progress != i )
281 {
282 if( Progress < 0 || i < Progress )
283 {
284 SG_UI_Console_Print_StdOut("", '\n', true);
285 }
286
287 Progress = i;
288
289 if( Progress >= 0 )
290 {
291 SG_UI_Console_Print_StdOut(CSG_String::Format("\r%3d%%", Progress > 100 ? 100 : Progress), '\0', true);
292 }
293 }
294
295 return( true );
296 }
297
298 //---------------------------------------------------------
299 bool SG_UI_Process_Set_Ready(void)
300 {
301 if( gSG_UI_Callback )
302 {
303 if( gSG_UI_Progress_Lock == 0 )
304 {
305 CSG_UI_Parameter p1, p2;
306
307 return( gSG_UI_Callback(CALLBACK_PROCESS_SET_READY, p1, p2) != 0 );
308 }
309 }
310
311 SG_UI_Process_Set_Progress(-1, -1);
312
313 return( true );
314 }
315
316 //---------------------------------------------------------
317 void SG_UI_Process_Set_Text(const CSG_String &Text)
318 {
319 if( gSG_UI_Progress_Lock == 0 )
320 {
321 if( gSG_UI_Callback )
322 {
323 CSG_UI_Parameter p1(Text), p2;
324
325 gSG_UI_Callback(CALLBACK_PROCESS_SET_TEXT, p1, p2);
326 }
327 else
328 {
329 SG_UI_Console_Print_StdOut(Text, '\n', true);
330 }
331 }
332 }
333
334
336 // //
337 // //
338 // //
340
341 //---------------------------------------------------------
342 bool SG_UI_Stop_Execution(bool bDialog)
343 {
344 if( gSG_UI_Callback )
345 {
346 CSG_UI_Parameter p1(bDialog), p2;
347
348 return( gSG_UI_Callback(CALLBACK_STOP_EXECUTION, p1, p2) != 0 );
349 }
350
351 return( false );
352 }
353
354
356 // //
357 // //
358 // //
360
361 //---------------------------------------------------------
362 void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
363 {
364 if( gSG_UI_Progress_Lock == 0 )
365 {
366 if( gSG_UI_Callback )
367 {
368 CSG_UI_Parameter p1(Message), p2(Caption);
369
370 gSG_UI_Callback(CALLBACK_DLG_MESSAGE, p1, p2);
371 }
372 else
373 {
374 SG_UI_Console_Print_StdOut(CSG_String::Format("%s: %s", Caption.c_str(), Message.c_str()), '\n', true);
375 }
376 }
377 }
378
379 //---------------------------------------------------------
380 bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
381 {
382 if( gSG_UI_Progress_Lock == 0 )
383 {
384 if( gSG_UI_Callback )
385 {
386 CSG_UI_Parameter p1(Message), p2(Caption);
387
388 return( gSG_UI_Callback(CALLBACK_DLG_CONTINUE, p1, p2) != 0 );
389 }
390 }
391
392 return( true );
393 }
394
395 //---------------------------------------------------------
396 int SG_UI_Dlg_Error(const CSG_String &Message, const CSG_String &Caption)
397 {
398 if( gSG_UI_Progress_Lock != 0 )
399 {
400 SG_UI_Msg_Add_Error(Caption);
401 SG_UI_Msg_Add_Error(Message);
402
403 return( 0 );
404 }
405
406 if( gSG_UI_Callback )
407 {
408 CSG_UI_Parameter p1(Message), p2(Caption);
409
410 return( gSG_UI_Callback(CALLBACK_DLG_ERROR, p1, p2) );
411 }
412
413 return( 0 );
414 }
415
416 //---------------------------------------------------------
417 void SG_UI_Dlg_Info(const CSG_String &Message, const CSG_String &Caption)
418 {
419 if( gSG_UI_Progress_Lock == 0 )
420 {
421 if( gSG_UI_Callback )
422 {
423 CSG_UI_Parameter p1(Message), p2(Caption);
424
425 gSG_UI_Callback(CALLBACK_DLG_INFO, p1, p2);
426 }
427 else
428 {
429 SG_UI_Console_Print_StdOut(CSG_String::Format("%s: %s", Caption.c_str(), Message.c_str()), '\n', true);
430 }
431 }
432 }
433
434
436 // //
437 // //
438 // //
440
441 //---------------------------------------------------------
442 bool SG_UI_Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption)
443 {
444 if( gSG_UI_Callback && pParameters )
445 {
446 CSG_UI_Parameter p1(pParameters), p2(Caption);
447
448 return( gSG_UI_Callback(CALLBACK_DLG_PARAMETERS, p1, p2) != 0 );
449 }
450
451 return( true );
452 }
453
454
456 // //
457 // //
458 // //
460
461 //---------------------------------------------------------
462 int gSG_UI_Msg_Lock = 0;
463
464 //---------------------------------------------------------
465 int SG_UI_Msg_Lock(bool bOn)
466 {
467 if( bOn )
468 {
469 gSG_UI_Msg_Lock++;
470 }
471 else if( gSG_UI_Msg_Lock > 0 )
472 {
473 gSG_UI_Msg_Lock--;
474 }
475
476 return( gSG_UI_Msg_Lock );
477 }
478
479 //---------------------------------------------------------
480 int SG_UI_Msg_Reset(void)
481 {
482 int Locked = gSG_UI_Msg_Lock;
483
484 gSG_UI_Msg_Lock = 0;
485
486 return( Locked );
487 }
488
489 //---------------------------------------------------------
490 void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style) { SG_UI_Msg_Add(CSG_String(Message), bNewLine, Style); }
491 void SG_UI_Msg_Add(const wchar_t *Message, bool bNewLine, TSG_UI_MSG_STYLE Style) { SG_UI_Msg_Add(CSG_String(Message), bNewLine, Style); }
492 void SG_UI_Msg_Add(const CSG_String &Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
493 {
494 if( !gSG_UI_Msg_Lock )
495 {
496 if( gSG_UI_Callback )
497 {
498 int Flags[2]; Flags[0] = bNewLine ? 1 : 0; Flags[1] = Style;
499
500 CSG_UI_Parameter p1(Message), p2(Flags);
501
502 gSG_UI_Callback(CALLBACK_MESSAGE_ADD, p1, p2);
503 }
504 else
505 {
506 if( bNewLine )
507 {
508 SG_UI_Console_Print_StdOut("");
509 }
510
511 SG_UI_Console_Print_StdOut(Message, '\0', true);
512 }
513 }
514 }
515
516 //---------------------------------------------------------
517 void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style) { SG_UI_Msg_Add_Execution(CSG_String(Message), bNewLine, Style); }
518 void SG_UI_Msg_Add_Execution(const wchar_t *Message, bool bNewLine, TSG_UI_MSG_STYLE Style) { SG_UI_Msg_Add_Execution(CSG_String(Message), bNewLine, Style); }
519 void SG_UI_Msg_Add_Execution(const CSG_String &Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
520 {
521 if( !gSG_UI_Msg_Lock )
522 {
523 if( gSG_UI_Callback )
524 {
525 int Flags[2]; Flags[0] = bNewLine ? 1 : 0; Flags[1] = Style;
526
527 CSG_UI_Parameter p1(Message), p2(Flags);
528
529 gSG_UI_Callback(CALLBACK_MESSAGE_ADD_EXECUTION, p1, p2);
530 }
531 else
532 {
533 if( bNewLine )
534 {
535 SG_UI_Console_Print_StdOut("");
536 }
537
538 SG_UI_Console_Print_StdOut(Message, '\0', true);
539 }
540 }
541 }
542
543 //---------------------------------------------------------
544 void SG_UI_Msg_Add_Error(const char *Message) { SG_UI_Msg_Add_Error(CSG_String(Message)); }
545 void SG_UI_Msg_Add_Error(const wchar_t *Message) { SG_UI_Msg_Add_Error(CSG_String(Message)); }
546 void SG_UI_Msg_Add_Error(const CSG_String &Message)
547 {
548 if( !gSG_UI_Msg_Lock )
549 {
550 if( gSG_UI_Callback )
551 {
552 CSG_UI_Parameter p1(Message), p2;
553
554 gSG_UI_Callback(CALLBACK_MESSAGE_ADD_ERROR, p1, p2);
555 }
556 else
557 {
558 SG_UI_Console_Print_StdErr(CSG_String::Format("\n[%s] %s", _TL("Error"), Message.c_str()), '\0', true);
559 }
560 }
561 }
562
563 //---------------------------------------------------------
564 void SG_UI_Msg_Flush(void)
565 {
566 fflush(stdout);
567 fflush(stderr);
568 }
569
571 // //
572 // //
573 // //
575
576 //---------------------------------------------------------
577 void SG_UI_ProgressAndMsg_Lock (bool bOn)
578 {
579 SG_UI_Progress_Lock(bOn);
580 SG_UI_Msg_Lock (bOn);
581 }
582
583 //---------------------------------------------------------
584 void SG_UI_ProgressAndMsg_Reset (void)
585 {
586 SG_UI_Progress_Reset();
587 SG_UI_Msg_Reset ();
588 }
589
590
592 // //
593 // //
594 // //
596
597 //---------------------------------------------------------
598 bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
599 {
600 if( gSG_UI_Callback && pDataObject )
601 {
602 CSG_UI_Parameter p1(pDataObject), p2(Show ? true : false);
603
604 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_ADD, p1, p2) != 0 );
605 }
606
607 return( false );
608 }
609
610 //---------------------------------------------------------
611 bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
612 {
613 if( gSG_UI_Callback && pDataObject )
614 {
615 CSG_UI_Parameter p1(pDataObject->Get_Owner() ? pDataObject->Get_Owner() : pDataObject), p2(pParameters);
616
617 if( gSG_UI_Callback(CALLBACK_DATAOBJECT_UPDATE, p1, p2) != 0 )
618 {
619 if( Show != SG_UI_DATAOBJECT_UPDATE )
620 {
621 SG_UI_DataObject_Show(pDataObject, Show);
622 }
623
624 return( true );
625 }
626 }
627
628 return( false );
629 }
630
631 //---------------------------------------------------------
632 bool SG_UI_DataObject_Show(CSG_Data_Object *pDataObject, int Show)
633 {
634 if( gSG_UI_Callback && pDataObject )
635 {
636 CSG_UI_Parameter p1(pDataObject), p2(Show);
637
638 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_SHOW, p1, p2) != 0 );
639 }
640
641 return( false );
642 }
643
644 //---------------------------------------------------------
645 bool SG_UI_DataObject_asImage(CSG_Data_Object *pDataObject, CSG_Grid *pGrid)
646 {
647 if( gSG_UI_Callback && pDataObject )
648 {
649 CSG_UI_Parameter p1(pDataObject), p2(pGrid);
650
651 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_ASIMAGE, p1, p2) != 0 );
652 }
653
654 return( false );
655 }
656
657 //---------------------------------------------------------
658 bool SG_UI_DataObject_Colors_Get(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
659 {
660 if( gSG_UI_Callback && pDataObject && pColors )
661 {
662 CSG_UI_Parameter p1(pDataObject), p2(pColors);
663
664 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_COLORS_GET, p1, p2) != 0 );
665 }
666
667 return( false );
668 }
669
670 //---------------------------------------------------------
671 bool SG_UI_DataObject_Colors_Set(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
672 {
673 if( gSG_UI_Progress_Lock == 0 && gSG_UI_Callback && pDataObject && pColors )
674 {
675 CSG_UI_Parameter p1(pDataObject), p2(pColors);
676
677 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_COLORS_SET, p1, p2) != 0 );
678 }
679
680 return( false );
681 }
682
683 //---------------------------------------------------------
684 bool SG_UI_DataObject_Params_Get (CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
685 {
686 if( gSG_UI_Callback && pDataObject && pParameters )
687 {
688 CSG_UI_Parameter p1(pDataObject), p2(pParameters);
689
690 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_PARAMS_GET, p1, p2) != 0 );
691 }
692
693 return( false );
694 }
695
696 //---------------------------------------------------------
697 bool SG_UI_DataObject_Params_Set (CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
698 {
699 if( gSG_UI_Progress_Lock == 0 && gSG_UI_Callback && pDataObject && pParameters )
700 {
701 CSG_UI_Parameter p1(pDataObject), p2(pParameters);
702
703 return( gSG_UI_Callback(CALLBACK_DATAOBJECT_PARAMS_SET, p1, p2) != 0 );
704 }
705
706 return( false );
707 }
708
709 //---------------------------------------------------------
710 bool SG_UI_Set_Map_Extent (double xMin, double yMin, double xMax, double yMax, int Maps)
711 {
712 if( gSG_UI_Callback )
713 {
714 CSG_Rect r(xMin, yMin, xMax, yMax); CSG_UI_Parameter p1(&r), p2(Maps);
715
716 return( gSG_UI_Callback(CALLBACK_SET_MAP_EXTENT, p1, p2) != 0 );
717 }
718
719 return( false );
720 }
721
722 //---------------------------------------------------------
723 bool SG_UI_Diagram_Show (class CSG_Table *pTable, class CSG_Parameters *pParameters)
724 {
725 if( gSG_UI_Callback && SG_UI_DataObject_Update(pTable, SG_UI_DATAOBJECT_UPDATE, NULL) )
726 {
727 CSG_UI_Parameter p1(pTable), p2(pParameters);
728
729 return( gSG_UI_Callback(CALLBACK_DIAGRAM_SHOW, p1, p2) != 0 );
730 }
731
732 return( false );
733 }
734
735 //---------------------------------------------------------
736 bool SG_UI_ODBC_Update (const CSG_String &Server)
737 {
738 if( gSG_UI_Callback )
739 {
740 CSG_UI_Parameter p1(Server), p2;
741
742 return( gSG_UI_Callback(CALLBACK_DATABASE_UPDATE, p1, p2) != 0 );
743 }
744
745 return( false );
746 }
747
748
750 // //
751 // //
752 // //
754
755 //---------------------------------------------------------
756 int SG_UI_Window_Arrange (int Arrange)
757 {
758 if( gSG_UI_Callback )
759 {
760 CSG_UI_Parameter p1, p2;
761
762 gSG_UI_Callback(CALLBACK_WINDOW_ARRANGE, p1, p2);
763
764 return( 1 );
765 }
766
767 return( 0 );
768 }
769
770 //---------------------------------------------------------
771 void * SG_UI_Get_Window_Main (void)
772 {
773 if( gSG_UI_Callback )
774 {
775 CSG_UI_Parameter p1, p2;
776
777 gSG_UI_Callback(CALLBACK_GET_APP_WINDOW, p1, p2);
778
779 return( p1.Pointer );
780 }
781
782 return( NULL );
783 }
784
785 //---------------------------------------------------------
786 CSG_String SG_UI_Get_Application_Path (bool bPathOnly)
787 {
788 CSG_String App_Path(wxStandardPaths::Get().GetExecutablePath().wc_str());
789
790 if( bPathOnly )
791 {
792 App_Path = SG_File_Get_Path(App_Path);
793 }
794
795 return( SG_File_Get_Path_Absolute(App_Path) );
796 }
797
798
800 // //
801 // //
802 // //
804
805 //---------------------------------------------------------
gSG_UI_Progress_Lock
int gSG_UI_Progress_Lock
Definition: api_callback.cpp:173
CSG_Rect
Definition: geo_tools.h:471
SG_File_Get_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
gSG_UI_Msg_Lock
int gSG_UI_Msg_Lock
Definition: api_callback.cpp:462
CALLBACK_DLG_CONTINUE
@ CALLBACK_DLG_CONTINUE
Definition: api_core.h:1554
CALLBACK_PROCESS_SET_BUSY
@ CALLBACK_PROCESS_SET_BUSY
Definition: api_core.h:1546
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_UI_DataObject_Params_Set
bool SG_UI_DataObject_Params_Set(CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
Definition: api_callback.cpp:697
CSG_String::to_ASCII
bool to_ASCII(char **pString, char Replace='_') const
Definition: api_string.cpp:909
CALLBACK_DATAOBJECT_COLORS_GET
@ CALLBACK_DATAOBJECT_COLORS_GET
Definition: api_core.h:1569
SG_UI_Msg_Reset
int SG_UI_Msg_Reset(void)
Definition: api_callback.cpp:480
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(void)
Definition: api_core.h:1591
SG_UI_Dlg_Continue
bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:380
SG_Set_UI_Callback
bool SG_Set_UI_Callback(TSG_PFNC_UI_Callback Function)
Definition: api_callback.cpp:137
CALLBACK_STOP_EXECUTION
@ CALLBACK_STOP_EXECUTION
Definition: api_core.h:1551
CALLBACK_DIAGRAM_SHOW
@ CALLBACK_DIAGRAM_SHOW
Definition: api_core.h:1576
gSG_UI_Callback
TSG_PFNC_UI_Callback gSG_UI_Callback
Definition: api_callback.cpp:134
CALLBACK_DLG_INFO
@ CALLBACK_DLG_INFO
Definition: api_core.h:1556
CALLBACK_DATABASE_UPDATE
@ CALLBACK_DATABASE_UPDATE
Definition: api_core.h:1578
SG_UI_Msg_Add_Execution
void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:517
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
SG_UI_ProgressAndMsg_Reset
void SG_UI_ProgressAndMsg_Reset(void)
Definition: api_callback.cpp:584
SG_UI_Process_Set_Okay
bool SG_UI_Process_Set_Okay(bool bOkay)
Definition: api_callback.cpp:223
SG_UI_Console_Print_StdOut
void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End, bool bFlush)
Definition: api_callback.cpp:77
SG_UI_Stop_Execution
bool SG_UI_Stop_Execution(bool bDialog)
Definition: api_callback.cpp:342
grid.h
CALLBACK_PROCESS_SET_OKAY
@ CALLBACK_PROCESS_SET_OKAY
Definition: api_core.h:1545
api_core.h
CALLBACK_PROCESS_SET_PROGRESS
@ CALLBACK_PROCESS_SET_PROGRESS
Definition: api_core.h:1547
SG_UI_Get_Application_Path
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
Definition: api_callback.cpp:786
CSG_UI_Parameter::String
CSG_String String
Definition: api_core.h:1605
SG_UI_DataObject_Show
bool SG_UI_DataObject_Show(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:632
SG_Get_UI_Callback
TSG_PFNC_UI_Callback SG_Get_UI_Callback(void)
Definition: api_callback.cpp:145
SG_UI_Progress_Reset
int SG_UI_Progress_Reset(void)
Definition: api_callback.cpp:191
CSG_Data_Object::Get_Owner
CSG_Data_Object * Get_Owner(void) const
Definition: dataobject.h:222
SG_UI_Set_Map_Extent
bool SG_UI_Set_Map_Extent(double xMin, double yMin, double xMax, double yMax, int Maps)
Definition: api_callback.cpp:710
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1509
TSG_PFNC_UI_Callback
int(* TSG_PFNC_UI_Callback)(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)
Definition: api_core.h:1610
SG_UI_ODBC_Update
bool SG_UI_ODBC_Update(const CSG_String &Server)
Definition: api_callback.cpp:736
SG_UI_Dlg_Message
void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:362
CSG_Data_Object
Definition: dataobject.h:180
SG_UI_Dlg_Info
void SG_UI_Dlg_Info(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:417
CALLBACK_SET_MAP_EXTENT
@ CALLBACK_SET_MAP_EXTENT
Definition: api_core.h:1574
SG_UI_Process_Set_Busy
bool SG_UI_Process_Set_Busy(bool bOn, const CSG_String &Message)
Definition: api_callback.cpp:236
SG_UI_Console_Set_UTF8
void SG_UI_Console_Set_UTF8(bool bOn)
Definition: api_callback.cpp:73
CALLBACK_DATAOBJECT_UPDATE
@ CALLBACK_DATAOBJECT_UPDATE
Definition: api_core.h:1565
CALLBACK_DLG_PARAMETERS
@ CALLBACK_DLG_PARAMETERS
Definition: api_core.h:1558
CALLBACK_PROCESS_SET_READY
@ CALLBACK_PROCESS_SET_READY
Definition: api_core.h:1548
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
SG_UI_Dlg_Parameters
bool SG_UI_Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption)
Definition: api_callback.cpp:442
SG_UI_DataObject_Update
bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
Definition: api_callback.cpp:611
CALLBACK_DATAOBJECT_ADD
@ CALLBACK_DATAOBJECT_ADD
Definition: api_core.h:1564
sLong
signed long long sLong
Definition: api_core.h:158
CALLBACK_DATAOBJECT_SHOW
@ CALLBACK_DATAOBJECT_SHOW
Definition: api_core.h:1566
CSG_UI_Parameter::Number
double Number
Definition: api_core.h:1601
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:598
SG_UI_DataObject_Colors_Set
bool SG_UI_DataObject_Colors_Set(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
Definition: api_callback.cpp:671
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
CALLBACK_DATAOBJECT_PARAMS_SET
@ CALLBACK_DATAOBJECT_PARAMS_SET
Definition: api_core.h:1572
SG_UI_Progress_Lock
int SG_UI_Progress_Lock(bool bOn)
Definition: api_callback.cpp:176
CALLBACK_DLG_ERROR
@ CALLBACK_DLG_ERROR
Definition: api_core.h:1555
CSG_UI_Parameter::Pointer
void * Pointer
Definition: api_core.h:1603
CALLBACK_MESSAGE_ADD_EXECUTION
@ CALLBACK_MESSAGE_ADD_EXECUTION
Definition: api_core.h:1562
CALLBACK_PROCESS_SET_TEXT
@ CALLBACK_PROCESS_SET_TEXT
Definition: api_core.h:1549
CSG_UI_Parameter
Definition: api_core.h:1589
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_UI_DataObject_Colors_Get
bool SG_UI_DataObject_Colors_Get(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
Definition: api_callback.cpp:658
CSG_Table
Definition: table.h:283
CALLBACK_MESSAGE_ADD_ERROR
@ CALLBACK_MESSAGE_ADD_ERROR
Definition: api_core.h:1561
SG_UI_Dlg_Error
int SG_UI_Dlg_Error(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:396
CSG_String::to_UTF8
size_t to_UTF8(char **pString) const
Definition: api_string.cpp:813
SG_File_Get_Path_Absolute
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
Definition: api_file.cpp:883
SG_UI_DataObject_Params_Get
bool SG_UI_DataObject_Params_Get(CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
Definition: api_callback.cpp:684
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
CALLBACK_GET_APP_WINDOW
@ CALLBACK_GET_APP_WINDOW
Definition: api_core.h:1582
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CALLBACK_WINDOW_ARRANGE
@ CALLBACK_WINDOW_ARRANGE
Definition: api_core.h:1580
CALLBACK_MESSAGE_ADD
@ CALLBACK_MESSAGE_ADD
Definition: api_core.h:1560
SG_UI_Console_Get_UTF8
bool SG_UI_Console_Get_UTF8(void)
Definition: api_callback.cpp:74
CSG_Grid
Definition: grid.h:473
SG_UI_Diagram_Show
bool SG_UI_Diagram_Show(class CSG_Table *pTable, class CSG_Parameters *pParameters)
Definition: api_callback.cpp:723
SG_UI_Window_Arrange
int SG_UI_Window_Arrange(int Arrange)
Definition: api_callback.cpp:756
CALLBACK_DATAOBJECT_PARAMS_GET
@ CALLBACK_DATAOBJECT_PARAMS_GET
Definition: api_core.h:1571
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:771
gSG_UI_Console_bUTF8
static bool gSG_UI_Console_bUTF8
Definition: api_callback.cpp:70
CALLBACK_PROCESS_GET_OKAY
@ CALLBACK_PROCESS_GET_OKAY
Definition: api_core.h:1544
SG_UI_DataObject_asImage
bool SG_UI_DataObject_asImage(CSG_Data_Object *pDataObject, CSG_Grid *pGrid)
Definition: api_callback.cpp:645
CALLBACK_DLG_MESSAGE
@ CALLBACK_DLG_MESSAGE
Definition: api_core.h:1553
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
TSG_UI_MSG_STYLE
TSG_UI_MSG_STYLE
Definition: api_core.h:1492
CSG_UI_Parameter::Boolean
bool Boolean
Definition: api_core.h:1599
CSG_Parameters
Definition: parameters.h:1650
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
SG_UI_Msg_Flush
void SG_UI_Msg_Flush(void)
Definition: api_callback.cpp:564
SG_UI_Console_Print_StdErr
void SG_UI_Console_Print_StdErr(const char *Text, SG_Char End, bool bFlush)
Definition: api_callback.cpp:102
CALLBACK_DATAOBJECT_ASIMAGE
@ CALLBACK_DATAOBJECT_ASIMAGE
Definition: api_core.h:1567
CALLBACK_DATAOBJECT_COLORS_SET
@ CALLBACK_DATAOBJECT_COLORS_SET
Definition: api_core.h:1570
CSG_Colors
Definition: api_core.h:1329
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_colors.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
api_colors.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include "api_core.h"
#include "mat_tools.h"

Go to the source code of this file.

Macros

#define | COLORS_SERIAL_VERSION_BINARY "SAGA_COLORPALETTE_VERSION_0.100_BINARY"
#define | COLORS_SERIAL_VERSION__ASCII "SAGA_COLORPALETTE_VERSION_0.100__ASCII"

Functions

CSG_String | SG_Colors_Get_Name (int Index)
long | SG_Color_Get_Random (void)
bool | SG_Color_From_Text (const CSG_String &Text, long &Color)
CSG_String | SG_Color_To_Text (long Color, bool bHexadecimal)

Macro Definition Documentation

◆ COLORS_SERIAL_VERSION__ASCII

#define COLORS_SERIAL_VERSION__ASCII "SAGA_COLORPALETTE_VERSION_0.100__ASCII"

Definition at line 1049 of file api_colors.cpp.

◆ COLORS_SERIAL_VERSION_BINARY

#define COLORS_SERIAL_VERSION_BINARY "SAGA_COLORPALETTE_VERSION_0.100_BINARY"

Definition at line 1048 of file api_colors.cpp.

Function Documentation

◆ SG_Color_From_Text()

bool SG_Color_From_Text | ( | const CSG_String & | Text,
 |  | long & | Color
 | ) |  |

Definition at line 79 of file api_colors.cpp.

References CSG_String::b_str(), CSG_String::Get_Char(), CSG_String::is_Empty(), CSG_String::Length(), SG_GET_RGB, and SG_GET_RGBA.

Referenced by CSG_Parameter_Color::_Set_Value().

◆ SG_Color_Get_Random()

long SG_Color_Get_Random ( void )

Definition at line 73 of file api_colors.cpp.

References CSG_Random::Get_Uniform(), and SG_GET_RGB.

◆ SG_Color_To_Text()

CSG_String SG_Color_To_Text | ( | long | Color,
 |  | bool | bHexadecimal
 | ) |  |

Definition at line 138 of file api_colors.cpp.

References CSG_String::Printf(), SG_GET_B, SG_GET_G, and SG_GET_R.

◆ SG_Colors_Get_Name()

CSG_String SG_Colors_Get_Name ( int Index )

Definition at line 67 of file api_colors.cpp.

References CSG_Colors::Get_Predefined_Name().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_colors.cpp Source File

  • saga_core
  • saga_api
api_colors.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_colors.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <stdlib.h>
54 #include <string.h>
55
56 #include "api_core.h"
57 #include "mat_tools.h"
58
59
61 // //
62 // //
63 // //
65
66 //---------------------------------------------------------
67 CSG_String SG_Colors_Get_Name (int Index)
68 {
69 return( CSG_Colors::Get_Predefined_Name(Index) );
70 }
71
72 //---------------------------------------------------------
73 long SG_Color_Get_Random (void)
74 {
75 return( SG_GET_RGB(CSG_Random::Get_Uniform(0, 255), CSG_Random::Get_Uniform(0, 255), CSG_Random::Get_Uniform(0, 255)) );
76 }
77
78 //---------------------------------------------------------
79 bool SG_Color_From_Text (const CSG_String &Text, long &Color)
80 { // from wx/src/common/colourcmn.cpp, hexadecimal prefixed with # ("HTML syntax") see https://drafts.csswg.org/css-color/#hex-notation
81
82 if( Text.is_Empty() || Text.Get_Char(0) != L'#' )
83 {
84 return( false );
85 }
86
87 const char *s = Text.b_str(); unsigned long c;
88
89 if( sscanf(s + 1, "%lx", &c) == 1 )
90 {
91 switch( Text.Length() - 1 )
92 {
93 case 6: // #rrggbb
94 c = (c << 8) + 0xFF;
95 Color = SG_GET_RGB(
96 (unsigned char)((c >> 24) & 0xFF),
97 (unsigned char)((c >> 16) & 0xFF),
98 (unsigned char)((c >> 8) & 0xFF)
99 );
100 return( true );
101
102 case 8: // #rrggbbaa
103 Color = SG_GET_RGBA(
104 (unsigned char)((c >> 24) & 0xFF),
105 (unsigned char)((c >> 16) & 0xFF),
106 (unsigned char)((c >> 8) & 0xFF),
107 (unsigned char)((c ) & 0xFF)
108 );
109 return( true );
110
111 case 3: // #rgb
112 c = (c << 4) + 0xF;
113 Color = SG_GET_RGB(
114 (unsigned char)(((c >> 12) & 0xF) * 0x11),
115 (unsigned char)(((c >> 8) & 0xF) * 0x11),
116 (unsigned char)(((c >> 4) & 0xF) * 0x11)
117 );
118 return( true );
119
120 case 4: // #rgba
121 Color = SG_GET_RGBA(
122 (unsigned char)(((c >> 12) & 0xF) * 0x11),
123 (unsigned char)(((c >> 8) & 0xF) * 0x11),
124 (unsigned char)(((c >> 4) & 0xF) * 0x11),
125 (unsigned char)(((c ) & 0xF) * 0x11)
126 );
127 return( true );
128
129 default:
130 return( false ); // unrecognized
131 }
132 }
133
134 return( false );
135 }
136
137 //---------------------------------------------------------
138 CSG_String SG_Color_To_Text (long Color, bool bHexadecimal)
139 {
140 CSG_String Text;
141
142 if( bHexadecimal )
143 {
144 Text.Printf("#%02X%02X%02X",
145 SG_GET_R(Color),
146 SG_GET_G(Color),
147 SG_GET_B(Color)
148 );
149 }
150 else
151 {
152 Text.Printf("%ld", Color);
153 }
154
155 return( Text );
156 }
157
158
160 // //
161 // //
162 // //
164
165 //---------------------------------------------------------
166 CSG_Colors::CSG_Colors(void)
167 {
168 m_Colors = NULL;
169 m_nColors = 0;
170
171 Create();
172 }
173
174 //---------------------------------------------------------
175 CSG_Colors::CSG_Colors(const CSG_Colors &Colors)
176 {
177 m_Colors = NULL;
178 m_nColors = 0;
179
180 Create(Colors);
181 }
182
183 //---------------------------------------------------------
184 CSG_Colors::CSG_Colors(int nColors, int Palette, bool bRevert)
185 {
186 m_Colors = NULL;
187 m_nColors = 0;
188
189 Create(nColors, Palette, bRevert);
190 }
191
192 //---------------------------------------------------------
193 CSG_Colors::~CSG_Colors(void)
194 {
195 Destroy();
196 }
197
198
200 // //
202
203 //---------------------------------------------------------
204 bool CSG_Colors::Create(void)
205 {
206 return( Create(11) );
207 }
208
209 //---------------------------------------------------------
210 bool CSG_Colors::Create(const CSG_Colors &Colors)
211 {
212 if( Colors.m_nColors > 0 )
213 {
214 m_nColors = Colors.m_nColors;
215 m_Colors = (long *)SG_Realloc(m_Colors, m_nColors * sizeof(long));
216
217 memcpy(m_Colors, Colors.m_Colors, m_nColors * sizeof(long));
218
219 return( true );
220 }
221
222 return( false );
223 }
224
225 //---------------------------------------------------------
226 bool CSG_Colors::Create(int nColors, int Palette, bool bRevert)
227 {
228 if( nColors <= 1 )
229 {
230 nColors = 11;
231 }
232
233 Set_Count(nColors);
234
235 Set_Palette(Palette, bRevert, nColors);
236
237 return( true );
238 }
239
240 //---------------------------------------------------------
241 void CSG_Colors::Destroy(void)
242 {
243 if( m_nColors > 0 )
244 {
245 SG_Free(m_Colors);
246
247 m_Colors = NULL;
248 m_nColors = 0;
249 }
250 }
251
252
254 // //
256
257 //---------------------------------------------------------
258 bool CSG_Colors::Set_Count(int nColors)
259 {
260 if( nColors == m_nColors )
261 {
262 return( true );
263 }
264
265 if( nColors < 1 )
266 {
267 return( false );
268 }
269
270 if( m_nColors == 0 )
271 {
272 return( Set_Default(nColors) );
273 }
274
275 //-----------------------------------------------------
276 CSG_Colors Colors(*this);
277
278 m_nColors = nColors;
279 m_Colors = (long *)SG_Realloc(m_Colors, m_nColors * sizeof(long));
280
281 double dStep = Get_Count() > 1 ? (Colors.Get_Count() - 1.0) / (Get_Count() - 1.0) : 0.0;
282
283 for(int i=0; i<Get_Count(); i++)
284 {
285 if( Get_Count() < Colors.Get_Count() )
286 {
287 m_Colors[i] = Colors[(int)(i * dStep)];
288 }
289 else // if( Get_Count() > Colors.Get_Count() )
290 {
291 m_Colors[i] = Colors.Get_Interpolated(i * dStep);
292 }
293 }
294
295 //---------------------------------------------
296 return( true );
297 }
298
299
301 // //
303
304 //---------------------------------------------------------
305 bool CSG_Colors::Set_Color(int Index, long Color)
306 {
307 if( Index >= 0 && Index < m_nColors )
308 {
309 m_Colors[Index] = Color;
310
311 return( true );
312 }
313
314 return( false );
315 }
316
317 //---------------------------------------------------------
318 bool CSG_Colors::Set_Color(int Index, int Red, int Green, int Blue)
319 {
320 return( Set_Color(Index, SG_GET_RGB(Red, Green, Blue)) );
321 }
322
323 //---------------------------------------------------------
324 bool CSG_Colors::Set_Red(int Index, int Value)
325 {
326 return( Set_Color(Index, Value , Get_Green(Index) , Get_Blue(Index)) );
327 }
328
329 //---------------------------------------------------------
330 bool CSG_Colors::Set_Green(int Index, int Value)
331 {
332 return( Set_Color(Index, Get_Red(Index) , Value , Get_Blue(Index)) );
333 }
334
335 //---------------------------------------------------------
336 bool CSG_Colors::Set_Blue(int Index, int Value)
337 {
338 return( Set_Color(Index, Get_Red(Index) , Get_Green(Index) , Value) );
339 }
340
341 //---------------------------------------------------------
342 bool CSG_Colors::Set_Brightness(int Index, int Value)
343 {
344 double r, g, b, ds;
345
346 //-----------------------------------------------------
347 if( Value < 0 )
348 {
349 Value = 0;
350 }
351 else if( Value > 255 )
352 {
353 Value = 255;
354 }
355
356 //-----------------------------------------------------
357 r = Get_Red (Index);
358 g = Get_Green(Index);
359 b = Get_Blue (Index);
360 ds = (r + g + b) / 3.0;
361
362 if( ds > 0.0 )
363 {
364 ds = Value / ds;
365 r *= ds;
366 g *= ds;
367 b *= ds;
368
369 _Set_Brightness(r, g, b);
370 }
371 else
372 {
373 r = g = b = Value / 3.0;
374 }
375
376 return( Set_Color(Index, (int)r, (int)g, (int)b) );
377 }
378
379 //---------------------------------------------------------
380 void CSG_Colors::_Set_Brightness(double &a, double &b, double &c, int Pass)
381 {
382 if( a > 255 )
383 {
384 int addSum;
385
386 addSum = (int)((a - 255) / 2.0);
387 a = 255;
388
389 b += addSum;
390 c += addSum;
391
392 if( b > 255 )
393 {
394 addSum = (int)(b - 255);
395 b = 255;
396
397 c += addSum;
398
399 if( c > 255 )
400 {
401 c = 255;
402 }
403 }
404 else if( c > 255 )
405 {
406 addSum = (int)(c - 255);
407 c = 255;
408
409 b += addSum;
410
411 if( b > 255 )
412 {
413 b = 255;
414 }
415 }
416 }
417 else if( Pass < 2 )
418 {
419 _Set_Brightness(b, c, a, Pass + 1);
420 }
421 }
422
423
425 // //
427
428 //---------------------------------------------------------
429 int CSG_Colors::Get_Predefined_Count(void)
430 {
431 return( SG_COLORS_COUNT );
432 }
433
434 //---------------------------------------------------------
435 CSG_String CSG_Colors::Get_Predefined_Name(int Index)
436 {
437 switch( Index )
438 {
439 case SG_COLORS_DEFAULT : return( _TL("default" ) );
440 case SG_COLORS_DEFAULT_BRIGHT : return( _TL("default (same brightness)") );
441 case SG_COLORS_BLACK_WHITE : return( _TL("greyscale" ) );
442 case SG_COLORS_BLACK_RED : return( _TL("black > red" ) );
443 case SG_COLORS_BLACK_GREEN : return( _TL("black > green" ) );
444 case SG_COLORS_BLACK_BLUE : return( _TL("black > blue" ) );
445 case SG_COLORS_WHITE_RED : return( _TL("white > red" ) );
446 case SG_COLORS_WHITE_GREEN : return( _TL("white > green" ) );
447 case SG_COLORS_WHITE_BLUE : return( _TL("white > blue" ) );
448 case SG_COLORS_YELLOW_RED : return( _TL("yellow > red" ) );
449 case SG_COLORS_YELLOW_GREEN : return( _TL("yellow > green" ) );
450 case SG_COLORS_YELLOW_BLUE : return( _TL("yellow > blue" ) );
451 case SG_COLORS_GREEN_RED : return( _TL("green > red" ) );
452 case SG_COLORS_RED_GREEN : return( _TL("red > green" ) );
453 case SG_COLORS_RED_BLUE : return( _TL("red > blue" ) );
454 case SG_COLORS_GREEN_BLUE : return( _TL("green > blue" ) );
455 case SG_COLORS_RED_GREY_BLUE : return( _TL("red > grey > blue" ) );
456 case SG_COLORS_RED_GREY_GREEN : return( _TL("red > grey > green" ) );
457 case SG_COLORS_GREEN_GREY_BLUE: return( _TL("green > grey > blue" ) );
458 case SG_COLORS_RED_GREEN_BLUE : return( _TL("red > green > blue" ) );
459 case SG_COLORS_RED_BLUE_GREEN : return( _TL("red > blue > green" ) );
460 case SG_COLORS_GREEN_RED_BLUE : return( _TL("green > red > blue" ) );
461 case SG_COLORS_RAINBOW : return( _TL("rainbow" ) );
462 case SG_COLORS_NEON : return( _TL("neon" ) );
463 case SG_COLORS_TOPOGRAPHY : return( _TL("topography 1" ) );
464 case SG_COLORS_TOPOGRAPHY_2 : return( _TL("topography 2" ) );
465 case SG_COLORS_TOPOGRAPHY_3 : return( _TL("topography 3" ) );
466 case SG_COLORS_PRECIPITATION : return( _TL("precipitation" ) );
467 case SG_COLORS_ASPECT_1 : return( _TL("aspect 1" ) );
468 case SG_COLORS_ASPECT_2 : return( _TL("aspect 2" ) );
469 case SG_COLORS_ASPECT_3 : return( _TL("aspect 3" ) );
470 default : return( _TL("" ) );
471 }
472 }
473
474 //---------------------------------------------------------
475 bool CSG_Colors::Set_Predefined(int Index, bool bRevert, int nColors)
476 {
477 switch( Index )
478 {
479 case SG_COLORS_DEFAULT:
480 Set_Default(nColors);
481 break;
482
483 case SG_COLORS_DEFAULT_BRIGHT:
484 Set_Default(nColors);
485 Set_Ramp_Brighness(127, 127);
486 break;
487
488 case SG_COLORS_BLACK_WHITE:
489 Set_Ramp(SG_GET_RGB( 0, 0, 0), SG_GET_RGB(255, 255, 255));
490 break;
491
492 case SG_COLORS_BLACK_RED:
493 Set_Ramp(SG_GET_RGB( 0, 0, 0), SG_GET_RGB(255, 0, 0));
494 break;
495
496 case SG_COLORS_BLACK_GREEN:
497 Set_Ramp(SG_GET_RGB( 0, 0, 0), SG_GET_RGB( 0, 255, 0));
498 break;
499
500 case SG_COLORS_BLACK_BLUE:
501 Set_Ramp(SG_GET_RGB( 0, 0, 0), SG_GET_RGB( 0, 0, 255));
502 break;
503
504 case SG_COLORS_WHITE_RED:
505 Set_Count(3);
506 Set_Color(0, SG_GET_RGB(255, 255, 255));
507 Set_Color(1, SG_GET_RGB(255, 127, 0));
508 Set_Color(2, SG_GET_RGB(159, 0, 0));
509 break;
510
511 case SG_COLORS_WHITE_GREEN:
512 Set_Ramp(SG_GET_RGB(255, 255, 255), SG_GET_RGB( 0, 127, 0));
513 break;
514
515 case SG_COLORS_WHITE_BLUE:
516 Set_Count(3);
517 Set_Color(0, SG_GET_RGB(255, 255, 255));
518 Set_Color(1, SG_GET_RGB( 0, 127, 255));
519 Set_Color(2, SG_GET_RGB( 0, 0, 159));
520 break;
521
522 case SG_COLORS_YELLOW_RED:
523 Set_Count(3);
524 Set_Color(0, SG_GET_RGB(255, 255, 127));
525 Set_Color(1, SG_GET_RGB(255, 127, 0));
526 Set_Color(2, SG_GET_RGB(127, 0, 0));
527 break;
528
529 case SG_COLORS_YELLOW_GREEN:
530 Set_Count(3);
531 Set_Color(0, SG_GET_RGB(255, 255, 127));
532 Set_Color(1, SG_GET_RGB(127, 255, 0));
533 Set_Color(2, SG_GET_RGB( 0, 127, 0));
534 break;
535
536 case SG_COLORS_YELLOW_BLUE:
537 Set_Count(3);
538 Set_Color(0, SG_GET_RGB(255, 255, 200));
539 Set_Color(1, SG_GET_RGB(127, 192, 255));
540 Set_Color(2, SG_GET_RGB( 0, 64, 127));
541 break;
542
543 case SG_COLORS_GREEN_RED:
544 Set_Count(3);
545 Set_Color(0, SG_GET_RGB( 0, 127, 0));
546 Set_Color(1, SG_GET_RGB(255, 255, 0));
547 Set_Color(2, SG_GET_RGB(255, 0, 0));
548 break;
549
550 case SG_COLORS_RED_GREEN:
551 Set_Count(3);
552 Set_Color(0, SG_GET_RGB(200, 0, 0));
553 Set_Color(1, SG_GET_RGB(255, 255, 127));
554 Set_Color(2, SG_GET_RGB( 0, 63, 0));
555 break;
556
557 case SG_COLORS_RED_BLUE:
558 Set_Ramp(SG_GET_RGB(255, 0, 0), SG_GET_RGB( 0, 0, 255));
559 break;
560
561 case SG_COLORS_GREEN_BLUE:
562 Set_Ramp(SG_GET_RGB( 0, 255, 0), SG_GET_RGB( 0, 0, 255));
563 break;
564
565 case SG_COLORS_RED_GREY_BLUE:
566 Set_Count(5);
567 Set_Color(0, SG_GET_RGB(127, 0, 0));
568 Set_Color(1, SG_GET_RGB(255, 127, 0));
569 Set_Color(2, SG_GET_RGB(239, 239, 239));
570 Set_Color(3, SG_GET_RGB( 0, 127, 255));
571 Set_Color(4, SG_GET_RGB( 0, 0, 127));
572 break;
573
574 case SG_COLORS_RED_GREY_GREEN:
575 Set_Count(5);
576 Set_Color(0, SG_GET_RGB(127, 0, 0));
577 Set_Color(1, SG_GET_RGB(255, 127, 0));
578 Set_Color(2, SG_GET_RGB(239, 239, 239));
579 Set_Color(3, SG_GET_RGB( 0, 255, 127));
580 Set_Color(4, SG_GET_RGB( 0, 127, 0));
581 break;
582
583 case SG_COLORS_GREEN_GREY_BLUE:
584 Set_Count(5);
585 Set_Color(0, SG_GET_RGB( 0, 127, 0));
586 Set_Color(1, SG_GET_RGB(127, 255, 0));
587 Set_Color(2, SG_GET_RGB(239, 239, 239));
588 Set_Color(3, SG_GET_RGB( 0, 127, 255));
589 Set_Color(4, SG_GET_RGB( 0, 0, 127));
590 break;
591
592 case SG_COLORS_RED_GREEN_BLUE:
593 Set_Count(5);
594 Set_Color(0, SG_GET_RGB(127, 0, 127));
595 Set_Color(1, SG_GET_RGB(255, 0, 0));
596 Set_Color(2, SG_GET_RGB( 0, 255, 0));
597 Set_Color(3, SG_GET_RGB( 0, 0, 255));
598 Set_Color(4, SG_GET_RGB(127, 0, 127));
599 break;
600
601 case SG_COLORS_RED_BLUE_GREEN:
602 Set_Count(5);
603 Set_Color(0, SG_GET_RGB(127, 127, 0));
604 Set_Color(1, SG_GET_RGB(255, 0, 0));
605 Set_Color(2, SG_GET_RGB( 0, 0, 255));
606 Set_Color(3, SG_GET_RGB( 0, 255, 0));
607 Set_Color(4, SG_GET_RGB(127, 127, 0));
608 break;
609
610 case SG_COLORS_GREEN_RED_BLUE:
611 Set_Count(5);
612 Set_Color(0, SG_GET_RGB( 0, 127, 127));
613 Set_Color(1, SG_GET_RGB( 0, 255, 0));
614 Set_Color(2, SG_GET_RGB(255, 0, 0));
615 Set_Color(3, SG_GET_RGB( 0, 0, 255));
616 Set_Color(4, SG_GET_RGB( 0, 127, 127));
617 break;
618
619 case SG_COLORS_RAINBOW:
620 Set_Count(8);
621 Set_Color(0, SG_GET_RGB( 64, 0, 127));
622 Set_Color(1, SG_GET_RGB( 0, 0, 255));
623 Set_Color(2, SG_GET_RGB( 0, 255, 255));
624 Set_Color(3, SG_GET_RGB( 0, 191, 0));
625 Set_Color(4, SG_GET_RGB(255, 255, 0));
626 Set_Color(5, SG_GET_RGB(255, 127, 0));
627 Set_Color(6, SG_GET_RGB(255, 0, 0));
628 Set_Color(7, SG_GET_RGB(127, 0, 0));
629 break;
630
631 case SG_COLORS_NEON:
632 Set_Count(7);
633 Set_Color(0, SG_GET_RGB( 0, 0, 0));
634 Set_Color(1, SG_GET_RGB(255, 0, 0));
635 Set_Color(2, SG_GET_RGB( 0, 0, 0));
636 Set_Color(3, SG_GET_RGB(255, 255, 0));
637 Set_Color(4, SG_GET_RGB( 0, 0, 0));
638 Set_Color(5, SG_GET_RGB( 0, 255, 0));
639 Set_Color(6, SG_GET_RGB( 0, 0, 0));
640 break;
641
642 case SG_COLORS_TOPOGRAPHY:
643 Set_Count(5);
644 Set_Color(0, SG_GET_RGB( 0, 63, 127));
645 Set_Color(1, SG_GET_RGB(127, 255, 0));
646 Set_Color(2, SG_GET_RGB(255, 255, 127));
647 Set_Color(3, SG_GET_RGB(191, 127, 0));
648 Set_Color(4, SG_GET_RGB(127, 63, 0));
649 break;
650
651 case SG_COLORS_TOPOGRAPHY_2:
652 Set_Count(6);
653 Set_Color(0, SG_GET_RGB( 0, 191, 191));
654 Set_Color(1, SG_GET_RGB( 0, 255, 0));
655 Set_Color(2, SG_GET_RGB(255, 255, 0));
656 Set_Color(3, SG_GET_RGB(255, 127, 0));
657 Set_Color(4, SG_GET_RGB(191, 152, 110));
658 Set_Color(5, SG_GET_RGB(199, 199, 199));
659 break;
660
661 case SG_COLORS_TOPOGRAPHY_3:
662 Set_Count(9);
663 Set_Color(0, SG_GET_RGB(177, 242, 212));
664 Set_Color(1, SG_GET_RGB(248, 252, 179));
665 Set_Color(2, SG_GET_RGB( 11, 128, 064));
666 Set_Color(3, SG_GET_RGB(248, 202, 80));
667 Set_Color(4, SG_GET_RGB(158, 30, 0));
668 Set_Color(5, SG_GET_RGB(128, 064, 064));
669 Set_Color(6, SG_GET_RGB(185, 121, 076));
670 Set_Color(7, SG_GET_RGB(179, 179, 179));
671 Set_Color(8, SG_GET_RGB(255, 255, 255));
672 break;
673
674 case SG_COLORS_PRECIPITATION: // juergen's favorite precipition colour ramp
675 Set_Count(22);
676 Set_Color( 0, SG_GET_RGB(216, 204, 131));
677 Set_Color( 1, SG_GET_RGB(196, 208, 111));
678 Set_Color( 2, SG_GET_RGB(184, 210, 101));
679 Set_Color( 3, SG_GET_RGB(172, 212, 91));
680 Set_Color( 4, SG_GET_RGB(139, 212, 99));
681 Set_Color( 5, SG_GET_RGB(107, 212, 107));
682 Set_Color( 6, SG_GET_RGB( 75, 212, 119));
683 Set_Color( 7, SG_GET_RGB( 42, 212, 131));
684 Set_Color( 8, SG_GET_RGB( 26, 212, 151));
685 Set_Color( 9, SG_GET_RGB( 10, 212, 172));
686 Set_Color(10, SG_GET_RGB( 30, 192, 192));
687 Set_Color(11, SG_GET_RGB( 50, 172, 212));
688 Set_Color(12, SG_GET_RGB( 70, 151, 214));
689 Set_Color(13, SG_GET_RGB( 91, 131, 216));
690 Set_Color(14, SG_GET_RGB( 75, 115, 198));
691 Set_Color(15, SG_GET_RGB( 58, 99, 180));
692 Set_Color(16, SG_GET_RGB( 42, 83, 184));
693 Set_Color(17, SG_GET_RGB( 26, 066, 188));
694 Set_Color(18, SG_GET_RGB( 26, 046, 180));
695 Set_Color(19, SG_GET_RGB( 26, 026, 166));
696 Set_Color(20, SG_GET_RGB( 38, 18, 151));
697 Set_Color(21, SG_GET_RGB( 50, 010, 131));
698 break;
699
700 case SG_COLORS_ASPECT_1:
701 Set_Count(5);
702 Set_Color(0, SG_GET_RGB(225, 225, 225));
703 Set_Color(1, SG_GET_RGB(127, 127, 255));
704 Set_Color(2, SG_GET_RGB( 20, 20, 20));
705 Set_Color(3, SG_GET_RGB(127, 255, 127));
706 Set_Color(4, SG_GET_RGB(225, 225, 225));
707 break;
708
709 case SG_COLORS_ASPECT_2:
710 Set_Count(5);
711 Set_Color(0, SG_GET_RGB(225, 225, 225));
712 Set_Color(1, SG_GET_RGB(255, 127, 127));
713 Set_Color(2, SG_GET_RGB( 20, 20, 20));
714 Set_Color(3, SG_GET_RGB(127, 255, 127));
715 Set_Color(4, SG_GET_RGB(225, 225, 225));
716 break;
717
718 case SG_COLORS_ASPECT_3:
719 Set_Count(5);
720 Set_Color(0, SG_GET_RGB(225, 225, 225));
721 Set_Color(1, SG_GET_RGB(255, 127, 127));
722 Set_Color(2, SG_GET_RGB( 20, 20, 20));
723 Set_Color(3, SG_GET_RGB(127, 127, 255));
724 Set_Color(4, SG_GET_RGB(225, 225, 225));
725 break;
726
727 case SG_COLORS_COUNT + 0:
728 Set_Count(3);
729 Set_Color(0, SG_GET_RGB( 0, 128, 0));
730 Set_Color(1, SG_GET_RGB(255, 255, 127));
731 Set_Color(2, SG_GET_RGB(127, 63, 63));
732 break;
733
734 case SG_COLORS_COUNT + 1:
735 Set_Count(3);
736 Set_Color(0, SG_GET_RGB( 0, 0, 255));
737 Set_Color(1, SG_GET_RGB(255, 255, 0));
738 Set_Color(2, SG_GET_RGB(255, 0, 0));
739 break;
740
741 case SG_COLORS_COUNT + 2:
742 Set_Count(3);
743 Set_Color(0, SG_GET_RGB( 0, 127, 0));
744 Set_Color(1, SG_GET_RGB(255, 255, 255));
745 Set_Color(2, SG_GET_RGB(255, 0, 0));
746 break;
747
748 case SG_COLORS_COUNT + 3:
749 Set_Count(3);
750 Set_Color(0, SG_GET_RGB( 0, 0, 255));
751 Set_Color(1, SG_GET_RGB(255, 255, 255));
752 Set_Color(2, SG_GET_RGB( 0, 127, 0));
753 break;
754
755 case SG_COLORS_COUNT + 4:
756 Set_Count(4);
757 Set_Color(0, SG_GET_RGB( 0, 0, 255));
758 Set_Color(1, SG_GET_RGB( 0, 255, 0));
759 Set_Color(2, SG_GET_RGB(255, 255, 0));
760 Set_Color(3, SG_GET_RGB(255, 0, 0));
761 break;
762
763 case SG_COLORS_COUNT + 5:
764 Set_Count(11);
765 Set_Color( 0, SG_GET_RGB( 37, 57, 175));
766 Set_Color( 1, SG_GET_RGB( 40, 127, 251));
767 Set_Color( 2, SG_GET_RGB( 50, 190, 255));
768 Set_Color( 3, SG_GET_RGB(106, 235, 255));
769 Set_Color( 4, SG_GET_RGB(138, 236, 174));
770 Set_Color( 5, SG_GET_RGB(205, 255, 162));
771 Set_Color( 6, SG_GET_RGB(240, 236, 121));
772 Set_Color( 7, SG_GET_RGB(255, 189, 87));
773 Set_Color( 8, SG_GET_RGB(255, 161, 68));
774 Set_Color( 9, SG_GET_RGB(255, 186, 133));
775 Set_Color(10, SG_GET_RGB(255, 255, 255));
776 break;
777
778 case SG_COLORS_COUNT + 6:
779 Set_Count(8);
780 Set_Color(0, SG_GET_RGB(171, 43, 0));
781 Set_Color(1, SG_GET_RGB(255, 127, 0));
782 Set_Color(2, SG_GET_RGB(255, 255, 0));
783 Set_Color(3, SG_GET_RGB( 0, 255, 0));
784 Set_Color(4, SG_GET_RGB( 0, 255, 255));
785 Set_Color(5, SG_GET_RGB( 0, 0, 255));
786 Set_Color(6, SG_GET_RGB(255, 0, 255));
787 Set_Color(7, SG_GET_RGB(255, 255, 255));
788 break;
789
790 case SG_COLORS_COUNT + 7:
791 Set_Count(5);
792 Set_Color(0, SG_GET_RGB( 0, 0, 191));
793 Set_Color(1, SG_GET_RGB(255, 0, 255));
794 Set_Color(2, SG_GET_RGB(255, 0, 0));
795 Set_Color(3, SG_GET_RGB(255, 255, 0));
796 Set_Color(4, SG_GET_RGB(245, 245, 163));
797 break;
798
799 case SG_COLORS_COUNT + 8:
800 Set_Count(6);
801 Set_Color(0, SG_GET_RGB(127, 255, 255));
802 Set_Color(1, SG_GET_RGB( 0, 0, 255));
803 Set_Color(2, SG_GET_RGB(127, 0, 255));
804 Set_Color(3, SG_GET_RGB(255, 0, 0));
805 Set_Color(4, SG_GET_RGB(255, 255, 0));
806 Set_Color(5, SG_GET_RGB(255, 255, 127));
807 break;
808
809 case SG_COLORS_COUNT + 9:
810 Set_Count(5);
811 Set_Color(0, SG_GET_RGB( 0, 0, 127));
812 Set_Color(1, SG_GET_RGB( 0, 127, 255));
813 Set_Color(2, SG_GET_RGB( 0, 191, 0));
814 Set_Color(3, SG_GET_RGB(191, 255, 0));
815 Set_Color(4, SG_GET_RGB(255, 255, 127));
816 break;
817
818 case SG_COLORS_COUNT + 10:
819 Set_Count(nColors);
820 Random();
821 break;
822
823 default:
824 return( false );
825 }
826
827 //-----------------------------------------------------
828 if( bRevert )
829 {
830 Revert();
831 }
832
833 return( Set_Count(nColors) );
834 }
835
836 //---------------------------------------------------------
837 bool CSG_Colors::Set_Default(int nColors)
838 {
839 if( nColors > 0 )
840 {
841 m_nColors = nColors;
842 m_Colors = (long *)SG_Realloc(m_Colors, m_nColors * sizeof(long));
843
844 double d = 0., dStep = 2. * M_PI / (double)Get_Count();
845
846 for(int i=0; i<Get_Count(); i++, d+=dStep)
847 {
848 Set_Color(i,
849 (int)(d < M_PI / 2 ? 0 : 128 - 127 * sin(M_PI - d)),
850 (int)(128 - 127 * cos(d)),
851 (int)(d > M_PI * 3 / 2 ? 0 : 128 + 127 * sin(d))
852 );
853 }
854
855 return( true );
856 }
857
858 return( false );
859 }
860
861 //---------------------------------------------------------
862 bool CSG_Colors::Set_Ramp(long Color_A, long Color_B)
863 {
864 return( Set_Ramp(Color_A, Color_B, 0, Get_Count() - 1) );
865 }
866
867 //---------------------------------------------------------
868 bool CSG_Colors::Set_Ramp(long Color_A, long Color_B, int iColor_A, int iColor_B)
869 {
870 if( iColor_A > iColor_B )
871 {
872 int i = iColor_A;
873 iColor_A = iColor_B;
874 iColor_B = i;
875 }
876
877 if( iColor_A < 0 )
878 {
879 iColor_A = 0;
880 }
881
882 if( iColor_B >= Get_Count() )
883 {
884 iColor_B = Get_Count() - 1;
885 }
886
887 //-----------------------------------------------------
888 int n = iColor_B - iColor_A;
889
890 if( n > 0 )
891 {
892 int ar = SG_GET_R(Color_A);
893 double dr = (double)(SG_GET_R(Color_B) - ar) / (double)n;
894
895 int ag = SG_GET_G(Color_A);
896 double dg = (double)(SG_GET_G(Color_B) - ag) / (double)n;
897
898 int ab = SG_GET_B(Color_A);
899 double db = (double)(SG_GET_B(Color_B) - ab) / (double)n;
900
901 for(int i=0; i<=n; i++)
902 {
903 Set_Color(iColor_A + i,
904 (int)(ar + i * dr),
905 (int)(ag + i * dg),
906 (int)(ab + i * db)
907 );
908 }
909
910 return( true );
911 }
912
913 return( false );
914 }
915
916 //---------------------------------------------------------
917 bool CSG_Colors::Set_Ramp_Brighness(int Brightness_A, int Brightness_B)
918 {
919 return( Set_Ramp_Brighness(Brightness_A, Brightness_B, 0, Get_Count() - 1) );
920 }
921
922 //---------------------------------------------------------
923 bool CSG_Colors::Set_Ramp_Brighness(int Brightness_A, int Brightness_B, int iColor_A, int iColor_B)
924 {
925 if( iColor_A > iColor_B )
926 {
927 int i = iColor_A;
928 iColor_A = iColor_B;
929 iColor_B = i;
930 }
931
932 if( iColor_A < 0 )
933 {
934 iColor_A = 0;
935 }
936
937 if( iColor_B >= Get_Count() )
938 {
939 iColor_B = Get_Count() - 1;
940 }
941
942 //-----------------------------------------------------
943 int n = iColor_B - iColor_A;
944
945 if( n > 0 )
946 {
947 double dBrightness = (double)(Brightness_B - Brightness_A) / (double)n;
948
949 for(int i=0; i<=n; i++)
950 {
951 Set_Brightness(iColor_A + i, (int)(Brightness_A + i * dBrightness));
952 }
953
954 return( true );
955 }
956
957 return( false );
958 }
959
960
962 // //
964
965 //---------------------------------------------------------
966 bool CSG_Colors::Random(void)
967 {
968 for(int i=0; i<Get_Count(); i++)
969 {
970 Set_Color(i,
971 (int)(255.0 * (double)rand() / (double)RAND_MAX),
972 (int)(255.0 * (double)rand() / (double)RAND_MAX),
973 (int)(255.0 * (double)rand() / (double)RAND_MAX)
974 );
975 }
976
977 return( Get_Count() > 0 );
978 }
979
980 //---------------------------------------------------------
981 bool CSG_Colors::Invert(void)
982 {
983 for(int i=0; i<Get_Count(); i++)
984 {
985 Set_Color(i, 255 - Get_Red(i), 255 - Get_Green(i), 255 - Get_Blue(i));
986 }
987
988 return( Get_Count() > 0 );
989 }
990
991 //---------------------------------------------------------
992 bool CSG_Colors::Revert(void)
993 {
994 for(int i=0, j=Get_Count()-1; i<j; i++, j--)
995 {
996 long c = Get_Color(j);
997 Set_Color(j, Get_Color(i));
998 Set_Color(i, c);
999 }
1000
1001 return( Get_Count() > 0 );
1002 }
1003
1004 //---------------------------------------------------------
1005 bool CSG_Colors::Greyscale(void)
1006 {
1007 for(int i=0; i<Get_Count(); i++)
1008 {
1009 long c = Get_Brightness(i);
1010
1011 Set_Color(i, c, c, c);
1012 }
1013
1014 return( Get_Count() > 0 );
1015 }
1016
1017
1019 // //
1021
1022 //---------------------------------------------------------
1023 CSG_Colors & CSG_Colors::operator = (const CSG_Colors &Colors)
1024 {
1025 Create(Colors);
1026
1027 return( *this );
1028 }
1029
1030 //---------------------------------------------------------
1031 bool CSG_Colors::Assign(const CSG_Colors &Colors)
1032 {
1033 return( Create(Colors) );
1034 }
1035
1036 //---------------------------------------------------------
1037 bool CSG_Colors::Assign(CSG_Colors *pColors)
1038 {
1039 return( pColors ? Create(*pColors) : false );
1040 }
1041
1042
1044 // //
1046
1047 //---------------------------------------------------------
1048 #define COLORS_SERIAL_VERSION_BINARY "SAGA_COLORPALETTE_VERSION_0.100_BINARY"
1049 #define COLORS_SERIAL_VERSION__ASCII "SAGA_COLORPALETTE_VERSION_0.100__ASCII"
1050
1051 //---------------------------------------------------------
1052 bool CSG_Colors::Load(const CSG_String &File_Name)
1053 {
1054 CSG_File Stream;
1055
1056 if( !Stream.Open(File_Name, SG_FILE_R, true) )
1057 {
1058 return( false );
1059 }
1060
1061 CSG_String Version;
1062
1063 Stream.Read(Version, sizeof(COLORS_SERIAL_VERSION__ASCII));
1064
1065 //-----------------------------------------------------
1066 if( Version.Find(COLORS_SERIAL_VERSION__ASCII) == 0 )
1067 {
1068 return( Serialize(Stream, false, false) );
1069 }
1070
1071 //-----------------------------------------------------
1072 Stream.Seek_Start();
1073 Stream.Read(Version, sizeof(COLORS_SERIAL_VERSION_BINARY));
1074
1075 if( Version.Find(COLORS_SERIAL_VERSION_BINARY) == 0 )
1076 {
1077 int nColors;
1078
1079 Stream.Read(&nColors, sizeof(nColors));
1080
1081 if( Set_Count(nColors) ) // different os, different sizeof(long) !!
1082 {
1083 size_t ValueSize = (size_t)((Stream.Length() - (sizeof(COLORS_SERIAL_VERSION_BINARY) + sizeof(int))) / nColors);
1084
1085 if( ValueSize > 0 )
1086 {
1087 BYTE *c = (BYTE *)SG_Malloc(ValueSize);
1088
1089 for(int i=0; i<nColors; i++)
1090 {
1091 Stream.Read(c, ValueSize);
1092
1093 Set_Color(i, c[0], c[1], c[2]);
1094 }
1095
1096 SG_Free(c);
1097 }
1098
1099 return( true );
1100 }
1101 }
1102
1103 //-----------------------------------------------------
1104 else // SAGA 1.x compatibility...
1105 {
1106 short nColors;
1107
1108 Stream.Seek_Start();
1109 Stream.Read(&nColors, sizeof(short));
1110
1111 if( Stream.Length() == (int)(sizeof(short) + 3 * nColors) && Set_Count(nColors) )
1112 {
1113 BYTE *R = (BYTE *)SG_Malloc(nColors * sizeof(BYTE)); Stream.Read(R, nColors * sizeof(BYTE));
1114 BYTE *G = (BYTE *)SG_Malloc(nColors * sizeof(BYTE)); Stream.Read(G, nColors * sizeof(BYTE));
1115 BYTE *B = (BYTE *)SG_Malloc(nColors * sizeof(BYTE)); Stream.Read(B, nColors * sizeof(BYTE));
1116
1117 for(int i=0; i<nColors; i++)
1118 {
1119 Set_Color(i, R[i], G[i], B[i]);
1120 }
1121
1122 SG_Free(R); SG_Free(G); SG_Free(B);
1123
1124 return( true );
1125 }
1126 }
1127
1128 //-----------------------------------------------------
1129 return( false );
1130 }
1131
1132 //---------------------------------------------------------
1133 bool CSG_Colors::Save(const CSG_String &File_Name, bool bBinary)
1134 {
1135 CSG_File Stream;
1136
1137 if( Stream.Open(File_Name, SG_FILE_W, bBinary) )
1138 {
1139 if( bBinary )
1140 {
1141 Stream.Write((void *)COLORS_SERIAL_VERSION_BINARY, sizeof(COLORS_SERIAL_VERSION_BINARY));
1142 }
1143 else
1144 {
1145 Stream.Write(COLORS_SERIAL_VERSION__ASCII); Stream.Write("\n");
1146 }
1147
1148 Serialize(Stream, true, bBinary);
1149
1150 return( true );
1151 }
1152
1153 return( false );
1154 }
1155
1156
1158 // //
1160
1161 //---------------------------------------------------------
1162 bool CSG_Colors::Serialize(CSG_File &Stream, bool bSave, bool bBinary)
1163 {
1164 if( Stream.is_Open() )
1165 {
1166 //-------------------------------------------------
1167 if( bBinary )
1168 {
1169 if( bSave )
1170 {
1171 if( m_nColors > 0 )
1172 {
1173 Stream.Write(&m_nColors, sizeof(m_nColors));
1174 Stream.Write(m_Colors, sizeof(long), m_nColors);
1175 }
1176 }
1177 else
1178 {
1179 int nColors;
1180
1181 Stream.Read(&nColors, sizeof(m_nColors));
1182
1183 if( Set_Count(nColors) )
1184 {
1185 Stream.Read(m_Colors, sizeof(long), m_nColors);
1186 }
1187 }
1188
1189 return( true );
1190 }
1191
1192 //-------------------------------------------------
1193 else
1194 {
1195 if( bSave )
1196 {
1197 if( Get_Count() > 0 )
1198 {
1199 Stream.Printf("%d\n", Get_Count());
1200
1201 for(int i=0; i<Get_Count(); i++)
1202 {
1203 Stream.Printf("%03d %03d %03d\n", (int)Get_Red(i), (int)Get_Green(i), (int)Get_Blue(i));
1204 }
1205 }
1206 }
1207 else
1208 {
1209 CSG_String sLine;
1210
1211 while( Stream.Read_Line(sLine) && sLine.is_Empty() ) {} // skip empty lines
1212
1213 if( Set_Count(sLine.asInt()) )
1214 {
1215 for(int i=0; i<Get_Count(); i++)
1216 {
1217 Stream.Read_Line(sLine);
1218
1219 Set_Color(i,
1220 sLine .asInt(),
1221 sLine.AfterFirst(' ').asInt(),
1222 sLine.AfterLast (' ').asInt()
1223 );
1224 }
1225 }
1226 }
1227
1228 return( true );
1229 }
1230 }
1231
1232 return( false );
1233 }
1234
1235 //---------------------------------------------------------
1236 bool CSG_Colors::to_Text(CSG_String &String)
1237 {
1238 if( Get_Count() > 0 )
1239 {
1240 String.Clear();
1241
1242 for(int i=0; i<Get_Count(); i++)
1243 {
1244 String += CSG_String::Format("%03d %03d %03d;", (int)Get_Red(i), (int)Get_Green(i), (int)Get_Blue(i));
1245 }
1246
1247 return( true );
1248 }
1249
1250 return( false );
1251 }
1252
1253 //---------------------------------------------------------
1254 bool CSG_Colors::from_Text(const CSG_String &String)
1255 {
1256 if( Set_Count((int)String.Length() / 12) )
1257 {
1258 for(int i=0, j=0; i<Get_Count(); i++, j+=12)
1259 {
1260 Set_Color(i,
1261 String.Mid(j + 0, 4).asInt(),
1262 String.Mid(j + 4, 4).asInt(),
1263 String.Mid(j + 8, 4).asInt()
1264 );
1265 }
1266
1267 return( true );
1268 }
1269
1270 return( false );
1271 }
1272
1273
1275 // //
1276 // //
1277 // //
1279
1280 //---------------------------------------------------------
CSG_Colors::Set_Brightness
bool Set_Brightness(int Index, int Value)
Definition: api_colors.cpp:342
CSG_Colors::Set_Color
bool Set_Color(int Index, long Color)
Definition: api_colors.cpp:305
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
CSG_Colors::from_Text
bool from_Text(const CSG_String &String)
Definition: api_colors.cpp:1254
SG_GET_RGB
#define SG_GET_RGB(r, g, b)
Definition: api_core.h:1253
SG_COLORS_RED_BLUE_GREEN
@ SG_COLORS_RED_BLUE_GREEN
Definition: api_core.h:1305
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_File::Seek_Start
bool Seek_Start(void) const
Definition: api_file.cpp:251
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Colors::Greyscale
bool Greyscale(void)
Definition: api_colors.cpp:1005
SG_GET_B
#define SG_GET_B(rgb)
Definition: api_core.h:1258
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
SG_Color_From_Text
bool SG_Color_From_Text(const CSG_String &Text, long &Color)
Definition: api_colors.cpp:79
SG_Colors_Get_Name
CSG_String SG_Colors_Get_Name(int Index)
Definition: api_colors.cpp:67
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
CSG_Colors::Load
bool Load(const CSG_String &File_Name)
Definition: api_colors.cpp:1052
SG_COLORS_GREEN_BLUE
@ SG_COLORS_GREEN_BLUE
Definition: api_core.h:1300
CSG_Colors::Revert
bool Revert(void)
Definition: api_colors.cpp:992
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:699
SG_COLORS_RED_GREY_BLUE
@ SG_COLORS_RED_GREY_BLUE
Definition: api_core.h:1301
CSG_Colors::Get_Predefined_Name
static CSG_String Get_Predefined_Name(int Identifier)
Definition: api_colors.cpp:435
CSG_Colors::Get_Blue
long Get_Blue(int Index) const
Definition: api_core.h:1360
CSG_Colors::Destroy
void Destroy(void)
Definition: api_colors.cpp:241
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
SG_COLORS_BLACK_BLUE
@ SG_COLORS_BLACK_BLUE
Definition: api_core.h:1290
CSG_Random::Get_Uniform
static double Get_Uniform(void)
Definition: mat_tools.cpp:274
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Colors::Invert
bool Invert(void)
Definition: api_colors.cpp:981
SG_Color_Get_Random
long SG_Color_Get_Random(void)
Definition: api_colors.cpp:73
SG_COLORS_TOPOGRAPHY
@ SG_COLORS_TOPOGRAPHY
Definition: api_core.h:1309
CSG_String::Get_Char
SG_Char Get_Char(size_t i) const
Definition: api_string.cpp:209
api_core.h
SG_COLORS_WHITE_GREEN
@ SG_COLORS_WHITE_GREEN
Definition: api_core.h:1292
SG_COLORS_RAINBOW
@ SG_COLORS_RAINBOW
Definition: api_core.h:1307
SG_COLORS_BLACK_RED
@ SG_COLORS_BLACK_RED
Definition: api_core.h:1288
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_Colors::Set_Blue
bool Set_Blue(int Index, int Value)
Definition: api_colors.cpp:336
CSG_Colors::Get_Red
long Get_Red(int Index) const
Definition: api_core.h:1358
SG_COLORS_ASPECT_2
@ SG_COLORS_ASPECT_2
Definition: api_core.h:1314
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Colors::Set_Ramp
bool Set_Ramp(long Color_A, long Color_B)
Definition: api_colors.cpp:862
CSG_File
Definition: api_core.h:1116
SG_GET_R
#define SG_GET_R(rgb)
Definition: api_core.h:1256
SG_COLORS_NEON
@ SG_COLORS_NEON
Definition: api_core.h:1308
mat_tools.h
CSG_Colors::Get_Predefined_Count
static int Get_Predefined_Count(void)
Definition: api_colors.cpp:429
CSG_Colors::Set_Predefined
bool Set_Predefined(int Index, bool bRevert=false, int nColors=11)
Definition: api_colors.cpp:475
COLORS_SERIAL_VERSION__ASCII
#define COLORS_SERIAL_VERSION__ASCII
Definition: api_colors.cpp:1049
SG_COLORS_YELLOW_BLUE
@ SG_COLORS_YELLOW_BLUE
Definition: api_core.h:1296
SG_COLORS_BLACK_WHITE
@ SG_COLORS_BLACK_WHITE
Definition: api_core.h:1287
SG_COLORS_YELLOW_RED
@ SG_COLORS_YELLOW_RED
Definition: api_core.h:1294
CSG_Colors::Get_Count
int Get_Count(void) const
Definition: api_core.h:1345
SG_COLORS_YELLOW_GREEN
@ SG_COLORS_YELLOW_GREEN
Definition: api_core.h:1295
CSG_Colors::Create
bool Create(void)
Definition: api_colors.cpp:204
CSG_Colors::Set_Palette
bool Set_Palette(int Index, bool bRevert=false, int nColors=11)
Definition: api_core.h:1380
CSG_Colors::Get_Color
long Get_Color(int Index) const
Definition: api_core.h:1357
SG_GET_G
#define SG_GET_G(rgb)
Definition: api_core.h:1257
SG_COLORS_DEFAULT
@ SG_COLORS_DEFAULT
Definition: api_core.h:1285
CSG_Colors::Set_Red
bool Set_Red(int Index, int Value)
Definition: api_colors.cpp:324
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
SG_COLORS_ASPECT_1
@ SG_COLORS_ASPECT_1
Definition: api_core.h:1313
SG_COLORS_WHITE_BLUE
@ SG_COLORS_WHITE_BLUE
Definition: api_core.h:1293
CSG_Colors::Get_Interpolated
long Get_Interpolated(double Index) const
Definition: api_core.h:1363
SG_COLORS_GREEN_RED
@ SG_COLORS_GREEN_RED
Definition: api_core.h:1297
CSG_Colors::Set_Green
bool Set_Green(int Index, int Value)
Definition: api_colors.cpp:330
CSG_Colors::Set_Count
bool Set_Count(int nColors)
Definition: api_colors.cpp:258
SG_COLORS_DEFAULT_BRIGHT
@ SG_COLORS_DEFAULT_BRIGHT
Definition: api_core.h:1286
CSG_Colors::CSG_Colors
CSG_Colors(void)
Definition: api_colors.cpp:166
SG_Color_To_Text
CSG_String SG_Color_To_Text(long Color, bool bHexadecimal)
Definition: api_colors.cpp:138
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1135
SG_COLORS_BLACK_GREEN
@ SG_COLORS_BLACK_GREEN
Definition: api_core.h:1289
CSG_Colors::operator=
CSG_Colors & operator=(const CSG_Colors &Colors)
Definition: api_colors.cpp:1023
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_COLORS_GREEN_GREY_BLUE
@ SG_COLORS_GREEN_GREY_BLUE
Definition: api_core.h:1303
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
SG_COLORS_TOPOGRAPHY_3
@ SG_COLORS_TOPOGRAPHY_3
Definition: api_core.h:1311
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
CSG_Colors::Set_Default
bool Set_Default(int nColors=11)
Definition: api_colors.cpp:837
SG_COLORS_ASPECT_3
@ SG_COLORS_ASPECT_3
Definition: api_core.h:1315
SG_COLORS_RED_GREY_GREEN
@ SG_COLORS_RED_GREY_GREEN
Definition: api_core.h:1302
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
COLORS_SERIAL_VERSION_BINARY
#define COLORS_SERIAL_VERSION_BINARY
Definition: api_colors.cpp:1048
CSG_Colors::Get_Brightness
long Get_Brightness(int Index) const
Definition: api_core.h:1361
M_PI
#define M_PI
Definition: mat_tools.h:98
B
#define B
CSG_String
Definition: api_core.h:557
CSG_Colors::Get_Green
long Get_Green(int Index) const
Definition: api_core.h:1359
CSG_Colors::Serialize
bool Serialize(CSG_File &Stream, bool bSave, bool bBinary)
Definition: api_colors.cpp:1162
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Colors::to_Text
bool to_Text(CSG_String &String)
Definition: api_colors.cpp:1236
SG_COLORS_COUNT
@ SG_COLORS_COUNT
Definition: api_core.h:1316
SG_COLORS_RED_BLUE
@ SG_COLORS_RED_BLUE
Definition: api_core.h:1299
CSG_String::AfterLast
CSG_String AfterLast(char Character) const
Definition: api_string.cpp:655
SG_COLORS_WHITE_RED
@ SG_COLORS_WHITE_RED
Definition: api_core.h:1291
SG_COLORS_RED_GREEN_BLUE
@ SG_COLORS_RED_GREEN_BLUE
Definition: api_core.h:1304
CSG_Colors::~CSG_Colors
virtual ~CSG_Colors(void)
Definition: api_colors.cpp:193
SG_COLORS_PRECIPITATION
@ SG_COLORS_PRECIPITATION
Definition: api_core.h:1312
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Colors::Random
bool Random(void)
Definition: api_colors.cpp:966
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_COLORS_RED_GREEN
@ SG_COLORS_RED_GREEN
Definition: api_core.h:1298
SG_COLORS_GREEN_RED_BLUE
@ SG_COLORS_GREEN_RED_BLUE
Definition: api_core.h:1306
CSG_Colors::Save
bool Save(const CSG_String &File_Name, bool bBinary)
Definition: api_colors.cpp:1133
CSG_Colors::Assign
bool Assign(const CSG_Colors &Colors)
Definition: api_colors.cpp:1031
SG_COLORS_TOPOGRAPHY_2
@ SG_COLORS_TOPOGRAPHY_2
Definition: api_core.h:1310
SG_GET_RGBA
#define SG_GET_RGBA(r, g, b, a)
Definition: api_core.h:1254
CSG_Colors
Definition: api_core.h:1329
CSG_Colors::Set_Ramp_Brighness
bool Set_Ramp_Brighness(int Brightness_A, int Brightness_B)
Definition: api_colors.cpp:917
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_core.cpp File Reference

  • saga_core
  • saga_api
Functions | Variables
api_core.cpp File Reference
#include <wx/utils.h>
#include <wx/app.h>
#include <wx/dir.h>
#include "api_core.h"
#include "tool_library.h"

Go to the source code of this file.

Functions

void | SG_OMP_Set_Max_Num_Threads (int iCores)
int | SG_OMP_Get_Max_Num_Threads (void)
int | SG_OMP_Get_Max_Num_Procs (void)
int | SG_OMP_Get_Thread_Num (void)
CSG_String | SG_Data_Type_Get_Name (TSG_Data_Type Type, bool bShort)
CSG_String | SG_Data_Type_Get_Identifier (TSG_Data_Type Type)
TSG_Data_Type | SG_Data_Type_Get_Type (const CSG_String &Identifier)
int | SG_Data_Type_Get_Flag (TSG_Data_Type Type)
bool | SG_Data_Type_is_Numeric (TSG_Data_Type Type)
bool | SG_Data_Type_Range_Check (TSG_Data_Type Type, double &Value)
bool | SG_Add_Dll_Paths (const wxString &Directory, wxString &Paths)
bool | SG_Initialize_Environment (bool bLibraries, bool bProjections, const SG_Char *Directory, bool bInitializeWX)
bool | SG_Uninitialize_Environment (void)

Variables

CSG_App_Initialize g_App_Initialize

Function Documentation

◆ SG_Add_Dll_Paths()

bool SG_Add_Dll_Paths | ( | const wxString & | Directory,
 |  | wxString & | Paths
 | ) |  |

Definition at line 342 of file api_core.cpp.

Referenced by SG_Initialize_Environment().

◆ SG_Data_Type_Get_Flag()

int SG_Data_Type_Get_Flag ( TSG_Data_Type Type )

Definition at line 173 of file api_core.cpp.

References SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Word, SG_DATATYPES_Binary, SG_DATATYPES_Bit, SG_DATATYPES_Byte, SG_DATATYPES_Char, SG_DATATYPES_Color, SG_DATATYPES_Date, SG_DATATYPES_Double, SG_DATATYPES_DWord, SG_DATATYPES_Float, SG_DATATYPES_Int, SG_DATATYPES_Long, SG_DATATYPES_Short, SG_DATATYPES_String, SG_DATATYPES_ULong, SG_DATATYPES_Undefined, and SG_DATATYPES_Word.

◆ SG_Data_Type_Get_Identifier()

CSG_String SG_Data_Type_Get_Identifier ( TSG_Data_Type Type )

Definition at line 146 of file api_core.cpp.

References gSG_Data_Type_Identifier.

Referenced by CSG_Parameter_Data_Type::Set_Data_Types().

◆ SG_Data_Type_Get_Name()

CSG_String SG_Data_Type_Get_Name | ( | TSG_Data_Type | Type,
 |  | bool | bShort
 | ) |  |

Definition at line 122 of file api_core.cpp.

References _TL, SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by CSG_Parameter::Get_Description(), CSG_Data_Manager::Get_Summary(), and SG_XML_Add_Parameter().

◆ SG_Data_Type_Get_Type()

TSG_Data_Type SG_Data_Type_Get_Type ( const CSG_String & Identifier )

Definition at line 152 of file api_core.cpp.

References CSG_String::Cmp(), gSG_Data_Type_Identifier, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Undefined, and SG_DATATYPE_Word.

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Data_Type::Get_Data_Type(), and CSG_Parameter_Data_Type::Set_Data_Type().

◆ SG_Data_Type_is_Numeric()

bool SG_Data_Type_is_Numeric ( TSG_Data_Type Type )

Definition at line 197 of file api_core.cpp.

References SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by CSG_PointCloud::Add_Shape().

◆ SG_Data_Type_Range_Check()

bool SG_Data_Type_Range_Check | ( | TSG_Data_Type | Type,
 |  | double & | Value
 | ) |  |

Definition at line 223 of file api_core.cpp.

References SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Short, and SG_DATATYPE_Word.

◆ SG_Initialize_Environment()

bool SG_Initialize_Environment | ( | bool | bLibraries,
 |  | bool | bProjections,
 |  | const SG_Char * | Directory,
 |  | bool | bInitializeWX
 | ) |  |

Definition at line 392 of file api_core.cpp.

References CSG_Tool_Library_Manager::Add_Directory(), CSG_String::c_str(), g_App_Initialize, CSG_Strings::Get_Count(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), SG_Add_Dll_Paths(), SG_Dir_Exists(), SG_File_Make_Path(), SG_Get_Projections(), SG_Get_Tool_Library_Manager(), SG_String_Tokenize(), SG_UI_Get_Application_Path(), and SG_UI_ProgressAndMsg_Lock().

◆ SG_OMP_Get_Max_Num_Procs()

int SG_OMP_Get_Max_Num_Procs ( void )

Definition at line 110 of file api_core.cpp.

Referenced by CSG_PointCloud::_On_Construction().

◆ SG_OMP_Get_Max_Num_Threads()

int SG_OMP_Get_Max_Num_Threads ( void )

Definition at line 109 of file api_core.cpp.

◆ SG_OMP_Get_Thread_Num()

int SG_OMP_Get_Thread_Num ( void )

Definition at line 111 of file api_core.cpp.

◆ SG_OMP_Set_Max_Num_Threads()

void SG_OMP_Set_Max_Num_Threads ( int iCores )

Definition at line 108 of file api_core.cpp.

◆ SG_Uninitialize_Environment()

bool SG_Uninitialize_Environment ( void )

Definition at line 533 of file api_core.cpp.

References g_App_Initialize.

Variable Documentation

◆ g_App_Initialize

CSG_App_Initialize g_App_Initialize

Definition at line 334 of file api_core.cpp.

Referenced by SG_Initialize_Environment(), and SG_Uninitialize_Environment().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_core.cpp Source File

  • saga_core
  • saga_api
api_core.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_core.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include <wx/utils.h>
52 #include <wx/app.h>
53 #include <wx/dir.h>
54
55 #include "api_core.h"
56 #include "tool_library.h"
57
58
60 // //
61 // //
62 // //
64
65 //---------------------------------------------------------
66 #ifdef _OPENMP
67
68 #include <omp.h>
69
70 //---------------------------------------------------------
71 int g_SG_OMP_Max_Num_Threads = omp_get_num_procs();
72
73 //---------------------------------------------------------
74 void SG_OMP_Set_Max_Num_Threads (int iCores)
75 {
76 if( iCores < 1 )
77 {
78 iCores = 1;
79 }
80 else if( iCores > omp_get_num_procs() )
81 {
82 iCores = omp_get_num_procs();
83 }
84
85 omp_set_num_threads(g_SG_OMP_Max_Num_Threads = iCores);
86 }
87
88 //---------------------------------------------------------
89 int SG_OMP_Get_Max_Num_Threads (void)
90 {
91 return( g_SG_OMP_Max_Num_Threads );
92 }
93
94 //---------------------------------------------------------
95 int SG_OMP_Get_Max_Num_Procs (void)
96 {
97 return( omp_get_num_procs() );
98 }
99
100 //---------------------------------------------------------
101 int SG_OMP_Get_Thread_Num (void)
102 {
103 return( omp_get_thread_num() );
104 }
105
106 //---------------------------------------------------------
107 #else
108 void SG_OMP_Set_Max_Num_Threads (int iCores) {}
109 int SG_OMP_Get_Max_Num_Threads (void) { return( 1 ); }
110 int SG_OMP_Get_Max_Num_Procs (void) { return( 1 ); }
111 int SG_OMP_Get_Thread_Num (void) { return( 0 ); }
112 #endif
113
114
116 // //
117 // //
118 // //
120
121 //---------------------------------------------------------
122 CSG_String SG_Data_Type_Get_Name (TSG_Data_Type Type, bool bShort)
123 {
124 switch( Type )
125 {
126 case SG_DATATYPE_Bit : return( _TL("bit" ) );
127 case SG_DATATYPE_Byte : return( bShort ? _TL("uint8" ) : _TL("unsigned 1 byte integer" ) );
128 case SG_DATATYPE_Char : return( bShort ? _TL("int8" ) : _TL("signed 1 byte integer" ) );
129 case SG_DATATYPE_Word : return( bShort ? _TL("uint16") : _TL("unsigned 2 byte integer" ) );
130 case SG_DATATYPE_Short : return( bShort ? _TL("int16" ) : _TL("signed 2 byte integer" ) );
131 case SG_DATATYPE_DWord : return( bShort ? _TL("uint32") : _TL("unsigned 4 byte integer" ) );
132 case SG_DATATYPE_Int : return( bShort ? _TL("int32" ) : _TL("signed 4 byte integer" ) );
133 case SG_DATATYPE_ULong : return( bShort ? _TL("uint64") : _TL("unsigned 8 byte integer" ) );
134 case SG_DATATYPE_Long : return( bShort ? _TL("int64" ) : _TL("signed 8 byte integer" ) );
135 case SG_DATATYPE_Float : return( bShort ? _TL("float" ) : _TL("4 byte floating point number") );
136 case SG_DATATYPE_Double: return( bShort ? _TL("double") : _TL("8 byte floating point number") );
137 case SG_DATATYPE_String: return( _TL("string") );
138 case SG_DATATYPE_Date : return( _TL("date" ) );
139 case SG_DATATYPE_Color : return( _TL("color" ) );
140 case SG_DATATYPE_Binary: return( _TL("binary") );
141 default : return( bShort ? _TL("none" ) : _TL("undefined" ) );
142 }
143 };
144
145 //---------------------------------------------------------
146 CSG_String SG_Data_Type_Get_Identifier (TSG_Data_Type Type)
147 {
148 return( gSG_Data_Type_Identifier[Type] );
149 }
150
151 //---------------------------------------------------------
152 TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
153 {
154 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Bit ]) ) return( SG_DATATYPE_Bit );
155 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Byte ]) ) return( SG_DATATYPE_Byte );
156 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Char ]) ) return( SG_DATATYPE_Char );
157 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Word ]) ) return( SG_DATATYPE_Word );
158 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Short ]) ) return( SG_DATATYPE_Short );
159 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_DWord ]) ) return( SG_DATATYPE_DWord );
160 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Int ]) ) return( SG_DATATYPE_Int );
161 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_ULong ]) ) return( SG_DATATYPE_ULong );
162 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Long ]) ) return( SG_DATATYPE_Long );
163 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Float ]) ) return( SG_DATATYPE_Float );
164 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Double]) ) return( SG_DATATYPE_Double );
165 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_String]) ) return( SG_DATATYPE_String );
166 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Date ]) ) return( SG_DATATYPE_Date );
167 if( !Identifier.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Color ]) ) return( SG_DATATYPE_Color );
168
169 return( SG_DATATYPE_Undefined );
170 }
171
172 //---------------------------------------------------------
173 int SG_Data_Type_Get_Flag(TSG_Data_Type Type)
174 {
175 switch( Type )
176 {
177 case SG_DATATYPE_Bit : return( SG_DATATYPES_Bit );
178 case SG_DATATYPE_Byte : return( SG_DATATYPES_Byte );
179 case SG_DATATYPE_Char : return( SG_DATATYPES_Char );
180 case SG_DATATYPE_Word : return( SG_DATATYPES_Word );
181 case SG_DATATYPE_Short : return( SG_DATATYPES_Short );
182 case SG_DATATYPE_DWord : return( SG_DATATYPES_DWord );
183 case SG_DATATYPE_Int : return( SG_DATATYPES_Int );
184 case SG_DATATYPE_ULong : return( SG_DATATYPES_ULong );
185 case SG_DATATYPE_Long : return( SG_DATATYPES_Long );
186 case SG_DATATYPE_Float : return( SG_DATATYPES_Float );
187 case SG_DATATYPE_Double: return( SG_DATATYPES_Double );
188 case SG_DATATYPE_String: return( SG_DATATYPES_String );
189 case SG_DATATYPE_Date : return( SG_DATATYPES_Date );
190 case SG_DATATYPE_Color : return( SG_DATATYPES_Color );
191 case SG_DATATYPE_Binary: return( SG_DATATYPES_Binary );
192 default : return( SG_DATATYPES_Undefined );
193 }
194 };
195
196 //---------------------------------------------------------
197 bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
198 {
199 switch( Type )
200 {
201 case SG_DATATYPE_Bit :
202 case SG_DATATYPE_Byte :
203 case SG_DATATYPE_Char :
204 case SG_DATATYPE_Word :
205 case SG_DATATYPE_Short :
206 case SG_DATATYPE_DWord :
207 case SG_DATATYPE_Int :
208 case SG_DATATYPE_ULong :
209 case SG_DATATYPE_Long :
210 case SG_DATATYPE_Float :
211 case SG_DATATYPE_Double:
212 return( true );
213
214 case SG_DATATYPE_String:
215 case SG_DATATYPE_Date :
216 case SG_DATATYPE_Color :
217 case SG_DATATYPE_Binary: default:
218 return( false );
219 }
220 }
221
222 //---------------------------------------------------------
223 bool SG_Data_Type_Range_Check(TSG_Data_Type Type, double &Value)
224 {
225 double min, max;
226
227 switch( Type )
228 {
229 default:
230 case SG_DATATYPE_Double: Value = (double)Value; return( true );
231 case SG_DATATYPE_Float : Value = (float )Value; return( true );
232
233 case SG_DATATYPE_Bit : min = 0.; max = 1.; break;
234 case SG_DATATYPE_Byte : min = 0.; max = 255.; break;
235 case SG_DATATYPE_Char : min = -128.; max = 127.; break;
236 case SG_DATATYPE_Word : min = 0.; max = 65535.; break;
237 case SG_DATATYPE_Short : min = -32768.; max = 32767.; break;
238 case SG_DATATYPE_DWord : min = 0.; max = 4294967295.; break;
239 case SG_DATATYPE_Int : min = -2147483648.; max = 2147483647.; break;
240 }
241
242 if( Value < min )
243 {
244 Value = min;
245 }
246 else if( Value > max )
247 {
248 Value = max;
249 }
250
251 return( true );
252 }
253
254
256 // //
257 // Environment //
258 // //
260
261 //---------------------------------------------------------
272 class CSG_App_Initialize
273 {
274 public:
275 CSG_App_Initialize(void)
276 {
277 m_Initialized = 0;
278 }
279
280 virtual ~CSG_App_Initialize(void)
281 {}
282
283 bool Initialize (void)
284 {
285 if( wxInitialize() )
286 {
287 m_Initialized++;
288
289 return( true );
290 }
291
292 return( false );
293 }
294
295 bool Uninitialize (void)
296 {
297 if( m_Initialized > 0 )
298 {
299 wxUninitialize();
300
301 m_Initialized--;
302
303 return( true );
304 }
305
306 return( false );
307 }
308
309 bool Uninitialize (bool bAll)
310 {
311 if( bAll )
312 {
313 while( m_Initialized > 0 )
314 {
315 Uninitialize();
316 }
317 }
318 else
319 {
320 Uninitialize();
321 }
322
323 return( true );
324 }
325
326
327 private:
328
329 int m_Initialized;
330
331 };
332
333 //---------------------------------------------------------
334 CSG_App_Initialize g_App_Initialize;
335
336
338 // //
340
341 //---------------------------------------------------------
342 bool SG_Add_Dll_Paths(const wxString &Directory, wxString &Paths)
343 {
344 wxDir Dir(Directory);
345
346 if( Dir.IsOpened() )
347 {
348 wxString Path;
349
350 if( Dir.GetFirst(&Path, "*.dll", wxDIR_HIDDEN|wxDIR_FILES) )
351 {
352 if( !Path.IsEmpty() )
353 {
354 Paths += ";";
355 }
356
357 Paths += Directory;
358 }
359
360 if( Dir.GetFirst(&Path, "gdal_netCDF.dll", wxDIR_HIDDEN|wxDIR_FILES) )
361 {
362 wxSetEnv("GDAL_DRIVER_PATH", Directory);
363 }
364
365 if( Dir.GetFirst(&Path, "pdalcpp.dll", wxDIR_HIDDEN | wxDIR_FILES) )
366 {
367 wxSetEnv("PDAL_DRIVER_PATH", Directory);
368 }
369
370 if( Dir.GetFirst(&Path, wxEmptyString, wxDIR_HIDDEN|wxDIR_DIRS) )
371 {
372 do
373 {
374 wxString SubDir(Directory + "\\" + Path);
375
376 if( !Path.CmpNoCase("gdal-plugins") ) { wxSetEnv("GDAL_DRIVER_PATH", SubDir); }
377 else if( !Path.CmpNoCase("gdal-data" ) ) { wxSetEnv("GDAL_DATA" , SubDir); }
378 else if( !Path.CmpNoCase("proj-data" ) ) { wxSetEnv("PROJ_LIB" , SubDir); }
379 else
380 {
381 SG_Add_Dll_Paths(SubDir, Paths);
382 }
383 }
384 while( Dir.GetNext(&Path) );
385 }
386 }
387
388 return( !Paths.IsEmpty() );
389 }
390
391 //---------------------------------------------------------
392 bool SG_Initialize_Environment(bool bLibraries, bool bProjections, const SG_Char *Directory, bool bInitializeWX)
393 {
394 if( bInitializeWX )
395 {
396 g_App_Initialize.Initialize();
397 }
398
399 //-----------------------------------------------------
400 static bool bInitialized = false;
401
402 if( bInitialized == false )
403 {
404 bInitialized = true;
405
406 SG_UI_ProgressAndMsg_Lock(true);
407
408 #ifdef _SAGA_MSW
409 {
410 wxString App_Path, Dll_Paths, System_Paths;
411
412 if( Directory && SG_Dir_Exists(Directory) )
413 {
414 App_Path = Directory;
415 }
416 else
417 {
418 App_Path = SG_UI_Get_Application_Path(true).c_str();
419 }
420
421 wxGetEnv("PATH", &System_Paths);
422
423 if( SG_Add_Dll_Paths(App_Path + "\\dll", Dll_Paths) )
424 {
425 Dll_Paths += ';' + App_Path + ';' + System_Paths;
426
427 wxSetEnv("PATH", Dll_Paths);
428 }
429
430 if( bLibraries )
431 {
432 SG_Get_Tool_Library_Manager().Add_Directory(SG_File_Make_Path(&App_Path, "tools"), false);
433 }
434
435 if( bProjections )
436 {
437 SG_Get_Projections().Load_Dictionary(SG_File_Make_Path(&App_Path, "saga_prj", "dic"));
438 SG_Get_Projections().Load_DB (SG_File_Make_Path(&App_Path, "saga_prj", "srs"));
439 }
440 }
441 #elif defined(__WXMAC__)
442 {
443 CSG_String App_Path(SG_UI_Get_Application_Path(true));
444
445 if( bLibraries )
446 {
447 if( SG_Get_Tool_Library_Manager().Add_Directory(App_Path + "/../Tools", false) < 1 )
448 {
449 #ifdef TOOLS_PATH
450 SG_Get_Tool_Library_Manager().Add_Directory(TOOLS_PATH);
451 #endif
452
453 #ifdef SHARE_PATH
454 SG_Get_Tool_Library_Manager().Add_Directory(CSG_String(SHARE_PATH) + "/toolchains"); // look for tool chains
455 #endif
456 }
457 }
458
459 if( bProjections )
460 {
461 if( SG_Get_Projections().Load_Dictionary(App_Path + "/saga_prj.dic") == false )
462 {
463 #ifdef SHARE_PATH
464 SG_Get_Projections().Load_Dictionary(CSG_String(SHARE_PATH) + "/saga_prj.dic");
465 #endif
466 }
467
468 if( SG_Get_Projections().Load_DB (App_Path + "/saga_prj.srs") == false )
469 {
470 #ifdef SHARE_PATH
471 SG_Get_Projections().Load_DB (CSG_String(SHARE_PATH) + "/saga_prj.srs");
472 #endif
473 }
474 }
475
476 if( SG_Dir_Exists(App_Path + "/proj-data") ) { wxSetEnv("PROJ_LIB" , wxString::Format("%s/proj-data", App_Path.c_str())); }
477 if( SG_Dir_Exists(App_Path + "/gdal-data") ) { wxSetEnv("GDAL_DATA", wxString::Format("%s/gdal-data", App_Path.c_str())); }
478 }
479 #else // #ifdef _SAGA_LINUX
480 {
481 if( bLibraries )
482 {
483 #ifdef TOOLS_PATH
484 SG_Get_Tool_Library_Manager().Add_Directory(TOOLS_PATH);
485 #endif
486 #ifdef SHARE_PATH
487 SG_Get_Tool_Library_Manager().Add_Directory(SG_File_Make_Path(SHARE_PATH, "toolchains")); // look for tool chains
488 #endif
489 }
490
491 if( bProjections )
492 {
493 #ifdef SHARE_PATH
494 SG_Get_Projections().Load_Dictionary(SG_File_Make_Path(SHARE_PATH, "saga_prj", "dic"));
495 SG_Get_Projections().Load_DB (SG_File_Make_Path(SHARE_PATH, "saga_prj", "srs"));
496 #endif
497 }
498 }
499 #endif
500
501 SG_UI_ProgressAndMsg_Lock(false);
502 }
503
504 //-----------------------------------------------------
505 if( bLibraries )
506 {
507 wxString Path;
508
509 if( wxGetEnv("SAGA_TLB", &Path) )
510 {
511 SG_UI_ProgressAndMsg_Lock(true);
512
513 #ifdef _SAGA_MSW
514 CSG_Strings Paths = SG_String_Tokenize(&Path, ";" ); // colon (':') would split drive from paths!
515 #else // #ifdef _SAGA_LINUX
516 CSG_Strings Paths = SG_String_Tokenize(&Path, ";:"); // colon (':') is more native to non-windows os than semi-colon (';'), we support both...
517 #endif
518
519 for(int i=0; i<Paths.Get_Count(); i++)
520 {
521 SG_Get_Tool_Library_Manager().Add_Directory(Paths[i]);
522 }
523
524 SG_UI_ProgressAndMsg_Lock(false);
525 }
526 }
527
528 //-----------------------------------------------------
529 return( true );
530 }
531
532 //---------------------------------------------------------
533 bool SG_Uninitialize_Environment(void)
534 {
535 g_App_Initialize.Uninitialize(true);
536
537 return( true );
538 }
539
540
542 // //
543 // //
544 // //
546
547 //---------------------------------------------------------
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
g_App_Initialize
CSG_App_Initialize g_App_Initialize
Definition: api_core.cpp:334
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
SG_DATATYPES_ULong
#define SG_DATATYPES_ULong
Definition: api_core.h:1014
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
SG_DATATYPES_Double
#define SG_DATATYPES_Double
Definition: api_core.h:1017
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
SG_DATATYPE_Binary
@ SG_DATATYPE_Binary
Definition: api_core.h:1000
SG_Data_Type_Range_Check
bool SG_Data_Type_Range_Check(TSG_Data_Type Type, double &Value)
Definition: api_core.cpp:223
SG_Data_Type_Get_Flag
int SG_Data_Type_Get_Flag(TSG_Data_Type Type)
Definition: api_core.cpp:173
SG_DATATYPES_Undefined
#define SG_DATATYPES_Undefined
Definition: api_core.h:1006
SG_Uninitialize_Environment
bool SG_Uninitialize_Environment(void)
Definition: api_core.cpp:533
SG_DATATYPES_Float
#define SG_DATATYPES_Float
Definition: api_core.h:1016
SG_Dir_Exists
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
Definition: api_file.cpp:727
SG_DATATYPES_DWord
#define SG_DATATYPES_DWord
Definition: api_core.h:1012
SG_Add_Dll_Paths
bool SG_Add_Dll_Paths(const wxString &Directory, wxString &Paths)
Definition: api_core.cpp:342
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
SG_DATATYPES_Long
#define SG_DATATYPES_Long
Definition: api_core.h:1015
api_core.h
SG_DATATYPES_String
#define SG_DATATYPES_String
Definition: api_core.h:1018
SG_UI_Get_Application_Path
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
Definition: api_callback.cpp:786
SG_DATATYPES_Word
#define SG_DATATYPES_Word
Definition: api_core.h:1010
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SG_Data_Type_Get_Identifier
CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
Definition: api_core.cpp:146
SG_OMP_Get_Max_Num_Threads
int SG_OMP_Get_Max_Num_Threads(void)
Definition: api_core.cpp:109
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
SG_DATATYPES_Char
#define SG_DATATYPES_Char
Definition: api_core.h:1009
SG_Initialize_Environment
bool SG_Initialize_Environment(bool bLibraries, bool bProjections, const SG_Char *Directory, bool bInitializeWX)
Definition: api_core.cpp:392
SG_DATATYPES_Byte
#define SG_DATATYPES_Byte
Definition: api_core.h:1008
SG_DATATYPES_Bit
#define SG_DATATYPES_Bit
Definition: api_core.h:1007
SG_DATATYPES_Date
#define SG_DATATYPES_Date
Definition: api_core.h:1019
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_Data_Type_is_Numeric
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
Definition: api_core.cpp:197
SG_DATATYPES_Short
#define SG_DATATYPES_Short
Definition: api_core.h:1011
SG_OMP_Get_Max_Num_Procs
int SG_OMP_Get_Max_Num_Procs(void)
Definition: api_core.cpp:110
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
SG_String_Tokenize
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1493
SG_Data_Type_Get_Name
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
Definition: api_core.cpp:122
SG_Get_Projections
SAGA_API_DLL_EXPORT CSG_Projections & SG_Get_Projections(void)
Definition: projections.cpp:66
CSG_Strings
Definition: api_core.h:693
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
SG_DATATYPES_Binary
#define SG_DATATYPES_Binary
Definition: api_core.h:1021
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
SG_Char
#define SG_Char
Definition: api_core.h:530
SG_DATATYPES_Color
#define SG_DATATYPES_Color
Definition: api_core.h:1020
CSG_String
Definition: api_core.h:557
SG_OMP_Set_Max_Num_Threads
void SG_OMP_Set_Max_Num_Threads(int iCores)
Definition: api_core.cpp:108
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Tool_Library_Manager::Add_Directory
int Add_Directory(const CSG_String &Directory, bool bOnlySubDirectories=false)
Definition: tool_library.cpp:394
SG_OMP_Get_Thread_Num
int SG_OMP_Get_Thread_Num(void)
Definition: api_core.cpp:111
SG_DATATYPES_Int
#define SG_DATATYPES_Int
Definition: api_core.h:1013
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Projections::Load_DB
bool Load_DB(const CSG_String &FileName, bool bAppend=false)
Definition: projections.cpp:860
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
SG_Data_Type_Get_Type
TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
Definition: api_core.cpp:152
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Projections::Load_Dictionary
bool Load_Dictionary(const CSG_String &FileName)
Definition: projections.cpp:811
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_core.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Typedefs | Enumerations | Functions | Variables
api_core.h File Reference
#include <math.h>
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <string>

Go to the source code of this file.

Classes

class | CSG_Buffer
class | CSG_Array
class | CSG_Array_Pointer
class | CSG_Array_Int
class | CSG_Array_sLong
class | CSG_String
class | CSG_Strings
class | CSG_String_Tokenizer
class | CSG_Bytes
class | CSG_Bytes_Array
class | CSG_Stack
class | CSG_File
class | CSG_File_Zip
class | CSG_Colors
class | CSG_Translator
class | CSG_UI_Parameter

Macros

#define | _SAGA_DLL_EXPORT
#define | _SAGA_DLL_IMPORT
#define | SAGA_API_DLL_EXPORT _SAGA_DLL_IMPORT
#define | SIZEOF_LONG 4
#define | SG_is_NaN(x) (x != x)
#define | SG_GET_LONG(b0, b1, b2, b3) ((long) (((BYTE)(b0) | ((WORD)(b1) << 8)) | (((DWORD)(BYTE)(b2)) << 16) | (((DWORD)(BYTE)(b3)) << 24)))
#define | SG_GET_BYTE_0(vLong) ((BYTE) ((vLong) ))
#define | SG_GET_BYTE_1(vLong) ((BYTE) ((vLong) >> 8))
#define | SG_GET_BYTE_2(vLong) ((BYTE) ((vLong) >> 16))
#define | SG_GET_BYTE_3(vLong) ((BYTE) ((vLong) >> 24))
#define | SG_FREE_SAFE(PTR) { if( PTR ) { SG_Free (PTR); PTR = NULL; } }
#define | SG_DELETE_SAFE(PTR) { if( PTR ) { delete (PTR); PTR = NULL; } }
#define | SG_DELETE_ARRAY(PTR) { if( PTR ) { delete[](PTR); PTR = NULL; } }
#define | SG_Char wchar_t
#define | SG_T(s) L ## s
#define | SG_PRINTF SG_Printf
#define | SG_FPRINTF SG_FPrintf
#define | SG_SSCANF swscanf
#define | SG_STR_CPY wcscpy
#define | SG_STR_LEN wcslen
#define | SG_STR_TOD wcstod
#define | SG_STR_CMP(s1, s2) CSG_String(s1).Cmp(s2)
#define | SG_STR_MBTOSG(s) CSG_String(s).w_str()
#define | SG_DEFAULT_DELIMITERS " \t\r\n"
#define | SG_DATATYPES_Undefined 0x0000
#define | SG_DATATYPES_Bit 0x0001
#define | SG_DATATYPES_Byte 0x0002
#define | SG_DATATYPES_Char 0x0004
#define | SG_DATATYPES_Word 0x0008
#define | SG_DATATYPES_Short 0x0010
#define | SG_DATATYPES_DWord 0x0020
#define | SG_DATATYPES_Int 0x0040
#define | SG_DATATYPES_ULong 0x0080
#define | SG_DATATYPES_Long 0x0100
#define | SG_DATATYPES_Float 0x0200
#define | SG_DATATYPES_Double 0x0400
#define | SG_DATATYPES_String 0x0800
#define | SG_DATATYPES_Date 0x1000
#define | SG_DATATYPES_Color 0x2000
#define | SG_DATATYPES_Binary 0x4000
#define | SG_DATATYPES_Standard 0xFFFF
#define | SG_DATATYPES_SInteger (SG_DATATYPES_Char|SG_DATATYPES_Short|SG_DATATYPES_Int |SG_DATATYPES_Long)
#define | SG_DATATYPES_UInteger (SG_DATATYPES_Byte|SG_DATATYPES_Word |SG_DATATYPES_DWord|SG_DATATYPES_ULong)
#define | SG_DATATYPES_Integer (SG_DATATYPES_SInteger|SG_DATATYPES_UInteger)
#define | SG_DATATYPES_Real (SG_DATATYPES_Float|SG_DATATYPES_Double)
#define | SG_DATATYPES_Numeric (SG_DATATYPES_Integer|SG_DATATYPES_Real)
#define | SG_DATATYPES_Table (SG_DATATYPES_String|SG_DATATYPES_Date|SG_DATATYPES_Color|SG_DATATYPES_Numeric|SG_DATATYPES_Binary)
#define | SG_GET_RGB(r, g, b) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16)))
#define | SG_GET_RGBA(r, g, b, a) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16) | (((DWORD)(BYTE)(a)) << 24)))
#define | SG_GET_R(rgb) ((BYTE) ((rgb) ))
#define | SG_GET_G(rgb) ((BYTE) ((rgb) >> 8))
#define | SG_GET_B(rgb) ((BYTE) ((rgb) >> 16))
#define | SG_GET_A(rgb) ((BYTE) ((rgb) >> 24))
#define | SG_COLOR_BLACK SG_GET_RGB( 0, 0, 0)
#define | SG_COLOR_GREY SG_GET_RGB(128, 128, 128)
#define | SG_COLOR_GREY_LIGHT SG_GET_RGB(192, 192, 192)
#define | SG_COLOR_WHITE SG_GET_RGB(255, 255, 255)
#define | SG_COLOR_RED SG_GET_RGB(255, 0, 0)
#define | SG_COLOR_RED_DARK SG_GET_RGB(128, 0, 0)
#define | SG_COLOR_YELLOW SG_GET_RGB(255, 255, 0)
#define | SG_COLOR_YELLOW_DARK SG_GET_RGB(128, 128, 0)
#define | SG_COLOR_GREEN SG_GET_RGB( 0, 255, 0)
#define | SG_COLOR_GREEN_DARK SG_GET_RGB( 0, 128, 0)
#define | SG_COLOR_GREEN_LIGHT SG_GET_RGB( 0, 255, 0)
#define | SG_COLOR_BLUE SG_GET_RGB( 0, 0, 255)
#define | SG_COLOR_BLUE_DARK SG_GET_RGB( 0, 0, 128)
#define | SG_COLOR_BLUE_LIGHT SG_GET_RGB( 0, 255, 255)
#define | SG_COLOR_BLUE_GREEN SG_GET_RGB( 0, 128, 128)
#define | SG_COLOR_PURPLE SG_GET_RGB(128, 0, 128)
#define | SG_COLOR_PINK SG_GET_RGB(255, 0, 255)
#define | SG_COLOR_NONE -1
#define | SG_COLOR_RANDOM -2
#define | _TL(s) SG_Translate(L ## s)
#define | _TW(s) SG_Translate(CSG_String(s))

Typedefs

typedef signed long long | sLong
typedef unsigned long long | uLong
typedef int(* | TSG_PFNC_UI_Callback) (TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)

Enumerations

enum TSG_Array_Growth {
TSG_Array_Growth::SG_ARRAY_GROWTH_0 = 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1, TSG_Array_Growth::SG_ARRAY_GROWTH_2, TSG_Array_Growth::SG_ARRAY_GROWTH_3,
TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_8, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_16, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_32, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_64,
TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_128, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_256, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_512, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_1024
}
enum TSG_File_Flags_Encoding {
SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF7, SG_FILE_ENCODING_UTF8, SG_FILE_ENCODING_UTF16LE,
SG_FILE_ENCODING_UTF16BE, SG_FILE_ENCODING_UTF32LE, SG_FILE_ENCODING_UTF32BE, SG_FILE_ENCODING_UNDEFINED
}
enum TSG_String_Tokenizer_Mode {
SG_TOKEN_INVALID, SG_TOKEN_DEFAULT, SG_TOKEN_RET_EMPTY, SG_TOKEN_RET_EMPTY_ALL,
SG_TOKEN_RET_DELIMS, SG_TOKEN_STRTOK
}
enum TSG_Data_Type {
SG_DATATYPE_Bit = 0, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Word,
SG_DATATYPE_Short, SG_DATATYPE_DWord, SG_DATATYPE_Int, SG_DATATYPE_ULong,
SG_DATATYPE_Long, SG_DATATYPE_Float, SG_DATATYPE_Double, SG_DATATYPE_String,
SG_DATATYPE_Date, SG_DATATYPE_Color, SG_DATATYPE_Binary, SG_DATATYPE_Undefined
}
enum | TSG_File_Type { SG_FILE_TYPE_NORMAL, SG_FILE_TYPE_ZIP }
enum | ESG_File_Flags_Open { SG_FILE_R, SG_FILE_W, SG_FILE_RW }
enum | ESG_File_Flags_Seek { SG_FILE_START, SG_FILE_CURRENT, SG_FILE_END }
enum ESG_Colors {
SG_COLORS_DEFAULT = 0, SG_COLORS_DEFAULT_BRIGHT, SG_COLORS_BLACK_WHITE, SG_COLORS_BLACK_RED,
SG_COLORS_BLACK_GREEN, SG_COLORS_BLACK_BLUE, SG_COLORS_WHITE_RED, SG_COLORS_WHITE_GREEN,
SG_COLORS_WHITE_BLUE, SG_COLORS_YELLOW_RED, SG_COLORS_YELLOW_GREEN, SG_COLORS_YELLOW_BLUE,
SG_COLORS_GREEN_RED, SG_COLORS_RED_GREEN, SG_COLORS_RED_BLUE, SG_COLORS_GREEN_BLUE,
SG_COLORS_RED_GREY_BLUE, SG_COLORS_RED_GREY_GREEN, SG_COLORS_GREEN_GREY_BLUE, SG_COLORS_RED_GREEN_BLUE,
SG_COLORS_RED_BLUE_GREEN, SG_COLORS_GREEN_RED_BLUE, SG_COLORS_RAINBOW, SG_COLORS_NEON,
SG_COLORS_TOPOGRAPHY, SG_COLORS_TOPOGRAPHY_2, SG_COLORS_TOPOGRAPHY_3, SG_COLORS_PRECIPITATION,
SG_COLORS_ASPECT_1, SG_COLORS_ASPECT_2, SG_COLORS_ASPECT_3, SG_COLORS_COUNT
}
enum TSG_UI_MSG_STYLE {
SG_UI_MSG_STYLE_NORMAL = 0, SG_UI_MSG_STYLE_BOLD, SG_UI_MSG_STYLE_ITALIC, SG_UI_MSG_STYLE_SUCCESS,
SG_UI_MSG_STYLE_FAILURE, SG_UI_MSG_STYLE_BIG, SG_UI_MSG_STYLE_SMALL, SG_UI_MSG_STYLE_01,
SG_UI_MSG_STYLE_02, SG_UI_MSG_STYLE_03
}
enum TSG_UI_DataObject_Update {
SG_UI_DATAOBJECT_UPDATE = 0, SG_UI_DATAOBJECT_SHOW_MAP, SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE, SG_UI_DATAOBJECT_SHOW_MAP_NEW,
SG_UI_DATAOBJECT_SHOW_MAP_LAST
}
enum | TSG_UI_Maps { SG_UI_MAP_ACTIVE = 0, SG_UI_MAP_LAST, SG_UI_MAP_ALL }
enum TSG_UI_Window_Arrange {
SG_UI_WINDOW_ARRANGE_MDI_CASCADE = 0x0001, SG_UI_WINDOW_ARRANGE_MDI_TILE_VER = 0x0002, SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR = 0x0004, SG_UI_WINDOW_ARRANGE_TDI_TILE_VER = 0x0008,
SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR = 0x0010, SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT = 0x0020, SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT = 0x0040, SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP = 0x0080,
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM = 0x0100
}
enum TSG_UI_Callback_ID {
CALLBACK_PROCESS_GET_OKAY, CALLBACK_PROCESS_SET_OKAY, CALLBACK_PROCESS_SET_BUSY, CALLBACK_PROCESS_SET_PROGRESS,
CALLBACK_PROCESS_SET_READY, CALLBACK_PROCESS_SET_TEXT, CALLBACK_STOP_EXECUTION, CALLBACK_DLG_MESSAGE,
CALLBACK_DLG_CONTINUE, CALLBACK_DLG_ERROR, CALLBACK_DLG_INFO, CALLBACK_DLG_PARAMETERS,
CALLBACK_MESSAGE_ADD, CALLBACK_MESSAGE_ADD_ERROR, CALLBACK_MESSAGE_ADD_EXECUTION, CALLBACK_DATAOBJECT_ADD,
CALLBACK_DATAOBJECT_UPDATE, CALLBACK_DATAOBJECT_SHOW, CALLBACK_DATAOBJECT_ASIMAGE, CALLBACK_DATAOBJECT_COLORS_GET,
CALLBACK_DATAOBJECT_COLORS_SET, CALLBACK_DATAOBJECT_PARAMS_GET, CALLBACK_DATAOBJECT_PARAMS_SET, CALLBACK_SET_MAP_EXTENT,
CALLBACK_DIAGRAM_SHOW, CALLBACK_DATABASE_UPDATE, CALLBACK_WINDOW_ARRANGE, CALLBACK_GET_APP_WINDOW,
CALLBACK_GET_APP_PATH
}

Functions

SAGA_API_DLL_EXPORT void | SG_OMP_Set_Max_Num_Threads (int iCores)
SAGA_API_DLL_EXPORT int | SG_OMP_Get_Max_Num_Threads (void)
SAGA_API_DLL_EXPORT int | SG_OMP_Get_Max_Num_Procs (void)
SAGA_API_DLL_EXPORT int | SG_OMP_Get_Thread_Num (void)
SAGA_API_DLL_EXPORT void * | SG_Malloc (size_t size)
SAGA_API_DLL_EXPORT void * | SG_Calloc (size_t num, size_t size)
SAGA_API_DLL_EXPORT void * | SG_Realloc (void *memblock, size_t size)
SAGA_API_DLL_EXPORT void | SG_Free (void *memblock)
SAGA_API_DLL_EXPORT void | SG_Swap_Bytes (void *Buffer, int nBytes)
SAGA_API_DLL_EXPORT int | SG_Mem_Get_Int (const char *Buffer, bool bSwapBytes)
SAGA_API_DLL_EXPORT void | SG_Mem_Set_Int (char *Buffer, int Value, bool bSwapBytes)
SAGA_API_DLL_EXPORT double | SG_Mem_Get_Double (const char *Buffer, bool bSwapBytes)
SAGA_API_DLL_EXPORT void | SG_Mem_Set_Double (char *Buffer, double Value, bool bSwapBytes)
SAGA_API_DLL_EXPORT CSG_String | operator+ (const char *A, const CSG_String &B)
SAGA_API_DLL_EXPORT CSG_String | operator+ (const wchar_t *A, const CSG_String &B)
SAGA_API_DLL_EXPORT CSG_String | operator+ (char A, const CSG_String &B)
SAGA_API_DLL_EXPORT CSG_String | operator+ (wchar_t A, const CSG_String &B)
SAGA_API_DLL_EXPORT CSG_Strings | SG_String_Tokenize (const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
SAGA_API_DLL_EXPORT bool | SG_is_Character_Numeric (int Character)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_CurrentTimeStr (bool bWithDate=true)
SAGA_API_DLL_EXPORT double | SG_Degree_To_Double (const CSG_String &String)
SAGA_API_DLL_EXPORT CSG_String | SG_Double_To_Degree (double Value)
SAGA_API_DLL_EXPORT int | SG_Get_Significant_Decimals (double Value, int maxDecimals=6)
SAGA_API_DLL_EXPORT void | SG_Flip_Decimal_Separators (CSG_String &String)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_String (double Value, int Precision=-99)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_String (int Value, int Precision=0)
size_t | SG_Data_Type_Get_Size (TSG_Data_Type Type)
SAGA_API_DLL_EXPORT CSG_String | SG_Data_Type_Get_Name (TSG_Data_Type Type, bool bShort=false)
SAGA_API_DLL_EXPORT CSG_String | SG_Data_Type_Get_Identifier (TSG_Data_Type Type)
SAGA_API_DLL_EXPORT TSG_Data_Type | SG_Data_Type_Get_Type (const CSG_String &Identifier)
SAGA_API_DLL_EXPORT int | SG_Data_Type_Get_Flag (TSG_Data_Type Type)
SAGA_API_DLL_EXPORT bool | SG_Data_Type_is_Numeric (TSG_Data_Type Type)
SAGA_API_DLL_EXPORT bool | SG_Data_Type_Range_Check (TSG_Data_Type Type, double &Value)
SAGA_API_DLL_EXPORT bool | SG_Dir_Exists (const CSG_String &Directory)
SAGA_API_DLL_EXPORT bool | SG_Dir_Create (const CSG_String &Directory, bool bFullPath=false)
SAGA_API_DLL_EXPORT bool | SG_Dir_Delete (const CSG_String &Directory, bool bRecursive=false)
SAGA_API_DLL_EXPORT CSG_String | SG_Dir_Get_Current (void)
SAGA_API_DLL_EXPORT CSG_String | SG_Dir_Get_Temp (void)
SAGA_API_DLL_EXPORT bool | SG_Dir_List_Subdirectories (CSG_Strings &List, const CSG_String &Directory)
SAGA_API_DLL_EXPORT bool | SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory)
SAGA_API_DLL_EXPORT bool | SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension)
SAGA_API_DLL_EXPORT bool | SG_File_Exists (const CSG_String &FileName)
SAGA_API_DLL_EXPORT bool | SG_File_Delete (const CSG_String &FileName)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Name_Temp (const CSG_String &Prefix)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Name_Temp (const CSG_String &Prefix, const CSG_String &Directory)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Name (const CSG_String &full_Path, bool bExtension)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Path (const CSG_String &full_Path)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Path_Absolute (const CSG_String &full_Path)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Path_Relative (const CSG_String &Directory, const CSG_String &full_Path)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name, const CSG_String &Extension)
SAGA_API_DLL_EXPORT bool | SG_File_Cmp_Extension (const CSG_String &FileName, const CSG_String &Extension)
SAGA_API_DLL_EXPORT CSG_String | SG_File_Get_Extension (const CSG_String &FileName)
SAGA_API_DLL_EXPORT bool | SG_File_Set_Extension (CSG_String &FileName, const CSG_String &Extension)
SAGA_API_DLL_EXPORT bool | SG_Get_Environment (const CSG_String &Variable, CSG_String *Value=NULL)
SAGA_API_DLL_EXPORT bool | SG_Set_Environment (const CSG_String &Variable, const CSG_String &Value)
SAGA_API_DLL_EXPORT CSG_String | SG_Colors_Get_Name (int Index)
SAGA_API_DLL_EXPORT long | SG_Color_Get_Random (void)
SAGA_API_DLL_EXPORT bool | SG_Color_From_Text (const CSG_String &Text, long &Color)
SAGA_API_DLL_EXPORT CSG_String | SG_Color_To_Text (long Color, bool bHexadecimal=true)
SAGA_API_DLL_EXPORT CSG_Translator & | SG_Get_Translator (void)
SAGA_API_DLL_EXPORT const SG_Char * | SG_Translate (const CSG_String &Text)
SAGA_API_DLL_EXPORT bool | SG_Set_UI_Callback (TSG_PFNC_UI_Callback Function)
SAGA_API_DLL_EXPORT TSG_PFNC_UI_Callback | SG_Get_UI_Callback (void)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Set_UTF8 (bool bOn)
SAGA_API_DLL_EXPORT bool | SG_UI_Console_Get_UTF8 (void)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdOut (const char *Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdOut (const wchar_t *Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdOut (const CSG_String &Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdErr (const char *Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdErr (const wchar_t *Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void | SG_UI_Console_Print_StdErr (const CSG_String &Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT int | SG_UI_Progress_Lock (bool bOn)
SAGA_API_DLL_EXPORT int | SG_UI_Progress_Reset (void)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Get_Okay (bool bBlink=false)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Okay (bool bOkay=true)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Busy (bool bOn=true, const CSG_String &Message="")
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Progress (int Position, int Range)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Progress (sLong Position, sLong Range)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Progress (double Position, double Range)
SAGA_API_DLL_EXPORT bool | SG_UI_Process_Set_Ready (void)
SAGA_API_DLL_EXPORT void | SG_UI_Process_Set_Text (const CSG_String &Text)
SAGA_API_DLL_EXPORT bool | SG_UI_Stop_Execution (bool bDialog)
SAGA_API_DLL_EXPORT void | SG_UI_Dlg_Message (const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT bool | SG_UI_Dlg_Continue (const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT int | SG_UI_Dlg_Error (const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT void | SG_UI_Dlg_Info (const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT bool | SG_UI_Dlg_Parameters (class CSG_Parameters *pParameters, const CSG_String &Caption)
SAGA_API_DLL_EXPORT int | SG_UI_Msg_Lock (bool bOn)
SAGA_API_DLL_EXPORT int | SG_UI_Msg_Reset (void)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add (const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add (const wchar_t *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add (const CSG_String &Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Execution (const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Execution (const wchar_t *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Execution (const CSG_String &Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Error (const char *Message)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Error (const wchar_t *Message)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Add_Error (const CSG_String &Message)
SAGA_API_DLL_EXPORT void | SG_UI_Msg_Flush (void)
SAGA_API_DLL_EXPORT void | SG_UI_ProgressAndMsg_Lock (bool bOn)
SAGA_API_DLL_EXPORT void | SG_UI_ProgressAndMsg_Reset (void)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Add (class CSG_Data_Object *pDataObject, int Show)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Update (class CSG_Data_Object *pDataObject, int Show, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Show (class CSG_Data_Object *pDataObject, int Show)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_asImage (class CSG_Data_Object *pDataObject, class CSG_Grid *pGrid)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Colors_Get (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Colors_Set (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Params_Get (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool | SG_UI_DataObject_Params_Set (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool | SG_UI_Set_Map_Extent (double xMin, double yMin, double xMax, double yMax, int Maps=SG_UI_MAP_ACTIVE)
SAGA_API_DLL_EXPORT bool | SG_UI_Diagram_Show (class CSG_Table *pTable, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool | SG_UI_ODBC_Update (const CSG_String &Server)
SAGA_API_DLL_EXPORT int | SG_UI_Window_Arrange (int Arrange)
SAGA_API_DLL_EXPORT void * | SG_UI_Get_Window_Main (void)
SAGA_API_DLL_EXPORT CSG_String | SG_UI_Get_Application_Path (bool bPathOnly=false)
SAGA_API_DLL_EXPORT bool | SG_Initialize_Environment (bool bLibraries=true, bool bProjections=true, const SG_Char *Directory=NULL, bool bInitializeWX=true)
SAGA_API_DLL_EXPORT bool | SG_Uninitialize_Environment (void)

Variables

const char gSG_Data_Type_Identifier [][32]

Detailed Description

Classes, functions, type definitions for basic helpers like data types, memory allocation, string handling, file access, translations, colors and user interface communication.

See also
CSG_String
CSG_File
CSG_Array
CSG_Bytes

Definition in file api_core.h.

Macro Definition Documentation

◆ _SAGA_DLL_EXPORT

#define _SAGA_DLL_EXPORT

Definition at line 86 of file api_core.h.

◆ _SAGA_DLL_IMPORT

#define _SAGA_DLL_IMPORT

Definition at line 87 of file api_core.h.

◆ _TL

#define _TL ( s ) SG_Translate(L ## s)

Definition at line 1480 of file api_core.h.

◆ _TW

#define _TW ( s ) SG_Translate(CSG_String(s))

Definition at line 1481 of file api_core.h.

◆ SAGA_API_DLL_EXPORT

#define SAGA_API_DLL_EXPORT _SAGA_DLL_IMPORT

Definition at line 94 of file api_core.h.

◆ SG_Char

#define SG_Char wchar_t

Definition at line 530 of file api_core.h.

◆ SG_COLOR_BLACK

#define SG_COLOR_BLACK SG_GET_RGB( 0, 0, 0)

Definition at line 1262 of file api_core.h.

◆ SG_COLOR_BLUE

#define SG_COLOR_BLUE SG_GET_RGB( 0, 0, 255)

Definition at line 1273 of file api_core.h.

◆ SG_COLOR_BLUE_DARK

#define SG_COLOR_BLUE_DARK SG_GET_RGB( 0, 0, 128)

Definition at line 1274 of file api_core.h.

◆ SG_COLOR_BLUE_GREEN

#define SG_COLOR_BLUE_GREEN SG_GET_RGB( 0, 128, 128)

Definition at line 1276 of file api_core.h.

◆ SG_COLOR_BLUE_LIGHT

#define SG_COLOR_BLUE_LIGHT SG_GET_RGB( 0, 255, 255)

Definition at line 1275 of file api_core.h.

◆ SG_COLOR_GREEN

#define SG_COLOR_GREEN SG_GET_RGB( 0, 255, 0)

Definition at line 1270 of file api_core.h.

◆ SG_COLOR_GREEN_DARK

#define SG_COLOR_GREEN_DARK SG_GET_RGB( 0, 128, 0)

Definition at line 1271 of file api_core.h.

◆ SG_COLOR_GREEN_LIGHT

#define SG_COLOR_GREEN_LIGHT SG_GET_RGB( 0, 255, 0)

Definition at line 1272 of file api_core.h.

◆ SG_COLOR_GREY

#define SG_COLOR_GREY SG_GET_RGB(128, 128, 128)

Definition at line 1263 of file api_core.h.

◆ SG_COLOR_GREY_LIGHT

#define SG_COLOR_GREY_LIGHT SG_GET_RGB(192, 192, 192)

Definition at line 1264 of file api_core.h.

◆ SG_COLOR_NONE

#define SG_COLOR_NONE -1

Definition at line 1279 of file api_core.h.

◆ SG_COLOR_PINK

#define SG_COLOR_PINK SG_GET_RGB(255, 0, 255)

Definition at line 1278 of file api_core.h.

◆ SG_COLOR_PURPLE

#define SG_COLOR_PURPLE SG_GET_RGB(128, 0, 128)

Definition at line 1277 of file api_core.h.

◆ SG_COLOR_RANDOM

#define SG_COLOR_RANDOM -2

Definition at line 1280 of file api_core.h.

◆ SG_COLOR_RED

#define SG_COLOR_RED SG_GET_RGB(255, 0, 0)

Definition at line 1266 of file api_core.h.

◆ SG_COLOR_RED_DARK

#define SG_COLOR_RED_DARK SG_GET_RGB(128, 0, 0)

Definition at line 1267 of file api_core.h.

◆ SG_COLOR_WHITE

#define SG_COLOR_WHITE SG_GET_RGB(255, 255, 255)

Definition at line 1265 of file api_core.h.

◆ SG_COLOR_YELLOW

#define SG_COLOR_YELLOW SG_GET_RGB(255, 255, 0)

Definition at line 1268 of file api_core.h.

◆ SG_COLOR_YELLOW_DARK

#define SG_COLOR_YELLOW_DARK SG_GET_RGB(128, 128, 0)

Definition at line 1269 of file api_core.h.

◆ SG_DATATYPES_Binary

#define SG_DATATYPES_Binary 0x4000

Definition at line 1021 of file api_core.h.

◆ SG_DATATYPES_Bit

#define SG_DATATYPES_Bit 0x0001

Definition at line 1007 of file api_core.h.

◆ SG_DATATYPES_Byte

#define SG_DATATYPES_Byte 0x0002

Definition at line 1008 of file api_core.h.

◆ SG_DATATYPES_Char

#define SG_DATATYPES_Char 0x0004

Definition at line 1009 of file api_core.h.

◆ SG_DATATYPES_Color

#define SG_DATATYPES_Color 0x2000

Definition at line 1020 of file api_core.h.

◆ SG_DATATYPES_Date

#define SG_DATATYPES_Date 0x1000

Definition at line 1019 of file api_core.h.

◆ SG_DATATYPES_Double

#define SG_DATATYPES_Double 0x0400

Definition at line 1017 of file api_core.h.

◆ SG_DATATYPES_DWord

#define SG_DATATYPES_DWord 0x0020

Definition at line 1012 of file api_core.h.

◆ SG_DATATYPES_Float

#define SG_DATATYPES_Float 0x0200

Definition at line 1016 of file api_core.h.

◆ SG_DATATYPES_Int

#define SG_DATATYPES_Int 0x0040

Definition at line 1013 of file api_core.h.

◆ SG_DATATYPES_Integer

#define SG_DATATYPES_Integer (SG_DATATYPES_SInteger|SG_DATATYPES_UInteger)

Definition at line 1025 of file api_core.h.

◆ SG_DATATYPES_Long

#define SG_DATATYPES_Long 0x0100

Definition at line 1015 of file api_core.h.

◆ SG_DATATYPES_Numeric

#define SG_DATATYPES_Numeric (SG_DATATYPES_Integer|SG_DATATYPES_Real)

Definition at line 1027 of file api_core.h.

◆ SG_DATATYPES_Real

#define SG_DATATYPES_Real (SG_DATATYPES_Float|SG_DATATYPES_Double)

Definition at line 1026 of file api_core.h.

◆ SG_DATATYPES_Short

#define SG_DATATYPES_Short 0x0010

Definition at line 1011 of file api_core.h.

◆ SG_DATATYPES_SInteger

#define SG_DATATYPES_SInteger (SG_DATATYPES_Char|SG_DATATYPES_Short|SG_DATATYPES_Int |SG_DATATYPES_Long)

Definition at line 1023 of file api_core.h.

◆ SG_DATATYPES_Standard

#define SG_DATATYPES_Standard 0xFFFF

Definition at line 1022 of file api_core.h.

◆ SG_DATATYPES_String

#define SG_DATATYPES_String 0x0800

Definition at line 1018 of file api_core.h.

◆ SG_DATATYPES_Table

#define SG_DATATYPES_Table (SG_DATATYPES_String|SG_DATATYPES_Date|SG_DATATYPES_Color|SG_DATATYPES_Numeric|SG_DATATYPES_Binary)

Definition at line 1028 of file api_core.h.

◆ SG_DATATYPES_UInteger

#define SG_DATATYPES_UInteger (SG_DATATYPES_Byte|SG_DATATYPES_Word |SG_DATATYPES_DWord|SG_DATATYPES_ULong)

Definition at line 1024 of file api_core.h.

◆ SG_DATATYPES_ULong

#define SG_DATATYPES_ULong 0x0080

Definition at line 1014 of file api_core.h.

◆ SG_DATATYPES_Undefined

#define SG_DATATYPES_Undefined 0x0000

Definition at line 1006 of file api_core.h.

◆ SG_DATATYPES_Word

#define SG_DATATYPES_Word 0x0008

Definition at line 1010 of file api_core.h.

◆ SG_DEFAULT_DELIMITERS

#define SG_DEFAULT_DELIMITERS " \t\r\n"

Definition at line 739 of file api_core.h.

◆ SG_DELETE_ARRAY

#define SG_DELETE_ARRAY ( PTR ) { if( PTR ) { delete[](PTR); PTR = NULL; } }

Definition at line 207 of file api_core.h.

◆ SG_DELETE_SAFE

#define SG_DELETE_SAFE ( PTR ) { if( PTR ) { delete (PTR); PTR = NULL; } }

Definition at line 206 of file api_core.h.

◆ SG_FPRINTF

#define SG_FPRINTF SG_FPrintf

Definition at line 533 of file api_core.h.

◆ SG_FREE_SAFE

#define SG_FREE_SAFE ( PTR ) { if( PTR ) { SG_Free (PTR); PTR = NULL; } }

Definition at line 205 of file api_core.h.

◆ SG_GET_A

#define SG_GET_A ( rgb ) ((BYTE) ((rgb) >> 24))

Definition at line 1259 of file api_core.h.

◆ SG_GET_B

#define SG_GET_B ( rgb ) ((BYTE) ((rgb) >> 16))

Definition at line 1258 of file api_core.h.

◆ SG_GET_BYTE_0

#define SG_GET_BYTE_0 ( vLong ) ((BYTE) ((vLong) ))

Definition at line 194 of file api_core.h.

◆ SG_GET_BYTE_1

#define SG_GET_BYTE_1 ( vLong ) ((BYTE) ((vLong) >> 8))

Definition at line 195 of file api_core.h.

◆ SG_GET_BYTE_2

#define SG_GET_BYTE_2 ( vLong ) ((BYTE) ((vLong) >> 16))

Definition at line 196 of file api_core.h.

◆ SG_GET_BYTE_3

#define SG_GET_BYTE_3 ( vLong ) ((BYTE) ((vLong) >> 24))

Definition at line 197 of file api_core.h.

◆ SG_GET_G

#define SG_GET_G ( rgb ) ((BYTE) ((rgb) >> 8))

Definition at line 1257 of file api_core.h.

◆ SG_GET_LONG

#define SG_GET_LONG | ( | b0,
 |  | b1,
 |  | b2,
 |  | b3
 | ) | ((long) (((BYTE)(b0) | ((WORD)(b1) << 8)) | (((DWORD)(BYTE)(b2)) << 16) | (((DWORD)(BYTE)(b3)) << 24)))

Definition at line 192 of file api_core.h.

◆ SG_GET_R

#define SG_GET_R ( rgb ) ((BYTE) ((rgb) ))

Definition at line 1256 of file api_core.h.

◆ SG_GET_RGB

#define SG_GET_RGB | ( | r,
 |  | g,
 |  | b
 | ) | ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16)))

Definition at line 1253 of file api_core.h.

◆ SG_GET_RGBA

#define SG_GET_RGBA | ( | r,
 |  | g,
 |  | b,
 |  | a
 | ) | ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16) | (((DWORD)(BYTE)(a)) << 24)))

Definition at line 1254 of file api_core.h.

◆ SG_is_NaN

#define SG_is_NaN ( x ) (x != x)

Definition at line 168 of file api_core.h.

◆ SG_PRINTF

#define SG_PRINTF SG_Printf

Definition at line 532 of file api_core.h.

◆ SG_SSCANF

#define SG_SSCANF swscanf

Definition at line 534 of file api_core.h.

◆ SG_STR_CMP

#define SG_STR_CMP | ( | s1,
 |  | s2
 | ) | CSG_String(s1).Cmp(s2)

Definition at line 538 of file api_core.h.

◆ SG_STR_CPY

#define SG_STR_CPY wcscpy

Definition at line 535 of file api_core.h.

◆ SG_STR_LEN

#define SG_STR_LEN wcslen

Definition at line 536 of file api_core.h.

◆ SG_STR_MBTOSG

#define SG_STR_MBTOSG ( s ) CSG_String(s).w_str()

Definition at line 539 of file api_core.h.

◆ SG_STR_TOD

#define SG_STR_TOD wcstod

Definition at line 537 of file api_core.h.

◆ SG_T

#define SG_T ( s ) L ## s

Definition at line 531 of file api_core.h.

◆ SIZEOF_LONG

#define SIZEOF_LONG 4

Definition at line 131 of file api_core.h.

Typedef Documentation

◆ sLong

typedef signed long long sLong

Definition at line 158 of file api_core.h.

◆ TSG_PFNC_UI_Callback

typedef int(* TSG_PFNC_UI_Callback) (TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)

Definition at line 1610 of file api_core.h.

◆ uLong

typedef unsigned long long uLong

Definition at line 159 of file api_core.h.

Enumeration Type Documentation

◆ ESG_Colors

enum ESG_Colors
Enumerator
SG_COLORS_DEFAULT
SG_COLORS_DEFAULT_BRIGHT
SG_COLORS_BLACK_WHITE
SG_COLORS_BLACK_RED
SG_COLORS_BLACK_GREEN
SG_COLORS_BLACK_BLUE
SG_COLORS_WHITE_RED
SG_COLORS_WHITE_GREEN
SG_COLORS_WHITE_BLUE
SG_COLORS_YELLOW_RED
SG_COLORS_YELLOW_GREEN
SG_COLORS_YELLOW_BLUE
SG_COLORS_GREEN_RED
SG_COLORS_RED_GREEN
SG_COLORS_RED_BLUE
SG_COLORS_GREEN_BLUE
SG_COLORS_RED_GREY_BLUE
SG_COLORS_RED_GREY_GREEN
SG_COLORS_GREEN_GREY_BLUE
SG_COLORS_RED_GREEN_BLUE
SG_COLORS_RED_BLUE_GREEN
SG_COLORS_GREEN_RED_BLUE
SG_COLORS_RAINBOW
SG_COLORS_NEON
SG_COLORS_TOPOGRAPHY
SG_COLORS_TOPOGRAPHY_2
SG_COLORS_TOPOGRAPHY_3
SG_COLORS_PRECIPITATION
SG_COLORS_ASPECT_1
SG_COLORS_ASPECT_2
SG_COLORS_ASPECT_3
SG_COLORS_COUNT

Definition at line 1283 of file api_core.h.

◆ ESG_File_Flags_Open

enum ESG_File_Flags_Open
Enumerator
SG_FILE_R
SG_FILE_W
SG_FILE_RW

Definition at line 1099 of file api_core.h.

◆ ESG_File_Flags_Seek

enum ESG_File_Flags_Seek
Enumerator
SG_FILE_START
SG_FILE_CURRENT
SG_FILE_END

Definition at line 1107 of file api_core.h.

◆ TSG_Array_Growth

enum TSG_Array_Growth
strong
Enumerator
SG_ARRAY_GROWTH_0
SG_ARRAY_GROWTH_1
SG_ARRAY_GROWTH_2
SG_ARRAY_GROWTH_3
SG_ARRAY_GROWTH_FIX_8
SG_ARRAY_GROWTH_FIX_16
SG_ARRAY_GROWTH_FIX_32
SG_ARRAY_GROWTH_FIX_64
SG_ARRAY_GROWTH_FIX_128
SG_ARRAY_GROWTH_FIX_256
SG_ARRAY_GROWTH_FIX_512
SG_ARRAY_GROWTH_FIX_1024

Definition at line 290 of file api_core.h.

◆ TSG_Data_Type

enum TSG_Data_Type
Enumerator
SG_DATATYPE_Bit
SG_DATATYPE_Byte
SG_DATATYPE_Char
SG_DATATYPE_Word
SG_DATATYPE_Short
SG_DATATYPE_DWord
SG_DATATYPE_Int
SG_DATATYPE_ULong
SG_DATATYPE_Long
SG_DATATYPE_Float
SG_DATATYPE_Double
SG_DATATYPE_String
SG_DATATYPE_Date
SG_DATATYPE_Color
SG_DATATYPE_Binary
SG_DATATYPE_Undefined

Definition at line 984 of file api_core.h.

◆ TSG_File_Flags_Encoding

enum TSG_File_Flags_Encoding
Enumerator
SG_FILE_ENCODING_ANSI
SG_FILE_ENCODING_UTF7
SG_FILE_ENCODING_UTF8
SG_FILE_ENCODING_UTF16LE
SG_FILE_ENCODING_UTF16BE
SG_FILE_ENCODING_UTF32LE
SG_FILE_ENCODING_UTF32BE
SG_FILE_ENCODING_UNDEFINED

Definition at line 542 of file api_core.h.

◆ TSG_File_Type

enum TSG_File_Type
Enumerator
SG_FILE_TYPE_NORMAL
SG_FILE_TYPE_ZIP

Definition at line 1091 of file api_core.h.

◆ TSG_String_Tokenizer_Mode

enum TSG_String_Tokenizer_Mode
Enumerator
SG_TOKEN_INVALID
SG_TOKEN_DEFAULT
SG_TOKEN_RET_EMPTY
SG_TOKEN_RET_EMPTY_ALL
SG_TOKEN_RET_DELIMS
SG_TOKEN_STRTOK

Definition at line 741 of file api_core.h.

◆ TSG_UI_Callback_ID

enum TSG_UI_Callback_ID
Enumerator
CALLBACK_PROCESS_GET_OKAY
CALLBACK_PROCESS_SET_OKAY
CALLBACK_PROCESS_SET_BUSY
CALLBACK_PROCESS_SET_PROGRESS
CALLBACK_PROCESS_SET_READY
CALLBACK_PROCESS_SET_TEXT
CALLBACK_STOP_EXECUTION
CALLBACK_DLG_MESSAGE
CALLBACK_DLG_CONTINUE
CALLBACK_DLG_ERROR
CALLBACK_DLG_INFO
CALLBACK_DLG_PARAMETERS
CALLBACK_MESSAGE_ADD
CALLBACK_MESSAGE_ADD_ERROR
CALLBACK_MESSAGE_ADD_EXECUTION
CALLBACK_DATAOBJECT_ADD
CALLBACK_DATAOBJECT_UPDATE
CALLBACK_DATAOBJECT_SHOW
CALLBACK_DATAOBJECT_ASIMAGE
CALLBACK_DATAOBJECT_COLORS_GET
CALLBACK_DATAOBJECT_COLORS_SET
CALLBACK_DATAOBJECT_PARAMS_GET
CALLBACK_DATAOBJECT_PARAMS_SET
CALLBACK_SET_MAP_EXTENT
CALLBACK_DIAGRAM_SHOW
CALLBACK_DATABASE_UPDATE
CALLBACK_WINDOW_ARRANGE
CALLBACK_GET_APP_WINDOW
CALLBACK_GET_APP_PATH

Definition at line 1542 of file api_core.h.

◆ TSG_UI_DataObject_Update

enum TSG_UI_DataObject_Update
Enumerator
SG_UI_DATAOBJECT_UPDATE
SG_UI_DATAOBJECT_SHOW_MAP
SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE
SG_UI_DATAOBJECT_SHOW_MAP_NEW
SG_UI_DATAOBJECT_SHOW_MAP_LAST

Definition at line 1507 of file api_core.h.

◆ TSG_UI_Maps

enum TSG_UI_Maps
Enumerator
SG_UI_MAP_ACTIVE
SG_UI_MAP_LAST
SG_UI_MAP_ALL

Definition at line 1518 of file api_core.h.

◆ TSG_UI_MSG_STYLE

enum TSG_UI_MSG_STYLE
Enumerator
SG_UI_MSG_STYLE_NORMAL
SG_UI_MSG_STYLE_BOLD
SG_UI_MSG_STYLE_ITALIC
SG_UI_MSG_STYLE_SUCCESS
SG_UI_MSG_STYLE_FAILURE
SG_UI_MSG_STYLE_BIG
SG_UI_MSG_STYLE_SMALL
SG_UI_MSG_STYLE_01
SG_UI_MSG_STYLE_02
SG_UI_MSG_STYLE_03

Definition at line 1491 of file api_core.h.

◆ TSG_UI_Window_Arrange

enum TSG_UI_Window_Arrange
Enumerator
SG_UI_WINDOW_ARRANGE_MDI_CASCADE
SG_UI_WINDOW_ARRANGE_MDI_TILE_VER
SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR
SG_UI_WINDOW_ARRANGE_TDI_TILE_VER
SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM

Definition at line 1527 of file api_core.h.

Function Documentation

◆ operator+() [1/4]

SAGA_API_DLL_EXPORT CSG_String operator+ | ( | char | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 491 of file api_string.cpp.

References A, and B.

◆ operator+() [2/4]

SAGA_API_DLL_EXPORT CSG_String operator+ | ( | const char * | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 473 of file api_string.cpp.

References A, and B.

◆ operator+() [3/4]

SAGA_API_DLL_EXPORT CSG_String operator+ | ( | const wchar_t * | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 482 of file api_string.cpp.

References A, and B.

◆ operator+() [4/4]

SAGA_API_DLL_EXPORT CSG_String operator+ | ( | wchar_t | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 500 of file api_string.cpp.

References A, and B.

◆ SG_Calloc()

SAGA_API_DLL_EXPORT void* SG_Calloc | ( | size_t | num,
 |  | size_t | size
 | ) |  |

Definition at line 71 of file api_memory.cpp.

Referenced by CSG_Grid_Radius::Create(), CSG_Formula::CSG_Formula(), and CSG_Table_DBase::Open_Write().

◆ SG_Color_From_Text()

SAGA_API_DLL_EXPORT bool SG_Color_From_Text | ( | const CSG_String & | Text,
 |  | long & | Color
 | ) |  |

Definition at line 79 of file api_colors.cpp.

References CSG_String::b_str(), CSG_String::Get_Char(), CSG_String::is_Empty(), CSG_String::Length(), SG_GET_RGB, and SG_GET_RGBA.

Referenced by CSG_Parameter_Color::_Set_Value().

◆ SG_Color_Get_Random()

SAGA_API_DLL_EXPORT long SG_Color_Get_Random ( void )

Definition at line 73 of file api_colors.cpp.

References CSG_Random::Get_Uniform(), and SG_GET_RGB.

◆ SG_Color_To_Text()

SAGA_API_DLL_EXPORT CSG_String SG_Color_To_Text | ( | long | Color,
 |  | bool | bHexadecimal = true
 | ) |  |

Definition at line 138 of file api_colors.cpp.

References CSG_String::Printf(), SG_GET_B, SG_GET_G, and SG_GET_R.

◆ SG_Colors_Get_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Colors_Get_Name ( int Index )

Definition at line 67 of file api_colors.cpp.

References CSG_Colors::Get_Predefined_Name().

◆ SG_Data_Type_Get_Flag()

SAGA_API_DLL_EXPORT int SG_Data_Type_Get_Flag ( TSG_Data_Type Type )

Definition at line 173 of file api_core.cpp.

References SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Word, SG_DATATYPES_Binary, SG_DATATYPES_Bit, SG_DATATYPES_Byte, SG_DATATYPES_Char, SG_DATATYPES_Color, SG_DATATYPES_Date, SG_DATATYPES_Double, SG_DATATYPES_DWord, SG_DATATYPES_Float, SG_DATATYPES_Int, SG_DATATYPES_Long, SG_DATATYPES_Short, SG_DATATYPES_String, SG_DATATYPES_ULong, SG_DATATYPES_Undefined, and SG_DATATYPES_Word.

◆ SG_Data_Type_Get_Identifier()

SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Identifier ( TSG_Data_Type Type )

Definition at line 146 of file api_core.cpp.

References gSG_Data_Type_Identifier.

Referenced by CSG_Parameter_Data_Type::Set_Data_Types().

◆ SG_Data_Type_Get_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Name | ( | TSG_Data_Type | Type,
 |  | bool | bShort = false
 | ) |  |

Definition at line 122 of file api_core.cpp.

References _TL, SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by CSG_Parameter::Get_Description(), CSG_Data_Manager::Get_Summary(), and SG_XML_Add_Parameter().

◆ SG_Data_Type_Get_Size()

size_t SG_Data_Type_Get_Size ( TSG_Data_Type Type )
inline

Definition at line 1052 of file api_core.h.

References SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

◆ SG_Data_Type_Get_Type()

SAGA_API_DLL_EXPORT TSG_Data_Type SG_Data_Type_Get_Type ( const CSG_String & Identifier )

Definition at line 152 of file api_core.cpp.

References CSG_String::Cmp(), gSG_Data_Type_Identifier, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Undefined, and SG_DATATYPE_Word.

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Parameter_Data_Type::Get_Data_Type(), and CSG_Parameter_Data_Type::Set_Data_Type().

◆ SG_Data_Type_is_Numeric()

SAGA_API_DLL_EXPORT bool SG_Data_Type_is_Numeric ( TSG_Data_Type Type )

Definition at line 197 of file api_core.cpp.

References SG_DATATYPE_Binary, SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, and SG_DATATYPE_Word.

Referenced by CSG_PointCloud::Add_Shape().

◆ SG_Data_Type_Range_Check()

SAGA_API_DLL_EXPORT bool SG_Data_Type_Range_Check | ( | TSG_Data_Type | Type,
 |  | double & | Value
 | ) |  |

Definition at line 223 of file api_core.cpp.

References SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Short, and SG_DATATYPE_Word.

◆ SG_Degree_To_Double()

SAGA_API_DLL_EXPORT double SG_Degree_To_Double ( const CSG_String & String )

Definition at line 1240 of file api_string.cpp.

References CSG_String::AfterFirst(), CSG_String::asDouble(), and CSG_String::BeforeFirst().

Referenced by CSG_Parameter_Degree::_Set_Value().

◆ SG_Dir_Create()

SAGA_API_DLL_EXPORT bool SG_Dir_Create | ( | const CSG_String & | Directory,
 |  | bool | bFullPath = false
 | ) |  |

Definition at line 733 of file api_file.cpp.

References CSG_String::c_str(), and SG_Dir_Exists().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), and CSG_Tool_Library_Manager::Get_Summary().

◆ SG_Dir_Delete()

SAGA_API_DLL_EXPORT bool SG_Dir_Delete | ( | const CSG_String & | Directory,
 |  | bool | bRecursive = false
 | ) |  |

Definition at line 744 of file api_file.cpp.

References CSG_String::c_str(), and SG_Dir_Exists().

◆ SG_Dir_Exists()

SAGA_API_DLL_EXPORT bool SG_Dir_Exists ( const CSG_String & Directory )

Definition at line 727 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), SG_Dir_Create(), SG_Dir_Delete(), SG_File_Get_Name_Temp(), SG_Grid_Cache_Set_Directory(), and SG_Initialize_Environment().

◆ SG_Dir_Get_Current()

SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Current ( void )

Definition at line 755 of file api_file.cpp.

◆ SG_Dir_Get_Temp()

SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Temp ( void )

Definition at line 763 of file api_file.cpp.

◆ SG_Dir_List_Files() [1/2]

SAGA_API_DLL_EXPORT bool SG_Dir_List_Files | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 795 of file api_file.cpp.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ SG_Dir_List_Files() [2/2]

SAGA_API_DLL_EXPORT bool SG_Dir_List_Files | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 800 of file api_file.cpp.

References CSG_String::c_str(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), CSG_String::is_Empty(), SG_File_Cmp_Extension(), and SG_File_Make_Path().

◆ SG_Dir_List_Subdirectories()

SAGA_API_DLL_EXPORT bool SG_Dir_List_Subdirectories | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 771 of file api_file.cpp.

References CSG_String::c_str(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), and SG_File_Make_Path().

◆ SG_Double_To_Degree()

SAGA_API_DLL_EXPORT CSG_String SG_Double_To_Degree ( double Value )

Definition at line 1210 of file api_string.cpp.

References CSG_String::Printf(), SG_Char, SG_Get_Significant_Decimals(), and SG_T.

Referenced by CSG_Parameter_Degree::_Set_String().

◆ SG_File_Cmp_Extension()

SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension | ( | const CSG_String & | FileName,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 928 of file api_file.cpp.

References SG_File_Get_Extension().

Referenced by CSG_Data_Manager::Add(), CSG_Tool_Library_Manager::Add_Library(), CSG_Grid_File_Info::Create(), CSG_Shapes::Create(), CSG_PointCloud::Get_Header_Content(), CSG_MetaData::Load(), CSG_Table::Load(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), and SG_Dir_List_Files().

◆ SG_File_Delete()

SAGA_API_DLL_EXPORT bool SG_File_Delete ( const CSG_String & FileName )

Definition at line 840 of file api_file.cpp.

References CSG_String::c_str(), and SG_File_Exists().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Data_Object::Delete(), CSG_Grid::On_Delete(), CSG_Grids::On_Delete(), CSG_PointCloud::On_Delete(), CSG_Shapes::On_Delete(), and CSG_Table::On_Delete().

◆ SG_File_Exists()

SAGA_API_DLL_EXPORT bool SG_File_Exists ( const CSG_String & FileName )

Definition at line 834 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Parameter_List::_Serialize(), CSG_Table::Create(), CSG_Translator::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Data_Collection::Delete(), CSG_Data_Object::Delete(), CSG_Data_Collection::Delete_Unsaved(), CSG_MetaData::Load(), CSG_Table::Load(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), CSG_File::Open(), CSG_File_Zip::Open(), CSG_Data_Object::Reload(), and SG_File_Delete().

◆ SG_File_Get_Extension()

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension ( const CSG_String & FileName )

Definition at line 953 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Data_Object::Load_MetaData(), and SG_File_Cmp_Extension().

◆ SG_File_Get_Name()

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name | ( | const CSG_String & | full_Path,
 |  | bool | bExtension
 | ) |  |

Definition at line 862 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Grid_File_Info::Create(), CSG_Tool_Library_Interface::Create(), CSG_PointCloud::Get_Header_Content(), CSG_Grids::Load(), CSG_Table::Load(), CSG_PointCloud::Save(), CSG_Data_Object::Set_File_Name(), and SG_File_Make_Path().

◆ SG_File_Get_Name_Temp() [1/2]

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp ( const CSG_String & Prefix )

Definition at line 846 of file api_file.cpp.

◆ SG_File_Get_Name_Temp() [2/2]

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp | ( | const CSG_String & | Prefix,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 851 of file api_file.cpp.

References CSG_String::c_str(), SG_Dir_Exists(), and SG_File_Make_Path().

◆ SG_File_Get_Path()

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path ( const CSG_String & full_Path )

Definition at line 875 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Grid_File_Info::Create(), CSG_Tool_Library_Manager::Get_Summary(), SG_File_Make_Path(), and SG_UI_Get_Application_Path().

◆ SG_File_Get_Path_Absolute()

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute ( const CSG_String & full_Path )

Definition at line 883 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Tool_Library_Interface::Create(), CSG_Tool_Library::CSG_Tool_Library(), and SG_UI_Get_Application_Path().

◆ SG_File_Get_Path_Relative()

SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Relative | ( | const CSG_String & | Directory,
 |  | const CSG_String & | full_Path
 | ) |  |

Definition at line 893 of file api_file.cpp.

References CSG_String::c_str().

◆ SG_File_Make_Path() [1/2]

SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path | ( | const CSG_String & | Directory,
 |  | const CSG_String & | Name
 | ) |  |

Definition at line 903 of file api_file.cpp.

Referenced by CSG_Tool_Library_Manager::Add_Directory(), CSG_Projections::Create(), CSG_Translator::Create(), CSG_Grid_File_Info::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library::Get_Summary(), CSG_Tool_Library_Manager::Get_Summary(), CSG_MetaData::Load(), CSG_MetaData::Save(), CSG_PointCloud::Save(), CSG_Grid::Set_Cache(), SG_Dir_List_Files(), SG_Dir_List_Subdirectories(), SG_File_Get_Name_Temp(), SG_FTP_Download(), and SG_Initialize_Environment().

◆ SG_File_Make_Path() [2/2]

SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path | ( | const CSG_String & | Directory,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 908 of file api_file.cpp.

References CSG_String::c_str(), CSG_String::is_Empty(), SG_File_Get_Name(), and SG_File_Get_Path().

◆ SG_File_Set_Extension()

SAGA_API_DLL_EXPORT bool SG_File_Set_Extension | ( | CSG_String & | FileName,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 934 of file api_file.cpp.

References CSG_String::c_str(), and CSG_String::Length().

Referenced by CSG_Data_Object::Delete(), CSG_Data_Object::Load_MetaData(), CSG_Grid::On_Delete(), CSG_Grids::On_Delete(), CSG_Shapes::On_Delete(), CSG_PointCloud::Save(), and CSG_Data_Object::Save_MetaData().

◆ SG_Flip_Decimal_Separators()

SAGA_API_DLL_EXPORT void SG_Flip_Decimal_Separators ( CSG_String & String )

Definition at line 1304 of file api_string.cpp.

References CSG_String::Length(), CSG_String::Set_Char(), and SG_T.

◆ SG_Free()

SAGA_API_DLL_EXPORT void SG_Free ( void * memblock )

Definition at line 83 of file api_memory.cpp.

Referenced by CSG_TIN::_Destroy_Edges(), CSG_TIN::_Destroy_Triangles(), CSG_TIN::_Triangulate(), CSG_PriorityQueue::Add(), CSG_Rects::Clear(), CSG_Rects_Int::Clear(), CSG_Parameters::Del_Parameters(), CSG_PointCloud::Del_Points(), CSG_PointCloud::Del_Selection(), CSG_Buffer::Destroy(), CSG_Bytes::Destroy(), CSG_Bytes_Array::Destroy(), CSG_Colors::Destroy(), CSG_Translator::Destroy(), CSG_Grid_Pyramid::Destroy(), CSG_Index::Destroy(), CSG_PriorityQueue::Destroy(), CSG_Matrix::Destroy(), CSG_Grid_Radius::Destroy(), CSG_PointCloud::Destroy(), CSG_Shape_Part::Destroy(), CSG_Table::Destroy(), CSG_Tool_Library_Manager::Destroy(), CSG_Colors::Load(), CSG_Formula::~CSG_Formula(), CSG_Parameter::~CSG_Parameter(), CSG_Table_Record::~CSG_Table_Record(), and CSG_Tool::~CSG_Tool().

◆ SG_Get_CurrentTimeStr()

SAGA_API_DLL_EXPORT CSG_String SG_Get_CurrentTimeStr ( bool bWithDate = true )

Definition at line 1184 of file api_string.cpp.

References CSG_String::Append(), and SG_T.

◆ SG_Get_Environment()

SAGA_API_DLL_EXPORT bool SG_Get_Environment | ( | const CSG_String & | Variable,
 |  | CSG_String * | Value = NULL
 | ) |  |

Definition at line 968 of file api_file.cpp.

References CSG_String::w_str().

◆ SG_Get_Significant_Decimals()

SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals | ( | double | Value,
 |  | int | maxDecimals = 6
 | ) |  |

Definition at line 1274 of file api_string.cpp.

Referenced by CSG_Parameter_Double::_Serialize(), CSG_Parameter_Range::_Serialize(), CSG_Parameter_Double::_Set_String(), CSG_Parameter_Range::_Set_String(), CSG_Grid_System::Get_Name(), SG_Double_To_Degree(), and SG_Get_String().

◆ SG_Get_String() [1/2]

SAGA_API_DLL_EXPORT CSG_String SG_Get_String | ( | double | Value,
 |  | int | Precision
 | ) |  |

Returns floating point number 'Value' as formatted string. The format depends on the 'Precision' value. If Precision is -99 (the default) it will simply use f format. If 'Precision' is -98 the string will always be formatted with the e format specification (i.e. scientific: d.dddd e dd). If Precision is zero (= 0) no decimals will be printed If Precision is positive (> 0) it specifies the fix number of decimals ("%.*f", Precision, Value), if negative only significant decimals will be plotted up to a maximum of the absolute value of 'Precision' digits.

Definition at line 1337 of file api_string.cpp.

References CSG_String::Left(), CSG_String::Length(), CSG_String::Printf(), CSG_String::Replace(), and SG_Get_Significant_Decimals().

Referenced by CSG_MetaData::Add_Child(), CSG_Table_Value_Double::asString(), CSG_Grids::Get_Grid_Name(), CSG_MetaData::Ins_Child(), CSG_Classifier_Supervised::Print(), and SG_Get_String().

◆ SG_Get_String() [2/2]

SAGA_API_DLL_EXPORT CSG_String SG_Get_String | ( | int | Value,
 |  | int | Precision = 0
 | ) |  |

Definition at line 1387 of file api_string.cpp.

References CSG_String::Format(), and SG_Get_String().

◆ SG_Get_Translator()

SAGA_API_DLL_EXPORT CSG_Translator& SG_Get_Translator ( void )

Definition at line 80 of file api_translator.cpp.

References gSG_Translator.

◆ SG_Get_UI_Callback()

SAGA_API_DLL_EXPORT TSG_PFNC_UI_Callback SG_Get_UI_Callback ( void )

Definition at line 145 of file api_callback.cpp.

References gSG_UI_Callback.

◆ SG_Initialize_Environment()

SAGA_API_DLL_EXPORT bool SG_Initialize_Environment | ( | bool | bLibraries = true,
 |  | bool | bProjections = true,
 |  | const SG_Char * | Directory = NULL,
 |  | bool | bInitializeWX = true
 | ) |  |

Definition at line 392 of file api_core.cpp.

References CSG_Tool_Library_Manager::Add_Directory(), CSG_String::c_str(), g_App_Initialize, CSG_Strings::Get_Count(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), SG_Add_Dll_Paths(), SG_Dir_Exists(), SG_File_Make_Path(), SG_Get_Projections(), SG_Get_Tool_Library_Manager(), SG_String_Tokenize(), SG_UI_Get_Application_Path(), and SG_UI_ProgressAndMsg_Lock().

◆ SG_is_Character_Numeric()

SAGA_API_DLL_EXPORT bool SG_is_Character_Numeric ( int Character )

Definition at line 1150 of file api_string.cpp.

◆ SG_Malloc()

SAGA_API_DLL_EXPORT void* SG_Malloc ( size_t size )

Definition at line 65 of file api_memory.cpp.

Referenced by CSG_TIN::_Triangulate(), CSG_Translator::Create(), CSG_PriorityQueue::Create(), CSG_Matrix::Create(), CSG_Table_Record::CSG_Table_Record(), CSG_Colors::Load(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), and CSG_String::to_UTF8().

◆ SG_Mem_Get_Double()

SAGA_API_DLL_EXPORT double SG_Mem_Get_Double | ( | const char * | Buffer,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 200 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Get_Int()

SAGA_API_DLL_EXPORT int SG_Mem_Get_Int | ( | const char * | Buffer,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 177 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Set_Double()

SAGA_API_DLL_EXPORT void SG_Mem_Set_Double | ( | char * | Buffer,
 |  | double | Value,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 212 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Set_Int()

SAGA_API_DLL_EXPORT void SG_Mem_Set_Int | ( | char * | Buffer,
 |  | int | Value,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 189 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_OMP_Get_Max_Num_Procs()

SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Procs ( void )

Definition at line 110 of file api_core.cpp.

Referenced by CSG_PointCloud::_On_Construction().

◆ SG_OMP_Get_Max_Num_Threads()

SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Threads ( void )

Definition at line 109 of file api_core.cpp.

◆ SG_OMP_Get_Thread_Num()

SAGA_API_DLL_EXPORT int SG_OMP_Get_Thread_Num ( void )

Definition at line 111 of file api_core.cpp.

◆ SG_OMP_Set_Max_Num_Threads()

SAGA_API_DLL_EXPORT void SG_OMP_Set_Max_Num_Threads ( int iCores )

Definition at line 108 of file api_core.cpp.

◆ SG_Realloc()

SAGA_API_DLL_EXPORT void* SG_Realloc | ( | void * | memblock,
 |  | size_t | size
 | ) |  |

Definition at line 77 of file api_memory.cpp.

Referenced by CSG_TIN::_Add_Edge(), CSG_Table_Record::_Add_Field(), CSG_Shape_Points::_Add_Part(), CSG_TIN::_Add_Triangle(), CSG_Shape_Part::_Alloc_Memory(), CSG_Table_Record::_Del_Field(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_TIN::_Triangulate(), CSG_Rects::Add(), CSG_Rects_Int::Add(), CSG_Bytes_Array::Add(), CSG_Classifier_Supervised::Add_Class(), CSG_Table::Add_Field(), CSG_Tool_Library_Manager::Add_Library(), CSG_Tool::Add_Parameters(), CSG_Matrix::Add_Rows(), CSG_Translator::Create(), CSG_Colors::Create(), CSG_PointCloud::Del_Field(), CSG_Table::Del_Field(), CSG_Tool_Library_Manager::Del_Library(), CSG_Parameters::Del_Parameter(), CSG_Shape_Points::Del_Part(), CSG_Matrix::Del_Rows(), CSG_Classifier_Supervised::Load(), CSG_Array::Set_Array(), CSG_Colors::Set_Count(), CSG_Colors::Set_Default(), CSG_Buffer::Set_Size(), and CSG_Classifier_Supervised::Train_Add_Sample().

◆ SG_Set_Environment()

SAGA_API_DLL_EXPORT bool SG_Set_Environment | ( | const CSG_String & | Variable,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 988 of file api_file.cpp.

References CSG_String::w_str().

◆ SG_Set_UI_Callback()

SAGA_API_DLL_EXPORT bool SG_Set_UI_Callback ( TSG_PFNC_UI_Callback Function )

Definition at line 137 of file api_callback.cpp.

References gSG_UI_Callback.

◆ SG_String_Tokenize()

SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize | ( | const CSG_String & | String,
 |  | const CSG_String & | Delimiters = SG_DEFAULT_DELIMITERS,
 |  | TSG_String_Tokenizer_Mode | Mode = SG_TOKEN_DEFAULT
 | ) |  |

Definition at line 1493 of file api_string.cpp.

References CSG_String_Tokenizer::Get_Next_Token(), and CSG_String_Tokenizer::Has_More_Tokens().

Referenced by CSG_Projection::is_Equal(), CSG_Parameter_Choice::Set_Items(), and SG_Initialize_Environment().

◆ SG_Swap_Bytes()

SAGA_API_DLL_EXPORT void SG_Swap_Bytes | ( | void * | Buffer,
 |  | int | nBytes
 | ) |  |

Definition at line 154 of file api_memory.cpp.

Referenced by CSG_Bytes::Add(), CSG_Bytes::asDouble(), CSG_Buffer::asDouble(), CSG_Bytes::asDWord(), CSG_Bytes::asFloat(), CSG_Buffer::asFloat(), CSG_Bytes::asInt(), CSG_Buffer::asInt(), CSG_Bytes::asShort(), CSG_Buffer::asShort(), CSG_Bytes::asWord(), CSG_File::Read_Double(), CSG_File::Read_Int(), CSG_Buffer::Set_Value(), SG_Mem_Get_Double(), SG_Mem_Get_Int(), SG_Mem_Set_Double(), SG_Mem_Set_Int(), CSG_File::Write_Double(), and CSG_File::Write_Int().

◆ SG_Translate()

SAGA_API_DLL_EXPORT const SG_Char* SG_Translate ( const CSG_String & Text )

Definition at line 93 of file api_translator.cpp.

References CSG_Translator::Get_Translation(), and gSG_Translator.

Referenced by CSG_Tool_Chain::Create().

◆ SG_UI_Console_Get_UTF8()

SAGA_API_DLL_EXPORT bool SG_UI_Console_Get_UTF8 ( void )

Definition at line 74 of file api_callback.cpp.

References gSG_UI_Console_bUTF8.

◆ SG_UI_Console_Print_StdErr() [1/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr | ( | const char * | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 102 of file api_callback.cpp.

References SG_UI_Console_Print_StdErr().

Referenced by SG_UI_Console_Print_StdErr(), and SG_UI_Msg_Add_Error().

◆ SG_UI_Console_Print_StdErr() [2/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr | ( | const CSG_String & | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 104 of file api_callback.cpp.

References gSG_UI_Console_bUTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().

◆ SG_UI_Console_Print_StdErr() [3/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr | ( | const wchar_t * | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 103 of file api_callback.cpp.

References SG_UI_Console_Print_StdErr().

◆ SG_UI_Console_Print_StdOut() [1/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut | ( | const char * | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 77 of file api_callback.cpp.

References SG_UI_Console_Print_StdOut().

Referenced by SG_UI_Console_Print_StdOut(), SG_UI_Dlg_Info(), SG_UI_Dlg_Message(), SG_UI_Msg_Add(), SG_UI_Msg_Add_Execution(), SG_UI_Process_Get_Okay(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Text().

◆ SG_UI_Console_Print_StdOut() [2/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut | ( | const CSG_String & | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 79 of file api_callback.cpp.

References gSG_UI_Console_bUTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().

◆ SG_UI_Console_Print_StdOut() [3/3]

SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut | ( | const wchar_t * | Text,
 |  | SG_Char | End = '\n',
 |  | bool | bFlush = true
 | ) |  |

Definition at line 78 of file api_callback.cpp.

References SG_UI_Console_Print_StdOut().

◆ SG_UI_Console_Set_UTF8()

SAGA_API_DLL_EXPORT void SG_UI_Console_Set_UTF8 ( bool bOn )

Definition at line 73 of file api_callback.cpp.

References gSG_UI_Console_bUTF8.

◆ SG_UI_DataObject_Add()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Add | ( | class CSG_Data_Object * | pDataObject,
 |  | int | Show
 | ) |  |

Definition at line 598 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_ADD, and gSG_UI_Callback.

Referenced by CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Data_Collection::Add(), and CSG_Tool::DataObject_Add().

◆ SG_UI_DataObject_asImage()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_asImage | ( | class CSG_Data_Object * | pDataObject,
 |  | class CSG_Grid * | pGrid
 | ) |  |

Definition at line 645 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_ASIMAGE, and gSG_UI_Callback.

◆ SG_UI_DataObject_Colors_Get()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Get | ( | class CSG_Data_Object * | pDataObject,
 |  | class CSG_Colors * | pColors
 | ) |  |

Definition at line 658 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_COLORS_GET, and gSG_UI_Callback.

Referenced by CSG_Tool::DataObject_Get_Colors().

◆ SG_UI_DataObject_Colors_Set()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Set | ( | class CSG_Data_Object * | pDataObject,
 |  | class CSG_Colors * | pColors
 | ) |  |

Definition at line 671 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_COLORS_SET, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::DataObject_Set_Colors().

◆ SG_UI_DataObject_Params_Get()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Get | ( | class CSG_Data_Object * | pDataObject,
 |  | class CSG_Parameters * | pParameters
 | ) |  |

Definition at line 684 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_PARAMS_GET, and gSG_UI_Callback.

Referenced by CSG_Tool::DataObject_Get_Parameters().

◆ SG_UI_DataObject_Params_Set()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Set | ( | class CSG_Data_Object * | pDataObject,
 |  | class CSG_Parameters * | pParameters
 | ) |  |

Definition at line 697 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_PARAMS_SET, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::DataObject_Set_Parameters().

◆ SG_UI_DataObject_Show()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Show | ( | class CSG_Data_Object * | pDataObject,
 |  | int | Show
 | ) |  |

Definition at line 632 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_SHOW, and gSG_UI_Callback.

Referenced by SG_UI_DataObject_Update().

◆ SG_UI_DataObject_Update()

SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Update | ( | class CSG_Data_Object * | pDataObject,
 |  | int | Show,
 |  | class CSG_Parameters * | pParameters
 | ) |  |

Definition at line 611 of file api_callback.cpp.

References CALLBACK_DATAOBJECT_UPDATE, CSG_Data_Object::Get_Owner(), gSG_UI_Callback, SG_UI_DataObject_Show(), and SG_UI_DATAOBJECT_UPDATE.

Referenced by CSG_Tool::DataObject_Update(), and SG_UI_Diagram_Show().

◆ SG_UI_Diagram_Show()

SAGA_API_DLL_EXPORT bool SG_UI_Diagram_Show | ( | class CSG_Table * | pTable,
 |  | class CSG_Parameters * | pParameters
 | ) |  |

Definition at line 723 of file api_callback.cpp.

References CALLBACK_DIAGRAM_SHOW, gSG_UI_Callback, SG_UI_DataObject_Update(), and SG_UI_DATAOBJECT_UPDATE.

◆ SG_UI_Dlg_Continue()

SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Continue | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 380 of file api_callback.cpp.

References CALLBACK_DLG_CONTINUE, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::Message_Dlg_Confirm().

◆ SG_UI_Dlg_Error()

SAGA_API_DLL_EXPORT int SG_UI_Dlg_Error | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 396 of file api_callback.cpp.

References CALLBACK_DLG_ERROR, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Msg_Add_Error().

Referenced by CSG_Tool::Error_Set().

◆ SG_UI_Dlg_Info()

SAGA_API_DLL_EXPORT void SG_UI_Dlg_Info | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 417 of file api_callback.cpp.

References CSG_String::c_str(), CALLBACK_DLG_INFO, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Dlg_Message()

SAGA_API_DLL_EXPORT void SG_UI_Dlg_Message | ( | const CSG_String & | Message,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 362 of file api_callback.cpp.

References CSG_String::c_str(), CALLBACK_DLG_MESSAGE, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Parameters::DataObjects_Check(), and CSG_Tool::Message_Dlg().

◆ SG_UI_Dlg_Parameters()

SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Parameters | ( | class CSG_Parameters * | pParameters,
 |  | const CSG_String & | Caption
 | ) |  |

Definition at line 442 of file api_callback.cpp.

References CALLBACK_DLG_PARAMETERS, and gSG_UI_Callback.

Referenced by CSG_Tool::Dlg_Parameters().

◆ SG_UI_Get_Application_Path()

SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_Application_Path ( bool bPathOnly = false )

Definition at line 786 of file api_callback.cpp.

References SG_File_Get_Path(), and SG_File_Get_Path_Absolute().

Referenced by CSG_Projections::Create(), and SG_Initialize_Environment().

◆ SG_UI_Get_Window_Main()

SAGA_API_DLL_EXPORT void* SG_UI_Get_Window_Main ( void )

Definition at line 771 of file api_callback.cpp.

References CALLBACK_GET_APP_WINDOW, gSG_UI_Callback, and CSG_UI_Parameter::Pointer.

Referenced by CSG_Tool_Library_Manager::Destroy(), CSG_Parameters::has_GUI(), and CSG_Tool::has_GUI().

◆ SG_UI_Msg_Add() [1/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add | ( | const char * | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 490 of file api_callback.cpp.

References SG_UI_Msg_Add().

Referenced by CSG_Tool_Library_Manager::Add_Library(), CSG_Shapes::Create(), CSG_Tool_Chain::Create(), CSG_Grid::Create(), CSG_Table::Create(), CSG_TIN::Create(), CSG_Tool::Execute(), CSG_Grids::Load(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), and SG_UI_Msg_Add().

◆ SG_UI_Msg_Add() [2/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add | ( | const CSG_String & | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 492 of file api_callback.cpp.

References CALLBACK_MESSAGE_ADD, gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Msg_Add() [3/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add | ( | const wchar_t * | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 491 of file api_callback.cpp.

References SG_UI_Msg_Add().

◆ SG_UI_Msg_Add_Error() [1/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error ( const char * Message )

Definition at line 544 of file api_callback.cpp.

References SG_UI_Msg_Add_Error().

Referenced by CSG_Tool_Library_Interface::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool::Error_Set(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), SG_FTP_Download(), SG_UI_Dlg_Error(), SG_UI_Msg_Add_Error(), CSG_Projections::WKT_from_Proj4(), and CSG_Projections::WKT_to_Proj4().

◆ SG_UI_Msg_Add_Error() [2/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error ( const CSG_String & Message )

Definition at line 546 of file api_callback.cpp.

References _TL, CSG_String::c_str(), CALLBACK_MESSAGE_ADD_ERROR, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdErr().

◆ SG_UI_Msg_Add_Error() [3/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error ( const wchar_t * Message )

Definition at line 545 of file api_callback.cpp.

References SG_UI_Msg_Add_Error().

◆ SG_UI_Msg_Add_Execution() [1/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution | ( | const char * | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 517 of file api_callback.cpp.

References SG_UI_Msg_Add_Execution().

Referenced by CSG_Tool::Execute(), CSG_Tool::Message_Add(), CSG_Parameters::Msg_String(), and SG_UI_Msg_Add_Execution().

◆ SG_UI_Msg_Add_Execution() [2/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution | ( | const CSG_String & | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 519 of file api_callback.cpp.

References CALLBACK_MESSAGE_ADD_EXECUTION, gSG_UI_Callback, gSG_UI_Msg_Lock, and SG_UI_Console_Print_StdOut().

◆ SG_UI_Msg_Add_Execution() [3/3]

SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution | ( | const wchar_t * | Message,
 |  | bool | bNewLine = true,
 |  | TSG_UI_MSG_STYLE | Style = SG_UI_MSG_STYLE_NORMAL
 | ) |  |

Definition at line 518 of file api_callback.cpp.

References SG_UI_Msg_Add_Execution().

◆ SG_UI_Msg_Flush()

SAGA_API_DLL_EXPORT void SG_UI_Msg_Flush ( void )

Definition at line 564 of file api_callback.cpp.

◆ SG_UI_Msg_Lock()

SAGA_API_DLL_EXPORT int SG_UI_Msg_Lock ( bool bOn )

Definition at line 465 of file api_callback.cpp.

References gSG_UI_Msg_Lock.

Referenced by CSG_Projections::Create(), CSG_Translator::Create(), CSG_Grid::Save(), and SG_UI_ProgressAndMsg_Lock().

◆ SG_UI_Msg_Reset()

SAGA_API_DLL_EXPORT int SG_UI_Msg_Reset ( void )

Definition at line 480 of file api_callback.cpp.

References gSG_UI_Msg_Lock.

Referenced by SG_UI_ProgressAndMsg_Reset().

◆ SG_UI_ODBC_Update()

SAGA_API_DLL_EXPORT bool SG_UI_ODBC_Update ( const CSG_String & Server )

Definition at line 736 of file api_callback.cpp.

References CALLBACK_DATABASE_UPDATE, and gSG_UI_Callback.

◆ SG_UI_Process_Get_Okay()

SAGA_API_DLL_EXPORT bool SG_UI_Process_Get_Okay ( bool bBlink = false )

Definition at line 201 of file api_callback.cpp.

References CALLBACK_PROCESS_GET_OKAY, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, SG_Char, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Shapes::Assign(), CSG_Tool::Error_Set(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Regression_Multiple::Get_Model_Stepwise(), CSG_Trend::Get_Trend(), CSG_Tool::is_Progress(), CSG_Tool::Process_Get_Okay(), SG_Matrix_LU_Decomposition(), and SG_UI_Process_Set_Progress().

◆ SG_UI_Process_Set_Busy()

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Busy | ( | bool | bOn = true,
 |  | const CSG_String & | Message = ""
 | ) |  |

Definition at line 236 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_BUSY, and gSG_UI_Callback.

◆ SG_UI_Process_Set_Okay()

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Okay ( bool bOkay = true )

Definition at line 223 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_OKAY, gSG_UI_Callback, and gSG_UI_Progress_Lock.

Referenced by CSG_Tool::Error_Set(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), and CSG_Tool_Interactive_Base::Execute_Position().

◆ SG_UI_Process_Set_Progress() [1/3]

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress | ( | double | Position,
 |  | double | Range
 | ) |  |

Definition at line 261 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_PROGRESS, CSG_String::Format(), gSG_UI_Callback, gSG_UI_Progress_Lock, SG_UI_Console_Print_StdOut(), and SG_UI_Process_Get_Okay().

◆ SG_UI_Process_Set_Progress() [2/3]

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress | ( | int | Position,
 |  | int | Range
 | ) |  |

Definition at line 249 of file api_callback.cpp.

References SG_UI_Process_Set_Progress().

Referenced by CSG_TIN::_Triangulate(), CSG_Grid::Assign(), CSG_TIN::Create(), CSG_PRQuadTree::Create(), CSG_Thin_Plate_Spline::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Grid_OGIS_Converter::from_WKBinary(), CSG_Projections::Load_DB(), CSG_Shapes::Make_Clean(), CSG_Grid::On_Update(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), CSG_Matrix::Set_Inverse(), CSG_Tool::Set_Progress(), SG_Matrix_LU_Decomposition(), SG_Matrix_LU_Solve(), SG_UI_Process_Set_Progress(), SG_UI_Process_Set_Ready(), and CSG_Grid_OGIS_Converter::to_WKBinary().

◆ SG_UI_Process_Set_Progress() [3/3]

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress | ( | sLong | Position,
 |  | sLong | Range
 | ) |  |

Definition at line 255 of file api_callback.cpp.

References SG_UI_Process_Set_Progress().

◆ SG_UI_Process_Set_Ready()

SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Ready ( void )

Definition at line 299 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_READY, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Process_Set_Progress().

Referenced by CSG_TIN::_Triangulate(), CSG_Grid::Assign(), CSG_Shapes::Create(), CSG_Grid::Create(), CSG_TIN::Create(), CSG_Tool::Execute(), CSG_Tool_Interactive_Base::Execute_Finish(), CSG_Tool_Interactive_Base::Execute_Keyboard(), CSG_Tool_Interactive_Base::Execute_Position(), CSG_Grids::Load(), CSG_Grid::On_Update(), CSG_Table_DBase::Open_Read(), CSG_Table_DBase::Open_Write(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), and CSG_Shapes::Save().

◆ SG_UI_Process_Set_Text()

SAGA_API_DLL_EXPORT void SG_UI_Process_Set_Text ( const CSG_String & Text )

Definition at line 317 of file api_callback.cpp.

References CALLBACK_PROCESS_SET_TEXT, gSG_UI_Callback, gSG_UI_Progress_Lock, and SG_UI_Console_Print_StdOut().

Referenced by CSG_Thin_Plate_Spline::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), and CSG_Tool::Process_Set_Text().

◆ SG_UI_Progress_Lock()

SAGA_API_DLL_EXPORT int SG_UI_Progress_Lock ( bool bOn )

Definition at line 176 of file api_callback.cpp.

References gSG_UI_Progress_Lock.

Referenced by SG_UI_ProgressAndMsg_Lock().

◆ SG_UI_Progress_Reset()

SAGA_API_DLL_EXPORT int SG_UI_Progress_Reset ( void )

Definition at line 191 of file api_callback.cpp.

References gSG_UI_Progress_Lock.

Referenced by SG_UI_ProgressAndMsg_Reset().

◆ SG_UI_ProgressAndMsg_Lock()

SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Lock ( bool bOn )

Definition at line 577 of file api_callback.cpp.

References SG_UI_Msg_Lock(), and SG_UI_Progress_Lock().

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), SG_Get_Projected(), and SG_Initialize_Environment().

◆ SG_UI_ProgressAndMsg_Reset()

SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Reset ( void )

Definition at line 584 of file api_callback.cpp.

References SG_UI_Msg_Reset(), and SG_UI_Progress_Reset().

◆ SG_UI_Set_Map_Extent()

SAGA_API_DLL_EXPORT bool SG_UI_Set_Map_Extent | ( | double | xMin,
 |  | double | yMin,
 |  | double | xMax,
 |  | double | yMax,
 |  | int | Maps = SG_UI_MAP_ACTIVE
 | ) |  |

Definition at line 710 of file api_callback.cpp.

References CALLBACK_SET_MAP_EXTENT, and gSG_UI_Callback.

◆ SG_UI_Stop_Execution()

SAGA_API_DLL_EXPORT bool SG_UI_Stop_Execution ( bool bDialog )

Definition at line 342 of file api_callback.cpp.

References CALLBACK_STOP_EXECUTION, and gSG_UI_Callback.

Referenced by CSG_Tool::Stop_Execution().

◆ SG_UI_Window_Arrange()

SAGA_API_DLL_EXPORT int SG_UI_Window_Arrange ( int Arrange )

Definition at line 756 of file api_callback.cpp.

References CALLBACK_WINDOW_ARRANGE, and gSG_UI_Callback.

◆ SG_Uninitialize_Environment()

SAGA_API_DLL_EXPORT bool SG_Uninitialize_Environment ( void )

Definition at line 533 of file api_core.cpp.

References g_App_Initialize.

Variable Documentation

◆ gSG_Data_Type_Identifier

const char gSG_Data_Type_Identifier[][32]
Initial value:
=
{
"BIT",
"BYTE_UNSIGNED",
"BYTE",
"SHORTINT_UNSIGNED",
"SHORTINT",
"INTEGER_UNSIGNED",
"INTEGER",
"LONGINT_UNSIGNED",
"LONGINT",
"FLOAT",
"DOUBLE",
"STRING",
"DATE",
"COLOR",
"BINARY",
"UNDEFINED"
}

Definition at line 1031 of file api_core.h.

Referenced by CSG_Parameter_Fixed_Table::_Serialize(), CSG_Grid_File_Info::Create(), CSG_Grid_File_Info::Save(), CSG_Table::Save(), SG_Data_Type_Get_Identifier(), and SG_Data_Type_Get_Type().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_core.h Source File

  • saga_core
  • saga_api
api_core.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_core.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__api_core_H
54 #define HEADER_INCLUDED__SAGA_API__api_core_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
75 // //
77 // //
78 // //
80
81 //---------------------------------------------------------
82 #ifdef _SAGA_MSW
83 #define _SAGA_DLL_EXPORT __declspec( dllexport )
84 #define _SAGA_DLL_IMPORT __declspec( dllimport )
85 #else
86 #define _SAGA_DLL_EXPORT
87 #define _SAGA_DLL_IMPORT
88 #endif
89
90 //---------------------------------------------------------
91 #ifdef _SAGA_API_EXPORTS
92 #define SAGA_API_DLL_EXPORT _SAGA_DLL_EXPORT
93 #else
94 #define SAGA_API_DLL_EXPORT _SAGA_DLL_IMPORT
95 #endif
96
97
99 // //
100 // //
101 // //
103
104 //---------------------------------------------------------
105 #ifndef SWIG
106
107 #include <math.h>
108 #include <memory.h>
109 #include <stdlib.h>
110 #include <stdio.h>
111 #include <string.h>
112 #include <wchar.h>
113 #include <string>
114
115 #endif // #ifdef SWIG
116
117
119 // //
120 // //
121 // //
123
124 //---------------------------------------------------------
125 // this is defined by configure, but will not be on a normal application build
126
127 #ifndef SIZEOF_LONG
128 #if defined(__alpha) || defined(__sparcv9) || defined(__LP64__) || (defined(__HOS_AIX__) && defined(_LP64))
129 #define SIZEOF_LONG 8
130 #else
131 #define SIZEOF_LONG 4
132 #endif
133 #endif
134
135 //---------------------------------------------------------
136 #ifdef _TYPEDEF_BOOL
137 typedef unsigned int bool;
138 #define true ((bool)1)
139 #define false ((bool)0)
140 #endif // _TYPEDEF_BOOL
141
142 //---------------------------------------------------------
143 #ifdef _TYPEDEF_BYTE
144 typedef unsigned char BYTE;
145 #endif // _TYPEDEF_BYTE
146
147 //---------------------------------------------------------
148 #ifdef _TYPEDEF_WORD
149 typedef unsigned short WORD;
150 #if SIZEOF_LONG == 4
151 typedef unsigned long DWORD;
152 #else
153 typedef unsigned int DWORD;
154 #endif
155 #endif // _TYPEDEF_WORD
156
157 //---------------------------------------------------------
158 typedef signed long long sLong;
159 typedef unsigned long long uLong;
160
161 //---------------------------------------------------------
162 #if defined(_SAGA_MSW)
163 #include <float.h>
164 #define SG_is_NaN _isnan
165 #elif defined(isnan)
166 #define SG_is_NaN isnan
167 #else
168 #define SG_is_NaN(x) (x != x)
169 #endif
170
171
173 // //
174 // Parallelization //
175 // //
177
178 //---------------------------------------------------------
179 SAGA_API_DLL_EXPORT void SG_OMP_Set_Max_Num_Threads (int iCores);
180 SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Threads (void);
181 SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Procs (void);
182 SAGA_API_DLL_EXPORT int SG_OMP_Get_Thread_Num (void);
183
184
186 // //
187 // Memory //
188 // //
190
191 //---------------------------------------------------------
192 #define SG_GET_LONG(b0, b1, b2, b3) ((long) (((BYTE)(b0) | ((WORD)(b1) << 8)) | (((DWORD)(BYTE)(b2)) << 16) | (((DWORD)(BYTE)(b3)) << 24)))
193
194 #define SG_GET_BYTE_0(vLong) ((BYTE) ((vLong) ))
195 #define SG_GET_BYTE_1(vLong) ((BYTE) ((vLong) >> 8))
196 #define SG_GET_BYTE_2(vLong) ((BYTE) ((vLong) >> 16))
197 #define SG_GET_BYTE_3(vLong) ((BYTE) ((vLong) >> 24))
198
199 //---------------------------------------------------------
200 SAGA_API_DLL_EXPORT void * SG_Malloc (size_t size);
201 SAGA_API_DLL_EXPORT void * SG_Calloc (size_t num, size_t size);
202 SAGA_API_DLL_EXPORT void * SG_Realloc (void *memblock, size_t size);
203 SAGA_API_DLL_EXPORT void SG_Free (void *memblock);
204
205 #define SG_FREE_SAFE(PTR) { if( PTR ) { SG_Free (PTR); PTR = NULL; } }
206 #define SG_DELETE_SAFE(PTR) { if( PTR ) { delete (PTR); PTR = NULL; } }
207 #define SG_DELETE_ARRAY(PTR) { if( PTR ) { delete[](PTR); PTR = NULL; } }
208
209 //---------------------------------------------------------
210 SAGA_API_DLL_EXPORT void SG_Swap_Bytes (void *Buffer, int nBytes);
211
212 SAGA_API_DLL_EXPORT int SG_Mem_Get_Int (const char *Buffer , bool bSwapBytes);
213 SAGA_API_DLL_EXPORT void SG_Mem_Set_Int (char *Buffer, int Value , bool bSwapBytes);
214 SAGA_API_DLL_EXPORT double SG_Mem_Get_Double (const char *Buffer , bool bSwapBytes);
215 SAGA_API_DLL_EXPORT void SG_Mem_Set_Double (char *Buffer, double Value, bool bSwapBytes);
216
217
219 // //
221
222 //---------------------------------------------------------
223 class SAGA_API_DLL_EXPORT CSG_Buffer
224 {
225 public:
226
227 CSG_Buffer (void);
228 bool Create (void);
229
230 CSG_Buffer (const CSG_Buffer &Buffer);
231 bool Create (const CSG_Buffer &Buffer);
232
233 CSG_Buffer (size_t Size);
234 bool Create (size_t Size);
235
236 virtual ~CSG_Buffer (void);
237 void Destroy (void);
238
239 bool Set_Size (size_t Size, bool bShrink = true);
240 bool Inc_Size (size_t Size) { return( Set_Size(m_Size + Size) ); }
241 size_t Get_Size (void) const { return( m_Size ); }
242
243 bool Set_Data (const char *Data, size_t Size, bool bShrink = true);
244 char * Get_Data (int Offset = 0) const { return( m_Data + Offset ); }
245
246 CSG_Buffer & operator = (const CSG_Buffer &Buffer) { Create(Buffer); return( *this ); }
247 char & operator [] (int Position) { return( m_Data[Position] ); }
248 char operator [] (int Position) const { return( m_Data[Position] ); }
249
250 void Add_Value (char Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
251 void Add_Value (short Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
252 void Add_Value (int Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
253 void Add_Value (float Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
254 void Add_Value (double Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
255
256 CSG_Buffer & operator += (char Value) { Add_Value(Value); return( *this ); }
257 CSG_Buffer & operator += (short Value) { Add_Value(Value); return( *this ); }
258 CSG_Buffer & operator += (int Value) { Add_Value(Value); return( *this ); }
259 CSG_Buffer & operator += (float Value) { Add_Value(Value); return( *this ); }
260 CSG_Buffer & operator += (double Value) { Add_Value(Value); return( *this ); }
261
262 void Set_Value (int Offset, char Value, bool bBigEndian = false) { m_Data[Offset] = Value; }
263 void Set_Value (int Offset, short Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(short *)(m_Data + Offset) = Value; }
264 void Set_Value (int Offset, int Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(int *)(m_Data + Offset) = Value; }
265 void Set_Value (int Offset, float Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(float *)(m_Data + Offset) = Value; }
266 void Set_Value (int Offset, double Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(double *)(m_Data + Offset) = Value; }
267
268 short asShort (int Offset, bool bBigEndian = false) const { short Value = *(short *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
269 int asInt (int Offset, bool bBigEndian = false) const { int Value = *(int *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
270 float asFloat (int Offset, bool bBigEndian = false) const { float Value = *(float *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
271 double asDouble (int Offset, bool bBigEndian = false) const { double Value = *(double *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
272
273
274 private:
275
276 char *m_Data;
277
278 size_t m_Size;
279
280 };
281
282
284 // //
285 // //
286 // //
288
289 //---------------------------------------------------------
290 enum class TSG_Array_Growth
291 {
292 SG_ARRAY_GROWTH_0 = 0,
293 SG_ARRAY_GROWTH_1,
294 SG_ARRAY_GROWTH_2,
295 SG_ARRAY_GROWTH_3,
296 SG_ARRAY_GROWTH_FIX_8,
297 SG_ARRAY_GROWTH_FIX_16,
298 SG_ARRAY_GROWTH_FIX_32,
299 SG_ARRAY_GROWTH_FIX_64,
300 SG_ARRAY_GROWTH_FIX_128,
301 SG_ARRAY_GROWTH_FIX_256,
302 SG_ARRAY_GROWTH_FIX_512,
303 SG_ARRAY_GROWTH_FIX_1024
304 };
305
306 //---------------------------------------------------------
307 class SAGA_API_DLL_EXPORT CSG_Array
308 {
309 public:
310 CSG_Array(void);
311 ~CSG_Array(void);
312
313 CSG_Array (const CSG_Array &Array);
314 void * Create (const CSG_Array &Array);
315
316 CSG_Array (size_t Value_Size, sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
317 void * Create (size_t Value_Size, sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
318
319 bool Destroy (void);
320
321 CSG_Array & operator = (const CSG_Array &Array) { Create(Array); return( *this ); }
322
323 bool Set_Growth (TSG_Array_Growth Growth);
324 TSG_Array_Growth Get_Growth (void) const { return( m_Growth ); }
325
326 size_t Get_Value_Size (void) const { return( m_Value_Size ); }
327 sLong Get_Size (void) const { return( m_nValues ); }
328 size_t Get_uSize (void) const { return( (size_t)m_nValues ); }
329
331 void * Get_Entry (sLong Index) const { return( Index >= 0 && Index < m_nValues ? (char *)m_Values + Index * m_Value_Size : NULL ); }
332 void * operator [] (sLong Index) const { return( Get_Entry(Index) ); }
333
334 bool Del_Entry (sLong Index, bool bShrink = true);
335
336 void * Get_Array (void) const { return( m_Values ); }
337 void * Get_Array (sLong nValues) { Set_Array(nValues); return( m_Values ); }
338
339 bool Set_Array (sLong nValues, bool bShrink = true);
340 bool Set_Array (sLong nValues, void **pArray, bool bShrink = true);
341
342 bool Inc_Array (sLong nValues = 1);
343 bool Inc_Array (void **pArray);
344
345 bool Dec_Array (bool bShrink = true);
346 bool Dec_Array (void **pArray, bool bShrink = true);
347
348
349 private:
350
351 TSG_Array_Growth m_Growth;
352
353 size_t m_Value_Size;
354
355 sLong m_nValues, m_nBuffer;
356
357 void *m_Values;
358
359 };
360
361
363 // //
365
366 //---------------------------------------------------------
367 class SAGA_API_DLL_EXPORT CSG_Array_Pointer
368 {
369 public:
370 CSG_Array_Pointer (const CSG_Array_Pointer &Array) { Create(Array); }
371 void ** Create (const CSG_Array_Pointer &Array);
372
373 CSG_Array_Pointer (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0) { Create(nValues, Growth); }
374 void ** Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
375
376 void Destroy (void) { m_Array.Destroy(); }
377
378 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
379 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
380
381 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
382 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
383
384 void ** Get_Array (void) const { return( (void **)m_Array.Get_Array() ); }
385 void ** Get_Array (sLong nValues) { return( (void **)m_Array.Get_Array(nValues) ); }
386
387 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
388 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
389 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
390
391 bool Add (void *Value);
392 bool Add (const CSG_Array_Pointer &Array);
393 bool Set (sLong Index, void *Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((void **)m_Array.Get_Entry(Index)) = Value; return( true ); }
394 void *& Get (sLong Index) { return( *((void **)m_Array.Get_Entry(Index)) ); }
395 void * Get (sLong Index) const { return( *((void **)m_Array.Get_Entry(Index)) ); }
396 bool Del (sLong Index);
397 sLong Del (void *Value);
398
399 CSG_Array_Pointer & operator = (const CSG_Array_Pointer &Array) { Create(Array); return( *this ); }
400
401 void *& operator [] (sLong Index) { return( Get(Index) ); }
402 void * operator [] (sLong Index) const { return( Get(Index) ); }
403
404 CSG_Array_Pointer & operator += (void *Value) { Add(Value); return( *this ); }
405 CSG_Array_Pointer & operator += (const CSG_Array_Pointer &Array) { Add(Array); return( *this ); }
406
407
408 private:
409
410 CSG_Array m_Array;
411
412 };
413
414
416 // //
418
419 //---------------------------------------------------------
420 class SAGA_API_DLL_EXPORT CSG_Array_Int
421 {
422 public:
423 CSG_Array_Int (const CSG_Array_Int &Array) { Create(Array); }
424 int * Create (const CSG_Array_Int &Array);
425
426 CSG_Array_Int (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0) { Create(nValues, Growth); }
427 int * Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
428
429 void Destroy (void) { m_Array.Destroy(); }
430
431 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
432 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
433
434 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
435 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
436
437 int * Get_Array (void) const { return( (int *)m_Array.Get_Array() ); }
438 int * Get_Array (sLong nValues) { return( (int *)m_Array.Get_Array(nValues) ); }
439
440 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
441 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
442 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
443
444 bool Add (int Value);
445 bool Add (const CSG_Array_Int &Array);
446 bool Set (sLong Index, int Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((int *)m_Array.Get_Entry(Index)) = Value; return( true ); }
447 int & Get (sLong Index) { return( *((int *)m_Array.Get_Entry(Index)) ); }
448 int Get (sLong Index) const { return( *((int *)m_Array.Get_Entry(Index)) ); }
449
450 bool Assign (int Value);
451
452 CSG_Array_Int & operator = (const CSG_Array_Int &Array) { Create(Array); return( *this ); }
453 CSG_Array_Int & operator = (int Value) { Assign(Value); return( *this ); }
454
455 int & operator [] (sLong Index) { return( Get(Index) ); }
456 int operator [] (sLong Index) const { return( Get(Index) ); }
457
458 CSG_Array_Int & operator += (int Value) { Add(Value); return( *this ); }
459 CSG_Array_Int & operator += (const CSG_Array_Int &Array) { Add(Array); return( *this ); }
460
461
462 private:
463
464 CSG_Array m_Array;
465
466 };
467
468
470 // //
472
473 //---------------------------------------------------------
474 class SAGA_API_DLL_EXPORT CSG_Array_sLong
475 {
476 public:
477 CSG_Array_sLong (const CSG_Array_sLong &Array) { Create(Array); }
478 sLong * Create (const CSG_Array_sLong &Array);
479
480 CSG_Array_sLong (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0) { Create(nValues, Growth); }
481 sLong * Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
482
483 void Destroy (void) { m_Array.Destroy(); }
484
485 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
486 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
487
488 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
489 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
490
491 sLong * Get_Array (void) const { return( (sLong *)m_Array.Get_Array() ); }
492 sLong * Get_Array (sLong nValues) { return( (sLong *)m_Array.Get_Array(nValues) ); }
493
494 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
495 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
496 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
497
498 bool Add (sLong Value);
499 bool Add (const CSG_Array_sLong &Array);
500 bool Set (sLong Index, sLong Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((sLong *)m_Array.Get_Entry(Index)) = Value; return( true ); }
501 sLong & Get (sLong Index) { return( *((sLong *)m_Array.Get_Entry(Index)) ); }
502 sLong Get (sLong Index) const { return( *((sLong *)m_Array.Get_Entry(Index)) ); }
503
504 bool Assign (sLong Value);
505
506 CSG_Array_sLong & operator = (const CSG_Array_sLong &Array) { Create(Array); return( *this ); }
507 CSG_Array_sLong & operator = (sLong Value) { Assign(Value); return( *this ); }
508
509 sLong & operator [] (sLong Index) { return( Get(Index) ); }
510 sLong operator [] (sLong Index) const { return( Get(Index) ); }
511
512 CSG_Array_sLong & operator += (sLong Value) { Add(Value); return( *this ); }
513 CSG_Array_sLong & operator += (const CSG_Array_sLong &Array) { Add(Array); return( *this ); }
514
515
516 private:
517
518 CSG_Array m_Array;
519
520 };
521
522
524 // //
525 // String //
526 // //
528
529 //---------------------------------------------------------
530 #define SG_Char wchar_t
531 #define SG_T(s) L ## s
532 #define SG_PRINTF SG_Printf
533 #define SG_FPRINTF SG_FPrintf
534 #define SG_SSCANF swscanf
535 #define SG_STR_CPY wcscpy
536 #define SG_STR_LEN wcslen
537 #define SG_STR_TOD wcstod
538 #define SG_STR_CMP(s1, s2) CSG_String(s1).Cmp(s2)
539 #define SG_STR_MBTOSG(s) CSG_String(s).w_str()
540
541 //---------------------------------------------------------
542 typedef enum
543 {
544 SG_FILE_ENCODING_ANSI,
545 SG_FILE_ENCODING_UTF7,
546 SG_FILE_ENCODING_UTF8,
547 SG_FILE_ENCODING_UTF16LE,
548 SG_FILE_ENCODING_UTF16BE,
549 SG_FILE_ENCODING_UTF32LE,
550 SG_FILE_ENCODING_UTF32BE,
551 SG_FILE_ENCODING_UNDEFINED
552 }
553 TSG_File_Flags_Encoding;
554
555 //---------------------------------------------------------
556 class SAGA_API_DLL_EXPORT CSG_String
557 {
558 public:
559 CSG_String(void);
560 CSG_String(const CSG_String &String);
561 CSG_String(const char *String);
562 CSG_String(const wchar_t *String);
563 CSG_String(char Character, size_t nRepeat = 1);
564 CSG_String(wchar_t Character, size_t nRepeat = 1);
565
566 CSG_String (const class wxString *pString);
567 bool Create (const class wxString *pString);
568
569 virtual ~CSG_String(void);
570
571 CSG_String & operator = (const CSG_String &String);
572 CSG_String & operator = (const char *String);
573 CSG_String & operator = (const wchar_t *String);
574 CSG_String & operator = (char Character);
575 CSG_String & operator = (wchar_t Character);
576
577 size_t Length (void) const;
578
579 bool is_Empty (void) const;
580
581 SG_Char operator [] (int i) const;
582 SG_Char operator [] (size_t i) const;
583 SG_Char Get_Char (size_t i) const;
584
585 void Set_Char (size_t i, char Character);
586 void Set_Char (size_t i, wchar_t Character);
587
588 const char * b_str (void) const;
589 const wchar_t * w_str (void) const;
590 const SG_Char * c_str (void) const;
591
592 operator const char * (void) const { return( b_str() ); }
593 operator const wchar_t * (void) const { return( w_str() ); }
594
595 CSG_String & Prepend (const CSG_String &String);
596
597 CSG_String & Append (const CSG_String &String);
598 CSG_String & Append (const char *String);
599 CSG_String & Append (const wchar_t *String);
600 CSG_String & Append (char Character, size_t nRepeat = 1);
601 CSG_String & Append (wchar_t Character, size_t nRepeat = 1);
602
603 void operator += (const CSG_String &String);
604 void operator += (const char *String);
605 void operator += (const wchar_t *String);
606 void operator += (char Character);
607 void operator += (wchar_t Character);
608
609 CSG_String operator + (const CSG_String &String) const;
610 CSG_String operator + (const char *String) const;
611 CSG_String operator + (const wchar_t *String) const;
612 CSG_String operator + (char Character) const;
613 CSG_String operator + (wchar_t Character) const;
614
615 int Cmp (const CSG_String &String) const;
616 int CmpNoCase (const CSG_String &String) const;
617
618 bool is_Same_As (const CSG_String &String, bool bCase = true) const;
619 bool is_Same_As (const char Character, bool bCase = true) const;
620 bool is_Same_As (const wchar_t Character, bool bCase = true) const;
621
622 CSG_String & Make_Lower (void);
623 CSG_String & Make_Upper (void);
624
625 void Clear (void);
626
627 static CSG_String Format (const char *Format, ...);
628 static CSG_String Format (const wchar_t *Format, ...);
629 int Printf (const char *Format, ...);
630 int Printf (const wchar_t *Format, ...);
631
632 size_t Replace (const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll = true);
633
634 CSG_String & Remove (size_t pos);
635 CSG_String & Remove (size_t pos, size_t len);
636
637 int Trim (bool fromRight = false);
638 int Trim_Both (void);
639
640 int Find (char Character, bool fromEnd = false) const;
641 int Find (wchar_t Character, bool fromEnd = false) const;
642 int Find (const CSG_String &String) const;
643 bool Contains (const CSG_String &String) const;
644
645 CSG_String AfterFirst (char Character) const;
646 CSG_String AfterFirst (wchar_t Character) const;
647 CSG_String AfterLast (char Character) const;
648 CSG_String AfterLast (wchar_t Character) const;
649 CSG_String BeforeFirst (char Character) const;
650 CSG_String BeforeFirst (wchar_t Character) const;
651 CSG_String BeforeLast (char Character) const;
652 CSG_String BeforeLast (wchar_t Character) const;
653
654 CSG_String Right (size_t count) const;
655 CSG_String Mid (size_t first, size_t count = 0) const;
656 CSG_String Left (size_t count) const;
657
658 bool is_Number (void) const;
659
660 int asInt (void) const;
661 bool asInt (int &Value) const;
662 sLong asLongLong (void) const;
663 bool asLongLong (sLong &Value) const;
664
665 double asDouble (void) const;
666 bool asDouble (double &Value) const;
667
668 static CSG_String from_UTF8 (const char *String, size_t Length = 0);
669
670 size_t to_UTF8 (char **pString) const;
671 CSG_Buffer to_UTF8 (void) const;
672 size_t to_MBChar (char **pString, int Encoding) const;
673 CSG_Buffer to_MBChar ( int Encoding) const;
674 bool to_ASCII (char **pString, char Replace = '_') const;
675 CSG_Buffer to_ASCII ( char Replace = '_') const;
676 std::string to_StdString (void) const;
677 std::wstring to_StdWstring (void) const;
678
679 protected:
680
681 class wxString *m_pString;
682
683 };
684
685 //---------------------------------------------------------
686 SAGA_API_DLL_EXPORT CSG_String operator + (const char *A, const CSG_String &B);
687 SAGA_API_DLL_EXPORT CSG_String operator + (const wchar_t *A, const CSG_String &B);
688 SAGA_API_DLL_EXPORT CSG_String operator + (char A, const CSG_String &B);
689 SAGA_API_DLL_EXPORT CSG_String operator + (wchar_t A, const CSG_String &B);
690
691 //---------------------------------------------------------
692 class SAGA_API_DLL_EXPORT CSG_Strings
693 {
694 public:
695 CSG_Strings(void);
696 CSG_Strings(const CSG_Strings &Strings);
697 CSG_Strings(int nStrings, const SG_Char **Strings);
698
699 virtual ~CSG_Strings(void);
700
701 bool Create (const CSG_Strings &Strings);
702 bool Destroy (void);
703
704 bool Set_Count (int Count) { return( Set_Count((size_t)Count) ); }
705 bool Set_Count (size_t Count);
706 int Get_Count (void) const { return( (int)m_Strings.Get_Size() ); }
707 size_t Get_Size (void) const { return( m_Strings.Get_Size() ); }
708
709 bool Add (const CSG_Strings &Strings);
710 bool Add (const CSG_String &String );
711 bool Ins (const CSG_String &String , int Index) { return( Ins(String, (size_t)Index) ); }
712 bool Ins (const CSG_String &String , size_t Index);
713 bool Del (int Index) { return( Del((size_t)Index) ); }
714 bool Del (size_t Index);
715
716 CSG_String & Get_String (int Index) const { return( *((CSG_String *)m_Strings[Index]) ); }
717 CSG_String & Get_String (size_t Index) const { return( *((CSG_String *)m_Strings[Index]) ); }
718
719 CSG_String & operator [] (int Index) const { return( Get_String(Index) ); }
720 CSG_String & operator [] (size_t Index) const { return( Get_String(Index) ); }
721
722 CSG_Strings & operator = (const CSG_Strings &Strings) { Create(Strings); return( *this ); }
723 CSG_Strings & operator += (const CSG_Strings &Strings) { Add (Strings); return( *this ); }
724 CSG_Strings & operator += (const CSG_String &String ) { Add (String ); return( *this ); }
725
726 bool Sort (bool Ascending = true);
727
728 void Clear (void) { Destroy(); }
729 bool Assign (const CSG_Strings &Strings) { return( Create(Strings) ); }
730
731
732 protected:
733
734 CSG_Array_Pointer m_Strings;
735
736 };
737
738 //---------------------------------------------------------
739 #define SG_DEFAULT_DELIMITERS " \t\r\n"
740
741 typedef enum
742 {
743 SG_TOKEN_INVALID,
744 SG_TOKEN_DEFAULT,
745 SG_TOKEN_RET_EMPTY,
746 SG_TOKEN_RET_EMPTY_ALL,
747 SG_TOKEN_RET_DELIMS,
748 SG_TOKEN_STRTOK
749 }
750 TSG_String_Tokenizer_Mode;
751
752 //---------------------------------------------------------
753 class SAGA_API_DLL_EXPORT CSG_String_Tokenizer
754 {
755 public:
756 CSG_String_Tokenizer(void);
757 CSG_String_Tokenizer(const CSG_String &String, const CSG_String &Delimiters = SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode = SG_TOKEN_DEFAULT);
758
759 ~CSG_String_Tokenizer(void);
760
761
762 size_t Get_Tokens_Count (void) const;
763 SG_Char Get_Last_Delimiter (void) const;
764 CSG_String Get_Next_Token (void);
765 size_t Get_Position (void) const;
766 CSG_String Get_String (void) const;
767 bool Has_More_Tokens (void) const;
768 void Set_String (const CSG_String &String, const CSG_String &Delimiters = SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode = SG_TOKEN_DEFAULT);
769
770
771 private:
772
773 class wxStringTokenizer *m_pTokenizer;
774
775 };
776
777 //---------------------------------------------------------
778 SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize (const CSG_String &String, const CSG_String &Delimiters = SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode = SG_TOKEN_DEFAULT);
779
780 //---------------------------------------------------------
781 SAGA_API_DLL_EXPORT bool SG_is_Character_Numeric (int Character);
782
783 SAGA_API_DLL_EXPORT CSG_String SG_Get_CurrentTimeStr (bool bWithDate = true);
784
785 SAGA_API_DLL_EXPORT double SG_Degree_To_Double (const CSG_String &String);
786 SAGA_API_DLL_EXPORT CSG_String SG_Double_To_Degree (double Value);
787
788 SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals (double Value, int maxDecimals = 6);
789
790 SAGA_API_DLL_EXPORT void SG_Flip_Decimal_Separators (CSG_String &String);
791
792 SAGA_API_DLL_EXPORT CSG_String SG_Get_String (double Value, int Precision = -99);
793 SAGA_API_DLL_EXPORT CSG_String SG_Get_String (int Value, int Precision = 0);
794
795
797 // //
798 // //
799 // //
801
802 //---------------------------------------------------------
803 class SAGA_API_DLL_EXPORT CSG_Bytes
804 {
805 public:
806 CSG_Bytes (void);
807 bool Create (void);
808
809 CSG_Bytes (const CSG_Bytes &Bytes);
810 bool Create (const CSG_Bytes &Bytes);
811
812 CSG_Bytes (const BYTE *Bytes, int nBytes);
813 bool Create (const BYTE *Bytes, int nBytes);
814
815 virtual ~CSG_Bytes(void);
816
817 bool Destroy (void);
818 bool Clear (void);
819
820 void Rewind (void) { m_Cursor = 0; }
821 bool is_EOF (void) { return( m_Cursor >= m_nBytes ); }
822
823 int Get_Count (void) const { return( m_nBytes ); }
824 BYTE * Get_Bytes (void) const { return( m_Bytes ); }
825
826 CSG_Bytes Get_Bytes (int i) const { if( i < 0 || i >= m_nBytes ) i = 0; return( CSG_Bytes(m_Bytes + i, m_nBytes - i) ); }
827 CSG_Bytes operator + (int i) const { return( Get_Bytes(i) ); }
828
829 BYTE Get_Byte (int i) const { return( i >= 0 && i < m_nBytes ? m_Bytes[i] : 0 ); }
830 BYTE operator [] (int i) const { return( Get_Byte(i) ); }
831
832 bool Assign (const CSG_Bytes &Bytes);
833 CSG_Bytes & operator = (const CSG_Bytes &Bytes) { Assign(Bytes); return( *this ); }
834
835 bool Add (const CSG_Bytes &Bytes);
836 CSG_Bytes & operator += (const CSG_Bytes &Bytes) { Add(Bytes); return( *this ); }
837
838 bool Add (void *Bytes, int nBytes, bool bSwapBytes);
839
840 bool Add (BYTE Value) { return( Add(&Value, sizeof(Value), false) ); }
841 CSG_Bytes & operator += (BYTE Value) { Add(Value); return( *this ); }
842 bool Add (char Value) { return( Add(&Value, sizeof(Value), false) ); }
843 CSG_Bytes & operator += (char Value) { Add(Value); return( *this ); }
844 bool Add (short Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
845 CSG_Bytes & operator += (short Value) { Add(Value); return( *this ); }
846 bool Add (WORD Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
847 CSG_Bytes & operator += (WORD Value) { Add(Value); return( *this ); }
848 bool Add (int Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
849 CSG_Bytes & operator += (int Value) { Add(Value); return( *this ); }
850 bool Add (DWORD Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
851 CSG_Bytes & operator += (DWORD Value) { Add(Value); return( *this ); }
852 bool Add (float Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
853 CSG_Bytes & operator += (float Value) { Add(Value); return( *this ); }
854 bool Add (double Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
855 CSG_Bytes & operator += (double Value) { Add(Value); return( *this ); }
856
857 BYTE asByte (int i) const { return( Get_Byte (i) ); }
858 char asChar (int i) const { return( (char)Get_Byte (i) ); }
859 short asShort (int i, bool bSwapBytes = false) const { short v = *((short *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
860 WORD asWord (int i, bool bSwapBytes = false) const { WORD v = *((WORD *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
861 int asInt (int i, bool bSwapBytes = false) const { int v = *((int *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
862 DWORD asDWord (int i, bool bSwapBytes = false) const { DWORD v = *((DWORD *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
863 float asFloat (int i, bool bSwapBytes = false) const { float v = *((float *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
864 double asDouble (int i, bool bSwapBytes = false) const { double v = *((double *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
865
866 BYTE Read_Byte (void) { BYTE v = asByte (m_Cursor); m_Cursor += sizeof(v); return( v ); }
867 char Read_Char (void) { char v = asByte (m_Cursor); m_Cursor += sizeof(v); return( v ); }
868 short Read_Short (bool bSwapBytes = false) { short v = asShort (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
869 WORD Read_Word (bool bSwapBytes = false) { WORD v = asWord (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
870 int Read_Int (bool bSwapBytes = false) { int v = asInt (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
871 DWORD Read_DWord (bool bSwapBytes = false) { DWORD v = asDWord (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
872 float Read_Float (bool bSwapBytes = false) { float v = asFloat (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
873 double Read_Double (bool bSwapBytes = false) { double v = asDouble(m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
874
875 CSG_String toHexString (void) const;
876 bool fromHexString (const CSG_String &HexString);
877
878
879 private:
880
881 int m_nBytes, m_nBuffer, m_Cursor;
882
883 BYTE *m_Bytes;
884
885
886 bool _Inc_Array (int nBytes);
887
888 };
889
890 //---------------------------------------------------------
891 class SAGA_API_DLL_EXPORT CSG_Bytes_Array
892 {
893 public:
894 CSG_Bytes_Array(void);
895 virtual ~CSG_Bytes_Array(void);
896
897 bool Destroy (void);
898
899 int Get_Count (void) const { return( m_nBytes ); }
900 CSG_Bytes * Get_Bytes (int i) { return( i >= 0 && i < m_nBytes ? m_pBytes[i] : NULL ); }
901 CSG_Bytes & operator [] (int i) { return( *Get_Bytes(i) ); }
902
903 CSG_Bytes * Add (void);
904
905
906 private:
907
908 int m_nBytes, m_nBuffer;
909
910 CSG_Bytes **m_pBytes;
911
912 };
913
914
916 // //
917 // //
918 // //
920
921 //---------------------------------------------------------
922 class CSG_Stack
923 {
924 public:
925 CSG_Stack(size_t RecordSize)
926 {
927 m_Stack.Create(RecordSize, 1, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_256);
928 }
929
930 virtual ~CSG_Stack(void) {}
931
932 bool Destroy (void) { return( m_Stack.Set_Array(1) ); }
933
934 size_t Get_RecordSize (void) const { return( m_Stack.Get_Value_Size() ); }
935 size_t Get_Size (void) const { return( m_Stack.Get_uSize() - 1 ); }
936
937 bool Clear (bool bFreeMemory = false)
938 {
939 return( m_Stack.Set_Array(1, bFreeMemory) );
940 }
941
942
943 protected:
944
945 void * Get_Record (size_t i) const
946 {
947 return( m_Stack.Get_Entry((sLong)(i + 1)) );
948 }
949
950 void * Get_Record_Push (void)
951 {
952 return( m_Stack.Inc_Array() ? m_Stack.Get_Entry(m_Stack.Get_Size() - 1) : NULL );
953 }
954
955 void * Get_Record_Pop (void)
956 {
957 if( m_Stack.Get_Size() > 0 )
958 {
959 memcpy(m_Stack.Get_Array(), m_Stack.Get_Entry(m_Stack.Get_Size() - 1), m_Stack.Get_Value_Size());
960
961 m_Stack.Dec_Array(true);
962
963 return( m_Stack.Get_Array() );
964 }
965
966 return( NULL );
967 }
968
969
970 private:
971
972 CSG_Array m_Stack;
973
974 };
975
976
978 // //
979 // Data Types //
980 // //
982
983 //---------------------------------------------------------
984 typedef enum
985 {
986 SG_DATATYPE_Bit = 0,
987 SG_DATATYPE_Byte,
988 SG_DATATYPE_Char,
989 SG_DATATYPE_Word,
990 SG_DATATYPE_Short,
991 SG_DATATYPE_DWord,
992 SG_DATATYPE_Int,
993 SG_DATATYPE_ULong,
994 SG_DATATYPE_Long,
995 SG_DATATYPE_Float,
996 SG_DATATYPE_Double,
997 SG_DATATYPE_String,
998 SG_DATATYPE_Date,
999 SG_DATATYPE_Color,
1000 SG_DATATYPE_Binary,
1001 SG_DATATYPE_Undefined
1002 }
1003 TSG_Data_Type;
1004
1005 //---------------------------------------------------------
1006 #define SG_DATATYPES_Undefined 0x0000
1007 #define SG_DATATYPES_Bit 0x0001
1008 #define SG_DATATYPES_Byte 0x0002
1009 #define SG_DATATYPES_Char 0x0004
1010 #define SG_DATATYPES_Word 0x0008
1011 #define SG_DATATYPES_Short 0x0010
1012 #define SG_DATATYPES_DWord 0x0020
1013 #define SG_DATATYPES_Int 0x0040
1014 #define SG_DATATYPES_ULong 0x0080
1015 #define SG_DATATYPES_Long 0x0100
1016 #define SG_DATATYPES_Float 0x0200
1017 #define SG_DATATYPES_Double 0x0400
1018 #define SG_DATATYPES_String 0x0800
1019 #define SG_DATATYPES_Date 0x1000
1020 #define SG_DATATYPES_Color 0x2000
1021 #define SG_DATATYPES_Binary 0x4000
1022 #define SG_DATATYPES_Standard 0xFFFF // all flags set
1023 #define SG_DATATYPES_SInteger (SG_DATATYPES_Char|SG_DATATYPES_Short|SG_DATATYPES_Int |SG_DATATYPES_Long)
1024 #define SG_DATATYPES_UInteger (SG_DATATYPES_Byte|SG_DATATYPES_Word |SG_DATATYPES_DWord|SG_DATATYPES_ULong)
1025 #define SG_DATATYPES_Integer (SG_DATATYPES_SInteger|SG_DATATYPES_UInteger)
1026 #define SG_DATATYPES_Real (SG_DATATYPES_Float|SG_DATATYPES_Double)
1027 #define SG_DATATYPES_Numeric (SG_DATATYPES_Integer|SG_DATATYPES_Real)
1028 #define SG_DATATYPES_Table (SG_DATATYPES_String|SG_DATATYPES_Date|SG_DATATYPES_Color|SG_DATATYPES_Numeric|SG_DATATYPES_Binary)
1029
1030 //---------------------------------------------------------
1031 const char gSG_Data_Type_Identifier[][32] =
1032 {
1033 "BIT",
1034 "BYTE_UNSIGNED",
1035 "BYTE",
1036 "SHORTINT_UNSIGNED",
1037 "SHORTINT",
1038 "INTEGER_UNSIGNED",
1039 "INTEGER",
1040 "LONGINT_UNSIGNED",
1041 "LONGINT",
1042 "FLOAT",
1043 "DOUBLE",
1044 "STRING",
1045 "DATE",
1046 "COLOR",
1047 "BINARY",
1048 "UNDEFINED"
1049 };
1050
1051 //---------------------------------------------------------
1052 inline size_t SG_Data_Type_Get_Size (TSG_Data_Type Type)
1053 {
1054 switch( Type )
1055 {
1056 case SG_DATATYPE_Bit : return( 0 );
1057 case SG_DATATYPE_Byte : return( sizeof(unsigned char) );
1058 case SG_DATATYPE_Char : return( sizeof(char) );
1059 case SG_DATATYPE_Word : return( sizeof(unsigned short int) );
1060 case SG_DATATYPE_Short : return( sizeof(short int) );
1061 case SG_DATATYPE_DWord : return( sizeof(unsigned int) );
1062 case SG_DATATYPE_Int : return( sizeof(int) );
1063 case SG_DATATYPE_ULong : return( sizeof(uLong) );
1064 case SG_DATATYPE_Long : return( sizeof(sLong) );
1065 case SG_DATATYPE_Float : return( sizeof(float) );
1066 case SG_DATATYPE_Double: return( sizeof(double) );
1067 case SG_DATATYPE_String: return( 0 );
1068 case SG_DATATYPE_Date : return( 0 );
1069 case SG_DATATYPE_Color : return( sizeof(unsigned int) );
1070 case SG_DATATYPE_Binary: return( 0 );
1071 default : return( 0 );
1072 }
1073 }
1074
1075 //---------------------------------------------------------
1076 SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Name (TSG_Data_Type Type, bool bShort = false);
1077 SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Identifier (TSG_Data_Type Type);
1078 SAGA_API_DLL_EXPORT TSG_Data_Type SG_Data_Type_Get_Type (const CSG_String &Identifier);
1079 SAGA_API_DLL_EXPORT int SG_Data_Type_Get_Flag (TSG_Data_Type Type);
1080 SAGA_API_DLL_EXPORT bool SG_Data_Type_is_Numeric (TSG_Data_Type Type);
1081 SAGA_API_DLL_EXPORT bool SG_Data_Type_Range_Check (TSG_Data_Type Type, double &Value);
1082
1083
1085 // //
1086 // File //
1087 // //
1089
1090 //---------------------------------------------------------
1091 typedef enum
1092 {
1093 SG_FILE_TYPE_NORMAL,
1094 SG_FILE_TYPE_ZIP
1095 }
1096 TSG_File_Type;
1097
1098 //---------------------------------------------------------
1099 enum ESG_File_Flags_Open
1100 {
1101 SG_FILE_R,
1102 SG_FILE_W,
1103 SG_FILE_RW
1104 };
1105
1106 //---------------------------------------------------------
1107 enum ESG_File_Flags_Seek
1108 {
1109 SG_FILE_START,
1110 SG_FILE_CURRENT,
1111 SG_FILE_END
1112 };
1113
1114 //---------------------------------------------------------
1115 class SAGA_API_DLL_EXPORT CSG_File
1116 {
1117 public:
1118
1119 CSG_File(void);
1120 virtual ~CSG_File(void);
1121
1122 CSG_File (const CSG_String &FileName, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_ANSI);
1123 virtual bool Open (const CSG_String &FileName, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_ANSI);
1124
1125 virtual bool Close (void);
1126
1127 virtual const CSG_String & Get_File_Name (void) const { return( m_FileName ); }
1128 virtual TSG_File_Type Get_File_Type (void) const { return( SG_FILE_TYPE_NORMAL ); }
1129
1130 class wxStreamBase * Get_Stream (void) const { return( (class wxStreamBase *)m_pStream ); }
1131
1132 bool Set_Encoding (int Encoding);
1133 int Get_Encoding (void) const { return( m_Encoding ); }
1134
1135 bool is_Open (void) const { return( m_pStream != NULL ); }
1136 bool is_Reading (void) const { return( m_pStream != NULL && m_Mode != SG_FILE_W ); }
1137 bool is_Writing (void) const { return( m_pStream != NULL && m_Mode != SG_FILE_R ); }
1138 bool is_EOF (void) const;
1139
1140 sLong Length (void) const;
1141
1142 bool Seek (sLong Offset, int Origin = SG_FILE_START) const;
1143 bool Seek_Start (void) const;
1144 bool Seek_End (void) const;
1145
1146 sLong Tell (void) const;
1147
1148 int Printf (const char *Format, ...);
1149 int Printf (const wchar_t *Format, ...);
1150
1151 size_t Read (void *Buffer, size_t Size, size_t Count = 1) const;
1152 size_t Write (void *Buffer, size_t Size, size_t Count = 1) const;
1153 size_t Read ( CSG_String &Buffer, size_t Size) const;
1154 size_t Write (const CSG_String &Buffer) const;
1155
1156 bool Read_Line (CSG_String &sLine) const;
1157
1158 int Read_Char (void) const;
1159 int Read_Int ( bool bBigEndian = false) const;
1160 bool Write_Int (int Value, bool bBigEndian = false);
1161 double Read_Double ( bool bBigEndian = false) const;
1162 bool Write_Double (double Value, bool bBigEndian = false);
1163
1164 bool Scan (int &Value) const;
1165 bool Scan (double &Value) const;
1166 bool Scan (CSG_String &Value, SG_Char Separator) const;
1167
1168 int Scan_Int (void) const;
1169 double Scan_Double (void) const;
1170 CSG_String Scan_String (SG_Char Separator) const;
1171
1172
1173 protected:
1174
1175 int m_Mode, m_Encoding;
1176
1177 CSG_String m_FileName;
1178
1179 void *m_pStream, *m_pConvert;
1180
1181
1182 void On_Construction (void);
1183
1184 };
1185
1186 //---------------------------------------------------------
1187 class SAGA_API_DLL_EXPORT CSG_File_Zip : public CSG_File
1188 {
1189 public:
1190
1191 CSG_File_Zip(void);
1192 virtual ~CSG_File_Zip(void);
1193
1194 CSG_File_Zip (const CSG_String &FileName, int Mode = SG_FILE_R, int Encoding = SG_FILE_ENCODING_ANSI);
1195 virtual bool Open (const CSG_String &FileName, int Mode = SG_FILE_R, int Encoding = SG_FILE_ENCODING_ANSI);
1196
1197 virtual bool Close (void);
1198
1199 virtual TSG_File_Type Get_File_Type (void) const { return( SG_FILE_TYPE_ZIP ); }
1200
1201 bool Add_Directory (const CSG_String &Name);
1202 bool Add_File (const CSG_String &Name, bool bBinary = true);
1203
1204 size_t Get_File_Count (void) { return( m_Files.Get_Size() ); }
1205 bool Get_File (const CSG_String &Name);
1206 bool Get_File (size_t Index);
1207 virtual CSG_String Get_File_Name (size_t Index);
1208 bool is_Directory (size_t Index);
1209
1210
1211 protected:
1212
1213 CSG_Array_Pointer m_Files;
1214
1215 };
1216
1217 //---------------------------------------------------------
1218 SAGA_API_DLL_EXPORT bool SG_Dir_Exists (const CSG_String &Directory);
1219 SAGA_API_DLL_EXPORT bool SG_Dir_Create (const CSG_String &Directory, bool bFullPath = false);
1220 SAGA_API_DLL_EXPORT bool SG_Dir_Delete (const CSG_String &Directory, bool bRecursive = false);
1221 SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Current (void);
1222 SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Temp (void);
1223 SAGA_API_DLL_EXPORT bool SG_Dir_List_Subdirectories (CSG_Strings &List, const CSG_String &Directory);
1224 SAGA_API_DLL_EXPORT bool SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory);
1225 SAGA_API_DLL_EXPORT bool SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension);
1226
1227 SAGA_API_DLL_EXPORT bool SG_File_Exists (const CSG_String &FileName);
1228 SAGA_API_DLL_EXPORT bool SG_File_Delete (const CSG_String &FileName);
1229 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp (const CSG_String &Prefix);
1230 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp (const CSG_String &Prefix, const CSG_String &Directory);
1231 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name (const CSG_String &full_Path, bool bExtension);
1232 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path (const CSG_String &full_Path);
1233 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute (const CSG_String &full_Path);
1234 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Relative (const CSG_String &Directory, const CSG_String &full_Path);
1235 SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name);
1236 SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name, const CSG_String &Extension);
1237 SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension (const CSG_String &FileName, const CSG_String &Extension);
1238 SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension (const CSG_String &FileName);
1239 SAGA_API_DLL_EXPORT bool SG_File_Set_Extension ( CSG_String &FileName, const CSG_String &Extension);
1240
1241 //---------------------------------------------------------
1242 SAGA_API_DLL_EXPORT bool SG_Get_Environment (const CSG_String &Variable, CSG_String *Value = NULL);
1243 SAGA_API_DLL_EXPORT bool SG_Set_Environment (const CSG_String &Variable, const CSG_String &Value);
1244
1245
1247 // //
1248 // Colors //
1249 // //
1251
1252 //---------------------------------------------------------
1253 #define SG_GET_RGB( r, g, b ) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16)))
1254 #define SG_GET_RGBA(r, g, b, a) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16) | (((DWORD)(BYTE)(a)) << 24)))
1255
1256 #define SG_GET_R(rgb) ((BYTE) ((rgb) ))
1257 #define SG_GET_G(rgb) ((BYTE) ((rgb) >> 8))
1258 #define SG_GET_B(rgb) ((BYTE) ((rgb) >> 16))
1259 #define SG_GET_A(rgb) ((BYTE) ((rgb) >> 24))
1260
1261 //---------------------------------------------------------
1262 #define SG_COLOR_BLACK SG_GET_RGB( 0, 0, 0)
1263 #define SG_COLOR_GREY SG_GET_RGB(128, 128, 128)
1264 #define SG_COLOR_GREY_LIGHT SG_GET_RGB(192, 192, 192)
1265 #define SG_COLOR_WHITE SG_GET_RGB(255, 255, 255)
1266 #define SG_COLOR_RED SG_GET_RGB(255, 0, 0)
1267 #define SG_COLOR_RED_DARK SG_GET_RGB(128, 0, 0)
1268 #define SG_COLOR_YELLOW SG_GET_RGB(255, 255, 0)
1269 #define SG_COLOR_YELLOW_DARK SG_GET_RGB(128, 128, 0)
1270 #define SG_COLOR_GREEN SG_GET_RGB( 0, 255, 0)
1271 #define SG_COLOR_GREEN_DARK SG_GET_RGB( 0, 128, 0)
1272 #define SG_COLOR_GREEN_LIGHT SG_GET_RGB( 0, 255, 0)
1273 #define SG_COLOR_BLUE SG_GET_RGB( 0, 0, 255)
1274 #define SG_COLOR_BLUE_DARK SG_GET_RGB( 0, 0, 128)
1275 #define SG_COLOR_BLUE_LIGHT SG_GET_RGB( 0, 255, 255)
1276 #define SG_COLOR_BLUE_GREEN SG_GET_RGB( 0, 128, 128)
1277 #define SG_COLOR_PURPLE SG_GET_RGB(128, 0, 128)
1278 #define SG_COLOR_PINK SG_GET_RGB(255, 0, 255)
1279 #define SG_COLOR_NONE -1
1280 #define SG_COLOR_RANDOM -2
1281
1282 //---------------------------------------------------------
1283 enum ESG_Colors
1284 {
1285 SG_COLORS_DEFAULT = 0,
1286 SG_COLORS_DEFAULT_BRIGHT,
1287 SG_COLORS_BLACK_WHITE,
1288 SG_COLORS_BLACK_RED,
1289 SG_COLORS_BLACK_GREEN,
1290 SG_COLORS_BLACK_BLUE,
1291 SG_COLORS_WHITE_RED,
1292 SG_COLORS_WHITE_GREEN,
1293 SG_COLORS_WHITE_BLUE,
1294 SG_COLORS_YELLOW_RED,
1295 SG_COLORS_YELLOW_GREEN,
1296 SG_COLORS_YELLOW_BLUE,
1297 SG_COLORS_GREEN_RED,
1298 SG_COLORS_RED_GREEN,
1299 SG_COLORS_RED_BLUE,
1300 SG_COLORS_GREEN_BLUE,
1301 SG_COLORS_RED_GREY_BLUE,
1302 SG_COLORS_RED_GREY_GREEN,
1303 SG_COLORS_GREEN_GREY_BLUE,
1304 SG_COLORS_RED_GREEN_BLUE,
1305 SG_COLORS_RED_BLUE_GREEN,
1306 SG_COLORS_GREEN_RED_BLUE,
1307 SG_COLORS_RAINBOW,
1308 SG_COLORS_NEON,
1309 SG_COLORS_TOPOGRAPHY,
1310 SG_COLORS_TOPOGRAPHY_2,
1311 SG_COLORS_TOPOGRAPHY_3,
1312 SG_COLORS_PRECIPITATION,
1313 SG_COLORS_ASPECT_1,
1314 SG_COLORS_ASPECT_2,
1315 SG_COLORS_ASPECT_3,
1316 SG_COLORS_COUNT
1317 };
1318
1319 //---------------------------------------------------------
1320 SAGA_API_DLL_EXPORT CSG_String SG_Colors_Get_Name (int Index);
1321
1322 SAGA_API_DLL_EXPORT long SG_Color_Get_Random (void);
1323
1324 SAGA_API_DLL_EXPORT bool SG_Color_From_Text (const CSG_String &Text, long &Color);
1325 SAGA_API_DLL_EXPORT CSG_String SG_Color_To_Text (long Color, bool bHexadecimal = true);
1326
1327 //---------------------------------------------------------
1328 class SAGA_API_DLL_EXPORT CSG_Colors
1329 {
1330 public:
1331 CSG_Colors (void);
1332 bool Create (void);
1333
1334 CSG_Colors (const CSG_Colors &Colors);
1335 bool Create (const CSG_Colors &Colors);
1336
1337 CSG_Colors (int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
1338 bool Create (int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
1339
1340 virtual ~CSG_Colors(void);
1341
1342 void Destroy (void);
1343
1344 bool Set_Count (int nColors);
1345 int Get_Count (void) const { return( m_nColors ); }
1346
1347 CSG_Colors & operator = (const CSG_Colors &Colors);
1348 long & operator [] (int Index) { return( m_Colors[Index < 0 ? 0 : Index >= m_nColors ? m_nColors - 1 : Index] ); }
1349
1350 bool Set_Color (int Index, long Color);
1351 bool Set_Color (int Index, int Red, int Green, int Blue);
1352 bool Set_Red (int Index, int Value);
1353 bool Set_Green (int Index, int Value);
1354 bool Set_Blue (int Index, int Value);
1355 bool Set_Brightness (int Index, int Value);
1356
1357 long Get_Color (int Index) const { return( m_nColors > 0 ? m_Colors[Index < 0 ? 0 : Index >= m_nColors ? m_nColors - 1 : Index] : 0 ); }
1358 long Get_Red (int Index) const { return( SG_GET_R(Get_Color(Index)) ); }
1359 long Get_Green (int Index) const { return( SG_GET_G(Get_Color(Index)) ); }
1360 long Get_Blue (int Index) const { return( SG_GET_B(Get_Color(Index)) ); }
1361 long Get_Brightness (int Index) const { return( (Get_Red(Index) + Get_Green(Index) + Get_Blue(Index)) / 3 ); }
1362
1363 long Get_Interpolated (double Index) const
1364 {
1365 if( m_nColors <= 0 ) return( 0 );
1366 if( Index <= 0. ) return( m_Colors[0] );
1367 if( Index >= m_nColors - 1. ) return( m_Colors[m_nColors - 1] );
1368
1369 int i = (int)Index; Index -= i;
1370 int r = (int)(Get_Red (i) + Index * ((double)Get_Red (i + 1) - Get_Red (i)));
1371 int g = (int)(Get_Green(i) + Index * ((double)Get_Green(i + 1) - Get_Green(i)));
1372 int b = (int)(Get_Blue (i) + Index * ((double)Get_Blue (i + 1) - Get_Blue (i)));
1373
1374 return( SG_GET_RGB(r, g, b) );
1375 }
1376
1377 static int Get_Predefined_Count(void);
1378 static CSG_String Get_Predefined_Name (int Identifier);
1379 bool Set_Predefined (int Index, bool bRevert = false, int nColors = 11);
1380 bool Set_Palette (int Index, bool bRevert = false, int nColors = 11) { return( Set_Predefined(Index, bRevert, nColors) ); }
1381 bool Set_Default (int nColors = 11);
1382 bool Set_Ramp (long Color_A, long Color_B);
1383 bool Set_Ramp (long Color_A, long Color_B, int iColor_A, int iColor_B);
1384 bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B);
1385 bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B, int iColor_A, int iColor_B);
1386
1387 bool Random (void);
1388 bool Invert (void);
1389 bool Revert (void);
1390 bool Greyscale (void);
1391
1392 bool Assign (const CSG_Colors &Colors);
1393 bool Assign (CSG_Colors *pSource);
1394
1395 bool Load (const CSG_String &File_Name);
1396 bool Save (const CSG_String &File_Name, bool bBinary);
1397
1398 bool Serialize (CSG_File &Stream, bool bSave, bool bBinary);
1399
1400 bool to_Text ( CSG_String &String);
1401 bool from_Text (const CSG_String &String);
1402
1403
1404 private:
1405
1406 int m_nColors;
1407
1408 long *m_Colors;
1409
1410
1411 void _Set_Brightness (double &a, double &b, double &c, int Pass = 0);
1412
1413 };
1414
1415
1417 // //
1418 // Translator //
1419 // //
1421
1422 //---------------------------------------------------------
1423 class SAGA_API_DLL_EXPORT CSG_Translator
1424 {
1425 public:
1426 CSG_Translator(void);
1427 virtual ~CSG_Translator(void);
1428
1429 CSG_Translator (const CSG_String &File_Name, bool bSetExtension = true, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1430 bool Create (const CSG_String &File_Name, bool bSetExtension = true, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1431
1432 CSG_Translator (class CSG_Table *pTranslations, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1433 bool Create (class CSG_Table *pTranslations, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1434
1435 void Destroy (void);
1436
1437 bool is_CaseSensitive (void) const { return( !m_bCmpNoCase ); }
1438
1439 int Get_Count (void) const { return( m_nTranslations ); }
1440 const SG_Char * Get_Text (int i) const { return( i >= 0 && i < m_nTranslations ? m_Translations[i]->m_Text : SG_T("") ); }
1441 const SG_Char * Get_Translation (int i) const { return( i >= 0 && i < m_nTranslations ? m_Translations[i]->m_Translation : SG_T("") ); }
1442
1443 const SG_Char * Get_Translation (const SG_Char *Text, bool bReturnNullOnNotFound = false) const;
1444 bool Get_Translation (const SG_Char *Text, CSG_String &Translation) const;
1445
1446
1447 private:
1448
1449 class CSG_Translation
1450 {
1451 public:
1452 CSG_Translation(const CSG_String &Text, const CSG_String &Translation)
1453 {
1454 m_Text = Text;
1455 m_Translation = Translation;
1456 }
1457
1458 CSG_String m_Text, m_Translation;
1459 };
1460
1461
1462 private:
1463
1464 bool m_bCmpNoCase;
1465
1466 int m_nTranslations;
1467
1468 CSG_Translation **m_Translations;
1469
1470
1471 int _Get_Index (const CSG_String &Text) const;
1472
1473 };
1474
1475 //---------------------------------------------------------
1476 SAGA_API_DLL_EXPORT CSG_Translator & SG_Get_Translator (void);
1477
1478 SAGA_API_DLL_EXPORT const SG_Char * SG_Translate (const CSG_String &Text);
1479
1480 #define _TL(s) SG_Translate(L ## s)
1481 #define _TW(s) SG_Translate(CSG_String(s))
1482
1483
1485 // //
1486 // UI Callback //
1487 // //
1489
1490 //---------------------------------------------------------
1491 typedef enum
1492 {
1493 SG_UI_MSG_STYLE_NORMAL = 0,
1494 SG_UI_MSG_STYLE_BOLD,
1495 SG_UI_MSG_STYLE_ITALIC,
1496 SG_UI_MSG_STYLE_SUCCESS,
1497 SG_UI_MSG_STYLE_FAILURE,
1498 SG_UI_MSG_STYLE_BIG,
1499 SG_UI_MSG_STYLE_SMALL,
1500 SG_UI_MSG_STYLE_01,
1501 SG_UI_MSG_STYLE_02,
1502 SG_UI_MSG_STYLE_03
1503 }
1504 TSG_UI_MSG_STYLE;
1505
1506 //---------------------------------------------------------
1507 typedef enum
1508 {
1509 SG_UI_DATAOBJECT_UPDATE = 0,
1510 SG_UI_DATAOBJECT_SHOW_MAP,
1511 SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE,
1512 SG_UI_DATAOBJECT_SHOW_MAP_NEW,
1513 SG_UI_DATAOBJECT_SHOW_MAP_LAST
1514 }
1515 TSG_UI_DataObject_Update;
1516
1517 //---------------------------------------------------------
1518 typedef enum
1519 {
1520 SG_UI_MAP_ACTIVE = 0,
1521 SG_UI_MAP_LAST,
1522 SG_UI_MAP_ALL
1523 }
1524 TSG_UI_Maps;
1525
1526 //---------------------------------------------------------
1527 typedef enum
1528 {
1529 SG_UI_WINDOW_ARRANGE_MDI_CASCADE = 0x0001,
1530 SG_UI_WINDOW_ARRANGE_MDI_TILE_VER = 0x0002,
1531 SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR = 0x0004,
1532 SG_UI_WINDOW_ARRANGE_TDI_TILE_VER = 0x0008,
1533 SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR = 0x0010,
1534 SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT = 0x0020,
1535 SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT = 0x0040,
1536 SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP = 0x0080,
1537 SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM = 0x0100
1538 }
1539 TSG_UI_Window_Arrange;
1540
1541 //---------------------------------------------------------
1542 typedef enum
1543 {
1544 CALLBACK_PROCESS_GET_OKAY,
1545 CALLBACK_PROCESS_SET_OKAY,
1546 CALLBACK_PROCESS_SET_BUSY,
1547 CALLBACK_PROCESS_SET_PROGRESS,
1548 CALLBACK_PROCESS_SET_READY,
1549 CALLBACK_PROCESS_SET_TEXT,
1550
1551 CALLBACK_STOP_EXECUTION,
1552
1553 CALLBACK_DLG_MESSAGE,
1554 CALLBACK_DLG_CONTINUE,
1555 CALLBACK_DLG_ERROR,
1556 CALLBACK_DLG_INFO,
1557
1558 CALLBACK_DLG_PARAMETERS,
1559
1560 CALLBACK_MESSAGE_ADD,
1561 CALLBACK_MESSAGE_ADD_ERROR,
1562 CALLBACK_MESSAGE_ADD_EXECUTION,
1563
1564 CALLBACK_DATAOBJECT_ADD,
1565 CALLBACK_DATAOBJECT_UPDATE,
1566 CALLBACK_DATAOBJECT_SHOW,
1567 CALLBACK_DATAOBJECT_ASIMAGE,
1568
1569 CALLBACK_DATAOBJECT_COLORS_GET,
1570 CALLBACK_DATAOBJECT_COLORS_SET,
1571 CALLBACK_DATAOBJECT_PARAMS_GET,
1572 CALLBACK_DATAOBJECT_PARAMS_SET,
1573
1574 CALLBACK_SET_MAP_EXTENT,
1575
1576 CALLBACK_DIAGRAM_SHOW,
1577
1578 CALLBACK_DATABASE_UPDATE,
1579
1580 CALLBACK_WINDOW_ARRANGE,
1581
1582 CALLBACK_GET_APP_WINDOW,
1583 CALLBACK_GET_APP_PATH
1584 }
1585 TSG_UI_Callback_ID;
1586
1587 //---------------------------------------------------------
1588 class SAGA_API_DLL_EXPORT CSG_UI_Parameter
1589 {
1590 public:
1591 CSG_UI_Parameter(void) : Boolean(false), Number( 0. ), Pointer(NULL) {}
1592 CSG_UI_Parameter(bool Value) : Boolean(Value), Number( 0. ), Pointer(NULL) {}
1593 CSG_UI_Parameter(int Value) : Boolean(false), Number(Value), Pointer(NULL) {}
1594 CSG_UI_Parameter(double Value) : Boolean(false), Number(Value), Pointer(NULL) {}
1595 CSG_UI_Parameter(const CSG_String &Value) : Boolean(false), Number( 0. ), Pointer(NULL), String(Value) {}
1596 CSG_UI_Parameter(void *Value) : Boolean(false), Number( 0. ), Pointer(Value) {}
1597 CSG_UI_Parameter(const CSG_UI_Parameter &Copy);
1598
1599 bool Boolean;
1600
1601 double Number;
1602
1603 void *Pointer;
1604
1605 CSG_String String;
1606
1607 };
1608
1609 //---------------------------------------------------------
1610 typedef int (* TSG_PFNC_UI_Callback) (TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2);
1611
1612 //---------------------------------------------------------
1613 SAGA_API_DLL_EXPORT bool SG_Set_UI_Callback (TSG_PFNC_UI_Callback Function);
1614 SAGA_API_DLL_EXPORT TSG_PFNC_UI_Callback SG_Get_UI_Callback (void);
1615
1616 //---------------------------------------------------------
1617 SAGA_API_DLL_EXPORT void SG_UI_Console_Set_UTF8 (bool bOn);
1618 SAGA_API_DLL_EXPORT bool SG_UI_Console_Get_UTF8 (void);
1619
1620 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const char *Text, SG_Char End = '\n', bool bFlush = true);
1621 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const wchar_t *Text, SG_Char End = '\n', bool bFlush = true);
1622 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const CSG_String &Text, SG_Char End = '\n', bool bFlush = true);
1623 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const char *Text, SG_Char End = '\n', bool bFlush = true);
1624 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const wchar_t *Text, SG_Char End = '\n', bool bFlush = true);
1625 SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const CSG_String &Text, SG_Char End = '\n', bool bFlush = true);
1626
1627 //---------------------------------------------------------
1628 SAGA_API_DLL_EXPORT int SG_UI_Progress_Lock (bool bOn);
1629 SAGA_API_DLL_EXPORT int SG_UI_Progress_Reset (void);
1630 SAGA_API_DLL_EXPORT bool SG_UI_Process_Get_Okay (bool bBlink = false);
1631 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Okay (bool bOkay = true);
1632 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Busy (bool bOn = true, const CSG_String &Message = "");
1633 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress (int Position, int Range);
1634 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress (sLong Position, sLong Range);
1635 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress (double Position, double Range);
1636 SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Ready (void);
1637 SAGA_API_DLL_EXPORT void SG_UI_Process_Set_Text (const CSG_String &Text);
1638
1639 SAGA_API_DLL_EXPORT bool SG_UI_Stop_Execution (bool bDialog);
1640
1641 SAGA_API_DLL_EXPORT void SG_UI_Dlg_Message (const CSG_String &Message, const CSG_String &Caption);
1642 SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Continue (const CSG_String &Message, const CSG_String &Caption);
1643 SAGA_API_DLL_EXPORT int SG_UI_Dlg_Error (const CSG_String &Message, const CSG_String &Caption);
1644 SAGA_API_DLL_EXPORT void SG_UI_Dlg_Info (const CSG_String &Message, const CSG_String &Caption);
1645 SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Parameters (class CSG_Parameters *pParameters, const CSG_String &Caption);
1646
1647 SAGA_API_DLL_EXPORT int SG_UI_Msg_Lock (bool bOn);
1648 SAGA_API_DLL_EXPORT int SG_UI_Msg_Reset (void);
1649 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const char *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1650 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const wchar_t *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1651 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const CSG_String &Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1652 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const char *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1653 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const wchar_t *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1654 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const CSG_String &Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1655 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error (const char *Message);
1656 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error (const wchar_t *Message);
1657 SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error (const CSG_String &Message);
1658 SAGA_API_DLL_EXPORT void SG_UI_Msg_Flush (void);
1659
1660 SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Lock (bool bOn);
1661 SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Reset (void);
1662
1663 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Add (class CSG_Data_Object *pDataObject, int Show);
1664 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Update (class CSG_Data_Object *pDataObject, int Show, class CSG_Parameters *pParameters);
1665 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Show (class CSG_Data_Object *pDataObject, int Show);
1666 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_asImage (class CSG_Data_Object *pDataObject, class CSG_Grid *pGrid);
1667
1668 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Get (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors);
1669 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Set (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors);
1670 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Get (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters);
1671 SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Set (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters);
1672
1673 SAGA_API_DLL_EXPORT bool SG_UI_Set_Map_Extent (double xMin, double yMin, double xMax, double yMax, int Maps = SG_UI_MAP_ACTIVE);
1674
1675 SAGA_API_DLL_EXPORT bool SG_UI_Diagram_Show (class CSG_Table *pTable, class CSG_Parameters *pParameters);
1676
1677 SAGA_API_DLL_EXPORT bool SG_UI_ODBC_Update (const CSG_String &Server);
1678
1679 SAGA_API_DLL_EXPORT int SG_UI_Window_Arrange (int Arrange);
1680
1681 SAGA_API_DLL_EXPORT void * SG_UI_Get_Window_Main (void);
1682 SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_Application_Path (bool bPathOnly = false);
1683
1684
1686 // //
1687 // Environment //
1688 // //
1690
1691 //---------------------------------------------------------
1692 SAGA_API_DLL_EXPORT bool SG_Initialize_Environment (bool bLibraries = true, bool bProjections = true, const SG_Char *Directory = NULL, bool bInitializeWX = true);
1693 SAGA_API_DLL_EXPORT bool SG_Uninitialize_Environment (void);
1694
1695
1697 // //
1698 // //
1699 // //
1701
1702 //---------------------------------------------------------
1703 #endif // #ifndef HEADER_INCLUDED__SAGA_API__api_core_H
SG_Data_Type_Range_Check
SAGA_API_DLL_EXPORT bool SG_Data_Type_Range_Check(TSG_Data_Type Type, double &Value)
Definition: api_core.cpp:223
CSG_Array_Int::Get_Array
int * Get_Array(sLong nValues)
Definition: api_core.h:438
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Bytes_Array::Get_Count
int Get_Count(void) const
Definition: api_core.h:899
SG_TOKEN_DEFAULT
@ SG_TOKEN_DEFAULT
Definition: api_core.h:744
CSG_Array_sLong::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:494
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
SG_TOKEN_INVALID
@ SG_TOKEN_INVALID
Definition: api_core.h:743
SG_UI_Dlg_Continue
SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:380
SG_UI_WINDOW_ARRANGE_MDI_CASCADE
@ SG_UI_WINDOW_ARRANGE_MDI_CASCADE
Definition: api_core.h:1529
SG_File_Get_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
CSG_Translator
Definition: api_core.h:1424
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_Bytes::Read_DWord
DWORD Read_DWord(bool bSwapBytes=false)
Definition: api_core.h:871
CSG_Array_sLong::Get
sLong & Get(sLong Index)
Definition: api_core.h:501
SG_GET_RGB
#define SG_GET_RGB(r, g, b)
Definition: api_core.h:1253
SG_COLORS_RED_BLUE_GREEN
@ SG_COLORS_RED_BLUE_GREEN
Definition: api_core.h:1305
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Buffer::Set_Value
void Set_Value(int Offset, int Value, bool bBigEndian=false)
Definition: api_core.h:264
CSG_Array_sLong::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:495
CSG_Bytes::asWord
WORD asWord(int i, bool bSwapBytes=false) const
Definition: api_core.h:860
CSG_Array_Int::Get
int & Get(sLong Index)
Definition: api_core.h:447
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Array::Get_Growth
TSG_Array_Growth Get_Growth(void) const
Definition: api_core.h:324
CSG_Buffer::Set_Value
void Set_Value(int Offset, short Value, bool bBigEndian=false)
Definition: api_core.h:263
SG_UI_Process_Set_Ready
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_UI_Msg_Add_Execution
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
Definition: api_callback.cpp:517
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(bool Value)
Definition: api_core.h:1592
CSG_Bytes::asFloat
float asFloat(int i, bool bSwapBytes=false) const
Definition: api_core.h:863
CALLBACK_DLG_CONTINUE
@ CALLBACK_DLG_CONTINUE
Definition: api_core.h:1554
CALLBACK_PROCESS_SET_BUSY
@ CALLBACK_PROCESS_SET_BUSY
Definition: api_core.h:1546
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
SG_Dir_List_Subdirectories
SAGA_API_DLL_EXPORT bool SG_Dir_List_Subdirectories(CSG_Strings &List, const CSG_String &Directory)
Definition: api_file.cpp:771
CSG_Bytes::Read_Int
int Read_Int(bool bSwapBytes=false)
Definition: api_core.h:870
SG_DATATYPE_Binary
@ SG_DATATYPE_Binary
Definition: api_core.h:1000
CSG_Array::Get_Array
void * Get_Array(sLong nValues)
Definition: api_core.h:337
SG_GET_B
#define SG_GET_B(rgb)
Definition: api_core.h:1258
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
SG_Data_Type_Get_Type
SAGA_API_DLL_EXPORT TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
Definition: api_core.cpp:152
CALLBACK_DATAOBJECT_COLORS_GET
@ CALLBACK_DATAOBJECT_COLORS_GET
Definition: api_core.h:1569
SG_Swap_Bytes
SAGA_API_DLL_EXPORT void SG_Swap_Bytes(void *Buffer, int nBytes)
Definition: api_memory.cpp:154
CSG_Array_Pointer::Get_Array
void ** Get_Array(sLong nValues)
Definition: api_core.h:385
CSG_File::Get_Stream
class wxStreamBase * Get_Stream(void) const
Definition: api_core.h:1130
CSG_Buffer::Add_Value
void Add_Value(float Value, bool bBigEndian=false)
Definition: api_core.h:253
CSG_Array_sLong::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:489
CSG_File::m_FileName
CSG_String m_FileName
Definition: api_core.h:1177
CSG_Translator::Get_Text
const SG_Char * Get_Text(int i) const
Definition: api_core.h:1440
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(void)
Definition: api_core.h:1591
CSG_Stack::Get_RecordSize
size_t Get_RecordSize(void) const
Definition: api_core.h:934
CSG_Strings::Del
bool Del(int Index)
Definition: api_core.h:713
SG_COLORS_GREEN_BLUE
@ SG_COLORS_GREEN_BLUE
Definition: api_core.h:1300
ESG_File_Flags_Open
ESG_File_Flags_Open
Definition: api_core.h:1100
CSG_Bytes::asByte
BYTE asByte(int i) const
Definition: api_core.h:857
CALLBACK_STOP_EXECUTION
@ CALLBACK_STOP_EXECUTION
Definition: api_core.h:1551
SG_Degree_To_Double
SAGA_API_DLL_EXPORT double SG_Degree_To_Double(const CSG_String &String)
Definition: api_string.cpp:1240
SG_TOKEN_RET_EMPTY_ALL
@ SG_TOKEN_RET_EMPTY_ALL
Definition: api_core.h:746
SG_Dir_Exists
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
Definition: api_file.cpp:727
A
#define A
SG_UI_DataObject_Params_Get
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Get(class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
Definition: api_callback.cpp:684
CALLBACK_DIAGRAM_SHOW
@ CALLBACK_DIAGRAM_SHOW
Definition: api_core.h:1576
SG_COLORS_RED_GREY_BLUE
@ SG_COLORS_RED_GREY_BLUE
Definition: api_core.h:1301
SG_UI_Console_Get_UTF8
SAGA_API_DLL_EXPORT bool SG_UI_Console_Get_UTF8(void)
Definition: api_callback.cpp:74
SG_UI_MSG_STYLE_NORMAL
@ SG_UI_MSG_STYLE_NORMAL
Definition: api_core.h:1493
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_Colors::Get_Blue
long Get_Blue(int Index) const
Definition: api_core.h:1360
SG_UI_MAP_LAST
@ SG_UI_MAP_LAST
Definition: api_core.h:1521
CSG_Stack::Get_Record_Pop
void * Get_Record_Pop(void)
Definition: api_core.h:955
CSG_Stack
Definition: api_core.h:923
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CALLBACK_DLG_INFO
@ CALLBACK_DLG_INFO
Definition: api_core.h:1556
CSG_Bytes::Get_Count
int Get_Count(void) const
Definition: api_core.h:823
TSG_File_Type
TSG_File_Type
Definition: api_core.h:1092
CALLBACK_DATABASE_UPDATE
@ CALLBACK_DATABASE_UPDATE
Definition: api_core.h:1578
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Bytes::Read_Word
WORD Read_Word(bool bSwapBytes=false)
Definition: api_core.h:869
SG_COLORS_BLACK_BLUE
@ SG_COLORS_BLACK_BLUE
Definition: api_core.h:1290
SG_UI_DATAOBJECT_SHOW_MAP_LAST
@ SG_UI_DATAOBJECT_SHOW_MAP_LAST
Definition: api_core.h:1513
SG_UI_ODBC_Update
SAGA_API_DLL_EXPORT bool SG_UI_ODBC_Update(const CSG_String &Server)
Definition: api_callback.cpp:736
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Strings::Ins
bool Ins(const CSG_String &String, int Index)
Definition: api_core.h:711
SG_UI_Msg_Lock
SAGA_API_DLL_EXPORT int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_Array_Int::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:434
CSG_File_Zip::Get_File_Type
virtual TSG_File_Type Get_File_Type(void) const
Definition: api_core.h:1199
SG_UI_DATAOBJECT_SHOW_MAP_NEW
@ SG_UI_DATAOBJECT_SHOW_MAP_NEW
Definition: api_core.h:1512
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM
Definition: api_core.h:1537
SG_DEFAULT_DELIMITERS
#define SG_DEFAULT_DELIMITERS
Definition: api_core.h:739
SG_Data_Type_Get_Size
size_t SG_Data_Type_Get_Size(TSG_Data_Type Type)
Definition: api_core.h:1052
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
SG_UI_Stop_Execution
SAGA_API_DLL_EXPORT bool SG_UI_Stop_Execution(bool bDialog)
Definition: api_callback.cpp:342
CSG_File::Get_Encoding
int Get_Encoding(void) const
Definition: api_core.h:1133
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT
Definition: api_core.h:1534
SG_Get_UI_Callback
SAGA_API_DLL_EXPORT TSG_PFNC_UI_Callback SG_Get_UI_Callback(void)
Definition: api_callback.cpp:145
CSG_Buffer::asDouble
double asDouble(int Offset, bool bBigEndian=false) const
Definition: api_core.h:271
SG_Translate
SAGA_API_DLL_EXPORT const SG_Char * SG_Translate(const CSG_String &Text)
Definition: api_translator.cpp:93
SG_Color_To_Text
SAGA_API_DLL_EXPORT CSG_String SG_Color_To_Text(long Color, bool bHexadecimal=true)
Definition: api_colors.cpp:138
SG_UI_Dlg_Message
SAGA_API_DLL_EXPORT void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:362
SG_UI_Get_Window_Main
SAGA_API_DLL_EXPORT void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:771
SG_Dir_Get_Temp
SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Temp(void)
Definition: api_file.cpp:763
SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR
@ SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR
Definition: api_core.h:1531
SG_COLORS_TOPOGRAPHY
@ SG_COLORS_TOPOGRAPHY
Definition: api_core.h:1309
SG_FILE_ENCODING_UTF32BE
@ SG_FILE_ENCODING_UTF32BE
Definition: api_core.h:550
CALLBACK_PROCESS_SET_OKAY
@ CALLBACK_PROCESS_SET_OKAY
Definition: api_core.h:1545
SG_FILE_TYPE_NORMAL
@ SG_FILE_TYPE_NORMAL
Definition: api_core.h:1093
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(const CSG_String &Value)
Definition: api_core.h:1595
CALLBACK_PROCESS_SET_PROGRESS
@ CALLBACK_PROCESS_SET_PROGRESS
Definition: api_core.h:1547
SG_COLORS_WHITE_GREEN
@ SG_COLORS_WHITE_GREEN
Definition: api_core.h:1292
CSG_Bytes::Get_Byte
BYTE Get_Byte(int i) const
Definition: api_core.h:829
SG_COLORS_RAINBOW
@ SG_COLORS_RAINBOW
Definition: api_core.h:1307
CSG_Buffer::Set_Value
void Set_Value(int Offset, char Value, bool bBigEndian=false)
Definition: api_core.h:262
SG_COLORS_BLACK_RED
@ SG_COLORS_BLACK_RED
Definition: api_core.h:1288
CSG_Array_Int::Get_Array
int * Get_Array(void) const
Definition: api_core.h:437
SG_UI_Console_Print_StdOut
SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End='\n', bool bFlush=true)
Definition: api_callback.cpp:77
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
SG_UI_DataObject_asImage
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_asImage(class CSG_Data_Object *pDataObject, class CSG_Grid *pGrid)
Definition: api_callback.cpp:645
SG_Mem_Set_Double
SAGA_API_DLL_EXPORT void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
Definition: api_memory.cpp:212
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_File::m_Mode
int m_Mode
Definition: api_core.h:1175
SG_is_Character_Numeric
SAGA_API_DLL_EXPORT bool SG_is_Character_Numeric(int Character)
Definition: api_string.cpp:1150
CALLBACK_GET_APP_PATH
@ CALLBACK_GET_APP_PATH
Definition: api_core.h:1583
SG_UI_WINDOW_ARRANGE_TDI_TILE_VER
@ SG_UI_WINDOW_ARRANGE_TDI_TILE_VER
Definition: api_core.h:1532
SG_Uninitialize_Environment
SAGA_API_DLL_EXPORT bool SG_Uninitialize_Environment(void)
Definition: api_core.cpp:533
CSG_Colors::Get_Red
long Get_Red(int Index) const
Definition: api_core.h:1358
TSG_UI_DataObject_Update
TSG_UI_DataObject_Update
Definition: api_core.h:1508
SG_COLORS_ASPECT_2
@ SG_COLORS_ASPECT_2
Definition: api_core.h:1314
CSG_Array_Int::Set
bool Set(sLong Index, int Value)
Definition: api_core.h:446
CSG_Array_sLong::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:488
SG_FILE_END
@ SG_FILE_END
Definition: api_core.h:1111
CSG_Array_Int::Get
int Get(sLong Index) const
Definition: api_core.h:448
CSG_Bytes::asShort
short asShort(int i, bool bSwapBytes=false) const
Definition: api_core.h:859
SG_UI_Process_Set_Busy
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Busy(bool bOn=true, const CSG_String &Message="")
Definition: api_callback.cpp:236
CSG_Array_Int::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:440
CSG_UI_Parameter::String
CSG_String String
Definition: api_core.h:1605
CSG_Array_Pointer::Get
void * Get(sLong Index) const
Definition: api_core.h:395
CSG_Array_sLong::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:496
SG_Dir_Get_Current
SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Current(void)
Definition: api_file.cpp:755
SG_UI_MSG_STYLE_02
@ SG_UI_MSG_STYLE_02
Definition: api_core.h:1501
CSG_Stack::Get_Record
void * Get_Record(size_t i) const
Definition: api_core.h:945
CSG_Array_Pointer::Set_Growth
bool Set_Growth(TSG_Array_Growth Growth)
Definition: api_core.h:378
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
CSG_File
Definition: api_core.h:1116
CSG_Array_Int::Get_Growth
TSG_Array_Growth Get_Growth(void) const
Definition: api_core.h:432
SG_UI_Process_Set_Text
SAGA_API_DLL_EXPORT void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
SG_FILE_ENCODING_UTF7
@ SG_FILE_ENCODING_UTF7
Definition: api_core.h:545
SG_UI_Dlg_Parameters
SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Parameters(class CSG_Parameters *pParameters, const CSG_String &Caption)
Definition: api_callback.cpp:442
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(int Value)
Definition: api_core.h:1593
SG_Set_Environment
SAGA_API_DLL_EXPORT bool SG_Set_Environment(const CSG_String &Variable, const CSG_String &Value)
Definition: api_file.cpp:988
CSG_Bytes::Get_Bytes
CSG_Bytes Get_Bytes(int i) const
Definition: api_core.h:826
SG_GET_R
#define SG_GET_R(rgb)
Definition: api_core.h:1256
SG_COLORS_NEON
@ SG_COLORS_NEON
Definition: api_core.h:1308
SG_Get_Environment
SAGA_API_DLL_EXPORT bool SG_Get_Environment(const CSG_String &Variable, CSG_String *Value=NULL)
Definition: api_file.cpp:968
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1509
SG_FILE_RW
@ SG_FILE_RW
Definition: api_core.h:1103
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
SG_COLORS_YELLOW_BLUE
@ SG_COLORS_YELLOW_BLUE
Definition: api_core.h:1296
SG_Data_Type_is_Numeric
SAGA_API_DLL_EXPORT bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
Definition: api_core.cpp:197
CSG_Bytes::Rewind
void Rewind(void)
Definition: api_core.h:820
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
SG_COLORS_BLACK_WHITE
@ SG_COLORS_BLACK_WHITE
Definition: api_core.h:1287
SG_COLORS_YELLOW_RED
@ SG_COLORS_YELLOW_RED
Definition: api_core.h:1294
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Array_Int::CSG_Array_Int
CSG_Array_Int(const CSG_Array_Int &Array)
Definition: api_core.h:423
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Colors::Get_Count
int Get_Count(void) const
Definition: api_core.h:1345
CSG_Buffer::Add_Value
void Add_Value(int Value, bool bBigEndian=false)
Definition: api_core.h:252
CSG_Bytes::Add
bool Add(float Value, bool bSwapBytes=false)
Definition: api_core.h:852
SG_UI_Dlg_Error
SAGA_API_DLL_EXPORT int SG_UI_Dlg_Error(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:396
CSG_Buffer
Definition: api_core.h:224
TSG_PFNC_UI_Callback
int(* TSG_PFNC_UI_Callback)(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)
Definition: api_core.h:1610
SG_COLORS_YELLOW_GREEN
@ SG_COLORS_YELLOW_GREEN
Definition: api_core.h:1295
SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE
@ SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE
Definition: api_core.h:1511
SG_UI_Process_Set_Okay
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Okay(bool bOkay=true)
Definition: api_callback.cpp:223
CSG_Buffer::asInt
int asInt(int Offset, bool bBigEndian=false) const
Definition: api_core.h:269
CSG_Array_sLong::Get
sLong Get(sLong Index) const
Definition: api_core.h:502
SG_UI_MSG_STYLE_SMALL
@ SG_UI_MSG_STYLE_SMALL
Definition: api_core.h:1499
CSG_Data_Object
Definition: dataobject.h:180
SG_File_Get_Path_Relative
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Relative(const CSG_String &Directory, const CSG_String &full_Path)
Definition: api_file.cpp:893
CSG_Colors::Set_Palette
bool Set_Palette(int Index, bool bRevert=false, int nColors=11)
Definition: api_core.h:1380
ESG_Colors
ESG_Colors
Definition: api_core.h:1284
CSG_Buffer::Set_Value
void Set_Value(int Offset, float Value, bool bBigEndian=false)
Definition: api_core.h:265
CSG_Array_Int::CSG_Array_Int
CSG_Array_Int(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition: api_core.h:426
CSG_Array_sLong::CSG_Array_sLong
CSG_Array_sLong(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition: api_core.h:480
CALLBACK_SET_MAP_EXTENT
@ CALLBACK_SET_MAP_EXTENT
Definition: api_core.h:1574
CSG_Translator::is_CaseSensitive
bool is_CaseSensitive(void) const
Definition: api_core.h:1437
SG_UI_MAP_ALL
@ SG_UI_MAP_ALL
Definition: api_core.h:1522
SG_FILE_ENCODING_UNDEFINED
@ SG_FILE_ENCODING_UNDEFINED
Definition: api_core.h:551
CSG_Stack::CSG_Stack
CSG_Stack(size_t RecordSize)
Definition: api_core.h:925
SG_Dir_Create
SAGA_API_DLL_EXPORT bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath=false)
Definition: api_file.cpp:733
CSG_Colors::Get_Color
long Get_Color(int Index) const
Definition: api_core.h:1357
CSG_Array_Int::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:442
CALLBACK_DATAOBJECT_UPDATE
@ CALLBACK_DATAOBJECT_UPDATE
Definition: api_core.h:1565
SG_GET_G
#define SG_GET_G(rgb)
Definition: api_core.h:1257
SG_COLORS_DEFAULT
@ SG_COLORS_DEFAULT
Definition: api_core.h:1285
CSG_Strings::m_Strings
CSG_Array_Pointer m_Strings
Definition: api_core.h:734
CSG_Strings::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:707
CALLBACK_DLG_PARAMETERS
@ CALLBACK_DLG_PARAMETERS
Definition: api_core.h:1558
SG_OMP_Get_Thread_Num
SAGA_API_DLL_EXPORT int SG_OMP_Get_Thread_Num(void)
Definition: api_core.cpp:111
CSG_Array_Pointer::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:382
SG_UI_Progress_Lock
SAGA_API_DLL_EXPORT int SG_UI_Progress_Lock(bool bOn)
Definition: api_callback.cpp:176
CALLBACK_PROCESS_SET_READY
@ CALLBACK_PROCESS_SET_READY
Definition: api_core.h:1548
SG_TOKEN_RET_EMPTY
@ SG_TOKEN_RET_EMPTY
Definition: api_core.h:745
CSG_Array_Int::Set_Growth
bool Set_Growth(TSG_Array_Growth Growth)
Definition: api_core.h:431
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
SG_UI_Get_Application_Path
SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_Application_Path(bool bPathOnly=false)
Definition: api_callback.cpp:786
SG_UI_Process_Set_Progress
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SG_UI_MAP_ACTIVE
@ SG_UI_MAP_ACTIVE
Definition: api_core.h:1520
CSG_Bytes::Read_Byte
BYTE Read_Byte(void)
Definition: api_core.h:866
CSG_File_Zip::Get_File_Count
size_t Get_File_Count(void)
Definition: api_core.h:1204
CSG_Array_sLong::Get_Growth
TSG_Array_Growth Get_Growth(void) const
Definition: api_core.h:486
SG_UI_DataObject_Colors_Get
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Get(class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
Definition: api_callback.cpp:658
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
CSG_Array_sLong::Destroy
void Destroy(void)
Definition: api_core.h:483
SG_COLORS_ASPECT_1
@ SG_COLORS_ASPECT_1
Definition: api_core.h:1313
SG_Get_CurrentTimeStr
SAGA_API_DLL_EXPORT CSG_String SG_Get_CurrentTimeStr(bool bWithDate=true)
Definition: api_string.cpp:1184
CALLBACK_DATAOBJECT_ADD
@ CALLBACK_DATAOBJECT_ADD
Definition: api_core.h:1564
sLong
signed long long sLong
Definition: api_core.h:158
CALLBACK_DATAOBJECT_SHOW
@ CALLBACK_DATAOBJECT_SHOW
Definition: api_core.h:1566
CSG_UI_Parameter::Number
double Number
Definition: api_core.h:1601
TSG_UI_Window_Arrange
TSG_UI_Window_Arrange
Definition: api_core.h:1528
SG_COLORS_WHITE_BLUE
@ SG_COLORS_WHITE_BLUE
Definition: api_core.h:1293
CSG_Array_Pointer::CSG_Array_Pointer
CSG_Array_Pointer(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition: api_core.h:373
CSG_Bytes::Add
bool Add(short Value, bool bSwapBytes=false)
Definition: api_core.h:844
CSG_Array_Pointer::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:389
SG_UI_MSG_STYLE_03
@ SG_UI_MSG_STYLE_03
Definition: api_core.h:1502
SG_UI_Progress_Reset
SAGA_API_DLL_EXPORT int SG_UI_Progress_Reset(void)
Definition: api_callback.cpp:191
CSG_Stack::Clear
bool Clear(bool bFreeMemory=false)
Definition: api_core.h:937
SG_Set_UI_Callback
SAGA_API_DLL_EXPORT bool SG_Set_UI_Callback(TSG_PFNC_UI_Callback Function)
Definition: api_callback.cpp:137
CSG_Colors::Get_Interpolated
long Get_Interpolated(double Index) const
Definition: api_core.h:1363
SG_Dir_Delete
SAGA_API_DLL_EXPORT bool SG_Dir_Delete(const CSG_String &Directory, bool bRecursive=false)
Definition: api_file.cpp:744
SG_COLORS_GREEN_RED
@ SG_COLORS_GREEN_RED
Definition: api_core.h:1297
CSG_Buffer::Inc_Size
bool Inc_Size(size_t Size)
Definition: api_core.h:240
SG_Get_Translator
SAGA_API_DLL_EXPORT CSG_Translator & SG_Get_Translator(void)
Definition: api_translator.cpp:80
SG_FILE_ENCODING_UTF32LE
@ SG_FILE_ENCODING_UTF32LE
Definition: api_core.h:549
CSG_Buffer::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:241
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
SG_Mem_Get_Int
SAGA_API_DLL_EXPORT int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
Definition: api_memory.cpp:177
CSG_File_Zip::m_Files
CSG_Array_Pointer m_Files
Definition: api_core.h:1213
SG_Get_Significant_Decimals
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
Definition: api_string.cpp:1274
CALLBACK_DATAOBJECT_PARAMS_SET
@ CALLBACK_DATAOBJECT_PARAMS_SET
Definition: api_core.h:1572
SG_String_Tokenize
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1493
SG_COLORS_DEFAULT_BRIGHT
@ SG_COLORS_DEFAULT_BRIGHT
Definition: api_core.h:1286
CSG_Translator::Get_Translation
const SG_Char * Get_Translation(int i) const
Definition: api_core.h:1441
CSG_Array_Int
Definition: api_core.h:421
SG_OMP_Set_Max_Num_Threads
SAGA_API_DLL_EXPORT void SG_OMP_Set_Max_Num_Threads(int iCores)
Definition: api_core.cpp:108
CALLBACK_DLG_ERROR
@ CALLBACK_DLG_ERROR
Definition: api_core.h:1555
CSG_UI_Parameter::Pointer
void * Pointer
Definition: api_core.h:1603
CSG_Bytes::Get_Bytes
BYTE * Get_Bytes(void) const
Definition: api_core.h:824
SG_FILE_CURRENT
@ SG_FILE_CURRENT
Definition: api_core.h:1110
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(double Value)
Definition: api_core.h:1594
CSG_Bytes::asDouble
double asDouble(int i, bool bSwapBytes=false) const
Definition: api_core.h:864
SG_UI_Window_Arrange
SAGA_API_DLL_EXPORT int SG_UI_Window_Arrange(int Arrange)
Definition: api_callback.cpp:756
CSG_Stack::Get_Record_Push
void * Get_Record_Push(void)
Definition: api_core.h:950
CSG_Bytes::Add
bool Add(DWORD Value, bool bSwapBytes=false)
Definition: api_core.h:850
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_File::Close
virtual bool Close(void)
Definition: api_file.cpp:154
CSG_Bytes::Add
bool Add(BYTE Value)
Definition: api_core.h:840
CSG_Array_sLong::Set
bool Set(sLong Index, sLong Value)
Definition: api_core.h:500
CSG_Array::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:328
SG_File_Get_Extension
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &FileName)
Definition: api_file.cpp:953
SG_UI_MSG_STYLE_BOLD
@ SG_UI_MSG_STYLE_BOLD
Definition: api_core.h:1494
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CALLBACK_MESSAGE_ADD_EXECUTION
@ CALLBACK_MESSAGE_ADD_EXECUTION
Definition: api_core.h:1562
CSG_Buffer::Add_Value
void Add_Value(char Value, bool bBigEndian=false)
Definition: api_core.h:250
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SG_UI_Msg_Flush
SAGA_API_DLL_EXPORT void SG_UI_Msg_Flush(void)
Definition: api_callback.cpp:564
CSG_Bytes::asChar
char asChar(int i) const
Definition: api_core.h:858
SG_UI_Dlg_Info
SAGA_API_DLL_EXPORT void SG_UI_Dlg_Info(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:417
CSG_Strings
Definition: api_core.h:693
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
SG_Data_Type_Get_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
Definition: api_core.cpp:146
SG_Color_Get_Random
SAGA_API_DLL_EXPORT long SG_Color_Get_Random(void)
Definition: api_colors.cpp:73
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1135
CSG_Array_Pointer::Set
bool Set(sLong Index, void *Value)
Definition: api_core.h:393
CSG_Strings::Assign
bool Assign(const CSG_Strings &Strings)
Definition: api_core.h:729
CSG_Bytes_Array
Definition: api_core.h:892
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
TSG_File_Flags_Encoding
TSG_File_Flags_Encoding
Definition: api_core.h:543
CSG_Strings::Set_Count
bool Set_Count(int Count)
Definition: api_core.h:704
SG_UI_ProgressAndMsg_Lock
SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
SG_UI_Set_Map_Extent
SAGA_API_DLL_EXPORT bool SG_UI_Set_Map_Extent(double xMin, double yMin, double xMax, double yMax, int Maps=SG_UI_MAP_ACTIVE)
Definition: api_callback.cpp:710
CALLBACK_PROCESS_SET_TEXT
@ CALLBACK_PROCESS_SET_TEXT
Definition: api_core.h:1549
CSG_UI_Parameter
Definition: api_core.h:1589
CSG_Bytes
Definition: api_core.h:804
SG_COLORS_BLACK_GREEN
@ SG_COLORS_BLACK_GREEN
Definition: api_core.h:1289
SG_UI_ProgressAndMsg_Reset
SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Reset(void)
Definition: api_callback.cpp:584
SG_Dir_List_Files
SAGA_API_DLL_EXPORT bool SG_Dir_List_Files(CSG_Strings &List, const CSG_String &Directory)
Definition: api_file.cpp:795
CSG_Array_Pointer::CSG_Array_Pointer
CSG_Array_Pointer(const CSG_Array_Pointer &Array)
Definition: api_core.h:370
CSG_Strings::Get_String
CSG_String & Get_String(int Index) const
Definition: api_core.h:716
SG_COLORS_GREEN_GREY_BLUE
@ SG_COLORS_GREEN_GREY_BLUE
Definition: api_core.h:1303
SG_UI_DataObject_Add
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Add(class CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:598
CSG_Stack::Destroy
bool Destroy(void)
Definition: api_core.h:932
CSG_Array_sLong::Set_Growth
bool Set_Growth(TSG_Array_Growth Growth)
Definition: api_core.h:485
SG_FILE_ENCODING_UTF16LE
@ SG_FILE_ENCODING_UTF16LE
Definition: api_core.h:547
SG_COLORS_TOPOGRAPHY_3
@ SG_COLORS_TOPOGRAPHY_3
Definition: api_core.h:1311
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
CSG_Table
Definition: table.h:283
SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR
@ SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR
Definition: api_core.h:1533
CALLBACK_MESSAGE_ADD_ERROR
@ CALLBACK_MESSAGE_ADD_ERROR
Definition: api_core.h:1561
CSG_Array_Int::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:441
SG_UI_MSG_STYLE_ITALIC
@ SG_UI_MSG_STYLE_ITALIC
Definition: api_core.h:1495
SG_Double_To_Degree
SAGA_API_DLL_EXPORT CSG_String SG_Double_To_Degree(double Value)
Definition: api_string.cpp:1210
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
SG_COLORS_ASPECT_3
@ SG_COLORS_ASPECT_3
Definition: api_core.h:1315
SG_COLORS_RED_GREY_GREEN
@ SG_COLORS_RED_GREY_GREEN
Definition: api_core.h:1302
SG_File_Get_Path_Absolute
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
Definition: api_file.cpp:883
ESG_File_Flags_Seek
ESG_File_Flags_Seek
Definition: api_core.h:1108
SG_TOKEN_STRTOK
@ SG_TOKEN_STRTOK
Definition: api_core.h:748
CSG_Bytes::asDWord
DWORD asDWord(int i, bool bSwapBytes=false) const
Definition: api_core.h:862
SG_UI_Console_Print_StdErr
SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr(const char *Text, SG_Char End='\n', bool bFlush=true)
Definition: api_callback.cpp:102
CSG_Array_Pointer::Destroy
void Destroy(void)
Definition: api_core.h:376
CSG_Translator::Get_Count
int Get_Count(void) const
Definition: api_core.h:1439
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT
Definition: api_core.h:1535
CSG_Colors::Get_Brightness
long Get_Brightness(int Index) const
Definition: api_core.h:1361
CSG_Array
Definition: api_core.h:308
B
#define B
SG_UI_DATAOBJECT_SHOW_MAP
@ SG_UI_DATAOBJECT_SHOW_MAP
Definition: api_core.h:1510
CSG_String
Definition: api_core.h:557
CSG_Array_Pointer
Definition: api_core.h:368
SG_Data_Type_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort=false)
Definition: api_core.cpp:122
CSG_File::m_pStream
void * m_pStream
Definition: api_core.h:1179
SG_Color_From_Text
SAGA_API_DLL_EXPORT bool SG_Color_From_Text(const CSG_String &Text, long &Color)
Definition: api_colors.cpp:79
CSG_Array::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_memory.cpp:425
SG_UI_Msg_Add_Error
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Colors::Get_Green
long Get_Green(int Index) const
Definition: api_core.h:1359
CSG_Stack::~CSG_Stack
virtual ~CSG_Stack(void)
Definition: api_core.h:930
SG_Data_Type_Get_Flag
SAGA_API_DLL_EXPORT int SG_Data_Type_Get_Flag(TSG_Data_Type Type)
Definition: api_core.cpp:173
CALLBACK_GET_APP_WINDOW
@ CALLBACK_GET_APP_WINDOW
Definition: api_core.h:1582
CSG_Bytes::Add
bool Add(int Value, bool bSwapBytes=false)
Definition: api_core.h:848
SG_UI_Msg_Reset
SAGA_API_DLL_EXPORT int SG_UI_Msg_Reset(void)
Definition: api_callback.cpp:480
SG_FILE_ENCODING_UTF16BE
@ SG_FILE_ENCODING_UTF16BE
Definition: api_core.h:548
SG_Colors_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_Colors_Get_Name(int Index)
Definition: api_colors.cpp:67
CSG_Bytes::Add
bool Add(char Value)
Definition: api_core.h:842
SG_COLORS_COUNT
@ SG_COLORS_COUNT
Definition: api_core.h:1316
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
CALLBACK_WINDOW_ARRANGE
@ CALLBACK_WINDOW_ARRANGE
Definition: api_core.h:1580
SG_Flip_Decimal_Separators
SAGA_API_DLL_EXPORT void SG_Flip_Decimal_Separators(CSG_String &String)
Definition: api_string.cpp:1304
SG_TOKEN_RET_DELIMS
@ SG_TOKEN_RET_DELIMS
Definition: api_core.h:747
TSG_String_Tokenizer_Mode
TSG_String_Tokenizer_Mode
Definition: api_core.h:742
TSG_Array_Growth::SG_ARRAY_GROWTH_0
@ SG_ARRAY_GROWTH_0
CSG_Bytes::Read_Char
char Read_Char(void)
Definition: api_core.h:867
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
SG_COLORS_RED_BLUE
@ SG_COLORS_RED_BLUE
Definition: api_core.h:1299
CSG_Strings::Get_String
CSG_String & Get_String(size_t Index) const
Definition: api_core.h:717
CSG_Array_sLong::Get_Array
sLong * Get_Array(void) const
Definition: api_core.h:491
CALLBACK_MESSAGE_ADD
@ CALLBACK_MESSAGE_ADD
Definition: api_core.h:1560
CSG_UI_Parameter::CSG_UI_Parameter
CSG_UI_Parameter(void *Value)
Definition: api_core.h:1596
CSG_Stack::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:935
SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP
Definition: api_core.h:1536
TSG_UI_Maps
TSG_UI_Maps
Definition: api_core.h:1519
CSG_Bytes::Read_Float
float Read_Float(bool bSwapBytes=false)
Definition: api_core.h:872
CSG_Array_Pointer::Get_Growth
TSG_Array_Growth Get_Growth(void) const
Definition: api_core.h:379
CSG_Grid
Definition: grid.h:473
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Bytes::Add
bool Add(WORD Value, bool bSwapBytes=false)
Definition: api_core.h:846
CALLBACK_DATAOBJECT_PARAMS_GET
@ CALLBACK_DATAOBJECT_PARAMS_GET
Definition: api_core.h:1571
CSG_File::Get_File_Type
virtual TSG_File_Type Get_File_Type(void) const
Definition: api_core.h:1128
SG_COLORS_WHITE_RED
@ SG_COLORS_WHITE_RED
Definition: api_core.h:1291
SG_UI_DataObject_Colors_Set
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Set(class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
Definition: api_callback.cpp:671
SG_Mem_Set_Int
SAGA_API_DLL_EXPORT void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
Definition: api_memory.cpp:189
CSG_Array_sLong::CSG_Array_sLong
CSG_Array_sLong(const CSG_Array_sLong &Array)
Definition: api_core.h:477
CSG_Array_Pointer::Get
void *& Get(sLong Index)
Definition: api_core.h:394
SG_COLORS_RED_GREEN_BLUE
@ SG_COLORS_RED_GREEN_BLUE
Definition: api_core.h:1304
CSG_Buffer::Add_Value
void Add_Value(short Value, bool bBigEndian=false)
Definition: api_core.h:251
CALLBACK_PROCESS_GET_OKAY
@ CALLBACK_PROCESS_GET_OKAY
Definition: api_core.h:1544
CSG_String::m_pString
class wxString * m_pString
Definition: api_core.h:681
SG_UI_MSG_STYLE_01
@ SG_UI_MSG_STYLE_01
Definition: api_core.h:1500
CALLBACK_DLG_MESSAGE
@ CALLBACK_DLG_MESSAGE
Definition: api_core.h:1553
CSG_Buffer::asFloat
float asFloat(int Offset, bool bBigEndian=false) const
Definition: api_core.h:270
SG_UI_DataObject_Params_Set
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Set(class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
Definition: api_callback.cpp:697
CSG_Bytes::asInt
int asInt(int i, bool bSwapBytes=false) const
Definition: api_core.h:861
SG_File_Get_Name_Temp
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix)
Definition: api_file.cpp:846
SG_UI_WINDOW_ARRANGE_MDI_TILE_VER
@ SG_UI_WINDOW_ARRANGE_MDI_TILE_VER
Definition: api_core.h:1530
SG_UI_Process_Get_Okay
SAGA_API_DLL_EXPORT bool SG_UI_Process_Get_Okay(bool bBlink=false)
Definition: api_callback.cpp:201
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_OMP_Get_Max_Num_Threads
SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Threads(void)
Definition: api_core.cpp:109
SG_COLORS_PRECIPITATION
@ SG_COLORS_PRECIPITATION
Definition: api_core.h:1312
CSG_Bytes_Array::Get_Bytes
CSG_Bytes * Get_Bytes(int i)
Definition: api_core.h:900
CSG_Bytes::Read_Short
short Read_Short(bool bSwapBytes=false)
Definition: api_core.h:868
SG_Initialize_Environment
SAGA_API_DLL_EXPORT bool SG_Initialize_Environment(bool bLibraries=true, bool bProjections=true, const SG_Char *Directory=NULL, bool bInitializeWX=true)
Definition: api_core.cpp:392
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
TSG_UI_MSG_STYLE
TSG_UI_MSG_STYLE
Definition: api_core.h:1492
CSG_Bytes::is_EOF
bool is_EOF(void)
Definition: api_core.h:821
CSG_UI_Parameter::Boolean
bool Boolean
Definition: api_core.h:1599
CSG_Parameters
Definition: parameters.h:1650
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Array_sLong
Definition: api_core.h:475
CSG_Array_Int::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:435
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Buffer::Set_Value
void Set_Value(int Offset, double Value, bool bBigEndian=false)
Definition: api_core.h:266
SG_UI_MSG_STYLE_BIG
@ SG_UI_MSG_STYLE_BIG
Definition: api_core.h:1498
SG_FILE_START
@ SG_FILE_START
Definition: api_core.h:1109
SG_FILE_TYPE_ZIP
@ SG_FILE_TYPE_ZIP
Definition: api_core.h:1094
SG_OMP_Get_Max_Num_Procs
SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Procs(void)
Definition: api_core.cpp:110
SG_COLORS_RED_GREEN
@ SG_COLORS_RED_GREEN
Definition: api_core.h:1298
CSG_String_Tokenizer
Definition: api_core.h:754
SG_COLORS_GREEN_RED_BLUE
@ SG_COLORS_GREEN_RED_BLUE
Definition: api_core.h:1306
TSG_UI_Callback_ID
TSG_UI_Callback_ID
Definition: api_core.h:1543
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
CALLBACK_DATAOBJECT_ASIMAGE
@ CALLBACK_DATAOBJECT_ASIMAGE
Definition: api_core.h:1567
CSG_Bytes::Read_Double
double Read_Double(bool bSwapBytes=false)
Definition: api_core.h:873
CSG_Array_Int::Destroy
void Destroy(void)
Definition: api_core.h:429
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_Array_sLong::Get_Array
sLong * Get_Array(sLong nValues)
Definition: api_core.h:492
SG_Mem_Get_Double
SAGA_API_DLL_EXPORT double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
Definition: api_memory.cpp:200
uLong
unsigned long long uLong
Definition: api_core.h:159
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
SG_UI_DataObject_Show
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Show(class CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:632
SG_UI_Console_Set_UTF8
SAGA_API_DLL_EXPORT void SG_UI_Console_Set_UTF8(bool bOn)
Definition: api_callback.cpp:73
SG_UI_Msg_Add
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add(const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
Definition: api_callback.cpp:490
CSG_Bytes::Add
bool Add(double Value, bool bSwapBytes=false)
Definition: api_core.h:854
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
CSG_File_Zip
Definition: api_core.h:1188
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
CSG_Buffer::Add_Value
void Add_Value(double Value, bool bBigEndian=false)
Definition: api_core.h:254
CSG_File::Get_File_Name
virtual const CSG_String & Get_File_Name(void) const
Definition: api_core.h:1127
SG_COLORS_TOPOGRAPHY_2
@ SG_COLORS_TOPOGRAPHY_2
Definition: api_core.h:1310
CALLBACK_DATAOBJECT_COLORS_SET
@ CALLBACK_DATAOBJECT_COLORS_SET
Definition: api_core.h:1570
CSG_Colors
Definition: api_core.h:1329
SG_UI_DataObject_Update
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Update(class CSG_Data_Object *pDataObject, int Show, class CSG_Parameters *pParameters)
Definition: api_callback.cpp:611
SG_UI_Diagram_Show
SAGA_API_DLL_EXPORT bool SG_UI_Diagram_Show(class CSG_Table *pTable, class CSG_Parameters *pParameters)
Definition: api_callback.cpp:723
CSG_Buffer::asShort
short asShort(int Offset, bool bBigEndian=false) const
Definition: api_core.h:268
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_file.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
api_file.cpp File Reference
#include <wx/utils.h>
#include <wx/filename.h>
#include <wx/dir.h>
#include <wx/wxcrtvararg.h>
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <wx/txtstrm.h>
#include <wx/log.h>
#include <wx/version.h>
#include "api_core.h"

Go to the source code of this file.

Macros

#define | m_pStream_Base ((wxStreamBase *)m_pStream)
#define | m_pStream_I ((wxFFileInputStream *)m_pStream)
#define | m_pStream_O ((wxFFileOutputStream *)m_pStream)
#define | m_pStream_IO ((wxFFileStream *)m_pStream)

Functions

bool | SG_Dir_Exists (const CSG_String &Directory)
bool | SG_Dir_Create (const CSG_String &Directory, bool bFullPath)
bool | SG_Dir_Delete (const CSG_String &Directory, bool bRecursive)
CSG_String | SG_Dir_Get_Current (void)
CSG_String | SG_Dir_Get_Temp (void)
bool | SG_Dir_List_Subdirectories (CSG_Strings &List, const CSG_String &Directory)
bool | SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory)
bool | SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension)
bool | SG_File_Exists (const CSG_String &FileName)
bool | SG_File_Delete (const CSG_String &FileName)
CSG_String | SG_File_Get_Name_Temp (const CSG_String &Prefix)
CSG_String | SG_File_Get_Name_Temp (const CSG_String &Prefix, const CSG_String &Directory)
CSG_String | SG_File_Get_Name (const CSG_String &full_Path, bool bExtension)
CSG_String | SG_File_Get_Path (const CSG_String &full_Path)
CSG_String | SG_File_Get_Path_Absolute (const CSG_String &full_Path)
CSG_String | SG_File_Get_Path_Relative (const CSG_String &Directory, const CSG_String &full_Path)
CSG_String | SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name)
CSG_String | SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name, const CSG_String &Extension)
bool | SG_File_Cmp_Extension (const CSG_String &FileName, const CSG_String &Extension)
bool | SG_File_Set_Extension (CSG_String &FileName, const CSG_String &Extension)
CSG_String | SG_File_Get_Extension (const CSG_String &FileName)
bool | SG_Get_Environment (const CSG_String &Variable, CSG_String *Value)
bool | SG_Set_Environment (const CSG_String &Variable, const CSG_String &Value)

Macro Definition Documentation

◆ m_pStream_Base

#define m_pStream_Base ((wxStreamBase *)m_pStream)

Definition at line 73 of file api_file.cpp.

◆ m_pStream_I

#define m_pStream_I ((wxFFileInputStream *)m_pStream)

Definition at line 74 of file api_file.cpp.

◆ m_pStream_IO

#define m_pStream_IO ((wxFFileStream *)m_pStream)

Definition at line 76 of file api_file.cpp.

◆ m_pStream_O

#define m_pStream_O ((wxFFileOutputStream *)m_pStream)

Definition at line 75 of file api_file.cpp.

Function Documentation

◆ SG_Dir_Create()

bool SG_Dir_Create | ( | const CSG_String & | Directory,
 |  | bool | bFullPath
 | ) |  |

Definition at line 733 of file api_file.cpp.

References CSG_String::c_str(), and SG_Dir_Exists().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), and CSG_Tool_Library_Manager::Get_Summary().

◆ SG_Dir_Delete()

bool SG_Dir_Delete | ( | const CSG_String & | Directory,
 |  | bool | bRecursive
 | ) |  |

Definition at line 744 of file api_file.cpp.

References CSG_String::c_str(), and SG_Dir_Exists().

◆ SG_Dir_Exists()

bool SG_Dir_Exists ( const CSG_String & Directory )

Definition at line 727 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), SG_Dir_Create(), SG_Dir_Delete(), SG_File_Get_Name_Temp(), SG_Grid_Cache_Set_Directory(), and SG_Initialize_Environment().

◆ SG_Dir_Get_Current()

CSG_String SG_Dir_Get_Current ( void )

Definition at line 755 of file api_file.cpp.

◆ SG_Dir_Get_Temp()

CSG_String SG_Dir_Get_Temp ( void )

Definition at line 763 of file api_file.cpp.

◆ SG_Dir_List_Files() [1/2]

bool SG_Dir_List_Files | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 795 of file api_file.cpp.

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ SG_Dir_List_Files() [2/2]

bool SG_Dir_List_Files | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 800 of file api_file.cpp.

References CSG_String::c_str(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), CSG_String::is_Empty(), SG_File_Cmp_Extension(), and SG_File_Make_Path().

◆ SG_Dir_List_Subdirectories()

bool SG_Dir_List_Subdirectories | ( | CSG_Strings & | List,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 771 of file api_file.cpp.

References CSG_String::c_str(), CSG_Strings::Clear(), CSG_Strings::Get_Count(), and SG_File_Make_Path().

◆ SG_File_Cmp_Extension()

bool SG_File_Cmp_Extension | ( | const CSG_String & | FileName,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 928 of file api_file.cpp.

References SG_File_Get_Extension().

Referenced by CSG_Data_Manager::Add(), CSG_Tool_Library_Manager::Add_Library(), CSG_Grid_File_Info::Create(), CSG_Shapes::Create(), CSG_PointCloud::Get_Header_Content(), CSG_MetaData::Load(), CSG_Table::Load(), CSG_Table::Save(), CSG_Grid::Save(), CSG_Grids::Save(), CSG_PointCloud::Save(), CSG_Shapes::Save(), and SG_Dir_List_Files().

◆ SG_File_Delete()

bool SG_File_Delete ( const CSG_String & FileName )

Definition at line 840 of file api_file.cpp.

References CSG_String::c_str(), and SG_File_Exists().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Data_Object::Delete(), CSG_Grid::On_Delete(), CSG_Grids::On_Delete(), CSG_PointCloud::On_Delete(), CSG_Shapes::On_Delete(), and CSG_Table::On_Delete().

◆ SG_File_Exists()

bool SG_File_Exists ( const CSG_String & FileName )

Definition at line 834 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Parameter_List::_Serialize(), CSG_Table::Create(), CSG_Translator::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Data_Collection::Delete(), CSG_Data_Object::Delete(), CSG_Data_Collection::Delete_Unsaved(), CSG_MetaData::Load(), CSG_Table::Load(), CSG_Projections::Load_DB(), CSG_Projections::Load_Dictionary(), CSG_File::Open(), CSG_File_Zip::Open(), CSG_Data_Object::Reload(), and SG_File_Delete().

◆ SG_File_Get_Extension()

CSG_String SG_File_Get_Extension ( const CSG_String & FileName )

Definition at line 953 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Data_Object::Load_MetaData(), and SG_File_Cmp_Extension().

◆ SG_File_Get_Name()

CSG_String SG_File_Get_Name | ( | const CSG_String & | full_Path,
 |  | bool | bExtension
 | ) |  |

Definition at line 862 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Grid_File_Info::Create(), CSG_Tool_Library_Interface::Create(), CSG_PointCloud::Get_Header_Content(), CSG_Grids::Load(), CSG_Table::Load(), CSG_PointCloud::Save(), CSG_Data_Object::Set_File_Name(), and SG_File_Make_Path().

◆ SG_File_Get_Name_Temp() [1/2]

CSG_String SG_File_Get_Name_Temp ( const CSG_String & Prefix )

Definition at line 846 of file api_file.cpp.

◆ SG_File_Get_Name_Temp() [2/2]

CSG_String SG_File_Get_Name_Temp | ( | const CSG_String & | Prefix,
 |  | const CSG_String & | Directory
 | ) |  |

Definition at line 851 of file api_file.cpp.

References CSG_String::c_str(), SG_Dir_Exists(), and SG_File_Make_Path().

◆ SG_File_Get_Path()

CSG_String SG_File_Get_Path ( const CSG_String & full_Path )

Definition at line 875 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Grid_File_Info::Create(), CSG_Tool_Library_Manager::Get_Summary(), SG_File_Make_Path(), and SG_UI_Get_Application_Path().

◆ SG_File_Get_Path_Absolute()

CSG_String SG_File_Get_Path_Absolute ( const CSG_String & full_Path )

Definition at line 883 of file api_file.cpp.

References CSG_String::c_str().

Referenced by CSG_Tool_Library_Interface::Create(), CSG_Tool_Library::CSG_Tool_Library(), and SG_UI_Get_Application_Path().

◆ SG_File_Get_Path_Relative()

CSG_String SG_File_Get_Path_Relative | ( | const CSG_String & | Directory,
 |  | const CSG_String & | full_Path
 | ) |  |

Definition at line 893 of file api_file.cpp.

References CSG_String::c_str().

◆ SG_File_Make_Path() [1/2]

CSG_String SG_File_Make_Path | ( | const CSG_String & | Directory,
 |  | const CSG_String & | Name
 | ) |  |

Definition at line 903 of file api_file.cpp.

Referenced by CSG_Tool_Library_Manager::Add_Directory(), CSG_Projections::Create(), CSG_Translator::Create(), CSG_Grid_File_Info::Create(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library::Get_Summary(), CSG_Tool_Library_Manager::Get_Summary(), CSG_MetaData::Load(), CSG_MetaData::Save(), CSG_PointCloud::Save(), CSG_Grid::Set_Cache(), SG_Dir_List_Files(), SG_Dir_List_Subdirectories(), SG_File_Get_Name_Temp(), SG_FTP_Download(), and SG_Initialize_Environment().

◆ SG_File_Make_Path() [2/2]

CSG_String SG_File_Make_Path | ( | const CSG_String & | Directory,
 |  | const CSG_String & | Name,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 908 of file api_file.cpp.

References CSG_String::c_str(), CSG_String::is_Empty(), SG_File_Get_Name(), and SG_File_Get_Path().

◆ SG_File_Set_Extension()

bool SG_File_Set_Extension | ( | CSG_String & | FileName,
 |  | const CSG_String & | Extension
 | ) |  |

Definition at line 934 of file api_file.cpp.

References CSG_String::c_str(), and CSG_String::Length().

Referenced by CSG_Data_Object::Delete(), CSG_Data_Object::Load_MetaData(), CSG_Grid::On_Delete(), CSG_Grids::On_Delete(), CSG_Shapes::On_Delete(), CSG_PointCloud::Save(), and CSG_Data_Object::Save_MetaData().

◆ SG_Get_Environment()

bool SG_Get_Environment | ( | const CSG_String & | Variable,
 |  | CSG_String * | Value
 | ) |  |

Definition at line 968 of file api_file.cpp.

References CSG_String::w_str().

◆ SG_Set_Environment()

bool SG_Set_Environment | ( | const CSG_String & | Variable,
 |  | const CSG_String & | Value
 | ) |  |

Definition at line 988 of file api_file.cpp.

References CSG_String::w_str().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_file.cpp Source File

  • saga_core
  • saga_api
api_file.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_file.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <wx/utils.h>
54 #include <wx/filename.h>
55 #include <wx/dir.h>
56 #include <wx/wxcrtvararg.h>
57 #include <wx/wfstream.h>
58 #include <wx/zipstrm.h>
59 #include <wx/txtstrm.h>
60 #include <wx/log.h>
61 #include <wx/version.h>
62
63 #include "api_core.h"
64
65
67 // //
68 // //
69 // //
71
72 //---------------------------------------------------------
73 #define m_pStream_Base ((wxStreamBase *)m_pStream)
74 #define m_pStream_I ((wxFFileInputStream *)m_pStream)
75 #define m_pStream_O ((wxFFileOutputStream *)m_pStream)
76 #define m_pStream_IO ((wxFFileStream *)m_pStream)
77
78
80 // //
81 // //
82 // //
84
85 //---------------------------------------------------------
86 CSG_File::CSG_File(void)
87 {
88 On_Construction();
89 }
90
91 //---------------------------------------------------------
92 CSG_File::CSG_File(const CSG_String &FileName, int Mode, bool bBinary, int Encoding)
93 {
94 On_Construction();
95
96 Open(FileName, Mode, bBinary, Encoding);
97 }
98
99 //---------------------------------------------------------
100 CSG_File::~CSG_File(void)
101 {
102 Close();
103 }
104
105
107 // //
109
110 //---------------------------------------------------------
111 bool CSG_File::Open(const CSG_String &FileName, int Mode, bool bBinary, int Encoding)
112 {
113 Close();
114
115 if( Mode == SG_FILE_R && !SG_File_Exists(FileName) )
116 {
117 return( false );
118 }
119
120 m_FileName = FileName;
121 m_Mode = Mode;
122
123 Set_Encoding(Encoding);
124
125 switch( m_Mode )
126 {
127 case SG_FILE_W:
128 m_pStream = new wxFFileOutputStream(FileName.c_str(), bBinary ? "wb" : "w");
129 break;
130
131 case SG_FILE_R:
132 m_pStream = new wxFFileInputStream (FileName.c_str(), bBinary ? "rb" : "r");
133 break;
134
135 default: // SG_FILE_RW
136 m_pStream = new wxFFileStream (FileName.c_str(), SG_File_Exists(FileName)
137 ? (bBinary ? "r+b" : "r+")
138 : (bBinary ? "w+b" : "w+")
139 );
140 break;
141 }
142
143 if( !m_pStream || !m_pStream_Base->IsOk() )
144 {
145 Close();
146
147 return( false );
148 }
149
150 return( true );
151 }
152
153 //---------------------------------------------------------
154 bool CSG_File::Close(void)
155 {
156 if( m_pStream )
157 {
158 delete(m_pStream_Base);
159
160 m_pStream = NULL;
161 }
162
163 Set_Encoding(SG_FILE_ENCODING_UNDEFINED);
164
165 return( true );
166 }
167
168
170 // //
172
173 //---------------------------------------------------------
174 void CSG_File::On_Construction(void)
175 {
176 m_pStream = NULL;
177 m_pConvert = NULL;
178 m_Encoding = SG_FILE_ENCODING_UNDEFINED;
179 }
180
181 //---------------------------------------------------------
182 bool CSG_File::Set_Encoding(int Encoding)
183 {
184 if( m_pConvert )
185 {
186 if( m_pConvert != &wxConvLocal
187 && m_pConvert != &wxConvLibc
188 && m_pConvert != &wxConvUTF7
189 && m_pConvert != &wxConvUTF8 )
190 {
191 delete((wxMBConv *)m_pConvert);
192 }
193
194 m_pConvert = NULL;
195 }
196
197 m_Encoding = Encoding;
198
199 switch( Encoding )
200 {
201 case SG_FILE_ENCODING_ANSI : break;
202 case SG_FILE_ENCODING_UTF7 : m_pConvert = &wxConvUTF7 ; break;
203 case SG_FILE_ENCODING_UTF8 : m_pConvert = &wxConvUTF8 ; break;
204 case SG_FILE_ENCODING_UTF16LE: m_pConvert = new wxMBConvUTF16LE(); break;
205 case SG_FILE_ENCODING_UTF16BE: m_pConvert = new wxMBConvUTF16BE(); break;
206 case SG_FILE_ENCODING_UTF32LE: m_pConvert = new wxMBConvUTF32LE(); break;
207 case SG_FILE_ENCODING_UTF32BE: m_pConvert = new wxMBConvUTF32BE(); break;
208 default : break;
209 }
210
211 return( true );
212 }
213
214
216 // //
218
219 //---------------------------------------------------------
220 sLong CSG_File::Length(void) const
221 {
222 return( m_pStream ? m_pStream_Base->GetLength() : -1 );
223 }
224
225 //---------------------------------------------------------
226 bool CSG_File::is_EOF(void) const
227 {
228 return( is_Reading() && (m_Mode == SG_FILE_R ? m_pStream_I->Eof() : m_pStream_IO->Eof()) );
229 }
230
231 //---------------------------------------------------------
232 bool CSG_File::Seek(sLong Offset, int Origin) const
233 {
234 if( m_pStream )
235 {
236 wxSeekMode Seek = Origin == SG_FILE_CURRENT ? wxFromCurrent : Origin == SG_FILE_END ? wxFromEnd : wxFromStart;
237
238 switch( m_Mode )
239 {
240 case SG_FILE_R : return( m_pStream_I ->SeekI(Offset, Seek) != wxInvalidOffset );
241 case SG_FILE_W : return( m_pStream_O ->SeekO(Offset, Seek) != wxInvalidOffset );
242 default : return( m_pStream_IO->SeekI(Offset, Seek) != wxInvalidOffset
243 && m_pStream_IO->SeekO(Offset, Seek) != wxInvalidOffset );
244 }
245 }
246
247 return( false );
248 }
249
250 //---------------------------------------------------------
251 bool CSG_File::Seek_Start(void) const { return( Seek(0, SEEK_SET) ); }
252 bool CSG_File::Seek_End (void) const { return( Seek(0, SEEK_END) ); }
253
254 //---------------------------------------------------------
255 sLong CSG_File::Tell(void) const
256 {
257 if( m_pStream )
258 {
259 switch( m_Mode )
260 {
261 case SG_FILE_R : return( m_pStream_I ->TellI() );
262 case SG_FILE_W : return( m_pStream_O ->TellO() );
263 default : return( m_pStream_IO->TellI() );
264 }
265 }
266
267 return( -1 );
268 }
269
270 //---------------------------------------------------------
271 int CSG_File::Printf(const char *Format, ...)
272 {
273 if( !is_Writing() )
274 {
275 return( 0 );
276 }
277
278 wxString String;
279
280 #ifdef _SAGA_LINUX
281 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
282 va_list argptr; va_start(argptr, _Format);
283 int Result = String.PrintfV(_Format, argptr);
284 #else
285 va_list argptr; va_start(argptr, Format);
286 int Result = String.PrintfV(Format, argptr);
287 #endif
288 va_end(argptr);
289
290 Write(&String);
291
292 return( Result );
293 }
294
295 //---------------------------------------------------------
296 int CSG_File::Printf(const wchar_t *Format, ...)
297 {
298 if( !is_Writing() )
299 {
300 return( 0 );
301 }
302
303 wxString String;
304
305 #ifdef _SAGA_LINUX
306 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
307 va_list argptr; va_start(argptr, _Format);
308 int Result = String.PrintfV(_Format, argptr);
309 #else
310 va_list argptr; va_start(argptr, Format);
311 int Result = String.PrintfV(Format, argptr);
312 #endif
313
314 va_end(argptr);
315
316 Write(&String);
317
318 return( Result );
319 }
320
321 //---------------------------------------------------------
322 size_t CSG_File::Read(void *Buffer, size_t Size, size_t Count) const
323 {
324 return( !is_Reading() || Size == 0 || Count == 0 ? 0 : m_Mode == SG_FILE_R
325 ? m_pStream_I ->Read(Buffer, Size * Count).LastRead() / Size
326 : m_pStream_IO->Read(Buffer, Size * Count).LastRead() / Size
327 );
328 }
329
330 size_t CSG_File::Read(CSG_String &Buffer, size_t Size) const
331 {
332 if( is_Reading() && Size > 0 )
333 {
334 CSG_Buffer s(Size + 1);
335
336 size_t i = Read(s.Get_Data(), sizeof(char), Size);
337
338 if( i > 0 )
339 {
340 s[Size] = '\0';
341
342 Buffer = s.Get_Data();
343
344 return( i );
345 }
346 }
347
348 Buffer.Clear();
349
350 return( 0 );
351 }
352
353 //---------------------------------------------------------
354 size_t CSG_File::Write(void *Buffer, size_t Size, size_t Count) const
355 {
356 return( !is_Writing() || Size == 0 || Count == 0 ? 0 : m_Mode == SG_FILE_W
357 ? m_pStream_O ->Write(Buffer, Size * Count).LastWrite()
358 : m_pStream_IO->Write(Buffer, Size * Count).LastWrite()
359 );
360 }
361
362 size_t CSG_File::Write(const CSG_String &Buffer) const
363 {
364 if( m_pConvert )
365 {
366 wxString _Buffer(Buffer.w_str());
367
368 const wxScopedCharBuffer s(_Buffer.mb_str(*((wxMBConv *)m_pConvert)));
369
370 return( Write((void *)s.data(), sizeof(char), s.length()) );
371 }
372
373 CSG_Buffer s(Buffer.to_ASCII()); // returns NULL terminated char sequence, Get_Size() count includes terminating NULL!!!
374
375 return( s.Get_Size() > 1 ? Write((void *)s.Get_Data(), sizeof(char), s.Get_Size() - 1) : 0 );
376 }
377
378 //---------------------------------------------------------
379 bool CSG_File::Read_Line(CSG_String &sLine) const
380 {
381 if( !is_Reading() || is_EOF() )
382 {
383 return( false );
384 }
385
386 wxString s;
387
388 if( m_pConvert )
389 {
390 if( m_Mode == SG_FILE_R )
391 {
392 wxTextInputStream Stream(*m_pStream_I , " \t", *((wxMBConv *)m_pConvert)); s = Stream.ReadLine();
393 }
394 else
395 {
396 wxTextInputStream Stream(*m_pStream_IO, " \t", *((wxMBConv *)m_pConvert)); s = Stream.ReadLine();
397 }
398 }
399 else
400 {
401 if( m_Mode == SG_FILE_R )
402 {
403 wxTextInputStream Stream(*m_pStream_I , " \t" ); s = Stream.ReadLine();
404 }
405 else
406 {
407 wxTextInputStream Stream(*m_pStream_IO, " \t" ); s = Stream.ReadLine();
408 }
409 }
410
411 sLine = CSG_String(&s);
412
413 return( !sLine.is_Empty() || !is_EOF() );
414 }
415
416 //---------------------------------------------------------
417 int CSG_File::Read_Char(void) const
418 {
419 return( !is_Reading() ? 0 : m_Mode == SG_FILE_R ? m_pStream_I->GetC() : m_pStream_IO->GetC() );
420 }
421
422 //---------------------------------------------------------
423 int CSG_File::Read_Int(bool bByteOrderBig) const
424 {
425 int Value = 0;
426
427 if( Read(&Value, sizeof(Value)) == 1 )
428 {
429 if( bByteOrderBig )
430 {
431 SG_Swap_Bytes(&Value, sizeof(Value));
432 }
433 }
434
435 return( Value );
436 }
437
438 bool CSG_File::Write_Int(int Value, bool bByteOrderBig)
439 {
440 if( bByteOrderBig )
441 {
442 SG_Swap_Bytes(&Value, sizeof(Value));
443 }
444
445 return( Write(&Value, sizeof(Value)) == sizeof(Value) );
446 }
447
448 //---------------------------------------------------------
449 double CSG_File::Read_Double(bool bByteOrderBig) const
450 {
451 double Value = 0;
452
453 if( Read(&Value, sizeof(Value)) == 1 )
454 {
455 if( bByteOrderBig )
456 {
457 SG_Swap_Bytes(&Value, sizeof(Value));
458 }
459 }
460
461 return( Value );
462 }
463
464 bool CSG_File::Write_Double(double Value, bool bByteOrderBig)
465 {
466 if( bByteOrderBig )
467 {
468 SG_Swap_Bytes(&Value, sizeof(Value));
469 }
470
471 return( Write(&Value, sizeof(Value)) == sizeof(Value) );
472 }
473
474 //---------------------------------------------------------
475 bool CSG_File::Scan(int &Value) const
476 {
477 if( is_Reading() )
478 {
479 int c; while( !is_EOF() && isspace(c = Read_Char()) ); // remove leading white space
480
481 if( isdigit(c) || strchr("-+", c) )
482 {
483 CSG_String s = (char)c;
484
485 while( !is_EOF() && isdigit(c = Read_Char()) )
486 {
487 s += (char)c;
488 }
489
490 return( s.asInt(Value) );
491 }
492 }
493
494 return( false );
495 }
496
497 bool CSG_File::Scan(double &Value) const
498 {
499 if( is_Reading() )
500 {
501 int c; while( !is_EOF() && isspace(c = Read_Char()) ); // remove leading white space
502
503 if( isdigit(c) || strchr("-+.,eE", c) )
504 {
505 CSG_String s = (char)c;
506
507 while( !is_EOF() && (isdigit(c = Read_Char()) || strchr(".,eE", c) || strchr("", c)) )
508 {
509 s += (char)c;
510 }
511
512 return( s.asDouble(Value) );
513 }
514 }
515
516 return( false );
517 }
518
519 bool CSG_File::Scan(CSG_String &Value, SG_Char Separator) const
520 {
521 if( is_Reading() && !is_EOF() )
522 {
523 Value.Clear();
524
525 int c; while( !is_EOF() && (c = Read_Char()) != Separator && c != EOF )
526 {
527 Value += (char)c;
528 }
529
530 return( true );
531 }
532
533 return( false );
534 }
535
536 //---------------------------------------------------------
537 int CSG_File::Scan_Int(void) const
538 {
539 int Value; return( Scan(Value) ? Value : 0 );
540 }
541
542 double CSG_File::Scan_Double(void) const
543 {
544 double Value; return( Scan(Value) ? Value : 0.0 );
545 }
546
547 CSG_String CSG_File::Scan_String(SG_Char Separator) const
548 {
549 CSG_String Value; Scan(Value, Separator); return( Value );
550 }
551
552
554 // //
555 // //
556 // //
558
559 //---------------------------------------------------------
560 CSG_File_Zip::CSG_File_Zip(void)
561 {
562 On_Construction();
563 }
564
565 //---------------------------------------------------------
566 CSG_File_Zip::CSG_File_Zip(const CSG_String &FileName, int Mode, int Encoding)
567 {
568 On_Construction();
569
570 Open(FileName, Mode, Encoding);
571 }
572
573 //---------------------------------------------------------
574 CSG_File_Zip::~CSG_File_Zip(void)
575 {
576 Close();
577 }
578
579 //---------------------------------------------------------
580 bool CSG_File_Zip::Open(const CSG_String &FileName, int Mode, int Encoding)
581 {
582 wxLogNull logNo; // suppress user notification dialog for invalid zip files
583
584 Close();
585
586 m_Mode = Mode;
587
588 Set_Encoding(Encoding);
589
590 if( Mode == SG_FILE_W )
591 {
592 m_pStream = new wxZipOutputStream(new wxFileOutputStream(FileName.c_str()));
593 }
594 else if( Mode == SG_FILE_R && SG_File_Exists(FileName) )
595 {
596 m_pStream = new wxZipInputStream (new wxFileInputStream (FileName.c_str()));
597 }
598
599 if( !m_pStream || !m_pStream_Base->IsOk() )
600 {
601 Close();
602
603 return( false );
604 }
605
606 if( is_Reading() )
607 {
608 wxZipEntry *pEntry;
609
610 while( (pEntry = ((wxZipInputStream *)m_pStream)->GetNextEntry()) != NULL )
611 {
612 m_Files += pEntry;
613 }
614 }
615
616 return( true );
617 }
618
619 //---------------------------------------------------------
620 bool CSG_File_Zip::Close(void)
621 {
622 for(sLong i=0; i<m_Files.Get_Size(); i++)
623 {
624 delete((wxZipEntry *)m_Files[i]);
625 }
626
627 m_Files.Set_Array(0);
628
629 return( CSG_File::Close() );
630 }
631
632 //---------------------------------------------------------
633 bool CSG_File_Zip::Add_Directory(const CSG_String &Name)
634 {
635 return( is_Writing() && ((wxZipOutputStream *)m_pStream)->PutNextDirEntry(Name.c_str()) );
636 }
637
638 //---------------------------------------------------------
639 bool CSG_File_Zip::Add_File(const CSG_String &Name, bool bBinary)
640 {
641 if( is_Writing() )
642 {
643 wxZipEntry *pEntry = new wxZipEntry(Name.c_str());
644
645 pEntry->SetIsText(bBinary == false);
646
647 #if wxCHECK_VERSION(3, 1, 1)
648 ((wxZipOutputStream *)m_pStream)->SetFormat(wxZIP_FORMAT_ZIP64);
649 #endif
650
651 if( ((wxZipOutputStream *)m_pStream)->PutNextEntry(pEntry) )
652 {
653 m_FileName = Name;
654
655 return( true );
656 }
657 }
658
659 return( false );
660 }
661
662 //---------------------------------------------------------
663 bool CSG_File_Zip::is_Directory(size_t Index)
664 {
665 if( is_Reading() && m_Files[Index] )
666 {
667 return( ((wxZipEntry *)m_Files[Index])->IsDir() );
668 }
669
670 return( false );
671 }
672
673 //---------------------------------------------------------
674 bool CSG_File_Zip::Get_File(size_t Index)
675 {
676 if( is_Reading() && m_Files[Index] )
677 {
678 if( ((wxZipInputStream *)m_pStream)->OpenEntry(*(wxZipEntry *)m_Files[Index]) )
679 {
680 m_FileName = Get_File_Name(Index);
681
682 return( true );
683 }
684 }
685
686 return( false );
687 }
688
689 //---------------------------------------------------------
690 bool CSG_File_Zip::Get_File(const CSG_String &Name)
691 {
692 if( is_Reading() )
693 {
694 for(sLong i=0; i<m_Files.Get_Size(); i++)
695 {
696 if( !((wxZipEntry *)m_Files[i])->GetName().Cmp(Name.c_str()) )
697 {
698 return( Get_File(i) );
699 }
700 }
701 }
702
703 return( false );
704 }
705
706 //---------------------------------------------------------
707 CSG_String CSG_File_Zip::Get_File_Name(size_t Index)
708 {
709 CSG_String s;
710
711 if( is_Reading() && m_Files[Index] )
712 {
713 wxString Name(((wxZipEntry *)m_Files[Index])->GetName()); s = &Name;
714 }
715
716 return( s );
717 }
718
719
721 // //
722 // //
723 // //
725
726 //---------------------------------------------------------
727 bool SG_Dir_Exists(const CSG_String &Directory)
728 {
729 return( wxFileName::DirExists(Directory.c_str()) );
730 }
731
732 //---------------------------------------------------------
733 bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath)
734 {
735 if( SG_Dir_Exists(Directory) )
736 {
737 return( true );
738 }
739
740 return( wxFileName::Mkdir(Directory.c_str(), wxS_DIR_DEFAULT, bFullPath ? wxPATH_MKDIR_FULL : 0) );
741 }
742
743 //---------------------------------------------------------
744 bool SG_Dir_Delete(const CSG_String &Directory, bool bRecursive)
745 {
746 if( !SG_Dir_Exists(Directory) )
747 {
748 return( true );
749 }
750
751 return( wxDir::Remove(Directory.c_str(), bRecursive ? wxPATH_RMDIR_RECURSIVE : 0) );
752 }
753
754 //---------------------------------------------------------
755 CSG_String SG_Dir_Get_Current(void)
756 {
757 wxString cwd = wxFileName::GetCwd();
758
759 return( CSG_String(&cwd) );
760 }
761
762 //---------------------------------------------------------
763 CSG_String SG_Dir_Get_Temp(void)
764 {
765 wxString fname = wxFileName::GetTempDir();
766
767 return( CSG_String(&fname) );
768 }
769
770 //---------------------------------------------------------
771 bool SG_Dir_List_Subdirectories (CSG_Strings &List, const CSG_String &Directory)
772 {
773 List.Clear();
774
775 wxDir Dir;
776
777 if( Dir.Open(Directory.c_str()) )
778 {
779 wxString FileName;
780
781 if( Dir.GetFirst(&FileName, wxEmptyString, wxDIR_DIRS) )
782 {
783 do
784 {
785 List += SG_File_Make_Path(Directory, &FileName);
786 }
787 while( Dir.GetNext(&FileName) );
788 }
789 }
790
791 return( List.Get_Count() > 0 );
792 }
793
794 //---------------------------------------------------------
795 bool SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory)
796 {
797 return( SG_Dir_List_Files(List, Directory, "") );
798 }
799
800 bool SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension)
801 {
802 List.Clear();
803
804 wxDir Dir;
805
806 if( Dir.Open(Directory.c_str()) )
807 {
808 wxString FileName;
809
810 if( Dir.GetFirst(&FileName, wxEmptyString, wxDIR_FILES) )
811 {
812 do
813 {
814 if( Extension.is_Empty() || SG_File_Cmp_Extension(&FileName, Extension) )
815 {
816 List += SG_File_Make_Path(Directory, &FileName);
817 }
818 }
819 while( Dir.GetNext(&FileName) );
820 }
821 }
822
823 return( List.Get_Count() > 0 );
824 }
825
826
828 // //
829 // //
830 // //
832
833 //---------------------------------------------------------
834 bool SG_File_Exists(const CSG_String &FileName)
835 {
836 return( wxFileExists(FileName.c_str()) );
837 }
838
839 //---------------------------------------------------------
840 bool SG_File_Delete(const CSG_String &FileName)
841 {
842 return( SG_File_Exists(FileName) && wxRemoveFile(FileName.c_str()) );
843 }
844
845 //---------------------------------------------------------
846 CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix)
847 {
848 return( SG_File_Get_Name_Temp(Prefix, "") );
849 }
850
851 CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix, const CSG_String &Directory)
852 {
853 if( !SG_Dir_Exists(Directory) )
854 {
855 return( CSG_String(wxFileName::CreateTempFileName(Prefix.c_str()).wc_str()) );
856 }
857
858 return( CSG_String(wxFileName::CreateTempFileName(SG_File_Make_Path(Directory, Prefix).w_str()).wc_str()) );
859 }
860
861 //---------------------------------------------------------
862 CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
863 {
864 wxFileName fn(full_Path.c_str());
865
866 if( bExtension )
867 {
868 wxString s(fn.GetFullName()); return( CSG_String(&s) );
869 }
870
871 wxString s(fn.GetName()); return( &s );
872 }
873
874 //---------------------------------------------------------
875 CSG_String SG_File_Get_Path(const CSG_String &full_Path)
876 {
877 wxString s(wxFileName(full_Path.c_str()).GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR));
878
879 return( CSG_String(&s) );
880 }
881
882 //---------------------------------------------------------
883 CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
884 {
885 wxFileName fn(full_Path.c_str());
886
887 fn.MakeAbsolute();
888
889 wxString s(fn.GetFullPath()); return( &s );
890 }
891
892 //---------------------------------------------------------
893 CSG_String SG_File_Get_Path_Relative(const CSG_String &Directory, const CSG_String &full_Path)
894 {
895 wxFileName fn(full_Path.c_str());
896
897 fn.MakeRelativeTo(Directory.c_str());
898
899 wxString s(fn.GetFullPath()); return( &s );
900 }
901
902 //---------------------------------------------------------
903 CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
904 {
905 return( SG_File_Make_Path(Directory, Name, "") );
906 }
907
908 CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name, const CSG_String &Extension)
909 {
910 wxFileName fn;
911
912 fn.AssignDir(!Directory.is_Empty() ? Directory.c_str() : SG_File_Get_Path(Name).c_str());
913
914 if( !Extension.is_Empty() )
915 {
916 fn.SetName (SG_File_Get_Name(Name, false).c_str());
917 fn.SetExt (Extension.c_str());
918 }
919 else
920 {
921 fn.SetFullName (SG_File_Get_Name(Name, true).c_str());
922 }
923
924 wxString s(fn.GetFullPath()); return( &s );
925 }
926
927 //---------------------------------------------------------
928 bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
929 {
930 return( SG_File_Get_Extension(FileName).CmpNoCase(Extension) == 0 );
931 }
932
933 //---------------------------------------------------------
934 bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
935 {
936 if( FileName.Length() > 0 )
937 {
938 wxFileName fn(FileName.c_str());
939
940 fn.SetExt(Extension.c_str());
941
942 wxString s(fn.GetFullPath());
943
944 FileName = &s;
945
946 return( true );
947 }
948
949 return( false );
950 }
951
952 //---------------------------------------------------------
953 CSG_String SG_File_Get_Extension(const CSG_String &FileName)
954 {
955 wxFileName fn(FileName.c_str());
956
957 wxString s(fn.GetExt()); return( &s );
958 }
959
960
962 // //
963 // //
964 // //
966
967 //---------------------------------------------------------
968 bool SG_Get_Environment(const CSG_String &Variable, CSG_String *Value)
969 {
970 if( Value == NULL )
971 {
972 return( wxGetEnv(Variable.w_str(), NULL) );
973 }
974
975 wxString s;
976
977 if( wxGetEnv(Variable.w_str(), &s) )
978 {
979 *Value = s.wc_str();
980
981 return( true );
982 }
983
984 return( false );
985 }
986
987 //---------------------------------------------------------
988 bool SG_Set_Environment(const CSG_String &Variable, const CSG_String &Value)
989 {
990 return( wxSetEnv(Variable.w_str(), Value.w_str()) );
991 }
992
993
995 // //
996 // //
997 // //
999
1000 //---------------------------------------------------------
m_pStream_O
#define m_pStream_O
Definition: api_file.cpp:75
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
CSG_File::Set_Encoding
bool Set_Encoding(int Encoding)
Definition: api_file.cpp:182
CSG_File_Zip::Get_File
bool Get_File(const CSG_String &Name)
Definition: api_file.cpp:690
CSG_File_Zip::is_Directory
bool is_Directory(size_t Index)
Definition: api_file.cpp:663
CSG_File::Seek_Start
bool Seek_Start(void) const
Definition: api_file.cpp:251
CSG_String::to_ASCII
bool to_ASCII(char **pString, char Replace='_') const
Definition: api_string.cpp:909
SG_Swap_Bytes
SAGA_API_DLL_EXPORT void SG_Swap_Bytes(void *Buffer, int nBytes)
Definition: api_memory.cpp:154
CSG_String::w_str
const wchar_t * w_str(void) const
Definition: api_string.cpp:248
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_File::m_FileName
CSG_String m_FileName
Definition: api_core.h:1177
SG_File_Get_Extension
CSG_String SG_File_Get_Extension(const CSG_String &FileName)
Definition: api_file.cpp:953
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_File::Seek
bool Seek(sLong Offset, int Origin=SG_FILE_START) const
Definition: api_file.cpp:232
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
SG_File_Exists
bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_File_Zip::Close
virtual bool Close(void)
Definition: api_file.cpp:620
CSG_File::Scan
bool Scan(int &Value) const
Definition: api_file.cpp:475
SG_FILE_ENCODING_UTF32BE
@ SG_FILE_ENCODING_UTF32BE
Definition: api_core.h:550
SG_File_Make_Path
CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
api_core.h
CSG_File::Scan_Int
int Scan_Int(void) const
Definition: api_file.cpp:537
SG_Dir_List_Subdirectories
bool SG_Dir_List_Subdirectories(CSG_Strings &List, const CSG_String &Directory)
Definition: api_file.cpp:771
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_File::m_Mode
int m_Mode
Definition: api_core.h:1175
SG_FILE_END
@ SG_FILE_END
Definition: api_core.h:1111
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
SG_FILE_ENCODING_UTF7
@ SG_FILE_ENCODING_UTF7
Definition: api_core.h:545
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Buffer
Definition: api_core.h:224
SG_Dir_Create
bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath)
Definition: api_file.cpp:733
CSG_File::Scan_String
CSG_String Scan_String(SG_Char Separator) const
Definition: api_file.cpp:547
SG_Dir_Get_Current
CSG_String SG_Dir_Get_Current(void)
Definition: api_file.cpp:755
SG_FILE_ENCODING_UNDEFINED
@ SG_FILE_ENCODING_UNDEFINED
Definition: api_core.h:551
CSG_File_Zip::~CSG_File_Zip
virtual ~CSG_File_Zip(void)
Definition: api_file.cpp:574
SG_File_Cmp_Extension
bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
CSG_File::On_Construction
void On_Construction(void)
Definition: api_file.cpp:174
CSG_File_Zip::CSG_File_Zip
CSG_File_Zip(void)
Definition: api_file.cpp:560
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
CSG_File::Scan_Double
double Scan_Double(void) const
Definition: api_file.cpp:542
sLong
signed long long sLong
Definition: api_core.h:158
CSG_File::Read_Int
int Read_Int(bool bBigEndian=false) const
Definition: api_file.cpp:423
SG_File_Get_Name
CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
SG_FILE_ENCODING_UTF32LE
@ SG_FILE_ENCODING_UTF32LE
Definition: api_core.h:549
CSG_Buffer::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:241
SG_Get_Environment
bool SG_Get_Environment(const CSG_String &Variable, CSG_String *Value)
Definition: api_file.cpp:968
CSG_File_Zip::m_Files
CSG_Array_Pointer m_Files
Definition: api_core.h:1213
CSG_File::m_Encoding
int m_Encoding
Definition: api_core.h:1175
SG_FILE_CURRENT
@ SG_FILE_CURRENT
Definition: api_core.h:1110
CSG_File::Close
virtual bool Close(void)
Definition: api_file.cpp:154
CSG_File::Read_Char
int Read_Char(void) const
Definition: api_file.cpp:417
CSG_File_Zip::Add_Directory
bool Add_Directory(const CSG_String &Name)
Definition: api_file.cpp:633
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Strings
Definition: api_core.h:693
SG_File_Delete
bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
SG_File_Get_Path_Relative
CSG_String SG_File_Get_Path_Relative(const CSG_String &Directory, const CSG_String &full_Path)
Definition: api_file.cpp:893
SG_FILE_ENCODING_UTF16LE
@ SG_FILE_ENCODING_UTF16LE
Definition: api_core.h:547
CSG_File::Write_Double
bool Write_Double(double Value, bool bBigEndian=false)
Definition: api_file.cpp:464
m_pStream_I
#define m_pStream_I
Definition: api_file.cpp:74
CSG_File::m_pConvert
void * m_pConvert
Definition: api_core.h:1179
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
SG_File_Get_Name_Temp
CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix)
Definition: api_file.cpp:846
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
SG_Char
#define SG_Char
Definition: api_core.h:530
m_pStream_IO
#define m_pStream_IO
Definition: api_file.cpp:76
CSG_String
Definition: api_core.h:557
SG_Dir_List_Files
bool SG_Dir_List_Files(CSG_Strings &List, const CSG_String &Directory)
Definition: api_file.cpp:795
CSG_File::m_pStream
void * m_pStream
Definition: api_core.h:1179
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_Set_Environment
bool SG_Set_Environment(const CSG_String &Variable, const CSG_String &Value)
Definition: api_file.cpp:988
SG_FILE_ENCODING_UTF16BE
@ SG_FILE_ENCODING_UTF16BE
Definition: api_core.h:548
CSG_File::Write_Int
bool Write_Int(int Value, bool bBigEndian=false)
Definition: api_file.cpp:438
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
CSG_File_Zip::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:580
SG_File_Get_Path
CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
CSG_File::Read_Double
double Read_Double(bool bBigEndian=false) const
Definition: api_file.cpp:449
SG_Dir_Delete
bool SG_Dir_Delete(const CSG_String &Directory, bool bRecursive)
Definition: api_file.cpp:744
SG_File_Set_Extension
bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_File::CSG_File
CSG_File(void)
Definition: api_file.cpp:86
SG_Dir_Get_Temp
CSG_String SG_Dir_Get_Temp(void)
Definition: api_file.cpp:763
CSG_File_Zip::Add_File
bool Add_File(const CSG_String &Name, bool bBinary=true)
Definition: api_file.cpp:639
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
CSG_File::is_EOF
bool is_EOF(void) const
Definition: api_file.cpp:226
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
m_pStream_Base
#define m_pStream_Base
Definition: api_file.cpp:73
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
SG_Dir_Exists
bool SG_Dir_Exists(const CSG_String &Directory)
Definition: api_file.cpp:727
CSG_File::Get_File_Name
virtual const CSG_String & Get_File_Name(void) const
Definition: api_core.h:1127
CSG_File::Seek_End
bool Seek_End(void) const
Definition: api_file.cpp:252
CSG_File::Tell
sLong Tell(void) const
Definition: api_file.cpp:255
SG_File_Get_Path_Absolute
CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
Definition: api_file.cpp:883
CSG_File::~CSG_File
virtual ~CSG_File(void)
Definition: api_file.cpp:100
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_memory.cpp File Reference

  • saga_core
  • saga_api
Functions
api_memory.cpp File Reference
#include "api_core.h"

Go to the source code of this file.

Functions

void * | SG_Malloc (size_t size)
void * | SG_Calloc (size_t num, size_t size)
void * | SG_Realloc (void *memblock, size_t new_size)
void | SG_Free (void *memblock)
void | SG_Swap_Bytes (void *Buffer, int nBytes)
int | SG_Mem_Get_Int (const char *Buffer, bool bSwapBytes)
void | SG_Mem_Set_Int (char *Buffer, int Value, bool bSwapBytes)
double | SG_Mem_Get_Double (const char *Buffer, bool bSwapBytes)
void | SG_Mem_Set_Double (char *Buffer, double Value, bool bSwapBytes)
BYTE | SG_Hex_to_Byte (const SG_Char Hex)

Function Documentation

◆ SG_Calloc()

void* SG_Calloc | ( | size_t | num,
 |  | size_t | size
 | ) |  |

Definition at line 71 of file api_memory.cpp.

Referenced by CSG_Grid_Radius::Create(), CSG_Formula::CSG_Formula(), and CSG_Table_DBase::Open_Write().

◆ SG_Free()

void SG_Free ( void * memblock )

Definition at line 83 of file api_memory.cpp.

Referenced by CSG_TIN::_Destroy_Edges(), CSG_TIN::_Destroy_Triangles(), CSG_TIN::_Triangulate(), CSG_PriorityQueue::Add(), CSG_Rects::Clear(), CSG_Rects_Int::Clear(), CSG_Parameters::Del_Parameters(), CSG_PointCloud::Del_Points(), CSG_PointCloud::Del_Selection(), CSG_Buffer::Destroy(), CSG_Bytes::Destroy(), CSG_Bytes_Array::Destroy(), CSG_Colors::Destroy(), CSG_Translator::Destroy(), CSG_Grid_Pyramid::Destroy(), CSG_Index::Destroy(), CSG_PriorityQueue::Destroy(), CSG_Matrix::Destroy(), CSG_Grid_Radius::Destroy(), CSG_PointCloud::Destroy(), CSG_Shape_Part::Destroy(), CSG_Table::Destroy(), CSG_Tool_Library_Manager::Destroy(), CSG_Colors::Load(), CSG_Formula::~CSG_Formula(), CSG_Parameter::~CSG_Parameter(), CSG_Table_Record::~CSG_Table_Record(), and CSG_Tool::~CSG_Tool().

◆ SG_Hex_to_Byte()

BYTE SG_Hex_to_Byte ( const SG_Char Hex )

Definition at line 936 of file api_memory.cpp.

Referenced by CSG_Bytes::fromHexString().

◆ SG_Malloc()

void* SG_Malloc ( size_t size )

Definition at line 65 of file api_memory.cpp.

Referenced by CSG_TIN::_Triangulate(), CSG_Translator::Create(), CSG_PriorityQueue::Create(), CSG_Matrix::Create(), CSG_Table_Record::CSG_Table_Record(), CSG_Colors::Load(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), and CSG_String::to_UTF8().

◆ SG_Mem_Get_Double()

double SG_Mem_Get_Double | ( | const char * | Buffer,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 200 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Get_Int()

int SG_Mem_Get_Int | ( | const char * | Buffer,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 177 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Set_Double()

void SG_Mem_Set_Double | ( | char * | Buffer,
 |  | double | Value,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 212 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Mem_Set_Int()

void SG_Mem_Set_Int | ( | char * | Buffer,
 |  | int | Value,
 |  | bool | bSwapBytes
 | ) |  |

Definition at line 189 of file api_memory.cpp.

References SG_Swap_Bytes().

◆ SG_Realloc()

void* SG_Realloc | ( | void * | memblock,
 |  | size_t | new_size
 | ) |  |

Definition at line 77 of file api_memory.cpp.

Referenced by CSG_TIN::_Add_Edge(), CSG_Table_Record::_Add_Field(), CSG_Shape_Points::_Add_Part(), CSG_TIN::_Add_Triangle(), CSG_Shape_Part::_Alloc_Memory(), CSG_Table_Record::_Del_Field(), CSG_Parameter_Table_Fields::_Set_Value(), CSG_TIN::_Triangulate(), CSG_Rects::Add(), CSG_Rects_Int::Add(), CSG_Bytes_Array::Add(), CSG_Classifier_Supervised::Add_Class(), CSG_Table::Add_Field(), CSG_Tool_Library_Manager::Add_Library(), CSG_Tool::Add_Parameters(), CSG_Matrix::Add_Rows(), CSG_Translator::Create(), CSG_Colors::Create(), CSG_PointCloud::Del_Field(), CSG_Table::Del_Field(), CSG_Tool_Library_Manager::Del_Library(), CSG_Parameters::Del_Parameter(), CSG_Shape_Points::Del_Part(), CSG_Matrix::Del_Rows(), CSG_Classifier_Supervised::Load(), CSG_Array::Set_Array(), CSG_Colors::Set_Count(), CSG_Colors::Set_Default(), CSG_Buffer::Set_Size(), and CSG_Classifier_Supervised::Train_Add_Sample().

◆ SG_Swap_Bytes()

void SG_Swap_Bytes | ( | void * | Buffer,
 |  | int | nBytes
 | ) |  |

Definition at line 154 of file api_memory.cpp.

Referenced by CSG_Bytes::Add(), CSG_Bytes::asDouble(), CSG_Buffer::asDouble(), CSG_Bytes::asDWord(), CSG_Bytes::asFloat(), CSG_Buffer::asFloat(), CSG_Bytes::asInt(), CSG_Buffer::asInt(), CSG_Bytes::asShort(), CSG_Buffer::asShort(), CSG_Bytes::asWord(), CSG_File::Read_Double(), CSG_File::Read_Int(), CSG_Buffer::Set_Value(), SG_Mem_Get_Double(), SG_Mem_Get_Int(), SG_Mem_Set_Double(), SG_Mem_Set_Int(), CSG_File::Write_Double(), and CSG_File::Write_Int().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_memory.cpp Source File

  • saga_core
  • saga_api
api_memory.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_memory.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "api_core.h"
54
55
57 // //
58 // //
59 // //
61
62 #ifndef _WINDOWS_
63
64 //---------------------------------------------------------
65 void * SG_Malloc(size_t size)
66 {
67 return( malloc(size) );
68 }
69
70 //---------------------------------------------------------
71 void * SG_Calloc(size_t num, size_t size)
72 {
73 return( calloc(num, size) );
74 }
75
76 //---------------------------------------------------------
77 void * SG_Realloc(void *memblock, size_t new_size)
78 {
79 return( realloc(memblock, new_size) );
80 }
81
82 //---------------------------------------------------------
83 void SG_Free(void *memblock)
84 {
85 if( memblock )
86 {
87 free(memblock);
88 }
89 }
90
91
93 // //
94 // //
95 // //
97
98 //---------------------------------------------------------
99 // Due to a bad 'feature' in the realloc routine of MS's
100 // MSVCRT (C-Runtime-Library), we recommend to use our own
101 // memory allocation routines...
102
103 #else // ifndef _WINDOWS_
104
105 void * SG_Malloc(size_t size)
106 {
107 return( HeapAlloc(GetProcessHeap(), 0, size) );
108 }
109
110 void * SG_Calloc(size_t num, size_t size)
111 {
112 return( HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num * size) );
113 }
114
115 void * SG_Realloc(void *memblock, size_t new_size)
116 {
117 if( new_size > 0 )
118 {
119 if( memblock )
120 {
121 return( HeapReAlloc(GetProcessHeap(), 0, memblock, new_size) );
122 }
123 else
124 {
125 return( HeapAlloc(GetProcessHeap(), 0, new_size) );
126 }
127 }
128 else
129 {
130 SG_Free(memblock);
131
132 return( NULL );
133 }
134 }
135
136 void SG_Free(void *memblock)
137 {
138 if( memblock )
139 {
140 HeapFree(GetProcessHeap(), 0, memblock);
141 }
142 }
143
144 #endif // ifndef _WINDOWS_
145
146
148 // //
149 // //
150 // //
152
153 //---------------------------------------------------------
154 void SG_Swap_Bytes(void *Buffer, int nBytes)
155 {
156 char Byte, *pA, *pB;
157
158 pA = (char *)Buffer;
159 pB = pA + nBytes - 1;
160
161 while( pA < pB )
162 {
163 Byte = *pA;
164 *(pA++) = *pB;
165 *(pB--) = Byte;
166 }
167 }
168
169
171 // //
172 // //
173 // //
175
176 //---------------------------------------------------------
177 int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
178 {
179 int Value = *(int *)Buffer;
180
181 if( bSwapBytes )
182 {
183 SG_Swap_Bytes(&Value, sizeof(Value));
184 }
185
186 return( Value );
187 }
188
189 void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
190 {
191 if( bSwapBytes )
192 {
193 SG_Swap_Bytes(&Value, sizeof(Value));
194 }
195
196 *((int *)Buffer) = Value;
197 }
198
199 //---------------------------------------------------------
200 double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
201 {
202 double Value = *(double *)Buffer;
203
204 if( bSwapBytes )
205 {
206 SG_Swap_Bytes(&Value, sizeof(Value));
207 }
208
209 return( Value );
210 }
211
212 void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
213 {
214 if( bSwapBytes )
215 {
216 SG_Swap_Bytes(&Value, sizeof(Value));
217 }
218
219 *(double *)Buffer = Value;
220 }
221
222
224 // //
225 // //
226 // //
228
229 //---------------------------------------------------------
230 CSG_Array::CSG_Array(void)
231 {
232 m_nBuffer = 0;
233 m_nValues = 0;
234 m_Values = NULL;
235
236 m_Value_Size = sizeof(char);
237 m_Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0;
238 }
239
240 //---------------------------------------------------------
241 CSG_Array::CSG_Array(const CSG_Array &Array)
242 {
243 m_nBuffer = 0;
244 m_nValues = 0;
245 m_Values = NULL;
246
247 Create(Array);
248 }
249
250 void * CSG_Array::Create(const CSG_Array &Array)
251 {
252 Destroy();
253
254 m_Value_Size = Array.m_Value_Size;
255 m_Growth = Array.m_Growth;
256
257 if( Array.m_nValues > 0 && Get_Array(Array.m_nValues) )
258 {
259 memcpy(m_Values, Array.m_Values, Array.m_nValues * Array.m_Value_Size);
260 }
261
262 return( Get_Array() );
263 }
264
265 //---------------------------------------------------------
266 CSG_Array::CSG_Array(size_t Value_Size, sLong nValues, TSG_Array_Growth Growth)
267 {
268 m_nBuffer = 0;
269 m_nValues = 0;
270 m_Values = NULL;
271
272 Create(Value_Size, nValues, Growth);
273 }
274
275 void * CSG_Array::Create(size_t Value_Size, sLong nValues, TSG_Array_Growth Growth)
276 {
277 Destroy();
278
279 m_Value_Size = Value_Size;
280 m_Growth = Growth;
281
282 return( Get_Array(nValues) );
283 }
284
285 //---------------------------------------------------------
286 CSG_Array::~CSG_Array(void)
287 {
288 Destroy();
289 }
290
291 bool CSG_Array::Destroy(void)
292 {
293 m_nBuffer = 0;
294 m_nValues = 0;
295
296 SG_FREE_SAFE(m_Values);
297
298 return( true );
299 }
300
301 //---------------------------------------------------------
302 bool CSG_Array::Set_Growth(TSG_Array_Growth Growth)
303 {
304 m_Growth = Growth;
305
306 return( true );
307 }
308
309 //---------------------------------------------------------
310 bool CSG_Array::Set_Array(sLong nValues, bool bShrink)
311 {
312 if( nValues >= m_nValues && nValues <= m_nBuffer )
313 {
314 m_nValues = nValues;
315
316 return( true );
317 }
318
319 if( nValues < m_nValues && !bShrink )
320 {
321 m_nValues = nValues;
322
323 return( true );
324 }
325
326 if( nValues == 0 )
327 {
328 Destroy();
329
330 return( true );
331 }
332
333 //-----------------------------------------------------
334 sLong nBuffer;
335
336 switch( m_Growth )
337 {
338 case TSG_Array_Growth::SG_ARRAY_GROWTH_0: default:
339 nBuffer = nValues;
340 break;
341
342 case TSG_Array_Growth::SG_ARRAY_GROWTH_1:
343 nBuffer = nValues < 10 ? nValues
344 : nValues < 100 ? (1 + nValues / 10) * 10
345 : nValues < 1000 ? (1 + nValues / 100) * 100
346 : nValues < 10000 ? (1 + nValues / 1000) * 1000
347 : (1 + nValues / 10000) * 10000;
348 break;
349
350 case TSG_Array_Growth::SG_ARRAY_GROWTH_2:
351 nBuffer = nValues < 100 ? nValues
352 : nValues < 1000 ? (1 + nValues / 10) * 10
353 : nValues < 10000 ? (1 + nValues / 100) * 100
354 : nValues < 100000 ? (1 + nValues / 1000) * 1000
355 : (1 + nValues / 10000) * 10000;
356 break;
357
358 case TSG_Array_Growth::SG_ARRAY_GROWTH_3:
359 nBuffer = nValues < 1000 ? (1 + nValues / 1000) * 1000
360 : nValues < 10000 ? (1 + nValues / 10000) * 10000
361 : nValues < 100000 ? (1 + nValues / 100000) * 100000
362 : (1 + nValues / 1000000) * 1000000;
363 break;
364
365 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_8 : nBuffer = (1 + nValues / 8) * 8; break;
366 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_16 : nBuffer = (1 + nValues / 16) * 16; break;
367 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_32 : nBuffer = (1 + nValues / 32) * 32; break;
368 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_64 : nBuffer = (1 + nValues / 64) * 64; break;
369 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_128 : nBuffer = (1 + nValues / 128) * 128; break;
370 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_256 : nBuffer = (1 + nValues / 256) * 256; break;
371 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_512 : nBuffer = (1 + nValues / 512) * 512; break;
372 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_1024: nBuffer = (1 + nValues / 1024) * 1024; break;
373 }
374
375 //-----------------------------------------------------
376 if( nBuffer == m_nBuffer )
377 {
378 m_nValues = nValues;
379
380 return( true );
381 }
382
383 //-----------------------------------------------------
384 void *Values = SG_Realloc(m_Values, nBuffer * m_Value_Size);
385
386 if( Values )
387 {
388 m_nBuffer = nBuffer;
389 m_nValues = nValues;
390 m_Values = Values;
391
392 return( true );
393 }
394
395 return( false );
396 }
397
398 //---------------------------------------------------------
399 bool CSG_Array::Set_Array(sLong nValues, void **pArray, bool bShrink)
400 {
401 if( Set_Array(nValues, bShrink) )
402 {
403 *pArray = m_Values;
404
405 return( true );
406 }
407
408 *pArray = m_Values;
409
410 return( false );
411 }
412
413 //---------------------------------------------------------
414 bool CSG_Array::Inc_Array (sLong nValues)
415 {
416 return( Set_Array(m_nValues + nValues) );
417 }
418
419 bool CSG_Array::Inc_Array (void **pArray)
420 {
421 return( Set_Array(m_nValues + 1, pArray) );
422 }
423
424 //---------------------------------------------------------
425 bool CSG_Array::Dec_Array (bool bShrink)
426 {
427 return( m_nValues > 0 ? Set_Array(m_nValues - 1, bShrink) : false );
428 }
429
430 bool CSG_Array::Dec_Array (void **pArray, bool bShrink)
431 {
432 return( m_nValues > 0 ? Set_Array(m_nValues - 1, pArray, bShrink) : false );
433 }
434
435 //---------------------------------------------------------
436 bool CSG_Array::Del_Entry(sLong Index, bool bShrink)
437 {
438 if( Index >= 0 && Index < m_nValues )
439 {
440 if( Index < m_nValues - 1 )
441 {
442 char *ip = (char *)m_Values + Index * m_Value_Size; char *jp = ip + m_Value_Size;
443
444 for(sLong i=Index, j=Index+1; j<m_nValues; i++, j++, ip+=m_Value_Size, jp+=m_Value_Size)
445 {
446 for(size_t k=0; k<m_Value_Size; k++)
447 {
448 ip[k] = jp[k];
449 }
450 }
451 }
452
453 Set_Array(m_nValues - 1, bShrink);
454
455 return( true );
456 }
457
458 return( false );
459 }
460
461
463 // //
464 // //
465 // //
467
468 //---------------------------------------------------------
469 void ** CSG_Array_Pointer::Create(const CSG_Array_Pointer &Array)
470 {
471 m_Array.Create(Array.m_Array);
472
473 return( (void **)m_Array.Get_Array() );
474 }
475
476 //---------------------------------------------------------
477 void ** CSG_Array_Pointer::Create(sLong nValues, TSG_Array_Growth Growth)
478 {
479 m_Array.Create(sizeof(void *), nValues, Growth);
480
481 return( (void **)m_Array.Get_Array() );
482 }
483
484 //---------------------------------------------------------
485 bool CSG_Array_Pointer::Add(void *Value)
486 {
487 if( Inc_Array() )
488 {
489 Get_Array()[Get_Size() - 1] = Value;
490
491 return( true );
492 }
493
494 return( false );
495 }
496
497 //---------------------------------------------------------
498 bool CSG_Array_Pointer::Add(const CSG_Array_Pointer &Array)
499 {
500 for(sLong i=0; i<Array.Get_Size(); i++)
501 {
502 if( Add(Array[i]) == false )
503 {
504 return( false );
505 }
506 }
507
508 return( true );
509 }
510
511 //---------------------------------------------------------
512 bool CSG_Array_Pointer::Del(sLong Index)
513 {
514 if( Index < Get_Size() )
515 {
516 for(sLong i=Index+1; i<Get_Size(); i++, Index++)
517 {
518 (*this)[Index] = (*this)[i];
519 }
520
521 return( Dec_Array() );
522 }
523
524 return( false );
525 }
526
527 //---------------------------------------------------------
528 sLong CSG_Array_Pointer::Del(void *Value)
529 {
530 sLong n = 0;
531
532 for(sLong i=Get_Size(); i>0; i--)
533 {
534 if( Value == (*this)[i - 1] && Del(i - 1) )
535 {
536 n++;
537 }
538 }
539
540 return( n );
541 }
542
543
545 // //
546 // //
547 // //
549
550 //---------------------------------------------------------
551 int * CSG_Array_Int::Create(const CSG_Array_Int &Array)
552 {
553 m_Array.Create(Array.m_Array);
554
555 return( (int *)m_Array.Get_Array() );
556 }
557
558 //---------------------------------------------------------
559 int * CSG_Array_Int::Create(sLong nValues, TSG_Array_Growth Growth)
560 {
561 m_Array.Create(sizeof(int), nValues, Growth);
562
563 return( (int *)m_Array.Get_Array() );
564 }
565
566 //---------------------------------------------------------
567 bool CSG_Array_Int::Add(int Value)
568 {
569 if( Inc_Array() )
570 {
571 Get_Array()[Get_Size() - 1] = Value;
572
573 return( true );
574 }
575
576 return( false );
577 }
578
579 //---------------------------------------------------------
580 bool CSG_Array_Int::Add(const CSG_Array_Int &Array)
581 {
582 for(sLong i=0; i<Array.Get_Size(); i++)
583 {
584 if( Add(Array[i]) == false )
585 {
586 return( false );
587 }
588 }
589
590 return( true );
591 }
592
593 //---------------------------------------------------------
594 bool CSG_Array_Int::Assign(int Value)
595 {
596 for(sLong i=0; i<Get_Size(); i++)
597 {
598 Get_Array()[i] = Value;
599 }
600
601 return( true );
602 }
603
604
606 // //
607 // //
608 // //
610
611 //---------------------------------------------------------
612 sLong * CSG_Array_sLong::Create(const CSG_Array_sLong &Array)
613 {
614 m_Array.Create(Array.m_Array);
615
616 return( (sLong *)m_Array.Get_Array() );
617 }
618
619 //---------------------------------------------------------
620 sLong * CSG_Array_sLong::Create(sLong nValues, TSG_Array_Growth Growth)
621 {
622 m_Array.Create(sizeof(sLong), nValues, Growth);
623
624 return( (sLong *)m_Array.Get_Array() );
625 }
626
627 //---------------------------------------------------------
628 bool CSG_Array_sLong::Add(sLong Value)
629 {
630 if( Inc_Array() )
631 {
632 Get_Array()[Get_Size() - 1] = Value;
633
634 return( true );
635 }
636
637 return( false );
638 }
639
640 //---------------------------------------------------------
641 bool CSG_Array_sLong::Add(const CSG_Array_sLong &Array)
642 {
643 for(sLong i=0; i<Array.Get_Size(); i++)
644 {
645 if( Add(Array[i]) == false )
646 {
647 return( false );
648 }
649 }
650
651 return( true );
652 }
653
654 //---------------------------------------------------------
655 bool CSG_Array_sLong::Assign(sLong Value)
656 {
657 for(sLong i=0; i<Get_Size(); i++)
658 {
659 Get_Array()[i] = Value;
660 }
661
662 return( true );
663 }
664
665
667 // //
668 // //
669 // //
671
672 //---------------------------------------------------------
673 CSG_Buffer::CSG_Buffer(void)
674 {
675 m_Data = NULL;
676 m_Size = 0;
677 }
678
679 bool CSG_Buffer::Create(void)
680 {
681 Destroy();
682
683 return( true );
684 }
685
686 //---------------------------------------------------------
687 CSG_Buffer::CSG_Buffer(const CSG_Buffer &Buffer)
688 {
689 m_Data = NULL;
690 m_Size = 0;
691
692 Create(Buffer);
693 }
694
695 bool CSG_Buffer::Create(const CSG_Buffer &Buffer)
696 {
697 return( Set_Data(Buffer.m_Data, Buffer.m_Size) );
698 }
699
700 //---------------------------------------------------------
701 CSG_Buffer::CSG_Buffer(size_t Size)
702 {
703 m_Data = NULL;
704 m_Size = 0;
705
706 Create(Size);
707 }
708
709 bool CSG_Buffer::Create(size_t Size)
710 {
711 return( Set_Size(Size) );
712 }
713
714 //---------------------------------------------------------
715 CSG_Buffer::~CSG_Buffer(void)
716 {
717 Destroy();
718 }
719
720 void CSG_Buffer::Destroy(void)
721 {
722 if( m_Data )
723 {
724 SG_Free(m_Data);
725 }
726
727 m_Data = NULL;
728 m_Size = 0;
729 }
730
731 //---------------------------------------------------------
732 bool CSG_Buffer::Set_Size(size_t Size, bool bShrink)
733 {
734 if( Size < 1 )
735 {
736 Destroy();
737 }
738 else if( Size > m_Size || (Size < m_Size && bShrink) )
739 {
740 char *Data = (char *)SG_Realloc(m_Data, Size * sizeof(char));
741
742 if( !Data )
743 {
744 return( false );
745 }
746
747 m_Data = Data;
748 m_Size = Size;
749 }
750
751 return( true );
752 }
753
754 //---------------------------------------------------------
755 bool CSG_Buffer::Set_Data(const char *Data, size_t Size, bool bShrink)
756 {
757 if( !Data || !Size || !Set_Size(Size, bShrink) )
758 {
759 return( false );
760 }
761
762 memcpy(m_Data, Data, m_Size);
763
764 return( true );
765 }
766
767
769 // //
770 // //
771 // //
773
774 //---------------------------------------------------------
775 CSG_Bytes::CSG_Bytes(void)
776 {
777 m_Bytes = NULL;
778 m_nBytes = 0;
779 m_nBuffer = 0;
780 m_Cursor = 0;
781 }
782
783 //---------------------------------------------------------
784 bool CSG_Bytes::Create(void)
785 {
786 return( Destroy() );
787 }
788
789 //---------------------------------------------------------
790 CSG_Bytes::CSG_Bytes(const CSG_Bytes &Bytes)
791 {
792 m_Bytes = NULL;
793 m_nBytes = 0;
794 m_nBuffer = 0;
795 m_Cursor = 0;
796
797 Create(Bytes);
798 }
799
800 bool CSG_Bytes::Create(const CSG_Bytes &Bytes)
801 {
802 return( Assign(Bytes) );
803 }
804
805 //---------------------------------------------------------
806 CSG_Bytes::CSG_Bytes(const BYTE *Bytes, int nBytes)
807 {
808 m_Bytes = NULL;
809 m_nBytes = 0;
810 m_nBuffer = 0;
811 m_Cursor = 0;
812
813 Create(Bytes, nBytes);
814 }
815
816 bool CSG_Bytes::Create(const BYTE *Bytes, int nBytes)
817 {
818 Destroy();
819
820 return( Add((void *)Bytes, nBytes, false) );
821 }
822
823 //---------------------------------------------------------
824 CSG_Bytes::~CSG_Bytes(void)
825 {
826 Destroy();
827 }
828
829 bool CSG_Bytes::Destroy(void)
830 {
831 if( m_Bytes )
832 {
833 SG_Free(m_Bytes);
834 }
835
836 m_Bytes = NULL;
837 m_nBytes = 0;
838 m_nBuffer = 0;
839 m_Cursor = 0;
840
841 return( true );
842 }
843
844 bool CSG_Bytes::Clear(void)
845 {
846 m_nBytes = 0;
847 m_Cursor = 0;
848
849 return( true );
850 }
851
852
854 // //
856
857 //---------------------------------------------------------
858 bool CSG_Bytes::_Inc_Array(int nBytes)
859 {
860 if( m_nBuffer < m_nBytes + nBytes )
861 {
862 int nBuffer = m_nBuffer + nBytes + 1024;
863 BYTE *Bytes = (BYTE *)SG_Realloc(m_Bytes, nBuffer * sizeof(BYTE));
864
865 if( !Bytes )
866 {
867 return( false );
868 }
869
870 m_Bytes = Bytes;
871 m_nBuffer = nBuffer;
872 }
873
874 m_nBytes += nBytes;
875
876 return( true );
877 }
878
879
881 // //
883
884 //---------------------------------------------------------
885 bool CSG_Bytes::Assign(const CSG_Bytes &Bytes)
886 {
887 Destroy();
888
889 if( _Inc_Array(Bytes.m_nBytes) )
890 {
891 memcpy(m_Bytes, Bytes.m_Bytes, m_nBytes);
892
893 return( true );
894 }
895
896 return( false );
897 }
898
899
901 // //
903
904 //---------------------------------------------------------
905 bool CSG_Bytes::Add(const CSG_Bytes &Bytes)
906 {
907 return( Add(Bytes.m_Bytes, Bytes.m_nBytes, false) );
908 }
909
910 //---------------------------------------------------------
911 bool CSG_Bytes::Add(void *Bytes, int nBytes, bool bSwapBytes)
912 {
913 int Offset = m_nBytes;
914
915 if( _Inc_Array(nBytes) )
916 {
917 memcpy(m_Bytes + Offset, Bytes, nBytes);
918
919 if( bSwapBytes )
920 {
921 SG_Swap_Bytes(m_Bytes + Offset, nBytes);
922 }
923
924 return( true );
925 }
926
927 return( false );
928 }
929
930
932 // //
934
935 //---------------------------------------------------------
936 BYTE SG_Hex_to_Byte (const SG_Char Hex)
937 {
938 switch( Hex )
939 {
940 case '1': return( 1 );
941 case '2': return( 2 );
942 case '3': return( 3 );
943 case '4': return( 4 );
944 case '5': return( 5 );
945 case '6': return( 6 );
946 case '7': return( 7 );
947 case '8': return( 8 );
948 case '9': return( 9 );
949 case 'a': case 'A': return( 10 );
950 case 'b': case 'B': return( 11 );
951 case 'c': case 'C': return( 12 );
952 case 'd': case 'D': return( 13 );
953 case 'e': case 'E': return( 14 );
954 case 'f': case 'F': return( 15 );
955 }
956
957 return( 0 );
958 }
959
960
962 // //
964
965 //---------------------------------------------------------
966 CSG_String CSG_Bytes::toHexString(void) const
967 {
968 CSG_String HexString;
969
970 for(int i=0; i<m_nBytes; i++)
971 {
972 HexString += CSG_String::Format(SG_T("%02X"), m_Bytes[i]);
973 }
974
975 return( HexString );
976 }
977
978 //---------------------------------------------------------
979 bool CSG_Bytes::fromHexString(const CSG_String &HexString)
980 {
981 Destroy();
982
983 const SG_Char *s = HexString.c_str();
984
985 for(size_t i=0; i<HexString.Length(); i+=2, s+=2)
986 {
987 Add((BYTE)(SG_Hex_to_Byte(s[1]) + 16 * SG_Hex_to_Byte(s[0])));
988 }
989
990 return( true );
991 }
992
993
995 // //
996 // //
997 // //
999
1000 //---------------------------------------------------------
1001 CSG_Bytes_Array::CSG_Bytes_Array(void)
1002 {
1003 m_pBytes = NULL;
1004 m_nBytes = 0;
1005 m_nBuffer = 0;
1006 }
1007
1008 //---------------------------------------------------------
1009 CSG_Bytes_Array::~CSG_Bytes_Array(void)
1010 {
1011 Destroy();
1012 }
1013
1014 //---------------------------------------------------------
1015 bool CSG_Bytes_Array::Destroy(void)
1016 {
1017 if( m_pBytes )
1018 {
1019 for(int i=0; i<m_nBytes; i++)
1020 {
1021 delete(m_pBytes[i]);
1022 }
1023
1024 SG_Free(m_pBytes);
1025 }
1026
1027 m_pBytes = NULL;
1028 m_nBytes = 0;
1029 m_nBuffer = 0;
1030
1031 return( true );
1032 }
1033
1034 //---------------------------------------------------------
1035 CSG_Bytes * CSG_Bytes_Array::Add(void)
1036 {
1037 if( m_nBytes >= m_nBuffer )
1038 {
1039 CSG_Bytes **pBytes = (CSG_Bytes **)SG_Realloc(m_pBytes, ((uLong)m_nBuffer + 256) * sizeof(CSG_Bytes *));
1040
1041 if( !pBytes )
1042 {
1043 return( NULL );
1044 }
1045
1046 m_pBytes = pBytes;
1047 m_nBuffer += 256;
1048 }
1049
1050 return( m_pBytes[m_nBytes++] = new CSG_Bytes );
1051 }
1052
1053
1055 // //
1056 // //
1057 // //
1059
1060 //---------------------------------------------------------
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Array_sLong::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:495
SG_Hex_to_Byte
BYTE SG_Hex_to_Byte(const SG_Char Hex)
Definition: api_memory.cpp:936
SG_Malloc
void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
SG_Mem_Get_Double
double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
Definition: api_memory.cpp:200
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Bytes::Destroy
bool Destroy(void)
Definition: api_memory.cpp:829
SG_Realloc
void * SG_Realloc(void *memblock, size_t new_size)
Definition: api_memory.cpp:77
CSG_Array_Int::Add
bool Add(int Value)
Definition: api_memory.cpp:567
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_Array_Int::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:434
CSG_Bytes::~CSG_Bytes
virtual ~CSG_Bytes(void)
Definition: api_memory.cpp:824
CSG_Array_Int::Create
int * Create(const CSG_Array_Int &Array)
Definition: api_memory.cpp:551
CSG_Buffer::~CSG_Buffer
virtual ~CSG_Buffer(void)
Definition: api_memory.cpp:715
CSG_Bytes::toHexString
CSG_String toHexString(void) const
Definition: api_memory.cpp:966
SG_Mem_Get_Int
int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
Definition: api_memory.cpp:177
CSG_Array_sLong::Create
sLong * Create(const CSG_Array_sLong &Array)
Definition: api_memory.cpp:612
CSG_Array::Del_Entry
bool Del_Entry(sLong Index, bool bShrink=true)
Definition: api_memory.cpp:436
api_core.h
CSG_Buffer::CSG_Buffer
CSG_Buffer(void)
Definition: api_memory.cpp:673
CSG_Array_Int::Get_Array
int * Get_Array(void) const
Definition: api_core.h:437
CSG_Array_sLong::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:488
CSG_Array_Pointer::Create
void ** Create(const CSG_Array_Pointer &Array)
Definition: api_memory.cpp:469
CSG_Buffer::Set_Size
bool Set_Size(size_t Size, bool bShrink=true)
Definition: api_memory.cpp:732
CSG_Bytes::Add
bool Add(const CSG_Bytes &Bytes)
Definition: api_memory.cpp:905
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
CSG_Bytes_Array::Add
CSG_Bytes * Add(void)
Definition: api_memory.cpp:1035
CSG_Bytes::CSG_Bytes
CSG_Bytes(void)
Definition: api_memory.cpp:775
CSG_Bytes_Array::CSG_Bytes_Array
CSG_Bytes_Array(void)
Definition: api_memory.cpp:1001
CSG_Bytes::Clear
bool Clear(void)
Definition: api_memory.cpp:844
SG_Calloc
void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
CSG_Array_sLong::Assign
bool Assign(sLong Value)
Definition: api_memory.cpp:655
CSG_Buffer
Definition: api_core.h:224
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
CSG_Buffer::Destroy
void Destroy(void)
Definition: api_memory.cpp:720
CSG_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:291
CSG_Array_Int::Assign
bool Assign(int Value)
Definition: api_memory.cpp:594
SG_Free
void SG_Free(void *memblock)
Definition: api_memory.cpp:83
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Array_Pointer::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:389
SG_Mem_Set_Int
void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
Definition: api_memory.cpp:189
CSG_Array_Int
Definition: api_core.h:421
CSG_Bytes_Array::~CSG_Bytes_Array
virtual ~CSG_Bytes_Array(void)
Definition: api_memory.cpp:1009
CSG_Bytes::fromHexString
bool fromHexString(const CSG_String &HexString)
Definition: api_memory.cpp:979
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Bytes::Assign
bool Assign(const CSG_Bytes &Bytes)
Definition: api_memory.cpp:885
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Bytes::Create
bool Create(void)
Definition: api_memory.cpp:784
CSG_Array::~CSG_Array
~CSG_Array(void)
Definition: api_memory.cpp:286
CSG_Bytes
Definition: api_core.h:804
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Buffer::Set_Data
bool Set_Data(const char *Data, size_t Size, bool bShrink=true)
Definition: api_memory.cpp:755
CSG_Array_Int::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:441
SG_Mem_Set_Double
void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
Definition: api_memory.cpp:212
CSG_Array::Set_Growth
bool Set_Growth(TSG_Array_Growth Growth)
Definition: api_memory.cpp:302
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Array::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_memory.cpp:425
CSG_Buffer::Create
bool Create(void)
Definition: api_memory.cpp:679
TSG_Array_Growth::SG_ARRAY_GROWTH_0
@ SG_ARRAY_GROWTH_0
CSG_Array_sLong::Get_Array
sLong * Get_Array(void) const
Definition: api_core.h:491
CSG_Bytes_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:1015
SG_Swap_Bytes
void SG_Swap_Bytes(void *Buffer, int nBytes)
Definition: api_memory.cpp:154
CSG_Array_Pointer::Add
bool Add(void *Value)
Definition: api_memory.cpp:485
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_Array_sLong::Add
bool Add(sLong Value)
Definition: api_memory.cpp:628
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Array_sLong
Definition: api_core.h:475
CSG_Array::CSG_Array
CSG_Array(void)
Definition: api_memory.cpp:230
uLong
unsigned long long uLong
Definition: api_core.h:159
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_string.cpp File Reference

  • saga_core
  • saga_api
Functions
api_string.cpp File Reference
#include <math.h>
#include <wx/string.h>
#include <wx/datetime.h>
#include <wx/tokenzr.h>
#include <wx/wxcrt.h>
#include <wx/wxcrtvararg.h>
#include <wx/convauto.h>
#include "api_core.h"
#include "mat_tools.h"

Go to the source code of this file.

Functions

CSG_String | operator+ (const char *A, const CSG_String &B)
CSG_String | operator+ (const wchar_t *A, const CSG_String &B)
CSG_String | operator+ (char A, const CSG_String &B)
CSG_String | operator+ (wchar_t A, const CSG_String &B)
bool | SG_is_Character_Numeric (int Character)
CSG_String | SG_Get_CurrentTimeStr (bool bWithDate)
CSG_String | SG_Double_To_Degree (double Value)
double | SG_Degree_To_Double (const CSG_String &String)
int | SG_Get_Significant_Decimals (double Value, int maxDecimals)
void | SG_Flip_Decimal_Separators (CSG_String &String)
CSG_String | SG_Get_String (double Value, int Precision)
CSG_String | SG_Get_String (int Value, int Precision)
CSG_Strings | SG_String_Tokenize (const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)

Function Documentation

◆ operator+() [1/4]

CSG_String operator+ | ( | char | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 491 of file api_string.cpp.

References A, and B.

◆ operator+() [2/4]

CSG_String operator+ | ( | const char * | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 473 of file api_string.cpp.

References A, and B.

◆ operator+() [3/4]

CSG_String operator+ | ( | const wchar_t * | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 482 of file api_string.cpp.

References A, and B.

◆ operator+() [4/4]

CSG_String operator+ | ( | wchar_t | A,
 |  | const CSG_String & | B
 | ) |  |

Definition at line 500 of file api_string.cpp.

References A, and B.

◆ SG_Degree_To_Double()

double SG_Degree_To_Double ( const CSG_String & String )

Definition at line 1240 of file api_string.cpp.

References CSG_String::AfterFirst(), CSG_String::asDouble(), and CSG_String::BeforeFirst().

Referenced by CSG_Parameter_Degree::_Set_Value().

◆ SG_Double_To_Degree()

CSG_String SG_Double_To_Degree ( double Value )

Definition at line 1210 of file api_string.cpp.

References CSG_String::Printf(), SG_Char, SG_Get_Significant_Decimals(), and SG_T.

Referenced by CSG_Parameter_Degree::_Set_String().

◆ SG_Flip_Decimal_Separators()

void SG_Flip_Decimal_Separators ( CSG_String & String )

Definition at line 1304 of file api_string.cpp.

References CSG_String::Length(), CSG_String::Set_Char(), and SG_T.

◆ SG_Get_CurrentTimeStr()

CSG_String SG_Get_CurrentTimeStr ( bool bWithDate )

Definition at line 1184 of file api_string.cpp.

References CSG_String::Append(), and SG_T.

◆ SG_Get_Significant_Decimals()

int SG_Get_Significant_Decimals | ( | double | Value,
 |  | int | maxDecimals
 | ) |  |

Definition at line 1274 of file api_string.cpp.

Referenced by CSG_Parameter_Double::_Serialize(), CSG_Parameter_Range::_Serialize(), CSG_Parameter_Double::_Set_String(), CSG_Parameter_Range::_Set_String(), CSG_Grid_System::Get_Name(), SG_Double_To_Degree(), and SG_Get_String().

◆ SG_Get_String() [1/2]

CSG_String SG_Get_String | ( | double | Value,
 |  | int | Precision
 | ) |  |

Returns floating point number 'Value' as formatted string. The format depends on the 'Precision' value. If Precision is -99 (the default) it will simply use f format. If 'Precision' is -98 the string will always be formatted with the e format specification (i.e. scientific: d.dddd e dd). If Precision is zero (= 0) no decimals will be printed If Precision is positive (> 0) it specifies the fix number of decimals ("%.*f", Precision, Value), if negative only significant decimals will be plotted up to a maximum of the absolute value of 'Precision' digits.

Definition at line 1337 of file api_string.cpp.

References CSG_String::Left(), CSG_String::Length(), CSG_String::Printf(), CSG_String::Replace(), and SG_Get_Significant_Decimals().

Referenced by CSG_MetaData::Add_Child(), CSG_Table_Value_Double::asString(), CSG_Grids::Get_Grid_Name(), CSG_MetaData::Ins_Child(), CSG_Classifier_Supervised::Print(), and SG_Get_String().

◆ SG_Get_String() [2/2]

CSG_String SG_Get_String | ( | int | Value,
 |  | int | Precision
 | ) |  |

Definition at line 1387 of file api_string.cpp.

References CSG_String::Format(), and SG_Get_String().

◆ SG_is_Character_Numeric()

bool SG_is_Character_Numeric ( int Character )

Definition at line 1150 of file api_string.cpp.

◆ SG_String_Tokenize()

CSG_Strings SG_String_Tokenize | ( | const CSG_String & | String,
 |  | const CSG_String & | Delimiters,
 |  | TSG_String_Tokenizer_Mode | Mode
 | ) |  |

Definition at line 1493 of file api_string.cpp.

References CSG_String_Tokenizer::Get_Next_Token(), and CSG_String_Tokenizer::Has_More_Tokens().

Referenced by CSG_Projection::is_Equal(), CSG_Parameter_Choice::Set_Items(), and SG_Initialize_Environment().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_string.cpp Source File

  • saga_core
  • saga_api
api_string.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_string.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <math.h>
54
55 #include <wx/string.h>
56 #include <wx/datetime.h>
57 #include <wx/tokenzr.h>
58 #include <wx/wxcrt.h>
59 #include <wx/wxcrtvararg.h>
60 #include <wx/convauto.h>
61
62 #include "api_core.h"
63 #include "mat_tools.h"
64
65
67 // //
68 // //
69 // //
71
72 //---------------------------------------------------------
73 CSG_String::CSG_String(void)
74 {
75 m_pString = new wxString;
76 }
77
78 CSG_String::CSG_String(const CSG_String &String)
79 {
80 m_pString = new wxString(*String.m_pString);
81 }
82
83 CSG_String::CSG_String(const char *String)
84 {
85 m_pString = String ? new wxString(String) : new wxString;
86 }
87
88 CSG_String::CSG_String(const wchar_t *String)
89 {
90 m_pString = String ? new wxString(String) : new wxString;
91 }
92
93 CSG_String::CSG_String(char Character, size_t nRepeat)
94 {
95 m_pString = new wxString(Character, nRepeat);
96 }
97
98 CSG_String::CSG_String(wchar_t Character, size_t nRepeat)
99 {
100 m_pString = new wxString(Character, nRepeat);
101 }
102
103 //---------------------------------------------------------
104 CSG_String::CSG_String(const class wxString *String)
105 {
106 m_pString = String ? new wxString(*String) : new wxString;
107 }
108
109 bool CSG_String::Create(const class wxString *pString)
110 {
111 if( pString )
112 *m_pString = *pString;
113 else
114 m_pString->Clear();
115
116 return( true );
117 }
118
119 //---------------------------------------------------------
120 CSG_String::~CSG_String(void)
121 {
122 delete(m_pString);
123 }
124
125
127 // //
129
130 //---------------------------------------------------------
131 CSG_String & CSG_String::operator = (const CSG_String &String)
132 {
133 *m_pString = *String.m_pString;
134
135 return( *this );
136 }
137
138 CSG_String & CSG_String::operator = (const char *String)
139 {
140 *m_pString = String;
141
142 return( *this );
143 }
144
145 CSG_String & CSG_String::operator = (const wchar_t *String)
146 {
147 *m_pString = String;
148
149 return( *this );
150 }
151
152 CSG_String & CSG_String::operator = (char Character)
153 {
154 *m_pString = Character;
155
156 return( *this );
157 }
158
159 CSG_String & CSG_String::operator = (wchar_t Character)
160 {
161 *m_pString = Character;
162
163 return( *this );
164 }
165
166
168 // //
170
171 //---------------------------------------------------------
172 size_t CSG_String::Length(void) const
173 {
174 return( m_pString->Length() );
175 }
176
177 //---------------------------------------------------------
178 bool CSG_String::is_Empty(void) const
179 {
180 return( m_pString->IsEmpty() );
181 }
182
183
185 // //
187
188 //---------------------------------------------------------
189 SG_Char CSG_String::operator [] (int i) const
190 {
191 if( i >= 0 && i < (int)Length() )
192 {
193 return( m_pString->GetChar(i) );
194 }
195
196 return( SG_T('\0') );
197 }
198
199 SG_Char CSG_String::operator [] (size_t i) const
200 {
201 if( i < Length() )
202 {
203 return( m_pString->GetChar(i) );
204 }
205
206 return( SG_T('\0') );
207 }
208
209 SG_Char CSG_String::Get_Char(size_t i) const
210 {
211 if( i < Length() )
212 {
213 return( m_pString->GetChar(i) );
214 }
215
216 return( SG_T('\0') );
217 }
218
219 //---------------------------------------------------------
220 void CSG_String::Set_Char(size_t i, char Character)
221 {
222 m_pString->SetChar(i, Character);
223 }
224
225 void CSG_String::Set_Char(size_t i, wchar_t Character)
226 {
227 m_pString->SetChar(i, Character);
228 }
229
230
232 // //
234
235 //---------------------------------------------------------
236 const SG_Char * CSG_String::c_str(void) const
237 {
238 return( m_pString->c_str() );
239 }
240
241 //---------------------------------------------------------
242 const char * CSG_String::b_str(void) const
243 {
244 return( *m_pString );
245 }
246
247 //---------------------------------------------------------
248 const wchar_t * CSG_String::w_str(void) const
249 {
250 return( m_pString->wc_str() );
251 }
252
253
255 // //
257
258 //---------------------------------------------------------
259 void CSG_String::Clear(void)
260 {
261 m_pString->Clear();
262 }
263
264
266 // //
268
269 //---------------------------------------------------------
270 CSG_String CSG_String::Format(const char *Format, ...)
271 {
272 CSG_String s;
273
274 #ifdef _SAGA_LINUX
275 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
276 va_list argptr; va_start(argptr, _Format);
277 s.m_pString->PrintfV(_Format, argptr);
278 #else
279 va_list argptr; va_start(argptr, Format);
280 s.m_pString->PrintfV(Format, argptr);
281 #endif
282
283 va_end(argptr);
284
285 return( s );
286 }
287
288 //---------------------------------------------------------
289 CSG_String CSG_String::Format(const wchar_t *Format, ...)
290 {
291 CSG_String s;
292
293 #ifdef _SAGA_LINUX
294 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
295 va_list argptr; va_start(argptr, _Format);
296 s.m_pString->PrintfV(_Format, argptr);
297 #else
298 va_list argptr; va_start(argptr, Format);
299 s.m_pString->PrintfV(Format, argptr);
300 #endif
301
302 va_end(argptr);
303
304 return( s );
305 }
306
307 //---------------------------------------------------------
308 int CSG_String::Printf(const char *Format, ...)
309 {
310 #ifdef _SAGA_LINUX
311 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
312 va_list argptr; va_start(argptr, _Format);
313 int Result = m_pString->PrintfV(_Format, argptr);
314 #else
315 va_list argptr; va_start(argptr, Format);
316 int Result = m_pString->PrintfV(Format, argptr);
317 #endif
318
319 va_end(argptr);
320
321 return( Result );
322 }
323
324 //---------------------------------------------------------
325 int CSG_String::Printf(const wchar_t *Format, ...)
326 {
327 #ifdef _SAGA_LINUX
328 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
329 va_list argptr; va_start(argptr, _Format);
330 int Result = m_pString->PrintfV(_Format, argptr);
331 #else
332 va_list argptr; va_start(argptr, Format);
333 int Result = m_pString->PrintfV(Format, argptr);
334 #endif
335
336 va_end(argptr);
337
338 return( Result );
339 }
340
341
343 // //
345
346 //---------------------------------------------------------
347 CSG_String & CSG_String::Prepend(const CSG_String &String)
348 {
349 m_pString->Prepend(*String.m_pString);
350
351 return( *this );
352 }
353
354 //---------------------------------------------------------
355 CSG_String & CSG_String::Append(const CSG_String &String)
356 {
357 m_pString->Append(*String.m_pString);
358
359 return( *this );
360 }
361
362 //---------------------------------------------------------
363 CSG_String & CSG_String::Append(const char *String)
364 {
365 m_pString->Append(String);
366
367 return( *this );
368 }
369
370 //---------------------------------------------------------
371 CSG_String & CSG_String::Append(const wchar_t *String)
372 {
373 m_pString->Append(String);
374
375 return( *this );
376 }
377
378 //---------------------------------------------------------
379 CSG_String & CSG_String::Append(char Character, size_t nRepeat)
380 {
381 m_pString->Append(Character, nRepeat);
382
383 return( *this );
384 }
385
386 //---------------------------------------------------------
387 CSG_String & CSG_String::Append(wchar_t Character, size_t nRepeat)
388 {
389 m_pString->Append(Character, nRepeat);
390
391 return( *this );
392 }
393
394 //---------------------------------------------------------
395 void CSG_String::operator += (const CSG_String &String)
396 {
397 *m_pString += *String.m_pString;
398 }
399
400 void CSG_String::operator += (const char *String)
401 {
402 *m_pString += String;
403 }
404
405 void CSG_String::operator += (const wchar_t *String)
406 {
407 *m_pString += String;
408 }
409
410 void CSG_String::operator += (char Character)
411 {
412 *m_pString += Character;
413 }
414
415 void CSG_String::operator += (wchar_t Character)
416 {
417 *m_pString += Character;
418 }
419
420
422 // //
424
425 //---------------------------------------------------------
426 CSG_String CSG_String::operator + (const CSG_String &String) const
427 {
428 CSG_String s(*this);
429
430 s += String;
431
432 return( s );
433 }
434
435 CSG_String CSG_String::operator + (const char *String) const
436 {
437 CSG_String s(*this);
438
439 s += String;
440
441 return( s );
442 }
443
444 CSG_String CSG_String::operator + (const wchar_t *String) const
445 {
446 CSG_String s(*this);
447
448 s += String;
449
450 return( s );
451 }
452
453 //---------------------------------------------------------
454 CSG_String CSG_String::operator + (char Character) const
455 {
456 CSG_String s(*this);
457
458 s += Character;
459
460 return( s );
461 }
462
463 CSG_String CSG_String::operator + (wchar_t Character) const
464 {
465 CSG_String s(*this);
466
467 s += Character;
468
469 return( s );
470 }
471
472 //---------------------------------------------------------
473 CSG_String operator + (const char *A, const CSG_String &B)
474 {
475 CSG_String s(A);
476
477 s += B;
478
479 return( s );
480 }
481
482 CSG_String operator + (const wchar_t *A, const CSG_String &B)
483 {
484 CSG_String s(A);
485
486 s += B;
487
488 return( s );
489 }
490
491 CSG_String operator + (char A, const CSG_String &B)
492 {
493 CSG_String s(A);
494
495 s += B;
496
497 return( s );
498 }
499
500 CSG_String operator + (wchar_t A, const CSG_String &B)
501 {
502 CSG_String s(A);
503
504 s += B;
505
506 return( s );
507 }
508
509
511 // //
513
514 //---------------------------------------------------------
515 int CSG_String::Cmp(const CSG_String &String) const
516 {
517 return( m_pString->Cmp(String.c_str()) );
518 }
519
520 //---------------------------------------------------------
521 int CSG_String::CmpNoCase(const CSG_String &String) const
522 {
523 return( m_pString->CmpNoCase(String.c_str()) );
524 }
525
526 //---------------------------------------------------------
527 bool CSG_String::is_Same_As(const CSG_String &String, bool bCase) const
528 {
529 return( m_pString->IsSameAs(*String.m_pString, bCase) );
530 }
531
532 bool CSG_String::is_Same_As(char Character, bool bCase) const
533 {
534 return( m_pString->IsSameAs(Character, bCase) );
535 }
536
537 bool CSG_String::is_Same_As(wchar_t Character, bool bCase) const
538 {
539 return( m_pString->IsSameAs(Character, bCase) );
540 }
541
542 //---------------------------------------------------------
543 CSG_String & CSG_String::Make_Lower(void)
544 {
545 m_pString->MakeLower();
546
547 return( *this );
548 }
549
550 //---------------------------------------------------------
551 CSG_String & CSG_String::Make_Upper(void)
552 {
553 m_pString->MakeUpper();
554
555 return( *this );
556 }
557
559 // //
561
562 //---------------------------------------------------------
563 size_t CSG_String::Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll)
564 {
565 return( m_pString->Replace(*sOld.m_pString, *sNew.m_pString, bReplaceAll) );
566 }
567
568 //---------------------------------------------------------
569 CSG_String & CSG_String::Remove(size_t pos)
570 {
571 m_pString->Remove(pos);
572
573 return( *this );
574 }
575
576 //---------------------------------------------------------
577 CSG_String & CSG_String::Remove(size_t pos, size_t len)
578 {
579 m_pString->Remove(pos, len);
580
581 return( *this );
582 }
583
584
586 // //
588
589 //---------------------------------------------------------
590 int CSG_String::Trim(bool fromRight)
591 {
592 size_t n = m_pString->Length();
593
594 m_pString->Trim(fromRight);
595
596 return( (int)(n - m_pString->Length()) );
597 }
598
599 //---------------------------------------------------------
600 int CSG_String::Trim_Both(void)
601 {
602 size_t n = m_pString->Length();
603
604 m_pString->Trim( true);
605 m_pString->Trim(false);
606
607 return( (int)(n - m_pString->Length()) );
608 }
609
610
612 // //
614
615 //---------------------------------------------------------
616 int CSG_String::Find(char Character, bool fromEnd) const
617 {
618 return( m_pString->Find(Character, fromEnd) );
619 }
620
621 int CSG_String::Find(wchar_t Character, bool fromEnd) const
622 {
623 return( m_pString->Find(Character, fromEnd) );
624 }
625
626 //---------------------------------------------------------
627 int CSG_String::Find(const CSG_String &String) const
628 {
629 return( m_pString->Find(*String.m_pString) );
630 }
631
632 //---------------------------------------------------------
633 bool CSG_String::Contains(const CSG_String &String) const
634 {
635 return( m_pString->Contains(*String.m_pString) );
636 }
637
638
640 // //
642
643 //---------------------------------------------------------
644 CSG_String CSG_String::AfterFirst(char Character) const
645 {
646 return( CSG_String(m_pString->AfterFirst(Character).c_str().AsWChar()) );
647 }
648
649 CSG_String CSG_String::AfterFirst(wchar_t Character) const
650 {
651 return( CSG_String(m_pString->AfterFirst(Character).c_str().AsWChar()) );
652 }
653
654 //---------------------------------------------------------
655 CSG_String CSG_String::AfterLast(char Character) const
656 {
657 return( CSG_String(m_pString->AfterLast(Character).c_str().AsWChar()) );
658 }
659
660 CSG_String CSG_String::AfterLast(wchar_t Character) const
661 {
662 return( CSG_String(m_pString->AfterLast(Character).c_str().AsWChar()) );
663 }
664
665 //---------------------------------------------------------
666 CSG_String CSG_String::BeforeFirst(char Character) const
667 {
668 return( CSG_String(m_pString->BeforeFirst(Character).c_str().AsWChar()) );
669 }
670
671 CSG_String CSG_String::BeforeFirst(wchar_t Character) const
672 {
673 return( CSG_String(m_pString->BeforeFirst(Character).c_str().AsWChar()) );
674 }
675
676 //---------------------------------------------------------
677 CSG_String CSG_String::BeforeLast(char Character) const
678 {
679 return( CSG_String(m_pString->BeforeLast(Character).c_str().AsWChar()) );
680 }
681
682 CSG_String CSG_String::BeforeLast(wchar_t Character) const
683 {
684 return( CSG_String(m_pString->BeforeLast(Character).c_str().AsWChar()) );
685 }
686
687
689 // //
691
692 //---------------------------------------------------------
693 CSG_String CSG_String::Right(size_t count) const
694 {
695 return( CSG_String(m_pString->Right(count).c_str().AsWChar()) );
696 }
697
698 //---------------------------------------------------------
699 CSG_String CSG_String::Mid(size_t first, size_t count) const
700 {
701 return( CSG_String(m_pString->Mid(first, count <= 0 ? Length() : count).c_str().AsWChar()) );
702 }
703
704 //---------------------------------------------------------
705 CSG_String CSG_String::Left(size_t count) const
706 {
707 return( CSG_String(m_pString->Left(count).c_str().AsWChar()) );
708 }
709
710
712 // //
714
715 //---------------------------------------------------------
716 bool CSG_String::is_Number(void) const
717 {
718 return( m_pString->IsNumber() );
719 }
720
721 //---------------------------------------------------------
722 int CSG_String::asInt(void) const
723 {
724 int Value; return( asInt(Value) ? Value : 0 );
725 }
726
727 bool CSG_String::asInt(int &Value) const
728 {
729 const wxChar *start = m_pString->c_str(); wxChar *end;
730
731 int value = wxStrtol(start, &end, 10);
732
733 if( end > start )
734 {
735 Value = value;
736
737 return( true );
738 }
739
740 return( false );
741 }
742
743 //---------------------------------------------------------
744 sLong CSG_String::asLongLong(void) const
745 {
746 sLong Value; return( asLongLong(Value) ? Value : 0 );
747 }
748
749 bool CSG_String::asLongLong(sLong &Value) const
750 {
751 if( m_pString->ToLongLong(&Value) )
752 {
753 return( true );
754 }
755
756 return( false );
757 }
758
759 //---------------------------------------------------------
760 double CSG_String::asDouble(void) const
761 {
762 double Value; return( asDouble(Value) ? Value : 0. );
763 }
764
765 bool CSG_String::asDouble(double &Value) const
766 {
767 const wxChar *start = m_pString->c_str(); wxChar *end;
768
769 double value = wxStrtod(start, &end);
770
771 if( end > start )
772 {
773 Value = value;
774
775 return( true );
776 }
777
778 return( false );
779 }
780
781
783 // //
785
786 //---------------------------------------------------------
787 CSG_String CSG_String::from_UTF8(const char *String, size_t Length)
788 {
789 CSG_String s;
790
791 if( String )
792 {
793 if( !Length )
794 {
795 Length = strlen(String);
796 }
797
798 *s.m_pString = wxString::FromUTF8(String, Length);
799 }
800
801 return( s );
802 }
803
804 //---------------------------------------------------------
812 //---------------------------------------------------------
813 size_t CSG_String::to_UTF8(char **pString) const
814 {
815 CSG_Buffer String(to_UTF8());
816
817 if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
818 {
819 memcpy(*pString, String.Get_Data(), String.Get_Size());
820
821 return( String.Get_Size() - 1 );
822 }
823
824 *pString = NULL;
825
826 return( 0 );
827 }
828
829 //---------------------------------------------------------
830 CSG_Buffer CSG_String::to_UTF8(void) const
831 {
832 CSG_Buffer String;
833
834 const wxScopedCharBuffer Buffer = m_pString->utf8_str();
835
836 String.Set_Data(Buffer.data(), Buffer.length() + 1);
837
838 return( String );
839 }
840
841
843 // //
845
846 //---------------------------------------------------------
854 //---------------------------------------------------------
855 size_t CSG_String::to_MBChar(char **pString, int Encoding) const
856 {
857 CSG_Buffer String(to_MBChar(Encoding));
858
859 if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
860 {
861 memcpy(*pString, String.Get_Data(), String.Get_Size());
862
863 return( String.Get_Size() - 1 );
864 }
865
866 *pString = NULL;
867
868 return( 0 );
869 }
870
871 //---------------------------------------------------------
872 CSG_Buffer CSG_String::to_MBChar(int Encoding) const
873 {
874 CSG_Buffer String;
875
876 wxScopedCharBuffer Buffer;
877
878 switch( Encoding ) // selecting the appropriate wxMBConv class
879 {
880 case SG_FILE_ENCODING_ANSI : Buffer = m_pString->mb_str(wxConvLibc ); break;
881 case SG_FILE_ENCODING_UTF7 : Buffer = m_pString->mb_str(wxConvUTF7 ); break;
882 case SG_FILE_ENCODING_UTF8 : Buffer = m_pString->mb_str(wxConvUTF8 ); break;
883 case SG_FILE_ENCODING_UTF16LE: Buffer = m_pString->mb_str(wxMBConvUTF16LE()); break;
884 case SG_FILE_ENCODING_UTF16BE: Buffer = m_pString->mb_str(wxMBConvUTF16BE()); break;
885 case SG_FILE_ENCODING_UTF32LE: Buffer = m_pString->mb_str(wxMBConvUTF32LE()); break;
886 case SG_FILE_ENCODING_UTF32BE: Buffer = m_pString->mb_str(wxMBConvUTF32BE()); break;
887 default : Buffer = m_pString->mb_str(wxConvAuto ()); break;
888 }
889
890 String.Set_Data(Buffer.data(), Buffer.length() + 1);
891
892 return( String );
893 }
894
895
897 // //
899
900 //---------------------------------------------------------
908 //---------------------------------------------------------
909 bool CSG_String::to_ASCII(char **pString, char Replace) const
910 {
911 CSG_Buffer String(to_ASCII());
912
913 if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
914 {
915 memcpy(*pString, String.Get_Data(), String.Get_Size());
916
917 return( true );
918 }
919
920 *pString = NULL;
921
922 return( false );
923 }
924
925 //---------------------------------------------------------
926 CSG_Buffer CSG_String::to_ASCII(char Replace) const
927 {
928 CSG_Buffer String;
929
930 #if wxCHECK_VERSION(3, 1, 0)
931 const wxScopedCharBuffer Buffer = m_pString->ToAscii(Replace);
932 #else
933 const wxScopedCharBuffer Buffer = m_pString->ToAscii();
934 #endif
935
936 String.Set_Data(Buffer.data(), Buffer.length() + 1);
937
938 return( String );
939 }
940
941
943 // //
945
946 //---------------------------------------------------------
953 //---------------------------------------------------------
954 std::string CSG_String::to_StdString(void) const
955 {
956 return( m_pString->ToStdString() );
957 }
958
959 //---------------------------------------------------------
963 //---------------------------------------------------------
964 std::wstring CSG_String::to_StdWstring(void) const
965 {
966 return( m_pString->ToStdWstring() );
967 }
968
969
971 // //
972 // //
973 // //
975
976 //---------------------------------------------------------
977 CSG_Strings::CSG_Strings(void)
978 {}
979
980 //---------------------------------------------------------
981 CSG_Strings::CSG_Strings(const CSG_Strings &Strings)
982 {
983 Create(Strings);
984 }
985
986 bool CSG_Strings::Create(const CSG_Strings &Strings)
987 {
988 Destroy();
989
990 return( Add(Strings) );
991 }
992
993 //---------------------------------------------------------
994 CSG_Strings::CSG_Strings(int nStrings, const SG_Char **Strings)
995 {
996 for(int i=0; i<nStrings; i++)
997 {
998 Add(Strings[i]);
999 }
1000 }
1001
1002 //---------------------------------------------------------
1003 CSG_Strings::~CSG_Strings(void)
1004 {
1005 Clear();
1006 }
1007
1008 //---------------------------------------------------------
1009 bool CSG_Strings::Destroy(void)
1010 {
1011 for(size_t i=0; i<Get_Size(); i++)
1012 {
1013 delete((CSG_String *)m_Strings[i]);
1014 }
1015
1016 m_Strings.Destroy();
1017
1018 return( true );
1019 }
1020
1021 //---------------------------------------------------------
1022 bool CSG_Strings::Add(const CSG_Strings &Strings)
1023 {
1024 for(size_t i=0; i<Strings.Get_Size(); i++)
1025 {
1026 Add(Strings[i]);
1027 }
1028
1029 return( true );
1030 }
1031
1032 //---------------------------------------------------------
1033 bool CSG_Strings::Add(const CSG_String &String)
1034 {
1035 size_t i = Get_Size();
1036
1037 if( m_Strings.Inc_Array() )
1038 {
1039 m_Strings[i] = new CSG_String(String);
1040
1041 return( true );
1042 }
1043
1044 return( false );
1045 }
1046
1047 //---------------------------------------------------------
1048 bool CSG_Strings::Ins(const CSG_String &String, size_t Index)
1049 {
1050 if( Index >= Get_Size() )
1051 {
1052 return( Add(String) );
1053 }
1054
1055 if( m_Strings.Inc_Array() )
1056 {
1057 for(size_t i=Get_Size()-1; i>Index; i--)
1058 {
1059 m_Strings[i] = m_Strings[i - 1];
1060 }
1061
1062 m_Strings[Index] = new CSG_String(String);
1063
1064 return( true );
1065 }
1066
1067 return( false );
1068 }
1069
1070 //---------------------------------------------------------
1071 bool CSG_Strings::Del(size_t Index)
1072 {
1073 if( Index >= Get_Size() )
1074 {
1075 return( false );
1076 }
1077
1078 delete((CSG_String *)m_Strings[Index]);
1079
1080 for(size_t i=Index+1; i<Get_Size(); i++)
1081 {
1082 m_Strings[i - 1] = m_Strings[i];
1083 }
1084
1085 m_Strings.Dec_Array();
1086
1087 return( true );
1088 }
1089
1090 //---------------------------------------------------------
1091 bool CSG_Strings::Set_Count(size_t Count)
1092 {
1093 while( Del(Count) ) {}
1094
1095 for(size_t i=Get_Size(); i<Count; i++)
1096 {
1097 Add("");
1098 }
1099
1100 return( true );
1101 }
1102
1103 //---------------------------------------------------------
1104 class CSG_Index_Compare_Strings : public CSG_Index::CSG_Index_Compare
1105 {
1106 public:
1107 CSG_String **m_Values; bool m_Ascending;
1108
1109 CSG_Index_Compare_Strings(CSG_String **Values, bool Ascending) : m_Values(Values), m_Ascending(Ascending) {}
1110
1111 virtual int Compare (const sLong _a, const sLong _b)
1112 {
1113 sLong a = m_Ascending ? _a : _b;
1114 sLong b = m_Ascending ? _b : _a;
1115
1116 return( m_Values[a]->Cmp(*m_Values[b]) );
1117 }
1118 };
1119
1120 //---------------------------------------------------------
1121 bool CSG_Strings::Sort(bool Ascending)
1122 {
1123 if( Get_Size() < 2 )
1124 {
1125 return( true );
1126 }
1127
1128 CSG_Index_Compare_Strings Compare((CSG_String **)m_Strings.Get_Array(), Ascending);
1129
1130 CSG_Index Index(Get_Count(), Compare);
1131
1132 CSG_Array_Pointer Strings(m_Strings);
1133
1134 for(size_t i=0; i<Get_Size(); i++)
1135 {
1136 m_Strings[i] = Strings[Index[i]];
1137 }
1138
1139 return( true );
1140 }
1141
1142
1144 // //
1145 // //
1146 // //
1148
1149 //---------------------------------------------------------
1150 bool SG_is_Character_Numeric(int Character)
1151 {
1152 switch( Character )
1153 {
1154 case '0':
1155 case '1':
1156 case '2':
1157 case '3':
1158 case '4':
1159 case '5':
1160 case '6':
1161 case '7':
1162 case '8':
1163 case '9':
1164 case '-':
1165 case '+':
1166 case '.':
1167 case ',':
1168 case 'e':
1169 case 'E':
1170 return( true );
1171 }
1172
1173 return( false );
1174 }
1175
1176
1178 // //
1179 // //
1180 // //
1182
1183 //---------------------------------------------------------
1184 CSG_String SG_Get_CurrentTimeStr(bool bWithDate)
1185 {
1186 CSG_String s;
1187 wxDateTime t;
1188
1189 t.SetToCurrent();
1190
1191 if( bWithDate )
1192 {
1193 s.Append(t.FormatISODate().wc_str());
1194 s.Append(SG_T("/"));
1195 }
1196
1197 s.Append(t.FormatISOTime().wc_str());
1198
1199 return( s );
1200 }
1201
1202
1204 // //
1205 // //
1206 // //
1208
1209 //---------------------------------------------------------
1210 CSG_String SG_Double_To_Degree(double Value)
1211 {
1212 SG_Char c;
1213 int d, h;
1214 double s;
1215 CSG_String String;
1216
1217 if( Value < 0.0 )
1218 {
1219 Value = -Value;
1220 c = SG_T('-');
1221 }
1222 else
1223 {
1224 c = SG_T('+');
1225 }
1226
1227 Value = fmod(Value, 360.0);
1228 d = (int)Value;
1229 Value = 60.0 * (Value - d);
1230 h = (int)Value;
1231 Value = 60.0 * (Value - h);
1232 s = Value;
1233
1234 String.Printf(SG_T("%c%03d\xb0%02d'%02.*f''"), c, d, h, SG_Get_Significant_Decimals(s), s);
1235
1236 return( String );
1237 }
1238
1239 //---------------------------------------------------------
1240 double SG_Degree_To_Double(const CSG_String &String)
1241 {
1242 double d, h, s, sig;
1243
1244 sig = 1.0;
1245 d = h = s = 0.0;
1246
1247 if( String.BeforeFirst('\xb0').asDouble(d) )
1248 {
1249 if( d < 0.0 )
1250 {
1251 sig = -1.0;
1252 d = -d;
1253 }
1254
1255 String.AfterFirst('\xb0').asDouble(h);
1256 String.AfterFirst('\'' ).asDouble(s);
1257 }
1258 else
1259 {
1260 String.asDouble(d);
1261 }
1262
1263 return( sig * (d + h / 60.0 + s / (60.0 * 60.0)) );
1264 }
1265
1266
1268 // //
1269 // //
1270 // //
1272
1273 //---------------------------------------------------------
1274 int SG_Get_Significant_Decimals(double Value, int maxDecimals)
1275 {
1276 int Decimals;
1277 double Reminder;
1278
1279 Value = fabs(Value);
1280
1281 for(Decimals=0; Decimals<maxDecimals; Decimals++)
1282 {
1283 Reminder = Value - floor(Value);
1284
1285 if( Reminder == 0.0 )
1286 {
1287 return( Decimals );
1288 }
1289
1290 Value = 10.0 * Value;
1291 }
1292
1293 return( maxDecimals );
1294 }
1295
1296
1298 // //
1299 // //
1300 // //
1302
1303 //---------------------------------------------------------
1304 void SG_Flip_Decimal_Separators(CSG_String &String)
1305 {
1306 for(size_t i=0; i<String.Length(); i++)
1307 {
1308 switch( String[i] )
1309 {
1310 case SG_T('.'): String.Set_Char(i, ','); break;
1311 case SG_T(','): String.Set_Char(i, '.'); break;
1312 }
1313 }
1314 }
1315
1316
1318 // //
1319 // //
1320 // //
1322
1323 //---------------------------------------------------------
1336 //---------------------------------------------------------
1337 CSG_String SG_Get_String(double Value, int Precision)
1338 {
1339 CSG_String s;
1340
1341 if ( Precision == -99 )
1342 {
1343 s.Printf("%f", Value);
1344 }
1345 else if( Precision == -98 )
1346 {
1347 s.Printf("%e", Value);
1348 }
1349 else if( Precision == 0 )
1350 {
1351 s.Printf("%d", (int)Value);
1352 }
1353 else if( Precision > 0 )
1354 {
1355 s.Printf("%.*f", Precision, Value);
1356 }
1357 else // if( Precision < 0 )
1358 {
1359 Precision = SG_Get_Significant_Decimals(Value, abs(Precision));
1360
1361 if( Precision == 0 )
1362 {
1363 s.Printf("%.0f", Value);
1364 }
1365 else // if( Precision > 0 )
1366 {
1367 s.Printf("%.*f", Precision, Value);
1368
1369 while( s.Length() > 1 && s[s.Length() - 1] == '0' )
1370 {
1371 s = s.Left(s.Length() - 1);
1372 }
1373
1374 if( s.Length() > 1 && (s[s.Length() - 1] == '.' || s[s.Length() - 1] == ',') )
1375 {
1376 s = s.Left(s.Length() - 1);
1377 }
1378 }
1379 }
1380
1381 s.Replace(",", ".");
1382
1383 return( s );
1384 }
1385
1386 //---------------------------------------------------------
1387 CSG_String SG_Get_String(int Value, int Precision)
1388 {
1389 if( Precision > 0 )
1390 {
1391 return( SG_Get_String((double)Value, Precision) );
1392 }
1393
1394 if( Precision < 0 )
1395 {
1396 return( CSG_String::Format("%0*d", Precision, Value) );
1397 }
1398
1399 return( CSG_String::Format("%d", Value) );
1400 }
1401
1402
1404 // //
1405 // //
1406 // //
1408
1409 //---------------------------------------------------------
1410 CSG_String_Tokenizer::CSG_String_Tokenizer(void)
1411 {
1412 m_pTokenizer = new wxStringTokenizer();
1413 }
1414
1415 //---------------------------------------------------------
1416 CSG_String_Tokenizer::CSG_String_Tokenizer(const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)
1417 {
1418 m_pTokenizer = new wxStringTokenizer();
1419
1420 Set_String(String, Delimiters, Mode);
1421 }
1422
1423 //---------------------------------------------------------
1424 CSG_String_Tokenizer::~CSG_String_Tokenizer(void)
1425 {
1426 delete(m_pTokenizer);
1427 }
1428
1429 //---------------------------------------------------------
1430 size_t CSG_String_Tokenizer::Get_Tokens_Count(void) const
1431 {
1432 return( m_pTokenizer->CountTokens() );
1433 }
1434
1435 //---------------------------------------------------------
1436 SG_Char CSG_String_Tokenizer::Get_Last_Delimiter(void) const
1437 {
1438 return( m_pTokenizer->GetLastDelimiter() );
1439 }
1440
1441 //---------------------------------------------------------
1442 CSG_String CSG_String_Tokenizer::Get_Next_Token(void)
1443 {
1444 wxString s(m_pTokenizer->GetNextToken());
1445
1446 return( &s );
1447 }
1448
1449 //---------------------------------------------------------
1450 size_t CSG_String_Tokenizer::Get_Position(void) const
1451 {
1452 return( m_pTokenizer->GetPosition() );
1453 }
1454
1455 //---------------------------------------------------------
1456 CSG_String CSG_String_Tokenizer::Get_String(void) const
1457 {
1458 wxString s(m_pTokenizer->GetString());
1459
1460 return( &s );
1461 }
1462
1463 //---------------------------------------------------------
1464 bool CSG_String_Tokenizer::Has_More_Tokens(void) const
1465 {
1466 return( m_pTokenizer->HasMoreTokens() );
1467 }
1468
1469 //---------------------------------------------------------
1470 void CSG_String_Tokenizer::Set_String(const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)
1471 {
1472 wxStringTokenizerMode _Mode;
1473
1474 switch( Mode )
1475 {
1476 default: _Mode = wxTOKEN_DEFAULT ; break;
1477 case SG_TOKEN_INVALID: _Mode = wxTOKEN_INVALID ; break;
1478 case SG_TOKEN_RET_EMPTY: _Mode = wxTOKEN_RET_EMPTY ; break;
1479 case SG_TOKEN_RET_EMPTY_ALL: _Mode = wxTOKEN_RET_EMPTY_ALL; break;
1480 case SG_TOKEN_RET_DELIMS: _Mode = wxTOKEN_RET_DELIMS ; break;
1481 case SG_TOKEN_STRTOK: _Mode = wxTOKEN_STRTOK ; break;
1482 }
1483
1484 m_pTokenizer->SetString(String.c_str(), Delimiters.c_str(), _Mode);
1485 }
1486
1487
1489 // //
1491
1492 //---------------------------------------------------------
1493 CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)
1494 {
1495 CSG_Strings Strings;
1496
1497 CSG_String_Tokenizer Tokenizer(String, Delimiters, Mode);
1498
1499 while( Tokenizer.Has_More_Tokens() )
1500 {
1501 Strings += Tokenizer.Get_Next_Token();
1502 }
1503
1504 return( Strings );
1505 }
1506
1507
1509 // //
1510 // //
1511 // //
1513
1514 //---------------------------------------------------------
CSG_Index
Definition: mat_tools.h:185
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
SG_TOKEN_INVALID
@ SG_TOKEN_INVALID
Definition: api_core.h:743
CSG_String_Tokenizer::Get_Tokens_Count
size_t Get_Tokens_Count(void) const
Definition: api_string.cpp:1430
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_String_Tokenizer::Has_More_Tokens
bool Has_More_Tokens(void) const
Definition: api_string.cpp:1464
CSG_String_Tokenizer::Get_String
CSG_String Get_String(void) const
Definition: api_string.cpp:1456
CSG_String::Append
CSG_String & Append(const CSG_String &String)
Definition: api_string.cpp:355
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_String::to_ASCII
bool to_ASCII(char **pString, char Replace='_') const
Definition: api_string.cpp:909
SG_Flip_Decimal_Separators
void SG_Flip_Decimal_Separators(CSG_String &String)
Definition: api_string.cpp:1304
CSG_String::w_str
const wchar_t * w_str(void) const
Definition: api_string.cpp:248
CSG_String::is_Number
bool is_Number(void) const
Definition: api_string.cpp:716
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
SG_Get_CurrentTimeStr
CSG_String SG_Get_CurrentTimeStr(bool bWithDate)
Definition: api_string.cpp:1184
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
CSG_Strings::Del
bool Del(int Index)
Definition: api_core.h:713
SG_Double_To_Degree
CSG_String SG_Double_To_Degree(double Value)
Definition: api_string.cpp:1210
CSG_String::~CSG_String
virtual ~CSG_String(void)
Definition: api_string.cpp:120
CSG_String::Remove
CSG_String & Remove(size_t pos)
Definition: api_string.cpp:569
SG_TOKEN_RET_EMPTY_ALL
@ SG_TOKEN_RET_EMPTY_ALL
Definition: api_core.h:746
A
#define A
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:699
CSG_Index::CSG_Index_Compare
Definition: mat_tools.h:188
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_String::operator+
CSG_String operator+(const CSG_String &String) const
Definition: api_string.cpp:426
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Strings::Ins
bool Ins(const CSG_String &String, int Index)
Definition: api_core.h:711
CSG_String::from_UTF8
static CSG_String from_UTF8(const char *String, size_t Length=0)
Definition: api_string.cpp:787
CSG_String::is_Same_As
bool is_Same_As(const CSG_String &String, bool bCase=true) const
Definition: api_string.cpp:527
CSG_Index::CSG_Index_Compare::Compare
virtual int Compare(const sLong a, const sLong b)=0
CSG_String::Make_Upper
CSG_String & Make_Upper(void)
Definition: api_string.cpp:551
SG_FILE_ENCODING_UTF32BE
@ SG_FILE_ENCODING_UTF32BE
Definition: api_core.h:550
CSG_String::Get_Char
SG_Char Get_Char(size_t i) const
Definition: api_string.cpp:209
api_core.h
CSG_String::CSG_String
CSG_String(void)
Definition: api_string.cpp:73
CSG_String::Prepend
CSG_String & Prepend(const CSG_String &String)
Definition: api_string.cpp:347
SG_String_Tokenize
CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)
Definition: api_string.cpp:1493
CSG_Strings::Create
bool Create(const CSG_Strings &Strings)
Definition: api_string.cpp:986
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_String::Create
bool Create(const class wxString *pString)
Definition: api_string.cpp:109
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SG_FILE_ENCODING_UTF7
@ SG_FILE_ENCODING_UTF7
Definition: api_core.h:545
CSG_String::to_UTF8
CSG_Buffer to_UTF8(void) const
Definition: api_string.cpp:830
CSG_String::BeforeLast
CSG_String BeforeLast(char Character) const
Definition: api_string.cpp:677
mat_tools.h
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Buffer
Definition: api_core.h:224
CSG_String::operator[]
SG_Char operator[](int i) const
Definition: api_string.cpp:189
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:590
CSG_String::to_StdString
std::string to_StdString(void) const
Definition: api_string.cpp:954
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1022
CSG_Strings::m_Strings
CSG_Array_Pointer m_Strings
Definition: api_core.h:734
CSG_Strings::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:707
SG_TOKEN_RET_EMPTY
@ SG_TOKEN_RET_EMPTY
Definition: api_core.h:745
operator+
CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Array_Pointer::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:389
SG_FILE_ENCODING_UTF32LE
@ SG_FILE_ENCODING_UTF32LE
Definition: api_core.h:549
CSG_Buffer::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:241
CSG_String::Trim_Both
int Trim_Both(void)
Definition: api_string.cpp:600
CSG_Strings::Destroy
bool Destroy(void)
Definition: api_string.cpp:1009
CSG_String::to_StdWstring
std::wstring to_StdWstring(void) const
Definition: api_string.cpp:964
CSG_Strings::~CSG_Strings
virtual ~CSG_Strings(void)
Definition: api_string.cpp:1003
CSG_Strings
Definition: api_core.h:693
CSG_Strings::Set_Count
bool Set_Count(int Count)
Definition: api_core.h:704
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
CSG_String::operator=
CSG_String & operator=(const CSG_String &String)
Definition: api_string.cpp:131
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::to_MBChar
size_t to_MBChar(char **pString, int Encoding) const
Definition: api_string.cpp:855
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
SG_FILE_ENCODING_UTF16LE
@ SG_FILE_ENCODING_UTF16LE
Definition: api_core.h:547
CSG_String_Tokenizer::CSG_String_Tokenizer
CSG_String_Tokenizer(void)
Definition: api_string.cpp:1410
CSG_Buffer::Set_Data
bool Set_Data(const char *Data, size_t Size, bool bShrink=true)
Definition: api_memory.cpp:755
SG_is_Character_Numeric
bool SG_is_Character_Numeric(int Character)
Definition: api_string.cpp:1150
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:705
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_String::operator+=
void operator+=(const CSG_String &String)
Definition: api_string.cpp:395
SG_TOKEN_STRTOK
@ SG_TOKEN_STRTOK
Definition: api_core.h:748
CSG_Array_Pointer::Destroy
void Destroy(void)
Definition: api_core.h:376
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String_Tokenizer::~CSG_String_Tokenizer
~CSG_String_Tokenizer(void)
Definition: api_string.cpp:1424
CSG_String::Contains
bool Contains(const CSG_String &String) const
Definition: api_string.cpp:633
B
#define B
CSG_String
Definition: api_core.h:557
CSG_Array_Pointer
Definition: api_core.h:368
CSG_String::Set_Char
void Set_Char(size_t i, char Character)
Definition: api_string.cpp:220
CSG_String_Tokenizer::Get_Last_Delimiter
SG_Char Get_Last_Delimiter(void) const
Definition: api_string.cpp:1436
SG_Get_Significant_Decimals
int SG_Get_Significant_Decimals(double Value, int maxDecimals)
Definition: api_string.cpp:1274
CSG_String_Tokenizer::Set_String
void Set_String(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1470
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1121
SG_Degree_To_Double
double SG_Degree_To_Double(const CSG_String &String)
Definition: api_string.cpp:1240
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_FILE_ENCODING_UTF16BE
@ SG_FILE_ENCODING_UTF16BE
Definition: api_core.h:548
CSG_String::asLongLong
sLong asLongLong(void) const
Definition: api_string.cpp:744
SG_TOKEN_RET_DELIMS
@ SG_TOKEN_RET_DELIMS
Definition: api_core.h:747
TSG_String_Tokenizer_Mode
TSG_String_Tokenizer_Mode
Definition: api_core.h:742
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_String::AfterLast
CSG_String AfterLast(char Character) const
Definition: api_string.cpp:655
CSG_String::m_pString
class wxString * m_pString
Definition: api_core.h:681
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_String_Tokenizer::Get_Position
size_t Get_Position(void) const
Definition: api_string.cpp:1450
SG_Get_String
CSG_String SG_Get_String(double Value, int Precision)
Definition: api_string.cpp:1337
CSG_String_Tokenizer
Definition: api_core.h:754
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_String_Tokenizer::Get_Next_Token
CSG_String Get_Next_Token(void)
Definition: api_string.cpp:1442
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_Strings::CSG_Strings
CSG_Strings(void)
Definition: api_string.cpp:977
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: api_translator.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions | Variables
api_translator.cpp File Reference
#include "api_core.h"
#include "table.h"

Go to the source code of this file.

Macros

#define COMPARE(Index, Text) (m_bCmpNoCase ? m_Translations[Index]->m_Text.CmpNoCase(Text) : m_Translations[Index]->m_Text.Cmp(Text))

Functions

CSG_Translator & | SG_Get_Translator (void)
const SG_Char * | SG_Translate (const CSG_String &Text)

Variables

CSG_Translator gSG_Translator

Macro Definition Documentation

◆ COMPARE

#define COMPARE | ( | Index,
 |  | Text
 | ) | (m_bCmpNoCase ? m_Translations[Index]->m_Text.CmpNoCase(Text) : m_Translations[Index]->m_Text.Cmp(Text))

Definition at line 235 of file api_translator.cpp.

Function Documentation

◆ SG_Get_Translator()

CSG_Translator& SG_Get_Translator ( void )

Definition at line 80 of file api_translator.cpp.

References gSG_Translator.

◆ SG_Translate()

const SG_Char* SG_Translate ( const CSG_String & Text )

Definition at line 93 of file api_translator.cpp.

References CSG_Translator::Get_Translation(), and gSG_Translator.

Referenced by CSG_Tool_Chain::Create().

Variable Documentation

◆ gSG_Translator

CSG_Translator gSG_Translator

Definition at line 77 of file api_translator.cpp.

Referenced by SG_Get_Translator(), and SG_Translate().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: api_translator.cpp Source File

  • saga_core
  • saga_api
api_translator.cpp
Go to the documentation of this file.
1 /**********************************************************
2 * Version $Id$
3 *********************************************************/
4
6 // //
7 // SAGA //
8 // //
9 // System for Automated Geoscientific Analyses //
10 // //
11 // Application Programming Interface //
12 // //
13 // Library: SAGA_API //
14 // //
15 //-------------------------------------------------------//
16 // //
17 // api_translator.cpp //
18 // //
19 // Copyright (C) 2005 by Olaf Conrad //
20 // //
21 //-------------------------------------------------------//
22 // //
23 // This file is part of 'SAGA - System for Automated //
24 // Geoscientific Analyses'. //
25 // //
26 // This library is free software; you can redistribute //
27 // it and/or modify it under the terms of the GNU Lesser //
28 // General Public License as published by the Free //
29 // Software Foundation, either version 2.1 of the //
30 // License, or (at your option) any later version. //
31 // //
32 // This library is distributed in the hope that it will //
33 // be useful, but WITHOUT ANY WARRANTY; without even the //
34 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
35 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
36 // License for more details. //
37 // //
38 // You should have received a copy of the GNU Lesser //
39 // General Public License along with this program; if //
40 // not, see <http://www.gnu.org/licenses/>. //
41 // //
42 //-------------------------------------------------------//
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Goettingen //
47 // Goldschmidtstr. 5 //
48 // 37077 Goettingen //
49 // Germany //
50 // //
51 // e-mail: oconrad@saga-gis.org //
52 // //
54
55 //---------------------------------------------------------
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 #include "api_core.h"
66
67 #include "table.h"
68
69
71 // //
72 // //
73 // //
75
76 //---------------------------------------------------------
77 CSG_Translator gSG_Translator;
78
79 //---------------------------------------------------------
80 CSG_Translator & SG_Get_Translator(void)
81 {
82 return( gSG_Translator );
83 }
84
85
87 // //
88 // //
89 // //
91
92 //---------------------------------------------------------
93 const SG_Char * SG_Translate(const CSG_String &Text)
94 {
95 return( gSG_Translator.Get_Translation(Text) );
96 }
97
98
100 // //
101 // //
102 // //
104
105 //---------------------------------------------------------
106 CSG_Translator::CSG_Translator(void)
107 {
108 m_nTranslations = 0;
109 m_Translations = NULL;
110 }
111
112 CSG_Translator::CSG_Translator(const CSG_String &File_Name, bool bSetExtension, int iText, int iTranslation, bool bCmpNoCase)
113 {
114 m_nTranslations = 0;
115 m_Translations = NULL;
116
117 Create(File_Name, bSetExtension, iText, iTranslation, bCmpNoCase);
118 }
119
120 CSG_Translator::CSG_Translator(class CSG_Table *pTable, int iText, int iTranslation, bool bCmpNoCase)
121 {
122 m_nTranslations = 0;
123 m_Translations = NULL;
124
125 Create(pTable, iText, iTranslation, bCmpNoCase);
126 }
127
128 //---------------------------------------------------------
129 CSG_Translator::~CSG_Translator(void)
130 {
131 Destroy();
132 }
133
134 //---------------------------------------------------------
135 void CSG_Translator::Destroy(void)
136 {
137 if( m_Translations )
138 {
139 for(int i=0; i<m_nTranslations; i++)
140 {
141 delete(m_Translations[i]);
142 }
143
144 SG_Free(m_Translations);
145
146 m_nTranslations = 0;
147 m_Translations = NULL;
148 }
149 }
150
151
153 // //
155
156 //---------------------------------------------------------
157 bool CSG_Translator::Create(const CSG_String &File_Name, bool bSetExtension, int iText, int iTranslation, bool bCmpNoCase)
158 {
159 CSG_Table Translations;
160 CSG_String fName(bSetExtension ? SG_File_Make_Path("", File_Name, "lng") : File_Name);
161
162 SG_UI_Msg_Lock(true);
163
164 Destroy();
165
166 if( SG_File_Exists(fName) && Translations.Create(fName, TABLE_FILETYPE_Text, SG_FILE_ENCODING_UTF8) )
167 {
168 Create(&Translations, iText, iTranslation, bCmpNoCase);
169 }
170
171 SG_UI_Msg_Lock(false);
172
173 return( m_nTranslations > 0 );
174 }
175
176 //---------------------------------------------------------
177 bool CSG_Translator::Create(class CSG_Table *pTranslations, int iText, int iTranslation, bool bCmpNoCase)
178 {
179 SG_UI_Msg_Lock(true);
180
181 Destroy();
182
183 if( iText != iTranslation && pTranslations && pTranslations->Get_Field_Count() > iText && pTranslations->Get_Field_Count() > iTranslation && pTranslations->Get_Count() > 0 )
184 {
185 int i;
186
187 m_bCmpNoCase = bCmpNoCase;
188
189 if( m_bCmpNoCase )
190 {
191 for(i=0; i<pTranslations->Get_Count(); i++)
192 {
193 CSG_Table_Record *pRecord = pTranslations->Get_Record(i);
194
195 if( !pRecord->is_NoData(iText) )
196 {
197 CSG_String s = pRecord->asString(iText);
198
199 pRecord->Set_Value(iText, s.Make_Lower().c_str());
200 }
201 }
202 }
203
204 pTranslations->Set_Index(iText, TABLE_INDEX_Ascending);
205
206 m_Translations = (CSG_Translation **)SG_Malloc(pTranslations->Get_Count() * sizeof(CSG_Translation *));
207
208 for(i=0; i<pTranslations->Get_Count(); i++)
209 {
210 CSG_Table_Record *pRecord = pTranslations->Get_Record_byIndex(i);
211
212 if( !pRecord->is_NoData(iText) && !pRecord->is_NoData(iTranslation) )
213 {
214 m_Translations[m_nTranslations++] = new CSG_Translation(pRecord->asString(iText), pRecord->asString(iTranslation));
215 }
216 }
217
218 if( m_nTranslations < pTranslations->Get_Count() )
219 {
220 m_Translations = (CSG_Translation **)SG_Realloc(m_Translations, m_nTranslations * sizeof(CSG_Translation *));
221 }
222 }
223
224 SG_UI_Msg_Lock(false);
225
226 return( m_nTranslations > 0 );
227 }
228
229
231 // //
233
234 //---------------------------------------------------------
235 #define COMPARE(Index, Text) (m_bCmpNoCase ? m_Translations[Index]->m_Text.CmpNoCase(Text) : m_Translations[Index]->m_Text.Cmp(Text))
236
237 //---------------------------------------------------------
238 int CSG_Translator::_Get_Index(const CSG_String &Text) const
239 {
240 int a, b, i, c;
241
242 if( m_nTranslations == 1 )
243 {
244 c = COMPARE(0, Text);
245
246 return( c >= 0 ? 0 : 1 );
247 }
248
249 if( m_nTranslations > 1 )
250 {
251 for(a=0, b=m_nTranslations-1; b - a > 1; )
252 {
253 i = a + (b - a) / 2;
254 c = COMPARE(i, Text);
255
256 if( c > 0 )
257 {
258 b = i;
259 }
260 else if( c < 0 )
261 {
262 a = i;
263 }
264 else
265 {
266 return( i );
267 }
268 }
269
270 if( COMPARE(a, Text) < 0 )
271 {
272 if( COMPARE(b, Text) < 0 )
273 {
274 return( m_nTranslations );
275 }
276
277 return( b );
278 }
279
280 if( COMPARE(b, Text) > 0 )
281 {
282 return( a );
283 }
284 }
285
286 return( m_nTranslations );
287 }
288
289
291 // //
293
294 //---------------------------------------------------------
295 const SG_Char * CSG_Translator::Get_Translation(const SG_Char *Text, bool bReturnNullOnNotFound) const
296 {
297 if( Text )
298 {
299 if( m_nTranslations > 0 )
300 {
301 int i;
302 CSG_String s(Text);
303
304 if( *Text == '{' )
305 {
306 s = s.AfterFirst('{').BeforeFirst('}');
307 }
308
309 if( (i = _Get_Index(s)) < m_nTranslations && !COMPARE(i, s) )
310 {
311 return( m_Translations[i]->m_Translation );
312 }
313 }
314
315 if( bReturnNullOnNotFound )
316 {
317 return( NULL );
318 }
319
320 //-------------------------------------------------
321 if( *Text == '{' )
322 {
323 do { Text++; } while( *Text != '}' && *Text != '\0' );
324 do { Text++; } while( *Text == ' ' && *Text != '\0' );
325 }
326 }
327
328 return( Text );
329 }
330
331 //---------------------------------------------------------
332 bool CSG_Translator::Get_Translation(const SG_Char *Text, CSG_String &Translation) const
333 {
334 if( Text )
335 {
336 if( m_nTranslations > 0 )
337 {
338 int i;
339 CSG_String s(Text);
340
341 if( *Text == '{' )
342 {
343 s = s.AfterFirst('{').BeforeFirst('}');
344 }
345
346 if( (i = _Get_Index(s)) < m_nTranslations && !COMPARE(i, s) )
347 {
348 Translation = m_Translations[i]->m_Translation;
349
350 return( true );
351 }
352 }
353
354 //-------------------------------------------------
355 if( *Text == '{' )
356 {
357 do { Text++; } while( *Text != '}' && *Text != '\0' );
358 do { Text++; } while( *Text == ' ' && *Text != '\0' );
359 }
360
361 Translation = Text;
362 }
363
364 return( false );
365 }
366
367
369 // //
370 // //
371 // //
373
374 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Translator
Definition: api_core.h:1424
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_Translator::CSG_Translator
CSG_Translator(void)
Definition: api_translator.cpp:106
CSG_Table_Record
Definition: table.h:130
COMPARE
#define COMPARE(Index, Text)
Definition: api_translator.cpp:235
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Translator::Destroy
void Destroy(void)
Definition: api_translator.cpp:135
api_core.h
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
gSG_Translator
CSG_Translator gSG_Translator
Definition: api_translator.cpp:77
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Translator::~CSG_Translator
virtual ~CSG_Translator(void)
Definition: api_translator.cpp:129
SG_Get_Translator
CSG_Translator & SG_Get_Translator(void)
Definition: api_translator.cpp:80
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Translator::Get_Translation
const SG_Char * Get_Translation(int i) const
Definition: api_core.h:1441
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
CSG_Table
Definition: table.h:283
CSG_Translator::Create
bool Create(const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
Definition: api_translator.cpp:157
SG_Translate
const SG_Char * SG_Translate(const CSG_String &Text)
Definition: api_translator.cpp:93
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_Translator::Get_Count
int Get_Count(void) const
Definition: api_core.h:1439
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
CSG_String
Definition: api_core.h:557
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
TABLE_FILETYPE_Text
@ TABLE_FILETYPE_Text
Definition: table.h:95
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
table.h
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: data_manager.cpp File Reference

  • saga_core
  • saga_api
Functions | Variables
data_manager.cpp File Reference
#include "data_manager.h"
#include "tool_library.h"

Go to the source code of this file.

Functions

CSG_Data_Manager & SG_Get_Data_Manager (void)

Variables

CSG_Data_Manager g_Data_Manager

Function Documentation

◆ SG_Get_Data_Manager()

CSG_Data_Manager& SG_Get_Data_Manager ( void )

Definition at line 65 of file data_manager.cpp.

References g_Data_Manager.

Referenced by CSG_Parameter_List::_Assign(), CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Tool::DataObject_Add(), CSG_Tool::Delete_Manager(), CSG_Tool::Execute(), and CSG_Tool::Reset_Manager().

Variable Documentation

◆ g_Data_Manager

CSG_Data_Manager g_Data_Manager

Definition at line 62 of file data_manager.cpp.

Referenced by CSG_Data_Collection::Add(), and SG_Get_Data_Manager().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: data_manager.cpp Source File

  • saga_core
  • saga_api
data_manager.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // data_manager.cpp //
15 // //
16 // Copyright (C) 2013 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "data_manager.h"
52 #include "tool_library.h"
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
62 CSG_Data_Manager g_Data_Manager;
63
64 //---------------------------------------------------------
65 CSG_Data_Manager & SG_Get_Data_Manager (void)
66 {
67 return( g_Data_Manager );
68 }
69
70
72 // //
73 // //
74 // //
76
77 //---------------------------------------------------------
78 CSG_Data_Collection::CSG_Data_Collection(CSG_Data_Manager *pManager, TSG_Data_Object_Type Type)
79 {
80 m_pManager = pManager;
81 m_Type = Type;
82 }
83
84 //---------------------------------------------------------
85 CSG_Data_Collection::~CSG_Data_Collection(void)
86 {
87 Delete_All();
88 }
89
90 //---------------------------------------------------------
91 CSG_Data_Object * CSG_Data_Collection::Get(const CSG_String &File, bool bNative) const
92 {
93 for(size_t i=0; i<Count(); i++)
94 {
95 if( !File.Cmp(Get(i)->Get_File_Name(bNative)) )
96 {
97 return( Get(i) );
98 }
99 }
100
101 return( NULL );
102 }
103
104 //---------------------------------------------------------
105 bool CSG_Data_Collection::Exists(CSG_Data_Object *pObject) const
106 {
107 for(size_t i=0; i<Count(); i++)
108 {
109 if( pObject == Get(i) )
110 {
111 return( true );
112 }
113 }
114
115 return( false );
116 }
117
118 //---------------------------------------------------------
119 bool CSG_Data_Collection::Add(CSG_Data_Object *pObject)
120 {
121 if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
122 {
123 if( Exists(pObject) )
124 {
125 return( true );
126 }
127
128 if( m_Objects.Inc_Array() )
129 {
130 m_Objects[Count() - 1] = pObject;
131
132 if( m_pManager == &g_Data_Manager )
133 {
134 SG_UI_DataObject_Add(pObject, SG_UI_DATAOBJECT_UPDATE);
135 }
136
137 return( true );
138 }
139 }
140
141 return( false );
142 }
143
144 //---------------------------------------------------------
145 bool CSG_Data_Collection::Delete(CSG_Data_Object *pObject, bool bDetach)
146 {
147 CSG_Data_Object **pObjects = (CSG_Data_Object **)m_Objects.Get_Array();
148
149 size_t i, n;
150
151 for(i=0, n=0; i<Count(); i++)
152 {
153 if( pObject == Get(i) )
154 {
155 if( !bDetach )
156 {
157 delete(Get(i));
158
159 bDetach = true; // just in case the same object has been added more than once
160 }
161 }
162 else
163 {
164 pObjects[n++] = pObjects[i];
165 }
166 }
167
168 if( n < m_Objects.Get_uSize() )
169 {
170 m_Objects.Set_Array(n);
171
172 return( true );
173 }
174
175 return( false );
176 }
177
178 //---------------------------------------------------------
179 bool CSG_Data_Collection::Delete(size_t i, bool bDetach)
180 {
181 return( Delete(Get(i), bDetach) );
182 }
183
184 //---------------------------------------------------------
185 bool CSG_Data_Collection::Delete(bool bDetach, bool bUnsaved)
186 {
187 if( bUnsaved )
188 {
189 for(size_t i=Count(); i>0; i--)
190 {
191 if( !SG_File_Exists(Get(i - 1)->Get_File_Name()) )
192 {
193 Delete(i, bDetach);
194 }
195 }
196 }
197 else
198 {
199 if( !bDetach )
200 {
201 for(size_t i=0; i<Count(); i++)
202 {
203 delete(Get(i));
204 }
205 }
206
207 m_Objects.Set_Array(0);
208 }
209
210 return( true );
211 }
212
213 //---------------------------------------------------------
214 bool CSG_Data_Collection::Delete_All(bool bDetach)
215 {
216 return( Delete(bDetach, false) );
217 }
218
219 //---------------------------------------------------------
220 bool CSG_Data_Collection::Delete_Unsaved(bool bDetach)
221 {
222 for(size_t i=Count(); i>0; i--)
223 {
224 if( !SG_File_Exists(Get(i - 1)->Get_File_Name()) )
225 {
226 Delete(i, bDetach);
227 }
228 }
229
230 return( true );
231 }
232
233
235 // //
236 // //
237 // //
239
240 //---------------------------------------------------------
241 CSG_Grid_Collection::CSG_Grid_Collection(CSG_Data_Manager *pManager)
242 : CSG_Data_Collection(pManager, SG_DATAOBJECT_TYPE_Grid)
243 {}
244
245 //---------------------------------------------------------
246 bool CSG_Grid_Collection::Exists(CSG_Data_Object *pObject) const
247 {
248 if( pObject == DATAOBJECT_NOTSET || pObject == DATAOBJECT_CREATE )
249 {
250 return( false );
251 }
252
253 for(size_t i=0; i<Count(); i++)
254 {
255 if( pObject == Get(i) )
256 {
257 return( true );
258 }
259 else if( Get(i)->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
260 { // does object (CSG_Grid) belong to a grid collection (CSG_Grids)
261 CSG_Grids *pGrids = (CSG_Grids *)Get(i);
262
263 for(int j=0; j<pGrids->Get_NZ(); j++)
264 {
265 if( pObject == pGrids->Get_Grid_Ptr(j) )
266 {
267 return( true );
268 }
269 }
270 }
271 }
272
273 return( false );
274 }
275
276 //---------------------------------------------------------
277 bool CSG_Grid_Collection::Add(CSG_Data_Object *pObject)
278 {
279 if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
280 {
281 CSG_Grid_System System;
282
283 switch( pObject->Get_ObjectType() )
284 {
285 case SG_DATAOBJECT_TYPE_Grid : System = ((CSG_Grid *)pObject)->Get_System(); break;
286 case SG_DATAOBJECT_TYPE_Grids: System = ((CSG_Grids *)pObject)->Get_System(); break;
287
288 default: return( false );
289 }
290
291 if( System.is_Valid() )
292 {
293 if( Count() == 0 || !m_System.is_Valid() )
294 {
295 m_System = System;
296 }
297
298 if( m_System == System )
299 {
300 return( CSG_Data_Collection::Add(pObject) );
301 }
302 }
303 }
304
305 return( false );
306 }
307
308
310 // //
311 // //
312 // //
314
315 //---------------------------------------------------------
316 CSG_Data_Manager::CSG_Data_Manager(void)
317 {
318 m_pTable = new CSG_Data_Collection(this, SG_DATAOBJECT_TYPE_Table );
319 m_pTIN = new CSG_Data_Collection(this, SG_DATAOBJECT_TYPE_TIN );
320 m_pPoint_Cloud = new CSG_Data_Collection(this, SG_DATAOBJECT_TYPE_PointCloud);
321 m_pShapes = new CSG_Data_Collection(this, SG_DATAOBJECT_TYPE_Shapes );
322 }
323
324 //---------------------------------------------------------
325 CSG_Data_Manager::~CSG_Data_Manager(void)
326 {
327 Delete_All();
328
329 delete(m_pTable );
330 delete(m_pTIN );
331 delete(m_pPoint_Cloud);
332 delete(m_pShapes );
333 }
334
335
337 // //
339
340 //---------------------------------------------------------
341 CSG_Data_Collection * CSG_Data_Manager::_Get_Collection(CSG_Data_Object *pObject) const
342 {
343 if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
344 {
345 switch( pObject->Get_ObjectType() )
346 {
347 case SG_DATAOBJECT_TYPE_Table : return( m_pTable );
348 case SG_DATAOBJECT_TYPE_TIN : return( m_pTIN );
349 case SG_DATAOBJECT_TYPE_PointCloud: return( m_pPoint_Cloud );
350 case SG_DATAOBJECT_TYPE_Shapes : return( m_pShapes );
351 case SG_DATAOBJECT_TYPE_Grid : return( Get_Grid_System(((CSG_Grid *)pObject)->Get_System()) );
352 case SG_DATAOBJECT_TYPE_Grids : return( Get_Grid_System(((CSG_Grids *)pObject)->Get_System()) );
353
354 default: break;
355 }
356 }
357
358 return( NULL );
359 }
360
361
363 // //
365
366 //---------------------------------------------------------
367 CSG_Grid_Collection * CSG_Data_Manager::Get_Grid_System(const CSG_Grid_System &System) const
368 {
369 for(size_t i=0; i<Grid_System_Count(); i++)
370 {
371 CSG_Grid_Collection *pSystem = Get_Grid_System(i);
372
373 if( pSystem->is_Equal(System) )
374 {
375 return( pSystem );
376 }
377 }
378
379 return( NULL );
380 }
381
382 //---------------------------------------------------------
383 bool CSG_Data_Manager::Exists(const CSG_Grid_System &System) const
384 {
385 return( Get_Grid_System(System) != NULL );
386 }
387
388 //---------------------------------------------------------
389 bool CSG_Data_Manager::Exists(CSG_Data_Object *pObject) const
390 {
391 if( m_pTable ->Exists(pObject) ) return( true );
392 if( m_pTIN ->Exists(pObject) ) return( true );
393 if( m_pPoint_Cloud->Exists(pObject) ) return( true );
394 if( m_pShapes ->Exists(pObject) ) return( true );
395
396 for(size_t i=0; i<Grid_System_Count(); i++)
397 {
398 if( Get_Grid_System(i)->Exists(pObject) ) return( true );
399 }
400
401 return( false );
402 }
403
404 //---------------------------------------------------------
405 CSG_Data_Object * CSG_Data_Manager::Find(const CSG_String &File, bool bNative) const
406 {
407 CSG_Data_Object *pObject;
408
409 if( (pObject = m_pTable ->Get(File, bNative)) != NULL ) return( pObject );
410 if( (pObject = m_pTIN ->Get(File, bNative)) != NULL ) return( pObject );
411 if( (pObject = m_pPoint_Cloud->Get(File, bNative)) != NULL ) return( pObject );
412 if( (pObject = m_pShapes ->Get(File, bNative)) != NULL ) return( pObject );
413
414 for(size_t i=0; i<Grid_System_Count(); i++)
415 {
416 if( (pObject = Get_Grid_System(i)->Get(File, bNative)) != NULL ) return( pObject );
417 }
418
419 return( NULL );
420 }
421
422
424 // //
426
427 //---------------------------------------------------------
428 bool CSG_Data_Manager::Add(CSG_Data_Object *pObject)
429 {
430 CSG_Data_Collection *pCollection = _Get_Collection(pObject);
431
432 if( pCollection == NULL && pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids) && m_Grid_Systems.Inc_Array() )
433 {
434 pCollection = new CSG_Grid_Collection(this);
435
436 m_Grid_Systems[m_Grid_Systems.Get_Size() - 1] = pCollection;
437 }
438
439 return( pCollection && pCollection->Add(pObject) );
440 }
441
442 //---------------------------------------------------------
443 CSG_Data_Object * CSG_Data_Manager::Add(const CSG_String &File, TSG_Data_Object_Type Type)
444 {
445 //-----------------------------------------------------
446 if( Type == SG_DATAOBJECT_TYPE_Undefined )
447 {
448 if( SG_File_Cmp_Extension(File, "txt" )
449 || SG_File_Cmp_Extension(File, "csv" )
450 || SG_File_Cmp_Extension(File, "dbf" ) )
451 {
452 Type = SG_DATAOBJECT_TYPE_Table;
453 }
454
455 if( SG_File_Cmp_Extension(File, "shp" ) )
456 {
457 Type = SG_DATAOBJECT_TYPE_Shapes;
458 }
459
460 if( SG_File_Cmp_Extension(File, "sg-pts-z")
461 || SG_File_Cmp_Extension(File, "sg-pts" )
462 || SG_File_Cmp_Extension(File, "spc" ) )
463 {
464 Type = SG_DATAOBJECT_TYPE_PointCloud;
465 }
466
467 if( SG_File_Cmp_Extension(File, "sg-grd-z")
468 || SG_File_Cmp_Extension(File, "sg-grd" )
469 || SG_File_Cmp_Extension(File, "sgrd" )
470 || SG_File_Cmp_Extension(File, "dgm" )
471 || SG_File_Cmp_Extension(File, "grd" ) )
472 {
473 Type = SG_DATAOBJECT_TYPE_Grid;
474 }
475
476 if( SG_File_Cmp_Extension(File, "sg-gds-z")
477 || SG_File_Cmp_Extension(File, "sg-gds" ) )
478 {
479 Type = SG_DATAOBJECT_TYPE_Grids;
480 }
481 }
482
483 //-----------------------------------------------------
484 CSG_Data_Object *pObject;
485
486 switch( Type )
487 {
488 case SG_DATAOBJECT_TYPE_Table : pObject = new CSG_Table (File); break;
489 case SG_DATAOBJECT_TYPE_Shapes : pObject = new CSG_Shapes (File); break;
490 case SG_DATAOBJECT_TYPE_TIN : pObject = new CSG_TIN (File); break;
491 case SG_DATAOBJECT_TYPE_PointCloud: pObject = new CSG_PointCloud(File); break;
492 case SG_DATAOBJECT_TYPE_Grid : pObject = new CSG_Grid (File); break;
493 case SG_DATAOBJECT_TYPE_Grids : pObject = new CSG_Grids (File); break;
494 default : pObject = NULL ; break;
495 }
496
497 if( pObject )
498 {
499 if( pObject->is_Valid() && Add(pObject) )
500 {
501 return( pObject );
502 }
503
504 delete(pObject);
505 }
506
507 //-----------------------------------------------------
508 return( _Add_External(File) );
509 }
510
511 //---------------------------------------------------------
512 CSG_Data_Object * CSG_Data_Manager::_Add_External(const CSG_String &File)
513 {
514 CSG_Data_Object *pData = NULL;
515
516 if( !SG_File_Exists(File) )
517 {
518 return( pData );
519 }
520
521 CSG_Tool *pImport = NULL;
522
523 SG_UI_Msg_Lock(true);
524
525 //-----------------------------------------------------
526 // Image Import
527
528 if( ( SG_File_Cmp_Extension(File, "bmp")
529 || SG_File_Cmp_Extension(File, "gif")
530 || SG_File_Cmp_Extension(File, "jpg")
531 || SG_File_Cmp_Extension(File, "png")
532 || SG_File_Cmp_Extension(File, "pcx")
533 || SG_File_Cmp_Extension(File, "xpm") )
534 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL
535 && pImport->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath) )
536 {
537 pImport->Set_Manager(this);
538
539 if( pImport->Execute() )
540 {
541 pData = pImport->Get_Parameter("OUT_GRID")->asDataObject();
542 }
543 }
544
545 SG_Get_Tool_Library_Manager().Delete_Tool(pImport);
546
547 //-----------------------------------------------------
548 // GDAL Import
549
550 if( !pData
551 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 0)) != NULL
552 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
553 {
554 pImport->Set_Manager(this);
555
556 if( pImport->Execute() )
557 {
558 pData = pImport->Get_Parameter("GRIDS")->asList()->Get_Item(0);
559 }
560 }
561
562 SG_Get_Tool_Library_Manager().Delete_Tool(pImport);
563
564 //-----------------------------------------------------
565 // OGR Import
566
567 if( !pData
568 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 3)) != NULL
569 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
570 {
571 pImport->Set_Manager(this);
572
573 if( pImport->Execute() )
574 {
575 pData = pImport->Get_Parameter("SHAPES")->asList()->Get_Item(0);
576 }
577 }
578
579 SG_Get_Tool_Library_Manager().Delete_Tool(pImport);
580
581 //-----------------------------------------------------
582 // LAZ Import
583
584 if( !pData && (SG_File_Cmp_Extension(File, "las") || SG_File_Cmp_Extension(File, "laz"))
585 && (pImport = SG_Get_Tool_Library_Manager().Create_Tool("io_pdal", 0)) != NULL
586 && pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
587 {
588 pImport->Set_Manager(this);
589
590 if( pImport->Execute() )
591 {
592 pData = pImport->Get_Parameter("POINTS")->asList()->Get_Item(0);
593 }
594 }
595
596 SG_Get_Tool_Library_Manager().Delete_Tool(pImport);
597
598 //-----------------------------------------------------
599 SG_UI_Msg_Lock(false);
600
601 return( pData );
602 }
603
604
606 // //
608
609 //---------------------------------------------------------
610 CSG_Table * CSG_Data_Manager::Add_Table(void)
611 {
612 CSG_Table *pObject = new CSG_Table();
613
614 if( pObject && !Add(pObject) )
615 {
616 delete(pObject); pObject = NULL;
617 }
618
619 return( pObject );
620 }
621
622 //---------------------------------------------------------
623 CSG_TIN * CSG_Data_Manager::Add_TIN(void)
624 {
625 CSG_TIN *pObject = new CSG_TIN();
626
627 if( pObject && !Add(pObject) )
628 {
629 delete(pObject); pObject = NULL;
630 }
631
632 return( pObject );
633 }
634
635 //---------------------------------------------------------
636 CSG_PointCloud * CSG_Data_Manager::Add_PointCloud(void)
637 {
638 CSG_PointCloud *pObject = new CSG_PointCloud();
639
640 if( pObject && !Add(pObject) )
641 {
642 delete(pObject); pObject = NULL;
643 }
644
645 return( pObject );
646 }
647
648 //---------------------------------------------------------
649 CSG_Shapes * CSG_Data_Manager::Add_Shapes(TSG_Shape_Type Type)
650 {
651 CSG_Shapes *pObject = new CSG_Shapes(Type);
652
653 if( pObject && !Add(pObject) )
654 {
655 delete(pObject); pObject = NULL;
656 }
657
658 return( pObject );
659 }
660
661 //---------------------------------------------------------
662 CSG_Grid * CSG_Data_Manager::Add_Grid(const CSG_Grid_System &System, TSG_Data_Type Type)
663 {
664 CSG_Grid *pObject = System.is_Valid() ? new CSG_Grid(System, Type) : NULL;
665
666 if( pObject && !Add(pObject) )
667 {
668 delete(pObject); pObject = NULL;
669 }
670
671 return( pObject );
672 }
673
674 //---------------------------------------------------------
675 CSG_Grid * CSG_Data_Manager::Add_Grid(int NX, int NY, double Cellsize, double xMin, double yMin, TSG_Data_Type Type)
676 {
677 return( Add_Grid(CSG_Grid_System(Cellsize, xMin, yMin, NX, NY), Type) );
678 }
679
680
682 // //
684
685 //---------------------------------------------------------
686 bool CSG_Data_Manager::Delete(CSG_Data_Collection *pCollection, bool bDetach)
687 {
688 if( pCollection == NULL || pCollection->m_pManager != this )
689 {
690 return( false );
691 }
692
693 //-----------------------------------------------------
694 if( pCollection == m_pTable ) { return( pCollection->Delete_All(bDetach) ); }
695 if( pCollection == m_pTIN ) { return( pCollection->Delete_All(bDetach) ); }
696 if( pCollection == m_pPoint_Cloud ) { return( pCollection->Delete_All(bDetach) ); }
697 if( pCollection == m_pShapes ) { return( pCollection->Delete_All(bDetach) ); }
698
699 //-----------------------------------------------------
700 if( pCollection->m_Type == SG_DATAOBJECT_TYPE_Grid )
701 {
702 CSG_Grid_Collection **pSystems = (CSG_Grid_Collection **)m_Grid_Systems.Get_Array();
703
704 size_t i, n;
705
706 for(i=0, n=0; i<m_Grid_Systems.Get_uSize(); i++)
707 {
708 if( pCollection == pSystems[i] )
709 {
710 if( bDetach )
711 {
712 pSystems[i]->Delete_All(bDetach);
713 }
714
715 delete(pSystems[i]);
716 }
717 else
718 {
719 pSystems[n++] = pSystems[i];
720 }
721 }
722
723 if( n < m_Grid_Systems.Get_uSize() )
724 {
725 m_Grid_Systems.Set_Array(n);
726
727 return( true );
728 }
729 }
730
731 //-----------------------------------------------------
732 return( false );
733 }
734
735 //---------------------------------------------------------
736 bool CSG_Data_Manager::Delete(CSG_Data_Object *pObject, bool bDetach)
737 {
738 CSG_Data_Collection *pCollection = _Get_Collection(pObject);
739
740 if( pCollection && pCollection->Delete(pObject, bDetach) )
741 {
742 if( pCollection->m_Type == SG_DATAOBJECT_TYPE_Grid && pCollection->Count() == 0 )
743 {
744 Delete(pCollection, bDetach);
745 }
746
747 return( true );
748 }
749
750 return( false );
751 }
752
753 //---------------------------------------------------------
754 bool CSG_Data_Manager::Delete(const CSG_Grid_System &System, bool bDetach)
755 {
756 return( Delete(Get_Grid_System(System), bDetach) );
757 }
758
759 //---------------------------------------------------------
760 bool CSG_Data_Manager::Delete(bool bDetach, bool bUnsaved)
761 {
762 m_pTable ->Delete(bDetach, bUnsaved);
763 m_pTIN ->Delete(bDetach, bUnsaved);
764 m_pPoint_Cloud->Delete(bDetach, bUnsaved);
765 m_pShapes ->Delete(bDetach, bUnsaved);
766
767 for(size_t i=0; i<Grid_System_Count(); i++)
768 {
769 CSG_Grid_Collection *pSystem = Get_Grid_System(i);
770
771 pSystem->Delete(bDetach, bUnsaved);
772
773 delete(pSystem);
774 }
775
776 m_Grid_Systems.Set_Array(0);
777
778 return( true );
779 }
780
781 //---------------------------------------------------------
782 bool CSG_Data_Manager::Delete_All(bool bDetach)
783 {
784 return( Delete(bDetach, false) );
785 }
786
787 //---------------------------------------------------------
788 bool CSG_Data_Manager::Delete_Unsaved(bool bDetach)
789 {
790 return( Delete(bDetach, true) );
791 }
792
793
795 // //
797
798 //---------------------------------------------------------
799 CSG_String CSG_Data_Manager::Get_Summary(void) const
800 {
801 CSG_String s;
802
803 //-----------------------------------------------------
804 if( Get_Table()->Count() > 0 )
805 {
806 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Table"), Get_Table()->Count(), _TL("objects"));
807
808 for(size_t i=0; i<Get_Table()->Count(); i++)
809 {
810 CSG_Table *pObject = (CSG_Table *)Get_Table()->Get(i);
811
812 s += CSG_String::Format("- [%d %s] %s\n",
813 pObject->Get_Count(), _TL("records"),
814 pObject->Get_Name()
815 );
816 }
817 }
818
819 //-----------------------------------------------------
820 if( Get_Shapes()->Count() > 0 )
821 {
822 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Shapes"), Get_Shapes()->Count(), _TL("objects"));
823
824 for(size_t i=0; i<Get_Shapes()->Count(); i++)
825 {
826 CSG_Shapes *pObject = (CSG_Shapes *)Get_Shapes()->Get(i);
827
828 s += CSG_String::Format("- [%s; %d %s] %s\n",
829 pObject->Get_Type() == SHAPE_TYPE_Point ? _TL("point" ) :
830 pObject->Get_Type() == SHAPE_TYPE_Points ? _TL("points" ) :
831 pObject->Get_Type() == SHAPE_TYPE_Line ? _TL("line" ) :
832 pObject->Get_Type() == SHAPE_TYPE_Polygon ? _TL("polygon") : _TL("unknown"),
833 pObject->Get_Count(), _TL("records"),
834 pObject->Get_Name()
835 );
836 }
837 }
838
839 //-----------------------------------------------------
840 if( Get_Point_Cloud()->Count() > 0 )
841 {
842 s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("Point Cloud"), Get_Point_Cloud()->Count(), _TL("objects"));
843
844 for(size_t i=0; i<Get_Point_Cloud()->Count(); i++)
845 {
846 CSG_PointCloud *pObject = (CSG_PointCloud *)Get_Point_Cloud()->Get(i);
847
848 s += CSG_String::Format("- [%d %s] %s\n",
849 pObject->Get_Count(), _TL("records"),
850 pObject->Get_Name()
851 );
852 }
853 }
854
855 //-----------------------------------------------------
856 // if( Get_TIN()->Count() > 0 )
857 // {
858 // s += CSG_String::Format("___\n%s [%zu %s]\n", _TL("TIN"), Get_TIN()->Count(), _TL("objects"));
859 //
860 // for(size_t i=0; i<Get_TIN()->Count(); i++)
861 // {
862 // CSG_TIN *pObject = (CSG_TIN *)Get_TIN()->Get(i);
863 //
864 // s += CSG_String::Format("- [%d %s] %s\n",
865 // pObject->Get_Count(), _TL("nodes"),
866 // pObject->Get_Name()
867 // );
868 // }
869 // }
870
871 //-----------------------------------------------------
872 if( Grid_System_Count() > 0 )
873 {
874 sLong memory = 0;
875
876 for(size_t i=0; i<Grid_System_Count(); i++)
877 {
878 CSG_Grid_Collection *pSystem = Get_Grid_System(i);
879
880 s += CSG_String::Format("___\n%s [%s; %zu %s]\n", _TL("Grid System"), pSystem->m_System.Get_Name(), pSystem->Count(), _TL("objects"));
881
882 for(size_t j=0; j<pSystem->Count(); j++)
883 {
884 if( pSystem->Get(j)->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid )
885 {
886 CSG_Grid *pObject = (CSG_Grid *)pSystem->Get(j);
887
888 s += CSG_String::Format("- [%s; %.1fmb] %s\n",
889 SG_Data_Type_Get_Name(pObject->Get_Type()).c_str(),
890 pObject->Get_Memory_Size() / (double)N_MEGABYTE_BYTES,
891 pObject->Get_Name()
892 );
893
894 memory += pObject->Get_Memory_Size();
895 }
896
897 if( pSystem->Get(j)->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
898 {
899 CSG_Grids *pObject = (CSG_Grids *)pSystem->Get(j);
900
901 s += CSG_String::Format("- [%s; %d %s; %.1fmb] %s\n",
902 SG_Data_Type_Get_Name(pObject->Get_Type()).c_str(),
903 pObject->Get_NZ(), _TL("grids"),
904 pObject->Get_Memory_Size() / (double)N_MEGABYTE_BYTES,
905 pObject->Get_Name()
906 );
907
908 memory += pObject->Get_Memory_Size();
909 }
910 }
911 }
912
913 s += CSG_String::Format("_\n%s: %.1fmb\n", _TL("Total memory in use by grids"), memory / (double)N_MEGABYTE_BYTES);
914 }
915
916 //-----------------------------------------------------
917 if( s.is_Empty() )
918 {
919 s += CSG_String::Format("%s - %s\n--- %s ---\n", _TL("Data Manager"), _TL("Summary"), _TL("no data"));
920 }
921 else
922 {
923 s.Prepend(CSG_String::Format("%s - %s\n", _TL("Data Manager"), _TL("Summary")));
924 }
925
926 //-----------------------------------------------------
927 return( s );
928 }
929
930
932 // //
933 // //
934 // //
936
937 //---------------------------------------------------------
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_Grid_Collection::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: data_manager.h:140
CSG_Data_Collection::CSG_Data_Collection
CSG_Data_Collection(class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type)
Definition: data_manager.cpp:78
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Data_Manager::Get_Shapes
CSG_Data_Collection * Get_Shapes(void) const
Definition: data_manager.h:172
CSG_Data_Manager::Get_Table
CSG_Data_Collection * Get_Table(void) const
Definition: data_manager.h:169
_TL
#define _TL(s)
Definition: api_core.h:1480
g_Data_Manager
CSG_Data_Manager g_Data_Manager
Definition: data_manager.cpp:62
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:96
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
CSG_Data_Collection::Add
virtual bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:119
data_manager.h
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Grid_System
Definition: grid.h:200
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(void)
Definition: data_manager.cpp:636
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Data_Collection::Delete_All
bool Delete_All(bool bDetach=false)
Definition: data_manager.cpp:214
CSG_Tool
Definition: tool.h:149
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
CSG_Data_Collection
Definition: data_manager.h:89
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Grids::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grids.h:169
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(TSG_Shape_Type Type=SHAPE_TYPE_Undefined)
Definition: data_manager.cpp:649
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:389
CSG_Data_Object::Get_ObjectType
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.
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_String::Prepend
CSG_String & Prepend(const CSG_String &String)
Definition: api_string.cpp:347
CSG_Data_Manager::Get_Grid_System
CSG_Grid_Collection * Get_Grid_System(size_t i) const
Definition: data_manager.h:175
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
CSG_Grid_Collection::Add
virtual bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:277
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1509
CSG_TIN
Definition: tin.h:222
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Grid_System::Get_Name
const SG_Char * Get_Name(bool bShort=true)
Definition: grid_system.cpp:249
CSG_Data_Collection::Get
CSG_Data_Object * Get(const CSG_String &File, bool bNative=true) const
Definition: data_manager.cpp:91
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Collection::Exists
virtual bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:105
CSG_Grid_Collection::CSG_Grid_Collection
CSG_Grid_Collection(class CSG_Data_Manager *pManager)
Definition: data_manager.cpp:241
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(void)
Definition: data_manager.cpp:623
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined)
Definition: data_manager.cpp:662
CSG_Data_Manager::Delete_All
bool Delete_All(bool bDetach=false)
Definition: data_manager.cpp:782
CSG_Grid_Collection::m_System
CSG_Grid_System m_System
Definition: data_manager.h:153
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Array_Pointer::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:382
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_Grid::Get_Memory_Size
sLong Get_Memory_Size(void) const
Definition: grid.h:601
CSG_Data_Manager::Delete
bool Delete(CSG_Data_Collection *pCollection, bool bDetach=false)
Definition: data_manager.cpp:686
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:598
CSG_Grids::Get_Grid_Ptr
CSG_Grid * Get_Grid_Ptr(int i) const
Definition: grids.h:248
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(void)
Definition: data_manager.cpp:610
SG_Data_Type_Get_Name
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
Definition: api_core.cpp:122
CSG_Data_Manager::Get_Point_Cloud
CSG_Data_Collection * Get_Point_Cloud(void) const
Definition: data_manager.h:171
CSG_Data_Manager::~CSG_Data_Manager
virtual ~CSG_Data_Manager(void)
Definition: data_manager.cpp:325
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Grids::Get_Memory_Size
sLong Get_Memory_Size(void) const
Definition: grids.h:251
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
CSG_Data_Collection::m_pManager
class CSG_Data_Manager * m_pManager
Definition: data_manager.h:116
CSG_Grid_Collection
Definition: data_manager.h:131
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Grid_Collection::Exists
virtual bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:246
CSG_Data_Manager::Get_Summary
CSG_String Get_Summary(void) const
Definition: data_manager.cpp:799
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
N_MEGABYTE_BYTES
#define N_MEGABYTE_BYTES
Definition: mat_tools.h:117
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition: tool.h:183
CSG_Data_Manager::Find
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
Definition: data_manager.cpp:405
CSG_Grid
Definition: grid.h:473
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_Data_Manager::Grid_System_Count
size_t Grid_System_Count(void) const
Definition: data_manager.h:174
CSG_Shapes
Definition: shapes.h:773
CSG_Data_Manager::CSG_Data_Manager
CSG_Data_Manager(void)
Definition: data_manager.cpp:316
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Data_Manager::Delete_Unsaved
bool Delete_Unsaved(bool bDetach=false)
Definition: data_manager.cpp:788
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Data_Collection::m_Objects
CSG_Array_Pointer m_Objects
Definition: data_manager.h:120
CSG_Data_Collection::m_Type
TSG_Data_Object_Type m_Type
Definition: data_manager.h:118
CSG_Grids
Definition: grids.h:119
CSG_Data_Collection::Delete
bool Delete(CSG_Data_Object *pObject, bool bDetach=false)
Definition: data_manager.cpp:145
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Data_Collection::Delete_Unsaved
bool Delete_Unsaved(bool bDetach=false)
Definition: data_manager.cpp:220
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Data_Collection::~CSG_Data_Collection
virtual ~CSG_Data_Collection(void)
Definition: data_manager.cpp:85
CSG_Grids::Get_NZ
int Get_NZ(void) const
Definition: grids.h:187
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: data_manager.h File Reference

  • saga_core
  • saga_api
Classes | Functions
data_manager.h File Reference
#include "parameters.h"

Go to the source code of this file.

Classes

class | CSG_Data_Collection
class | CSG_Grid_Collection
class | CSG_Data_Manager

Functions

SAGA_API_DLL_EXPORT CSG_Data_Manager & SG_Get_Data_Manager (void)

Detailed Description

Classes for data object management and declaration of the SAGA API's default data manager.

See also
SG_Get_Data_Manager
CSG_Data_Manager
CSG_Data_Object

Definition in file data_manager.h.

Function Documentation

◆ SG_Get_Data_Manager()

SAGA_API_DLL_EXPORT CSG_Data_Manager& SG_Get_Data_Manager ( void )

Definition at line 65 of file data_manager.cpp.

References g_Data_Manager.

Referenced by CSG_Parameter_List::_Assign(), CSG_Parameter_Data_Object_Output::_Set_Value(), CSG_Tool::DataObject_Add(), CSG_Tool::Delete_Manager(), CSG_Tool::Execute(), and CSG_Tool::Reset_Manager().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: data_manager.h Source File

  • saga_core
  • saga_api
data_manager.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // data_manager.h //
15 // //
16 // Copyright (C) 2013 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__data_manager_H
52 #define HEADER_INCLUDED__SAGA_API__data_manager_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
71 // //
73 // //
74 // //
76
77 //---------------------------------------------------------
78 #include "parameters.h"
79
80
82 // //
83 // //
84 // //
86
87 //---------------------------------------------------------
88 class SAGA_API_DLL_EXPORT CSG_Data_Collection
89 {
90 friend class CSG_Data_Manager;
91
92 public:
93
94 size_t Count (void) const { return( m_Objects.Get_Size() ); }
95
96 CSG_Data_Object * Get (size_t i) const { return( i < Count() ? (CSG_Data_Object *)m_Objects[i] : NULL ); }
97 CSG_Data_Object * Get (const CSG_String &File, bool bNative = true) const;
98
99 virtual bool Exists (CSG_Data_Object *pObject) const;
100
101
102 protected:
103
104 CSG_Data_Collection(class CSG_Data_Manager *pManager, TSG_Data_Object_Type Type);
105 virtual ~CSG_Data_Collection(void);
106
107 virtual bool Add (CSG_Data_Object *pObject);
108 bool Delete (CSG_Data_Object *pObject, bool bDetach = false);
109 bool Delete (size_t i , bool bDetach = false);
110 bool Delete ( bool bDetach = false, bool bUnsaved = false);
111
112 bool Delete_All ( bool bDetach = false); // deprecated
113 bool Delete_Unsaved ( bool bDetach = false); // deprecated
114
115
116 class CSG_Data_Manager *m_pManager;
117
118 TSG_Data_Object_Type m_Type;
119
120 CSG_Array_Pointer m_Objects;
121
122 };
123
124
126 // //
128
129 //---------------------------------------------------------
130 class SAGA_API_DLL_EXPORT CSG_Grid_Collection : public CSG_Data_Collection
131 {
132 friend class CSG_Data_Manager;
133
134 public:
135
136 virtual bool Exists (CSG_Data_Object *pObject) const;
137
138 const CSG_Grid_System & Get_System (void) const { return( m_System ); }
139
140 bool is_Equal (const CSG_Grid_System &System) const
141 {
142 return( Count() > 0 && m_System.is_Equal(System) );
143 }
144
145
146 protected:
147
148 CSG_Grid_Collection(class CSG_Data_Manager *pManager);
149
150 virtual bool Add (CSG_Data_Object *pObject);
151
152
153 CSG_Grid_System m_System;
154
155 };
156
157
159 // //
161
162 //---------------------------------------------------------
163 class SAGA_API_DLL_EXPORT CSG_Data_Manager
164 {
165 public:
166 CSG_Data_Manager(void);
167 virtual ~CSG_Data_Manager(void);
168
169 CSG_Data_Collection * Get_Table (void) const { return( m_pTable ); }
170 CSG_Data_Collection * asTIN (void) const { return( m_pTIN ); }
171 CSG_Data_Collection * Get_Point_Cloud (void) const { return( m_pPoint_Cloud ); }
172 CSG_Data_Collection * Get_Shapes (void) const { return( m_pShapes ); }
173
174 size_t Grid_System_Count (void) const { return( m_Grid_Systems.Get_Size() ); }
175 CSG_Grid_Collection * Get_Grid_System (size_t i) const { return( i < Grid_System_Count() ? (CSG_Grid_Collection *)m_Grid_Systems[i] : NULL ); }
176 CSG_Grid_Collection * Get_Grid_System (const CSG_Grid_System &System) const;
177
178 bool Add (CSG_Data_Object *pObject);
179
180 CSG_Data_Object * Add (const CSG_String &File, TSG_Data_Object_Type Type = SG_DATAOBJECT_TYPE_Undefined);
181 CSG_Data_Object * Add (const char *File, TSG_Data_Object_Type Type = SG_DATAOBJECT_TYPE_Undefined) { return( Add(CSG_String(File), Type) ); }
182 CSG_Data_Object * Add (const wchar_t *File, TSG_Data_Object_Type Type = SG_DATAOBJECT_TYPE_Undefined) { return( Add(CSG_String(File), Type) ); }
183
184 CSG_Table * Add_Table (void);
185 CSG_Table * Add_Table (const CSG_String &File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table ) ); }
186 CSG_Table * Add_Table (const char *File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table ) ); }
187 CSG_Table * Add_Table (const wchar_t *File) { return( (CSG_Table *)Add(File, SG_DATAOBJECT_TYPE_Table ) ); }
188
189 CSG_TIN * Add_TIN (void);
190 CSG_TIN * Add_TIN (const CSG_String &File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN ) ); }
191 CSG_TIN * Add_TIN (const char *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN ) ); }
192 CSG_TIN * Add_TIN (const wchar_t *File) { return( (CSG_TIN *)Add(File, SG_DATAOBJECT_TYPE_TIN ) ); }
193
194 CSG_PointCloud * Add_PointCloud (void);
195 CSG_PointCloud * Add_PointCloud (const CSG_String &File) { return( (CSG_PointCloud *)Add(File, SG_DATAOBJECT_TYPE_PointCloud) ); }
196 CSG_PointCloud * Add_PointCloud (const char *File) { return( (CSG_PointCloud *)Add(File, SG_DATAOBJECT_TYPE_PointCloud) ); }
197 CSG_PointCloud * Add_PointCloud (const wchar_t *File) { return( (CSG_PointCloud *)Add(File, SG_DATAOBJECT_TYPE_PointCloud) ); }
198
199 CSG_Shapes * Add_Shapes (TSG_Shape_Type Type = SHAPE_TYPE_Undefined);
200 CSG_Shapes * Add_Shapes (const CSG_String &File) { return( (CSG_Shapes *)Add(File, SG_DATAOBJECT_TYPE_Shapes ) ); }
201 CSG_Shapes * Add_Shapes (const char *File) { return( (CSG_Shapes *)Add(File, SG_DATAOBJECT_TYPE_Shapes ) ); }
202 CSG_Shapes * Add_Shapes (const wchar_t *File) { return( (CSG_Shapes *)Add(File, SG_DATAOBJECT_TYPE_Shapes ) ); }
203
204 CSG_Grid * Add_Grid (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined);
205 CSG_Grid * Add_Grid (int NX, int NY, double Cellsize = 0., double xMin = 0., double yMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
206 CSG_Grid * Add_Grid (const CSG_String &File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid ) ); }
207 CSG_Grid * Add_Grid (const char *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid ) ); }
208 CSG_Grid * Add_Grid (const wchar_t *File) { return( (CSG_Grid *)Add(File, SG_DATAOBJECT_TYPE_Grid ) ); }
209
210 CSG_Grids * Add_Grids (const CSG_String &File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids ) ); }
211 CSG_Grids * Add_Grids (const char *File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids ) ); }
212 CSG_Grids * Add_Grids (const wchar_t *File) { return( (CSG_Grids *)Add(File, SG_DATAOBJECT_TYPE_Grids ) ); }
213
214 bool Delete (CSG_Data_Collection *pCollection, bool bDetach = false);
215 bool Delete (CSG_Data_Object *pObject , bool bDetach = false);
216 bool Delete (const CSG_Grid_System &System , bool bDetach = false);
217 bool Delete ( bool bDetach = false, bool bUnsaved = false);
218
219 bool Delete_All ( bool bDetach = false); // deprecated
220 bool Delete_Unsaved ( bool bDetach = false); // deprecated
221
222 bool Exists (CSG_Data_Object *pObject) const;
223 bool Exists (const CSG_Grid_System &System) const;
224
225 CSG_Data_Object * Find (const CSG_String &File, bool bNative = true) const;
226
227 CSG_String Get_Summary (void) const;
228
229
230 private:
231
232 CSG_Array_Pointer m_Grid_Systems;
233
234 CSG_Data_Collection *m_pTable, *m_pTIN, *m_pPoint_Cloud, *m_pShapes;
235
236
237 CSG_Data_Collection * _Get_Collection (CSG_Data_Object *pObject) const;
238
239 CSG_Data_Object * _Add_External (const CSG_String &File);
240
241 };
242
243 //---------------------------------------------------------
244 SAGA_API_DLL_EXPORT CSG_Data_Manager & SG_Get_Data_Manager (void);
245
246
248 // //
249 // //
250 // //
252
253 //---------------------------------------------------------
254 #endif // #ifndef HEADER_INCLUDED__SAGA_API__data_manager_H
CSG_Grid_Collection::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: data_manager.h:140
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_Data_Manager::Get_Shapes
CSG_Data_Collection * Get_Shapes(void) const
Definition: data_manager.h:172
CSG_Data_Manager::Get_Table
CSG_Data_Collection * Get_Table(void) const
Definition: data_manager.h:169
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:96
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
CSG_Data_Collection::Add
virtual bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:119
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Grid_System
Definition: grid.h:200
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(const wchar_t *File)
Definition: data_manager.h:187
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(const char *File)
Definition: data_manager.h:191
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(const wchar_t *File)
Definition: data_manager.h:208
CSG_Data_Manager::Add
CSG_Data_Object * Add(const wchar_t *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined)
Definition: data_manager.h:182
CSG_Data_Collection
Definition: data_manager.h:89
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:389
CSG_Grid_Collection::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: data_manager.h:138
CSG_Data_Manager::Get_Grid_System
CSG_Grid_Collection * Get_Grid_System(size_t i) const
Definition: data_manager.h:175
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(const CSG_String &File)
Definition: data_manager.h:206
CSG_TIN
Definition: tin.h:222
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Collection::Exists
virtual bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:105
CSG_Data_Manager::asTIN
CSG_Data_Collection * asTIN(void) const
Definition: data_manager.h:170
CSG_Data_Manager::Delete_All
bool Delete_All(bool bDetach=false)
Definition: data_manager.cpp:782
CSG_Grid_Collection::m_System
CSG_Grid_System m_System
Definition: data_manager.h:153
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(const CSG_String &File)
Definition: data_manager.h:185
CSG_Data_Manager::Delete
bool Delete(CSG_Data_Collection *pCollection, bool bDetach=false)
Definition: data_manager.cpp:686
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(const char *File)
Definition: data_manager.h:201
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(const CSG_String &File)
Definition: data_manager.h:200
CSG_Data_Manager::Add_Grids
CSG_Grids * Add_Grids(const wchar_t *File)
Definition: data_manager.h:212
CSG_Data_Manager::Add_Grids
CSG_Grids * Add_Grids(const CSG_String &File)
Definition: data_manager.h:210
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Data_Manager::Get_Point_Cloud
CSG_Data_Collection * Get_Point_Cloud(void) const
Definition: data_manager.h:171
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
parameters.h
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(const char *File)
Definition: data_manager.h:207
CSG_Table
Definition: table.h:283
SG_Get_Data_Manager
SAGA_API_DLL_EXPORT CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(const CSG_String &File)
Definition: data_manager.h:190
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(const wchar_t *File)
Definition: data_manager.h:197
CSG_Data_Collection::m_pManager
class CSG_Data_Manager * m_pManager
Definition: data_manager.h:116
CSG_Grid_Collection
Definition: data_manager.h:131
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(const wchar_t *File)
Definition: data_manager.h:202
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(const wchar_t *File)
Definition: data_manager.h:192
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(const char *File)
Definition: data_manager.h:186
CSG_Grid
Definition: grid.h:473
CSG_Data_Manager::Grid_System_Count
size_t Grid_System_Count(void) const
Definition: data_manager.h:174
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(const char *File)
Definition: data_manager.h:196
CSG_Data_Manager::Add_Grids
CSG_Grids * Add_Grids(const char *File)
Definition: data_manager.h:211
CSG_Shapes
Definition: shapes.h:773
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Data_Manager::Delete_Unsaved
bool Delete_Unsaved(bool bDetach=false)
Definition: data_manager.cpp:788
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Data_Manager::Add
CSG_Data_Object * Add(const char *File, TSG_Data_Object_Type Type=SG_DATAOBJECT_TYPE_Undefined)
Definition: data_manager.h:181
CSG_Data_Collection::m_Objects
CSG_Array_Pointer m_Objects
Definition: data_manager.h:120
CSG_Data_Collection::m_Type
TSG_Data_Object_Type m_Type
Definition: data_manager.h:118
CSG_Grids
Definition: grids.h:119
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(const CSG_String &File)
Definition: data_manager.h:195
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: dataobject.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions | Variables
dataobject.cpp File Reference
#include "dataobject.h"
#include <wx/string.h>
#include "tool_chain.h"

Go to the source code of this file.

Macros

#define Min_Samples 100

Functions

void * | SG_Get_Create_Pointer (void)
CSG_String | SG_Get_DataObject_Identifier (TSG_Data_Object_Type Type)
CSG_String | SG_Get_DataObject_Name (TSG_Data_Object_Type Type)
CSG_String | SG_Get_DataObject_Class_Name (TSG_Data_Object_Type Type)
bool | SG_DataObject_Set_Max_Samples (sLong Max_Samples)
sLong | SG_DataObject_Get_Max_Samples (void)
void | SG_Set_History_Depth (int Depth)
int | SG_Get_History_Depth (void)
void | SG_Set_History_Ignore_Lists (int Ignore)
int | SG_Get_History_Ignore_Lists (void)

Variables

static sLong | gSG_DataObject_Max_Samples = 0
int | g_History_Depth = -1
int | g_History_Ignore_Lists = true

Macro Definition Documentation

◆ Min_Samples

#define Min_Samples 100

Function Documentation

◆ SG_DataObject_Get_Max_Samples()

sLong SG_DataObject_Get_Max_Samples ( void )

Get the default value for the number of maximum samples used for building data object statistics

Definition at line 139 of file dataobject.cpp.

References gSG_DataObject_Max_Samples.

Referenced by CSG_Grid::Create().

◆ SG_DataObject_Set_Max_Samples()

bool SG_DataObject_Set_Max_Samples ( sLong Max_Samples )

Set the default value for the number of maximum samples used for building data object statistics

Definition at line 126 of file dataobject.cpp.

References gSG_DataObject_Max_Samples.

◆ SG_Get_Create_Pointer()

void* SG_Get_Create_Pointer ( void )

Definition at line 65 of file dataobject.cpp.

References DATAOBJECT_CREATE.

◆ SG_Get_DataObject_Class_Name()

CSG_String SG_Get_DataObject_Class_Name ( TSG_Data_Object_Type Type )

Definition at line 101 of file dataobject.cpp.

References SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ SG_Get_DataObject_Identifier()

CSG_String SG_Get_DataObject_Identifier ( TSG_Data_Object_Type Type )

Definition at line 71 of file dataobject.cpp.

References SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ SG_Get_DataObject_Name()

CSG_String SG_Get_DataObject_Name ( TSG_Data_Object_Type Type )

Definition at line 86 of file dataobject.cpp.

References _TL, SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

Referenced by CSG_Parameter::Get_Description(), and SG_XML_Add_Parameter().

◆ SG_Get_History_Depth()

int SG_Get_History_Depth ( void )

Definition at line 159 of file dataobject.cpp.

References g_History_Depth.

◆ SG_Get_History_Ignore_Lists()

int SG_Get_History_Ignore_Lists ( void )

Definition at line 172 of file dataobject.cpp.

References g_History_Ignore_Lists.

Referenced by CSG_Parameters::Set_History().

◆ SG_Set_History_Depth()

void SG_Set_History_Depth ( int Depth )

Definition at line 154 of file dataobject.cpp.

References g_History_Depth.

◆ SG_Set_History_Ignore_Lists()

void SG_Set_History_Ignore_Lists ( int Ignore )

Definition at line 167 of file dataobject.cpp.

References g_History_Ignore_Lists.

Variable Documentation

◆ g_History_Depth

int g_History_Depth = -1

Definition at line 152 of file dataobject.cpp.

Referenced by SG_Get_History_Depth(), and SG_Set_History_Depth().

◆ g_History_Ignore_Lists

int g_History_Ignore_Lists = true

Definition at line 165 of file dataobject.cpp.

Referenced by SG_Get_History_Ignore_Lists(), and SG_Set_History_Ignore_Lists().

◆ gSG_DataObject_Max_Samples

sLong gSG_DataObject_Max_Samples = 0
static

Definition at line 123 of file dataobject.cpp.

Referenced by CSG_Data_Object::CSG_Data_Object(), SG_DataObject_Get_Max_Samples(), and SG_DataObject_Set_Max_Samples().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: dataobject.cpp Source File

  • saga_core
  • saga_api
dataobject.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // dataobject.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "dataobject.h"
54
55 #include <wx/string.h>
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 void * SG_Get_Create_Pointer(void)
66 {
67 return( DATAOBJECT_CREATE );
68 }
69
70 //---------------------------------------------------------
71 CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
72 {
73 switch( Type )
74 {
75 case SG_DATAOBJECT_TYPE_Grid : return( "GRID" );
76 case SG_DATAOBJECT_TYPE_Grids : return( "GRIDS" );
77 case SG_DATAOBJECT_TYPE_Table : return( "TABLE" );
78 case SG_DATAOBJECT_TYPE_Shapes : return( "SHAPES" );
79 case SG_DATAOBJECT_TYPE_TIN : return( "TIN" );
80 case SG_DATAOBJECT_TYPE_PointCloud: return( "POINTS" );
81 default : return( "UNDEFINED" );
82 }
83 }
84
85 //---------------------------------------------------------
86 CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
87 {
88 switch( Type )
89 {
90 case SG_DATAOBJECT_TYPE_Grid : return( _TL("Grid" ) );
91 case SG_DATAOBJECT_TYPE_Grids : return( _TL("Grids" ) );
92 case SG_DATAOBJECT_TYPE_Table : return( _TL("Table" ) );
93 case SG_DATAOBJECT_TYPE_Shapes : return( _TL("Shapes" ) );
94 case SG_DATAOBJECT_TYPE_TIN : return( _TL("TIN" ) );
95 case SG_DATAOBJECT_TYPE_PointCloud: return( _TL("Point Cloud") );
96 default : return( _TL("Undefined" ) );
97 }
98 }
99
100 //---------------------------------------------------------
101 CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
102 {
103 switch( Type )
104 {
105 case SG_DATAOBJECT_TYPE_Grid : return( "CSG_Grid" );
106 case SG_DATAOBJECT_TYPE_Grids : return( "CSG_Grids" );
107 case SG_DATAOBJECT_TYPE_Table : return( "CSG_Table" );
108 case SG_DATAOBJECT_TYPE_Shapes : return( "CSG_Shapes" );
109 case SG_DATAOBJECT_TYPE_TIN : return( "CSG_TIN" );
110 case SG_DATAOBJECT_TYPE_PointCloud: return( "CSG_PointCloud" );
111 default : return( "CSG_DataObject" );
112 }
113 }
114
115
117 // //
118 // Data Object Statistics //
119 // //
121
122 //---------------------------------------------------------
123 static sLong gSG_DataObject_Max_Samples = 0;
124
125 //---------------------------------------------------------
126 bool SG_DataObject_Set_Max_Samples (sLong Max_Samples)
127 {
128 if( Max_Samples >= 0 )
129 {
130 gSG_DataObject_Max_Samples = Max_Samples;
131
132 return( true );
133 }
134
135 return( false );
136 }
137
138 //---------------------------------------------------------
139 sLong SG_DataObject_Get_Max_Samples (void)
140 {
141 return( gSG_DataObject_Max_Samples );
142 }
143
144
146 // //
147 // //
148 // //
150
151 //---------------------------------------------------------
152 int g_History_Depth = -1;
153
154 void SG_Set_History_Depth (int Depth)
155 {
156 g_History_Depth = Depth;
157 }
158
159 int SG_Get_History_Depth (void)
160 {
161 return( g_History_Depth );
162 }
163
164 //---------------------------------------------------------
165 int g_History_Ignore_Lists = true;
166
167 void SG_Set_History_Ignore_Lists (int Ignore)
168 {
169 g_History_Ignore_Lists = Ignore != 0;
170 }
171
172 int SG_Get_History_Ignore_Lists (void)
173 {
174 return( g_History_Ignore_Lists );
175 }
176
177
179 // //
180 // //
181 // //
183
184 //---------------------------------------------------------
185 CSG_Data_Object::CSG_Data_Object(void)
186 {
187 m_MetaData.Set_Name("SAGA_METADATA");
188
189 m_pMD_Database = m_MetaData.Add_Child(SG_META_DATABASE);
190 m_pMD_Source = m_MetaData.Add_Child(SG_META_SOURCE );
191 m_pMD_History = m_MetaData.Add_Child(SG_META_HISTORY );
192
193 //-----------------------------------------------------
194 m_File_bNative = false;
195 m_File_Type = 0;
196 m_bModified = true;
197
198 m_NoData_Value[0] = -99999.;
199 m_NoData_Value[1] = -99999.;
200
201 m_Max_Samples = gSG_DataObject_Max_Samples;
202
203 m_Name .Clear();
204 m_Description .Clear();
205
206 m_bUpdate = false;
207
208 m_pOwner = NULL;
209 }
210
211 //---------------------------------------------------------
212 CSG_Data_Object::~CSG_Data_Object(void)
213 {
214 Destroy();
215 }
216
217 //---------------------------------------------------------
218 bool CSG_Data_Object::Destroy(void)
219 {
220 m_Name.Clear(); m_Description.Clear();
221
222 m_pMD_Database->Destroy();
223 m_pMD_Source ->Destroy();
224 m_pMD_History ->Destroy();
225
226 return( true );
227 }
228
229
231 // //
233
234 //---------------------------------------------------------
235 void CSG_Data_Object::Set_Name(const CSG_String &Name)
236 {
237 if( Name.is_Empty() )
238 {
239 m_Name = _TL("Data");
240 }
241 else
242 {
243 m_Name = Name;
244 }
245 }
246
247 //---------------------------------------------------------
248 void CSG_Data_Object::Fmt_Name(const char *Format, ...)
249 {
250 wxString _s;
251
252 va_list argptr;
253
254 #ifdef _SAGA_LINUX
255 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
256 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
257 #else
258 va_start(argptr, Format); _s.PrintfV( Format, argptr);
259 #endif
260
261 va_end(argptr);
262
263 Set_Name(CSG_String(&_s));
264 }
265
266 //---------------------------------------------------------
267 void CSG_Data_Object::Fmt_Name(const wchar_t *Format, ...)
268 {
269 wxString _s;
270
271 va_list argptr;
272
273 #ifdef _SAGA_LINUX
274 // workaround as we only use wide characters
275 // since wx 2.9.4 so interpret strings as multibyte
276 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
277 va_start(argptr, _Format); _s.PrintfV(_Format, argptr);
278 #else
279 va_start(argptr, Format); _s.PrintfV( Format, argptr);
280 #endif
281
282 va_end(argptr);
283
284 CSG_String s(&_s);
285
286 Set_Name(CSG_String(&_s));
287 }
288
289 //---------------------------------------------------------
290 const SG_Char * CSG_Data_Object::Get_Name(void) const
291 {
292 return( m_Name );
293 }
294
295 //---------------------------------------------------------
296 void CSG_Data_Object::Set_Description(const CSG_String &Description)
297 {
298 m_Description = Description;
299 }
300
301 const SG_Char * CSG_Data_Object::Get_Description(void) const
302 {
303 return( m_Description.is_Empty() && m_pOwner ? m_pOwner->m_Description : m_Description );
304 }
305
306 //---------------------------------------------------------
307 void CSG_Data_Object::Set_File_Name (const CSG_String &FileName)
308 {
309 Set_File_Name(FileName, false);
310 }
311
312 //---------------------------------------------------------
313 void CSG_Data_Object::Set_File_Name(const CSG_String &FileName, bool bNative)
314 {
315 if( FileName.is_Empty() )
316 {
317 m_FileName .Clear();
318 m_File_bNative = false;
319 m_bModified = true;
320 }
321 else
322 {
323 m_FileName = FileName;
324 m_File_bNative = bNative;
325 m_bModified = false;
326 m_Name = SG_File_Get_Name(FileName, false);
327 }
328 }
329
330 //---------------------------------------------------------
331 const SG_Char * CSG_Data_Object::Get_File_Name(bool bNative) const
332 {
333 if( bNative && !m_File_bNative )
334 {
335 return( SG_T("") );
336 }
337
338 if( m_pOwner )
339 {
340 if( m_pOwner->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
341 {
342 return( m_pOwner->m_FileName.c_str() );
343 }
344 }
345
346 return( m_FileName.c_str() );
347 }
348
349 //---------------------------------------------------------
350 int CSG_Data_Object::Get_File_Type(void) const
351 {
352 return( m_File_Type );
353 }
354
355
357 // //
359
360 //---------------------------------------------------------
361 /*
362 * If the data object has a file asssociation, this function
363 * can be used to reload its content.
364 */
365 //---------------------------------------------------------
366 bool CSG_Data_Object::Reload(void)
367 {
368 return( SG_File_Exists(m_FileName) && On_Reload() );
369 }
370
371 //---------------------------------------------------------
372 /*
373 * If the data object is stored in a native SAGA format,
374 * this function can be used to delete all files asssociated
375 * with it.
376 */
377 //---------------------------------------------------------
378 bool CSG_Data_Object::Delete(void)
379 {
380 if( m_File_bNative && SG_File_Exists(m_FileName) && On_Delete() )
381 {
382 CSG_String FileName = m_FileName;
383
384 switch( Get_ObjectType() )
385 {
386 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
387 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
388 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
389 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
390 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
391 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
392 default : SG_File_Set_Extension(FileName, "sg-info"); break;
393 }
394
395 SG_File_Delete(FileName);
396
397 SG_File_Set_Extension(FileName, "prj"); SG_File_Delete(FileName);
398 SG_File_Set_Extension(FileName, "sg-prj"); SG_File_Delete(FileName);
399
400 //-------------------------------------------------
401 m_FileName = "";
402 m_File_bNative = false;
403 m_File_Type = 0;
404
405 m_bModified = true;
406
407 m_pMD_Database->Destroy();
408
409 return( true );
410 }
411
412 return( false );
413 }
414
415
417 // //
419
420 //---------------------------------------------------------
421 /*
422 * Type cast function. Returns NULL if object is not exactly
423 * of class type CSG_Table with bPolymorph = false or of
424 * one of its derivatives (CSG_Shapes, CSG_PointCloud,
425 * CSG_TIN) with bPolymorph = true.
426 */
427 //---------------------------------------------------------
428 CSG_Table * CSG_Data_Object::asTable(bool bPolymorph) const
429 {
430 if( bPolymorph )
431 {
432 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Table
433 || Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
434 || Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud
435 || Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN
436 ? (CSG_Table *)this : NULL
437 );
438 }
439
440 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Table ? (CSG_Table *)this : NULL );
441 }
442
443 //---------------------------------------------------------
444 /*
445 * Type cast function. Returns NULL if object is not exactly
446 * of class type CSG_Shapes with bPolymorph = false or of
447 * one of its derivatives (CSG_PointCloud) with bPolymorph = true.
448 */
449 //---------------------------------------------------------
450 CSG_Shapes * CSG_Data_Object::asShapes(bool bPolymorph) const
451 {
452 if( bPolymorph )
453 {
454 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
455 || Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud
456 ? (CSG_Shapes *)this : NULL
457 );
458 }
459
460 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes ? (CSG_Shapes *)this : NULL );
461 }
462
463 //---------------------------------------------------------
464 /*
465 * Type cast function. Returns NULL if object is not exactly
466 * of class type CSG_TIN. The bPolymorph flag has no effect.
467 */
468 //---------------------------------------------------------
469 CSG_TIN * CSG_Data_Object::asTIN(bool bPolymorph) const
470 {
471 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN ? (CSG_TIN *)this : NULL );
472 }
473
474 //---------------------------------------------------------
475 /*
476 * Type cast function. Returns NULL if object is not exactly
477 * of class type CSG_PointCloud. The bPolymorph flag has no effect.
478 */
479 //---------------------------------------------------------
480 CSG_PointCloud * CSG_Data_Object::asPointCloud(bool bPolymorph) const
481 {
482 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud ? (CSG_PointCloud *)this : NULL );
483 }
484
485 //---------------------------------------------------------
486 /*
487 * Type cast function. Returns NULL if object is not exactly
488 * of class type CSG_Grid. The bPolymorph flag has no effect.
489 */
490 //---------------------------------------------------------
491 CSG_Grid * CSG_Data_Object::asGrid(bool bPolymorph) const
492 {
493 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid ? (CSG_Grid *)this : NULL );
494 }
495
496 //---------------------------------------------------------
497 /*
498 * Type cast function. Returns NULL if object is not exactly
499 * of class type CSG_Grids. The bPolymorph flag has no effect.
500 */
501 //---------------------------------------------------------
502 CSG_Grids * CSG_Data_Object::asGrids(bool bPolymorph) const
503 {
504 return( Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids ? (CSG_Grids *)this : NULL );
505 }
506
507
509 // //
511
512 //---------------------------------------------------------
513 bool CSG_Data_Object::Set_NoData_Value(double Value)
514 {
515 return( Set_NoData_Value_Range(Value, Value) );
516 }
517
518 //---------------------------------------------------------
519 bool CSG_Data_Object::Set_NoData_Value_Range(double Lower, double Upper)
520 {
521 if( Lower > Upper )
522 {
523 double d = Lower; Lower = Upper; Upper = d;
524 }
525
526 if( Lower != m_NoData_Value[0] || Upper != m_NoData_Value[1] )
527 {
528 m_NoData_Value[0] = Lower;
529 m_NoData_Value[1] = Upper;
530
531 Set_Modified();
532
533 On_NoData_Changed();
534
535 return( true );
536 }
537
538 return( false );
539 }
540
541 //---------------------------------------------------------
542 bool CSG_Data_Object::On_NoData_Changed(void)
543 {
544 if( !Get_Update_Flag() )
545 {
546 Set_Update_Flag();
547 }
548
549 return( true );
550 }
551
552
554 // //
556
557 //---------------------------------------------------------
558 bool CSG_Data_Object::Set_Max_Samples(sLong Max_Samples)
559 {
560 #define Min_Samples 100
561
562 if( m_Max_Samples != Max_Samples && Max_Samples >= Min_Samples )
563 {
564 m_Max_Samples = Max_Samples;
565
566 Update(true);
567 }
568
569 return( true );
570 }
571
572
574 // //
576
577 //---------------------------------------------------------
578 CSG_Projection & CSG_Data_Object::Get_Projection(void)
579 {
580 return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
581 }
582
583 //---------------------------------------------------------
584 const CSG_Projection & CSG_Data_Object::Get_Projection(void) const
585 {
586 return( m_pOwner ? m_pOwner->m_Projection : m_Projection );
587 }
588
589
591 // //
593
594 //---------------------------------------------------------
595 bool CSG_Data_Object::Load_MetaData(const CSG_String &_FileName)
596 {
597 CSG_String FileName(_FileName);
598
599 switch( Get_ObjectType() )
600 {
601 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
602 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
603 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
604 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
605 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
606 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info");
607 if( !SG_File_Get_Extension(_FileName).CmpNoCase("spc") ) SG_File_Set_Extension(FileName, "mpts"); break;
608
609 default: return( false );
610 }
611
612 CSG_File Stream(FileName, SG_FILE_R, false);
613
614 return( Load_MetaData(Stream) );
615 }
616
617 //---------------------------------------------------------
618 bool CSG_Data_Object::Save_MetaData(const CSG_String &_FileName)
619 {
620 CSG_String FileName(_FileName);
621
622 switch( Get_ObjectType() )
623 {
624 case SG_DATAOBJECT_TYPE_Grid : SG_File_Set_Extension(FileName, "mgrd" ); break;
625 case SG_DATAOBJECT_TYPE_Grids : SG_File_Set_Extension(FileName, "sg-info"); break;
626 case SG_DATAOBJECT_TYPE_Table : SG_File_Set_Extension(FileName, "mtab" ); break;
627 case SG_DATAOBJECT_TYPE_Shapes : SG_File_Set_Extension(FileName, "mshp" ); break;
628 case SG_DATAOBJECT_TYPE_TIN : SG_File_Set_Extension(FileName, "sg-info"); break;
629 case SG_DATAOBJECT_TYPE_PointCloud: SG_File_Set_Extension(FileName, "sg-info"); break;
630
631 default: return( false );
632 }
633
634 CSG_File Stream(FileName, SG_FILE_W, false);
635
636 return( Save_MetaData(Stream) );
637 }
638
639 //---------------------------------------------------------
640 bool CSG_Data_Object::Load_MetaData(CSG_File &Stream)
641 {
642 CSG_MetaData m;
643
644 if( !m.Load(Stream) )
645 {
646 return( false );
647 }
648
649 //-----------------------------------------------------
650 if( m("DESCRIPTION") && !m["DESCRIPTION"].Get_Content().is_Empty() )
651 {
652 Set_Description(m["DESCRIPTION"].Get_Content());
653 }
654
655 //-----------------------------------------------------
656 m_pMD_Source->Destroy();
657
658 if( m(SG_META_SOURCE) )
659 m_pMD_Source->Assign(m[SG_META_SOURCE]);
660
661 //-----------------------------------------------------
662 m_pMD_Database->Destroy();
663
664 if( m(SG_META_DATABASE) )
665 m_pMD_Database->Assign(m[SG_META_DATABASE]);
666
667 //-----------------------------------------------------
668 m_MetaData.Del_Child(SG_META_PROJECTION);
669
670 if( m(SG_META_PROJECTION) && m_Projection.Load(m[SG_META_PROJECTION]) )
671 m_MetaData.Add_Child(m[SG_META_PROJECTION]);
672 else if( m[SG_META_SOURCE](SG_META_PROJECTION) && m_Projection.Load(m[SG_META_SOURCE][SG_META_PROJECTION]) )
673 m_MetaData.Add_Child(m[SG_META_SOURCE][SG_META_PROJECTION]);
674
675 //-----------------------------------------------------
676 m_pMD_History->Destroy();
677
678 if( m(SG_META_HISTORY) )
679 m_pMD_History->Assign(m[SG_META_HISTORY]);
680 else
681 m_pMD_History->Add_Child(SG_META_FILEPATH, Get_File_Name());
682
683 return( true );
684 }
685
686 //---------------------------------------------------------
687 bool CSG_Data_Object::Save_MetaData(CSG_File &Stream)
688 {
689 //-----------------------------------------------------
690 if( m_MetaData(SG_META_FILEPATH) )
691 m_MetaData(SG_META_FILEPATH)->Set_Content(m_FileName);
692 else
693 m_MetaData.Add_Child(SG_META_FILEPATH, m_FileName);
694
695 //-----------------------------------------------------
696 if( m_MetaData("DESCRIPTION") )
697 m_MetaData("DESCRIPTION")->Set_Content(Get_Description());
698 else
699 m_MetaData.Add_Child("DESCRIPTION", Get_Description());
700
701 //-----------------------------------------------------
702 if( m_Projection.Get_Type() == SG_PROJ_TYPE_CS_Undefined )
703 m_MetaData.Del_Child(SG_META_PROJECTION);
704 else if( m_MetaData(SG_META_PROJECTION) )
705 m_Projection.Save(*m_MetaData(SG_META_PROJECTION));
706 else
707 m_Projection.Save(*m_MetaData.Add_Child(SG_META_PROJECTION));
708
709 //-----------------------------------------------------
710 return( m_MetaData.Save(Stream) );
711 }
712
713 //---------------------------------------------------------
714 bool CSG_Data_Object::Update(bool bForce)
715 {
716 if( m_bUpdate || bForce )
717 {
718 m_bUpdate = false;
719
720 bool bResult = On_Update();
721
722 return( bResult );
723 }
724
725 return( true );
726 }
727
728
730 // //
732
733 //---------------------------------------------------------
734 bool CSG_Data_Object::Assign(CSG_Data_Object *pObject)
735 {
736 return( false );
737 }
738
739
741 // //
743
744 //---------------------------------------------------------
745 #include "tool_chain.h"
746
747 //---------------------------------------------------------
748 bool CSG_Data_Object::Save_History_to_Model(const CSG_String &File) const
749 {
750 return( CSG_Tool_Chain::Save_History_to_Model(Get_History(), File) );
751 }
752
753
755 // //
756 // //
757 // //
759
760 //---------------------------------------------------------
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:734
CSG_Data_Object::m_pOwner
CSG_Data_Object * m_pOwner
Definition: dataobject.h:259
SG_T
#define SG_T(s)
Definition: api_core.h:531
Min_Samples
#define Min_Samples
CSG_MetaData::Del_Child
bool Del_Child(int Index)
Definition: metadata.cpp:329
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
tool_chain.h
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Data_Object::asTIN
class CSG_TIN * asTIN(bool bPolymorph=false) const
Definition: dataobject.cpp:469
SG_Get_Create_Pointer
void * SG_Get_Create_Pointer(void)
Definition: dataobject.cpp:65
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
CSG_Data_Object::Get_ObjectType
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.
CSG_Data_Object::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:558
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_File
Definition: api_core.h:1116
CSG_Projection::Get_Type
TSG_Projection_Type Get_Type(void) const
Definition: geo_tools.h:887
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:450
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
CSG_TIN
Definition: tin.h:222
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
SG_META_SOURCE
#define SG_META_SOURCE
Definition: dataobject.h:89
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Object::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: dataobject.cpp:542
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:502
SG_DataObject_Get_Max_Samples
sLong SG_DataObject_Get_Max_Samples(void)
Definition: dataobject.cpp:139
SG_Get_DataObject_Identifier
CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:71
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
SG_META_HISTORY
#define SG_META_HISTORY
Definition: dataobject.h:93
sLong
signed long long sLong
Definition: api_core.h:158
SG_Set_History_Depth
void SG_Set_History_Depth(int Depth)
Definition: dataobject.cpp:154
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
SG_Set_History_Ignore_Lists
void SG_Set_History_Ignore_Lists(int Ignore)
Definition: dataobject.cpp:167
SG_File_Get_Extension
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &FileName)
Definition: api_file.cpp:953
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
dataobject.h
CSG_Data_Object::asTable
class CSG_Table * asTable(bool bPolymorph=false) const
Definition: dataobject.cpp:428
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
SG_DataObject_Set_Max_Samples
bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:126
CSG_Tool_Chain::Save_History_to_Model
static bool Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_MetaData::Assign
bool Assign(const CSG_MetaData &MetaData, bool bAddChildren=true)
Definition: metadata.cpp:761
CSG_Projection
Definition: geo_tools.h:833
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:274
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Data_Object::Delete
bool Delete(void)
Deletes all files associated with this data object if possible. Works only with native SAGA files....
Definition: dataobject.cpp:378
SG_Get_History_Ignore_Lists
int SG_Get_History_Ignore_Lists(void)
Definition: dataobject.cpp:172
SG_Char
#define SG_Char
Definition: api_core.h:530
SG_META_PROJECTION
#define SG_META_PROJECTION
Definition: dataobject.h:92
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Data_Object::asGrid
class CSG_Grid * asGrid(bool bPolymorph=false) const
Definition: dataobject.cpp:491
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
SG_META_DATABASE
#define SG_META_DATABASE
Definition: dataobject.h:91
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_Data_Object::Save_History_to_Model
bool Save_History_to_Model(const CSG_String &File) const
Definition: dataobject.cpp:748
SG_Get_History_Depth
int SG_Get_History_Depth(void)
Definition: dataobject.cpp:159
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_PROJ_TYPE_CS_Undefined
@ SG_PROJ_TYPE_CS_Undefined
Definition: geo_tools.h:784
CSG_Data_Object::Get_File_Type
int Get_File_Type(void) const
Definition: dataobject.cpp:350
g_History_Ignore_Lists
int g_History_Ignore_Lists
Definition: dataobject.cpp:165
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Data_Object::Fmt_Name
void Fmt_Name(const char *Format,...)
Definition: dataobject.cpp:248
CSG_Data_Object::asPointCloud
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
Definition: dataobject.cpp:480
CSG_Grid
Definition: grid.h:473
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Data_Object::CSG_Data_Object
CSG_Data_Object(void)
Definition: dataobject.cpp:185
CSG_PointCloud
Definition: pointcloud.h:105
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Data_Object::Reload
bool Reload(void)
If there is an associated file data can be reloaded with this command.
Definition: dataobject.cpp:366
CSG_Data_Object::~CSG_Data_Object
virtual ~CSG_Data_Object(void)
Definition: dataobject.cpp:212
CSG_Grids
Definition: grids.h:119
g_History_Depth
int g_History_Depth
Definition: dataobject.cpp:152
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
SG_Get_DataObject_Class_Name
CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:101
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
SG_META_FILEPATH
#define SG_META_FILEPATH
Definition: dataobject.h:90
gSG_DataObject_Max_Samples
static sLong gSG_DataObject_Max_Samples
Definition: dataobject.cpp:123
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: dataobject.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Enumerations | Functions
dataobject.h File Reference
#include "mat_tools.h"
#include "metadata.h"

Go to the source code of this file.

Classes

class CSG_Data_Object

Macros

#define | SG_META_SOURCE "SOURCE"
#define | SG_META_FILEPATH "FILE"
#define | SG_META_DATABASE "DATABASE"
#define | SG_META_PROJECTION "PROJECTION"
#define | SG_META_HISTORY "HISTORY"
#define | DATAOBJECT_NOTSET ((void *)NULL)
#define | DATAOBJECT_CREATE ((void *)1)

Enumerations

enum TSG_Data_Object_Type {
SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_Table, SG_DATAOBJECT_TYPE_Shapes,
SG_DATAOBJECT_TYPE_TIN, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Undefined
}

Functions

SAGA_API_DLL_EXPORT void * | SG_Get_Create_Pointer (void)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_DataObject_Identifier (TSG_Data_Object_Type Type)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_DataObject_Name (TSG_Data_Object_Type Type)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_DataObject_Class_Name (TSG_Data_Object_Type Type)
SAGA_API_DLL_EXPORT bool | SG_DataObject_Set_Max_Samples (sLong Max_Samples)
SAGA_API_DLL_EXPORT sLong | SG_DataObject_Get_Max_Samples (void)
SAGA_API_DLL_EXPORT void | SG_Set_History_Depth (int Depth)
SAGA_API_DLL_EXPORT int | SG_Get_History_Depth (void)
SAGA_API_DLL_EXPORT void | SG_Set_History_Ignore_Lists (int Ignore)
SAGA_API_DLL_EXPORT int | SG_Get_History_Ignore_Lists (void)

Detailed Description

Base class for data objects and related declarations.

See also
CSG_Data_Object
CSG_History

Definition in file dataobject.h.

Macro Definition Documentation

◆ DATAOBJECT_CREATE

#define DATAOBJECT_CREATE ((void *)1)

Definition at line 130 of file dataobject.h.

◆ DATAOBJECT_NOTSET

#define DATAOBJECT_NOTSET ((void *)NULL)

Definition at line 129 of file dataobject.h.

◆ SG_META_DATABASE

#define SG_META_DATABASE "DATABASE"

Definition at line 91 of file dataobject.h.

◆ SG_META_FILEPATH

#define SG_META_FILEPATH "FILE"

Definition at line 90 of file dataobject.h.

◆ SG_META_HISTORY

#define SG_META_HISTORY "HISTORY"

Definition at line 93 of file dataobject.h.

◆ SG_META_PROJECTION

#define SG_META_PROJECTION "PROJECTION"

Definition at line 92 of file dataobject.h.

◆ SG_META_SOURCE

#define SG_META_SOURCE "SOURCE"

Definition at line 89 of file dataobject.h.

Enumeration Type Documentation

◆ TSG_Data_Object_Type

enum TSG_Data_Object_Type

Definition of available data types. This is returned by the CSG_Data_Object::Get_ObjectType() function to allow type checking at run time.

See also
CSG_Data_Object
CSG_Table
CSG_PointCloud
CSG_Shapes
CSG_TIN
CSG_Grid
CSG_Grids
Enumerator
SG_DATAOBJECT_TYPE_Grid
SG_DATAOBJECT_TYPE_Grids
SG_DATAOBJECT_TYPE_Table
SG_DATAOBJECT_TYPE_Shapes
SG_DATAOBJECT_TYPE_TIN
SG_DATAOBJECT_TYPE_PointCloud
SG_DATAOBJECT_TYPE_Undefined

Definition at line 116 of file dataobject.h.

Function Documentation

◆ SG_DataObject_Get_Max_Samples()

SAGA_API_DLL_EXPORT sLong SG_DataObject_Get_Max_Samples ( void )

Get the default value for the number of maximum samples used for building data object statistics

Definition at line 139 of file dataobject.cpp.

References gSG_DataObject_Max_Samples.

Referenced by CSG_Grid::Create().

◆ SG_DataObject_Set_Max_Samples()

SAGA_API_DLL_EXPORT bool SG_DataObject_Set_Max_Samples ( sLong Max_Samples )

Set the default value for the number of maximum samples used for building data object statistics

Definition at line 126 of file dataobject.cpp.

References gSG_DataObject_Max_Samples.

◆ SG_Get_Create_Pointer()

SAGA_API_DLL_EXPORT void* SG_Get_Create_Pointer ( void )

Definition at line 65 of file dataobject.cpp.

References DATAOBJECT_CREATE.

◆ SG_Get_DataObject_Class_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Class_Name ( TSG_Data_Object_Type Type )

Definition at line 101 of file dataobject.cpp.

References SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ SG_Get_DataObject_Identifier()

SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Identifier ( TSG_Data_Object_Type Type )

Definition at line 71 of file dataobject.cpp.

References SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

◆ SG_Get_DataObject_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Name ( TSG_Data_Object_Type Type )

Definition at line 86 of file dataobject.cpp.

References _TL, SG_DATAOBJECT_TYPE_Grid, SG_DATAOBJECT_TYPE_Grids, SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, SG_DATAOBJECT_TYPE_Table, and SG_DATAOBJECT_TYPE_TIN.

Referenced by CSG_Parameter::Get_Description(), and SG_XML_Add_Parameter().

◆ SG_Get_History_Depth()

SAGA_API_DLL_EXPORT int SG_Get_History_Depth ( void )

Definition at line 159 of file dataobject.cpp.

References g_History_Depth.

◆ SG_Get_History_Ignore_Lists()

SAGA_API_DLL_EXPORT int SG_Get_History_Ignore_Lists ( void )

Definition at line 172 of file dataobject.cpp.

References g_History_Ignore_Lists.

Referenced by CSG_Parameters::Set_History().

◆ SG_Set_History_Depth()

SAGA_API_DLL_EXPORT void SG_Set_History_Depth ( int Depth )

Definition at line 154 of file dataobject.cpp.

References g_History_Depth.

◆ SG_Set_History_Ignore_Lists()

SAGA_API_DLL_EXPORT void SG_Set_History_Ignore_Lists ( int Ignore )

Definition at line 167 of file dataobject.cpp.

References g_History_Ignore_Lists.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: dataobject.h Source File

  • saga_core
  • saga_api
dataobject.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // dataobject.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__dataobject_H
54 #define HEADER_INCLUDED__SAGA_API__dataobject_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
71 // //
73 // //
74 // //
76
77 //---------------------------------------------------------
78 #include "mat_tools.h"
79 #include "metadata.h"
80
81
83 // //
84 // Meta-Data //
85 // //
87
88 //---------------------------------------------------------
89 #define SG_META_SOURCE "SOURCE"
90 #define SG_META_FILEPATH "FILE"
91 #define SG_META_DATABASE "DATABASE"
92 #define SG_META_PROJECTION "PROJECTION"
93 #define SG_META_HISTORY "HISTORY"
94
95
97 // //
98 // Data Objects //
99 // //
101
102 //---------------------------------------------------------
115 //---------------------------------------------------------
116 typedef enum
117 {
118 SG_DATAOBJECT_TYPE_Grid,
119 SG_DATAOBJECT_TYPE_Grids,
120 SG_DATAOBJECT_TYPE_Table,
121 SG_DATAOBJECT_TYPE_Shapes,
122 SG_DATAOBJECT_TYPE_TIN,
123 SG_DATAOBJECT_TYPE_PointCloud,
124 SG_DATAOBJECT_TYPE_Undefined
125 }
126 TSG_Data_Object_Type;
127
128 //---------------------------------------------------------
129 #define DATAOBJECT_NOTSET ((void *)NULL)
130 #define DATAOBJECT_CREATE ((void *)1)
131
132 SAGA_API_DLL_EXPORT void * SG_Get_Create_Pointer (void);
133
134 //---------------------------------------------------------
135 SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Identifier (TSG_Data_Object_Type Type);
136 SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Name (TSG_Data_Object_Type Type);
137 SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Class_Name (TSG_Data_Object_Type Type);
138
139
141 // //
143
144 //---------------------------------------------------------
146 SAGA_API_DLL_EXPORT bool SG_DataObject_Set_Max_Samples (sLong Max_Samples);
147
149 SAGA_API_DLL_EXPORT sLong SG_DataObject_Get_Max_Samples (void);
150
151
153 // //
155
156 //---------------------------------------------------------
157 SAGA_API_DLL_EXPORT void SG_Set_History_Depth (int Depth);
158 SAGA_API_DLL_EXPORT int SG_Get_History_Depth (void);
159 SAGA_API_DLL_EXPORT void SG_Set_History_Ignore_Lists (int Ignore);
160 SAGA_API_DLL_EXPORT int SG_Get_History_Ignore_Lists (void);
161
162
164 // //
166
167 //---------------------------------------------------------
178 //---------------------------------------------------------
179 class SAGA_API_DLL_EXPORT CSG_Data_Object
180 {
181 public:
182 CSG_Data_Object(void);
183 virtual ~CSG_Data_Object(void);
184
185 virtual bool Destroy (void);
186
188 virtual TSG_Data_Object_Type Get_ObjectType (void) const = 0;
189
190 virtual bool is_Valid (void) const = 0;
191
192 virtual bool Save (const CSG_String &File, int Format = 0) = 0;
193 virtual bool Save (const char *File, int Format = 0) = 0;
194 virtual bool Save (const wchar_t *File, int Format = 0) = 0;
195
197 bool Reload (void);
198
200 bool Delete (void);
201
202 void Set_File_Name (const CSG_String &FileName);
203 const SG_Char * Get_File_Name (bool bNative = true) const;
204 int Get_File_Type (void) const;
205
206 bool is_File_Native (void) const { return( m_File_bNative ); }
207
208 virtual bool Assign (CSG_Data_Object *pObject);
209
210 void Set_Name (const CSG_String &Name);
211 void Fmt_Name (const char *Format, ...);
212 void Fmt_Name (const wchar_t *Format, ...);
213 const SG_Char * Get_Name (void) const;
214
215 void Set_Description (const CSG_String &Description);
216 const SG_Char * Get_Description (void) const;
217
218 virtual void Set_Modified (bool bOn = true) { m_bModified = bOn; if( bOn && m_pOwner ) m_pOwner->Set_Modified(bOn); }
219 virtual bool is_Modified (void) const { return( m_bModified ); }
220 bool Update (bool bForce = false);
221
222 CSG_Data_Object * Get_Owner (void) const { return( m_pOwner ); }
223 void Set_Owner (CSG_Data_Object *pOwner) { m_pOwner = pOwner; }
224
225 CSG_MetaData & Get_MetaData (void) const { return( *m_pMD_Source ); }
226 CSG_MetaData & Get_MetaData_DB (void) const { return( *m_pMD_Database ); }
227 CSG_MetaData & Get_History (void) { return( *m_pMD_History ); }
228 const CSG_MetaData & Get_History (void) const { return( *m_pMD_History ); }
229
230 virtual const CSG_Rect & Get_Extent (void) = 0;
231
232 CSG_Projection & Get_Projection (void);
233 const CSG_Projection & Get_Projection (void) const;
234
235 class CSG_Table * asTable (bool bPolymorph = false) const;
236 class CSG_Shapes * asShapes (bool bPolymorph = false) const;
237 class CSG_TIN * asTIN (bool bPolymorph = false) const;
238 class CSG_PointCloud * asPointCloud (bool bPolymorph = false) const;
239 class CSG_Grid * asGrid (bool bPolymorph = false) const;
240 class CSG_Grids * asGrids (bool bPolymorph = false) const;
241
242 virtual bool Set_NoData_Value (double Value);
243 virtual bool Set_NoData_Value_Range (double Lower, double Upper);
244 double Get_NoData_Value (bool bUpper = false) const { return( m_NoData_Value[bUpper ? 1 : 0] ); }
245
246 bool is_NoData_Value (double Value) const
247 {
248 return( SG_is_NaN(Value) || (m_NoData_Value[0] < m_NoData_Value[1] ? m_NoData_Value[0] <= Value && Value <= m_NoData_Value[1] : Value == m_NoData_Value[0]) );
249 }
250
251 bool Save_History_to_Model (const CSG_String &File) const;
252
253 virtual bool Set_Max_Samples (sLong Max_Samples);
254 sLong Get_Max_Samples (void) const { return( m_Max_Samples ); }
255
256
257 protected:
258
259 CSG_Data_Object *m_pOwner;
260
261
262 void Set_File_Name (const CSG_String &FileName, bool bNative);
263 void Set_File_Type (int Type) { m_File_Type = Type; }
264
265 virtual bool On_Reload (void) = 0;
266 virtual bool On_Delete (void) = 0;
267
268 bool Load_MetaData (const CSG_String &FileName);
269 bool Load_MetaData (CSG_File &Stream);
270 bool Save_MetaData (const CSG_String &FileName);
271 bool Save_MetaData (CSG_File &Stream);
272
273 void Set_Update_Flag (bool bOn = true) { m_bUpdate = bOn; }
274 bool Get_Update_Flag (void) { return( m_bUpdate ); }
275 virtual bool On_Update (void) { return( true ); }
276 virtual bool On_NoData_Changed (void);
277
278
279 private:
280
281 bool m_bModified, m_bUpdate, m_File_bNative;
282
283 int m_File_Type;
284
285 sLong m_Max_Samples;
286
287 double m_NoData_Value[2];
288
289 CSG_String m_FileName, m_Name, m_Description;
290
291
292 CSG_MetaData m_MetaData, *m_pMD_Source, *m_pMD_History, *m_pMD_Database;
293
294 CSG_Projection m_Projection;
295
296 };
297
298
300 // //
301 // //
302 // //
304
305 //---------------------------------------------------------
306 #endif // #ifndef HEADER_INCLUDED__SAGA_API__dataobject_H
CSG_Rect
Definition: geo_tools.h:471
SG_Get_DataObject_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Identifier(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:71
SG_Get_History_Ignore_Lists
SAGA_API_DLL_EXPORT int SG_Get_History_Ignore_Lists(void)
Definition: dataobject.cpp:172
CSG_Data_Object::Get_Max_Samples
sLong Get_Max_Samples(void) const
Definition: dataobject.h:254
CSG_Data_Object::m_pOwner
CSG_Data_Object * m_pOwner
Definition: dataobject.h:259
SG_DataObject_Set_Max_Samples
SAGA_API_DLL_EXPORT bool SG_DataObject_Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:126
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
CSG_Data_Object::Save
virtual bool Save(const wchar_t *File, int Format=0)=0
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
SG_Get_DataObject_Class_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:101
CSG_Data_Object::Save
virtual bool Save(const CSG_String &File, int Format=0)=0
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Data_Object::asTIN
class CSG_TIN * asTIN(bool bPolymorph=false) const
Definition: dataobject.cpp:469
CSG_Data_Object::Get_ObjectType
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.
SG_Get_Create_Pointer
SAGA_API_DLL_EXPORT void * SG_Get_Create_Pointer(void)
Definition: dataobject.cpp:65
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_File
Definition: api_core.h:1116
SG_Set_History_Depth
SAGA_API_DLL_EXPORT void SG_Set_History_Depth(int Depth)
Definition: dataobject.cpp:154
CSG_Data_Object::Get_Owner
CSG_Data_Object * Get_Owner(void) const
Definition: dataobject.h:222
CSG_Grids::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: grids.cpp:1539
mat_tools.h
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:450
SG_Get_History_Depth
SAGA_API_DLL_EXPORT int SG_Get_History_Depth(void)
Definition: dataobject.cpp:159
CSG_TIN
Definition: tin.h:222
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Object::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: dataobject.cpp:542
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:502
CSG_Data_Object::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Data_Object::is_Modified
virtual bool is_Modified(void) const
Definition: dataobject.h:219
CSG_Data_Object::Set_File_Type
void Set_File_Type(int Type)
Definition: dataobject.h:263
SG_is_NaN
#define SG_is_NaN(x)
Definition: api_core.h:168
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Data_Object::asTable
class CSG_Table * asTable(bool bPolymorph=false) const
Definition: dataobject.cpp:428
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Projection
Definition: geo_tools.h:833
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_Data_Object::is_File_Native
bool is_File_Native(void) const
Definition: dataobject.h:206
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:274
CSG_Data_Object::Get_History
const CSG_MetaData & Get_History(void) const
Definition: dataobject.h:228
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Data_Object::asGrid
class CSG_Grid * asGrid(bool bPolymorph=false) const
Definition: dataobject.cpp:491
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Object::Save
virtual bool Save(const char *File, int Format=0)=0
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Save_History_to_Model
bool Save_History_to_Model(const CSG_String &File) const
Definition: dataobject.cpp:748
CSG_Data_Object::Get_MetaData_DB
CSG_MetaData & Get_MetaData_DB(void) const
Definition: dataobject.h:226
metadata.h
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
SG_Get_DataObject_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Data_Object::asPointCloud
class CSG_PointCloud * asPointCloud(bool bPolymorph=false) const
Definition: dataobject.cpp:480
CSG_Data_Object::Set_Owner
void Set_Owner(CSG_Data_Object *pOwner)
Definition: dataobject.h:223
CSG_Grid
Definition: grid.h:473
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Shapes
Definition: shapes.h:773
CSG_Grids::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double loValue, double hiValue)
Definition: grids.cpp:393
CSG_PointCloud
Definition: pointcloud.h:105
SG_DataObject_Get_Max_Samples
SAGA_API_DLL_EXPORT sLong SG_DataObject_Get_Max_Samples(void)
Definition: dataobject.cpp:139
CSG_Grids
Definition: grids.h:119
SG_Set_History_Ignore_Lists
SAGA_API_DLL_EXPORT void SG_Set_History_Ignore_Lists(int Ignore)
Definition: dataobject.cpp:167
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: datetime.cpp File Reference

  • saga_core
  • saga_api
Functions
datetime.cpp File Reference
#include <time.h>
#include <wx/datetime.h>
#include "datetime.h"
#include "mat_tools.h"

Go to the source code of this file.

Functions

bool | SG_JulianDayNumber_To_Date (double JDN, int &y, int &m, int &d)
CSG_String | SG_JulianDayNumber_To_Date (double JDN)
CSG_String | SG_JulianDayNumber_To_Date (int JDN)
double | SG_Date_To_JulianDayNumber (int y, int m, int d)
double | SG_Date_To_JulianDayNumber (const CSG_String &Date)
int | SG_Get_Day_MidOfMonth (int Month, bool bLeapYear)
bool | SG_Get_Sun_Position (double JulianDayNumber, double &RA, double &Dec)
bool | SG_Get_Sun_Position (const CSG_DateTime &Time, double &RA, double &Dec)
bool | SG_Get_Sun_Position (double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth)
bool | SG_Get_Sun_Position (const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth)
double | SG_Get_Day_Length (int DayOfYear, double Latitude)
double | SG_Get_Day_Length (const CSG_DateTime &Date, double Latitude)

Function Documentation

◆ SG_Date_To_JulianDayNumber() [1/2]

double SG_Date_To_JulianDayNumber ( const CSG_String & Date )

Returns the Julian Day Number.

Definition at line 746 of file datetime.cpp.

References CSG_String::AfterFirst(), CSG_String_Tokenizer::Get_Next_Token(), CSG_String_Tokenizer::Get_Tokens_Count(), CSG_String::Length(), and SG_Date_To_JulianDayNumber().

◆ SG_Date_To_JulianDayNumber() [2/2]

double SG_Date_To_JulianDayNumber | ( | int | y,
 |  | int | m,
 |  | int | d
 | ) |  |

Returns the Julian Day Number calculated from Gregorian date (year, month, day).

Definition at line 729 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_Date_To_JulianDayNumber().

◆ SG_Get_Day_Length() [1/2]

double SG_Get_Day_Length | ( | const CSG_DateTime & | Date,
 |  | double | Latitude
 | ) |  |

Definition at line 927 of file datetime.cpp.

References CSG_DateTime::Get_DayOfYear(), and SG_Get_Day_Length().

◆ SG_Get_Day_Length() [2/2]

double SG_Get_Day_Length | ( | int | DayOfYear,
 |  | double | Latitude
 | ) |  |

Definition at line 913 of file datetime.cpp.

References M_DEG_TO_RAD, and M_PI.

Referenced by SG_Get_Day_Length().

◆ SG_Get_Day_MidOfMonth()

int SG_Get_Day_MidOfMonth | ( | int | Month,
 |  | bool | bLeapYear
 | ) |  |

Returns the day number (starting with zero for the first of January) for the mid of the requested month (January = 0).

Definition at line 784 of file datetime.cpp.

◆ SG_Get_Sun_Position() [1/4]

bool SG_Get_Sun_Position | ( | const CSG_DateTime & | Time,
 |  | double & | RA,
 |  | double & | Dec
 | ) |  |

Definition at line 862 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [2/4]

bool SG_Get_Sun_Position | ( | const CSG_DateTime & | Time,
 |  | double | Longitude,
 |  | double | Latitude,
 |  | double & | Height,
 |  | double & | Azimuth
 | ) |  |

Definition at line 902 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [3/4]

bool SG_Get_Sun_Position | ( | double | JulianDayNumber,
 |  | double & | RA,
 |  | double & | Dec
 | ) |  |

Calculates the Sun's position for given date and time as declination and right ascension angles (radians). Solar coordinates according to Jean Meeus: Astronomical Algorithms, accuracy of 0.01 degree

Definition at line 835 of file datetime.cpp.

References M_DEG_TO_RAD.

Referenced by SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [4/4]

bool SG_Get_Sun_Position | ( | double | JulianDayNumber,
 |  | double | Longitude,
 |  | double | Latitude,
 |  | double & | Height,
 |  | double & | Azimuth
 | ) |  |

Calculates the Sun's position for given date and time and position on Earth as given by longitude and latitude (radians). Height and Azimuth are calculated as radians. Returns true if Sun is above horizon.

Definition at line 875 of file datetime.cpp.

References M_DEG_TO_RAD, and SG_Get_Sun_Position().

◆ SG_JulianDayNumber_To_Date() [1/3]

CSG_String SG_JulianDayNumber_To_Date ( double JDN )

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 698 of file datetime.cpp.

References CSG_String::Printf(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [2/3]

bool SG_JulianDayNumber_To_Date | ( | double | JDN,
 |  | int & | y,
 |  | int & | m,
 |  | int & | d
 | ) |  |

Expects 'Value' to be the Julian Day Number.

Definition at line 678 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [3/3]

CSG_String SG_JulianDayNumber_To_Date ( int JDN )

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 719 of file datetime.cpp.

References SG_JulianDayNumber_To_Date().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: datetime.cpp Source File

  • saga_core
  • saga_api
datetime.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // datetime.cpp //
15 // //
16 // Copyright (C) 2015 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include <time.h>
52
53 #include <wx/datetime.h>
54
55 #include "datetime.h"
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 CSG_String CSG_TimeSpan::Format(const CSG_String &Format) const
66 {
67 wxTimeSpan ts((wxLongLong(m_span)));
68
69 wxString s = !Format.is_Empty() ? ts.Format(Format.c_str()) : ts.Format(wxDefaultTimeSpanFormat);
70
71 return( CSG_String(&s) );
72 }
73
74
76 // //
77 // //
78 // //
80
81 //---------------------------------------------------------
82 CSG_DateTime::CSG_DateTime(void)
83 {
84 m_pDateTime = new wxDateTime(wxDateTime::Now());
85 }
86
87 //---------------------------------------------------------
88 CSG_DateTime::CSG_DateTime(const CSG_DateTime &DateTime)
89 {
90 m_pDateTime = new wxDateTime(*DateTime.m_pDateTime);
91 }
92
93 //---------------------------------------------------------
94 CSG_DateTime::CSG_DateTime(double JDN)
95 {
96 m_pDateTime = new wxDateTime(JDN);
97 }
98
99 //---------------------------------------------------------
100 CSG_DateTime::CSG_DateTime(const CSG_String &ISODate)
101 {
102 m_pDateTime = new wxDateTime(wxDateTime::Now());
103
104 Set(ISODate);
105 }
106
107 //---------------------------------------------------------
108 CSG_DateTime::CSG_DateTime(TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
109 {
110 m_pDateTime = new wxDateTime(Hour, Minute, Second, Millisec);
111 }
112
113 //---------------------------------------------------------
114 CSG_DateTime::CSG_DateTime(TSG_DateTime Day, Month Month, int Year, TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
115 {
116 m_pDateTime = new wxDateTime(Day, (wxDateTime::Month)Month, Year, Hour, Minute, Second, Millisec);
117 }
118
119 //---------------------------------------------------------
120 CSG_DateTime::~CSG_DateTime(void)
121 {
122 delete(m_pDateTime);
123 }
124
125
127 // //
129
130 //---------------------------------------------------------
131 CSG_DateTime & CSG_DateTime::Set(const CSG_DateTime &DateTime)
132 {
133 m_pDateTime->Set(DateTime.m_pDateTime->GetTm());
134
135 return( *this );
136 }
137
138 //---------------------------------------------------------
139 CSG_DateTime & CSG_DateTime::Set(double JDN)
140 {
141 m_pDateTime->Set(JDN);
142
143 return( *this );
144 }
145
146 //---------------------------------------------------------
147 CSG_DateTime & CSG_DateTime::Set(const CSG_String &ISODate)
148 {
149 // 0123456789
150 // YYYY-MM-DD
151
152 if( ISODate.Length() >= 10 && ISODate[4] == '-' && ISODate[7] == '-' )
153 {
154 int y = ISODate.Left ( 4).asInt();
155 int m = ISODate.Mid (5, 2).asInt();
156 int d = ISODate.Right( 2).asInt();
157
158 Set((TSG_DateTime)d, (Month)(m - 1), y);
159 }
160
161 return( *this );
162 }
163
164 //---------------------------------------------------------
165 CSG_DateTime & CSG_DateTime::Set(TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
166 {
167 m_pDateTime->Set(Hour, Minute, Second, Millisec);
168
169 return( *this );
170 }
171
172 //---------------------------------------------------------
173 CSG_DateTime & CSG_DateTime::Set(TSG_DateTime Day, Month Month, int Year, TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
174 {
175 m_pDateTime->Set(Day, (wxDateTime::Month)Month, Year, Hour, Minute, Second, Millisec);
176
177 return( *this );
178 }
179
180 //---------------------------------------------------------
181 CSG_DateTime & CSG_DateTime::Set_Millisecond(unsigned short Value)
182 {
183 m_pDateTime->SetMillisecond(Value);
184
185 return( *this );
186 }
187
188 //---------------------------------------------------------
189 CSG_DateTime & CSG_DateTime::Set_Second(unsigned short Value)
190 {
191 m_pDateTime->SetSecond(Value);
192
193 return( *this );
194 }
195
196 //---------------------------------------------------------
197 CSG_DateTime & CSG_DateTime::Set_Minute(unsigned short Value)
198 {
199 m_pDateTime->SetMinute(Value);
200
201 return( *this );
202 }
203
204 //---------------------------------------------------------
205 CSG_DateTime & CSG_DateTime::Set_Hour(unsigned short Value)
206 {
207 m_pDateTime->SetHour(Value);
208
209 return( *this );
210 }
211
212 CSG_DateTime & CSG_DateTime::Set_Hour(double Value)
213 {
214 m_pDateTime->ResetTime();
215
216 Value = fmod(Value, 24.0); if( Value < 0.0 ) Value += 24.0;
217
218 m_pDateTime->SetHour ((wxDateTime::wxDateTime_t)Value); Value = (Value - (wxDateTime::wxDateTime_t)Value) * 60.0;
219 m_pDateTime->SetMinute ((wxDateTime::wxDateTime_t)Value); Value = (Value - (wxDateTime::wxDateTime_t)Value) * 60.0;
220 m_pDateTime->SetSecond ((wxDateTime::wxDateTime_t)Value); Value = (Value - (wxDateTime::wxDateTime_t)Value) * 1000.0;
221 m_pDateTime->SetMillisecond((wxDateTime::wxDateTime_t)Value);
222
223 return( *this );
224 }
225
226 //---------------------------------------------------------
227 CSG_DateTime & CSG_DateTime::Set_Day(unsigned short Value)
228 {
229 m_pDateTime->SetDay(Value);
230
231 return( *this );
232 }
233
234 //---------------------------------------------------------
235 CSG_DateTime & CSG_DateTime::Set_Month(unsigned short Value)
236 {
237 m_pDateTime->SetMonth((wxDateTime::Month)Value);
238
239 return( *this );
240 }
241
242 //---------------------------------------------------------
243 CSG_DateTime & CSG_DateTime::Set_Year(int Value)
244 {
245 m_pDateTime->SetYear(Value);
246
247 return( *this );
248 }
249
250 //---------------------------------------------------------
251 CSG_DateTime & CSG_DateTime::Set_DayOfYear(unsigned short Value)
252 {
253 m_pDateTime->SetToYearDay(Value);
254
255 return( *this );
256 }
257
258 //---------------------------------------------------------
259 CSG_DateTime & CSG_DateTime::Set_To_Current(void)
260 {
261 m_pDateTime->SetToCurrent();
262
263 return( *this );
264 }
265
266 //---------------------------------------------------------
267 CSG_DateTime & CSG_DateTime::Reset_Time(void)
268 {
269 m_pDateTime->ResetTime();
270
271 return( *this );
272 }
273
274
276 // //
278
279 //---------------------------------------------------------
280 CSG_DateTime CSG_DateTime::From_UTC(bool noDST) const
281 {
282 return( CSG_DateTime(m_pDateTime->FromUTC(noDST).GetJDN()) );
283
284 // CSG_DateTime dt; dt.m_pDateTime->Set(m_pDateTime->FromUTC(noDST).GetTm()); return( dt );
285 }
286
287 //---------------------------------------------------------
288 CSG_DateTime CSG_DateTime::To_UTC(bool noDST) const
289 {
290 return( CSG_DateTime(m_pDateTime->ToUTC(noDST).GetJDN()) );
291 }
292
293 //---------------------------------------------------------
294 CSG_DateTime & CSG_DateTime::Make_UTC(bool noDST)
295 {
296 m_pDateTime->MakeUTC(noDST);
297
298 return( *this );
299 }
300
301 //---------------------------------------------------------
302 bool CSG_DateTime::is_DST(void) const
303 {
304 return( m_pDateTime->IsDST() != 0 );
305 }
306
307
309 // //
311
312 //---------------------------------------------------------
313 sLong CSG_DateTime::Get_Value(void) const
314 {
315 return( m_pDateTime->GetValue().GetValue() );
316 }
317
318
320 // //
322
323 //---------------------------------------------------------
324 CSG_DateTime CSG_DateTime::Add(const CSG_TimeSpan &TimeSpan) const
325 {
326 CSG_DateTime dt(*this);
327
328 return( dt.Add(TimeSpan) );
329 }
330
331 CSG_DateTime & CSG_DateTime::Add(const CSG_TimeSpan &TimeSpan)
332 {
333 m_pDateTime->Add(wxTimeSpan((wxLongLong)TimeSpan.m_span));
334
335 return( *this);
336 }
337
338 //---------------------------------------------------------
339 CSG_DateTime CSG_DateTime::Subtract(const CSG_TimeSpan &TimeSpan) const
340 {
341 CSG_DateTime dt(*this);
342
343 return( dt.Subtract(TimeSpan) );
344 }
345
346 CSG_DateTime & CSG_DateTime::Subtract(const CSG_TimeSpan &TimeSpan)
347 {
348 m_pDateTime->Subtract(wxTimeSpan((wxLongLong)TimeSpan.m_span));
349
350 return( *this);
351 }
352
353 //---------------------------------------------------------
354 CSG_TimeSpan CSG_DateTime::Subtract(const CSG_DateTime &DateTime) const
355 {
356 CSG_TimeSpan Span((sLong)m_pDateTime->Subtract(*DateTime.m_pDateTime).GetValue().GetValue());
357
358 return( Span );
359 }
360
361
363 // //
365
366 //---------------------------------------------------------
367 bool CSG_DateTime::is_Valid(void) const
368 {
369 return( m_pDateTime->IsValid() );
370 }
371
372 //---------------------------------------------------------
373 unsigned short CSG_DateTime::Get_Millisecond(void) const { return( m_pDateTime->GetMillisecond() ); }
374 unsigned short CSG_DateTime::Get_Second (void) const { return( m_pDateTime->GetSecond () ); }
375 unsigned short CSG_DateTime::Get_Minute (void) const { return( m_pDateTime->GetMinute () ); }
376 unsigned short CSG_DateTime::Get_Hour (void) const { return( m_pDateTime->GetHour () ); }
377 unsigned short CSG_DateTime::Get_Day (void) const { return( m_pDateTime->GetDay () ); }
378
379 CSG_DateTime::Month CSG_DateTime::Get_Month(void) const
380 {
381 return( (Month)m_pDateTime->GetMonth() );
382 }
383
384 int CSG_DateTime::Get_Year(void) const
385 {
386 return( m_pDateTime->GetYear() );
387 }
388
389 //---------------------------------------------------------
390 unsigned short CSG_DateTime::Get_DayOfYear(void) const
391 {
392 return( m_pDateTime->GetDayOfYear() );
393 }
394
395 CSG_DateTime::WeekDay CSG_DateTime::Get_WeekDay(void) const
396 {
397 return( (WeekDay)m_pDateTime->GetWeekDay() );
398 }
399
400 CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfMonth(void) const
401 {
402 return( (TSG_DateTime)m_pDateTime->GetWeekOfMonth() );
403 }
404
405 CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfYear(void) const
406 {
407 return( (TSG_DateTime)m_pDateTime->GetWeekOfYear() );
408 }
409
410 //---------------------------------------------------------
411 double CSG_DateTime::Get_JDN(void) const
412 {
413 return( m_pDateTime->GetJDN() );
414 }
415
416 double CSG_DateTime::Get_MJD(void) const
417 {
418 return( m_pDateTime->GetMJD() );
419 }
420
421
423 // //
425
426 //---------------------------------------------------------
427 bool CSG_DateTime::is_EarlierThan (const CSG_DateTime &DateTime) const { return( m_pDateTime->IsEarlierThan(*DateTime.m_pDateTime) ); }
428 bool CSG_DateTime::is_EqualTo (const CSG_DateTime &DateTime) const { return( m_pDateTime->IsEqualTo (*DateTime.m_pDateTime) ); }
429 bool CSG_DateTime::is_LaterThan (const CSG_DateTime &DateTime) const { return( m_pDateTime->IsLaterThan (*DateTime.m_pDateTime) ); }
430
431 //---------------------------------------------------------
432 bool CSG_DateTime::is_SameDate (const CSG_DateTime &DateTime) const { return( m_pDateTime->IsSameDate (*DateTime.m_pDateTime) ); }
433 bool CSG_DateTime::is_SameTime (const CSG_DateTime &DateTime) const { return( m_pDateTime->IsSameTime (*DateTime.m_pDateTime) ); }
434
435 //---------------------------------------------------------
436 bool CSG_DateTime::is_Between (const CSG_DateTime &t1, const CSG_DateTime &t2) const { return( m_pDateTime->IsBetween (*t1.m_pDateTime, *t2.m_pDateTime) ); }
437 bool CSG_DateTime::is_StrictlyBetween(const CSG_DateTime &t1, const CSG_DateTime &t2) const { return( m_pDateTime->IsStrictlyBetween(*t1.m_pDateTime, *t2.m_pDateTime) ); }
438
439
441 // //
443
444 //---------------------------------------------------------
445 CSG_String CSG_DateTime::Format(const CSG_String &Format) const
446 {
447 wxString s(m_pDateTime->Format(Format.c_str())); CSG_String _s(&s); return( _s );
448 }
449
450 CSG_String CSG_DateTime::Format_Date(void) const
451 {
452 wxString s(m_pDateTime->FormatDate()); CSG_String _s(&s); return( _s );
453 }
454
455 CSG_String CSG_DateTime::Format_Time(void) const
456 {
457 wxString s(m_pDateTime->FormatTime()); CSG_String _s(&s); return( _s );
458 }
459
460 CSG_String CSG_DateTime::Format_ISODate(void) const
461 {
462 wxString s(m_pDateTime->FormatISODate()); CSG_String _s(&s); return( _s );
463 }
464
465 CSG_String CSG_DateTime::Format_ISOTime(void) const
466 {
467 wxString s(m_pDateTime->FormatISOTime()); CSG_String _s(&s); return( _s );
468 }
469
470 CSG_String CSG_DateTime::Format_ISOCombined(char sep) const
471 {
472 wxString s(m_pDateTime->FormatISOCombined(sep)); CSG_String _s(&s); return( _s );
473 }
474
475 //---------------------------------------------------------
476 bool CSG_DateTime::Parse_Date(const CSG_String &date)
477 {
478 wxString::const_iterator end; return( m_pDateTime->ParseDate(date.c_str(), &end) );
479 }
480
481 bool CSG_DateTime::Parse_DateTime(const CSG_String &datetime)
482 {
483 wxString::const_iterator end; return( m_pDateTime->ParseDateTime(datetime.c_str(), &end) );
484 }
485
486 bool CSG_DateTime::Parse_Format(const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef)
487 {
488 wxString::const_iterator end; return( m_pDateTime->ParseFormat(date.c_str(), format.c_str(), *dateDef.m_pDateTime, &end) );
489 }
490
491 bool CSG_DateTime::Parse_Format(const CSG_String &date, const CSG_String &format)
492 {
493 wxString::const_iterator end; return( m_pDateTime->ParseFormat(date.c_str(), format.c_str(), &end) );
494 }
495
496 bool CSG_DateTime::Parse_Format(const CSG_String &date)
497 {
498 wxString::const_iterator end; return( m_pDateTime->ParseFormat(date.c_str(), &end) );
499 }
500
501 //---------------------------------------------------------
502 bool CSG_DateTime::Parse_ISOCombined(const CSG_String &date, char sep)
503 {
504 return( m_pDateTime->ParseISOCombined(date.c_str(), sep) );
505 }
506
507 bool CSG_DateTime::Parse_ISODate(const CSG_String &date)
508 {
509 return( m_pDateTime->ParseISODate(date.c_str()) );
510 }
511
512 bool CSG_DateTime::Parse_ISOTime(const CSG_String &date)
513 {
514 return( m_pDateTime->ParseISOTime(date.c_str()) );
515 }
516
517
519 // //
521
522 //---------------------------------------------------------
523 CSG_DateTime::TSG_DateTime CSG_DateTime::Get_Current_Day(void)
524 {
525 CSG_DateTime Now;
526
527 Now.Set_To_Current();
528
529 return( Now.Get_Day() );
530 }
531
532 CSG_DateTime::Month CSG_DateTime::Get_Current_Month(void)
533 {
534 return( (Month)wxDateTime::GetCurrentMonth() );
535 }
536
537 int CSG_DateTime::Get_Current_Year(void)
538 {
539 return( wxDateTime::GetCurrentYear() );
540 }
541
542 //---------------------------------------------------------
543 CSG_String CSG_DateTime::Get_MonthName(Month month, NameFlags flags)
544 {
545 wxString s(wxDateTime::GetMonthName ((wxDateTime::Month)month , (wxDateTime::NameFlags)flags)); CSG_String _s(&s); return( _s );
546 }
547
548 CSG_String CSG_DateTime::Get_EnglishMonthName(Month month, NameFlags flags)
549 {
550 wxString s(wxDateTime::GetEnglishMonthName ((wxDateTime::Month)month , (wxDateTime::NameFlags)flags)); CSG_String _s(&s); return( _s );
551 }
552
553 CSG_String CSG_DateTime::Get_WeekDayName(WeekDay weekday, NameFlags flags)
554 {
555 wxString s(wxDateTime::GetWeekDayName ((wxDateTime::WeekDay)weekday, (wxDateTime::NameFlags)flags)); CSG_String _s(&s); return( _s );
556 }
557
558 CSG_String CSG_DateTime::Get_EnglishWeekDayName(WeekDay weekday, NameFlags flags)
559 {
560 wxString s(wxDateTime::GetEnglishWeekDayName((wxDateTime::WeekDay)weekday, (wxDateTime::NameFlags)flags)); CSG_String _s(&s); return( _s );
561 }
562
563 //---------------------------------------------------------
564 CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays(int year)
565 {
566 return( (TSG_DateTime)wxDateTime::GetNumberOfDays(year) );
567 }
568
569 CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays(Month month, int year)
570 {
571 return( (TSG_DateTime)wxDateTime::GetNumberOfDays((wxDateTime::Month)month, year) );
572 }
573
574 //---------------------------------------------------------
575 bool CSG_DateTime::is_LeapYear(int year)
576 {
577 return( wxDateTime::IsLeapYear(year) );
578 }
579
580 //---------------------------------------------------------
581 CSG_DateTime CSG_DateTime::Now(void)
582 {
583 CSG_DateTime DateTime; *DateTime.m_pDateTime = wxDateTime::Now();
584
585 return( DateTime );
586 }
587
588
590 // //
592
593 //---------------------------------------------------------
594 CSG_DateTime & CSG_DateTime::Set_Unix_Time(sLong Seconds)
595 {
596 time_t tUnix = Seconds;
597 struct tm t;
598
599 #ifdef _SAGA_LINUX
600 t = *gmtime(&tUnix);
601 #else
602 gmtime_s(&t, &tUnix);
603 #endif
604
605 Set(t.tm_mday, (CSG_DateTime::Month)(t.tm_mon), t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec);
606
607 return( *this );
608 }
609
610 //---------------------------------------------------------
611 CSG_DateTime & CSG_DateTime::Set_Hours_AD(int Hours)
612 {
613 long d, n;
614 double h;
615
616 h = 1721424.0 + (Hours - 12.0) / 24.0;
617 d = (long)h; // Truncate to integral day
618 h = h - d + 0.5; // Fractional part of calendar day
619 if( h >= 1.0 ) // Is it really the next calendar day?
620 {
621 h--;
622 d++;
623 }
624
625 int day, mon, year, hour, min, sec;
626
627 h = 24.0 * (h);
628 hour = (int)h;
629 h = 60.0 * (h - hour);
630 min = (int)h;
631 h = 60.0 * (h - min);
632 sec = (int)h;
633
634 d = d + 68569;
635 n = 4 * d / 146097;
636 d = d - (146097 * n + 3) / 4;
637 year = 4000 * (d + 1) / 1461001;
638 d = d - 1461 * year / 4 + 31; // 1461 = 365.25 * 4
639 mon = 80 * d / 2447;
640 day = d - 2447 * mon / 80;
641 d = mon / 11;
642 mon = mon + 2 - 12 * d;
643 year = 100 * (n - 49) + year + d;
644
645 Set(day, (CSG_DateTime::Month)(mon - 1), year, hour, min, sec);
646
647 return( *this );
648 }
649
650
652 // //
654
655 //---------------------------------------------------------
656 CSG_String CSG_DateTime::Get_Month_Choices(void)
657 {
658 CSG_String Choices;
659
660 Choices.Printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|",
661 _TL("January"), _TL("February"), _TL("March" ), _TL("April" ), _TL("May" ), _TL("June" ),
662 _TL("July" ), _TL("August" ), _TL("September"), _TL("October"), _TL("November"), _TL("December")
663 );
664
665 return( Choices );
666 }
667
668
670 // //
672
673 //---------------------------------------------------------
677 //---------------------------------------------------------
678 bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
679 {
680 int J = (int)floor(JDN);
681 int f = J + 1401 + (((4 * J + 274277) / 146097) * 3) / 4 - 38;
682 int e = 4 * f + 3;
683 int g = (e % 1461) / 4;
684 int h = 5 * g + 2;
685
686 d = (h % 153) / 5 + 1;
687 m = (h / 153 + 2) % 12 + 1;
688 y = (e / 1461) - 4716 + (12 + 2 - m) / 12;
689
690 return( true );
691 }
692
693 //---------------------------------------------------------
697 //---------------------------------------------------------
698 CSG_String SG_JulianDayNumber_To_Date(double JDN)
699 {
700 JDN = 0.5 + floor(JDN);
701
702 CSG_String Date;
703
704 int y, m, d;
705
706 if( SG_JulianDayNumber_To_Date(JDN, y, m, d) )
707 {
708 Date.Printf("%04d-%02d-%02d", y, m, d); // yyyy-mm-dd (ISO 8601)
709 }
710
711 return( Date );
712 }
713
714 //---------------------------------------------------------
718 //---------------------------------------------------------
719 CSG_String SG_JulianDayNumber_To_Date(int JDN)
720 {
721 return( SG_JulianDayNumber_To_Date(JDN + 0.5) );
722 }
723
724 //---------------------------------------------------------
728 //---------------------------------------------------------
729 double SG_Date_To_JulianDayNumber(int y, int m, int d)
730 {
731 int a = m <= 2 ? 1 : 0;
732
733 y += 4800 - a;
734 m += 12 * a - 3;
735
736 double JDN = d + floor((153. * m + 2.) / 5.) + 365. * y + floor(y / 4.) - floor(y / 100.) + floor(y / 400.) - 32045.;
737
738 return( JDN );
739 }
740
741 //---------------------------------------------------------
745 //---------------------------------------------------------
746 double SG_Date_To_JulianDayNumber(const CSG_String &Date)
747 {
748 if( Date.Length() < 10 )
749 {
750 return( 0.0 );
751 }
752
753 int bBC = Date[0] == '-' ? -1 : 1;
754
755 CSG_String_Tokenizer t(bBC < 0 ? Date.AfterFirst('-') : Date, "-./");
756
757 if( t.Get_Tokens_Count() < 3 )
758 {
759 return( 0.0 );
760 }
761
762 CSG_Strings s; for(int i=0; i<3; i++) s += t.Get_Next_Token();
763
764 bool bISO = s[0].Length() == 4; // yyyy-mm-dd (ISO 8601)
765
766 int y = s[bISO ? 0 : 2].asInt() * bBC;
767 int m = s[ 1 ].asInt(); if( m < 1 ) m = 1; else if( m > 12 ) m = 12;
768 int d = s[bISO ? 2 : 0].asInt(); if( d < 1 ) d = 1; else if( d > 31 ) d = 31;
769
770 return( SG_Date_To_JulianDayNumber(y, m, d) );
771 }
772
773
775 // //
777
778 //---------------------------------------------------------
783 //---------------------------------------------------------
784 int SG_Get_Day_MidOfMonth(int Month, bool bLeapYear)
785 {
786 static const int MidOfMonth[12] =
787 // JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
788 // 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
789 // 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
790 { 15, 45, 74, 105, 135, 166, 196, 227, 258, 288, 319, 349 };
791
792 int Day;
793
794 if( Month < 0 )
795 {
796 Month = (Month % 12) + 12;
797 Day = MidOfMonth[Month] - 365;
798 }
799 else if( Month >= 12 )
800 {
801 Month = (Month % 12);
802 Day = MidOfMonth[Month] + 365;
803 }
804 else
805 {
806 Day = MidOfMonth[Month];
807 }
808
809 if( bLeapYear && Month > 1 )
810 {
811 Day++;
812 }
813
814 return( Day );
815 }
816
817
819 // //
820 // //
821 // //
823
824 //---------------------------------------------------------
825 #include "mat_tools.h"
826
827 //---------------------------------------------------------
834 //---------------------------------------------------------
835 bool SG_Get_Sun_Position(double JulianDayNumber, double &RA, double &Dec)
836 {
837 //-----------------------------------------------------
838 double T = (JulianDayNumber - 2451545.0 ) / 36525.0; // Number of Julian centuries since 2000/01/01 at 12 UT (JDN = 2451545.0)
839
840 double M = M_DEG_TO_RAD * (357.52910 + 35999.05030 * T - 0.0001559 * T*T - 0.00000048 * T*T*T); // mean anomaly
841 double L = M_DEG_TO_RAD * ((280.46645 + 36000.76983 * T + 0.0003032 * T*T) // mean longitude
842 + ((1.914600 - 0.004817 * T - 0.000014 * T*T) * sin(M)
843 + (0.019993 - 0.000101 * T) * sin(2.0 * M) + 0.000290 * sin(3.0 * M))); // true longitude
844
845 //-----------------------------------------------------
846 // convert ecliptic longitude to right ascension RA and declination delta
847
848 static const double Ecliptic_Obliquity = M_DEG_TO_RAD * 23.43929111;
849
850 double X = cos(L);
851 double Y = cos(Ecliptic_Obliquity) * sin(L);
852 double Z = sin(Ecliptic_Obliquity) * sin(L);
853 double R = sqrt(1.0 - Z*Z);
854
855 Dec = atan2(Z, R);
856 RA = 2.0 * atan2(Y, (X + R));
857
858 return( true );
859 }
860
861 //---------------------------------------------------------
862 bool SG_Get_Sun_Position(const CSG_DateTime &Time, double &RA, double &Dec)
863 {
864 return( SG_Get_Sun_Position(Time.Get_JDN(), RA, Dec) );
865 }
866
867 //---------------------------------------------------------
874 //---------------------------------------------------------
875 bool SG_Get_Sun_Position(double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth)
876 {
877 //-----------------------------------------------------
878 // 1. Get right ascension RA and declination delta
879
880 double RA, Delta; SG_Get_Sun_Position(JulianDayNumber, RA, Delta);
881
882 //-----------------------------------------------------
883 // 2. compute sidereal time (radians) at Greenwich local sidereal time at longitude (radians)
884
885 double T = (JulianDayNumber - 2451545.0 ) / 36525.0;
886
887 double Theta = Longitude + M_DEG_TO_RAD * (280.46061837 + 360.98564736629 * (JulianDayNumber - 2451545.0) + T*T * (0.000387933 - T / 38710000.0));
888
889 double Tau = Theta - RA; // compute local hour angle (radians)
890
891 //-----------------------------------------------------
892 // 3. convert (tau, delta) to horizon coordinates (h, az) of the observer
893
894 Height = asin ( sin(Latitude) * sin(Delta) + cos(Latitude) * cos(Delta) * cos(Tau));
895 Azimuth = atan2(-sin(Tau) * cos(Delta), cos(Latitude) * sin(Delta) - sin(Latitude) * cos(Delta) * cos(Tau));
896 // Azimuth = atan2(-sin(Tau), cos(Latitude) * tan(Delta) - sin(Latitude) * cos(Tau)); // previous formula gives same result but is better because of division by zero effects...
897
898 return( Height > 0.0 );
899 }
900
901 //---------------------------------------------------------
902 bool SG_Get_Sun_Position(const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth)
903 {
904 return( SG_Get_Sun_Position(Time.Get_JDN(), Longitude, Latitude, Height, Azimuth) );
905 }
906
907
909 // //
911
912 //---------------------------------------------------------
913 double SG_Get_Day_Length(int DayOfYear, double Latitude)
914 {
915 double tanLat = tan(Latitude * M_DEG_TO_RAD);
916
917 double JD = DayOfYear * M_PI * 2. / 365.;
918
919 double SunDec = 0.4093 * sin(JD - 1.405); // solar declination
920
921 double d = -tanLat * tan(SunDec); // sunset hour angle
922
923 return( acos(d < -1 ? -1 : d < 1 ? d : 1) * 24. / M_PI );
924 }
925
926 //---------------------------------------------------------
927 double SG_Get_Day_Length(const CSG_DateTime &Date, double Latitude)
928 {
929 return( SG_Get_Day_Length(Date.Get_DayOfYear(), Latitude) );
930 }
931
932
934 // //
935 // //
936 // //
938
939 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:111
CSG_DateTime::Parse_Date
bool Parse_Date(const CSG_String &date)
Definition: datetime.cpp:476
CSG_DateTime::Set_Hour
CSG_DateTime & Set_Hour(unsigned short Value)
Definition: datetime.cpp:205
CSG_DateTime::Parse_ISOTime
bool Parse_ISOTime(const CSG_String &date)
Definition: datetime.cpp:512
CSG_String_Tokenizer::Get_Tokens_Count
size_t Get_Tokens_Count(void) const
Definition: api_string.cpp:1430
CSG_DateTime::Set_Millisecond
CSG_DateTime & Set_Millisecond(unsigned short Value)
Definition: datetime.cpp:181
CSG_DateTime::Get_WeekOfMonth
TSG_DateTime Get_WeekOfMonth(void) const
Definition: datetime.cpp:400
CSG_DateTime::Set_Second
CSG_DateTime & Set_Second(unsigned short Value)
Definition: datetime.cpp:189
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_DateTime::Get_Millisecond
unsigned short Get_Millisecond(void) const
Definition: datetime.cpp:373
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_DateTime::From_UTC
CSG_DateTime From_UTC(bool noDST=false) const
Definition: datetime.cpp:280
CSG_DateTime::Get_EnglishWeekDayName
static CSG_String Get_EnglishWeekDayName(WeekDay weekday, NameFlags flags=Name_Full)
Definition: datetime.cpp:558
CSG_DateTime::Set_Month
CSG_DateTime & Set_Month(unsigned short Value)
Definition: datetime.cpp:235
SG_Get_Day_MidOfMonth
int SG_Get_Day_MidOfMonth(int Month, bool bLeapYear)
Definition: datetime.cpp:784
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_DateTime::Get_Current_Month
static Month Get_Current_Month(void)
Definition: datetime.cpp:532
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:699
CSG_DateTime::is_DST
bool is_DST(void) const
Definition: datetime.cpp:302
CSG_DateTime::Parse_ISODate
bool Parse_ISODate(const CSG_String &date)
Definition: datetime.cpp:507
CSG_DateTime::is_SameTime
bool is_SameTime(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:433
CSG_DateTime::Get_Current_Day
static TSG_DateTime Get_Current_Day(void)
Definition: datetime.cpp:523
CSG_DateTime::Make_UTC
CSG_DateTime & Make_UTC(bool noDST=false)
Definition: datetime.cpp:294
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_DateTime::NameFlags
NameFlags
Definition: datetime.h:211
CSG_DateTime::is_EarlierThan
bool is_EarlierThan(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:427
CSG_DateTime::Set_Day
CSG_DateTime & Set_Day(unsigned short Value)
Definition: datetime.cpp:227
CSG_DateTime::is_LeapYear
static bool is_LeapYear(int year=Inv_Year)
Definition: datetime.cpp:575
CSG_DateTime::Format_Time
CSG_String Format_Time(void) const
Definition: datetime.cpp:455
CSG_DateTime::Get_Month_Choices
static CSG_String Get_Month_Choices(void)
Definition: datetime.cpp:656
CSG_DateTime::is_Between
bool is_Between(const CSG_DateTime &t1, const CSG_DateTime &t2) const
Definition: datetime.cpp:436
CSG_DateTime::is_EqualTo
bool is_EqualTo(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:428
CSG_TimeSpan
Definition: datetime.h:91
CSG_DateTime::Get_Minute
unsigned short Get_Minute(void) const
Definition: datetime.cpp:375
CSG_DateTime::Set_Minute
CSG_DateTime & Set_Minute(unsigned short Value)
Definition: datetime.cpp:197
CSG_DateTime::Format_ISOTime
CSG_String Format_ISOTime(void) const
Definition: datetime.cpp:465
CSG_DateTime::Get_Year
int Get_Year(void) const
Definition: datetime.cpp:384
CSG_DateTime::To_UTC
CSG_DateTime To_UTC(bool noDST=false) const
Definition: datetime.cpp:288
CSG_DateTime::Set_Year
CSG_DateTime & Set_Year(int Value)
Definition: datetime.cpp:243
CSG_DateTime::Get_Second
unsigned short Get_Second(void) const
Definition: datetime.cpp:374
CSG_DateTime::Get_MJD
double Get_MJD(void) const
Definition: datetime.cpp:416
CSG_DateTime::is_Valid
bool is_Valid(void) const
Definition: datetime.cpp:367
mat_tools.h
CSG_DateTime::Format_ISODate
CSG_String Format_ISODate(void) const
Definition: datetime.cpp:460
CSG_DateTime::Get_Month
Month Get_Month(void) const
Definition: datetime.cpp:379
CSG_DateTime::Get_Current_Year
static int Get_Current_Year(void)
Definition: datetime.cpp:537
CSG_DateTime::Parse_Format
bool Parse_Format(const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef)
Definition: datetime.cpp:486
CSG_DateTime::Set_Unix_Time
CSG_DateTime & Set_Unix_Time(sLong Seconds)
Definition: datetime.cpp:594
CSG_DateTime::Parse_DateTime
bool Parse_DateTime(const CSG_String &datetime)
Definition: datetime.cpp:481
CSG_TimeSpan::Format
CSG_String Format(const CSG_String &format="") const
Definition: datetime.cpp:65
CSG_DateTime::Set_Hours_AD
CSG_DateTime & Set_Hours_AD(int Hours)
Definition: datetime.cpp:611
CSG_DateTime::Get_DayOfYear
unsigned short Get_DayOfYear(void) const
Definition: datetime.cpp:390
CSG_DateTime::Format
CSG_String Format(const CSG_String &Format="") const
Definition: datetime.cpp:445
CSG_DateTime::Set_To_Current
CSG_DateTime & Set_To_Current(void)
Definition: datetime.cpp:259
sLong
signed long long sLong
Definition: api_core.h:158
CSG_DateTime::is_SameDate
bool is_SameDate(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:432
CSG_DateTime::TSG_DateTime
unsigned short TSG_DateTime
Definition: datetime.h:189
SG_Get_Day_Length
double SG_Get_Day_Length(int DayOfYear, double Latitude)
Definition: datetime.cpp:913
CSG_DateTime::Get_WeekDay
WeekDay Get_WeekDay(void) const
Definition: datetime.cpp:395
CSG_DateTime::is_StrictlyBetween
bool is_StrictlyBetween(const CSG_DateTime &t1, const CSG_DateTime &t2) const
Definition: datetime.cpp:437
CSG_DateTime::Get_JDN
double Get_JDN(void) const
Definition: datetime.cpp:411
CSG_DateTime::is_LaterThan
bool is_LaterThan(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:429
SG_Get_Sun_Position
bool SG_Get_Sun_Position(double JulianDayNumber, double &RA, double &Dec)
Definition: datetime.cpp:835
CSG_Strings
Definition: api_core.h:693
CSG_DateTime
Definition: datetime.h:183
CSG_DateTime::~CSG_DateTime
virtual ~CSG_DateTime(void)
Definition: datetime.cpp:120
CSG_DateTime::Get_Hour
unsigned short Get_Hour(void) const
Definition: datetime.cpp:376
CSG_DateTime::Subtract
CSG_DateTime Subtract(const CSG_TimeSpan &TimeSpan) const
Definition: datetime.cpp:339
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:705
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
M_PI
#define M_PI
Definition: mat_tools.h:98
CSG_String
Definition: api_core.h:557
CSG_DateTime::Set_DayOfYear
CSG_DateTime & Set_DayOfYear(unsigned short Value)
Definition: datetime.cpp:251
CSG_DateTime::Year
Year
Definition: datetime.h:206
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_Date_To_JulianDayNumber
double SG_Date_To_JulianDayNumber(int y, int m, int d)
Definition: datetime.cpp:729
CSG_DateTime::Set
CSG_DateTime & Set(const CSG_DateTime &DateTime)
Definition: datetime.cpp:131
SG_JulianDayNumber_To_Date
bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
Definition: datetime.cpp:678
CSG_DateTime::Get_Day
unsigned short Get_Day(void) const
Definition: datetime.cpp:377
CSG_DateTime::Parse_ISOCombined
bool Parse_ISOCombined(const CSG_String &date, char sep='T')
Definition: datetime.cpp:502
CSG_DateTime::Get_WeekDayName
static CSG_String Get_WeekDayName(WeekDay weekday, NameFlags flags=Name_Full)
Definition: datetime.cpp:553
CSG_DateTime::Get_NumberOfDays
static TSG_DateTime Get_NumberOfDays(int year)
Definition: datetime.cpp:564
CSG_DateTime::Get_Value
sLong Get_Value(void) const
Definition: datetime.cpp:313
CSG_DateTime::Reset_Time
CSG_DateTime & Reset_Time(void)
Definition: datetime.cpp:267
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_DateTime::Get_EnglishMonthName
static CSG_String Get_EnglishMonthName(Month month, NameFlags flags=Name_Full)
Definition: datetime.cpp:548
CSG_DateTime::Format_ISOCombined
CSG_String Format_ISOCombined(char sep='T') const
Definition: datetime.cpp:470
CSG_DateTime::Format_Date
CSG_String Format_Date(void) const
Definition: datetime.cpp:450
CSG_String_Tokenizer
Definition: api_core.h:754
CSG_DateTime::Month
Month
Definition: datetime.h:196
CSG_String_Tokenizer::Get_Next_Token
CSG_String Get_Next_Token(void)
Definition: api_string.cpp:1442
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_DateTime::CSG_DateTime
CSG_DateTime(void)
Definition: datetime.cpp:82
CSG_DateTime::Get_WeekOfYear
TSG_DateTime Get_WeekOfYear(void) const
Definition: datetime.cpp:405
datetime.h
CSG_DateTime::WeekDay
WeekDay
Definition: datetime.h:201
CSG_DateTime::Add
CSG_DateTime Add(const CSG_TimeSpan &TimeSpan) const
Definition: datetime.cpp:324
CSG_DateTime::Get_MonthName
static CSG_String Get_MonthName(Month month, NameFlags flags=Name_Full)
Definition: datetime.cpp:543
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: datetime.h File Reference

  • saga_core
  • saga_api
Classes | Functions
datetime.h File Reference
#include "api_core.h"

Go to the source code of this file.

Classes

class | CSG_TimeSpan
class | CSG_DateTime

Functions

SAGA_API_DLL_EXPORT bool | SG_JulianDayNumber_To_Date (double JDN, int &y, int &m, int &d)
SAGA_API_DLL_EXPORT CSG_String | SG_JulianDayNumber_To_Date (double JDN)
SAGA_API_DLL_EXPORT CSG_String | SG_JulianDayNumber_To_Date (int JDN)
SAGA_API_DLL_EXPORT double | SG_Date_To_JulianDayNumber (int y, int m, int d)
SAGA_API_DLL_EXPORT double | SG_Date_To_JulianDayNumber (const CSG_String &Date)
SAGA_API_DLL_EXPORT int | SG_Get_Day_MidOfMonth (int Month, bool bLeapYear=false)
SAGA_API_DLL_EXPORT bool | SG_Get_Sun_Position (double JulianDayNumber, double &RA, double &Dec)
SAGA_API_DLL_EXPORT bool | SG_Get_Sun_Position (const CSG_DateTime &Time, double &RA, double &Dec)
SAGA_API_DLL_EXPORT bool | SG_Get_Sun_Position (double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth)
SAGA_API_DLL_EXPORT bool | SG_Get_Sun_Position (const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth)
SAGA_API_DLL_EXPORT double | SG_Get_Day_Length (int DayOfYear, double Latitude)
SAGA_API_DLL_EXPORT double | SG_Get_Day_Length (const CSG_DateTime &Date, double Latitude)

Detailed Description

Simplified wrappers for wxDateTime and related classes including functions for the calculation of the Sun's position and the day length.

See also
CSG_DateTime
CSG_TimeSpan
SG_Get_Sun_Position
SG_Get_Day_Length

Definition in file datetime.h.

Function Documentation

◆ SG_Date_To_JulianDayNumber() [1/2]

SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber ( const CSG_String & Date )

Returns the Julian Day Number.

Definition at line 746 of file datetime.cpp.

References CSG_String::AfterFirst(), CSG_String_Tokenizer::Get_Next_Token(), CSG_String_Tokenizer::Get_Tokens_Count(), CSG_String::Length(), and SG_Date_To_JulianDayNumber().

◆ SG_Date_To_JulianDayNumber() [2/2]

SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber | ( | int | y,
 |  | int | m,
 |  | int | d
 | ) |  |

Returns the Julian Day Number calculated from Gregorian date (year, month, day).

Definition at line 729 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_Date_To_JulianDayNumber().

◆ SG_Get_Day_Length() [1/2]

SAGA_API_DLL_EXPORT double SG_Get_Day_Length | ( | const CSG_DateTime & | Date,
 |  | double | Latitude
 | ) |  |

Definition at line 927 of file datetime.cpp.

References CSG_DateTime::Get_DayOfYear(), and SG_Get_Day_Length().

◆ SG_Get_Day_Length() [2/2]

SAGA_API_DLL_EXPORT double SG_Get_Day_Length | ( | int | DayOfYear,
 |  | double | Latitude
 | ) |  |

Definition at line 913 of file datetime.cpp.

References M_DEG_TO_RAD, and M_PI.

Referenced by SG_Get_Day_Length().

◆ SG_Get_Day_MidOfMonth()

SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth | ( | int | Month,
 |  | bool | bLeapYear
 | ) |  |

Returns the day number (starting with zero for the first of January) for the mid of the requested month (January = 0).

Definition at line 784 of file datetime.cpp.

◆ SG_Get_Sun_Position() [1/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position | ( | const CSG_DateTime & | Time,
 |  | double & | RA,
 |  | double & | Dec
 | ) |  |

Definition at line 862 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [2/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position | ( | const CSG_DateTime & | Time,
 |  | double | Longitude,
 |  | double | Latitude,
 |  | double & | Height,
 |  | double & | Azimuth
 | ) |  |

Definition at line 902 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [3/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position | ( | double | JulianDayNumber,
 |  | double & | RA,
 |  | double & | Dec
 | ) |  |

Calculates the Sun's position for given date and time as declination and right ascension angles (radians). Solar coordinates according to Jean Meeus: Astronomical Algorithms, accuracy of 0.01 degree

Definition at line 835 of file datetime.cpp.

References M_DEG_TO_RAD.

Referenced by SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [4/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position | ( | double | JulianDayNumber,
 |  | double | Longitude,
 |  | double | Latitude,
 |  | double & | Height,
 |  | double & | Azimuth
 | ) |  |

Calculates the Sun's position for given date and time and position on Earth as given by longitude and latitude (radians). Height and Azimuth are calculated as radians. Returns true if Sun is above horizon.

Definition at line 875 of file datetime.cpp.

References M_DEG_TO_RAD, and SG_Get_Sun_Position().

◆ SG_JulianDayNumber_To_Date() [1/3]

SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date ( double JDN )

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 698 of file datetime.cpp.

References CSG_String::Printf(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [2/3]

SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date | ( | double | JDN,
 |  | int & | y,
 |  | int & | m,
 |  | int & | d
 | ) |  |

Expects 'Value' to be the Julian Day Number.

Definition at line 678 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [3/3]

SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date ( int JDN )

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 719 of file datetime.cpp.

References SG_JulianDayNumber_To_Date().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: datetime.h Source File

  • saga_core
  • saga_api
datetime.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // datetime.h //
15 // //
16 // Copyright (C) 2015 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__datetime_H
52 #define HEADER_INCLUDED__SAGA_API__datetime_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
73 // //
75 // //
76 // //
78
79 //---------------------------------------------------------
80 #include "api_core.h"
81
82
84 // //
85 // //
86 // //
88
89 //---------------------------------------------------------
90 class SAGA_API_DLL_EXPORT CSG_TimeSpan
91 {
92 friend class CSG_DateTime;
93
94 public:
95
96 CSG_TimeSpan(void) { m_span = 0l ; }
97 CSG_TimeSpan(const CSG_TimeSpan &ts) { m_span = ts.m_span; }
98 CSG_TimeSpan(const sLong &diff) { m_span = diff ; }
99 CSG_TimeSpan(double hours) { m_span = (sLong)(1000.*60.*60. * hours); }
100 CSG_TimeSpan(long hours, long min = 0, sLong sec = 0, sLong msec = 0)
101 {
102 m_span = msec + 1000 * (sec + 60 * ((sLong)min + 60 * (sLong)hours));
103 }
104
105 //-----------------------------------------------------
106 static CSG_TimeSpan Milliseconds (sLong ms ) { return( CSG_TimeSpan(0, 0, 0, ms) ); }
107 static CSG_TimeSpan Seconds (sLong sec ) { return( CSG_TimeSpan(0, 0, sec ) ); }
108 static CSG_TimeSpan Minutes (long min ) { return( CSG_TimeSpan(0, min, 0 ) ); }
109 static CSG_TimeSpan Hours (long hours) { return( CSG_TimeSpan(hours, 0, 0) ); }
110 static CSG_TimeSpan Days (long days ) { return( Hours(24 * days) ); }
111 static CSG_TimeSpan Weeks (long days ) { return( Days ( 7 * days) ); }
112
113 static CSG_TimeSpan Millisecond (void) { return( Milliseconds(1) ); }
114 static CSG_TimeSpan Second (void) { return( Seconds (1) ); }
115 static CSG_TimeSpan Minute (void) { return( Minutes (1) ); }
116 static CSG_TimeSpan Hour (void) { return( Hours (1) ); }
117 static CSG_TimeSpan Day (void) { return( Days (1) ); }
118 static CSG_TimeSpan Week (void) { return( Weeks (1) ); }
119
120 //-----------------------------------------------------
121 CSG_TimeSpan & Add (const CSG_TimeSpan &ts) { m_span += ts.m_span; return( *this ); }
122 CSG_TimeSpan & Subtract (const CSG_TimeSpan &ts) { m_span -= ts.m_span; return( *this ); }
123 CSG_TimeSpan & Multiply (int n) { m_span *= n; return( *this ); }
124
125 CSG_TimeSpan & operator += (const CSG_TimeSpan &ts) { return( Add (ts) ); }
126 CSG_TimeSpan & operator -= (const CSG_TimeSpan &ts) { return( Subtract(ts) ); }
127 CSG_TimeSpan & operator *= (int n) { return( Multiply( n) ); }
128
129 CSG_TimeSpan Add (const CSG_TimeSpan &ts) const { return( CSG_TimeSpan(m_span + ts.m_span) ); }
130 CSG_TimeSpan Subtract (const CSG_TimeSpan &ts) const { return( CSG_TimeSpan(m_span - ts.m_span) ); }
131 CSG_TimeSpan Multiply (int n) const { return( CSG_TimeSpan(m_span * n) ); }
132
133 CSG_TimeSpan operator + (const CSG_TimeSpan &ts) const { return( CSG_TimeSpan(m_span + ts.m_span) ); }
134 CSG_TimeSpan operator - (const CSG_TimeSpan &ts) const { return( CSG_TimeSpan(m_span - ts.m_span) ); }
135 CSG_TimeSpan operator * (int n) const { return( CSG_TimeSpan(m_span * n) ); }
136
137 CSG_TimeSpan Abs (void) const { return( CSG_TimeSpan(m_span >= 0l ? m_span : -m_span) ); }
138 CSG_TimeSpan Negate (void) const { return( CSG_TimeSpan(-m_span) ); }
139 CSG_TimeSpan & Neg (void) { m_span = -m_span; return( *this ); }
140 CSG_TimeSpan & operator - (void) { return( Neg() ); }
141
142 bool is_Null (void) const { return( m_span == 0l ); }
143 bool is_Positive (void) const { return( m_span > 0l ); }
144 bool is_Negative (void) const { return( m_span < 0l ); }
145
146 bool operator ! (void) const { return( !is_Null() ); }
147
148 bool is_EqualTo (const CSG_TimeSpan &ts) const { return( m_span == ts.m_span ); }
149 bool is_LongerThan (const CSG_TimeSpan &ts) const { return( m_span > ts.m_span ); }
150 bool is_ShorterThan (const CSG_TimeSpan &ts) const { return( m_span < ts.m_span ); }
151
152 bool operator < (const CSG_TimeSpan &ts) const { return( m_span < ts.m_span ); }
153 bool operator <= (const CSG_TimeSpan &ts) const { return( m_span <= ts.m_span ); }
154 bool operator == (const CSG_TimeSpan &ts) const { return( m_span == ts.m_span ); }
155 bool operator != (const CSG_TimeSpan &ts) const { return( m_span != ts.m_span ); }
156 bool operator >= (const CSG_TimeSpan &ts) const { return( m_span >= ts.m_span ); }
157 bool operator > (const CSG_TimeSpan &ts) const { return( m_span > ts.m_span ); }
158
159 int Get_Weeks (void) const { return( Get_Days () / 7 ); }
160 int Get_Days (void) const { return( Get_Hours () / 24 ); }
161 int Get_Hours (void) const { return( Get_Minutes() / 60 ); }
162 int Get_Minutes (void) const { return( (int)(Get_Seconds() / 60) ); }
163 sLong Get_Seconds (void) const { return( m_span / 1000l ); }
164 sLong Get_Milliseconds (void) const { return( m_span ); }
165 sLong Get_Value (void) const { return( m_span ); }
166
167 CSG_String Format (const CSG_String &format = "") const;
168
169
170 private:
171
172 sLong m_span;
173
174 };
175
176
178 // //
180
181 //---------------------------------------------------------
182 class SAGA_API_DLL_EXPORT CSG_DateTime
183 {
184 public:
185
186 //-----------------------------------------------------
187 // types
188
189 typedef unsigned short TSG_DateTime;
190
191
192 //-----------------------------------------------------
193 // constants
194
195 enum Month // symbolic names for the months
196 {
197 Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Inv_Month
198 };
199
200 enum WeekDay // symbolic names for the weekdays
201 {
202 Sun, Mon, Tue, Wed, Thu, Fri, Sat, Inv_WeekDay
203 };
204
205 enum Year // invalid value for the year
206 {
207 Inv_Year = -32768 // should hold in wxDateTime_t
208 };
209
210 enum NameFlags // flags for GetWeekDayName and GetMonthName
211 {
212 Name_Full = 0x01, // return full name
213 Name_Abbr = 0x02 // return abbreviated name
214 };
215
216
217 public:
218
219 //-----------------------------------------------------
220 CSG_DateTime(void);
221 CSG_DateTime(const CSG_DateTime &DateTime);
222 CSG_DateTime(const CSG_String &ISODate);
223 CSG_DateTime(double JDN);
224 CSG_DateTime( TSG_DateTime Hour , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
225 CSG_DateTime(TSG_DateTime Day, Month Month, int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
226
227 virtual ~CSG_DateTime(void);
228
229
230 //-----------------------------------------------------
231 CSG_DateTime & Set (const CSG_DateTime &DateTime);
232 CSG_DateTime & Set (const CSG_String &ISODate);
233 CSG_DateTime & Set (double JDN);
234 CSG_DateTime & Set ( TSG_DateTime Hour , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
235 CSG_DateTime & Set (TSG_DateTime Day, Month Month, int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
236
237 CSG_DateTime & Set_Millisecond (unsigned short Value);
238 CSG_DateTime & Set_Second (unsigned short Value);
239 CSG_DateTime & Set_Minute (unsigned short Value);
240 CSG_DateTime & Set_Hour (unsigned short Value);
241 CSG_DateTime & Set_Hour (double Value);
242 CSG_DateTime & Set_Day (unsigned short Value);
243 CSG_DateTime & Set_Month (unsigned short Value);
244 CSG_DateTime & Set_Year (int Value);
245
246 CSG_DateTime & Set_DayOfYear (unsigned short Value);
247 CSG_DateTime & Set_To_Current (void);
248
249 CSG_DateTime & Set_Unix_Time (sLong Seconds);
250 CSG_DateTime & Set_Hours_AD (int Hours);
251
252 CSG_DateTime & Reset_Time (void);
253
254
255 //-----------------------------------------------------
256 CSG_DateTime From_UTC (bool noDST = false) const;
257 CSG_DateTime To_UTC (bool noDST = false) const;
258
259 CSG_DateTime & Make_UTC (bool noDST = false);
260
261 bool is_DST (void) const;
262
263
264 //-----------------------------------------------------
265 CSG_DateTime Add (const CSG_TimeSpan &TimeSpan) const;
266 CSG_DateTime & Add (const CSG_TimeSpan &TimeSpan);
267
268 CSG_DateTime Subtract (const CSG_TimeSpan &TimeSpan) const;
269 CSG_DateTime & Subtract (const CSG_TimeSpan &TimeSpan);
270
271 CSG_TimeSpan Subtract (const CSG_DateTime &DateTime) const;
272
273
274 //-----------------------------------------------------
275 bool is_Valid (void) const;
276
277 sLong Get_Value (void) const;
278
279 unsigned short Get_Millisecond (void) const;
280 unsigned short Get_Second (void) const;
281 unsigned short Get_Minute (void) const;
282 unsigned short Get_Hour (void) const;
283
284 unsigned short Get_Day (void) const;
285 Month Get_Month (void) const;
286 int Get_Year (void) const;
287
288 unsigned short Get_DayOfYear (void) const;
289 WeekDay Get_WeekDay (void) const;
290 TSG_DateTime Get_WeekOfMonth (void) const;
291 TSG_DateTime Get_WeekOfYear (void) const;
292
293 double Get_JDN (void) const;
294 double Get_MJD (void) const;
295
296
297 //-----------------------------------------------------
298 bool is_EarlierThan (const CSG_DateTime &DateTime) const;
299 bool is_EqualTo (const CSG_DateTime &DateTime) const;
300 bool is_LaterThan (const CSG_DateTime &DateTime) const;
301
302 bool is_SameDate (const CSG_DateTime &DateTime) const;
303 bool is_SameTime (const CSG_DateTime &DateTime) const;
304
305 bool is_Between (const CSG_DateTime &t1, const CSG_DateTime &t2) const;
306 bool is_StrictlyBetween (const CSG_DateTime &t1, const CSG_DateTime &t2) const;
307
308
309 //-----------------------------------------------------
310 CSG_DateTime & operator = (const CSG_DateTime &DateTime) { return( Set (DateTime) ); }
311 CSG_DateTime & operator = (double JDN) { return( Set ( JDN) ); }
312
313 CSG_DateTime & operator += (const CSG_TimeSpan &TimeSpan) { return( Add (TimeSpan) ); }
314 CSG_DateTime & operator -= (const CSG_TimeSpan &TimeSpan) { return( Subtract(TimeSpan) ); }
315
316 CSG_DateTime operator + (const CSG_TimeSpan &TimeSpan) const { return( Add (TimeSpan) ); }
317 CSG_DateTime operator - (const CSG_TimeSpan &TimeSpan) const { return( Subtract(TimeSpan) ); }
318
319 CSG_TimeSpan operator - (const CSG_DateTime &DateTime) const { return( Subtract(DateTime) ); }
320
321 bool operator < (const CSG_DateTime &DateTime) const { return( Get_Value() < DateTime.Get_Value() ); }
322 bool operator <= (const CSG_DateTime &DateTime) const { return( Get_Value() <= DateTime.Get_Value() ); }
323 bool operator == (const CSG_DateTime &DateTime) const { return( Get_Value() == DateTime.Get_Value() ); }
324 bool operator >= (const CSG_DateTime &DateTime) const { return( Get_Value() >= DateTime.Get_Value() ); }
325 bool operator > (const CSG_DateTime &DateTime) const { return( Get_Value() > DateTime.Get_Value() ); }
326
327
328 //-----------------------------------------------------
329 CSG_String Format (const CSG_String &Format = "") const;
330 CSG_String Format_Date (void) const;
331 CSG_String Format_Time (void) const;
332 CSG_String Format_ISODate (void) const;
333 CSG_String Format_ISOTime (void) const;
334 CSG_String Format_ISOCombined (char sep = 'T') const;
335
336 bool Parse_Date (const CSG_String &date);
337 bool Parse_DateTime (const CSG_String &datetime);
338 bool Parse_Format (const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef);
339 bool Parse_Format (const CSG_String &date, const CSG_String &format);
340 bool Parse_Format (const CSG_String &date);
341 bool Parse_ISOCombined (const CSG_String &date, char sep= 'T');
342 bool Parse_ISODate (const CSG_String &date);
343 bool Parse_ISOTime (const CSG_String &date);
344
345
346 //-----------------------------------------------------
347 static TSG_DateTime Get_Current_Day (void);
348 static Month Get_Current_Month (void);
349 static int Get_Current_Year (void);
350
351 static CSG_String Get_MonthName (Month month, NameFlags flags = Name_Full);
352 static CSG_String Get_EnglishMonthName (Month month, NameFlags flags = Name_Full);
353 static CSG_String Get_WeekDayName (WeekDay weekday, NameFlags flags = Name_Full);
354 static CSG_String Get_EnglishWeekDayName (WeekDay weekday, NameFlags flags = Name_Full);
355
356 static TSG_DateTime Get_NumberOfDays ( int year);
357 static TSG_DateTime Get_NumberOfDays (Month month, int year = Inv_Year);
358
359 static bool is_LeapYear (int year = Inv_Year);
360
361 static CSG_DateTime Now (void);
362
363 static CSG_String Get_Month_Choices (void);
364
365
366 private:
367
368 class wxDateTime *m_pDateTime;
369
370 };
371
372
374 // //
375 // //
376 // //
378
379 //---------------------------------------------------------
380 SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date (double JDN, int &y, int &m, int &d);
381 SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date (double JDN);
382 SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date (int JDN);
383
384 SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber (int y, int m, int d);
385 SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber (const CSG_String &Date);
386
387 SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth (int Month, bool bLeapYear = false);
388
389
391 // //
392 // //
393 // //
395
396 //---------------------------------------------------------
397 SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (double JulianDayNumber, double &RA, double &Dec);
398 SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (const CSG_DateTime &Time, double &RA, double &Dec);
399
400 SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth);
401 SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth);
402
403 SAGA_API_DLL_EXPORT double SG_Get_Day_Length (int DayOfYear, double Latitude);
404 SAGA_API_DLL_EXPORT double SG_Get_Day_Length (const CSG_DateTime &Date, double Latitude);
405
406
408 // //
409 // //
410 // //
412
413 //---------------------------------------------------------
414 #endif // #ifndef HEADER_INCLUDED__SAGA_API__datetime_H
CSG_TimeSpan::is_Null
bool is_Null(void) const
Definition: datetime.h:142
CSG_DateTime::operator>
bool operator>(const CSG_DateTime &DateTime) const
Definition: datetime.h:325
CSG_TimeSpan::is_Negative
bool is_Negative(void) const
Definition: datetime.h:144
SG_JulianDayNumber_To_Date
SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
Definition: datetime.cpp:678
CSG_TimeSpan::CSG_TimeSpan
CSG_TimeSpan(long hours, long min=0, sLong sec=0, sLong msec=0)
Definition: datetime.h:100
CSG_TimeSpan::Get_Hours
int Get_Hours(void) const
Definition: datetime.h:161
SG_Get_Day_Length
SAGA_API_DLL_EXPORT double SG_Get_Day_Length(int DayOfYear, double Latitude)
Definition: datetime.cpp:913
CSG_TimeSpan::Week
static CSG_TimeSpan Week(void)
Definition: datetime.h:118
CSG_DateTime::operator-
CSG_DateTime operator-(const CSG_TimeSpan &TimeSpan) const
Definition: datetime.h:317
CSG_DateTime::NameFlags
NameFlags
Definition: datetime.h:211
SG_Get_Sun_Position
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position(double JulianDayNumber, double &RA, double &Dec)
Definition: datetime.cpp:835
CSG_TimeSpan::Weeks
static CSG_TimeSpan Weeks(long days)
Definition: datetime.h:111
CSG_TimeSpan::Get_Milliseconds
sLong Get_Milliseconds(void) const
Definition: datetime.h:164
api_core.h
CSG_TimeSpan::CSG_TimeSpan
CSG_TimeSpan(void)
Definition: datetime.h:96
CSG_TimeSpan::Hours
static CSG_TimeSpan Hours(long hours)
Definition: datetime.h:109
CSG_TimeSpan::Get_Weeks
int Get_Weeks(void) const
Definition: datetime.h:159
CSG_TimeSpan
Definition: datetime.h:91
CSG_TimeSpan::Add
CSG_TimeSpan & Add(const CSG_TimeSpan &ts)
Definition: datetime.h:121
SG_Get_Day_MidOfMonth
SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth(int Month, bool bLeapYear=false)
Definition: datetime.cpp:784
CSG_TimeSpan::Day
static CSG_TimeSpan Day(void)
Definition: datetime.h:117
CSG_DateTime::operator+=
CSG_DateTime & operator+=(const CSG_TimeSpan &TimeSpan)
Definition: datetime.h:313
CSG_DateTime::Wed
@ Wed
Definition: datetime.h:202
CSG_TimeSpan::Get_Days
int Get_Days(void) const
Definition: datetime.h:160
CSG_TimeSpan::Subtract
CSG_TimeSpan & Subtract(const CSG_TimeSpan &ts)
Definition: datetime.h:122
CSG_TimeSpan::is_LongerThan
bool is_LongerThan(const CSG_TimeSpan &ts) const
Definition: datetime.h:149
CSG_TimeSpan::CSG_TimeSpan
CSG_TimeSpan(const CSG_TimeSpan &ts)
Definition: datetime.h:97
CSG_TimeSpan::CSG_TimeSpan
CSG_TimeSpan(const sLong &diff)
Definition: datetime.h:98
CSG_TimeSpan::Hour
static CSG_TimeSpan Hour(void)
Definition: datetime.h:116
CSG_TimeSpan::Subtract
CSG_TimeSpan Subtract(const CSG_TimeSpan &ts) const
Definition: datetime.h:130
CSG_TimeSpan::Days
static CSG_TimeSpan Days(long days)
Definition: datetime.h:110
CSG_DateTime::Format
CSG_String Format(const CSG_String &Format="") const
Definition: datetime.cpp:445
CSG_DateTime::Sep
@ Sep
Definition: datetime.h:197
CSG_DateTime::operator>=
bool operator>=(const CSG_DateTime &DateTime) const
Definition: datetime.h:324
CSG_TimeSpan::Multiply
CSG_TimeSpan & Multiply(int n)
Definition: datetime.h:123
CSG_TimeSpan::is_EqualTo
bool is_EqualTo(const CSG_TimeSpan &ts) const
Definition: datetime.h:148
CSG_TimeSpan::Negate
CSG_TimeSpan Negate(void) const
Definition: datetime.h:138
sLong
signed long long sLong
Definition: api_core.h:158
SG_Date_To_JulianDayNumber
SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber(int y, int m, int d)
Definition: datetime.cpp:729
CSG_DateTime::TSG_DateTime
unsigned short TSG_DateTime
Definition: datetime.h:189
CSG_TimeSpan::Minute
static CSG_TimeSpan Minute(void)
Definition: datetime.h:115
CSG_TimeSpan::Minutes
static CSG_TimeSpan Minutes(long min)
Definition: datetime.h:108
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_DateTime::operator<=
bool operator<=(const CSG_DateTime &DateTime) const
Definition: datetime.h:322
CSG_DateTime::operator<
bool operator<(const CSG_DateTime &DateTime) const
Definition: datetime.h:321
CSG_DateTime
Definition: datetime.h:183
CSG_TimeSpan::Get_Minutes
int Get_Minutes(void) const
Definition: datetime.h:162
CSG_TimeSpan::Second
static CSG_TimeSpan Second(void)
Definition: datetime.h:114
CSG_DateTime::Subtract
CSG_DateTime Subtract(const CSG_TimeSpan &TimeSpan) const
Definition: datetime.cpp:339
CSG_TimeSpan::Abs
CSG_TimeSpan Abs(void) const
Definition: datetime.h:137
CSG_TimeSpan::is_Positive
bool is_Positive(void) const
Definition: datetime.h:143
CSG_TimeSpan::Multiply
CSG_TimeSpan Multiply(int n) const
Definition: datetime.h:131
CSG_TimeSpan::Get_Seconds
sLong Get_Seconds(void) const
Definition: datetime.h:163
CSG_String
Definition: api_core.h:557
CSG_DateTime::Year
Year
Definition: datetime.h:206
CSG_DateTime::operator-=
CSG_DateTime & operator-=(const CSG_TimeSpan &TimeSpan)
Definition: datetime.h:314
CSG_DateTime::Get_Value
sLong Get_Value(void) const
Definition: datetime.cpp:313
CSG_TimeSpan::CSG_TimeSpan
CSG_TimeSpan(double hours)
Definition: datetime.h:99
CSG_TimeSpan::Get_Value
sLong Get_Value(void) const
Definition: datetime.h:165
CSG_TimeSpan::is_ShorterThan
bool is_ShorterThan(const CSG_TimeSpan &ts) const
Definition: datetime.h:150
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
CSG_TimeSpan::Seconds
static CSG_TimeSpan Seconds(sLong sec)
Definition: datetime.h:107
CSG_DateTime::Month
Month
Definition: datetime.h:196
CSG_TimeSpan::Add
CSG_TimeSpan Add(const CSG_TimeSpan &ts) const
Definition: datetime.h:129
CSG_TimeSpan::Neg
CSG_TimeSpan & Neg(void)
Definition: datetime.h:139
CSG_DateTime::operator==
bool operator==(const CSG_DateTime &DateTime) const
Definition: datetime.h:323
CSG_DateTime::WeekDay
WeekDay
Definition: datetime.h:201
CSG_DateTime::Add
CSG_DateTime Add(const CSG_TimeSpan &TimeSpan) const
Definition: datetime.cpp:324
CSG_TimeSpan::Milliseconds
static CSG_TimeSpan Milliseconds(sLong ms)
Definition: datetime.h:106
CSG_TimeSpan::Millisecond
static CSG_TimeSpan Millisecond(void)
Definition: datetime.h:113
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: geo_classes.cpp File Reference

  • saga_core
  • saga_api
geo_classes.cpp File Reference
#include "parameters.h"
#include "geo_tools.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: geo_classes.cpp Source File

  • saga_core
  • saga_api
geo_classes.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // geo_classes.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "parameters.h"
54
55 #include "geo_tools.h"
56
57
59 // //
60 // CSG_Point //
61 // //
63
64 //---------------------------------------------------------
65 CSG_Point::CSG_Point(void)
66 {
67 Assign(0., 0.);
68 }
69
70 CSG_Point::CSG_Point(const CSG_Point &Point)
71 {
72 Assign(Point.x, Point.y);
73 }
74
75 CSG_Point::CSG_Point(const TSG_Point &Point)
76 {
77 Assign(Point.x, Point.y);
78 }
79
80 CSG_Point::CSG_Point(double _x, double _y)
81 {
82 Assign(_x, _y);
83 }
84
85 //---------------------------------------------------------
86 void CSG_Point::Assign(double _x, double _y)
87 {
88 x = _x;
89 y = _y;
90 }
91
92 void CSG_Point::Assign(const CSG_Point &Point)
93 {
94 x = Point.x;
95 y = Point.y;
96 }
97
98 //---------------------------------------------------------
99 void CSG_Point::Add(const CSG_Point &Point)
100 {
101 x += Point.x;
102 y += Point.y;
103 }
104
105 void CSG_Point::Subtract(const CSG_Point &Point)
106 {
107 x -= Point.x;
108 y -= Point.y;
109 }
110
111 void CSG_Point::Multiply(const CSG_Point &Point)
112 {
113 x *= Point.x;
114 y *= Point.y;
115 }
116
117 void CSG_Point::Multiply(double Value)
118 {
119 x *= Value;
120 y *= Value;
121 }
122
123 void CSG_Point::Divide(double Value)
124 {
125 x /= Value;
126 y /= Value;
127 }
128
129 //---------------------------------------------------------
130 double CSG_Point::Get_Length(void) const
131 {
132 return( sqrt(x*x + y*y) );
133 }
134
135
137 // //
139
140 //---------------------------------------------------------
141 CSG_Point_3D::CSG_Point_3D(void)
142 {
143 Assign(0., 0., 0.);
144 }
145
146 CSG_Point_3D::CSG_Point_3D(const CSG_Point_3D &Point)
147 {
148 Assign(Point.x, Point.y, Point.z);
149 }
150
151 CSG_Point_3D::CSG_Point_3D(const TSG_Point_3D &Point)
152 {
153 Assign(Point.x, Point.y, Point.z);
154 }
155
156 CSG_Point_3D::CSG_Point_3D(double _x, double _y, double _z)
157 {
158 Assign(_x, _y, _z);
159 }
160
161 //---------------------------------------------------------
162 void CSG_Point_3D::Assign(double _x, double _y, double _z)
163 {
164 x = _x;
165 y = _y;
166 z = _z;
167 }
168
169 void CSG_Point_3D::Assign(const CSG_Point_3D &Point)
170 {
171 x = Point.x;
172 y = Point.y;
173 z = Point.z;
174 }
175
176 //---------------------------------------------------------
177 void CSG_Point_3D::Add(const CSG_Point_3D &Point)
178 {
179 x += Point.x;
180 y += Point.y;
181 z += Point.z;
182 }
183
184 void CSG_Point_3D::Subtract(const CSG_Point_3D &Point)
185 {
186 x -= Point.x;
187 y -= Point.y;
188 z -= Point.z;
189 }
190
191 void CSG_Point_3D::Multiply(const CSG_Point_3D &Point)
192 {
193 x *= Point.x;
194 y *= Point.y;
195 z *= Point.z;
196 }
197
198 void CSG_Point_3D::Multiply(double Value)
199 {
200 x *= Value;
201 y *= Value;
202 z *= Value;
203 }
204
205 void CSG_Point_3D::Divide(double Value)
206 {
207 x /= Value;
208 y /= Value;
209 z /= Value;
210 }
211
212 //---------------------------------------------------------
213 double CSG_Point_3D::Get_Length(void) const
214 {
215 return( sqrt(x*x + y*y + z*z) );
216 }
217
218
220 // //
222
223 //---------------------------------------------------------
224 CSG_Point_4D::CSG_Point_4D(void)
225 {
226 Assign(0., 0., 0., 0.);
227 }
228
229 CSG_Point_4D::CSG_Point_4D(const CSG_Point_4D &Point)
230 {
231 Assign(Point.x, Point.y, Point.z, Point.m);
232 }
233
234 CSG_Point_4D::CSG_Point_4D(const TSG_Point_4D &Point)
235 {
236 Assign(Point.x, Point.y, Point.z, Point.m);
237 }
238
239 CSG_Point_4D::CSG_Point_4D(double _x, double _y, double _z, double _m)
240 {
241 Assign(_x, _y, _z, _m);
242 }
243
244 //---------------------------------------------------------
245 void CSG_Point_4D::Assign(double _x, double _y, double _z, double _m)
246 {
247 x = _x;
248 y = _y;
249 z = _z;
250 m = _m;
251 }
252
253 void CSG_Point_4D::Assign(const CSG_Point_4D &Point)
254 {
255 x = Point.x;
256 y = Point.y;
257 z = Point.z;
258 m = Point.m;
259 }
260
261 //---------------------------------------------------------
262 void CSG_Point_4D::Add(const CSG_Point_4D &Point)
263 {
264 x += Point.x;
265 y += Point.y;
266 z += Point.z;
267 m += Point.m;
268 }
269
270 void CSG_Point_4D::Subtract(const CSG_Point_4D &Point)
271 {
272 x -= Point.x;
273 y -= Point.y;
274 z -= Point.z;
275 m -= Point.m;
276 }
277
278 void CSG_Point_4D::Multiply(const CSG_Point_4D &Point)
279 {
280 x *= Point.x;
281 y *= Point.y;
282 z *= Point.z;
283 m *= Point.m;
284 }
285
286 void CSG_Point_4D::Multiply(double Value)
287 {
288 x *= Value;
289 y *= Value;
290 z *= Value;
291 m *= Value;
292 }
293
294 void CSG_Point_4D::Divide(double Value)
295 {
296 x /= Value;
297 y /= Value;
298 z /= Value;
299 m /= Value;
300 }
301
302 //---------------------------------------------------------
303 double CSG_Point_4D::Get_Length(void) const
304 {
305 return( sqrt(x*x + y*y + z*z + m*m) );
306 }
307
308
310 // //
311 // //
312 // //
314
315 //---------------------------------------------------------
316 CSG_Points::CSG_Points(void)
317 {
318 m_Points.Create(sizeof(TSG_Point), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
319 }
320
321 CSG_Points::CSG_Points(const CSG_Points &Points)
322 {
323 m_Points.Create(sizeof(TSG_Point), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
324
325 Assign(Points);
326 }
327
328 CSG_Points::CSG_Points(sLong nPoints, TSG_Array_Growth Growth)
329 {
330 m_Points.Create(sizeof(TSG_Point), nPoints, Growth);
331 }
332
333 //---------------------------------------------------------
334 bool CSG_Points::Assign(const CSG_Points &Points)
335 {
336 if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
337 {
338 if( m_Points.Get_Size() > 0 )
339 {
340 memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
341 }
342
343 return( true );
344 }
345
346 return( false );
347 }
348
349 //---------------------------------------------------------
350 bool CSG_Points::Add(double x, double y)
351 {
352 if( m_Points.Inc_Array() )
353 {
354 TSG_Point *Point = (TSG_Point *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
355
356 Point->x = x;
357 Point->y = y;
358
359 return( true );
360 }
361
362 return( false );
363 }
364
365
367 // //
368 // //
369 // //
371
372 //---------------------------------------------------------
373 CSG_Lines::CSG_Lines(void)
374 {
375 m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
376 }
377
378 CSG_Lines::CSG_Lines(const CSG_Lines &Lines)
379 {
380 m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
381
382 Create(Lines);
383 }
384
385 bool CSG_Lines::Create(const CSG_Lines &Lines)
386 {
387 return( Assign(Lines) );
388 }
389
390 CSG_Lines::CSG_Lines(sLong nLines)
391 {
392 m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
393
394 Create(nLines);
395 }
396
397 bool CSG_Lines::Create(sLong nLines)
398 {
399 return( Set_Count(nLines) );
400 }
401
402 //---------------------------------------------------------
403 CSG_Lines::~CSG_Lines(void)
404 {
405 Destroy();
406 }
407
408 //---------------------------------------------------------
409 bool CSG_Lines::Destroy(void)
410 {
411 return( Set_Count(0) );
412 }
413
414 //---------------------------------------------------------
415 bool CSG_Lines::Clear(void)
416 {
417 return( Set_Count(0) );
418 }
419
420 //---------------------------------------------------------
421 bool CSG_Lines::Assign(const CSG_Lines &Lines)
422 {
423 if( Set_Count(Lines.Get_Count()) )
424 {
425 for(sLong i=0; i<Lines.Get_Count(); i++)
426 {
427 Get_Line(i).Assign(Lines[i]);
428 }
429
430 return( true );
431 }
432
433 return( false );
434 }
435
436 //---------------------------------------------------------
437 CSG_Points & CSG_Lines::Add(void)
438 {
439 Set_Count(Get_Count() + 1);
440
441 return( Get_Line(Get_Count() - 1) );
442 }
443
444 //---------------------------------------------------------
445 bool CSG_Lines::Add(const CSG_Points &Line)
446 {
447 Add().Assign(Line);
448
449 return( true );
450 }
451
452 //---------------------------------------------------------
453 bool CSG_Lines::Add(const CSG_Lines &Lines)
454 {
455 for(sLong i=0; i<Lines.Get_Count(); i++)
456 {
457 Add(Lines[i]);
458 }
459
460 return( true );
461 }
462
463 //---------------------------------------------------------
464 bool CSG_Lines::Del(sLong Index)
465 {
466 if( Index >= 0 && Index < m_Lines.Get_Size() )
467 {
468 delete((CSG_Points *)m_Lines[Index]);
469
470 return( m_Lines.Del(Index) );
471 }
472
473 return( false );
474 }
475
476 //---------------------------------------------------------
477 bool CSG_Lines::Set_Count(sLong new_Count)
478 {
479 if( new_Count < 0 )
480 {
481 new_Count = 0;
482 }
483
484 sLong old_Count = m_Lines.Get_Size();
485
486 if( new_Count > old_Count )
487 {
488 m_Lines.Set_Array(new_Count);
489
490 for(sLong i=old_Count; i<new_Count; i++)
491 {
492 m_Lines[i] = new CSG_Points;
493 }
494 }
495 else if( new_Count < old_Count )
496 {
497 for(sLong i=new_Count; i<old_Count; i++)
498 {
499 delete((CSG_Points *)m_Lines[i]);
500 }
501
502 m_Lines.Set_Array(new_Count);
503 }
504
505 return( true );
506 }
507
508 double CSG_Lines::Get_Length(void) const
509 {
510 double Length = 0.;
511
512 for(sLong i=0; i<Get_Count(); i++)
513 {
514 Length += Get_Length(i);
515 }
516
517 return( Length );
518 }
519
520 double CSG_Lines::Get_Length(sLong Index) const
521 {
522 double Length = 0.;
523
524 if( Index >= 0 && Index < Get_Count() )
525 {
526 const CSG_Points &Line = Get_Line(Index);
527
528 if( Line.Get_Count() > 1 )
529 {
530 for(sLong i=0, j=1; j<Line.Get_Count(); i++, j++)
531 {
532 Length += SG_Get_Distance(Line[i], Line[j]);
533 }
534 }
535 }
536
537 return( Length );
538 }
539
540
542 // //
543 // //
544 // //
546
547 //---------------------------------------------------------
548 CSG_Points_3D::CSG_Points_3D(void)
549 {
550 m_Points.Create(sizeof(TSG_Point_3D), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
551 }
552
553 CSG_Points_3D::CSG_Points_3D(const CSG_Points_3D &Points)
554 {
555 m_Points.Create(sizeof(CSG_Points_3D), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
556
557 Assign(Points);
558 }
559
560 CSG_Points_3D::CSG_Points_3D(sLong nPoints, TSG_Array_Growth Growth)
561 {
562 m_Points.Create(sizeof(TSG_Point_3D), nPoints, Growth);
563 }
564
565 //---------------------------------------------------------
566 bool CSG_Points_3D::Assign(const CSG_Points_3D &Points)
567 {
568 if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
569 {
570 if( m_Points.Get_Size() > 0 )
571 {
572 memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
573 }
574
575 return( true );
576 }
577
578 return( false );
579 }
580
581 //---------------------------------------------------------
582 bool CSG_Points_3D::Add(double x, double y, double z)
583 {
584 if( m_Points.Inc_Array() )
585 {
586 TSG_Point_3D *Point = (TSG_Point_3D *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
587
588 Point->x = x;
589 Point->y = y;
590 Point->z = z;
591
592 return( true );
593 }
594
595 return( false );
596 }
597
598
600 // //
601 // //
602 // //
604
605 //---------------------------------------------------------
606 CSG_Points_Int::CSG_Points_Int(void)
607 {
608 m_Points.Create(sizeof(TSG_Point_Int), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
609 }
610
611 CSG_Points_Int::CSG_Points_Int(const CSG_Points_Int &Points)
612 {
613 m_Points.Create(sizeof(TSG_Point_Int), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
614
615 Assign(Points);
616 }
617
618 CSG_Points_Int::CSG_Points_Int(sLong nPoints, TSG_Array_Growth Growth)
619 {
620 m_Points.Create(sizeof(TSG_Point_Int), nPoints, Growth);
621 }
622
623 //---------------------------------------------------------
624 bool CSG_Points_Int::Assign(const CSG_Points_Int &Points)
625 {
626 if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
627 {
628 if( m_Points.Get_Size() > 0 )
629 {
630 memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
631 }
632
633 return( true );
634 }
635
636 return( false );
637 }
638
639 //---------------------------------------------------------
640 bool CSG_Points_Int::Add(int x, int y)
641 {
642 if( m_Points.Inc_Array() )
643 {
644 TSG_Point_Int *Point = (TSG_Point_Int *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
645
646 Point->x = x;
647 Point->y = y;
648
649 return( true );
650 }
651
652 return( false );
653 }
654
655
657 // //
658 // CSG_Rect //
659 // //
661
662 //---------------------------------------------------------
663 CSG_Rect::CSG_Rect(void)
664 {
665 Assign(0., 0., 0., 0.);
666 }
667
668 CSG_Rect::CSG_Rect(const CSG_Rect &Rect)
669 {
670 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
671 }
672
673 CSG_Rect::CSG_Rect(const TSG_Rect &Rect)
674 {
675 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
676 }
677
678 CSG_Rect::CSG_Rect(const CSG_Point &A, const CSG_Point &B)
679 {
680 Assign(A.x, A.y, B.x, B.y);
681 }
682
683 CSG_Rect::CSG_Rect(double xMin, double yMin, double xMax, double yMax)
684 {
685 Assign(xMin, yMin, xMax, yMax);
686 }
687
688 //---------------------------------------------------------
689 CSG_Rect::~CSG_Rect(void)
690 {}
691
692 //---------------------------------------------------------
693 bool CSG_Rect::operator == (const CSG_Rect &Rect) const
694 {
695 return( is_Equal(Rect) );
696 }
697
698 bool CSG_Rect::operator != (const CSG_Rect &Rect) const
699 {
700 return( !is_Equal(Rect) );
701 }
702
703 CSG_Rect & CSG_Rect::operator = (const CSG_Rect &Rect)
704 {
705 Assign(Rect);
706
707 return( *this );
708 }
709
710 void CSG_Rect::operator += (const CSG_Point &Point)
711 {
712 Move( Point.x, Point.y);
713 }
714
715 void CSG_Rect::operator -= (const CSG_Point &Point)
716 {
717 Move(-Point.y, -Point.y);
718 }
719
720 //---------------------------------------------------------
721 void CSG_Rect::Assign(double xMin, double yMin, double xMax, double yMax)
722 {
723 if( xMin < xMax )
724 {
725 this->xMin = xMin;
726 this->xMax = xMax;
727 }
728 else
729 {
730 this->xMin = xMax;
731 this->xMax = xMin;
732 }
733
734 if( yMin < yMax )
735 {
736 this->yMin = yMin;
737 this->yMax = yMax;
738 }
739 else
740 {
741 this->yMin = yMax;
742 this->yMax = yMin;
743 }
744 }
745
746 void CSG_Rect::Assign(const CSG_Point &A, const CSG_Point &B)
747 {
748 Assign(A.x, A.y, B.x, B.y);
749 }
750
751 void CSG_Rect::Assign(const CSG_Rect &Rect)
752 {
753 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
754 }
755
756 //---------------------------------------------------------
757 void CSG_Rect::Set_BottomLeft(double x, double y)
758 {
759 Assign(x, y, xMax, yMax);
760 }
761
762 void CSG_Rect::Set_BottomLeft(const CSG_Point &Point)
763 {
764 Set_BottomLeft(Point.x, Point.y );
765 }
766
767 void CSG_Rect::Set_TopRight(double x, double y)
768 {
769 Assign(xMin, yMin, x, y);
770 }
771
772 void CSG_Rect::Set_TopRight(const CSG_Point &Point)
773 {
774 Set_TopRight(Point.x, Point.y );
775 }
776
777 //---------------------------------------------------------
778 bool CSG_Rect::is_Equal(double xMin, double yMin, double xMax, double yMax, double epsilon) const
779 {
780 return( SG_Is_Equal(this->xMin, xMin, epsilon) && SG_Is_Equal(this->yMin, yMin, epsilon)
781 && SG_Is_Equal(this->xMax, xMax, epsilon) && SG_Is_Equal(this->yMax, yMax, epsilon) );
782 }
783
784 bool CSG_Rect::is_Equal(const CSG_Rect &Rect, double epsilon) const
785 {
786 return( is_Equal(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax, epsilon) );
787 }
788
789 //---------------------------------------------------------
790 void CSG_Rect::Move(double dx, double dy)
791 {
792 xMin += dx; yMin += dy;
793 xMax += dx; yMax += dy;
794 }
795
796 void CSG_Rect::Move(const CSG_Point &Point)
797 {
798 Move(Point.x, Point.y);
799 }
800
801 //---------------------------------------------------------
802 void CSG_Rect::Inflate(double dx, double dy, bool bPercent)
803 {
804 if( bPercent )
805 {
806 dx = (Get_XRange() * 0.01 * dx) / 2.;
807 dy = (Get_YRange() * 0.01 * dy) / 2.;
808 }
809
810 Assign(
811 xMin - dx, yMin - dy,
812 xMax + dx, yMax + dy
813 );
814 }
815
816 void CSG_Rect::Inflate(double d, bool bPercent)
817 {
818 Inflate(d, d, bPercent);
819 }
820
821 void CSG_Rect::Deflate(double dx, double dy, bool bPercent)
822 {
823 Inflate(-dx, -dy, bPercent);
824 }
825
826 void CSG_Rect::Deflate(double d, bool bPercent)
827 {
828 Deflate(d, d, bPercent);
829 }
830
831 //---------------------------------------------------------
832 void CSG_Rect::Union(double x, double y)
833 {
834 if( xMin > x ) { xMin = x; } else if( xMax < x ) { xMax = x; }
835 if( yMin > y ) { yMin = y; } else if( yMax < y ) { yMax = y; }
836 }
837
838 //---------------------------------------------------------
839 void CSG_Rect::Union(const CSG_Point &Point)
840 {
841 if( xMin > Point.x ) { xMin = Point.x; } else if( xMax < Point.x ) { xMax = Point.x; }
842 if( yMin > Point.y ) { yMin = Point.y; } else if( yMax < Point.y ) { yMax = Point.y; }
843 }
844
845 //---------------------------------------------------------
846 void CSG_Rect::Union(const CSG_Rect &Rect)
847 {
848 if( xMin > Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
849 if( yMin > Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
850 if( xMax < Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
851 if( yMax < Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
852 }
853
854 //---------------------------------------------------------
855 bool CSG_Rect::Intersect(const CSG_Rect &Rect)
856 {
857 switch( Intersects(Rect) )
858 {
859 case INTERSECTION_None: default:
860 return( false );
861
862 case INTERSECTION_Identical:
863 case INTERSECTION_Contained:
864 break;
865
866 case INTERSECTION_Contains:
867 (*this) = Rect;
868 break;
869
870 case INTERSECTION_Overlaps:
871 if( xMin < Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
872 if( yMin < Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
873 if( xMax > Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
874 if( yMax > Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
875 break;
876 }
877
878 return( true );
879 }
880
881 //---------------------------------------------------------
882 TSG_Intersection CSG_Rect::Intersects(const CSG_Rect &Rect) const
883 {
884 if( xMax < Rect.Get_XMin() || Rect.Get_XMax() < xMin
885 || yMax < Rect.Get_YMin() || Rect.Get_YMax() < yMin )
886 {
887 return( INTERSECTION_None );
888 }
889
890 if( is_Equal(Rect) )
891 {
892 return( INTERSECTION_Identical );
893 }
894
895 if( Contains(Rect.Get_XMin(), Rect.Get_YMin())
896 && Contains(Rect.Get_XMax(), Rect.Get_YMax()) )
897 {
898 return( INTERSECTION_Contains );
899 }
900
901 if( Rect.Contains(Get_XMin(), Get_YMin())
902 && Rect.Contains(Get_XMax(), Get_YMax()) )
903 {
904 return( INTERSECTION_Contained );
905 }
906
907 return( INTERSECTION_Overlaps );
908 }
909
910 //---------------------------------------------------------
911 bool CSG_Rect::Contains(double x, double y) const
912 {
913 return( xMin <= x && x <= xMax && yMin <= y && y <= yMax );
914 }
915
916 bool CSG_Rect::Contains(const CSG_Point &Point) const
917 {
918 return( Contains(Point.x, Point.y) );
919 }
920
921
923 // //
925
926 //---------------------------------------------------------
927 CSG_Rects::CSG_Rects(void)
928 {
929 m_nRects = 0; m_Rects = NULL;
930 }
931
932 //---------------------------------------------------------
933 CSG_Rects::CSG_Rects(const CSG_Rects &Rects)
934 {
935 m_nRects = 0; m_Rects = NULL;
936
937 Assign(Rects);
938 }
939
940 //---------------------------------------------------------
941 CSG_Rects::~CSG_Rects(void)
942 {
943 Clear();
944 }
945
946 //---------------------------------------------------------
947 void CSG_Rects::Clear(void)
948 {
949 if( m_Rects )
950 {
951 for(int i=0; i<m_nRects; i++)
952 {
953 delete(m_Rects[i]);
954 }
955
956 SG_Free(m_Rects);
957 }
958
959 m_nRects = 0;
960 m_Rects = NULL;
961 }
962
963 //---------------------------------------------------------
964 bool CSG_Rects::Assign(const CSG_Rects &Rects)
965 {
966 Clear();
967
968 for(int i=0; i<Rects.m_nRects; i++)
969 {
970 Add(*Rects.m_Rects[i]);
971 }
972
973 return( true );
974 }
975
976 //---------------------------------------------------------
977 CSG_Rects & CSG_Rects::operator = (const CSG_Rects &Rects)
978 {
979 Assign(Rects);
980
981 return( *this );
982 }
983
984 //---------------------------------------------------------
985 bool CSG_Rects::Add(void)
986 {
987 return( Add(CSG_Rect()) );
988 }
989
990 //---------------------------------------------------------
991 bool CSG_Rects::Add(double xMin, double yMin, double xMax, double yMax)
992 {
993 return( Add(CSG_Rect(xMin, yMin, xMax, yMax)) );
994 }
995
996 //---------------------------------------------------------
997 bool CSG_Rects::Add(const CSG_Rect &Rect)
998 {
999 m_Rects = (CSG_Rect **)SG_Realloc(m_Rects, ((uLong)m_nRects + 1) * sizeof(CSG_Rect *));
1000 m_Rects[m_nRects] = new CSG_Rect(Rect);
1001 m_nRects++;
1002
1003 return( true );
1004 }
1005
1006
1008 // //
1009 // CSG_Rect_Int //
1010 // //
1012
1013 //---------------------------------------------------------
1014 CSG_Rect_Int::CSG_Rect_Int(void)
1015 {
1016 Assign(0, 0, 0, 0);
1017 }
1018
1019 CSG_Rect_Int::CSG_Rect_Int(const CSG_Rect_Int &Rect)
1020 {
1021 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1022 }
1023
1024 CSG_Rect_Int::CSG_Rect_Int(const TSG_Rect_Int &Rect)
1025 {
1026 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1027 }
1028
1029 CSG_Rect_Int::CSG_Rect_Int(const TSG_Point_Int &A, const TSG_Point_Int &B)
1030 {
1031 Assign(A.x, A.y, B.x, B.y);
1032 }
1033
1034 CSG_Rect_Int::CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax)
1035 {
1036 Assign(xMin, yMin, xMax, yMax);
1037 }
1038
1039 //---------------------------------------------------------
1040 CSG_Rect_Int::~CSG_Rect_Int(void)
1041 {}
1042
1043 //---------------------------------------------------------
1044 bool CSG_Rect_Int::operator == (const CSG_Rect_Int &Rect) const
1045 {
1046 return( is_Equal(Rect) );
1047 }
1048
1049 bool CSG_Rect_Int::operator != (const CSG_Rect_Int &Rect) const
1050 {
1051 return( !is_Equal(Rect) );
1052 }
1053
1054 CSG_Rect_Int & CSG_Rect_Int::operator = (const CSG_Rect_Int &Rect)
1055 {
1056 Assign(Rect);
1057
1058 return( *this );
1059 }
1060
1061 void CSG_Rect_Int::operator += (const TSG_Point_Int &Point)
1062 {
1063 Move( Point.x, Point.y);
1064 }
1065
1066 void CSG_Rect_Int::operator -= (const TSG_Point_Int &Point)
1067 {
1068 Move(-Point.y, -Point.y);
1069 }
1070
1071 //---------------------------------------------------------
1072 void CSG_Rect_Int::Assign(int xMin, int yMin, int xMax, int yMax)
1073 {
1074 if( xMin < xMax )
1075 {
1076 this->xMin = xMin;
1077 this->xMax = xMax;
1078 }
1079 else
1080 {
1081 this->xMin = xMax;
1082 this->xMax = xMin;
1083 }
1084
1085 if( yMin < yMax )
1086 {
1087 this->yMin = yMin;
1088 this->yMax = yMax;
1089 }
1090 else
1091 {
1092 this->yMin = yMax;
1093 this->yMax = yMin;
1094 }
1095 }
1096
1097 void CSG_Rect_Int::Assign(const TSG_Point_Int &A, const TSG_Point_Int &B)
1098 {
1099 Assign(A.x, A.y, B.x, B.y);
1100 }
1101
1102 void CSG_Rect_Int::Assign(const CSG_Rect_Int &Rect)
1103 {
1104 Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1105 }
1106
1107 //---------------------------------------------------------
1108 void CSG_Rect_Int::Set_BottomLeft(int x, int y)
1109 {
1110 Assign(x, y, xMax, yMax);
1111 }
1112
1113 void CSG_Rect_Int::Set_BottomLeft(const TSG_Point_Int &Point)
1114 {
1115 Set_BottomLeft(Point.x, Point.y );
1116 }
1117
1118 void CSG_Rect_Int::Set_TopRight(int x, int y)
1119 {
1120 Assign(xMin, yMin, x, y);
1121 }
1122
1123 void CSG_Rect_Int::Set_TopRight(const TSG_Point_Int &Point)
1124 {
1125 Set_TopRight(Point.x, Point.y );
1126 }
1127
1128 //---------------------------------------------------------
1129 bool CSG_Rect_Int::is_Equal(int xMin, int yMin, int xMax, int yMax) const
1130 {
1131 return( (this->xMin == xMin) && (this->yMin == yMin)
1132 && (this->xMax == xMax) && (this->yMax == yMax) );
1133 }
1134
1135 bool CSG_Rect_Int::is_Equal(const CSG_Rect_Int &Rect) const
1136 {
1137 return( is_Equal(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax) );
1138 }
1139
1140 //---------------------------------------------------------
1141 void CSG_Rect_Int::Move(int dx, int dy)
1142 {
1143 xMin += dx; yMin += dy;
1144 xMax += dx; yMax += dy;
1145 }
1146
1147 void CSG_Rect_Int::Move(const TSG_Point_Int &Point)
1148 {
1149 Move(Point.x, Point.y);
1150 }
1151
1152 //---------------------------------------------------------
1153 void CSG_Rect_Int::Inflate(int dx, int dy)
1154 {
1155 Assign(xMin - dx, yMin - dy, xMax + dx, yMax + dy);
1156 }
1157
1158 void CSG_Rect_Int::Inflate(int d)
1159 {
1160 Inflate(d, d);
1161 }
1162
1163 void CSG_Rect_Int::Deflate(int dx, int dy)
1164 {
1165 Inflate(-dx, -dy);
1166 }
1167
1168 void CSG_Rect_Int::Deflate(int d)
1169 {
1170 Deflate(d, d);
1171 }
1172
1173 //---------------------------------------------------------
1174 void CSG_Rect_Int::Union(int x, int y)
1175 {
1176 if( xMin > x ) { xMin = x; } else if( xMax < x ) { xMax = x; }
1177 if( yMin > y ) { yMin = y; } else if( yMax < y ) { yMax = y; }
1178 }
1179
1180 //---------------------------------------------------------
1181 void CSG_Rect_Int::Union(const TSG_Point_Int &Point)
1182 {
1183 if( xMin > Point.x ) { xMin = Point.x; } else if( xMax < Point.x ) { xMax = Point.x; }
1184 if( yMin > Point.y ) { yMin = Point.y; } else if( yMax < Point.y ) { yMax = Point.y; }
1185 }
1186
1187 //---------------------------------------------------------
1188 void CSG_Rect_Int::Union(const CSG_Rect_Int &Rect)
1189 {
1190 if( xMin > Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
1191 if( yMin > Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
1192 if( xMax < Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
1193 if( yMax < Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
1194 }
1195
1196 //---------------------------------------------------------
1197 bool CSG_Rect_Int::Intersect(const CSG_Rect_Int &Rect)
1198 {
1199 switch( Intersects(Rect) )
1200 {
1201 case INTERSECTION_None: default:
1202 return( false );
1203
1204 case INTERSECTION_Identical:
1205 case INTERSECTION_Contained:
1206 break;
1207
1208 case INTERSECTION_Contains:
1209 (*this) = Rect;
1210 break;
1211
1212 case INTERSECTION_Overlaps:
1213 if( xMin < Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
1214 if( yMin < Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
1215 if( xMax > Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
1216 if( yMax > Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
1217 break;
1218 }
1219
1220 return( true );
1221 }
1222
1223 //---------------------------------------------------------
1224 TSG_Intersection CSG_Rect_Int::Intersects(const CSG_Rect_Int &Rect) const
1225 {
1226 if( xMax < Rect.Get_XMin() || Rect.Get_XMax() < xMin
1227 || yMax < Rect.Get_YMin() || Rect.Get_YMax() < yMin )
1228 {
1229 return( INTERSECTION_None );
1230 }
1231
1232 if( is_Equal(Rect) )
1233 {
1234 return( INTERSECTION_Identical );
1235 }
1236
1237 if( Contains(Rect.Get_XMin(), Rect.Get_YMin())
1238 && Contains(Rect.Get_XMax(), Rect.Get_YMax()) )
1239 {
1240 return( INTERSECTION_Contains );
1241 }
1242
1243 if( Rect.Contains(Get_XMin(), Get_YMin())
1244 && Rect.Contains(Get_XMax(), Get_YMax()) )
1245 {
1246 return( INTERSECTION_Contained );
1247 }
1248
1249 return( INTERSECTION_Overlaps );
1250 }
1251
1252 //---------------------------------------------------------
1253 bool CSG_Rect_Int::Contains(double x, double y) const
1254 {
1255 return( xMin <= x && x <= xMax && yMin <= y && y <= yMax );
1256 }
1257
1258 bool CSG_Rect_Int::Contains(const TSG_Point_Int &Point) const
1259 {
1260 return( Contains(Point.x, Point.y) );
1261 }
1262
1263
1265 // //
1267
1268 //---------------------------------------------------------
1269 CSG_Rects_Int::CSG_Rects_Int(void)
1270 {
1271 m_nRects = 0;
1272 m_Rects = NULL;
1273 }
1274
1275 //---------------------------------------------------------
1276 CSG_Rects_Int::~CSG_Rects_Int(void)
1277 {
1278 Clear();
1279 }
1280
1281 //---------------------------------------------------------
1282 void CSG_Rects_Int::Clear(void)
1283 {
1284 if( m_Rects )
1285 {
1286 for(int i=0; i<m_nRects; i++)
1287 {
1288 delete(m_Rects[i]);
1289 }
1290
1291 SG_Free(m_Rects);
1292 }
1293
1294 m_nRects = 0;
1295 m_Rects = NULL;
1296 }
1297
1298 //---------------------------------------------------------
1299 bool CSG_Rects_Int::Assign(const CSG_Rects_Int &Rects)
1300 {
1301 Clear();
1302
1303 for(int i=0; i<Rects.m_nRects; i++)
1304 {
1305 Add(*Rects.m_Rects[i]);
1306 }
1307
1308 return( true );
1309 }
1310
1311 //---------------------------------------------------------
1312 CSG_Rects_Int & CSG_Rects_Int::operator = (const CSG_Rects_Int &Rects)
1313 {
1314 Assign(Rects);
1315
1316 return( *this );
1317 }
1318
1319 //---------------------------------------------------------
1320 bool CSG_Rects_Int::Add(void)
1321 {
1322 return( Add(CSG_Rect_Int()) );
1323 }
1324
1325 //---------------------------------------------------------
1326 bool CSG_Rects_Int::Add(int xMin, int yMin, int xMax, int yMax)
1327 {
1328 return( Add(CSG_Rect_Int(xMin, yMin, xMax, yMax)) );
1329 }
1330
1331 //---------------------------------------------------------
1332 bool CSG_Rects_Int::Add(const CSG_Rect_Int &Rect)
1333 {
1334 m_Rects = (CSG_Rect_Int **)SG_Realloc(m_Rects, ((uLong)m_nRects + 1) * sizeof(CSG_Rect_Int *));
1335 m_Rects[m_nRects] = new CSG_Rect_Int(Rect);
1336 m_nRects++;
1337
1338 return( true );
1339 }
1340
1341
1343 // //
1344 // //
1345 // //
1347
1348 //---------------------------------------------------------
1349 CSG_Distance_Weighting::CSG_Distance_Weighting(void)
1350 {
1351 m_Weighting = SG_DISTWGHT_None;
1352
1353 m_IDW_Power = 2.;
1354 m_IDW_bOffset = true;
1355
1356 m_Bandwidth = 1.;
1357 }
1358
1359 //---------------------------------------------------------
1360 CSG_Distance_Weighting::~CSG_Distance_Weighting(void)
1361 {}
1362
1363 //---------------------------------------------------------
1364 bool CSG_Distance_Weighting::Create_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, bool bIDW_Offset)
1365 {
1366 if( Add_Parameters(Parameters, Parent, bIDW_Offset) )
1367 {
1368 if( Parameters("DW_WEIGHTING" ) ) { Parameters("DW_WEIGHTING" )->Set_Value((int)m_Weighting ); }
1369 if( Parameters("DW_IDW_POWER" ) ) { Parameters("DW_IDW_POWER" )->Set_Value( m_IDW_Power ); }
1370 if( Parameters("DW_IDW_OFFSET") ) { Parameters("DW_IDW_OFFSET")->Set_Value( m_IDW_bOffset); }
1371 if( Parameters("DW_BANDWIDTH" ) ) { Parameters("DW_BANDWIDTH" )->Set_Value( m_Bandwidth ); }
1372
1373 return( true );
1374 }
1375
1376 return( false );
1377 }
1378
1379 //---------------------------------------------------------
1380 bool CSG_Distance_Weighting::Add_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, bool bIDW_Offset)
1381 {
1382 Parameters.Add_Choice(Parent,
1383 "DW_WEIGHTING" , _TL("Weighting Function"),
1384 _TL(""),
1385 CSG_String::Format("%s|%s|%s|%s",
1386 _TL("no distance weighting"),
1387 _TL("inverse distance to a power"),
1388 _TL("exponential"),
1389 _TL("gaussian")
1390 ), 0
1391 );
1392
1393 Parameters.Add_Double("DW_WEIGHTING",
1394 "DW_IDW_POWER" , _TL("Power"),
1395 _TL(""),
1396 2., 0., true
1397 );
1398
1399 if( bIDW_Offset )
1400 {
1401 Parameters.Add_Bool ("DW_WEIGHTING",
1402 "DW_IDW_OFFSET" , _TL("Offset"),
1403 _TL("Calculates weights for distance plus one, avoiding division by zero for zero distances"),
1404 true
1405 );
1406 }
1407
1408 Parameters.Add_Double("DW_WEIGHTING",
1409 "DW_BANDWIDTH" , _TL("Bandwidth"),
1410 _TL("Bandwidth for exponential and Gaussian weighting"),
1411 1., 0., true
1412 );
1413
1414 return( true );
1415 }
1416
1417 //---------------------------------------------------------
1418 bool CSG_Distance_Weighting::Enable_Parameters(CSG_Parameters &Parameters)
1419 {
1420 if( Parameters("DW_WEIGHTING") )
1421 {
1422 int Method = Parameters("DW_WEIGHTING")->asInt();
1423
1424 Parameters.Set_Enabled("DW_IDW_OFFSET", Method == 1);
1425 Parameters.Set_Enabled("DW_IDW_POWER" , Method == 1);
1426 Parameters.Set_Enabled("DW_BANDWIDTH" , Method >= 2);
1427 }
1428
1429 return( true );
1430 }
1431
1432 //---------------------------------------------------------
1433 bool CSG_Distance_Weighting::Set_Parameters(CSG_Parameters &Parameters)
1434 {
1435 if( Parameters("DW_WEIGHTING") )
1436 {
1437 switch( Parameters("DW_WEIGHTING")->asInt() )
1438 {
1439 case 0: Set_Weighting(SG_DISTWGHT_None ); break;
1440 case 1: Set_Weighting(SG_DISTWGHT_IDW ); break;
1441 case 2: Set_Weighting(SG_DISTWGHT_EXP ); break;
1442 case 3: Set_Weighting(SG_DISTWGHT_GAUSS); break;
1443 }
1444 }
1445
1446 if( Parameters("DW_IDW_OFFSET") )
1447 {
1448 Set_IDW_Offset(Parameters("DW_IDW_OFFSET")->asBool ());
1449 }
1450
1451 if( Parameters("DW_IDW_POWER" ) )
1452 {
1453 Set_IDW_Power (Parameters("DW_IDW_POWER" )->asDouble());
1454 }
1455
1456 if( Parameters("DW_BANDWIDTH" ) )
1457 {
1458 Set_BandWidth (Parameters("DW_BANDWIDTH" )->asDouble());
1459 }
1460
1461 return( true );
1462 }
1463
1464
1466 // //
1468
1469 //---------------------------------------------------------
1470 bool CSG_Distance_Weighting::Set_Weighting(TSG_Distance_Weighting Weighting)
1471 {
1472 m_Weighting = Weighting;
1473
1474 return( true );
1475 }
1476
1477 //---------------------------------------------------------
1478 bool CSG_Distance_Weighting::Set_IDW_Power(double Value)
1479 {
1480 if( Value <= 0. )
1481 {
1482 return( false );
1483 }
1484
1485 m_IDW_Power = Value;
1486
1487 return( true );
1488 }
1489
1490 //---------------------------------------------------------
1491 bool CSG_Distance_Weighting::Set_IDW_Offset(bool bOn)
1492 {
1493 m_IDW_bOffset = bOn;
1494
1495 return( true );
1496 }
1497
1498 //---------------------------------------------------------
1499 bool CSG_Distance_Weighting::Set_BandWidth(double Value)
1500 {
1501 if( Value <= 0. )
1502 {
1503 return( false );
1504 }
1505
1506 m_Bandwidth = Value;
1507
1508 return( true );
1509 }
1510
1511
1513 // //
1514 // //
1515 // //
1517
1518 //---------------------------------------------------------
CSG_Rects_Int::CSG_Rects_Int
CSG_Rects_Int(void)
Definition: geo_classes.cpp:1269
CSG_Rect
Definition: geo_tools.h:471
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_Points::Add
bool Add(double x, double y)
Definition: geo_classes.cpp:350
CSG_Rect_Int::Get_XMin
int Get_XMin(void) const
Definition: geo_tools.h:612
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:320
CSG_Rect_Int::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:1253
CSG_Point_3D::Add
virtual void Add(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:177
SSG_Rect_Int::yMax
int yMax
Definition: geo_tools.h:577
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Rects_Int::Assign
bool Assign(const CSG_Rects_Int &Rects)
Definition: geo_classes.cpp:1299
CSG_Rects
Definition: geo_tools.h:540
CSG_Rect::operator!=
bool operator!=(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:698
CSG_Lines::Create
bool Create(const CSG_Lines &Lines)
Definition: geo_classes.cpp:385
CSG_Rect_Int::Get_YMin
int Get_YMin(void) const
Definition: geo_tools.h:614
CSG_Points_3D::CSG_Points_3D
CSG_Points_3D(void)
Definition: geo_classes.cpp:548
_TL
#define _TL(s)
Definition: api_core.h:1480
TSG_Distance_Weighting
TSG_Distance_Weighting
Definition: geo_tools.h:685
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Distance_Weighting::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1418
CSG_Points_3D::Add
bool Add(double x, double y, double z)
Definition: geo_classes.cpp:582
SSG_Rect_Int::yMin
int yMin
Definition: geo_tools.h:577
CSG_Points_Int::Add
bool Add(int x, int y)
Definition: geo_classes.cpp:640
CSG_Point_3D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:213
CSG_Point_3D::Subtract
virtual void Subtract(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:184
CSG_Rect_Int::Get_XMax
int Get_XMax(void) const
Definition: geo_tools.h:613
SG_DISTWGHT_EXP
@ SG_DISTWGHT_EXP
Definition: geo_tools.h:688
A
#define A
CSG_Point::Subtract
virtual void Subtract(const CSG_Point &Point)
Definition: geo_classes.cpp:105
CSG_Points_Int
Definition: geo_tools.h:425
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_Rects::~CSG_Rects
virtual ~CSG_Rects(void)
Definition: geo_classes.cpp:941
CSG_Rect::~CSG_Rect
~CSG_Rect(void)
Definition: geo_classes.cpp:689
CSG_Rect_Int::operator=
CSG_Rect_Int & operator=(const CSG_Rect_Int &Rect)
Definition: geo_classes.cpp:1054
CSG_Point::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:130
SG_DISTWGHT_GAUSS
@ SG_DISTWGHT_GAUSS
Definition: geo_tools.h:689
CSG_Point::Multiply
virtual void Multiply(const CSG_Point &Point)
Definition: geo_classes.cpp:111
CSG_Distance_Weighting::Set_IDW_Power
bool Set_IDW_Power(double Value)
Definition: geo_classes.cpp:1478
CSG_Rect_Int::Set_BottomLeft
void Set_BottomLeft(int x, int y)
Definition: geo_classes.cpp:1108
CSG_Point::Add
virtual void Add(const CSG_Point &Point)
Definition: geo_classes.cpp:99
CSG_Rect_Int::Union
void Union(int x, int y)
Definition: geo_classes.cpp:1174
CSG_Rect_Int::Set_TopRight
void Set_TopRight(int x, int y)
Definition: geo_classes.cpp:1118
SSG_Point_4D
Definition: geo_tools.h:357
SSG_Point_3D
Definition: geo_tools.h:264
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_Lines::Destroy
bool Destroy(void)
Definition: geo_classes.cpp:409
SSG_Rect_Int
Definition: geo_tools.h:576
CSG_Lines::~CSG_Lines
virtual ~CSG_Lines(void)
Definition: geo_classes.cpp:403
CSG_Lines::Del
bool Del(sLong Index)
Definition: geo_classes.cpp:464
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
CSG_Lines::Set_Count
bool Set_Count(sLong nLines)
Definition: geo_classes.cpp:477
CSG_Rects::Clear
void Clear(void)
Definition: geo_classes.cpp:947
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Rects_Int::~CSG_Rects_Int
virtual ~CSG_Rects_Int(void)
Definition: geo_classes.cpp:1276
CSG_Rect::operator+=
void operator+=(const CSG_Point &Point)
Definition: geo_classes.cpp:710
CSG_Rect_Int::Deflate
void Deflate(int d)
Definition: geo_classes.cpp:1168
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Point::CSG_Point
CSG_Point(void)
Definition: geo_classes.cpp:65
SSG_Point
Definition: geo_tools.h:128
CSG_Distance_Weighting::CSG_Distance_Weighting
CSG_Distance_Weighting(void)
Definition: geo_classes.cpp:1349
CSG_Array_Pointer::Create
void ** Create(const CSG_Array_Pointer &Array)
Definition: api_memory.cpp:469
CSG_Rects_Int::Add
bool Add(void)
Definition: geo_classes.cpp:1320
CSG_Distance_Weighting::Set_Parameters
bool Set_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1433
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
SSG_Rect
Definition: geo_tools.h:464
CSG_Rect::Intersect
bool Intersect(const CSG_Rect &Rect)
Definition: geo_classes.cpp:855
CSG_Point_4D::Assign
virtual void Assign(double x, double y, double z, double m)
Definition: geo_classes.cpp:245
CSG_Rect_Int
Definition: geo_tools.h:583
SG_DISTWGHT_IDW
@ SG_DISTWGHT_IDW
Definition: geo_tools.h:687
CSG_Rect::Deflate
void Deflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:826
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Point
Definition: geo_tools.h:135
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Point_4D::Add
virtual void Add(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:262
CSG_Point_4D::Subtract
virtual void Subtract(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:270
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Rects_Int::operator=
CSG_Rects_Int & operator=(const CSG_Rects_Int &Rects)
Definition: geo_classes.cpp:1312
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Rect::operator-=
void operator-=(const CSG_Point &Point)
Definition: geo_classes.cpp:715
CSG_Rect::operator==
bool operator==(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:693
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Rects_Int::Clear
void Clear(void)
Definition: geo_classes.cpp:1282
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Rect_Int::is_Equal
bool is_Equal(int xMin, int yMin, int xMax, int yMax) const
Definition: geo_classes.cpp:1129
CSG_Rect::Set_BottomLeft
void Set_BottomLeft(double x, double y)
Definition: geo_classes.cpp:757
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_Point_4D
Definition: geo_tools.h:364
CSG_Point_4D::CSG_Point_4D
CSG_Point_4D(void)
Definition: geo_classes.cpp:224
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Distance_Weighting::Create_Parameters
bool Create_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1364
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Point::Assign
virtual void Assign(double x, double y)
Definition: geo_classes.cpp:86
CSG_Point_4D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:303
SSG_Rect_Int::xMax
int xMax
Definition: geo_tools.h:577
CSG_Point_3D::Assign
virtual void Assign(double x, double y, double z)
Definition: geo_classes.cpp:162
CSG_Rects::CSG_Rects
CSG_Rects(void)
Definition: geo_classes.cpp:927
SSG_Rect_Int::xMin
int xMin
Definition: geo_tools.h:577
CSG_Distance_Weighting::Set_Weighting
bool Set_Weighting(TSG_Distance_Weighting Weighting)
Definition: geo_classes.cpp:1470
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
CSG_Rects::Assign
bool Assign(const CSG_Rects &Rects)
Definition: geo_classes.cpp:964
CSG_Rect_Int::Intersect
bool Intersect(const CSG_Rect_Int &Rect)
Definition: geo_classes.cpp:1197
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Distance_Weighting::Set_IDW_Offset
bool Set_IDW_Offset(bool bOn=true)
Definition: geo_classes.cpp:1491
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:239
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Rect_Int::~CSG_Rect_Int
~CSG_Rect_Int(void)
Definition: geo_classes.cpp:1040
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Lines::Add
CSG_Points & Add(void)
Definition: geo_classes.cpp:437
CSG_Point_3D::CSG_Point_3D
CSG_Point_3D(void)
Definition: geo_classes.cpp:141
SG_Is_Equal
bool SG_Is_Equal(double a, double b, double epsilon)
Definition: geo_functions.cpp:64
CSG_Points
Definition: geo_tools.h:184
parameters.h
CSG_Lines::Assign
bool Assign(const CSG_Lines &Lines)
Definition: geo_classes.cpp:421
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Points::CSG_Points
CSG_Points(void)
Definition: geo_classes.cpp:316
CSG_Lines::CSG_Lines
CSG_Lines(void)
Definition: geo_classes.cpp:373
CSG_Rect::CSG_Rect
CSG_Rect(void)
Definition: geo_classes.cpp:663
CSG_Points_Int::CSG_Points_Int
CSG_Points_Int(void)
Definition: geo_classes.cpp:606
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Point::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:123
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
B
#define B
CSG_String
Definition: api_core.h:557
CSG_Point_3D::Multiply
virtual void Multiply(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:191
CSG_Rect::is_Equal
bool is_Equal(double xMin, double yMin, double xMax, double yMax, double epsilon=0.) const
Definition: geo_classes.cpp:778
CSG_Rect::Move
void Move(double dx, double dy)
Definition: geo_classes.cpp:790
CSG_Rects::Add
bool Add(void)
Definition: geo_classes.cpp:985
CSG_Rect::operator=
CSG_Rect & operator=(const CSG_Rect &Rect)
Definition: geo_classes.cpp:703
SSG_Point_Int
Definition: geo_tools.h:418
CSG_Distance_Weighting::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1380
CSG_Points_Int::Assign
bool Assign(const CSG_Points_Int &Points)
Definition: geo_classes.cpp:624
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_Rect_Int::operator!=
bool operator!=(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1049
CSG_Rect_Int::operator==
bool operator==(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1044
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
CSG_Lines::Get_Length
double Get_Length(void) const
Definition: geo_classes.cpp:508
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect_Int::Get_YMax
int Get_YMax(void) const
Definition: geo_tools.h:615
CSG_Rects_Int
Definition: geo_tools.h:648
CSG_Point_4D::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:294
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_Rect_Int::operator-=
void operator-=(const TSG_Point_Int &Point)
Definition: geo_classes.cpp:1066
SSG_Point_Int::y
int y
Definition: geo_tools.h:419
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Rect::Set_TopRight
void Set_TopRight(double x, double y)
Definition: geo_classes.cpp:767
CSG_Lines::Clear
bool Clear(void)
Definition: geo_classes.cpp:415
CSG_Rect_Int::CSG_Rect_Int
CSG_Rect_Int(void)
Definition: geo_classes.cpp:1014
CSG_Rect_Int::Assign
void Assign(int xMin, int yMin, int xMax, int yMax)
Definition: geo_classes.cpp:1072
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Rect_Int::Move
void Move(int dx, int dy)
Definition: geo_classes.cpp:1141
CSG_Lines::Get_Line
CSG_Points & Get_Line(sLong Index)
Definition: geo_tools.h:241
CSG_Point_4D::Multiply
virtual void Multiply(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:278
CSG_Point_3D::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:205
CSG_Points_3D::Assign
bool Assign(const CSG_Points_3D &Points)
Definition: geo_classes.cpp:566
CSG_Lines
Definition: geo_tools.h:216
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Parameters
Definition: parameters.h:1650
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Rect_Int::Inflate
void Inflate(int d)
Definition: geo_classes.cpp:1158
CSG_Rect_Int::operator+=
void operator+=(const TSG_Point_Int &Point)
Definition: geo_classes.cpp:1061
CSG_Distance_Weighting::~CSG_Distance_Weighting
virtual ~CSG_Distance_Weighting(void)
Definition: geo_classes.cpp:1360
SSG_Point_Int::x
int x
Definition: geo_tools.h:419
SG_DISTWGHT_None
@ SG_DISTWGHT_None
Definition: geo_tools.h:686
CSG_Rect_Int::Intersects
TSG_Intersection Intersects(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1224
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Points::Assign
bool Assign(const CSG_Points &Points)
Definition: geo_classes.cpp:334
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
geo_tools.h
CSG_Rects::operator=
CSG_Rects & operator=(const CSG_Rects &Rects)
Definition: geo_classes.cpp:977
CSG_Distance_Weighting::Set_BandWidth
bool Set_BandWidth(double Value)
Definition: geo_classes.cpp:1499
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: geo_functions.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
geo_functions.cpp File Reference
#include "geo_tools.h"
#include "mat_tools.h"

Go to the source code of this file.

Macros

#define | A Triangle[0]
#define | B Triangle[1]
#define | C Triangle[2]

Functions

bool | SG_Is_Equal (double a, double b, double epsilon)
bool | SG_Is_Equal (const TSG_Point &A, const TSG_Point &B, double epsilon)
bool | SG_Is_Between (double x, double a, double b, double epsilon)
bool | SG_Is_Between (const TSG_Point &Point, const TSG_Point &Corner_A, const TSG_Point &Corner_B, double epsilon)
double | SG_Get_Length (double dx, double dy)
double | SG_Get_Distance (double ax, double ay, double bx, double by, bool bPolar)
double | SG_Get_Distance (const TSG_Point &A, const TSG_Point &B, bool bPolar)
double | SG_Get_Distance (double ax, double ay, double bx, double by)
double | SG_Get_Distance (const TSG_Point &A, const TSG_Point &B)
double | SG_Get_Distance (double ax, double ay, double az, double bx, double by, double bz)
double | SG_Get_Distance (const TSG_Point_3D &A, const TSG_Point_3D &B)
double | SG_Get_Distance_Polar (double aLon, double aLat, double bLon, double bLat, double a, double e, bool bDegree)
double | SG_Get_Distance_Polar (const TSG_Point &A, const TSG_Point &B, double a, double e, bool bDegree)
double | SG_Get_Angle_Of_Direction (double dx, double dy)
double | SG_Get_Angle_Of_Direction (double ax, double ay, double bx, double by)
double | SG_Get_Angle_Of_Direction (const TSG_Point &A)
double | SG_Get_Angle_Of_Direction (const TSG_Point &A, const TSG_Point &B)
double | SG_Get_Angle_Difference (double a, double b)
bool | SG_is_Angle_Between (double Angle, double Angle_Min, double Angle_Max, bool bCheckRange)
bool | SG_Get_Crossing (TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
bool | SG_Get_Crossing_InRegion (TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
bool | SG_Is_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch, double Epsilon)
double | SG_Get_Distance_To_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch)
double | SG_Get_Nearest_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch)
bool | SG_Get_Triangle_CircumCircle (TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
double | SG_Get_Polygon_Area (TSG_Point *Points, int nPoints)
double | SG_Get_Polygon_Area (const CSG_Points &Points)

Macro Definition Documentation

◆ A

#define A Triangle[0]

◆ B

#define B Triangle[1]

◆ C

#define C Triangle[2]

Function Documentation

◆ SG_Get_Angle_Difference()

double SG_Get_Angle_Difference | ( | double | a,
 |  | double | b
 | ) |  |

Definition at line 247 of file geo_functions.cpp.

References M_PI_180, and M_PI_360.

◆ SG_Get_Angle_Of_Direction() [1/4]

double SG_Get_Angle_Of_Direction ( const TSG_Point & A )

Definition at line 235 of file geo_functions.cpp.

References A, and SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [2/4]

double SG_Get_Angle_Of_Direction | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B
 | ) |  |

Definition at line 241 of file geo_functions.cpp.

References A, B, and SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [3/4]

double SG_Get_Angle_Of_Direction | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by
 | ) |  |

Definition at line 229 of file geo_functions.cpp.

References SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [4/4]

double SG_Get_Angle_Of_Direction | ( | double | dx,
 |  | double | dy
 | ) |  |

Definition at line 216 of file geo_functions.cpp.

References M_PI_090, M_PI_180, and M_PI_360.

Referenced by SG_Get_Angle_Of_Direction().

◆ SG_Get_Crossing()

bool SG_Get_Crossing | ( | TSG_Point & | Crossing,
 |  | const TSG_Point & | a1,
 |  | const TSG_Point & | a2,
 |  | const TSG_Point & | b1,
 |  | const TSG_Point & | b2,
 |  | bool | bExactMatch
 | ) |  |

Definition at line 280 of file geo_functions.cpp.

References M_GET_MAX, M_GET_MIN, SSG_Point::x, and SSG_Point::y.

Referenced by CSG_TIN_Triangle::is_Containing(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Get_Crossing_InRegion(), SG_Get_Nearest_Point_On_Line(), and SG_Get_Triangle_CircumCircle().

◆ SG_Get_Crossing_InRegion()

bool SG_Get_Crossing_InRegion | ( | TSG_Point & | Crossing,
 |  | const TSG_Point & | a,
 |  | const TSG_Point & | b,
 |  | const TSG_Rect & | Region
 | ) |  |

Definition at line 342 of file geo_functions.cpp.

References SG_Get_Crossing(), SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ SG_Get_Distance() [1/6]

double SG_Get_Distance | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B
 | ) |  |

Definition at line 124 of file geo_functions.cpp.

References A, and B.

◆ SG_Get_Distance() [2/6]

double SG_Get_Distance | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | bool | bPolar
 | ) |  |

Definition at line 109 of file geo_functions.cpp.

References A, B, SG_Get_Distance(), and SG_Get_Distance_Polar().

◆ SG_Get_Distance() [3/6]

double SG_Get_Distance | ( | const TSG_Point_3D & | A,
 |  | const TSG_Point_3D & | B
 | ) |  |

Definition at line 145 of file geo_functions.cpp.

References A, and B.

◆ SG_Get_Distance() [4/6]

double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | az,
 |  | double | bx,
 |  | double | by,
 |  | double | bz
 | ) |  |

Definition at line 135 of file geo_functions.cpp.

◆ SG_Get_Distance() [5/6]

double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by
 | ) |  |

Definition at line 115 of file geo_functions.cpp.

◆ SG_Get_Distance() [6/6]

double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by,
 |  | bool | bPolar
 | ) |  |

Definition at line 103 of file geo_functions.cpp.

References SG_Get_Distance(), and SG_Get_Distance_Polar().

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_Shape_Point::Get_Distance(), CSG_Shape_Points::Get_Distance(), CSG_Shape_Line::Get_Length(), CSG_Lines::Get_Length(), CSG_PointCloud::Get_Shape(), SG_Get_Distance(), and SG_Get_Nearest_Point_On_Line().

◆ SG_Get_Distance_Polar() [1/2]

double SG_Get_Distance_Polar | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | double | a,
 |  | double | e,
 |  | bool | bDegree
 | ) |  |

Definition at line 203 of file geo_functions.cpp.

References A, B, and SG_Get_Distance_Polar().

◆ SG_Get_Distance_Polar() [2/2]

double SG_Get_Distance_Polar | ( | double | aLon,
 |  | double | aLat,
 |  | double | bLon,
 |  | double | bLat,
 |  | double | a,
 |  | double | e,
 |  | bool | bDegree
 | ) |  |

Definition at line 157 of file geo_functions.cpp.

References C, M_DEG_TO_RAD, and SG_Get_Square().

Referenced by SG_Get_Distance(), and SG_Get_Distance_Polar().

◆ SG_Get_Distance_To_Line()

double SG_Get_Distance_To_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | bool | bExactMatch
 | ) |  |

Definition at line 413 of file geo_functions.cpp.

References SG_Get_Nearest_Point_On_Line().

◆ SG_Get_Length()

double SG_Get_Length | ( | double | dx,
 |  | double | dy
 | ) |  |

Definition at line 97 of file geo_functions.cpp.

◆ SG_Get_Nearest_Point_On_Line()

double SG_Get_Nearest_Point_On_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | TSG_Point & | Line_Point,
 |  | bool | bExactMatch
 | ) |  |

Definition at line 421 of file geo_functions.cpp.

References SG_Get_Crossing(), SG_Get_Distance(), SG_IS_BETWEEN, SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon_Part::Get_Distance(), CSG_Shape_Line::Get_Distance(), and SG_Get_Distance_To_Line().

◆ SG_Get_Polygon_Area() [1/2]

double SG_Get_Polygon_Area ( const CSG_Points & Points )

Definition at line 534 of file geo_functions.cpp.

References CSG_Points::Get_Count().

◆ SG_Get_Polygon_Area() [2/2]

double SG_Get_Polygon_Area | ( | TSG_Point * | Points,
 |  | int | nPoints
 | ) |  |

Definition at line 514 of file geo_functions.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by CSG_TIN_Node::Get_Polygon_Area().

◆ SG_Get_Triangle_CircumCircle()

bool SG_Get_Triangle_CircumCircle | ( | TSG_Point | Triangle[3],
 |  | TSG_Point & | Point,
 |  | double & | Radius
 | ) |  |

Definition at line 465 of file geo_functions.cpp.

References A, B, C, SG_Get_Crossing(), SSG_Point::x, and SSG_Point::y.

◆ SG_is_Angle_Between()

bool SG_is_Angle_Between | ( | double | Angle,
 |  | double | Angle_Min,
 |  | double | Angle_Max,
 |  | bool | bCheckRange
 | ) |  |

Definition at line 257 of file geo_functions.cpp.

References M_PI_360.

◆ SG_Is_Between() [1/2]

bool SG_Is_Between | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Corner_A,
 |  | const TSG_Point & | Corner_B,
 |  | double | epsilon
 | ) |  |

Definition at line 83 of file geo_functions.cpp.

References SG_Is_Between(), SSG_Point::x, and SSG_Point::y.

◆ SG_Is_Between() [2/2]

bool SG_Is_Between | ( | double | x,
 |  | double | a,
 |  | double | b,
 |  | double | epsilon
 | ) |  |

Definition at line 77 of file geo_functions.cpp.

Referenced by SG_Is_Between(), and SG_Is_Point_On_Line().

◆ SG_Is_Equal() [1/2]

bool SG_Is_Equal | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | double | epsilon
 | ) |  |

Definition at line 70 of file geo_functions.cpp.

References A, B, and SG_Is_Equal().

◆ SG_Is_Equal() [2/2]

bool SG_Is_Equal | ( | double | a,
 |  | double | b,
 |  | double | epsilon
 | ) |  |

Definition at line 64 of file geo_functions.cpp.

Referenced by CSG_Rect::is_Equal(), SG_Is_Equal(), and SG_Is_Point_On_Line().

◆ SG_Is_Point_On_Line()

bool SG_Is_Point_On_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | bool | bExactMatch,
 |  | double | Epsilon
 | ) |  |

Definition at line 394 of file geo_functions.cpp.

References SG_Is_Between(), SG_Is_Equal(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), and CSG_Shape_Polygon_Part::_is_OnEdge().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: geo_functions.cpp Source File

  • saga_core
  • saga_api
geo_functions.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // geo_functions.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "geo_tools.h"
54 #include "mat_tools.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 bool SG_Is_Equal(double a, double b, double epsilon)
65 {
66 return( fabs(a - b) <= epsilon );
67 }
68
69 //---------------------------------------------------------
70 bool SG_Is_Equal(const TSG_Point &A, const TSG_Point &B, double epsilon)
71 {
72 return( SG_Is_Equal(A.x, B.x, epsilon)
73 && SG_Is_Equal(A.y, B.y, epsilon) );
74 }
75
76 //---------------------------------------------------------
77 bool SG_Is_Between(double x, double a, double b, double epsilon)
78 {
79 return( (a - epsilon <= x && x <= b + epsilon)
80 || (b - epsilon <= x && x <= a + epsilon) );
81 }
82
83 bool SG_Is_Between(const TSG_Point &Point, const TSG_Point &Corner_A, const TSG_Point &Corner_B, double epsilon)
84 {
85 return( SG_Is_Between(Point.x, Corner_A.x, Corner_B.x, epsilon)
86 && SG_Is_Between(Point.y, Corner_A.y, Corner_B.y, epsilon) );
87 }
88
89
91 // //
92 // //
93 // //
95
96 //---------------------------------------------------------
97 double SG_Get_Length(double dx, double dy)
98 {
99 return( sqrt(dx*dx + dy*dy) );
100 }
101
102 //---------------------------------------------------------
103 double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
104 {
105 return( bPolar ? SG_Get_Distance_Polar(ax, ay, bx, by) : SG_Get_Distance(ax, ay, bx, by) );
106 }
107
108 //---------------------------------------------------------
109 double SG_Get_Distance(const TSG_Point &A, const TSG_Point &B, bool bPolar)
110 {
111 return( bPolar ? SG_Get_Distance_Polar(A, B) : SG_Get_Distance(A, B) );
112 }
113
114 //---------------------------------------------------------
115 double SG_Get_Distance(double ax, double ay, double bx, double by)
116 {
117 ax -= bx;
118 ay -= by;
119
120 return( sqrt(ax*ax + ay*ay) );
121 }
122
123 //---------------------------------------------------------
124 double SG_Get_Distance(const TSG_Point &A, const TSG_Point &B)
125 {
126 double dx, dy;
127
128 dx = B.x - A.x;
129 dy = B.y - A.y;
130
131 return( sqrt(dx*dx + dy*dy) );
132 }
133
134 //---------------------------------------------------------
135 double SG_Get_Distance(double ax, double ay, double az, double bx, double by, double bz)
136 {
137 ax -= bx;
138 ay -= by;
139 az -= bz;
140
141 return( sqrt(ax*ax + ay*ay + az*az) );
142 }
143
144 //---------------------------------------------------------
145 double SG_Get_Distance(const TSG_Point_3D &A, const TSG_Point_3D &B)
146 {
147 double dx, dy, dz;
148
149 dx = B.x - A.x;
150 dy = B.y - A.y;
151 dz = B.z - A.z;
152
153 return( sqrt(dx*dx + dy*dy + dz*dz) );
154 }
155
156 //---------------------------------------------------------
157 double SG_Get_Distance_Polar(double aLon, double aLat, double bLon, double bLat, double a, double e, bool bDegree)
158 {
159 if( bDegree )
160 {
161 aLon *= M_DEG_TO_RAD;
162 aLat *= M_DEG_TO_RAD;
163 bLon *= M_DEG_TO_RAD;
164 bLat *= M_DEG_TO_RAD;
165 }
166
167 if( e <= 0. )
168 {
169 return( a * acos(sin(aLat) * sin(bLat) + cos(aLat) * cos(bLat) * cos(bLon - aLon)) );
170 }
171 else
172 {
173 double F = (aLat + bLat) / 2.;
174 double G = (aLat - bLat) / 2.;
175 double l = (aLon - bLon) / 2.;
176
177 double sin2_F = SG_Get_Square(sin(F));
178 double cos2_F = SG_Get_Square(cos(F));
179 double sin2_G = SG_Get_Square(sin(G));
180 double cos2_G = SG_Get_Square(cos(G));
181 double sin2_l = SG_Get_Square(sin(l));
182 double cos2_l = SG_Get_Square(cos(l));
183
184 double S = sin2_G * cos2_l + cos2_F * sin2_l;
185 double C = cos2_G * cos2_l + sin2_F * sin2_l;
186
187 double w = atan(sqrt(S / C));
188 double D = 2. * w * a;
189
190 double R = sqrt(S * C) / w;
191 double H1 = (3. * R - 1.) / (2. * C);
192 double H2 = (3. * R + 1.) / (2. * S);
193
194 double f = 1. / e;
195
196 double d = D * (1. + f * H1 * sin2_F * cos2_G - f * H2 * cos2_F * sin2_G);
197
198 return( d );
199 }
200 }
201
202 //---------------------------------------------------------
203 double SG_Get_Distance_Polar(const TSG_Point &A, const TSG_Point &B, double a, double e, bool bDegree)
204 {
205 return( SG_Get_Distance_Polar(A.x, A.y, B.x, B.y, a, e, bDegree) );
206 }
207
208
210 // //
211 // //
212 // //
214
215 //---------------------------------------------------------
216 double SG_Get_Angle_Of_Direction(double dx, double dy)
217 {
218 if( dx == 0. )
219 {
220 return( dy > 0. ? 0. : dy < 0. ? M_PI_180 : -M_PI_360 );
221 }
222
223 dx = M_PI_090 - atan2(dy, dx);
224
225 return( dx < 0. ? M_PI_360 + dx : dx );
226 }
227
228 //---------------------------------------------------------
229 double SG_Get_Angle_Of_Direction(double ax, double ay, double bx, double by)
230 {
231 return( SG_Get_Angle_Of_Direction(bx - ax, by - ay) );
232 }
233
234 //---------------------------------------------------------
235 double SG_Get_Angle_Of_Direction(const TSG_Point &A)
236 {
237 return( SG_Get_Angle_Of_Direction(A.x, A.y) );
238 }
239
240 //---------------------------------------------------------
241 double SG_Get_Angle_Of_Direction(const TSG_Point &A, const TSG_Point &B)
242 {
243 return( SG_Get_Angle_Of_Direction(B.x - A.x, B.y - A.y) );
244 }
245
246 //---------------------------------------------------------
247 double SG_Get_Angle_Difference(double a, double b)
248 {
249 double d = fmod(b - a, M_PI_360);
250
251 if( d < 0. ) d += M_PI_360;
252
253 return( d > M_PI_180 ? d - M_PI_180 : d );
254 }
255
256 //---------------------------------------------------------
257 bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange)
258 {
259 if( bCheckRange )
260 {
261 Angle = fmod(Angle , M_PI_360); if( Angle < 0. ) Angle += M_PI_360;
262 Angle_Min = fmod(Angle_Min, M_PI_360); if( Angle_Min < 0. ) Angle_Min += M_PI_360;
263 Angle_Max = fmod(Angle_Max, M_PI_360); if( Angle_Max < 0. ) Angle_Max += M_PI_360;
264 }
265
266 return( Angle_Min <= Angle_Max
267 ? Angle_Min <= Angle && Angle <= Angle_Max
268 : Angle_Min <= Angle || Angle <= Angle_Max
269 );
270 }
271
272
274 // //
275 // //
276 // //
278
279 //---------------------------------------------------------
280 bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
281 {
282 //-----------------------------------------------------
283 if( bExactMatch
284 && ( (M_GET_MAX(a1.x, a2.x) < M_GET_MIN(b1.x, b2.x))
285 || (M_GET_MIN(a1.x, a2.x) > M_GET_MAX(b1.x, b2.x))
286 || (M_GET_MAX(a1.y, a2.y) < M_GET_MIN(b1.y, b2.y))
287 || (M_GET_MIN(a1.y, a2.y) > M_GET_MAX(b1.y, b2.y)) ) )
288 {
289 return( false );
290 }
291
292 //-----------------------------------------------------
293 if( (a1.x == b1.x && a1.y == b1.y) || (a1.x == b2.x && a1.y == b2.y) )
294 {
295 Crossing = a1;
296
297 return( true );
298 }
299
300 if( (a2.x == b1.x && a2.y == b1.y) || (a2.x == b2.x && a2.y == b2.y) )
301 {
302 Crossing = a2;
303
304 return( true );
305 }
306
307 //-----------------------------------------------------
308 double lambda, div, a_dx, a_dy, b_dx, b_dy;
309
310 a_dx = a2.x - a1.x;
311 a_dy = a2.y - a1.y;
312
313 b_dx = b2.x - b1.x;
314 b_dy = b2.y - b1.y;
315
316 if( (div = a_dx * b_dy - b_dx * a_dy) != 0. )
317 {
318 lambda = ((b1.x - a1.x) * b_dy - b_dx * (b1.y - a1.y)) / div;
319
320 Crossing.x = a1.x + lambda * a_dx;
321 Crossing.y = a1.y + lambda * a_dy;
322
323 if( !bExactMatch )
324 {
325 return( true );
326 }
327 else if( 0. <= lambda && lambda <= 1. )
328 {
329 lambda = ((b1.x - a1.x) * a_dy - a_dx * (b1.y - a1.y)) / div;
330
331 if( 0. <= lambda && lambda <= 1. )
332 {
333 return( true );
334 }
335 }
336 }
337
338 return( false );
339 }
340
341 //---------------------------------------------------------
342 bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
343 {
344 TSG_Point ra, rb;
345
346 //-----------------------------------------------------
347 ra.y = Region.yMin;
348 rb.y = Region.yMax;
349
350 ra.x = rb.x = Region.xMin;
351
352 if( SG_Get_Crossing(Crossing, a, b, ra, rb, true) )
353 {
354 return( true );
355 }
356
357 //-----------------------------------------------------
358 ra.x = rb.x = Region.xMax;
359
360 if( SG_Get_Crossing(Crossing, a, b, ra, rb, true) )
361 {
362 return( true );
363 }
364
365 //-----------------------------------------------------
366 ra.x = Region.xMin;
367 ra.y = Region.yMax;
368
369 if( SG_Get_Crossing(Crossing, a, b, ra, rb, true) )
370 {
371 return( true );
372 }
373
374 //-----------------------------------------------------
375 ra.y = rb.y = Region.yMin;
376
377 if( SG_Get_Crossing(Crossing, a, b, ra, rb, true) )
378 {
379 return( true );
380 }
381
382 //-----------------------------------------------------
383 return( false );
384 }
385
386
388 // //
389 // //
390 // //
392
393 //---------------------------------------------------------
394 bool SG_Is_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch, double Epsilon)
395 {
396 if( SG_Is_Equal(Line_B.x, Line_A.x, Epsilon) ) // vertical line
397 {
398 return( SG_Is_Between(Point.y, Line_A.y, Line_B.y, Epsilon) && (!bExactMatch || SG_Is_Between(Point.x, Line_A.x, Line_B.x, Epsilon)) );
399 }
400
401 if( bExactMatch && !SG_Is_Between(Point, Line_A, Line_B, Epsilon) )
402 {
403 return( false );
404 }
405
406 double b = (Line_B.y - Line_A.y) / (Line_B.x - Line_A.x);
407 double a = Line_A.y - b * Line_A.x;
408
409 return( SG_Is_Equal(Point.y, a + b * Point.x, Epsilon) );
410 }
411
412 //---------------------------------------------------------
413 double SG_Get_Distance_To_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch)
414 {
415 TSG_Point Line_Point;
416
417 return( SG_Get_Nearest_Point_On_Line(Point, Line_A, Line_B, Line_Point, bExactMatch) );
418 }
419
420 //---------------------------------------------------------
421 double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch)
422 {
423 CSG_Point Point_Ortho(
424 Point.x - (Line_B.y - Line_A.y),
425 Point.y + (Line_B.x - Line_A.x)
426 );
427
428 if( !SG_Get_Crossing(Line_Point, Line_A, Line_B, Point, Point_Ortho, false) )
429 {
430 return( -1. );
431 }
432
433 if( !bExactMatch || (bExactMatch
434 && SG_IS_BETWEEN(Line_A.x, Line_Point.x, Line_B.x)
435 && SG_IS_BETWEEN(Line_A.y, Line_Point.y, Line_B.y)) )
436 {
437 return( SG_Get_Distance(Point, Line_Point) );
438 }
439
440 double Distance_A = SG_Get_Distance(Point, Line_A);
441 double Distance_B = SG_Get_Distance(Point, Line_B);
442
443 if( Distance_A < Distance_B )
444 {
445 Line_Point = Line_A;
446
447 return( Distance_A );
448 }
449 else
450 {
451 Line_Point = Line_B;
452
453 return( Distance_B );
454 }
455 }
456
457
459 // //
460 // //
461 // //
463
464 //---------------------------------------------------------
465 bool SG_Get_Triangle_CircumCircle(TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
466 {
467 #define A Triangle[0]
468 #define B Triangle[1]
469 #define C Triangle[2]
470
471 //-----------------------------------------------------
472 TSG_Point AB, AC, AB_M, AC_M, AB_N, AC_N;
473
474 AB.x = B.x - A.x;
475 AB.y = B.y - A.y;
476 AB_M.x = A.x + AB.x / 2.;
477 AB_M.y = A.y + AB.y / 2.;
478 AB_N.x = AB_M.x - AB.y;
479 AB_N.y = AB_M.y + AB.x;
480
481 AC.x = C.x - A.x;
482 AC.y = C.y - A.y;
483 AC_M.x = A.x + AC.x / 2.;
484 AC_M.y = A.y + AC.y / 2.;
485 AC_N.x = AC_M.x - AC.y;
486 AC_N.y = AC_M.y + AC.x;
487
488 if( SG_Get_Crossing(Point, AB_M, AB_N, AC_M, AC_N, false) )
489 {
490 AB.x = A.x - Point.x;
491 AB.y = A.y - Point.y;
492
493 Radius = sqrt(AB.x*AB.x + AB.y*AB.y);
494
495 return( true );
496 }
497
498 return( false );
499
500 //-----------------------------------------------------
501 #undef A
502 #undef B
503 #undef C
504 }
505
506
508 // //
509 // //
510 // //
512
513 //---------------------------------------------------------
514 double SG_Get_Polygon_Area(TSG_Point *Points, int nPoints)
515 {
516 double Area = 0.;
517
518 if( nPoints >= 3 )
519 {
520 TSG_Point *iP = Points, *jP = Points + nPoints - 1;
521
522 for(int i=0; i<nPoints; i++, jP=iP++)
523 {
524 Area += (jP->x * iP->y) - (iP->x * jP->y);
525 }
526
527 Area /= 2.;
528 }
529
530 return( Area );
531 }
532
533 //---------------------------------------------------------
534 double SG_Get_Polygon_Area(const CSG_Points &Points)
535 {
536 double Area = 0.;
537
538 if( Points.Get_Count() >= 3 )
539 {
540 for(sLong i=0, j=Points.Get_Count()-1; i<Points.Get_Count(); j=i++)
541 {
542 Area += (Points[j].x * Points[i].y)
543 - (Points[i].x * Points[j].y);
544 }
545
546 Area /= 2.;
547 }
548
549 return( Area );
550 }
551
552
554 // //
555 // //
556 // //
558
559 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:111
SG_Get_Triangle_CircumCircle
bool SG_Get_Triangle_CircumCircle(TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
Definition: geo_functions.cpp:465
SG_Get_Crossing_InRegion
bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
Definition: geo_functions.cpp:342
A
#define A
SG_Get_Polygon_Area
double SG_Get_Polygon_Area(TSG_Point *Points, int nPoints)
Definition: geo_functions.cpp:514
SG_Get_Distance_To_Line
double SG_Get_Distance_To_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch)
Definition: geo_functions.cpp:413
C
#define C
SSG_Point_3D
Definition: geo_tools.h:264
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
SG_Get_Angle_Of_Direction
double SG_Get_Angle_Of_Direction(double dx, double dy)
Definition: geo_functions.cpp:216
SSG_Point
Definition: geo_tools.h:128
SG_Get_Nearest_Point_On_Line
double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch)
Definition: geo_functions.cpp:421
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
mat_tools.h
CSG_Point
Definition: geo_tools.h:135
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SG_Get_Distance_Polar
double SG_Get_Distance_Polar(double aLon, double aLat, double bLon, double bLat, double a, double e, bool bDegree)
Definition: geo_functions.cpp:157
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Length
double SG_Get_Length(double dx, double dy)
Definition: geo_functions.cpp:97
SG_Get_Square
double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
M_PI_180
#define M_PI_180
Definition: mat_tools.h:104
SG_is_Angle_Between
bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange)
Definition: geo_functions.cpp:257
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
SG_Is_Equal
bool SG_Is_Equal(double a, double b, double epsilon)
Definition: geo_functions.cpp:64
CSG_Points
Definition: geo_tools.h:184
SG_Get_Angle_Difference
double SG_Get_Angle_Difference(double a, double b)
Definition: geo_functions.cpp:247
M_GET_MIN
#define M_GET_MIN(a, b)
Definition: mat_tools.h:128
SG_Is_Point_On_Line
bool SG_Is_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch, double Epsilon)
Definition: geo_functions.cpp:394
M_GET_MAX
#define M_GET_MAX(a, b)
Definition: mat_tools.h:129
B
#define B
M_PI_090
#define M_PI_090
Definition: mat_tools.h:102
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
M_PI_360
#define M_PI_360
Definition: mat_tools.h:108
SSG_Point::y
double y
Definition: geo_tools.h:129
SG_IS_BETWEEN
#define SG_IS_BETWEEN(a, x, b)
Definition: geo_tools.h:90
SG_Is_Between
bool SG_Is_Between(double x, double a, double b, double epsilon)
Definition: geo_functions.cpp:77
SG_Get_Crossing
bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
Definition: geo_functions.cpp:280
geo_tools.h
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: geo_tools.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Typedefs | Enumerations | Functions
geo_tools.h File Reference
#include "api_core.h"
#include "metadata.h"

Go to the source code of this file.

Classes

struct | SSG_Point
class | CSG_Point
class | CSG_Points
class | CSG_Lines
struct | SSG_Point_3D
class | CSG_Point_3D
class | CSG_Points_3D
struct | SSG_Point_4D
class | CSG_Point_4D
struct | SSG_Point_Int
class | CSG_Points_Int
struct | SSG_Rect
class | CSG_Rect
class | CSG_Rects
struct | SSG_Rect_Int
class | CSG_Rect_Int
class | CSG_Rects_Int
class | CSG_Distance_Weighting
class | CSG_Projection
class | CSG_Projections

Macros

#define SG_IS_BETWEEN(a, x, b) (((a) <= (x) && (x) <= (b)) || ((b) <= (x) && (x) <= (a)))

Typedefs

typedef struct SSG_Point | TSG_Point
typedef struct SSG_Point_3D | TSG_Point_3D
typedef struct SSG_Point_4D | TSG_Point_4D
typedef struct SSG_Point_Int | TSG_Point_Int
typedef struct SSG_Rect | TSG_Rect
typedef struct SSG_Rect_Int | TSG_Rect_Int

Enumerations

enum TSG_Intersection {
INTERSECTION_None = 0, INTERSECTION_Identical, INTERSECTION_Overlaps, INTERSECTION_Contained,
INTERSECTION_Contains
}
enum | TSG_Point_Type { TSG_Point_Type::SG_POINT_TYPE_2D = 0, TSG_Point_Type::SG_POINT_TYPE_3D, TSG_Point_Type::SG_POINT_TYPE_4D, TSG_Point_Type::SG_POINT_TYPE_2D_Int }
enum | TSG_Distance_Weighting { SG_DISTWGHT_None = 0, SG_DISTWGHT_IDW, SG_DISTWGHT_EXP, SG_DISTWGHT_GAUSS }
enum | TSG_Projection_Format { SG_PROJ_FMT_WKT, SG_PROJ_FMT_Proj4, SG_PROJ_FMT_EPSG, SG_PROJ_FMT_Undefined }
enum | TSG_Projection_Type { SG_PROJ_TYPE_CS_Projected, SG_PROJ_TYPE_CS_Geographic, SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Undefined }
enum TSG_Projection_Unit {
SG_PROJ_UNIT_Kilometer, SG_PROJ_UNIT_Meter, SG_PROJ_UNIT_Decimeter, SG_PROJ_UNIT_Centimeter,
SG_PROJ_UNIT_Millimeter, SG_PROJ_UNIT_Int_Nautical_Mile, SG_PROJ_UNIT_Int_Inch, SG_PROJ_UNIT_Int_Foot,
SG_PROJ_UNIT_Int_Yard, SG_PROJ_UNIT_Int_Statute_Mile, SG_PROJ_UNIT_Int_Fathom, SG_PROJ_UNIT_Int_Chain,
SG_PROJ_UNIT_Int_Link, SG_PROJ_UNIT_US_Inch, SG_PROJ_UNIT_US_Foot, SG_PROJ_UNIT_US_Yard,
SG_PROJ_UNIT_US_Chain, SG_PROJ_UNIT_US_Statute_Mile, SG_PROJ_UNIT_Indian_Yard, SG_PROJ_UNIT_Indian_Foot,
SG_PROJ_UNIT_Indian_Chain, SG_PROJ_UNIT_Undefined
}

Functions

SAGA_API_DLL_EXPORT TSG_Projection_Type | SG_Get_Projection_Type (const CSG_String &Identifier)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Projection_Type_Identifier (TSG_Projection_Type Type)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Projection_Type_Name (TSG_Projection_Type Type)
SAGA_API_DLL_EXPORT TSG_Projection_Unit | SG_Get_Projection_Unit (const CSG_String &Identifier)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Projection_Unit_Identifier (TSG_Projection_Unit Unit)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Projection_Unit_Name (TSG_Projection_Unit Unit, bool bSimple=false)
SAGA_API_DLL_EXPORT double | SG_Get_Projection_Unit_To_Meter (TSG_Projection_Unit Unit)
SAGA_API_DLL_EXPORT CSG_Projections & | SG_Get_Projections (void)
SAGA_API_DLL_EXPORT bool | SG_Get_Projected (class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target)
SAGA_API_DLL_EXPORT bool | SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point)
SAGA_API_DLL_EXPORT bool | SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle)
SAGA_API_DLL_EXPORT bool | SG_Grid_Get_Geographic_Coordinates (CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
SAGA_API_DLL_EXPORT bool | SG_Is_Equal (double a, double b, double epsilon=0.)
SAGA_API_DLL_EXPORT bool | SG_Is_Equal (const TSG_Point &A, const TSG_Point &B, double epsilon=0.)
SAGA_API_DLL_EXPORT bool | SG_Is_Between (double x, double a, double b, double epsilon=0.)
SAGA_API_DLL_EXPORT bool | SG_Is_Between (const TSG_Point &Point, const TSG_Point &Corner_A, const TSG_Point &Corner_B, double epsilon=0.)
SAGA_API_DLL_EXPORT double | SG_Get_Length (double dx, double dy)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (double ax, double ay, double bx, double by, bool bPolar)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (const TSG_Point &A, const TSG_Point &B, bool bPolar)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (double ax, double ay, double bx, double by)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (const TSG_Point &A, const TSG_Point &B)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (double ax, double ay, double az, double bx, double by, double bz)
SAGA_API_DLL_EXPORT double | SG_Get_Distance (const TSG_Point_3D &A, const TSG_Point_3D &B)
SAGA_API_DLL_EXPORT double | SG_Get_Distance_Polar (double aLon, double aLat, double bLon, double bLat, double a=6378137., double e=298.257223563, bool bDegree=true)
SAGA_API_DLL_EXPORT double | SG_Get_Distance_Polar (const TSG_Point &A, const TSG_Point &B, double a=6378137., double e=298.257223563, bool bDegree=true)
SAGA_API_DLL_EXPORT double | SG_Get_Angle_Of_Direction (double dx, double dy)
SAGA_API_DLL_EXPORT double | SG_Get_Angle_Of_Direction (double ax, double ay, double bx, double by)
SAGA_API_DLL_EXPORT double | SG_Get_Angle_Of_Direction (const TSG_Point &A)
SAGA_API_DLL_EXPORT double | SG_Get_Angle_Of_Direction (const TSG_Point &A, const TSG_Point &B)
SAGA_API_DLL_EXPORT double | SG_Get_Angle_Difference (double a, double b)
SAGA_API_DLL_EXPORT bool | SG_is_Angle_Between (double Angle, double Angle_Min, double Angle_Max, bool bCheckRange=true)
SAGA_API_DLL_EXPORT bool | SG_Get_Crossing (TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch=true)
SAGA_API_DLL_EXPORT bool | SG_Get_Crossing_InRegion (TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
SAGA_API_DLL_EXPORT bool | SG_Is_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=false, double Epsilon=0.)
SAGA_API_DLL_EXPORT double | SG_Get_Distance_To_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=true)
SAGA_API_DLL_EXPORT double | SG_Get_Nearest_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch=true)
SAGA_API_DLL_EXPORT bool | SG_Get_Triangle_CircumCircle (TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
SAGA_API_DLL_EXPORT double | SG_Get_Polygon_Area (TSG_Point *Points, int nPoints)
SAGA_API_DLL_EXPORT double | SG_Get_Polygon_Area (const CSG_Points &Points)

Detailed Description

Tools for geometric/geographic data types and related functions.

See also
CSG_Point
CSG_Rect
CSG_Projections

Definition in file geo_tools.h.

Macro Definition Documentation

◆ SG_IS_BETWEEN

#define SG_IS_BETWEEN | ( | a,
 |  | x,
 |  | b
 | ) | (((a) <= (x) && (x) <= (b)) || ((b) <= (x) && (x) <= (a)))

Definition at line 90 of file geo_tools.h.

Typedef Documentation

◆ TSG_Point

typedef struct SSG_Point TSG_Point

◆ TSG_Point_3D

typedef struct SSG_Point_3D TSG_Point_3D

◆ TSG_Point_4D

typedef struct SSG_Point_4D TSG_Point_4D

◆ TSG_Point_Int

typedef struct SSG_Point_Int TSG_Point_Int

◆ TSG_Rect

typedef struct SSG_Rect TSG_Rect

◆ TSG_Rect_Int

typedef struct SSG_Rect_Int TSG_Rect_Int

Enumeration Type Documentation

◆ TSG_Distance_Weighting

enum TSG_Distance_Weighting
Enumerator
SG_DISTWGHT_None
SG_DISTWGHT_IDW
SG_DISTWGHT_EXP
SG_DISTWGHT_GAUSS

Definition at line 684 of file geo_tools.h.

◆ TSG_Intersection

enum TSG_Intersection
Enumerator
INTERSECTION_None
INTERSECTION_Identical
INTERSECTION_Overlaps
INTERSECTION_Contained
INTERSECTION_Contains

Definition at line 100 of file geo_tools.h.

◆ TSG_Point_Type

enum TSG_Point_Type
strong
Enumerator
SG_POINT_TYPE_2D
SG_POINT_TYPE_3D
SG_POINT_TYPE_4D
SG_POINT_TYPE_2D_Int

Definition at line 111 of file geo_tools.h.

◆ TSG_Projection_Format

enum TSG_Projection_Format
Enumerator
SG_PROJ_FMT_WKT
SG_PROJ_FMT_Proj4
SG_PROJ_FMT_EPSG
SG_PROJ_FMT_Undefined

Definition at line 769 of file geo_tools.h.

◆ TSG_Projection_Type

enum TSG_Projection_Type
Enumerator
SG_PROJ_TYPE_CS_Projected
SG_PROJ_TYPE_CS_Geographic
SG_PROJ_TYPE_CS_Geocentric
SG_PROJ_TYPE_CS_Undefined

Definition at line 779 of file geo_tools.h.

◆ TSG_Projection_Unit

enum TSG_Projection_Unit
Enumerator
SG_PROJ_UNIT_Kilometer
SG_PROJ_UNIT_Meter
SG_PROJ_UNIT_Decimeter
SG_PROJ_UNIT_Centimeter
SG_PROJ_UNIT_Millimeter
SG_PROJ_UNIT_Int_Nautical_Mile
SG_PROJ_UNIT_Int_Inch
SG_PROJ_UNIT_Int_Foot
SG_PROJ_UNIT_Int_Yard
SG_PROJ_UNIT_Int_Statute_Mile
SG_PROJ_UNIT_Int_Fathom
SG_PROJ_UNIT_Int_Chain
SG_PROJ_UNIT_Int_Link
SG_PROJ_UNIT_US_Inch
SG_PROJ_UNIT_US_Foot
SG_PROJ_UNIT_US_Yard
SG_PROJ_UNIT_US_Chain
SG_PROJ_UNIT_US_Statute_Mile
SG_PROJ_UNIT_Indian_Yard
SG_PROJ_UNIT_Indian_Foot
SG_PROJ_UNIT_Indian_Chain
SG_PROJ_UNIT_Undefined

Definition at line 789 of file geo_tools.h.

Function Documentation

◆ SG_Get_Angle_Difference()

SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference | ( | double | a,
 |  | double | b
 | ) |  |

Definition at line 247 of file geo_functions.cpp.

References M_PI_180, and M_PI_360.

◆ SG_Get_Angle_Of_Direction() [1/4]

SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction ( const TSG_Point & A )

Definition at line 235 of file geo_functions.cpp.

References A, and SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [2/4]

SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B
 | ) |  |

Definition at line 241 of file geo_functions.cpp.

References A, B, and SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [3/4]

SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by
 | ) |  |

Definition at line 229 of file geo_functions.cpp.

References SG_Get_Angle_Of_Direction().

◆ SG_Get_Angle_Of_Direction() [4/4]

SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction | ( | double | dx,
 |  | double | dy
 | ) |  |

Definition at line 216 of file geo_functions.cpp.

References M_PI_090, M_PI_180, and M_PI_360.

Referenced by SG_Get_Angle_Of_Direction().

◆ SG_Get_Crossing()

SAGA_API_DLL_EXPORT bool SG_Get_Crossing | ( | TSG_Point & | Crossing,
 |  | const TSG_Point & | a1,
 |  | const TSG_Point & | a2,
 |  | const TSG_Point & | b1,
 |  | const TSG_Point & | b2,
 |  | bool | bExactMatch = true
 | ) |  |

Definition at line 280 of file geo_functions.cpp.

References M_GET_MAX, M_GET_MIN, SSG_Point::x, and SSG_Point::y.

Referenced by CSG_TIN_Triangle::is_Containing(), CSG_Shape_Line::On_Intersects(), CSG_Shape_Polygon::On_Intersects(), SG_Get_Crossing_InRegion(), SG_Get_Nearest_Point_On_Line(), and SG_Get_Triangle_CircumCircle().

◆ SG_Get_Crossing_InRegion()

SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion | ( | TSG_Point & | Crossing,
 |  | const TSG_Point & | a,
 |  | const TSG_Point & | b,
 |  | const TSG_Rect & | Region
 | ) |  |

Definition at line 342 of file geo_functions.cpp.

References SG_Get_Crossing(), SSG_Point::x, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Point::y, SSG_Rect::yMax, and SSG_Rect::yMin.

Referenced by CSG_Shape_Line::On_Intersects(), and CSG_Shape_Polygon::On_Intersects().

◆ SG_Get_Distance() [1/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B
 | ) |  |

Definition at line 124 of file geo_functions.cpp.

References A, and B.

◆ SG_Get_Distance() [2/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | bool | bPolar
 | ) |  |

Definition at line 109 of file geo_functions.cpp.

References A, B, SG_Get_Distance(), and SG_Get_Distance_Polar().

◆ SG_Get_Distance() [3/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | const TSG_Point_3D & | A,
 |  | const TSG_Point_3D & | B
 | ) |  |

Definition at line 145 of file geo_functions.cpp.

References A, and B.

◆ SG_Get_Distance() [4/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | az,
 |  | double | bx,
 |  | double | by,
 |  | double | bz
 | ) |  |

Definition at line 135 of file geo_functions.cpp.

◆ SG_Get_Distance() [5/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by
 | ) |  |

Definition at line 115 of file geo_functions.cpp.

◆ SG_Get_Distance() [6/6]

SAGA_API_DLL_EXPORT double SG_Get_Distance | ( | double | ax,
 |  | double | ay,
 |  | double | bx,
 |  | double | by,
 |  | bool | bPolar
 | ) |  |

Definition at line 103 of file geo_functions.cpp.

References SG_Get_Distance(), and SG_Get_Distance_Polar().

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), CSG_Shape_Polygon_Part::_Update_Area(), CSG_Shape_Point::Get_Distance(), CSG_Shape_Points::Get_Distance(), CSG_Shape_Line::Get_Length(), CSG_Lines::Get_Length(), CSG_PointCloud::Get_Shape(), SG_Get_Distance(), and SG_Get_Nearest_Point_On_Line().

◆ SG_Get_Distance_Polar() [1/2]

SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | double | a = 6378137.,
 |  | double | e = 298.257223563,
 |  | bool | bDegree = true
 | ) |  |

Definition at line 203 of file geo_functions.cpp.

References A, B, and SG_Get_Distance_Polar().

◆ SG_Get_Distance_Polar() [2/2]

SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar | ( | double | aLon,
 |  | double | aLat,
 |  | double | bLon,
 |  | double | bLat,
 |  | double | a = 6378137.,
 |  | double | e = 298.257223563,
 |  | bool | bDegree = true
 | ) |  |

Definition at line 157 of file geo_functions.cpp.

References C, M_DEG_TO_RAD, and SG_Get_Square().

Referenced by SG_Get_Distance(), and SG_Get_Distance_Polar().

◆ SG_Get_Distance_To_Line()

SAGA_API_DLL_EXPORT double SG_Get_Distance_To_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | bool | bExactMatch = true
 | ) |  |

Definition at line 413 of file geo_functions.cpp.

References SG_Get_Nearest_Point_On_Line().

◆ SG_Get_Length()

SAGA_API_DLL_EXPORT double SG_Get_Length | ( | double | dx,
 |  | double | dy
 | ) |  |

Definition at line 97 of file geo_functions.cpp.

◆ SG_Get_Nearest_Point_On_Line()

SAGA_API_DLL_EXPORT double SG_Get_Nearest_Point_On_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | TSG_Point & | Line_Point,
 |  | bool | bExactMatch = true
 | ) |  |

Definition at line 421 of file geo_functions.cpp.

References SG_Get_Crossing(), SG_Get_Distance(), SG_IS_BETWEEN, SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon_Part::Get_Distance(), CSG_Shape_Line::Get_Distance(), and SG_Get_Distance_To_Line().

◆ SG_Get_Polygon_Area() [1/2]

SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area ( const CSG_Points & Points )

Definition at line 534 of file geo_functions.cpp.

References CSG_Points::Get_Count().

◆ SG_Get_Polygon_Area() [2/2]

SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area | ( | TSG_Point * | Points,
 |  | int | nPoints
 | ) |  |

Definition at line 514 of file geo_functions.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by CSG_TIN_Node::Get_Polygon_Area().

◆ SG_Get_Projected() [1/3]

SAGA_API_DLL_EXPORT bool SG_Get_Projected | ( | class CSG_Shapes * | pSource,
 |  | class CSG_Shapes * | pTarget,
 |  | const CSG_Projection & | Target
 | ) |  |

Definition at line 2191 of file projections.cpp.

References CSG_Shapes::Create(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Delete_Tool(), CSG_Tool::Execute(), CSG_Projection::Get_Proj4(), CSG_Data_Object::Get_Projection(), CSG_Projection::is_Okay(), CSG_Shapes::is_Valid(), CSG_Tool::Set_Manager(), CSG_Tool::Set_Parameter(), SG_Get_Tool_Library_Manager(), and SG_UI_ProgressAndMsg_Lock().

Referenced by SG_Get_Projected().

◆ SG_Get_Projected() [2/3]

SAGA_API_DLL_EXPORT bool SG_Get_Projected | ( | const CSG_Projection & | Source,
 |  | const CSG_Projection & | Target,
 |  | TSG_Point & | Point
 | ) |  |

Definition at line 2233 of file projections.cpp.

References CSG_Parameter::asDouble(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Delete_Tool(), CSG_Tool::Execute(), CSG_Tool::Get_Parameter(), CSG_Projection::Get_Proj4(), CSG_Projection::is_Okay(), CSG_Tool::Set_Manager(), CSG_Tool::Set_Parameter(), SG_Get_Tool_Library_Manager(), SG_UI_ProgressAndMsg_Lock(), SSG_Point::x, and SSG_Point::y.

◆ SG_Get_Projected() [3/3]

SAGA_API_DLL_EXPORT bool SG_Get_Projected | ( | const CSG_Projection & | Source,
 |  | const CSG_Projection & | Target,
 |  | TSG_Rect & | Rectangle
 | ) |  |

Definition at line 2270 of file projections.cpp.

References CSG_Shape::Add_Point(), CSG_Shapes::Add_Shape(), CSG_Projection::Create(), CSG_Shapes::Create(), CSG_Shapes::Get_Extent(), CSG_Data_Object::Get_Projection(), CSG_Projection::is_Okay(), SG_Get_Projected(), SHAPE_TYPE_Point, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ SG_Get_Projection_Type()

SAGA_API_DLL_EXPORT TSG_Projection_Type SG_Get_Projection_Type ( const CSG_String & Identifier )

Definition at line 77 of file projections.cpp.

References CSG_String::CmpNoCase(), SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, SG_PROJ_TYPE_CS_Projected, and SG_PROJ_TYPE_CS_Undefined.

Referenced by CSG_Projection::Assign().

◆ SG_Get_Projection_Type_Identifier()

SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Identifier ( TSG_Projection_Type Type )

Definition at line 87 of file projections.cpp.

References SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, and SG_PROJ_TYPE_CS_Projected.

Referenced by CSG_Projection::Get_Type_Identifier().

◆ SG_Get_Projection_Type_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Name ( TSG_Projection_Type Type )

Definition at line 99 of file projections.cpp.

References _TL, SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, and SG_PROJ_TYPE_CS_Projected.

Referenced by CSG_Projection::Get_Description(), CSG_Projections::Get_Names_List(), and CSG_Projection::Get_Type_Name().

◆ SG_Get_Projection_Unit()

SAGA_API_DLL_EXPORT TSG_Projection_Unit SG_Get_Projection_Unit ( const CSG_String & Identifier )

Definition at line 144 of file projections.cpp.

References CSG_String::CmpNoCase(), SG_PROJ_UNIT_Meter, SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projection_Unit_Identifier()

SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Identifier ( TSG_Projection_Unit Unit )

Definition at line 160 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by CSG_Projection::Get_Unit_Identifier().

◆ SG_Get_Projection_Unit_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Name | ( | TSG_Projection_Unit | Unit,
 |  | bool | bSimple = false
 | ) |  |

Definition at line 169 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projection_Unit_To_Meter()

SAGA_API_DLL_EXPORT double SG_Get_Projection_Unit_To_Meter ( TSG_Projection_Unit Unit )

Definition at line 178 of file projections.cpp.

References SG_PROJ_UNIT_Centimeter, SG_PROJ_UNIT_Decimeter, SG_PROJ_UNIT_Indian_Chain, SG_PROJ_UNIT_Indian_Foot, SG_PROJ_UNIT_Indian_Yard, SG_PROJ_UNIT_Int_Chain, SG_PROJ_UNIT_Int_Fathom, SG_PROJ_UNIT_Int_Foot, SG_PROJ_UNIT_Int_Inch, SG_PROJ_UNIT_Int_Link, SG_PROJ_UNIT_Int_Nautical_Mile, SG_PROJ_UNIT_Int_Statute_Mile, SG_PROJ_UNIT_Int_Yard, SG_PROJ_UNIT_Kilometer, SG_PROJ_UNIT_Meter, SG_PROJ_UNIT_Millimeter, SG_PROJ_UNIT_US_Chain, SG_PROJ_UNIT_US_Foot, SG_PROJ_UNIT_US_Inch, SG_PROJ_UNIT_US_Statute_Mile, and SG_PROJ_UNIT_US_Yard.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projections()

SAGA_API_DLL_EXPORT CSG_Projections& SG_Get_Projections ( void )

Definition at line 66 of file projections.cpp.

References gSG_Projections.

Referenced by SG_Initialize_Environment().

◆ SG_Get_Triangle_CircumCircle()

SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle | ( | TSG_Point | Triangle[3],
 |  | TSG_Point & | Point,
 |  | double & | Radius
 | ) |  |

Definition at line 465 of file geo_functions.cpp.

References A, B, C, SG_Get_Crossing(), SSG_Point::x, and SSG_Point::y.

◆ SG_Grid_Get_Geographic_Coordinates()

SAGA_API_DLL_EXPORT bool SG_Grid_Get_Geographic_Coordinates | ( | CSG_Grid * | pGrid,
 |  | CSG_Grid * | pLon,
 |  | CSG_Grid * | pLat
 | ) |  |

Definition at line 2307 of file projections.cpp.

References CSG_Grid::Create(), CSG_Data_Object::Get_Projection(), CSG_Grid::Get_System(), CSG_Projection::is_Okay(), CSG_Grid::is_Valid(), SG_RUN_TOOL, and SG_TOOL_PARAMETER_SET.

◆ SG_is_Angle_Between()

SAGA_API_DLL_EXPORT bool SG_is_Angle_Between | ( | double | Angle,
 |  | double | Angle_Min,
 |  | double | Angle_Max,
 |  | bool | bCheckRange = true
 | ) |  |

Definition at line 257 of file geo_functions.cpp.

References M_PI_360.

◆ SG_Is_Between() [1/2]

SAGA_API_DLL_EXPORT bool SG_Is_Between | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Corner_A,
 |  | const TSG_Point & | Corner_B,
 |  | double | epsilon = 0.
 | ) |  |

Definition at line 83 of file geo_functions.cpp.

References SG_Is_Between(), SSG_Point::x, and SSG_Point::y.

◆ SG_Is_Between() [2/2]

SAGA_API_DLL_EXPORT bool SG_Is_Between | ( | double | x,
 |  | double | a,
 |  | double | b,
 |  | double | epsilon = 0.
 | ) |  |

Definition at line 77 of file geo_functions.cpp.

Referenced by SG_Is_Between(), and SG_Is_Point_On_Line().

◆ SG_Is_Equal() [1/2]

SAGA_API_DLL_EXPORT bool SG_Is_Equal | ( | const TSG_Point & | A,
 |  | const TSG_Point & | B,
 |  | double | epsilon = 0.
 | ) |  |

Definition at line 70 of file geo_functions.cpp.

References A, B, and SG_Is_Equal().

◆ SG_Is_Equal() [2/2]

SAGA_API_DLL_EXPORT bool SG_Is_Equal | ( | double | a,
 |  | double | b,
 |  | double | epsilon = 0.
 | ) |  |

Definition at line 64 of file geo_functions.cpp.

Referenced by CSG_Rect::is_Equal(), SG_Is_Equal(), and SG_Is_Point_On_Line().

◆ SG_Is_Point_On_Line()

SAGA_API_DLL_EXPORT bool SG_Is_Point_On_Line | ( | const TSG_Point & | Point,
 |  | const TSG_Point & | Line_A,
 |  | const TSG_Point & | Line_B,
 |  | bool | bExactMatch = false,
 |  | double | Epsilon = 0.
 | ) |  |

Definition at line 394 of file geo_functions.cpp.

References SG_Is_Between(), SG_Is_Equal(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon_Part::_Add_Edge_Points(), and CSG_Shape_Polygon_Part::_is_OnEdge().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: geo_tools.h Source File

  • saga_core
  • saga_api
geo_tools.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // geo_tools.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__geo_tools_H
54 #define HEADER_INCLUDED__SAGA_API__geo_tools_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
72 // //
74 // //
75 // //
77
78 //---------------------------------------------------------
79 #include "api_core.h"
80 #include "metadata.h"
81
82
84 // //
85 // //
86 // //
88
89 //---------------------------------------------------------
90 #define SG_IS_BETWEEN(a, x, b) (((a) <= (x) && (x) <= (b)) || ((b) <= (x) && (x) <= (a)))
91
92
94 // //
95 // //
96 // //
98
99 //---------------------------------------------------------
100 typedef enum
101 {
102 INTERSECTION_None = 0,
103 INTERSECTION_Identical,
104 INTERSECTION_Overlaps,
105 INTERSECTION_Contained,
106 INTERSECTION_Contains
107 }
108 TSG_Intersection;
109
110 //---------------------------------------------------------
111 enum class TSG_Point_Type
112 {
113 SG_POINT_TYPE_2D = 0,
114 SG_POINT_TYPE_3D,
115 SG_POINT_TYPE_4D,
116 SG_POINT_TYPE_2D_Int
117 };
118
119
121 // //
122 // //
123 // //
125
126 //---------------------------------------------------------
127 typedef struct SSG_Point
128 {
129 double x, y;
130 }
131 TSG_Point;
132
133 //---------------------------------------------------------
134 class SAGA_API_DLL_EXPORT CSG_Point : public TSG_Point
135 {
136 public:
137 CSG_Point(void);
138 CSG_Point(const CSG_Point &Point);
139 CSG_Point(const TSG_Point &Point);
140 CSG_Point(double x, double y);
141
142 virtual ~CSG_Point(void) {}
143
144 virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_2D ); }
145
146 virtual bool operator == (const CSG_Point &Point) const { return( is_Equal(Point) ); }
147 virtual bool operator != (const CSG_Point &Point) const { return( !is_Equal(Point) ); }
148
149 virtual CSG_Point operator + (const CSG_Point &Point) const { return( CSG_Point(x + Point.x, y + Point.y) ); }
150 virtual CSG_Point operator - (const CSG_Point &Point) const { return( CSG_Point(x - Point.x, y - Point.y) ); }
151
152 virtual CSG_Point & operator = (const CSG_Point &Point) { Assign (Point); return( *this ); }
153 virtual CSG_Point & operator += (const CSG_Point &Point) { Add (Point); return( *this ); }
154 virtual CSG_Point & operator -= (const CSG_Point &Point) { Subtract(Point); return( *this ); }
155 virtual CSG_Point & operator *= (const CSG_Point &Point) { Multiply(Point); return( *this ); }
156
157 CSG_Point operator * (double Value) const { return( CSG_Point(x * Value, y * Value) ); }
158 CSG_Point operator / (double Value) const { return( CSG_Point(x / Value, y / Value) ); }
159 virtual CSG_Point & operator *= (double Value) { Multiply(Value); return( *this ); }
160 virtual CSG_Point & operator /= (double Value) { Divide (Value); return( *this ); }
161
162 virtual void Assign (double x, double y);
163 virtual void Assign (const CSG_Point &Point);
164
165 virtual void Add (const CSG_Point &Point);
166 virtual void Subtract (const CSG_Point &Point);
167 virtual void Multiply (const CSG_Point &Point);
168
169 virtual void Multiply (double Value);
170 virtual void Divide (double Value);
171
172 virtual double Get_Length (void) const;
173
174 virtual bool is_Equal (const CSG_Point &Point, double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, epsilon) ); }
175 virtual bool is_Equal (double _x, double _y, double epsilon = 0.) const
176 {
177 return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon );
178 }
179
180 };
181
182 //---------------------------------------------------------
183 class SAGA_API_DLL_EXPORT CSG_Points
184 {
185 public:
186 CSG_Points(void);
187 CSG_Points(const CSG_Points &Points);
188 CSG_Points(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
189
190 bool Clear (void) { return( m_Points.Destroy() ); }
191
192 CSG_Points & operator = (const CSG_Points &Points) { Assign(Points); return( *this ); }
193 bool Assign (const CSG_Points &Points);
194
195 bool Add (double x, double y);
196 bool Add (const TSG_Point &Point) { return( Add(Point.x, Point.y) ); }
197 bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
198
199 bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
200 sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
201
202 TSG_Point * Get_Points (void) const { return( (TSG_Point *)m_Points.Get_Array() ); }
203
204 TSG_Point & operator [] (sLong Index) { return( Get_Points()[Index] ); }
205 const TSG_Point & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
206
207
208 private:
209
210 CSG_Array m_Points;
211
212 };
213
214 //---------------------------------------------------------
215 class SAGA_API_DLL_EXPORT CSG_Lines
216 {
217 public:
218 CSG_Lines(void);
219 virtual ~CSG_Lines(void);
220
221 CSG_Lines (const CSG_Lines &Lines);
222 bool Create (const CSG_Lines &Lines);
223
224 CSG_Lines (sLong nLines);
225 bool Create (sLong nLines);
226
227 bool Destroy (void);
228 bool Clear (void);
229
230 CSG_Lines & operator = (const CSG_Lines &Lines) { Assign(Lines); return( *this ); }
231 bool Assign (const CSG_Lines &Lines);
232
233 CSG_Points & Add (void);
234 bool Add (const CSG_Points &Line);
235 bool Add (const CSG_Lines &Lines);
236 bool Del (sLong Index);
237
238 bool Set_Count (sLong nLines);
239 sLong Get_Count (void) const { return( m_Lines.Get_Size() ); }
240
241 CSG_Points & Get_Line (sLong Index) { return( *((CSG_Points *)m_Lines[Index]) ); }
242 const CSG_Points & Get_Line (sLong Index) const { return( *((CSG_Points *)m_Lines[Index]) ); }
243
244 CSG_Points & operator [] (sLong Index) { return( Get_Line(Index) ); }
245 const CSG_Points & operator [] (sLong Index) const { return( Get_Line(Index) ); }
246
247 double Get_Length (void) const;
248 double Get_Length (sLong Index) const;
249
250
251 private:
252
253 CSG_Array_Pointer m_Lines;
254
255 };
256
257
259 // //
261
262 //---------------------------------------------------------
263 typedef struct SSG_Point_3D
264 {
265 double x, y, z;
266 }
267 TSG_Point_3D;
268
269 //---------------------------------------------------------
270 class SAGA_API_DLL_EXPORT CSG_Point_3D : public TSG_Point_3D
271 {
272 public:
273 CSG_Point_3D(void);
274 CSG_Point_3D(const CSG_Point_3D &Point);
275 CSG_Point_3D(const TSG_Point_3D &Point);
276 CSG_Point_3D(double x, double y, double z);
277
278 virtual ~CSG_Point_3D(void) {}
279
280 virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_3D ); }
281
282 virtual bool operator == (const CSG_Point_3D &Point) const { return( is_Equal(Point) ); }
283 virtual bool operator != (const CSG_Point_3D &Point) const { return( !is_Equal(Point) ); }
284
285 virtual CSG_Point_3D operator + (const CSG_Point_3D &Point) const { return( CSG_Point_3D(x + Point.x, y + Point.y, z + Point.z) ); }
286 virtual CSG_Point_3D operator - (const CSG_Point_3D &Point) const { return( CSG_Point_3D(x - Point.x, y - Point.y, z - Point.z) ); }
287
288 virtual CSG_Point_3D & operator = (const CSG_Point_3D &Point) { Assign (Point); return( *this ); }
289 virtual CSG_Point_3D & operator += (const CSG_Point_3D &Point) { Add (Point); return( *this ); }
290 virtual CSG_Point_3D & operator -= (const CSG_Point_3D &Point) { Subtract(Point); return( *this ); }
291 virtual CSG_Point_3D & operator *= (const CSG_Point_3D &Point) { Multiply(Point); return( *this ); }
292
293 CSG_Point_3D operator * (double Value) const { return( CSG_Point_3D(x * Value, y * Value, z * Value) ); }
294 CSG_Point_3D operator / (double Value) const { return( CSG_Point_3D(x / Value, y / Value, z / Value) ); }
295 virtual CSG_Point_3D & operator *= (double Value) { Multiply(Value); return( *this ); }
296 virtual CSG_Point_3D & operator /= (double Value) { Divide (Value); return( *this ); }
297
298 virtual void Assign (double x, double y, double z);
299 virtual void Assign (const CSG_Point_3D &Point);
300
301 virtual void Add (const CSG_Point_3D &Point);
302 virtual void Subtract (const CSG_Point_3D &Point);
303 virtual void Multiply (const CSG_Point_3D &Point);
304
305 virtual void Multiply (double Value);
306 virtual void Divide (double Value);
307
308 virtual double Get_Length (void) const;
309
310 virtual bool is_Equal (const CSG_Point_3D &Point , double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, Point.y, epsilon) ); }
311 virtual bool is_Equal (double _x, double _y, double _z, double epsilon = 0.) const
312 {
313 return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon );
314 }
315
316 };
317
318 //---------------------------------------------------------
319 class SAGA_API_DLL_EXPORT CSG_Points_3D
320 {
321 public:
322 CSG_Points_3D(void);
323 CSG_Points_3D(const CSG_Points_3D &Points);
324 CSG_Points_3D(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
325
326 bool Clear (void) { return( m_Points.Destroy() ); }
327
328 CSG_Points_3D & operator = (const CSG_Points_3D &Points) { Assign(Points); return( *this ); }
329 bool Assign (const CSG_Points_3D &Points);
330
331 bool Add (double x, double y, double z);
332 bool Add (const TSG_Point_3D &Point) { return( Add(Point.x, Point.y, Point.z) ); }
333 bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
334
335 bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
336 sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
337
338 TSG_Point_3D * Get_Points (void) const { return( (TSG_Point_3D *)m_Points.Get_Array() ); }
339
340 TSG_Point_3D & operator [] (sLong Index) { return( Get_Points()[Index] ); }
341 const TSG_Point_3D & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
342
343
344 private:
345
346 CSG_Array m_Points;
347
348 };
349
350
352 // //
354
355 //---------------------------------------------------------
356 typedef struct SSG_Point_4D
357 {
358 double x, y, z, m;
359 }
360 TSG_Point_4D;
361
362 //---------------------------------------------------------
363 class SAGA_API_DLL_EXPORT CSG_Point_4D : public TSG_Point_4D
364 {
365 public:
366 CSG_Point_4D(void);
367 CSG_Point_4D(const CSG_Point_4D &Point);
368 CSG_Point_4D(const TSG_Point_4D &Point);
369 CSG_Point_4D(double x, double y, double z, double m);
370
371 virtual ~CSG_Point_4D(void) {}
372
373 virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_4D ); }
374
375 virtual bool operator == (const CSG_Point_4D &Point) const { return( is_Equal(Point) ); }
376 virtual bool operator != (const CSG_Point_4D &Point) const { return( !is_Equal(Point) ); }
377
378 virtual CSG_Point_4D operator + (const CSG_Point_4D &Point) const { return( CSG_Point_4D(x + Point.x, y + Point.y, z + Point.z, m + Point.m) ); }
379 virtual CSG_Point_4D operator - (const CSG_Point_4D &Point) const { return( CSG_Point_4D(x - Point.x, y - Point.y, z - Point.z, m - Point.m) ); }
380
381 CSG_Point_4D operator * (double Value) const { return( CSG_Point_4D(x * Value, y * Value, z * Value, m * Value) ); }
382 CSG_Point_4D operator / (double Value) const { return( CSG_Point_4D(x / Value, y / Value, z / Value, m * Value) ); }
383 virtual CSG_Point_4D & operator *= (double Value) { Multiply(Value); return( *this ); }
384 virtual CSG_Point_4D & operator /= (double Value) { Divide (Value); return( *this ); }
385
386 virtual CSG_Point_4D & operator = (const CSG_Point_4D &Point) { Assign (Point); return( *this ); }
387 virtual CSG_Point_4D & operator += (const CSG_Point_4D &Point) { Add (Point); return( *this ); }
388 virtual CSG_Point_4D & operator -= (const CSG_Point_4D &Point) { Subtract(Point); return( *this ); }
389 virtual CSG_Point_4D & operator *= (const CSG_Point_4D &Point) { Multiply(Point); return( *this ); }
390
391 virtual void Assign (double x, double y, double z, double m);
392 virtual void Assign (const CSG_Point_4D &Point);
393
394 virtual void Add (const CSG_Point_4D &Point);
395 virtual void Subtract (const CSG_Point_4D &Point);
396 virtual void Multiply (const CSG_Point_4D &Point);
397
398 virtual void Multiply (double Value);
399 virtual void Divide (double Value);
400
401 virtual double Get_Length (void) const;
402
403 virtual bool is_Equal (const CSG_Point_4D &Point , double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, Point.y, Point.m, epsilon) ); }
404 virtual bool is_Equal (double _x, double _y, double _z, double _m, double epsilon = 0.) const
405 {
406 return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon && fabs(m - _m) <= epsilon );
407 }
408
409 };
410
411
413 // //
415
416 //---------------------------------------------------------
417 typedef struct SSG_Point_Int
418 {
419 int x, y;
420 }
421 TSG_Point_Int;
422
423 //---------------------------------------------------------
424 class SAGA_API_DLL_EXPORT CSG_Points_Int
425 {
426 public:
427 CSG_Points_Int(void);
428 CSG_Points_Int(const CSG_Points_Int &Points);
429 CSG_Points_Int(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
430
431 bool Clear (void) { return( m_Points.Destroy() ); }
432
433 CSG_Points_Int & operator = (const CSG_Points_Int &Points) { Assign(Points); return( *this ); }
434 bool Assign (const CSG_Points_Int &Points);
435
436 bool Add (int x, int y);
437 bool Add (const TSG_Point_Int &Point) { return( Add(Point.x, Point.y) ); }
438 bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
439
440 bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
441 sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
442
443 TSG_Point_Int * Get_Points (void) const { return( (TSG_Point_Int *)m_Points.Get_Array() ); }
444
445 TSG_Point_Int & operator [] (sLong Index) { return( Get_Points()[Index] ); }
446 const TSG_Point_Int & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
447
448
449 private:
450
451 CSG_Array m_Points;
452
453 };
454
455
457 // //
458 // //
459 // //
461
462 //---------------------------------------------------------
463 typedef struct SSG_Rect
464 {
465 double xMin, yMin, xMax, yMax;
466 }
467 TSG_Rect;
468
469 //---------------------------------------------------------
470 class SAGA_API_DLL_EXPORT CSG_Rect : public TSG_Rect
471 {
472 public:
473 CSG_Rect(void);
474 CSG_Rect(const CSG_Rect &Rect);
475 CSG_Rect(const TSG_Rect &Rect);
476 CSG_Rect(const CSG_Point &A, const CSG_Point &B);
477 CSG_Rect(double xMin, double yMin, double xMax, double yMax);
478
479 ~CSG_Rect(void);
480
481 bool operator == (const CSG_Rect &Rect) const;
482 bool operator != (const CSG_Rect &Rect) const;
483
484 CSG_Rect & operator = (const CSG_Rect &Rect);
485 void operator += (const CSG_Point &Point);
486 void operator -= (const CSG_Point &Point);
487
488 void Assign (double xMin, double yMin, double xMax, double yMax);
489 void Assign (const CSG_Point &A, const CSG_Point &B);
490 void Assign (const CSG_Rect &Rect);
491
492 void Set_BottomLeft (double x, double y);
493 void Set_BottomLeft (const CSG_Point &Point);
494 void Set_TopRight (double x, double y);
495 void Set_TopRight (const CSG_Point &Point);
496
497 bool is_Equal (double xMin, double yMin, double xMax, double yMax, double epsilon = 0.) const;
498 bool is_Equal (const CSG_Rect &Rect , double epsilon = 0.) const;
499
500 double Get_XMin (void) const { return( xMin ); }
501 double Get_XMax (void) const { return( xMax ); }
502 double Get_YMin (void) const { return( yMin ); }
503 double Get_YMax (void) const { return( yMax ); }
504
505 double Get_XRange (void) const { return( xMax - xMin ); }
506 double Get_YRange (void) const { return( yMax - yMin ); }
507
508 double Get_Area (void) const { return( Get_XRange() * Get_YRange() ); }
509 double Get_Diameter (void) const { return( sqrt(Get_XRange()*Get_XRange() + Get_YRange()*Get_YRange()) ); }
510
511 CSG_Point Get_TopLeft (void) const { return( CSG_Point(xMin, yMax) ); }
512 CSG_Point Get_BottomRight (void) const { return( CSG_Point(xMax, yMin) ); }
513
514 CSG_Point Get_Center (void) const { return( CSG_Point(Get_XCenter(), Get_YCenter()) ); }
515 double Get_XCenter (void) const { return( (xMin + xMax) / 2. ); }
516 double Get_YCenter (void) const { return( (yMin + yMax) / 2. ); }
517
518 void Move (double dx, double dy);
519 void Move (const CSG_Point &Point);
520
521 void Inflate (double d, bool bPercent = true);
522 void Deflate (double d, bool bPercent = true);
523 void Inflate (double dx, double dy, bool bPercent = true);
524 void Deflate (double dx, double dy, bool bPercent = true);
525
526 void Union (double x, double y);
527 void Union (const CSG_Point &Point);
528 void Union (const CSG_Rect &Rect);
529 bool Intersect (const CSG_Rect &Rect);
530
531 TSG_Intersection Intersects (const CSG_Rect &Rect) const;
532
533 bool Contains (double x, double y) const;
534 bool Contains (const CSG_Point &Point) const;
535
536 };
537
538 //---------------------------------------------------------
539 class SAGA_API_DLL_EXPORT CSG_Rects
540 {
541 public:
542 CSG_Rects(void);
543 CSG_Rects(const CSG_Rects &Rects);
544 virtual ~CSG_Rects(void);
545
546 void Clear (void);
547
548 CSG_Rects & operator = (const CSG_Rects &Rects);
549 bool Assign (const CSG_Rects &Rects);
550
551 bool Add (void);
552 bool Add (double xMin, double yMin, double xMax, double yMax);
553 bool Add (const CSG_Rect &Rect);
554
555 int Get_Count (void) const { return( m_nRects ); }
556
557 CSG_Rect & operator [] (int Index) { return( *m_Rects[Index] ); }
558 CSG_Rect & Get_Rect (int Index) { return( *m_Rects[Index] ); }
559
560
561 private:
562
563 int m_nRects;
564
565 CSG_Rect **m_Rects;
566
567 };
568
569
571 // //
573
574 //---------------------------------------------------------
575 typedef struct SSG_Rect_Int
576 {
577 int xMin, yMin, xMax, yMax;
578 }
579 TSG_Rect_Int;
580
581 //---------------------------------------------------------
582 class SAGA_API_DLL_EXPORT CSG_Rect_Int : public TSG_Rect_Int
583 {
584 public:
585 CSG_Rect_Int(void);
586 CSG_Rect_Int(const CSG_Rect_Int &Rect);
587 CSG_Rect_Int(const TSG_Rect_Int &Rect);
588 CSG_Rect_Int(const TSG_Point_Int &A, const TSG_Point_Int &B);
589 CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax);
590
591 ~CSG_Rect_Int(void);
592
593 bool operator == (const CSG_Rect_Int &Rect) const;
594 bool operator != (const CSG_Rect_Int &Rect) const;
595
596 CSG_Rect_Int & operator = (const CSG_Rect_Int &Rect);
597 void operator += (const TSG_Point_Int &Point);
598 void operator -= (const TSG_Point_Int &Point);
599
600 void Assign (int xMin, int yMin, int xMax, int yMax);
601 void Assign (const TSG_Point_Int &A, const TSG_Point_Int &B);
602 void Assign (const CSG_Rect_Int &Rect);
603
604 void Set_BottomLeft (int x, int y);
605 void Set_BottomLeft (const TSG_Point_Int &Point);
606 void Set_TopRight (int x, int y);
607 void Set_TopRight (const TSG_Point_Int &Point);
608
609 bool is_Equal (int xMin, int yMin, int xMax, int yMax) const;
610 bool is_Equal (const CSG_Rect_Int &Rect ) const;
611
612 int Get_XMin (void) const { return( xMin ); }
613 int Get_XMax (void) const { return( xMax ); }
614 int Get_YMin (void) const { return( yMin ); }
615 int Get_YMax (void) const { return( yMax ); }
616
617 int Get_XRange (void) const { return( xMax - xMin ); }
618 int Get_YRange (void) const { return( yMax - yMin ); }
619
620 double Get_Area (void) const { return( ((double)Get_XRange() * (double)Get_YRange()) ); }
621 double Get_Diameter (void) const { double x = (double)xMax - xMin, y = (double)yMax - yMin; return( sqrt(x*x + y*y) ); }
622
623 TSG_Point_Int Get_TopLeft (void) const { TSG_Point_Int p; p.x = xMin; p.y = yMax; return( p ); }
624 TSG_Point_Int Get_BottomRight (void) const { TSG_Point_Int p; p.x = xMax; p.y = yMin; return( p ); }
625
626 void Move (int dx, int dy);
627 void Move (const TSG_Point_Int &Point);
628
629 void Inflate (int d);
630 void Deflate (int d);
631 void Inflate (int dx, int dy);
632 void Deflate (int dx, int dy);
633
634 void Union (int x, int y);
635 void Union (const TSG_Point_Int &Point);
636 void Union (const CSG_Rect_Int &Rect);
637 bool Intersect (const CSG_Rect_Int &Rect);
638
639 TSG_Intersection Intersects (const CSG_Rect_Int &Rect) const;
640
641 bool Contains (double x, double y) const;
642 bool Contains (const TSG_Point_Int &Point) const;
643
644 };
645
646 //---------------------------------------------------------
647 class SAGA_API_DLL_EXPORT CSG_Rects_Int
648 {
649 public:
650 CSG_Rects_Int(void);
651 virtual ~CSG_Rects_Int(void);
652
653 void Clear (void);
654
655 CSG_Rects_Int & operator = (const CSG_Rects_Int &Rects);
656 bool Assign (const CSG_Rects_Int &Rects);
657
658 bool Add (void);
659 bool Add (int xMin, int yMin, int xMax, int yMax);
660 bool Add (const CSG_Rect_Int &Rect);
661
662 int Get_Count (void) const { return( m_nRects ); }
663
664 CSG_Rect_Int & operator [] (int Index) { return( *m_Rects[Index] ); }
665 CSG_Rect_Int & Get_Rect (int Index) { return( *m_Rects[Index] ); }
666
667
668 private:
669
670 int m_nRects;
671
672 CSG_Rect_Int **m_Rects;
673
674 };
675
676
678 // //
679 // //
680 // //
682
683 //---------------------------------------------------------
684 typedef enum
685 {
686 SG_DISTWGHT_None = 0,
687 SG_DISTWGHT_IDW,
688 SG_DISTWGHT_EXP,
689 SG_DISTWGHT_GAUSS
690 }
691 TSG_Distance_Weighting;
692
693
695 // //
697
698 //---------------------------------------------------------
699 class SAGA_API_DLL_EXPORT CSG_Distance_Weighting
700 {
701 public:
702 CSG_Distance_Weighting(void);
703 virtual ~CSG_Distance_Weighting(void);
704
705 static bool Enable_Parameters (class CSG_Parameters &Parameters);
706 bool Create_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
707 static bool Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
708 bool Set_Parameters (class CSG_Parameters &Parameters);
709
710 TSG_Distance_Weighting Get_Weighting (void) const { return( m_Weighting ); }
711 bool Set_Weighting (TSG_Distance_Weighting Weighting);
712
713 double Get_IDW_Power (void) const { return( m_IDW_Power ); }
714 bool Set_IDW_Power (double Value);
715
716 bool Get_IDW_Offset (void) const { return( m_IDW_bOffset ); }
717 bool Set_IDW_Offset (bool bOn = true);
718
719 double Get_BandWidth (void) const { return( m_Bandwidth ); }
720 bool Set_BandWidth (double Value);
721
722 //-----------------------------------------------------
723 double Get_Weight (double Distance) const
724 {
725 if( Distance < 0. )
726 {
727 return( 0. );
728 }
729
730 switch( m_Weighting )
731 {
732 case SG_DISTWGHT_IDW :
733 return( m_IDW_bOffset
734 ? pow(1. + Distance, -m_IDW_Power) : Distance > 0.
735 ? pow( Distance, -m_IDW_Power) : 0.
736 );
737
738 case SG_DISTWGHT_EXP :
739 return( exp(-Distance / m_Bandwidth) );
740
741 case SG_DISTWGHT_GAUSS:
742 Distance /= m_Bandwidth;
743 return( exp(-0.5 * Distance*Distance) );
744
745 default: // case SG_DISTWGHT_None:
746 return( 1. );
747 }
748 }
749
750
751 private:
752
753 bool m_IDW_bOffset;
754
755 double m_IDW_Power, m_Bandwidth;
756
757 TSG_Distance_Weighting m_Weighting;
758
759 };
760
761
763 // //
764 // //
765 // //
767
768 //---------------------------------------------------------
769 typedef enum
770 {
771 SG_PROJ_FMT_WKT,
772 SG_PROJ_FMT_Proj4,
773 SG_PROJ_FMT_EPSG,
774 SG_PROJ_FMT_Undefined
775 }
776 TSG_Projection_Format;
777
778 //---------------------------------------------------------
779 typedef enum
780 {
781 SG_PROJ_TYPE_CS_Projected,
782 SG_PROJ_TYPE_CS_Geographic,
783 SG_PROJ_TYPE_CS_Geocentric,
784 SG_PROJ_TYPE_CS_Undefined
785 }
786 TSG_Projection_Type;
787
788 //---------------------------------------------------------
789 typedef enum
790 {
791 SG_PROJ_UNIT_Kilometer,
792 SG_PROJ_UNIT_Meter,
793 SG_PROJ_UNIT_Decimeter,
794 SG_PROJ_UNIT_Centimeter,
795 SG_PROJ_UNIT_Millimeter,
796 SG_PROJ_UNIT_Int_Nautical_Mile,
797 SG_PROJ_UNIT_Int_Inch,
798 SG_PROJ_UNIT_Int_Foot,
799 SG_PROJ_UNIT_Int_Yard,
800 SG_PROJ_UNIT_Int_Statute_Mile,
801 SG_PROJ_UNIT_Int_Fathom,
802 SG_PROJ_UNIT_Int_Chain,
803 SG_PROJ_UNIT_Int_Link,
804 SG_PROJ_UNIT_US_Inch,
805 SG_PROJ_UNIT_US_Foot,
806 SG_PROJ_UNIT_US_Yard,
807 SG_PROJ_UNIT_US_Chain,
808 SG_PROJ_UNIT_US_Statute_Mile,
809 SG_PROJ_UNIT_Indian_Yard,
810 SG_PROJ_UNIT_Indian_Foot,
811 SG_PROJ_UNIT_Indian_Chain,
812 SG_PROJ_UNIT_Undefined
813 }
814 TSG_Projection_Unit;
815
816 //---------------------------------------------------------
817 SAGA_API_DLL_EXPORT TSG_Projection_Type SG_Get_Projection_Type (const CSG_String &Identifier);
818 SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Identifier (TSG_Projection_Type Type);
819 SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Name (TSG_Projection_Type Type);
820
821 SAGA_API_DLL_EXPORT TSG_Projection_Unit SG_Get_Projection_Unit (const CSG_String &Identifier);
822 SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Identifier (TSG_Projection_Unit Unit);
823 SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Name (TSG_Projection_Unit Unit, bool bSimple = false);
824 SAGA_API_DLL_EXPORT double SG_Get_Projection_Unit_To_Meter (TSG_Projection_Unit Unit);
825
826
828 // //
830
831 //---------------------------------------------------------
832 class SAGA_API_DLL_EXPORT CSG_Projection
833 {
834 friend class CSG_Projections;
835
836 public:
837 CSG_Projection(void);
838 virtual ~CSG_Projection(void);
839
840 void Destroy (void);
841
842 CSG_Projection (const CSG_Projection &Projection);
843 bool Create (const CSG_Projection &Projection);
844 bool Assign (const CSG_Projection &Projection);
845 CSG_Projection & operator = (const CSG_Projection &Projection) { Assign(Projection); return( *this ); }
846
847 CSG_Projection (int Authority_ID, const SG_Char *Authority = NULL);
848 bool Create (int Authority_ID, const SG_Char *Authority = NULL);
849 bool Assign (int Authority_ID, const SG_Char *Authority = NULL);
850 CSG_Projection & operator = (int Authority_ID) { Assign(Authority_ID); return( *this ); }
851
852 CSG_Projection (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
853 bool Create (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
854 bool Assign (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
855 CSG_Projection & operator = (const CSG_String &Projection) { Assign(Projection); return( *this ); }
856
857 CSG_Projection (const CSG_String &WKT, const CSG_String &Proj4);
858 bool Create (const CSG_String &WKT, const CSG_String &Proj4);
859 bool Assign (const CSG_String &WKT, const CSG_String &Proj4);
860
861 bool is_Okay (void) const { return( m_Type != SG_PROJ_TYPE_CS_Undefined ); }
862 bool is_Equal (const CSG_Projection &Projection) const;
863 bool operator == (const CSG_Projection &Projection) const { return( is_Equal(Projection) == true ); }
864 bool operator != (const CSG_Projection &Projection) const { return( is_Equal(Projection) == false ); }
865
866 bool Set_GCS_WGS84 (void);
867 bool Set_UTM_WGS84 (int Zone, bool bSouth = false);
868
869 bool Load (const CSG_String &FileName, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
870 bool Save (const CSG_String &FileName, TSG_Projection_Format Format = SG_PROJ_FMT_WKT) const;
871
872 bool Load (CSG_File &Stream, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
873 bool Save (CSG_File &Stream, TSG_Projection_Format Format = SG_PROJ_FMT_WKT) const;
874
875 bool Load (const CSG_MetaData &Projection);
876 bool Save ( CSG_MetaData &Projection) const;
877
878 const CSG_String & Get_Name (void) const { return( m_Name ); }
879 const CSG_String & Get_WKT (void) const { return( m_WKT ); }
880 const CSG_String & Get_Proj4 (void) const { return( m_Proj4 ); }
881 const CSG_String & Get_Authority (void) const { return( m_Authority ); }
882 int Get_Authority_ID (void) const { return( m_Authority_ID ); }
883 int Get_EPSG (void) const { return( m_Authority.Cmp("EPSG") ? -1 : m_Authority_ID ); }
884
885 CSG_String Get_Description (void) const;
886
887 TSG_Projection_Type Get_Type (void) const { return( m_Type ); }
888 CSG_String Get_Type_Identifier (void) const { return( SG_Get_Projection_Type_Identifier(m_Type) ); }
889 CSG_String Get_Type_Name (void) const { return( SG_Get_Projection_Type_Name (m_Type) ); }
890
891 bool is_Projection (void) const { return( m_Type == SG_PROJ_TYPE_CS_Projected ); }
892 bool is_Geographic (void) const { return( m_Type == SG_PROJ_TYPE_CS_Geographic ); }
893 bool is_Geocentric (void) const { return( m_Type == SG_PROJ_TYPE_CS_Geocentric ); }
894
895
896 TSG_Projection_Unit Get_Unit (void) const { return( m_Unit ); }
897 CSG_String Get_Unit_Identifier (void) const { return( SG_Get_Projection_Unit_Identifier(m_Unit) ); }
898 CSG_String Get_Unit_Name (void) const { return( m_Unit_Name ); }
899 double Get_Unit_To_Meter (void) const { return( m_Unit_To_Meter ); }
900
901
902 private:
903
904 int m_Authority_ID;
905
906 double m_Unit_To_Meter;
907
908 TSG_Projection_Type m_Type;
909
910 TSG_Projection_Unit m_Unit;
911
912 CSG_String m_Name, m_WKT, m_Proj4, m_Authority, m_Unit_Name;
913
914
915 };
916
917
919 // //
921
922 //---------------------------------------------------------
926 //---------------------------------------------------------
927 class SAGA_API_DLL_EXPORT CSG_Projections
928 {
929 friend class CSG_Projection;
930
931 public:
932 CSG_Projections(void);
933 virtual ~CSG_Projections(void);
934
935 CSG_Projections (bool bLoad_DB);
936 bool Create (bool bLoad_DB = true);
937
938 CSG_Projections (const CSG_String &File_DB);
939 bool Create (const CSG_String &File_DB);
940
941 void Destroy (void);
942
943 bool Reset_Dictionary (void);
944 bool Load_Dictionary (const CSG_String &FileName);
945 bool Save_Dictionary (const CSG_String &FileName);
946
947 bool Load_DB (const CSG_String &FileName, bool bAppend = false);
948 bool Save_DB (const CSG_String &FileName);
949
950 sLong Get_Count (void) const;
951
952 bool Add (const CSG_Projection &Projection);
953 bool Add (const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID);
954
955 CSG_Projection Get_Projection (sLong Index) const;
956 CSG_Projection operator [] (sLong Index) const { return( Get_Projection(Index) ); }
957
958 bool Get_Projection (CSG_Projection &Projection, int EPSG_ID ) const;
959 bool Get_Projection (CSG_Projection &Projection, const CSG_String &Authority, int Authority_ID) const;
960
961 CSG_String Get_Names_List (TSG_Projection_Type Type = SG_PROJ_TYPE_CS_Undefined) const;
962
963 static CSG_MetaData WKT_to_MetaData (const CSG_String &WKT);
964
965 bool WKT_to_Proj4 (CSG_String &Proj4, const CSG_String &WKT ) const;
966 bool WKT_from_Proj4 (CSG_String &WKT , const CSG_String &Proj4) const;
967
968 bool EPSG_to_Proj4 (CSG_String &Proj4, int EPSG_Code) const;
969 bool EPSG_to_WKT (CSG_String &WKT , int EPSG_Code) const;
970
971 static const CSG_Projection & Get_GCS_WGS84 (void);
972 static CSG_Projection Get_UTM_WGS84 (int Zone, bool bSouth = false);
973
974
975 private:
976
977 CSG_Translator m_WKT_to_Proj4, m_Proj4_to_WKT, m_EPSG_to_Idx;
978
979 class CSG_Table *m_pProjections;
980
981
982 void _On_Construction (void);
983
984 static bool _WKT_to_MetaData (CSG_MetaData &MetaData, const CSG_String &WKT);
985
986 bool _WKT_to_Proj4_Set_Datum (CSG_String &Proj4, const CSG_MetaData &WKT) const;
987
988 static bool _Proj4_Find_Parameter ( const CSG_String &Proj4, const CSG_String &Key);
989 static bool _Proj4_Read_Parameter (CSG_String &Value, const CSG_String &Proj4, const CSG_String &Key);
990 static bool _Proj4_Get_Ellipsoid (CSG_String &Value, const CSG_String &Proj4);
991 static bool _Proj4_Get_Datum (CSG_String &Value, const CSG_String &Proj4);
992 static bool _Proj4_Get_Prime_Meridian (CSG_String &Value, const CSG_String &Proj4);
993 static bool _Proj4_Get_Unit (CSG_String &Value, const CSG_String &Proj4);
994
995 bool _Set_Dictionary (CSG_Table &Dictionary, int Direction);
996 bool _Set_Dictionary (CSG_Translator &Dictionary, int Direction);
997
998 };
999
1000 //---------------------------------------------------------
1001 SAGA_API_DLL_EXPORT CSG_Projections & SG_Get_Projections (void);
1002
1003 //---------------------------------------------------------
1004 SAGA_API_DLL_EXPORT bool SG_Get_Projected (class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target);
1005
1006 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point );
1007 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle);
1008
1009 //---------------------------------------------------------
1010 SAGA_API_DLL_EXPORT bool SG_Grid_Get_Geographic_Coordinates (CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat);
1011
1012
1014 // //
1015 // Functions //
1016 // //
1018
1019 //---------------------------------------------------------
1020 SAGA_API_DLL_EXPORT bool SG_Is_Equal (double a, double b, double epsilon = 0.);
1021 SAGA_API_DLL_EXPORT bool SG_Is_Equal (const TSG_Point &A, const TSG_Point &B, double epsilon = 0.);
1022
1023 SAGA_API_DLL_EXPORT bool SG_Is_Between (double x, double a, double b, double epsilon = 0.);
1024 SAGA_API_DLL_EXPORT bool SG_Is_Between (const TSG_Point &Point, const TSG_Point &Corner_A, const TSG_Point &Corner_B, double epsilon = 0.);
1025
1026 //---------------------------------------------------------
1027 SAGA_API_DLL_EXPORT double SG_Get_Length (double dx, double dy);
1028
1029 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by, bool bPolar);
1030 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B , bool bPolar);
1031
1032 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by);
1033 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B);
1034
1035 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double az, double bx, double by, double bz);
1036 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point_3D &A, const TSG_Point_3D &B);
1037
1038 SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar (double aLon, double aLat, double bLon, double bLat, double a = 6378137., double e = 298.257223563, bool bDegree = true);
1039 SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar (const TSG_Point &A , const TSG_Point &B , double a = 6378137., double e = 298.257223563, bool bDegree = true);
1040
1041 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double dx, double dy);
1042 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double ax, double ay, double bx, double by);
1043 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (const TSG_Point &A);
1044 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (const TSG_Point &A, const TSG_Point &B);
1045 SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference (double a, double b);
1046 SAGA_API_DLL_EXPORT bool SG_is_Angle_Between (double Angle, double Angle_Min, double Angle_Max, bool bCheckRange = true);
1047
1048 SAGA_API_DLL_EXPORT bool SG_Get_Crossing (TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch = true);
1049 SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion (TSG_Point &Crossing, const TSG_Point &a , const TSG_Point & b, const TSG_Rect &Region);
1050
1051 SAGA_API_DLL_EXPORT bool SG_Is_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch = false, double Epsilon = 0.);
1052 SAGA_API_DLL_EXPORT double SG_Get_Distance_To_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch = true);
1053 SAGA_API_DLL_EXPORT double SG_Get_Nearest_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch = true);
1054
1055 SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle (TSG_Point Triangle[3], TSG_Point &Point, double &Radius);
1056
1057 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (TSG_Point *Points, int nPoints);
1058 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (const CSG_Points &Points);
1059
1060
1062 // //
1063 // //
1064 // //
1066
1067 //---------------------------------------------------------
1068 #endif // #ifndef HEADER_INCLUDED__SAGA_API__geo_tools_H
SG_Get_Distance_To_Line
SAGA_API_DLL_EXPORT double SG_Get_Distance_To_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=true)
Definition: geo_functions.cpp:413
CSG_Rect
Definition: geo_tools.h:471
SG_PROJ_UNIT_Indian_Foot
@ SG_PROJ_UNIT_Indian_Foot
Definition: geo_tools.h:810
CSG_Point::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:144
SG_PROJ_UNIT_Int_Chain
@ SG_PROJ_UNIT_Int_Chain
Definition: geo_tools.h:802
SG_Get_Projection_Unit_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Identifier(TSG_Projection_Unit Unit)
Definition: projections.cpp:160
SG_PROJ_UNIT_US_Statute_Mile
@ SG_PROJ_UNIT_US_Statute_Mile
Definition: geo_tools.h:808
CSG_Points_3D::Add
bool Add(const TSG_Point_3D &Point)
Definition: geo_tools.h:332
CSG_Translator
Definition: api_core.h:1424
CSG_Point::~CSG_Point
virtual ~CSG_Point(void)
Definition: geo_tools.h:142
SG_Get_Projection_Type_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Identifier(TSG_Projection_Type Type)
Definition: projections.cpp:87
CSG_Rect_Int::Get_XMin
int Get_XMin(void) const
Definition: geo_tools.h:612
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:320
SG_Get_Length
SAGA_API_DLL_EXPORT double SG_Get_Length(double dx, double dy)
Definition: geo_functions.cpp:97
SSG_Rect_Int::yMax
int yMax
Definition: geo_tools.h:577
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Rects
Definition: geo_tools.h:540
CSG_Rect_Int::Get_YMin
int Get_YMin(void) const
Definition: geo_tools.h:614
TSG_Distance_Weighting
TSG_Distance_Weighting
Definition: geo_tools.h:685
TSG_Rect_Int
struct SSG_Rect_Int TSG_Rect_Int
CSG_Points_Int::Get_Points
TSG_Point_Int * Get_Points(void) const
Definition: geo_tools.h:443
SG_PROJ_TYPE_CS_Geographic
@ SG_PROJ_TYPE_CS_Geographic
Definition: geo_tools.h:782
SG_Get_Angle_Of_Direction
SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction(double dx, double dy)
Definition: geo_functions.cpp:216
SSG_Rect_Int::yMin
int yMin
Definition: geo_tools.h:577
CSG_Point_4D::is_Equal
virtual bool is_Equal(double _x, double _y, double _z, double _m, double epsilon=0.) const
Definition: geo_tools.h:404
CSG_Point_4D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:373
SG_Get_Angle_Difference
SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference(double a, double b)
Definition: geo_functions.cpp:247
SG_PROJ_FMT_Undefined
@ SG_PROJ_FMT_Undefined
Definition: geo_tools.h:774
CSG_Point_4D::is_Equal
virtual bool is_Equal(const CSG_Point_4D &Point, double epsilon=0.) const
Definition: geo_tools.h:403
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_Rect_Int::Get_XMax
int Get_XMax(void) const
Definition: geo_tools.h:613
CSG_Points_Int::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:441
CSG_Projections::Create
bool Create(bool bLoad_DB=true)
Definition: projections.cpp:721
SG_DISTWGHT_EXP
@ SG_DISTWGHT_EXP
Definition: geo_tools.h:688
CSG_Points_Int::Clear
bool Clear(void)
Definition: geo_tools.h:431
A
#define A
SG_PROJ_UNIT_Int_Statute_Mile
@ SG_PROJ_UNIT_Int_Statute_Mile
Definition: geo_tools.h:800
CSG_Points_Int
Definition: geo_tools.h:425
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Projection::Get_Unit_Name
CSG_String Get_Unit_Name(void) const
Definition: geo_tools.h:898
SG_Get_Crossing
SAGA_API_DLL_EXPORT bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch=true)
Definition: geo_functions.cpp:280
CSG_Rect::Get_TopLeft
CSG_Point Get_TopLeft(void) const
Definition: geo_tools.h:511
SG_Get_Crossing_InRegion
SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
Definition: geo_functions.cpp:342
SG_PROJ_UNIT_Int_Foot
@ SG_PROJ_UNIT_Int_Foot
Definition: geo_tools.h:798
SG_DISTWGHT_GAUSS
@ SG_DISTWGHT_GAUSS
Definition: geo_tools.h:689
CSG_Points_3D::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:335
TSG_Projection_Type
TSG_Projection_Type
Definition: geo_tools.h:780
CSG_Rects::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:555
CSG_Projections::CSG_Projection
friend class CSG_Projection
Definition: geo_tools.h:929
SG_Get_Projection_Unit
SAGA_API_DLL_EXPORT TSG_Projection_Unit SG_Get_Projection_Unit(const CSG_String &Identifier)
Definition: projections.cpp:144
CSG_Rect_Int::Get_XRange
int Get_XRange(void) const
Definition: geo_tools.h:617
SSG_Point_4D
Definition: geo_tools.h:357
SG_PROJ_UNIT_US_Inch
@ SG_PROJ_UNIT_US_Inch
Definition: geo_tools.h:804
SSG_Point_3D
Definition: geo_tools.h:264
SG_Get_Distance
SAGA_API_DLL_EXPORT double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
SG_PROJ_UNIT_Int_Inch
@ SG_PROJ_UNIT_Int_Inch
Definition: geo_tools.h:797
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:336
SSG_Rect_Int
Definition: geo_tools.h:576
CSG_Point_3D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:280
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Projection::is_Geographic
bool is_Geographic(void) const
Definition: geo_tools.h:892
CSG_Point_3D::is_Equal
virtual bool is_Equal(double _x, double _y, double _z, double epsilon=0.) const
Definition: geo_tools.h:311
SG_Is_Between
SAGA_API_DLL_EXPORT bool SG_Is_Between(double x, double a, double b, double epsilon=0.)
Definition: geo_functions.cpp:77
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
api_core.h
SG_PROJ_UNIT_Int_Link
@ SG_PROJ_UNIT_Int_Link
Definition: geo_tools.h:803
SG_PROJ_UNIT_Int_Yard
@ SG_PROJ_UNIT_Int_Yard
Definition: geo_tools.h:799
SG_PROJ_UNIT_US_Foot
@ SG_PROJ_UNIT_US_Foot
Definition: geo_tools.h:805
CSG_Rects::Get_Rect
CSG_Rect & Get_Rect(int Index)
Definition: geo_tools.h:558
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:508
CSG_Projection::Get_WKT
const CSG_String & Get_WKT(void) const
Definition: geo_tools.h:879
SG_PROJ_UNIT_Indian_Yard
@ SG_PROJ_UNIT_Indian_Yard
Definition: geo_tools.h:809
CSG_Projection::CSG_Projections
friend class CSG_Projections
Definition: geo_tools.h:834
SSG_Point
Definition: geo_tools.h:128
CSG_Distance_Weighting::Get_Weight
double Get_Weight(double Distance) const
Definition: geo_tools.h:723
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:326
CSG_Projection::Get_EPSG
int Get_EPSG(void) const
Definition: geo_tools.h:883
CSG_Rect_Int::Get_TopLeft
TSG_Point_Int Get_TopLeft(void) const
Definition: geo_tools.h:623
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:394
TSG_Point_3D
struct SSG_Point_3D TSG_Point_3D
CSG_Rect_Int::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:621
CSG_Projection::Get_Unit
TSG_Projection_Unit Get_Unit(void) const
Definition: geo_tools.h:896
CSG_File
Definition: api_core.h:1116
CSG_Point_4D::~CSG_Point_4D
virtual ~CSG_Point_4D(void)
Definition: geo_tools.h:371
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
SG_Get_Polygon_Area
SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area(TSG_Point *Points, int nPoints)
Definition: geo_functions.cpp:514
CSG_Points::Add
bool Add(const TSG_Point &Point)
Definition: geo_tools.h:196
SG_Get_Projection_Unit_To_Meter
SAGA_API_DLL_EXPORT double SG_Get_Projection_Unit_To_Meter(TSG_Projection_Unit Unit)
Definition: projections.cpp:178
CSG_Projection::Get_Type
TSG_Projection_Type Get_Type(void) const
Definition: geo_tools.h:887
SG_Get_Triangle_CircumCircle
SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle(TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
Definition: geo_functions.cpp:465
SG_PROJ_UNIT_Indian_Chain
@ SG_PROJ_UNIT_Indian_Chain
Definition: geo_tools.h:811
CSG_Rect_Int
Definition: geo_tools.h:583
SG_DISTWGHT_IDW
@ SG_DISTWGHT_IDW
Definition: geo_tools.h:687
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
SG_Get_Distance_Polar
SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar(double aLon, double aLat, double bLon, double bLat, double a=6378137., double e=298.257223563, bool bDegree=true)
Definition: geo_functions.cpp:157
CSG_Point
Definition: geo_tools.h:135
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Points_Int::Add
bool Add(const TSG_Point_Int &Point)
Definition: geo_tools.h:437
CSG_Rects_Int::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:662
CSG_Projection::Get_Name
const CSG_String & Get_Name(void) const
Definition: geo_tools.h:878
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Projection::Get_Unit_Identifier
CSG_String Get_Unit_Identifier(void) const
Definition: geo_tools.h:897
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Point_4D
Definition: geo_tools.h:364
sLong
signed long long sLong
Definition: api_core.h:158
SG_PROJ_UNIT_Int_Nautical_Mile
@ SG_PROJ_UNIT_Int_Nautical_Mile
Definition: geo_tools.h:796
CSG_Rect_Int::Get_BottomRight
TSG_Point_Int Get_BottomRight(void) const
Definition: geo_tools.h:624
CSG_Projection::Get_Authority_ID
int Get_Authority_ID(void) const
Definition: geo_tools.h:882
CSG_Distance_Weighting
Definition: geo_tools.h:700
CSG_Projection::Get_Proj4
const CSG_String & Get_Proj4(void) const
Definition: geo_tools.h:880
TSG_Point_Int
struct SSG_Point_Int TSG_Point_Int
SG_PROJ_UNIT_US_Chain
@ SG_PROJ_UNIT_US_Chain
Definition: geo_tools.h:807
SSG_Rect_Int::xMax
int xMax
Definition: geo_tools.h:577
CSG_Points_3D::Get_Points
TSG_Point_3D * Get_Points(void) const
Definition: geo_tools.h:338
SG_PROJ_UNIT_Centimeter
@ SG_PROJ_UNIT_Centimeter
Definition: geo_tools.h:794
CSG_Lines::Get_Line
const CSG_Points & Get_Line(sLong Index) const
Definition: geo_tools.h:242
SSG_Rect_Int::xMin
int xMin
Definition: geo_tools.h:577
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Distance_Weighting::Get_BandWidth
double Get_BandWidth(void) const
Definition: geo_tools.h:719
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:239
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
TSG_Projection_Unit
TSG_Projection_Unit
Definition: geo_tools.h:790
SG_Get_Projections
SAGA_API_DLL_EXPORT CSG_Projections & SG_Get_Projections(void)
Definition: projections.cpp:66
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
TSG_Point_4D
struct SSG_Point_4D TSG_Point_4D
SG_is_Angle_Between
SAGA_API_DLL_EXPORT bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange=true)
Definition: geo_functions.cpp:257
SG_PROJ_TYPE_CS_Projected
@ SG_PROJ_TYPE_CS_Projected
Definition: geo_tools.h:781
CSG_Point::is_Equal
virtual bool is_Equal(double _x, double _y, double epsilon=0.) const
Definition: geo_tools.h:175
CSG_Points
Definition: geo_tools.h:184
SG_PROJ_UNIT_US_Yard
@ SG_PROJ_UNIT_US_Yard
Definition: geo_tools.h:806
CSG_Rect::Get_BottomRight
CSG_Point Get_BottomRight(void) const
Definition: geo_tools.h:512
CSG_Projection
Definition: geo_tools.h:833
CSG_Table
Definition: table.h:283
CSG_Projection::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: geo_tools.h:889
CSG_Rect::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:509
SG_PROJ_FMT_EPSG
@ SG_PROJ_FMT_EPSG
Definition: geo_tools.h:773
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Rects_Int::Get_Rect
CSG_Rect_Int & Get_Rect(int Index)
Definition: geo_tools.h:665
CSG_Points_3D::Del
bool Del(sLong Index)
Definition: geo_tools.h:333
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array
Definition: api_core.h:308
B
#define B
CSG_Points_Int::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:440
SG_PROJ_UNIT_Kilometer
@ SG_PROJ_UNIT_Kilometer
Definition: geo_tools.h:791
CSG_String
Definition: api_core.h:557
SG_Get_Projection_Unit_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Name(TSG_Projection_Unit Unit, bool bSimple=false)
Definition: projections.cpp:169
CSG_Array_Pointer
Definition: api_core.h:368
SG_PROJ_UNIT_Undefined
@ SG_PROJ_UNIT_Undefined
Definition: geo_tools.h:812
CSG_Point_3D::~CSG_Point_3D
virtual ~CSG_Point_3D(void)
Definition: geo_tools.h:278
SSG_Point_Int
Definition: geo_tools.h:418
CSG_MetaData
Definition: metadata.h:88
CSG_Projection::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: geo_tools.h:888
CSG_Distance_Weighting::Get_IDW_Power
double Get_IDW_Power(void) const
Definition: geo_tools.h:713
TSG_Rect
struct SSG_Rect TSG_Rect
CSG_Rect::Get_Center
CSG_Point Get_Center(void) const
Definition: geo_tools.h:514
CSG_Rect_Int::Get_YRange
int Get_YRange(void) const
Definition: geo_tools.h:618
SG_Get_Projection_Type_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Name(TSG_Projection_Type Type)
Definition: projections.cpp:99
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
SG_Is_Point_On_Line
SAGA_API_DLL_EXPORT bool SG_Is_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=false, double Epsilon=0.)
Definition: geo_functions.cpp:394
CSG_Points_Int::Del
bool Del(sLong Index)
Definition: geo_tools.h:438
metadata.h
TSG_Point_Type::SG_POINT_TYPE_2D
@ SG_POINT_TYPE_2D
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
CSG_Projection::Get_Unit_To_Meter
double Get_Unit_To_Meter(void) const
Definition: geo_tools.h:899
CSG_Projection::is_Projection
bool is_Projection(void) const
Definition: geo_tools.h:891
SG_PROJ_UNIT_Int_Fathom
@ SG_PROJ_UNIT_Int_Fathom
Definition: geo_tools.h:801
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SG_PROJ_TYPE_CS_Undefined
@ SG_PROJ_TYPE_CS_Undefined
Definition: geo_tools.h:784
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect_Int::Get_YMax
int Get_YMax(void) const
Definition: geo_tools.h:615
SG_PROJ_UNIT_Millimeter
@ SG_PROJ_UNIT_Millimeter
Definition: geo_tools.h:795
TSG_Projection_Format
TSG_Projection_Format
Definition: geo_tools.h:770
CSG_Point_3D::is_Equal
virtual bool is_Equal(const CSG_Point_3D &Point, double epsilon=0.) const
Definition: geo_tools.h:310
CSG_Rects_Int
Definition: geo_tools.h:648
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point_Int::y
int y
Definition: geo_tools.h:419
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
SG_PROJ_UNIT_Meter
@ SG_PROJ_UNIT_Meter
Definition: geo_tools.h:792
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Projection::is_Geocentric
bool is_Geocentric(void) const
Definition: geo_tools.h:893
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
CSG_Lines::Get_Line
CSG_Points & Get_Line(sLong Index)
Definition: geo_tools.h:241
SG_PROJ_UNIT_Decimeter
@ SG_PROJ_UNIT_Decimeter
Definition: geo_tools.h:793
CSG_Shapes
Definition: shapes.h:773
SG_PROJ_TYPE_CS_Geocentric
@ SG_PROJ_TYPE_CS_Geocentric
Definition: geo_tools.h:783
CSG_Lines
Definition: geo_tools.h:216
TSG_Point
struct SSG_Point TSG_Point
CSG_Points::Get_Points
TSG_Point * Get_Points(void) const
Definition: geo_tools.h:202
CSG_Projections::Destroy
void Destroy(void)
Definition: projections.cpp:786
CSG_Points::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:199
CSG_Points::Clear
bool Clear(void)
Definition: geo_tools.h:190
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Parameters
Definition: parameters.h:1650
SG_Get_Nearest_Point_On_Line
SAGA_API_DLL_EXPORT double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch=true)
Definition: geo_functions.cpp:421
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
CSG_Projection::Get_Authority
const CSG_String & Get_Authority(void) const
Definition: geo_tools.h:881
SG_Get_Projection_Type
SAGA_API_DLL_EXPORT TSG_Projection_Type SG_Get_Projection_Type(const CSG_String &Identifier)
Definition: projections.cpp:77
SG_Is_Equal
SAGA_API_DLL_EXPORT bool SG_Is_Equal(double a, double b, double epsilon=0.)
Definition: geo_functions.cpp:64
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
SSG_Point_Int::x
int x
Definition: geo_tools.h:419
TSG_Point_Type
TSG_Point_Type
Definition: geo_tools.h:112
CSG_Point::is_Equal
virtual bool is_Equal(const CSG_Point &Point, double epsilon=0.) const
Definition: geo_tools.h:174
SG_DISTWGHT_None
@ SG_DISTWGHT_None
Definition: geo_tools.h:686
SG_Get_Projected
SAGA_API_DLL_EXPORT bool SG_Get_Projected(class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target)
Definition: projections.cpp:2191
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Distance_Weighting::Get_Weighting
TSG_Distance_Weighting Get_Weighting(void) const
Definition: geo_tools.h:710
CSG_Rect_Int::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:620
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Points::Del
bool Del(sLong Index)
Definition: geo_tools.h:197
CSG_Projections
Definition: geo_tools.h:928
SG_PROJ_FMT_Proj4
@ SG_PROJ_FMT_Proj4
Definition: geo_tools.h:772
SG_Grid_Get_Geographic_Coordinates
SAGA_API_DLL_EXPORT bool SG_Grid_Get_Geographic_Coordinates(CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
Definition: projections.cpp:2307
CSG_Distance_Weighting::Get_IDW_Offset
bool Get_IDW_Offset(void) const
Definition: geo_tools.h:716
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
grid.cpp File Reference
#include "grid.h"
#include "data_manager.h"

Go to the source code of this file.

Macros

#define | BILINEAR_ADD(ix, iy, d)
#define | BILINEAR_ADD_BYTE(ix, iy, d)
#define | BiCubicSpline(d, v) (v[1] + 0.5 * d * (v[2] - v[0] + d * (2 * v[0] - 5 * v[1] + 4 * v[2] - v[3] + d * (3 * (v[1] - v[2]) + v[3] - v[0]))))
#define | SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255
#define | SORT_SWAP(a, b) {itemp=(a);(a)=(b);(b)=itemp;}

Functions

CSG_Grid * | SG_Create_Grid (void)
CSG_Grid * | SG_Create_Grid (const CSG_Grid &Grid)
CSG_Grid * | SG_Create_Grid (const char *File, TSG_Data_Type Type, bool bCached, bool bLoadData)
CSG_Grid * | SG_Create_Grid (const wchar_t *File, TSG_Data_Type Type, bool bCached, bool bLoadData)
CSG_Grid * | SG_Create_Grid (const CSG_String &File, TSG_Data_Type Type, bool bCached, bool bLoadData)
CSG_Grid * | SG_Create_Grid (CSG_Grid *pGrid, TSG_Data_Type Type, bool bCached)
CSG_Grid * | SG_Create_Grid (const CSG_Grid_System &System, TSG_Data_Type Type, bool bCached)
CSG_Grid * | SG_Create_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin, bool bCached)

Macro Definition Documentation

◆ BiCubicSpline

#define BiCubicSpline | ( | d,
 |  | v
 | ) | (v[1] + 0.5 * d * (v[2] - v[0] + d * (2 * v[0] - 5 * v[1] + 4 * v[2] - v[3] + d * (3 * (v[1] - v[2]) + v[3] - v[0]))))

◆ BILINEAR_ADD

#define BILINEAR_ADD | ( | ix,
 |  | iy,
 |  | d
 | ) |
Value:
if( is_InGrid(ix, iy) ) {\
n += d; z += d * asDouble(ix, iy);\
}

Definition at line 608 of file grid.cpp.

◆ BILINEAR_ADD_BYTE

#define BILINEAR_ADD_BYTE | ( | ix,
 |  | iy,
 |  | d
 | ) |
Value:
if( is_InGrid(ix, iy) ) {\
n += d; sLong v = asInt(ix, iy);\
z[0] += d * SG_GET_BYTE_0(v);\
z[1] += d * SG_GET_BYTE_1(v);\
z[2] += d * SG_GET_BYTE_2(v);\
z[3] += d * SG_GET_BYTE_3(v);\
}

Definition at line 613 of file grid.cpp.

◆ SG_GRID_HISTOGRAM_CLASSES_DEFAULT

#define SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255

Definition at line 1170 of file grid.cpp.

◆ SORT_SWAP

#define SORT_SWAP | ( | a,
 |  | b
 | ) | {itemp=(a);(a)=(b);(b)=itemp;}

Function Documentation

◆ SG_Create_Grid() [1/8]

CSG_Grid* SG_Create_Grid | ( | const char * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 86 of file grid.cpp.

References SG_Create_Grid().

◆ SG_Create_Grid() [2/8]

CSG_Grid* SG_Create_Grid ( const CSG_Grid & Grid )

Safe grid construction

Definition at line 78 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [3/8]

CSG_Grid* SG_Create_Grid | ( | const CSG_Grid_System & | System,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 104 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [4/8]

CSG_Grid* SG_Create_Grid | ( | const CSG_String & | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 88 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [5/8]

CSG_Grid* SG_Create_Grid | ( | const wchar_t * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 87 of file grid.cpp.

References SG_Create_Grid().

◆ SG_Create_Grid() [6/8]

CSG_Grid* SG_Create_Grid | ( | CSG_Grid * | pGrid,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 96 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [7/8]

CSG_Grid* SG_Create_Grid | ( | TSG_Data_Type | Type,
 |  | int | NX,
 |  | int | NY,
 |  | double | Cellsize = 0.0,
 |  | double | xMin = 0.0,
 |  | double | yMin = 0.0,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 112 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [8/8]

CSG_Grid* SG_Create_Grid ( void )

Safe grid construction

Definition at line 72 of file grid.cpp.

Referenced by CSG_Grids::Add_Grid(), CSG_Grids::Del_Grid(), CSG_Grids::Del_Grids(), CSG_Parameters_Grid_Target::Get_Grid(), and SG_Create_Grid().

SG_GET_BYTE_1
#define SG_GET_BYTE_1(vLong)
Definition: api_core.h:195
SG_GET_BYTE_3
#define SG_GET_BYTE_3(vLong)
Definition: api_core.h:197
sLong
signed long long sLong
Definition: api_core.h:158
SG_GET_BYTE_0
#define SG_GET_BYTE_0(vLong)
Definition: api_core.h:194
SG_GET_BYTE_2
#define SG_GET_BYTE_2(vLong)
Definition: api_core.h:196
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid.cpp Source File

  • saga_core
  • saga_api
grid.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "grid.h"
52 #include "data_manager.h"
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
62 BYTE CSG_Grid::m_Bitmask[8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 };
63
64
66 // //
67 // //
68 // //
70
71 //---------------------------------------------------------
72 CSG_Grid * SG_Create_Grid(void)
73 {
74 return( new CSG_Grid );
75 }
76
77 //---------------------------------------------------------
78 CSG_Grid * SG_Create_Grid(const CSG_Grid &Grid)
79 {
80 CSG_Grid *pGrid = new CSG_Grid(Grid);
81
82 if( !pGrid->is_Valid() ) { delete(pGrid); return( NULL ); } return( pGrid );
83 }
84
85 //---------------------------------------------------------
86 CSG_Grid * SG_Create_Grid(const char *File, TSG_Data_Type Type, bool bCached, bool bLoadData) { return( SG_Create_Grid(CSG_String(File), Type, bCached, bLoadData) ); }
87 CSG_Grid * SG_Create_Grid(const wchar_t *File, TSG_Data_Type Type, bool bCached, bool bLoadData) { return( SG_Create_Grid(CSG_String(File), Type, bCached, bLoadData) ); }
88 CSG_Grid * SG_Create_Grid(const CSG_String &File, TSG_Data_Type Type, bool bCached, bool bLoadData)
89 {
90 CSG_Grid *pGrid = new CSG_Grid(File, Type, bCached, bLoadData);
91
92 if( !pGrid->is_Valid() ) { delete(pGrid); return( NULL ); } return( pGrid );
93 }
94
95 //---------------------------------------------------------
96 CSG_Grid * SG_Create_Grid(CSG_Grid *pGrid, TSG_Data_Type Type, bool bCached)
97 {
98 pGrid = new CSG_Grid(pGrid, Type, bCached);
99
100 if( !pGrid->is_Valid() ) { delete(pGrid); return( NULL ); } return( pGrid );
101 }
102
103 //---------------------------------------------------------
104 CSG_Grid * SG_Create_Grid(const CSG_Grid_System &System, TSG_Data_Type Type, bool bCached)
105 {
106 CSG_Grid *pGrid = new CSG_Grid(System, Type, bCached);
107
108 if( !pGrid->is_Valid() ) { delete(pGrid); return( NULL ); } return( pGrid );
109 }
110
111 //---------------------------------------------------------
112 CSG_Grid * SG_Create_Grid(TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin, bool bCached)
113 {
114 CSG_Grid *pGrid = new CSG_Grid(Type, NX, NY, Cellsize, xMin, yMin, bCached);
115
116 if( !pGrid->is_Valid() ) { delete(pGrid); return( NULL ); } return( pGrid );
117 }
118
119
121 // //
122 // //
123 // //
125
126 //---------------------------------------------------------
130 //---------------------------------------------------------
131 CSG_Grid::CSG_Grid(void)
132 : CSG_Data_Object()
133 {
134 _On_Construction();
135 }
136
137 //---------------------------------------------------------
141 //---------------------------------------------------------
142 CSG_Grid::CSG_Grid(const CSG_Grid &Grid)
143 : CSG_Data_Object()
144 {
145 _On_Construction(); Create(Grid);
146 }
147
148 //---------------------------------------------------------
152 //---------------------------------------------------------
153 CSG_Grid::CSG_Grid(const char *File, TSG_Data_Type Type, bool bCached, bool bLoadData) : CSG_Grid(CSG_String(File), Type, bCached, bLoadData) {}
154 CSG_Grid::CSG_Grid(const wchar_t *File, TSG_Data_Type Type, bool bCached, bool bLoadData) : CSG_Grid(CSG_String(File), Type, bCached, bLoadData) {}
155 CSG_Grid::CSG_Grid(const CSG_String &File, TSG_Data_Type Type, bool bCached, bool bLoadData)
156 : CSG_Data_Object()
157 {
158 _On_Construction(); Create(File, Type, bCached, bLoadData);
159 }
160
161 //---------------------------------------------------------
165 //---------------------------------------------------------
166 CSG_Grid::CSG_Grid(CSG_Grid *pGrid, TSG_Data_Type Type, bool bCached)
167 : CSG_Data_Object()
168 {
169 _On_Construction(); Create(pGrid, Type, bCached);
170 }
171
172 //---------------------------------------------------------
176 //---------------------------------------------------------
177 CSG_Grid::CSG_Grid(const CSG_Grid_System &System, TSG_Data_Type Type, bool bCached)
178 : CSG_Data_Object()
179 {
180 _On_Construction(); Create(System, Type, bCached);
181 }
182
183 //---------------------------------------------------------
190 //---------------------------------------------------------
191 CSG_Grid::CSG_Grid(TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin, bool bCached)
192 : CSG_Data_Object()
193 {
194 _On_Construction(); Create(Type, NX, NY, Cellsize, xMin, yMin, bCached);
195 }
196
197
199 // //
201
202 //---------------------------------------------------------
203 void CSG_Grid::_On_Construction(void)
204 {
205 m_Type = SG_DATATYPE_Undefined;
206
207 m_Values = NULL;
208
209 m_Cache_Stream = NULL;
210 m_Cache_Offset = 0;
211 m_Cache_bSwap = false;
212 m_Cache_bFlip = false;
213
214 m_zScale = 1.;
215 m_zOffset = 0.;
216
217 m_Index = NULL;
218
219 m_pOwner = NULL;
220
221 Set_Update_Flag();
222 }
223
224
226 // //
228
229 //---------------------------------------------------------
230 bool CSG_Grid::Create(const CSG_Grid &Grid)
231 {
232 if( Create(Grid.Get_System(), Grid.Get_Type()) )
233 {
234 Set_Name (Grid.Get_Name ());
235 Set_Description (Grid.Get_Description());
236 Set_Unit (Grid.Get_Unit ());
237 Set_NoData_Value_Range(Grid.Get_NoData_Value(), Grid.Get_NoData_Value(true));
238 Set_Scaling (Grid.Get_Scaling(), Grid.Get_Offset());
239 Get_MetaData().Create (Grid.Get_MetaData());
240
241 #pragma omp parallel for
242 for(int y=0; y<Get_NY(); y++)
243 {
244 for(int x=0; x<Get_NX(); x++)
245 {
246 Set_Value(x, y, Grid.asDouble(x, y, false), false);
247 }
248 }
249
250 return( true );
251 }
252
253 return( false );
254 }
255
256 //---------------------------------------------------------
257 bool CSG_Grid::Create(CSG_Grid *pGrid, TSG_Data_Type Type, bool bCached)
258 {
259 if( pGrid )
260 {
261 if( Type == SG_DATATYPE_Undefined )
262 {
263 Type = pGrid->Get_Type();
264 }
265
266 if( Create(Type, pGrid->Get_NX(), pGrid->Get_NY(), pGrid->Get_Cellsize(), pGrid->Get_XMin(), pGrid->Get_YMin(), bCached) )
267 {
268 Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_Value(true));
269
270 Get_Projection() = pGrid->Get_Projection();
271
272 return( true );
273 }
274 }
275
276 return( false );
277 }
278
279 //---------------------------------------------------------
280 bool CSG_Grid::Create(const CSG_Grid_System &System, TSG_Data_Type Type, bool bCached)
281 {
282 return( Create(Type, System.Get_NX(), System.Get_NY(), System.Get_Cellsize(), System.Get_XMin(), System.Get_YMin(), bCached) );
283 }
284
285 //---------------------------------------------------------
286 bool CSG_Grid::Create(const char *File, TSG_Data_Type Type, bool bCached, bool bLoadData) { return( Create(CSG_String(File), Type, bCached, bLoadData) ); }
287 bool CSG_Grid::Create(const wchar_t *File, TSG_Data_Type Type, bool bCached, bool bLoadData) { return( Create(CSG_String(File), Type, bCached, bLoadData) ); }
288 bool CSG_Grid::Create(const CSG_String &File, TSG_Data_Type Type, bool bCached, bool bLoadData)
289 {
290 Destroy();
291
292 SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Loading grid"), File.c_str()), true);
293
294 m_Type = Type;
295
296 if( _Load_PGSQL (File, bCached, bLoadData)
297 || _Load_Native (File, bCached, bLoadData)
298 || _Load_Compressed(File, bCached, bLoadData)
299 || _Load_Surfer (File, bCached, bLoadData)
300 || _Load_External (File, bCached, bLoadData) )
301 {
302 Set_Max_Samples(SG_DataObject_Get_Max_Samples() > 0 ? SG_DataObject_Get_Max_Samples() : Get_NCells());
303
304 Set_Modified(false);
305 Set_Update_Flag();
306
307 SG_UI_Process_Set_Ready();
308 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
309
310 return( true );
311 }
312
313 Destroy();
314
315 SG_UI_Process_Set_Ready();
316 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
317
318 return( false );
319 }
320
321 //---------------------------------------------------------
322 bool CSG_Grid::Create(TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin, bool bCached)
323 {
324 Destroy();
325
326 _Set_Properties(Type, NX, NY, Cellsize, xMin, yMin);
327
328 return( _Memory_Create(bCached) );
329 }
330
331
333 // //
334 // Destruction //
335 // //
337
338 //---------------------------------------------------------
342 CSG_Grid::~CSG_Grid(void)
343 {
344 Destroy();
345 }
346
350 bool CSG_Grid::Destroy(void)
351 {
352 _Memory_Destroy();
353
354 m_Type = SG_DATATYPE_Undefined;
355
356 m_zScale = 1.;
357 m_zOffset = 0.;
358
359 m_Unit .Clear();
360
361 m_System .Assign(0., 0., 0., 0, 0);
362
363 return( CSG_Data_Object::Destroy() );
364 }
365
366
368 // //
369 // Header //
370 // //
372
373 //---------------------------------------------------------
374 void CSG_Grid::_Set_Properties(TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin)
375 {
376 m_Type = Type;
377
378 switch( m_Type )
379 {
380 case SG_DATATYPE_Bit : Set_NoData_Value( 0.); break;
381 case SG_DATATYPE_Byte : Set_NoData_Value( 0.); break;
382 case SG_DATATYPE_Char : Set_NoData_Value( -127.); break;
383 case SG_DATATYPE_Word : Set_NoData_Value( 65535.); break;
384 case SG_DATATYPE_Short : Set_NoData_Value( -32767.); break;
385 case SG_DATATYPE_DWord : Set_NoData_Value( 4294967295.); break;
386 case SG_DATATYPE_Int : Set_NoData_Value(-2147483647.); break;
387 case SG_DATATYPE_ULong : Set_NoData_Value( 4294967295.); break;
388 case SG_DATATYPE_Long : Set_NoData_Value(-2147483647.); break;
389 case SG_DATATYPE_Float : Set_NoData_Value( -99999.); break;
390 case SG_DATATYPE_Double: Set_NoData_Value( -99999.); break;
391 case SG_DATATYPE_Color : Set_NoData_Value( 4294967295.); break;
392
393 default:
394 m_Type = SG_DATATYPE_Float; Set_NoData_Value( -99999.); break;
395 }
396
397 m_System.Assign(Cellsize > 0. ? Cellsize : 1., xMin, yMin, NX, NY);
398
399 m_Statistics.Invalidate();
400
401 m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
402 m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
403
404 Set_Max_Samples(SG_DataObject_Get_Max_Samples() > 0 ? SG_DataObject_Get_Max_Samples() : Get_NCells());
405 }
406
407 //---------------------------------------------------------
408 void CSG_Grid::Set_Unit(const CSG_String &Unit)
409 {
410 m_Unit = Unit;
411 }
412
413 //---------------------------------------------------------
414 void CSG_Grid::Set_Scaling(double Scale, double Offset)
415 {
416 if( (Scale != m_zScale && Scale != 0.) || Offset != m_zOffset )
417 {
418 if( Scale != 0. )
419 {
420 m_zScale = Scale;
421 }
422
423 m_zOffset = Offset;
424
425 Set_Update_Flag();
426 }
427 }
428
429 //---------------------------------------------------------
430 double CSG_Grid::Get_Scaling(void) const
431 {
432 return( m_zScale );
433 }
434
435 //---------------------------------------------------------
436 double CSG_Grid::Get_Offset(void) const
437 {
438 return( m_zOffset );
439 }
440
441
443 // //
444 // Checks //
445 // //
447
448 //---------------------------------------------------------
449 bool CSG_Grid::is_Valid(void) const
450 {
451 if( m_System.is_Valid() && m_Type != SG_DATATYPE_Undefined )
452 {
453 return( m_Values != NULL || is_Cached() );
454 }
455
456 return( false );
457 }
458
459 //---------------------------------------------------------
460 TSG_Intersection CSG_Grid::is_Intersecting(const CSG_Rect &Extent) const
461 {
462 return( Get_Extent().Intersects(Extent) );
463 }
464
465 TSG_Intersection CSG_Grid::is_Intersecting(const TSG_Rect &Extent) const
466 {
467 return( Get_Extent().Intersects(Extent) );
468 }
469
470 TSG_Intersection CSG_Grid::is_Intersecting(double xMin, double yMin, double xMax, double yMax) const
471 {
472 return( is_Intersecting(CSG_Rect(xMin, yMin, xMax, yMax)) );
473 }
474
475 //---------------------------------------------------------
476 bool CSG_Grid::is_Compatible(CSG_Grid *pGrid) const
477 {
478 return( pGrid && is_Compatible(pGrid->Get_System()) );
479 }
480
481 bool CSG_Grid::is_Compatible(const CSG_Grid_System &System) const
482 {
483 return( m_System == System );
484 }
485
486 bool CSG_Grid::is_Compatible(int NX, int NY, double Cellsize, double xMin, double yMin) const
487 {
488 return( is_Compatible(CSG_Grid_System(Cellsize, xMin, yMin, NX, NY)) );
489 }
490
491
493 // //
494 // value access by row //
495 // //
497
498 //---------------------------------------------------------
499 CSG_Vector CSG_Grid::Get_Row(int y) const
500 {
501 CSG_Vector Values;
502
503 if( y >= 0 && y < Get_NY() )
504 {
505 Values.Create(Get_NX());
506
507 for(int x=0; x<Get_NX(); x++)
508 {
509 Values[x] = asDouble(x, y);
510 }
511 }
512
513 return( Values );
514 }
515
516 //---------------------------------------------------------
517 bool CSG_Grid::Set_Row(int y, const CSG_Vector &Values)
518 {
519 if( y >= 0 && y < Get_NY() && Values.Get_N() == Get_NX() )
520 {
521 for(int x=0; x<Get_NX(); x++)
522 {
523 Set_Value(x, y, Values[x]);
524 }
525
526 return( true );
527 }
528
529 return( false );
530 }
531
532
534 // //
535 // Value access by Position (-> Interpolation) //
536 // //
538
539 //---------------------------------------------------------
540 double CSG_Grid::Get_Value(const TSG_Point &p, TSG_Grid_Resampling Resampling, bool bByteWise) const
541 {
542 double Value;
543
544 return( Get_Value(p.x, p.y, Value, Resampling, false, bByteWise) ? Value : Get_NoData_Value() );
545 }
546
547 double CSG_Grid::Get_Value(double x, double y, TSG_Grid_Resampling Resampling, bool bByteWise) const
548 {
549 double Value;
550
551 return( Get_Value(x, y, Value, Resampling, false, bByteWise) ? Value : Get_NoData_Value() );
552 }
553
554 bool CSG_Grid::Get_Value(const TSG_Point &p, double &Value, TSG_Grid_Resampling Resampling, bool bNoData, bool bByteWise) const
555 {
556 return( Get_Value(p.x, p.y, Value, Resampling, bNoData, bByteWise) );
557 }
558
559 //---------------------------------------------------------
560 bool CSG_Grid::Get_Value(double x, double y, double &Value, TSG_Grid_Resampling Resampling, bool bNoData, bool bByteWise) const
561 {
562 if( m_System.Get_Extent(true).Contains(x, y) )
563 {
564 int ix = (int)floor(x = (x - Get_XMin()) / Get_Cellsize()); double dx = x - ix;
565 int iy = (int)floor(y = (y - Get_YMin()) / Get_Cellsize()); double dy = y - iy;
566
567 if( bNoData || is_InGrid(ix + (int)(0.5 + dx), iy + (int)(0.5 + dy)) )
568 {
569 switch( Resampling )
570 {
571 case GRID_RESAMPLING_NearestNeighbour: return( _Get_ValAtPos_NearestNeighbour(Value, ix, iy, dx, dy ) );
572 case GRID_RESAMPLING_Bilinear : return( _Get_ValAtPos_BiLinear (Value, ix, iy, dx, dy, bByteWise) );
573 case GRID_RESAMPLING_BicubicSpline : return( _Get_ValAtPos_BiCubicSpline (Value, ix, iy, dx, dy, bByteWise) );
574 case GRID_RESAMPLING_BSpline: default: return( _Get_ValAtPos_BSpline (Value, ix, iy, dx, dy, bByteWise) );
575 }
576 }
577 }
578
579 Value = Get_NoData_Value();
580
581 return( false );
582 }
583
584
586 // //
588
589 //---------------------------------------------------------
590 inline bool CSG_Grid::_Get_ValAtPos_NearestNeighbour(double &Value, int x, int y, double dx, double dy) const
591 {
592 if( is_InGrid(x = x + (int)(0.5 + dx), y = y + (int)(0.5 + dy)) )
593 {
594 Value = asDouble(x, y);
595
596 return( true );
597 }
598
599 return( false );
600 }
601
602
604 // //
606
607 //---------------------------------------------------------
608 #define BILINEAR_ADD(ix, iy, d) if( is_InGrid(ix, iy) ) {\
609 n += d; z += d * asDouble(ix, iy);\
610 }
611
612 //---------------------------------------------------------
613 #define BILINEAR_ADD_BYTE(ix, iy, d) if( is_InGrid(ix, iy) ) {\
614 n += d; sLong v = asInt(ix, iy);\
615 z[0] += d * SG_GET_BYTE_0(v);\
616 z[1] += d * SG_GET_BYTE_1(v);\
617 z[2] += d * SG_GET_BYTE_2(v);\
618 z[3] += d * SG_GET_BYTE_3(v);\
619 }
620
621 //---------------------------------------------------------
622 inline bool CSG_Grid::_Get_ValAtPos_BiLinear(double &Value, int x, int y, double dx, double dy, bool bByteWise) const
623 {
624 if( !bByteWise )
625 {
626 double z = 0., n = 0.;
627
628 BILINEAR_ADD(x , y , (1. - dx) * (1. - dy));
629 BILINEAR_ADD(x + 1, y , ( dx) * (1. - dy));
630 BILINEAR_ADD(x , y + 1, (1. - dx) * ( dy));
631 BILINEAR_ADD(x + 1, y + 1, ( dx) * ( dy));
632
633 if( n > 0. )
634 {
635 Value = z / n;
636
637 return( true );
638 }
639 }
640
641 //-----------------------------------------------------
642 else
643 {
644 double n = 0.;
645 CSG_Vector z(4);
646
647 BILINEAR_ADD_BYTE(x , y , (1. - dx) * (1. - dy));
648 BILINEAR_ADD_BYTE(x + 1, y , ( dx) * (1. - dy));
649 BILINEAR_ADD_BYTE(x , y + 1, (1. - dx) * ( dy));
650 BILINEAR_ADD_BYTE(x + 1, y + 1, ( dx) * ( dy));
651
652 if( n > 0. )
653 {
654 z *= 1. / n;
655
656 Value = SG_GET_LONG(z[0], z[1], z[2], z[3]);
657
658 return( true );
659 }
660 }
661
662 return( false );
663 }
664
665
667 // //
669
670 //---------------------------------------------------------
671 inline double CSG_Grid::_Get_ValAtPos_BiCubicSpline(double dx, double dy, double v_xy[4][4]) const
672 {
673 #define BiCubicSpline(d, v) (v[1] + 0.5 * d * (v[2] - v[0] + d * (2 * v[0] - 5 * v[1] + 4 * v[2] - v[3] + d * (3 * (v[1] - v[2]) + v[3] - v[0]))))
674
675 double v_x[4];
676
677 for(int ix=0; ix<4; ix++)
678 {
679 v_x[ix] = BiCubicSpline(dy, v_xy[ix]);
680 }
681
682 return( BiCubicSpline(dx, v_x) );
683 }
684
685 //---------------------------------------------------------
686 inline bool CSG_Grid::_Get_ValAtPos_BiCubicSpline(double &Value, int x, int y, double dx, double dy, bool bByteWise) const
687 {
688 if( !bByteWise )
689 {
690 double v_xy[4][4];
691
692 if( _Get_ValAtPos_Fill4x4Submatrix(x, y, v_xy) )
693 {
694 Value = _Get_ValAtPos_BiCubicSpline(dx, dy, v_xy);
695
696 return( true );
697 }
698 }
699 else
700 {
701 double v_xy[4][4][4];
702
703 if( _Get_ValAtPos_Fill4x4Submatrix(x, y, v_xy) )
704 {
705 Value = SG_GET_LONG(
706 _Get_ValAtPos_BiCubicSpline(dx, dy, v_xy[0]),
707 _Get_ValAtPos_BiCubicSpline(dx, dy, v_xy[1]),
708 _Get_ValAtPos_BiCubicSpline(dx, dy, v_xy[2]),
709 _Get_ValAtPos_BiCubicSpline(dx, dy, v_xy[3])
710 );
711
712 return( true );
713 }
714 }
715
716 return( false );
717 }
718
719
721 // //
723
724 //---------------------------------------------------------
725 inline double CSG_Grid::_Get_ValAtPos_BSpline(double dx, double dy, double v_xy[4][4]) const
726 {
727 double Rx[4], Ry[4];
728
729 for(int i=0; i<4; i++)
730 {
731 double d, s;
732
733 s = 0.;
734 if( (d = i - dx + 1.) > 0. ) s += d*d*d;
735 if( (d = i - dx + 0.) > 0. ) s += -4. * d*d*d;
736 if( (d = i - dx - 1.) > 0. ) s += 6. * d*d*d;
737 if( (d = i - dx - 2.) > 0. ) s += -4. * d*d*d;
738 // if( (d = i - dx - 3.) > 0. ) s += d*d*d;
739 Rx[i] = s / 6.;
740
741 s = 0.;
742 if( (d = i - dy + 1.) > 0. ) s += d*d*d;
743 if( (d = i - dy + 0.) > 0. ) s += -4. * d*d*d;
744 if( (d = i - dy - 1.) > 0. ) s += 6. * d*d*d;
745 if( (d = i - dy - 2.) > 0. ) s += -4. * d*d*d;
746 // if( (d = i - dy - 3.) > 0. ) s += d*d*d;
747 Ry[i] = s / 6.;
748 }
749
750 double z = 0.;
751
752 for(int iy=0; iy<4; iy++)
753 {
754 for(int ix=0; ix<4; ix++)
755 {
756 z += v_xy[ix][iy] * Rx[ix] * Ry[iy];
757 }
758 }
759
760 return( z );
761 }
762
763 //---------------------------------------------------------
764 inline bool CSG_Grid::_Get_ValAtPos_BSpline(double &Value, int x, int y, double dx, double dy, bool bByteWise) const
765 {
766 if( !bByteWise )
767 {
768 double v_xy[4][4];
769
770 if( _Get_ValAtPos_Fill4x4Submatrix(x, y, v_xy) )
771 {
772 Value = _Get_ValAtPos_BSpline(dx, dy, v_xy);
773
774 return( true );
775 }
776 }
777 else
778 {
779 double v_xy[4][4][4];
780
781 if( _Get_ValAtPos_Fill4x4Submatrix(x, y, v_xy) )
782 {
783 Value = SG_GET_LONG(
784 _Get_ValAtPos_BSpline(dx, dy, v_xy[0]),
785 _Get_ValAtPos_BSpline(dx, dy, v_xy[1]),
786 _Get_ValAtPos_BSpline(dx, dy, v_xy[2]),
787 _Get_ValAtPos_BSpline(dx, dy, v_xy[3])
788 );
789
790 return( true );
791 }
792 }
793
794 return( false );
795 }
796
797
799 // //
801
802 //---------------------------------------------------------
803 inline bool CSG_Grid::_Get_ValAtPos_Fill4x4Submatrix(int x, int y, double v_xy[4][4]) const
804 {
805 int ix, iy, jx, jy, nNoData = 0;
806
807 //-----------------------------------------------------
808 for(iy=0, jy=y-1; iy<4; iy++, jy++)
809 {
810 for(ix=0, jx=x-1; ix<4; ix++, jx++)
811 {
812 if( is_InGrid(jx, jy) )
813 {
814 v_xy[ix][iy] = asDouble(jx, jy);
815 }
816 else
817 {
818 v_xy[ix][iy] = Get_NoData_Value();
819
820 nNoData++;
821 }
822 }
823 }
824
825 //-----------------------------------------------------
826 for(int i=0; nNoData>0 && nNoData<16 && i<16; i++) // guess missing values as average of surrounding data values
827 {
828 double t_xy[4][4];
829
830 for(iy=0; iy<4; iy++) for(ix=0; ix<4; ix++)
831 {
832 t_xy[ix][iy] = v_xy[ix][iy];
833 }
834
835 for(iy=0; iy<4; iy++) for(ix=0; ix<4; ix++)
836 {
837 if( is_NoData_Value(t_xy[ix][iy]) )
838 {
839 int n = 0;
840 double s = 0.;
841
842 for(jy=iy-1; jy<=iy+1; jy++) for(jx=ix-1; jx<=ix+1; jx++)
843 {
844 if( is_InGrid(jx + x - 1, jy + y - 1) )
845 {
846 s += asDouble(jx + x - 1, jy + y - 1);
847 n ++;
848 }
849 else if( jy >= 0 && jy < 4 && jx >= 0 && jx < 4 && !is_NoData_Value(t_xy[jx][jy]) )
850 {
851 s += t_xy[jx][jy];
852 n ++;
853 }
854 }
855
856 if( n > 0 )
857 {
858 v_xy[ix][iy] = s / n;
859
860 nNoData--;
861 }
862 }
863 }
864 }
865
866 //-----------------------------------------------------
867 return( nNoData == 0 );
868 }
869
870 //---------------------------------------------------------
871 inline bool CSG_Grid::_Get_ValAtPos_Fill4x4Submatrix(int x, int y, double v_xy[4][4][4]) const
872 {
873 int ix, iy, jx, jy, nNoData = 0;
874
875 //-----------------------------------------------------
876 for(iy=0, jy=y-1; iy<4; iy++, jy++)
877 {
878 for(ix=0, jx=x-1; ix<4; ix++, jx++)
879 {
880 if( is_InGrid(jx, jy) )
881 {
882 int z = asInt(jx, jy);
883
884 v_xy[0][ix][iy] = SG_GET_BYTE_0(z);
885 v_xy[1][ix][iy] = SG_GET_BYTE_1(z);
886 v_xy[2][ix][iy] = SG_GET_BYTE_2(z);
887 v_xy[3][ix][iy] = SG_GET_BYTE_3(z);
888 }
889 else
890 {
891 v_xy[0][ix][iy] = -1;
892
893 nNoData++;
894 }
895 }
896 }
897
898 //-----------------------------------------------------
899 for(int i=0; nNoData>0 && nNoData<16 && i<16; i++) // guess missing values as average of surrounding data values
900 {
901 double t_xy[4][4][4];
902
903 for(iy=0; iy<4; iy++) for(ix=0; ix<4; ix++)
904 {
905 t_xy[0][ix][iy] = v_xy[0][ix][iy];
906 t_xy[1][ix][iy] = v_xy[1][ix][iy];
907 t_xy[2][ix][iy] = v_xy[2][ix][iy];
908 t_xy[3][ix][iy] = v_xy[3][ix][iy];
909 }
910
911 for(iy=0; iy<4; iy++) for(ix=0; ix<4; ix++)
912 {
913 if( t_xy[0][ix][iy] < 0 )
914 {
915 int n = 0;
916 double s[4]; s[0] = s[1] = s[2] = s[3] = 0.;
917
918 for(jy=iy-1; jy<=iy+1; jy++) for(jx=ix-1; jx<=ix+1; jx++)
919 {
920 if( is_InGrid(jx + x - 1, jy + y - 1) )
921 {
922 int z = asInt(jx + x - 1, jy + y - 1);
923
924 s[0] += SG_GET_BYTE_0(z);
925 s[1] += SG_GET_BYTE_1(z);
926 s[2] += SG_GET_BYTE_2(z);
927 s[3] += SG_GET_BYTE_3(z);
928 n ++;
929 }
930 else if( jy >= 0 && jy < 4 && jx >= 0 && jx < 4 && !is_NoData_Value(t_xy[0][jx][jy]) )
931 {
932 s[0] += t_xy[0][jx][jy];
933 s[1] += t_xy[1][jx][jy];
934 s[2] += t_xy[2][jx][jy];
935 s[3] += t_xy[3][jx][jy];
936 n ++;
937 }
938 }
939
940 if( n > 0 )
941 {
942 v_xy[0][ix][iy] = s[0] / n;
943 v_xy[1][ix][iy] = s[1] / n;
944 v_xy[2][ix][iy] = s[2] / n;
945 v_xy[3][ix][iy] = s[3] / n;
946
947 nNoData--;
948 }
949 }
950 }
951 }
952
953 //-----------------------------------------------------
954 return( nNoData == 0 );
955 }
956
957
959 // //
960 // Statistics //
961 // //
963
964 //---------------------------------------------------------
965 bool CSG_Grid::On_Update(void)
966 {
967 if( !is_Valid() )
968 {
969 return( false );
970 }
971
972 SG_FREE_SAFE(m_Index);
973
974 m_Statistics.Invalidate();
975 m_Histogram.Destroy();
976
977 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
978
979 if( Get_Max_Samples() > 0 && Get_Max_Samples() < Get_NCells() )
980 {
981 double d = (double)Get_NCells() / (double)Get_Max_Samples();
982
983 for(double i=0; i<(double)Get_NCells(); i+=d)
984 {
985 double Value = asDouble((sLong)i, false);
986
987 if( !is_NoData_Value(Value) )
988 {
989 m_Statistics += Scaling ? Offset + Scaling * Value : Value;
990 }
991 }
992
993 m_Statistics.Set_Count(m_Statistics.Get_Count() >= Get_Max_Samples() ? Get_NCells() // any no-data cells ?
994 : (sLong)(Get_NCells() * (double)m_Statistics.Get_Count() / (double)Get_Max_Samples())
995 );
996 }
997 else
998 {
999 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
1000 {
1001 for(int x=0; x<Get_NX(); x++)
1002 {
1003 double Value = asDouble(x, y, false);
1004
1005 if( !is_NoData_Value(Value) )
1006 {
1007 m_Statistics += Scaling ? Offset + Scaling * Value : Value;
1008 }
1009 }
1010 }
1011
1012 SG_UI_Process_Set_Ready();
1013 }
1014
1015 return( true );
1016 }
1017
1018 //---------------------------------------------------------
1019 double CSG_Grid::Get_Mean(void)
1020 {
1021 Update(); return( m_Statistics.Get_Mean() );
1022 }
1023
1024 double CSG_Grid::Get_Min(void)
1025 {
1026 Update(); return( m_Statistics.Get_Minimum() );
1027 }
1028
1029 double CSG_Grid::Get_Max(void)
1030 {
1031 Update(); return( m_Statistics.Get_Maximum() );
1032 }
1033
1034 double CSG_Grid::Get_Range(void)
1035 {
1036 Update(); return( m_Statistics.Get_Range() );
1037 }
1038
1039 double CSG_Grid::Get_StdDev(void)
1040 {
1041 Update(); return( m_Statistics.Get_StdDev() );
1042 }
1043
1044 double CSG_Grid::Get_Variance(void)
1045 {
1046 Update(); return( m_Statistics.Get_Variance() );
1047 }
1048
1049 //---------------------------------------------------------
1050 sLong CSG_Grid::Get_Data_Count(void)
1051 {
1052 Update(); return( m_Statistics.Get_Count() );
1053 }
1054
1055 sLong CSG_Grid::Get_NoData_Count(void)
1056 {
1057 Update(); return( Get_NCells() - m_Statistics.Get_Count() );
1058 }
1059
1060 //---------------------------------------------------------
1061 double CSG_Grid::Get_Quantile(double Quantile, bool bFromHistogram)
1062 {
1063 if( Quantile <= 0. ) { return( Get_Min() ); }
1064 if( Quantile >= 1. ) { return( Get_Max() ); }
1065
1066 if( bFromHistogram )
1067 {
1068 return( Get_Histogram().Get_Quantile(Quantile) );
1069 }
1070 else
1071 {
1072 sLong n = (sLong)(Quantile * (Get_Data_Count() - 1));
1073
1074 if( Get_Sorted(n, n, false) )
1075 {
1076 return( asDouble(n) );
1077 }
1078 }
1079
1080 return( Get_NoData_Value() );
1081 }
1082
1083 //---------------------------------------------------------
1084 double CSG_Grid::Get_Percentile(double Percentile, bool bFromHistogram)
1085 {
1086 return( Get_Quantile(0.01 * Percentile, bFromHistogram) );
1087 }
1088
1089
1091 // //
1093
1094 //---------------------------------------------------------
1101 const CSG_Simple_Statistics & CSG_Grid::Get_Statistics(void)
1102 {
1103 Update(); return( m_Statistics );
1104 }
1105
1106 //---------------------------------------------------------
1112 //---------------------------------------------------------
1113 bool CSG_Grid::Get_Statistics(const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues) const
1114 {
1115 int xMin = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMin()); if( xMin < 0 ) xMin = 0;
1116 int yMin = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMin()); if( yMin < 0 ) yMin = 0;
1117 int xMax = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMax()); if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
1118 int yMax = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMax()); if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
1119
1120 if( xMin > xMax || yMin > yMax )
1121 {
1122 return( false ); // no overlap
1123 }
1124
1125 Statistics.Create(bHoldValues);
1126
1127 int nx = 1 + (xMax - xMin);
1128 int ny = 1 + (yMax - yMin);
1129 sLong nCells = nx * ny;
1130
1131 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
1132
1133 if( Get_Max_Samples() > 0 && Get_Max_Samples() < nCells )
1134 {
1135 double d = (double)nCells / (double)Get_Max_Samples();
1136
1137 for(double i=0; i<(double)nCells; i+=d)
1138 {
1139 int y = yMin + (int)i / nx;
1140 int x = xMin + (int)i % nx;
1141
1142 double Value = asDouble(x, y, false);
1143
1144 if( !is_NoData_Value(Value) )
1145 {
1146 Statistics += Scaling ? Offset + Scaling * Value : Value;
1147 }
1148 }
1149 }
1150 else
1151 {
1152 for(int y=yMin; y<=yMax; y++)
1153 {
1154 for(int x=xMin; x<=xMax; x++)
1155 {
1156 double Value = asDouble(x, y, false);
1157
1158 if( !is_NoData_Value(Value) )
1159 {
1160 Statistics += Scaling ? Offset + Scaling * Value : Value;
1161 }
1162 }
1163 }
1164 }
1165
1166 return( Statistics.Get_Count() > 0 );
1167 }
1168
1169 //---------------------------------------------------------
1170 #define SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255
1171
1172 //---------------------------------------------------------
1177 const CSG_Histogram & CSG_Grid::Get_Histogram(size_t nClasses)
1178 {
1179 Update();
1180
1181 if( nClasses > 1 && nClasses != m_Histogram.Get_Class_Count() )
1182 {
1183 m_Histogram.Destroy();
1184 }
1185
1186 if( m_Histogram.Get_Statistics().Get_Count() < 1 )
1187 {
1188 m_Histogram.Create(nClasses > 1 ? nClasses : SG_GRID_HISTOGRAM_CLASSES_DEFAULT, Get_Min(), Get_Max(), this, (size_t)Get_Max_Samples());
1189 }
1190
1191 return( m_Histogram );
1192 }
1193
1194 //---------------------------------------------------------
1195 bool CSG_Grid::Get_Histogram(const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses) const
1196 {
1197 CSG_Simple_Statistics Statistics;
1198
1199 if( !Get_Statistics(rWorld, Statistics) )
1200 {
1201 return( false );
1202 }
1203
1204 int xMin = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMin()); if( xMin < 0 ) xMin = 0;
1205 int yMin = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMin()); if( yMin < 0 ) yMin = 0;
1206 int xMax = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMax()); if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
1207 int yMax = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMax()); if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
1208
1209 if( xMin > xMax || yMin > yMax )
1210 {
1211 return( false ); // no overlap
1212 }
1213
1214 Histogram.Create(nClasses > 1 ? nClasses : SG_GRID_HISTOGRAM_CLASSES_DEFAULT, Statistics.Get_Minimum(), Statistics.Get_Maximum());
1215
1216 int nx = 1 + (xMax - xMin);
1217 int ny = 1 + (yMax - yMin);
1218 sLong nCells = nx * ny;
1219
1220 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
1221
1222 if( Get_Max_Samples() > 0 && Get_Max_Samples() < nCells )
1223 {
1224 double d = (double)nCells / (double)Get_Max_Samples();
1225
1226 for(double i=0; i<(double)nCells; i+=d)
1227 {
1228 int y = yMin + (int)i / nx;
1229 int x = xMin + (int)i % nx;
1230
1231 double Value = asDouble(x, y, false);
1232
1233 if( !is_NoData_Value(Value) )
1234 {
1235 Histogram += Scaling ? Offset + Scaling * Value : Value;
1236 }
1237 }
1238 }
1239 else
1240 {
1241 for(int y=yMin; y<=yMax; y++)
1242 {
1243 for(int x=xMin; x<=xMax; x++)
1244 {
1245 double Value = asDouble(x, y, false);
1246
1247 if( !is_NoData_Value(Value) )
1248 {
1249 Histogram += Scaling ? Offset + Scaling * Value : Value;
1250 }
1251 }
1252 }
1253 }
1254
1255 return( Histogram.Update() );
1256 }
1257
1258
1260 // //
1261 // Index //
1262 // //
1264
1265 //---------------------------------------------------------
1266 bool CSG_Grid::_Set_Index(void)
1267 {
1268 //-----------------------------------------------------
1269 if( m_Index == NULL && (m_Index = (sLong *)SG_Malloc((size_t)Get_NCells() * sizeof(sLong))) == NULL )
1270 {
1271 SG_UI_Msg_Add_Error(_TL("could not create index: insufficient memory"));
1272
1273 return( false );
1274 }
1275
1276 //-----------------------------------------------------
1277 const sLong M = 7;
1278
1279 sLong i, j, k, l, ir, n, *istack, jstack, nstack, indxt, itemp, nData;
1280 double a;
1281
1282 //-----------------------------------------------------
1283 SG_UI_Process_Set_Text(CSG_String::Format("%s: %s", _TL("Create index"), Get_Name()));
1284
1285 for(i=0, j=0, nData=Get_NCells(); i<Get_NCells(); i++)
1286 {
1287 if( is_NoData(i) )
1288 {
1289 m_Index[--nData] = i;
1290 }
1291 else // if( !is_NoData(i) )
1292 {
1293 m_Index[j++] = i;
1294 }
1295 }
1296
1297 if( nData <= 0 )
1298 {
1299 // SG_FREE_SAFE(m_Index);
1300
1301 return( false ); // nothing to do
1302 }
1303
1304 //-----------------------------------------------------
1305 l = 0;
1306 n = 0;
1307 ir = nData - 1;
1308
1309 nstack = 64;
1310 istack = (sLong *)SG_Malloc((size_t)nstack * sizeof(sLong));
1311 jstack = 0;
1312
1313 for(;;)
1314 {
1315 if( ir - l < M )
1316 {
1317 if( !SG_UI_Process_Set_Progress((double)(n += M - 1), (double)nData) )
1318 {
1319 SG_FREE_SAFE(istack);
1320 SG_FREE_SAFE(m_Index);
1321
1322 SG_UI_Msg_Add_Error(_TL("index creation stopped by user"));
1323 SG_UI_Process_Set_Ready();
1324
1325 return( false );
1326 }
1327
1328 for(j=l+1; j<=ir; j++)
1329 {
1330 indxt = m_Index[j];
1331 a = asDouble(indxt);
1332
1333 for(i=j-1; i>=0; i--)
1334 {
1335 if( asDouble(m_Index[i]) <= a )
1336 {
1337 break;
1338 }
1339
1340 m_Index[i + 1] = m_Index[i];
1341 }
1342
1343 m_Index[i + 1] = indxt;
1344 }
1345
1346 if( jstack == 0 )
1347 {
1348 break;
1349 }
1350
1351 ir = istack[jstack--];
1352 l = istack[jstack--];
1353 }
1354
1355 //-------------------------------------------------
1356 else
1357 {
1358 #define SORT_SWAP(a,b) {itemp=(a);(a)=(b);(b)=itemp;}
1359
1360 k = (l + ir) >> 1;
1361
1362 SORT_SWAP(m_Index[k], m_Index[l + 1]);
1363
1364 if( asDouble( m_Index[l + 1]) > asDouble(m_Index[ir]) )
1365 SORT_SWAP(m_Index[l + 1], m_Index[ir]);
1366
1367 if( asDouble( m_Index[l ]) > asDouble(m_Index[ir]) )
1368 SORT_SWAP(m_Index[l ], m_Index[ir]);
1369
1370 if( asDouble( m_Index[l + 1]) > asDouble(m_Index[l ]) )
1371 SORT_SWAP(m_Index[l + 1], m_Index[l ]);
1372
1373 i = l + 1;
1374 j = ir;
1375 indxt = m_Index[l];
1376 a = asDouble(indxt);
1377
1378 for(;;)
1379 {
1380 do i++; while(asDouble(m_Index[i]) < a);
1381 do j--; while(asDouble(m_Index[j]) > a);
1382
1383 if( j < i )
1384 {
1385 break;
1386 }
1387
1388 SORT_SWAP(m_Index[i], m_Index[j]);
1389 }
1390
1391 #undef SORT_SWAP
1392
1393 m_Index[l] = m_Index[j];
1394 m_Index[j] = indxt;
1395 jstack += 2;
1396
1397 if( jstack >= nstack )
1398 {
1399 nstack += 64;
1400 istack = (sLong *)SG_Realloc(istack, (size_t)nstack * sizeof(int));
1401 }
1402
1403 if( ir - i + 1 >= j - l )
1404 {
1405 istack[jstack] = ir;
1406 istack[jstack - 1] = i;
1407 ir = j - 1;
1408 }
1409 else
1410 {
1411 istack[jstack] = j - 1;
1412 istack[jstack - 1] = l;
1413 l = i;
1414 }
1415 }
1416 }
1417
1418 //-----------------------------------------------------
1419 SG_Free(istack);
1420
1421 SG_UI_Process_Set_Ready();
1422
1423 return( true );
1424 }
1425
1426
1428 // //
1429 // //
1430 // //
1432
1433 //---------------------------------------------------------
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_Rect
Definition: geo_tools.h:471
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Grid::is_InGrid
bool is_InGrid(int x, int y, bool bCheckNoData=true) const
Definition: grid.h:593
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_Data_Object::Get_Max_Samples
sLong Get_Max_Samples(void) const
Definition: dataobject.h:254
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Data_Object::m_pOwner
CSG_Data_Object * m_pOwner
Definition: dataobject.h:259
GRID_RESAMPLING_NearestNeighbour
@ GRID_RESAMPLING_NearestNeighbour
Definition: grid.h:157
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
CSG_Histogram::Update
bool Update(void)
Definition: mat_tools.cpp:1363
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
BILINEAR_ADD_BYTE
#define BILINEAR_ADD_BYTE(ix, iy, d)
Definition: grid.cpp:613
BILINEAR_ADD
#define BILINEAR_ADD(ix, iy, d)
Definition: grid.cpp:608
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_Grid::is_Scaled
bool is_Scaled(void) const
Definition: grid.h:559
GRID_RESAMPLING_BicubicSpline
@ GRID_RESAMPLING_BicubicSpline
Definition: grid.h:159
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
CSG_Simple_Statistics::Get_Variance
double Get_Variance(void)
Definition: mat_tools.h:737
CSG_Grid::is_Intersecting
TSG_Intersection is_Intersecting(const CSG_Rect &Extent) const
Definition: grid.cpp:460
data_manager.h
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_Grid_System
Definition: grid.h:200
TSG_Grid_Resampling
TSG_Grid_Resampling
Definition: grid.h:156
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
CSG_Grid::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(void)
Definition: grid.cpp:1101
CSG_Histogram
Definition: mat_tools.h:986
CSG_Grid::CSG_Grid
CSG_Grid(void)
Definition: grid.cpp:131
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
SG_GET_BYTE_1
#define SG_GET_BYTE_1(vLong)
Definition: api_core.h:195
CSG_Grid_System::Get_yWorld_to_Grid
int Get_yWorld_to_Grid(double yWorld) const
Definition: grid.h:291
SG_Data_Type_Get_Size
size_t SG_Data_Type_Get_Size(TSG_Data_Type Type)
Definition: api_core.h:1052
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
grid.h
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Histogram::Create
bool Create(const CSG_Histogram &Histogram)
Definition: mat_tools.cpp:1495
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:558
CSG_Grid::Get_Quantile
double Get_Quantile(double Quantile, bool bFromHistogram=true)
Definition: grid.cpp:1061
SSG_Point
Definition: geo_tools.h:128
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
SSG_Rect
Definition: geo_tools.h:464
CSG_Grid::Get_Data_Count
sLong Get_Data_Count(void)
Definition: grid.cpp:1050
CSG_Grid::Destroy
virtual bool Destroy(void)
Definition: grid.cpp:350
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
CSG_Grid::Get_Variance
double Get_Variance(void)
Definition: grid.cpp:1044
CSG_Grid::Get_Scaling
double Get_Scaling(void) const
Definition: grid.cpp:430
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:548
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:539
SG_GET_BYTE_3
#define SG_GET_BYTE_3(vLong)
Definition: api_core.h:197
CSG_Vector
Definition: mat_tools.h:345
CSG_Data_Object
Definition: dataobject.h:180
GRID_RESAMPLING_Bilinear
@ GRID_RESAMPLING_Bilinear
Definition: grid.h:158
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Grid::Get_Mean
double Get_Mean(void)
Definition: grid.cpp:1019
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
SG_DataObject_Get_Max_Samples
sLong SG_DataObject_Get_Max_Samples(void)
Definition: dataobject.cpp:139
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
SORT_SWAP
#define SORT_SWAP(a, b)
CSG_Grid::Get_Max
double Get_Max(void)
Definition: grid.cpp:1029
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
CSG_Grid::Set_Scaling
void Set_Scaling(double Scale=1.0, double Offset=0.0)
Definition: grid.cpp:414
CSG_Grid::Set_Row
bool Set_Row(int y, const CSG_Vector &Values)
Definition: grid.cpp:517
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Simple_Statistics::Get_StdDev
double Get_StdDev(void)
Definition: mat_tools.h:738
CSG_Grid::Get_Unit
const CSG_String & Get_Unit(void) const
Definition: grid.h:525
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
CSG_Grid::Get_Offset
double Get_Offset(void) const
Definition: grid.cpp:436
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:544
SG_GRID_HISTOGRAM_CLASSES_DEFAULT
#define SG_GRID_HISTOGRAM_CLASSES_DEFAULT
Definition: grid.cpp:1170
CSG_Grid::Get_Value
double Get_Value(double x, double y, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const
Definition: grid.cpp:547
CSG_Grid::Get_Percentile
double Get_Percentile(double Percentile, bool bFromHistogram=true)
Definition: grid.cpp:1084
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Grid::Get_Histogram
const CSG_Histogram & Get_Histogram(size_t nClasses=0)
Definition: grid.cpp:1177
GRID_RESAMPLING_BSpline
@ GRID_RESAMPLING_BSpline
Definition: grid.h:160
CSG_Grid::Get_Sorted
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:662
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Histogram::Get_Class_Count
size_t Get_Class_Count(void) const
Definition: mat_tools.h:1018
CSG_Simple_Statistics::Set_Count
bool Set_Count(sLong Count)
Definition: mat_tools.cpp:424
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Grid::is_Compatible
bool is_Compatible(CSG_Grid *pGrid) const
Definition: grid.cpp:476
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:238
CSG_String
Definition: api_core.h:557
CSG_Grid::Get_Range
double Get_Range(void)
Definition: grid.cpp:1034
CSG_Histogram::Destroy
bool Destroy(void)
Definition: mat_tools.cpp:1272
SG_GET_LONG
#define SG_GET_LONG(b0, b1, b2, b3)
Definition: api_core.h:192
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Grid::Get_Min
double Get_Min(void)
Definition: grid.cpp:1024
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
CSG_Simple_Statistics::Get_Range
double Get_Range(void)
Definition: mat_tools.h:733
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Grid::Get_Row
CSG_Vector Get_Row(int y) const
Definition: grid.cpp:499
CSG_Grid::Get_NoData_Count
sLong Get_NoData_Count(void)
Definition: grid.cpp:1055
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Simple_Statistics::Create
bool Create(bool bHoldValues=false)
Definition: mat_tools.cpp:350
CSG_Grid_System::Get_xWorld_to_Grid
int Get_xWorld_to_Grid(double xWorld) const
Definition: grid.h:290
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
SG_GET_BYTE_0
#define SG_GET_BYTE_0(vLong)
Definition: api_core.h:194
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_Grid::On_Update
virtual bool On_Update(void)
Definition: grid.cpp:965
BiCubicSpline
#define BiCubicSpline(d, v)
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:605
CSG_Grid
Definition: grid.h:473
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_MetaData::Create
bool Create(void)
Definition: metadata.cpp:81
SG_GET_BYTE_2
#define SG_GET_BYTE_2(vLong)
Definition: api_core.h:196
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Grid::~CSG_Grid
virtual ~CSG_Grid(void)
Definition: grid.cpp:342
CSG_Grid::Set_Unit
void Set_Unit(const CSG_String &Unit)
Definition: grid.cpp:408
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:699
CSG_Grid::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grid.h:533
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Grid::Get_StdDev
double Get_StdDev(void)
Definition: grid.cpp:1039
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Histogram::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(void) const
Definition: mat_tools.h:1051
CSG_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:537
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
CSG_Grid::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grid.h:636
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Enumerations | Functions | Variables
grid.h File Reference
#include "table.h"
#include "grid_pyramid.h"

Go to the source code of this file.

Classes

class | CSG_Grid_System
class | CSG_Grid_File_Info
class | CSG_Grid
class | CSG_Grid_Stack
class | CSG_Grid_Cell_Addressor

Macros

#define | GRID_FILE_KEY_TRUE SG_T("TRUE")
#define | GRID_FILE_KEY_FALSE SG_T("FALSE")
#define | SG_GRID_PTR_SAFE_SET_NODATA(g, x, y) { if( g && g->is_InGrid(x, y, false) ) { g->Set_NoData(x, y ); } }
#define | SG_GRID_PTR_SAFE_SET_VALUE(g, x, y, z) { if( g && g->is_InGrid(x, y, false) ) { g->Set_Value (x, y, z); } }
#define | SG_GRIDCELLADDR_PARM_SQUARE 0x01
#define | SG_GRIDCELLADDR_PARM_CIRCLE 0x02
#define | SG_GRIDCELLADDR_PARM_ANNULUS 0x04
#define | SG_GRIDCELLADDR_PARM_SECTOR 0x08
#define | SG_GRIDCELLADDR_PARM_SIZEDBL 0x10
#define | SG_GRIDCELLADDR_PARM_MAPUNIT 0x20
#define | SG_GRIDCELLADDR_PARM_WEIGHTING 0x40
#define | SG_GRIDCELLADDR_PARM_DEFAULT (SG_GRIDCELLADDR_PARM_SQUARE|SG_GRIDCELLADDR_PARM_CIRCLE)

Enumerations

enum TSG_Grid_File_Format {
GRID_FILE_FORMAT_Undefined = 0, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_ASCII,
GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF
}
enum TSG_Grid_File_Key {
GRID_FILE_KEY_NAME = 0, GRID_FILE_KEY_DESCRIPTION, GRID_FILE_KEY_UNITNAME, GRID_FILE_KEY_DATAFILE_NAME,
GRID_FILE_KEY_DATAFILE_OFFSET, GRID_FILE_KEY_DATAFORMAT, GRID_FILE_KEY_BYTEORDER_BIG, GRID_FILE_KEY_POSITION_XMIN,
GRID_FILE_KEY_POSITION_YMIN, GRID_FILE_KEY_CELLCOUNT_X, GRID_FILE_KEY_CELLCOUNT_Y, GRID_FILE_KEY_CELLSIZE,
GRID_FILE_KEY_Z_FACTOR, GRID_FILE_KEY_Z_OFFSET, GRID_FILE_KEY_NODATA_VALUE, GRID_FILE_KEY_TOPTOBOTTOM,
GRID_FILE_KEY_Count
}
enum TSG_Grid_Resampling {
GRID_RESAMPLING_NearestNeighbour = 0, GRID_RESAMPLING_Bilinear, GRID_RESAMPLING_BicubicSpline, GRID_RESAMPLING_BSpline,
GRID_RESAMPLING_Mean_Nodes, GRID_RESAMPLING_Mean_Cells, GRID_RESAMPLING_Minimum, GRID_RESAMPLING_Maximum,
GRID_RESAMPLING_Majority, GRID_RESAMPLING_Undefined
}
enum TSG_Grid_Operation { GRID_OPERATION_Addition = 0, GRID_OPERATION_Subtraction, GRID_OPERATION_Multiplication, GRID_OPERATION_Division }

Functions

SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (void)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (const CSG_Grid &Grid)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (const char *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (const wchar_t *File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (const CSG_String &File, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (CSG_Grid *pGrid, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCached=false)
SAGA_API_DLL_EXPORT CSG_Grid * | SG_Create_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize=0.0, double xMin=0.0, double yMin=0.0, bool bCached=false)
SAGA_API_DLL_EXPORT const SG_Char * | SG_Grid_Cache_Get_Directory (void)
SAGA_API_DLL_EXPORT void | SG_Grid_Cache_Set_Directory (const SG_Char *Directory)
SAGA_API_DLL_EXPORT void | SG_Grid_Cache_Set_Mode (int Mode)
SAGA_API_DLL_EXPORT int | SG_Grid_Cache_Get_Mode (void)
SAGA_API_DLL_EXPORT void | SG_Grid_Cache_Set_Threshold (int nBytes)
SAGA_API_DLL_EXPORT void | SG_Grid_Cache_Set_Threshold_MB (double nMegabytes)
SAGA_API_DLL_EXPORT sLong | SG_Grid_Cache_Get_Threshold (void)
SAGA_API_DLL_EXPORT double | SG_Grid_Cache_Get_Threshold_MB (void)
SAGA_API_DLL_EXPORT bool | SG_Grid_Set_File_Format_Default (int Format)
SAGA_API_DLL_EXPORT TSG_Grid_File_Format | SG_Grid_Get_File_Format_Default (void)
SAGA_API_DLL_EXPORT CSG_String | SG_Grid_Get_File_Extension_Default (void)

Variables

const SG_Char gSG_Grid_File_Key_Names [GRID_FILE_KEY_Count][32]

Detailed Description

Classes for raster data management.

See also
CSG_Data_Object
CSG_Grid_System
CSG_Grid

Definition in file grid.h.

Macro Definition Documentation

◆ GRID_FILE_KEY_FALSE

#define GRID_FILE_KEY_FALSE SG_T("FALSE")

Definition at line 145 of file grid.h.

◆ GRID_FILE_KEY_TRUE

#define GRID_FILE_KEY_TRUE SG_T("TRUE")

Definition at line 144 of file grid.h.

◆ SG_GRID_PTR_SAFE_SET_NODATA

#define SG_GRID_PTR_SAFE_SET_NODATA | ( | g,
 |  | x,
 |  | y
 | ) | { if( g && g->is_InGrid(x, y, false) ) { g->Set_NoData(x, y ); } }

Definition at line 988 of file grid.h.

◆ SG_GRID_PTR_SAFE_SET_VALUE

#define SG_GRID_PTR_SAFE_SET_VALUE | ( | g,
 |  | x,
 |  | y,
 |  | z
 | ) | { if( g && g->is_InGrid(x, y, false) ) { g->Set_Value (x, y, z); } }

Definition at line 989 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_ANNULUS

#define SG_GRIDCELLADDR_PARM_ANNULUS 0x04

Definition at line 1094 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_CIRCLE

#define SG_GRIDCELLADDR_PARM_CIRCLE 0x02

Definition at line 1093 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_DEFAULT

#define SG_GRIDCELLADDR_PARM_DEFAULT (SG_GRIDCELLADDR_PARM_SQUARE|SG_GRIDCELLADDR_PARM_CIRCLE)

Definition at line 1099 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_MAPUNIT

#define SG_GRIDCELLADDR_PARM_MAPUNIT 0x20

Definition at line 1097 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_SECTOR

#define SG_GRIDCELLADDR_PARM_SECTOR 0x08

Definition at line 1095 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_SIZEDBL

#define SG_GRIDCELLADDR_PARM_SIZEDBL 0x10

Definition at line 1096 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_SQUARE

#define SG_GRIDCELLADDR_PARM_SQUARE 0x01

Definition at line 1092 of file grid.h.

◆ SG_GRIDCELLADDR_PARM_WEIGHTING

#define SG_GRIDCELLADDR_PARM_WEIGHTING 0x40

Definition at line 1098 of file grid.h.

Enumeration Type Documentation

◆ TSG_Grid_File_Format

enum TSG_Grid_File_Format
Enumerator
GRID_FILE_FORMAT_Undefined
GRID_FILE_FORMAT_Binary_old
GRID_FILE_FORMAT_Binary
GRID_FILE_FORMAT_ASCII
GRID_FILE_FORMAT_Compressed
GRID_FILE_FORMAT_GeoTIFF

Definition at line 88 of file grid.h.

◆ TSG_Grid_File_Key

enum TSG_Grid_File_Key
Enumerator
GRID_FILE_KEY_NAME
GRID_FILE_KEY_DESCRIPTION
GRID_FILE_KEY_UNITNAME
GRID_FILE_KEY_DATAFILE_NAME
GRID_FILE_KEY_DATAFILE_OFFSET
GRID_FILE_KEY_DATAFORMAT
GRID_FILE_KEY_BYTEORDER_BIG
GRID_FILE_KEY_POSITION_XMIN
GRID_FILE_KEY_POSITION_YMIN
GRID_FILE_KEY_CELLCOUNT_X
GRID_FILE_KEY_CELLCOUNT_Y
GRID_FILE_KEY_CELLSIZE
GRID_FILE_KEY_Z_FACTOR
GRID_FILE_KEY_Z_OFFSET
GRID_FILE_KEY_NODATA_VALUE
GRID_FILE_KEY_TOPTOBOTTOM
GRID_FILE_KEY_Count

Definition at line 100 of file grid.h.

◆ TSG_Grid_Operation

enum TSG_Grid_Operation
Enumerator
GRID_OPERATION_Addition
GRID_OPERATION_Subtraction
GRID_OPERATION_Multiplication
GRID_OPERATION_Division

Definition at line 173 of file grid.h.

◆ TSG_Grid_Resampling

enum TSG_Grid_Resampling
Enumerator
GRID_RESAMPLING_NearestNeighbour
GRID_RESAMPLING_Bilinear
GRID_RESAMPLING_BicubicSpline
GRID_RESAMPLING_BSpline
GRID_RESAMPLING_Mean_Nodes
GRID_RESAMPLING_Mean_Cells
GRID_RESAMPLING_Minimum
GRID_RESAMPLING_Maximum
GRID_RESAMPLING_Majority
GRID_RESAMPLING_Undefined

Definition at line 155 of file grid.h.

Function Documentation

◆ SG_Create_Grid() [1/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | const char * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 86 of file grid.cpp.

References SG_Create_Grid().

◆ SG_Create_Grid() [2/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid ( const CSG_Grid & Grid )

Safe grid construction

Definition at line 78 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [3/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | const CSG_Grid_System & | System,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 104 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [4/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | const CSG_String & | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 88 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [5/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | const wchar_t * | File,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false,
 |  | bool | bLoadData = true
 | ) |  |

Safe grid construction

Definition at line 87 of file grid.cpp.

References SG_Create_Grid().

◆ SG_Create_Grid() [6/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | CSG_Grid * | pGrid,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 96 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [7/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid | ( | TSG_Data_Type | Type,
 |  | int | NX,
 |  | int | NY,
 |  | double | Cellsize = 0.0,
 |  | double | xMin = 0.0,
 |  | double | yMin = 0.0,
 |  | bool | bCached = false
 | ) |  |

Safe grid construction

Definition at line 112 of file grid.cpp.

References CSG_Grid::is_Valid().

◆ SG_Create_Grid() [8/8]

SAGA_API_DLL_EXPORT CSG_Grid* SG_Create_Grid ( void )

Safe grid construction

Definition at line 72 of file grid.cpp.

Referenced by CSG_Grids::Add_Grid(), CSG_Grids::Del_Grid(), CSG_Grids::Del_Grids(), CSG_Parameters_Grid_Target::Get_Grid(), and SG_Create_Grid().

◆ SG_Grid_Cache_Get_Directory()

SAGA_API_DLL_EXPORT const SG_Char* SG_Grid_Cache_Get_Directory ( void )

Get default directory for grid caching

Definition at line 81 of file grid_memory.cpp.

References gSG_Grid_Cache_Directory.

◆ SG_Grid_Cache_Get_Mode()

SAGA_API_DLL_EXPORT int SG_Grid_Cache_Get_Mode ( void )

Definition at line 110 of file grid_memory.cpp.

References gSG_Grid_Cache_Mode.

◆ SG_Grid_Cache_Get_Threshold()

SAGA_API_DLL_EXPORT sLong SG_Grid_Cache_Get_Threshold ( void )

Definition at line 139 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold.

◆ SG_Grid_Cache_Get_Threshold_MB()

SAGA_API_DLL_EXPORT double SG_Grid_Cache_Get_Threshold_MB ( void )

Definition at line 145 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold, and N_MEGABYTE_BYTES.

◆ SG_Grid_Cache_Set_Directory()

SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Directory ( const SG_Char * Directory )

Set default directory for grid caching

Definition at line 87 of file grid_memory.cpp.

References gSG_Grid_Cache_Directory, and SG_Dir_Exists().

◆ SG_Grid_Cache_Set_Mode()

SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Mode ( int Mode )

Definition at line 104 of file grid_memory.cpp.

References gSG_Grid_Cache_Mode.

◆ SG_Grid_Cache_Set_Threshold()

SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold ( int nBytes )

Definition at line 124 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold.

Referenced by SG_Grid_Cache_Set_Threshold_MB().

◆ SG_Grid_Cache_Set_Threshold_MB()

SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB ( double nMegabytes )

Definition at line 133 of file grid_memory.cpp.

References N_MEGABYTE_BYTES, and SG_Grid_Cache_Set_Threshold().

◆ SG_Grid_Get_File_Extension_Default()

SAGA_API_DLL_EXPORT CSG_String SG_Grid_Get_File_Extension_Default ( void )

Definition at line 129 of file grid_io.cpp.

References GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF, and gSG_Grid_File_Format_Default.

◆ SG_Grid_Get_File_Format_Default()

SAGA_API_DLL_EXPORT TSG_Grid_File_Format SG_Grid_Get_File_Format_Default ( void )

Definition at line 123 of file grid_io.cpp.

References gSG_Grid_File_Format_Default.

◆ SG_Grid_Set_File_Format_Default()

SAGA_API_DLL_EXPORT bool SG_Grid_Set_File_Format_Default ( int Format )

Definition at line 106 of file grid_io.cpp.

References GRID_FILE_FORMAT_ASCII, GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF, and gSG_Grid_File_Format_Default.

Variable Documentation

◆ gSG_Grid_File_Key_Names

const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32]
Initial value:
=
{
SG_T("NAME"),
SG_T("DESCRIPTION"),
SG_T("UNIT"),
SG_T("DATAFILE_NAME"),
SG_T("DATAFILE_OFFSET"),
SG_T("DATAFORMAT"),
SG_T("BYTEORDER_BIG"),
SG_T("POSITION_XMIN"),
SG_T("POSITION_YMIN"),
SG_T("CELLCOUNT_X"),
SG_T("CELLCOUNT_Y"),
SG_T("CELLSIZE"),
SG_T("Z_FACTOR"),
SG_T("Z_OFFSET"),
SG_T("NODATA_VALUE"),
}

Definition at line 123 of file grid.h.

SG_T
#define SG_T(s)
Definition: api_core.h:531
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid.h Source File

  • saga_core
  • saga_api
grid.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__grid_H
52 #define HEADER_INCLUDED__SAGA_API__grid_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
70 // //
72 // //
73 // //
75
76 //---------------------------------------------------------
77 #include "table.h"
78 #include "grid_pyramid.h"
79
80
82 // //
83 // Grid File //
84 // //
86
87 //---------------------------------------------------------
88 typedef enum
89 {
90 GRID_FILE_FORMAT_Undefined = 0,
91 GRID_FILE_FORMAT_Binary_old,
92 GRID_FILE_FORMAT_Binary,
93 GRID_FILE_FORMAT_ASCII,
94 GRID_FILE_FORMAT_Compressed,
95 GRID_FILE_FORMAT_GeoTIFF
96 }
97 TSG_Grid_File_Format;
98
99 //---------------------------------------------------------
100 typedef enum
101 {
102 GRID_FILE_KEY_NAME = 0,
103 GRID_FILE_KEY_DESCRIPTION,
104 GRID_FILE_KEY_UNITNAME,
105 GRID_FILE_KEY_DATAFILE_NAME,
106 GRID_FILE_KEY_DATAFILE_OFFSET,
107 GRID_FILE_KEY_DATAFORMAT,
108 GRID_FILE_KEY_BYTEORDER_BIG,
109 GRID_FILE_KEY_POSITION_XMIN,
110 GRID_FILE_KEY_POSITION_YMIN,
111 GRID_FILE_KEY_CELLCOUNT_X,
112 GRID_FILE_KEY_CELLCOUNT_Y,
113 GRID_FILE_KEY_CELLSIZE,
114 GRID_FILE_KEY_Z_FACTOR,
115 GRID_FILE_KEY_Z_OFFSET,
116 GRID_FILE_KEY_NODATA_VALUE,
117 GRID_FILE_KEY_TOPTOBOTTOM,
118 GRID_FILE_KEY_Count
119 }
120 TSG_Grid_File_Key;
121
122 //---------------------------------------------------------
123 const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32] =
124 {
125 SG_T("NAME"),
126 SG_T("DESCRIPTION"),
127 SG_T("UNIT"),
128 SG_T("DATAFILE_NAME"),
129 SG_T("DATAFILE_OFFSET"),
130 SG_T("DATAFORMAT"),
131 SG_T("BYTEORDER_BIG"),
132 SG_T("POSITION_XMIN"),
133 SG_T("POSITION_YMIN"),
134 SG_T("CELLCOUNT_X"),
135 SG_T("CELLCOUNT_Y"),
136 SG_T("CELLSIZE"),
137 SG_T("Z_FACTOR"),
138 SG_T("Z_OFFSET"),
139 SG_T("NODATA_VALUE"),
140 SG_T("TOPTOBOTTOM")
141 };
142
143 //---------------------------------------------------------
144 #define GRID_FILE_KEY_TRUE SG_T("TRUE")
145 #define GRID_FILE_KEY_FALSE SG_T("FALSE")
146
147
149 // //
150 // //
151 // //
153
154 //---------------------------------------------------------
155 typedef enum
156 {
157 GRID_RESAMPLING_NearestNeighbour = 0,
158 GRID_RESAMPLING_Bilinear,
159 GRID_RESAMPLING_BicubicSpline,
160 GRID_RESAMPLING_BSpline,
161
162 GRID_RESAMPLING_Mean_Nodes,
163 GRID_RESAMPLING_Mean_Cells,
164 GRID_RESAMPLING_Minimum,
165 GRID_RESAMPLING_Maximum,
166 GRID_RESAMPLING_Majority,
167
168 GRID_RESAMPLING_Undefined
169 }
170 TSG_Grid_Resampling;
171
172 //---------------------------------------------------------
173 typedef enum
174 {
175 GRID_OPERATION_Addition = 0,
176 GRID_OPERATION_Subtraction,
177 GRID_OPERATION_Multiplication,
178 GRID_OPERATION_Division
179 }
180 TSG_Grid_Operation;
181
182
184 // //
185 // CSG_Grid_System //
186 // //
188
189 //---------------------------------------------------------
198 //---------------------------------------------------------
199 class SAGA_API_DLL_EXPORT CSG_Grid_System
200 {
201 public:
202 CSG_Grid_System(void);
203
204 CSG_Grid_System (const CSG_Grid_System &System);
205 bool Create (const CSG_Grid_System &System);
206
207 CSG_Grid_System (double Cellsize, const CSG_Rect &Extent);
208 bool Create (double Cellsize, const CSG_Rect &Extent);
209
210 CSG_Grid_System (double Cellsize, double xMin, double yMin, double xMax, double yMax);
211 bool Create (double Cellsize, double xMin, double yMin, double xMax, double yMax);
212
213 CSG_Grid_System (double Cellsize, double xMin, double yMin, int NX, int NY);
214 bool Create (double Cellsize, double xMin, double yMin, int NX, int NY);
215
216 ~CSG_Grid_System(void);
217
218 bool Destroy (void);
219
220 //-----------------------------------------------------
221 bool Assign (const CSG_Grid_System &System);
222 bool Assign (double Cellsize, const CSG_Rect &Extent);
223 bool Assign (double Cellsize, double xMin, double yMin, double xMax, double yMax);
224 bool Assign (double Cellsize, double xMin, double yMin, int NX, int NY);
225
226 //-----------------------------------------------------
227 bool is_Valid (void) const;
228
229 const SG_Char * Get_Name (bool bShort = true);
230
231 double Get_Cellsize (void) const { return( m_Cellsize ); }
232 double Get_Cellarea (void) const { return( m_Cellarea ); }
233
234 int Get_NX (void) const { return( m_NX ); }
235 int Get_NY (void) const { return( m_NY ); }
236 sLong Get_NCells (void) const { return( m_NCells ); }
237
238 const CSG_Rect & Get_Extent (bool bCells = false) const { return( bCells ? m_Extent_Cells : m_Extent ); }
239
240 double Get_XMin (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_XMin () : m_Extent.Get_XMin () ); }
241 double Get_XMax (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_XMax () : m_Extent.Get_XMax () ); }
242 double Get_XRange (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_XRange() : m_Extent.Get_XRange() ); }
243
244 double Get_YMin (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_YMin () : m_Extent.Get_YMin () ); }
245 double Get_YMax (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_YMax () : m_Extent.Get_YMax () ); }
246 double Get_YRange (bool bCells = false) const { return( bCells ? m_Extent_Cells.Get_YRange() : m_Extent.Get_YRange() ); }
247
248
249 //-----------------------------------------------------
250 bool operator == (const CSG_Grid_System &System) const;
251 void operator = (const CSG_Grid_System &System);
252
253 bool is_Equal (const CSG_Grid_System &System) const;
254 bool is_Equal (double Cellsize, const TSG_Rect &Extent) const;
255
256
257 //-----------------------------------------------------
259 double Fit_xto_Grid_System (double x) const { return( Get_XMin() + m_Cellsize * Get_xWorld_to_Grid(x) ); }
260
262 double Fit_yto_Grid_System (double y) const { return( Get_YMin() + m_Cellsize * Get_yWorld_to_Grid(y) ); }
263
265 TSG_Point Fit_to_Grid_System (TSG_Point ptWorld) const
266 {
267 ptWorld.x = Fit_xto_Grid_System(ptWorld.x);
268 ptWorld.y = Fit_yto_Grid_System(ptWorld.y);
269
270 return( ptWorld );
271 }
272
273
274 //-----------------------------------------------------
275 double Get_xGrid_to_World (int xGrid) const { return( Get_XMin() + xGrid * m_Cellsize ); }
276 double Get_yGrid_to_World (int yGrid) const { return( Get_YMin() + yGrid * m_Cellsize ); }
277
278 TSG_Point Get_Grid_to_World (int xGrid, int yGrid) const
279 {
280 TSG_Point pt;
281
282 pt.x = Get_xGrid_to_World(xGrid);
283 pt.y = Get_yGrid_to_World(yGrid);
284
285 return( pt );
286 }
287
288
289 //-----------------------------------------------------
290 int Get_xWorld_to_Grid (double xWorld) const { return( (int)floor(0.5 + (xWorld - Get_XMin()) / m_Cellsize) ); }
291 int Get_yWorld_to_Grid (double yWorld) const { return( (int)floor(0.5 + (yWorld - Get_YMin()) / m_Cellsize) ); }
292
293 bool Get_World_to_Grid (int &xGrid, int &yGrid, double xWorld, double yWorld) const
294 {
295 return( is_InGrid(xGrid = Get_xWorld_to_Grid(xWorld), yGrid = Get_yWorld_to_Grid(yWorld)) );
296 }
297
298 bool Get_World_to_Grid (int &xGrid, int &yGrid, TSG_Point ptWorld) const
299 {
300 return( is_InGrid(xGrid = Get_xWorld_to_Grid(ptWorld.x), yGrid = Get_yWorld_to_Grid(ptWorld.y)) );
301 }
302
303
304 //-----------------------------------------------------
305 bool Get_Neighbor_Pos (int Direction, int x, int y, int &xPos, int &yPos) const
306 {
307 return( is_InGrid(xPos = Get_xTo(Direction, x), yPos = Get_yTo(Direction, y)) );
308 }
309
310 static int Get_xTo (int Direction, int x = 0)
311 {
312 static int ix[8] = { 0, 1, 1, 1, 0,-1,-1,-1 };
313
314 Direction %= 8;
315
316 if( Direction < 0 )
317 {
318 Direction += 8;
319 }
320
321 return( x + ix[Direction] );
322 }
323
324 static int Get_yTo (int Direction, int y = 0)
325 {
326 static int iy[8] = { 1, 1, 0,-1,-1,-1, 0, 1 };
327
328 Direction %= 8;
329
330 if( Direction < 0 )
331 {
332 Direction += 8;
333 }
334
335 return( y + iy[Direction] );
336 }
337
338 static int Get_xFrom (int Direction, int x = 0) { return( Get_xTo(Direction + 4, x) ); }
339 static int Get_yFrom (int Direction, int y = 0) { return( Get_yTo(Direction + 4, y) ); }
340
341 int Get_xToSave (int Direction, int x) const { return( (x = Get_xTo (Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
342 int Get_yToSave (int Direction, int y) const { return( (y = Get_yTo (Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
343 int Get_xFromSave (int Direction, int x) const { return( (x = Get_xFrom(Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
344 int Get_yFromSave (int Direction, int y) const { return( (y = Get_yFrom(Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
345
346 bool is_InGrid (int x, int y) const { return( x >= 0 && x < m_NX && y >= 0 && y < m_NY ); }
347 bool is_InGrid (int x, int y, int Rand) const { return( x >= Rand && x < m_NX - Rand && y >= Rand && y < m_NY - Rand ); }
348
349 double Get_Length (int Direction) const { return( Direction % 2 ? m_Diagonal : m_Cellsize ); }
350 static double Get_UnitLength (int Direction) { return( Direction % 2 ? sqrt(2.0) : 1.0 ); }
351
352 static int Set_Precision (int Decimals);
353 static int Get_Precision (void);
354
355 sLong Get_IndexFromRowCol (int x, int y) const
356 {
357 if( m_NX > 0 )
358 {
359 return( (sLong)y * m_NX + x );
360 }
361
362 return( -1 );
363 }
364
365 bool Get_RowColFromIndex (int &x, int &y, sLong i) const
366 {
367 if( m_NX > 0 )
368 {
369 x = (int)(i % m_NX);
370 y = (int)(i / m_NX);
371
372 return( true );
373 }
374
375 return( false );
376 }
377
378
379 private:
380
381 int m_NX, m_NY;
382
383 sLong m_NCells;
384
385 double m_Cellsize, m_Cellarea, m_Diagonal;
386
387 CSG_Rect m_Extent, m_Extent_Cells;
388
389 CSG_String m_Name;
390
391 static int m_Precision;
392
393 };
394
395
397 // //
398 // CSG_Grid //
399 // //
401
402 //---------------------------------------------------------
406 //---------------------------------------------------------
407 class SAGA_API_DLL_EXPORT CSG_Grid_File_Info
408 {
409 //---------------------------------------------------------
410 public:
411
412 //-----------------------------------------------------
413 CSG_Grid_File_Info(void);
414
415 CSG_Grid_File_Info (const CSG_Grid_File_Info &Info);
416 bool Create (const CSG_Grid_File_Info &Info);
417
418 CSG_Grid_File_Info (const CSG_String &File);
419 bool Create (const CSG_String &File);
420
421 CSG_Grid_File_Info (CSG_File &Stream);
422 bool Create (CSG_File &Stream);
423
424 CSG_Grid_File_Info (const CSG_Grid &Grid);
425 bool Create (const CSG_Grid &Grid);
426
427 bool Save (const CSG_String &File , bool bBinary = true);
428 bool Save (const CSG_File &Stream, bool bBinary = true);
429
430 static bool Save (const CSG_String &File , const CSG_Grid &Grid, bool bBinary = true);
431 static bool Save (const CSG_File &Stream, const CSG_Grid &Grid, bool bBinary = true);
432
433 bool Save_AUX_XML (const CSG_String &File);
434 bool Save_AUX_XML (CSG_File &Stream);
435
436 //-----------------------------------------------------
437 bool m_bFlip, m_bSwapBytes;
438
439 sLong m_Offset;
440
441 double m_zScale, m_zOffset, m_NoData[2];
442
443 TSG_Data_Type m_Type;
444
445 CSG_String m_Name, m_Description, m_Unit, m_Data_File;
446
447 CSG_Grid_System m_System;
448
449 CSG_Projection m_Projection;
450
451
452 private:
453
454 void _On_Construction (void);
455
456 int _Get_Key (CSG_File &Stream, CSG_String &Line);
457
458 };
459
460
462 // //
463 // CSG_Grid //
464 // //
466
467 //---------------------------------------------------------
471 //---------------------------------------------------------
472 class SAGA_API_DLL_EXPORT CSG_Grid : public CSG_Data_Object
473 {
474 //---------------------------------------------------------
475 public:
476
477 //-----------------------------------------------------
478 CSG_Grid(void);
479
480 CSG_Grid (const CSG_Grid &Grid);
481 bool Create (const CSG_Grid &Grid);
482
483 CSG_Grid (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
484 bool Create (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
485 CSG_Grid (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
486 bool Create (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
487 CSG_Grid (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
488 bool Create (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
489
490 CSG_Grid (CSG_Grid *pGrid , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
491 bool Create (CSG_Grid *pGrid , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
492
493 CSG_Grid (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
494 bool Create (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
495
496 CSG_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize = 0.0, double xMin = 0.0, double yMin = 0.0, bool bCached = false);
497 bool Create (TSG_Data_Type Type, int NX, int NY, double Cellsize = 0.0, double xMin = 0.0, double yMin = 0.0, bool bCached = false);
498
499
500 //-----------------------------------------------------
501 virtual ~CSG_Grid(void);
502
503 virtual bool Destroy (void);
504
505
506 //-----------------------------------------------------
507 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
508 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
509 virtual bool Save (const CSG_String &File, int Format = 0);
510
511 //-----------------------------------------------------
514 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_Grid ); }
515
516 //-----------------------------------------------------
517 // Data-Info...
518
519 TSG_Data_Type Get_Type (void) const { return( m_Type ); }
520
521 int Get_nValueBytes (void) const { return( (int)m_nBytes_Value ); }
522 int Get_nLineBytes (void) const { return( (int)m_nBytes_Line ); }
523
524 void Set_Unit (const CSG_String &Unit);
525 const CSG_String & Get_Unit (void) const { return( m_Unit ); }
526
527
528 //-----------------------------------------------------
529 // Georeference...
530
531 const CSG_Grid_System & Get_System (void) const { return( m_System ); }
532
533 virtual const CSG_Rect & Get_Extent (void) { return( m_System.Get_Extent() ); }
534
535 int Get_NX (void) const { return( m_System.Get_NX() ); }
536 int Get_NY (void) const { return( m_System.Get_NY() ); }
537 sLong Get_NCells (void) const { return( m_System.Get_NCells() ); }
538
539 double Get_Cellsize (void) const { return( m_System.Get_Cellsize() ); }
540 double Get_Cellarea (void) const { return( m_System.Get_Cellarea() ); }
541
542 const CSG_Rect & Get_Extent (bool bCells = false) const { return( m_System.Get_Extent(bCells) ); }
543
544 double Get_XMin (bool bCells = false) const { return( m_System.Get_XMin (bCells) ); }
545 double Get_XMax (bool bCells = false) const { return( m_System.Get_XMax (bCells) ); }
546 double Get_XRange (bool bCells = false) const { return( m_System.Get_XRange(bCells) ); }
547
548 double Get_YMin (bool bCells = false) const { return( m_System.Get_YMin (bCells) ); }
549 double Get_YMax (bool bCells = false) const { return( m_System.Get_YMax (bCells) ); }
550 double Get_YRange (bool bCells = false) const { return( m_System.Get_YRange(bCells) ); }
551
552
553 //-----------------------------------------------------
554 // Values...
555
556 void Set_Scaling (double Scale = 1.0, double Offset = 0.0);
557 double Get_Scaling (void) const;
558 double Get_Offset (void) const;
559 bool is_Scaled (void) const { return( m_zScale != 1.0 || m_zOffset != 0.0 ); }
560
561 double Get_Mean (void);
562 double Get_Min (void);
563 double Get_Max (void);
564 double Get_Range (void);
565 double Get_StdDev (void);
566 double Get_Variance (void);
567 double Get_Quantile (double Quantile, bool bFromHistogram = true);
568 double Get_Percentile (double Percentile, bool bFromHistogram = true);
569
570 const CSG_Simple_Statistics & Get_Statistics (void);
571 bool Get_Statistics (const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues = false) const;
572
573 const CSG_Histogram & Get_Histogram (size_t nClasses = 0);
574 bool Get_Histogram (const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses = 0) const;
575
576 sLong Get_Data_Count (void);
577 sLong Get_NoData_Count (void);
578
579
580 //-----------------------------------------------------
581 // Checks...
582
583 virtual bool is_Valid (void) const;
584
585 TSG_Intersection is_Intersecting (const CSG_Rect &Extent) const;
586 TSG_Intersection is_Intersecting (const TSG_Rect &Extent) const;
587 TSG_Intersection is_Intersecting (double xMin, double yMin, double xMax, double yMax) const;
588
589 bool is_Compatible (CSG_Grid *pGrid) const;
590 bool is_Compatible (const CSG_Grid_System &System) const;
591 bool is_Compatible (int NX, int NY, double Cellsize, double xMin, double yMin) const;
592
593 bool is_InGrid (int x, int y, bool bCheckNoData = true) const { return( m_System.is_InGrid(x, y) && (!bCheckNoData || !is_NoData(x, y)) ); }
594 bool is_InGrid_byPos (double x, double y, bool bCheckNoData = true) const { return( Get_Extent(true).Contains(x, y) && (!bCheckNoData || !is_NoData(m_System.Get_xWorld_to_Grid(x), m_System.Get_yWorld_to_Grid(y))) ); }
595 bool is_InGrid_byPos (const TSG_Point &p, bool bCheckNoData = true) const { return( is_InGrid_byPos(p.x, p.y, bCheckNoData) ); }
596
597
598 //-----------------------------------------------------
599 // Memory...
600
601 sLong Get_Memory_Size (void) const { return( Get_NCells() * Get_nValueBytes() ); }
602 double Get_Memory_Size_MB (void) const { return( (double)Get_Memory_Size() / N_MEGABYTE_BYTES ); }
603
604 bool Set_Cache (bool bOn);
605 bool is_Cached (void) const { return( m_Cache_Stream != NULL ); }
606
607
608 //-----------------------------------------------------
609 // Operations...
610
611 void Assign_NoData (void);
612
613 virtual bool Assign (double Value = 0.0);
614 virtual bool Assign (CSG_Data_Object *pObject);
615 virtual bool Assign (CSG_Grid *pGrid, TSG_Grid_Resampling Interpolation);
616
617 void Flip (void);
618 void Mirror (void);
619 void Invert (void);
620
621 bool Normalise (void);
622 bool DeNormalise (double Minimum, double Maximum);
623
624 bool Standardise (void);
625 bool DeStandardise (double Mean, double StdDev);
626
627 int Get_Gradient_NeighborDir (int x, int y, bool bDown = true, bool bNoEdges = true) const;
628 bool Get_Gradient (int x, int y , double &Slope, double &Aspect) const;
629 bool Get_Gradient (double x, double y, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const;
630 bool Get_Gradient (const TSG_Point &p, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const;
631
632
633 //-----------------------------------------------------
634 // Set update flag when modified...
635
636 virtual void Set_Modified (bool bModified = true)
637 {
638 CSG_Data_Object::Set_Modified(bModified);
639
640 if( bModified )
641 {
642 Set_Update_Flag();
643 }
644 }
645
646
647 //-----------------------------------------------------
648 // Index...
649
650 bool Set_Index (bool bOn = true)
651 {
652 if( !bOn )
653 {
654 SG_FREE_SAFE(m_Index);
655
656 return( true );
657 }
658
659 return( _Get_Index() );
660 }
661
662 sLong Get_Sorted (sLong Position, bool bDown = true, bool bCheckNoData = true)
663 {
664 if( Position >= 0 && Position < Get_NCells() && _Get_Index() )
665 {
666 Position = m_Index[bDown ? Get_NCells() - Position - 1 : Position];
667
668 if( !bCheckNoData || !is_NoData(Position) )
669 {
670 return( Position );
671 }
672 }
673
674 return( -1 );
675 }
676
677 bool Get_Sorted (sLong Position, sLong &i, bool bDown = true, bool bCheckNoData = true)
678 {
679 return( (i = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
680 }
681
682 bool Get_Sorted (sLong Position, int &x, int &y, bool bDown = true, bool bCheckNoData = true)
683 {
684 if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
685 {
686 x = (int)(Position % Get_NX());
687 y = (int)(Position / Get_NX());
688
689 return( true );
690 }
691
692 return( false );
693 }
694
695
696 //-----------------------------------------------------
697 // No Data Value...
698
699 virtual bool is_NoData (int x, int y) const { return( is_NoData_Value(asDouble(x, y, false)) ); }
700 virtual bool is_NoData (sLong i) const { return( is_NoData_Value(asDouble( i, false)) ); }
701
702 virtual void Set_NoData (int x, int y) { Set_Value(x, y, Get_NoData_Value(), false); }
703 virtual void Set_NoData (sLong i) { Set_Value( i, Get_NoData_Value(), false); }
704
705
706 //-----------------------------------------------------
707 // Operators...
708
709 virtual CSG_Grid & operator = (const CSG_Grid &Grid);
710 virtual CSG_Grid & operator = (double Value);
711
712 virtual CSG_Grid operator + (const CSG_Grid &Grid) const;
713 virtual CSG_Grid operator + (double Value) const;
714 virtual CSG_Grid & operator += (const CSG_Grid &Grid);
715 virtual CSG_Grid & operator += (double Value);
716 virtual CSG_Grid & Add (const CSG_Grid &Grid);
717 virtual CSG_Grid & Add (double Value);
718
719 virtual CSG_Grid operator - (const CSG_Grid &Grid) const;
720 virtual CSG_Grid operator - (double Value) const;
721 virtual CSG_Grid & operator -= (const CSG_Grid &Grid);
722 virtual CSG_Grid & operator -= (double Value);
723 virtual CSG_Grid & Subtract (const CSG_Grid &Grid);
724 virtual CSG_Grid & Subtract (double Value);
725
726 virtual CSG_Grid operator * (const CSG_Grid &Grid) const;
727 virtual CSG_Grid operator * (double Value) const;
728 virtual CSG_Grid & operator *= (const CSG_Grid &Grid);
729 virtual CSG_Grid & operator *= (double Value);
730 virtual CSG_Grid & Multiply (const CSG_Grid &Grid);
731 virtual CSG_Grid & Multiply (double Value);
732
733 virtual CSG_Grid operator / (const CSG_Grid &Grid) const;
734 virtual CSG_Grid operator / (double Value) const;
735 virtual CSG_Grid & operator /= (const CSG_Grid &Grid);
736 virtual CSG_Grid & operator /= (double Value);
737 virtual CSG_Grid & Divide (const CSG_Grid &Grid);
738 virtual CSG_Grid & Divide (double Value);
739
740 virtual double operator () (int x, int y) const { return( asDouble(x, y) ); }
741
742
743 //-----------------------------------------------------
744 // Get Value...
745
746 double Get_Value (double x, double y, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline , bool bByteWise = false) const;
747 double Get_Value (const TSG_Point &p, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline , bool bByteWise = false) const;
748 bool Get_Value (double x, double y, double &Value, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, bool bNoData = false, bool bByteWise = false) const;
749 bool Get_Value (const TSG_Point &p, double &Value, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, bool bNoData = false, bool bByteWise = false) const;
750
751 virtual BYTE asByte (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble(x, y, bScaled)) ); }
752 virtual BYTE asByte ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble( i, bScaled)) ); }
753 virtual char asChar (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble(x, y, bScaled)) ); }
754 virtual char asChar ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble( i, bScaled)) ); }
755 virtual short asShort (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble(x, y, bScaled)) ); }
756 virtual short asShort ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble( i, bScaled)) ); }
757 virtual int asInt (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble(x, y, bScaled)) ); }
758 virtual int asInt ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble( i, bScaled)) ); }
759 virtual sLong asLong (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble(x, y, bScaled)) ); }
760 virtual sLong asLong ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble( i, bScaled)) ); }
761 virtual float asFloat (int x, int y, bool bScaled = true) const { return( (float) (asDouble(x, y, bScaled)) ); }
762 virtual float asFloat ( sLong i, bool bScaled = true) const { return( (float) (asDouble( i, bScaled)) ); }
763
764 //-----------------------------------------------------
765 virtual double asDouble( sLong i, bool bScaled = true) const
766 {
767 return( asDouble((int)(i % Get_NX()), (int)(i / Get_NX()), bScaled) );
768 }
769
770 virtual double asDouble(int x, int y, bool bScaled = true) const
771 {
772 double Value;
773
774 if( is_Cached() )
775 {
776 Value = _Cache_Get_Value(x, y);
777 }
778 else switch( m_Type )
779 {
780 case SG_DATATYPE_Float : Value = (double)((float **)m_Values)[y][x]; break;
781 case SG_DATATYPE_Double: Value = (double)((double **)m_Values)[y][x]; break;
782 case SG_DATATYPE_Byte : Value = (double)((BYTE **)m_Values)[y][x]; break;
783 case SG_DATATYPE_Char : Value = (double)((char **)m_Values)[y][x]; break;
784 case SG_DATATYPE_Word : Value = (double)((WORD **)m_Values)[y][x]; break;
785 case SG_DATATYPE_Short : Value = (double)((short **)m_Values)[y][x]; break;
786 case SG_DATATYPE_DWord : Value = (double)((DWORD **)m_Values)[y][x]; break;
787 case SG_DATATYPE_Int : Value = (double)((int **)m_Values)[y][x]; break;
788 case SG_DATATYPE_Long : Value = (double)((sLong **)m_Values)[y][x]; break;
789 case SG_DATATYPE_ULong : Value = (double)((uLong **)m_Values)[y][x]; break;
790 case SG_DATATYPE_Bit : Value = (double)(((BYTE **)m_Values)[y][x / 8] & m_Bitmask[x % 8]) == 0 ? 0.0 : 1.0; break;
791
792 default:
793 return( 0.0 );
794 }
795
796 if( bScaled && is_Scaled() )
797 {
798 Value = m_zOffset + m_zScale * Value;
799 }
800
801 return( Value );
802 }
803
804
805 //-----------------------------------------------------
806 // Set Value...
807
808 virtual void Add_Value(int x, int y, double Value) { Set_Value(x, y, asDouble(x, y) + Value ); }
809 virtual void Add_Value(sLong i, double Value) { Set_Value( i, asDouble( i) + Value ); }
810
811 virtual void Mul_Value(int x, int y, double Value) { Set_Value(x, y, asDouble(x, y) * Value ); }
812 virtual void Mul_Value(sLong i, double Value) { Set_Value( i, asDouble( i) * Value ); }
813
814 //-----------------------------------------------------
815 virtual void Set_Value(sLong i, double Value, bool bScaled = true)
816 {
817 Set_Value((int)(i % Get_NX()), (int)(i / Get_NX()), Value, bScaled);
818 }
819
820 virtual void Set_Value(int x, int y, double Value, bool bScaled = true)
821 {
822 if( bScaled && is_Scaled() )
823 {
824 Value = (Value - m_zOffset) / m_zScale;
825 }
826
827 if( is_Cached() )
828 {
829 _Cache_Set_Value(x, y, Value);
830 }
831 else switch( m_Type )
832 {
833 case SG_DATATYPE_Float : ((float **)m_Values)[y][x] = (float )(Value); break;
834 case SG_DATATYPE_Double: ((double **)m_Values)[y][x] = (double )(Value); break;
835 case SG_DATATYPE_Byte : ((BYTE **)m_Values)[y][x] = SG_ROUND_TO_BYTE (Value); break;
836 case SG_DATATYPE_Char : ((char **)m_Values)[y][x] = SG_ROUND_TO_CHAR (Value); break;
837 case SG_DATATYPE_Word : ((WORD **)m_Values)[y][x] = SG_ROUND_TO_WORD (Value); break;
838 case SG_DATATYPE_Short : ((short **)m_Values)[y][x] = SG_ROUND_TO_SHORT(Value); break;
839 case SG_DATATYPE_DWord : ((DWORD **)m_Values)[y][x] = SG_ROUND_TO_DWORD(Value); break;
840 case SG_DATATYPE_Int : ((int **)m_Values)[y][x] = SG_ROUND_TO_INT (Value); break;
841 case SG_DATATYPE_Long : ((sLong **)m_Values)[y][x] = SG_ROUND_TO_SLONG(Value); break;
842 case SG_DATATYPE_ULong : ((uLong **)m_Values)[y][x] = SG_ROUND_TO_ULONG(Value); break;
843 case SG_DATATYPE_Bit : ((BYTE **)m_Values)[y][x / 8] = Value != 0.0
844 ? ((BYTE **)m_Values)[y][x / 8] | m_Bitmask[x % 8]
845 : ((BYTE **)m_Values)[y][x / 8] & (~m_Bitmask[x % 8]);
846 break;
847
848 default:
849 return;
850 }
851
852 Set_Modified();
853 }
854
855 //-----------------------------------------------------
856 CSG_Vector Get_Row (int y) const;
857 bool Set_Row (int y, const CSG_Vector &Values);
858
859
860 //---------------------------------------------------------
861 protected:
862
863 virtual bool On_Update (void);
864 virtual bool On_Reload (void);
865 virtual bool On_Delete (void);
866
867
868 //---------------------------------------------------------
869 private:
870
871 void **m_Values;
872
873 bool m_Cache_bTemp, m_Cache_bSwap, m_Cache_bFlip;
874
875 size_t m_nBytes_Value, m_nBytes_Line;
876
877 sLong *m_Index, m_Cache_Offset;
878
879 double m_zOffset, m_zScale;
880
881 FILE *m_Cache_Stream;
882
883 TSG_Data_Type m_Type;
884
885 CSG_String m_Unit, m_Cache_File;
886
887 CSG_Simple_Statistics m_Statistics;
888
889 CSG_Histogram m_Histogram;
890
891 CSG_Grid_System m_System;
892
893
894 //-----------------------------------------------------
895 static BYTE m_Bitmask[8];
896
897
898 //-----------------------------------------------------
899 void _On_Construction (void);
900
901 void _Set_Properties (TSG_Data_Type Type, int NX, int NY, double Cellsize, double xMin, double yMin);
902
903 bool _Set_Index (void);
904 bool _Get_Index (void)
905 {
906 if( Get_Update_Flag() )
907 {
908 Update();
909 }
910
911 return( m_Index || _Set_Index() );
912 }
913
914
915 //-----------------------------------------------------
916 // Memory handling...
917
918 bool _Memory_Create (bool bCached);
919 void _Memory_Destroy (void);
920
921 bool _Array_Create (void);
922 void _Array_Destroy (void);
923
924 bool _Cache_Check (void);
925 bool _Cache_Create (const CSG_String &File, TSG_Data_Type Data_Type, sLong Offset, bool bSwap, bool bFlip);
926 bool _Cache_Create (void);
927 bool _Cache_Destroy (bool bMemory_Restore);
928 void _Cache_Set_Value (int x, int y, double Value);
929 double _Cache_Get_Value (int x, int y) const;
930
931
932 //-----------------------------------------------------
933 // File access...
934
935 void _Swap_Bytes (char *Bytes, int nBytes) const;
936
937 bool _Load_External (const CSG_String &File, bool bCached, bool bLoadData);
938 bool _Load_PGSQL (const CSG_String &File, bool bCached, bool bLoadData);
939
940 bool _Load_Native (const CSG_String &File, bool bCached, bool bLoadData);
941 bool _Save_Native (const CSG_String &File, TSG_Grid_File_Format Format);
942
943 bool _Load_Compressed (const CSG_String &File, bool bCached, bool bLoadData);
944 bool _Save_Compressed (const CSG_String &File);
945
946 bool _Load_Binary (CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes);
947 bool _Save_Binary (CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes);
948 bool _Load_ASCII (CSG_File &Stream, bool bCached, bool bFlip = false);
949 bool _Save_ASCII (CSG_File &Stream, bool bFlip = false);
950
951 bool _Load_Surfer (const CSG_String &File, bool bCached, bool bLoadData);
952
953
954 //-----------------------------------------------------
955 CSG_Grid & _Operation_Arithmetic (const CSG_Grid &Grid, TSG_Grid_Operation Operation);
956 CSG_Grid & _Operation_Arithmetic (double Value , TSG_Grid_Operation Operation);
957
958 bool _Assign_Interpolated (CSG_Grid *pSource, TSG_Grid_Resampling Interpolation);
959 bool _Assign_MeanValue (CSG_Grid *pSource, bool bAreaProportional);
960 bool _Assign_ExtremeValue (CSG_Grid *pSource, bool bMaximum);
961 bool _Assign_Majority (CSG_Grid *pSource);
962
963
964 //-----------------------------------------------------
965 // Interpolation subroutines...
966
967 bool _Get_ValAtPos_NearestNeighbour (double &Value, int x, int y, double dx, double dy ) const;
968 bool _Get_ValAtPos_BiLinear (double &Value, int x, int y, double dx, double dy, bool bByteWise) const;
969 bool _Get_ValAtPos_BiCubicSpline (double &Value, int x, int y, double dx, double dy, bool bByteWise) const;
970 bool _Get_ValAtPos_BSpline (double &Value, int x, int y, double dx, double dy, bool bByteWise) const;
971
972 double _Get_ValAtPos_BiCubicSpline (double dx, double dy, double z_xy[4][4]) const;
973 double _Get_ValAtPos_BSpline (double dx, double dy, double z_xy[4][4]) const;
974
975 bool _Get_ValAtPos_Fill4x4Submatrix (int x, int y, double z_xy[4][4] ) const;
976 bool _Get_ValAtPos_Fill4x4Submatrix (int x, int y, double z_xy[4][4][4]) const;
977
978 };
979
980
982 // //
983 // Functions //
984 // //
986
987 //---------------------------------------------------------
988 #define SG_GRID_PTR_SAFE_SET_NODATA(g, x, y) { if( g && g->is_InGrid(x, y, false) ) { g->Set_NoData(x, y ); } }
989 #define SG_GRID_PTR_SAFE_SET_VALUE(g, x, y, z) { if( g && g->is_InGrid(x, y, false) ) { g->Set_Value (x, y, z); } }
990
991 //---------------------------------------------------------
993 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (void);
994
996 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const CSG_Grid &Grid);
997
999 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1001 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1003 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1004
1006 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (CSG_Grid *pGrid , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
1007
1009 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
1010
1012 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize = 0.0, double xMin = 0.0, double yMin = 0.0, bool bCached = false);
1013
1014 //---------------------------------------------------------
1016 SAGA_API_DLL_EXPORT const SG_Char * SG_Grid_Cache_Get_Directory (void);
1017
1019 SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Directory (const SG_Char *Directory);
1020
1021 SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Mode (int Mode);
1022 SAGA_API_DLL_EXPORT int SG_Grid_Cache_Get_Mode (void);
1023
1024 SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold (int nBytes);
1025 SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB (double nMegabytes);
1026 SAGA_API_DLL_EXPORT sLong SG_Grid_Cache_Get_Threshold (void);
1027 SAGA_API_DLL_EXPORT double SG_Grid_Cache_Get_Threshold_MB (void);
1028
1029 //---------------------------------------------------------
1030 SAGA_API_DLL_EXPORT bool SG_Grid_Set_File_Format_Default (int Format);
1031 SAGA_API_DLL_EXPORT TSG_Grid_File_Format SG_Grid_Get_File_Format_Default (void);
1032 SAGA_API_DLL_EXPORT CSG_String SG_Grid_Get_File_Extension_Default (void);
1033
1034
1036 // //
1037 // //
1038 // //
1040
1041 //---------------------------------------------------------
1042 class CSG_Grid_Stack : public CSG_Stack
1043 {
1044 public:
1045 CSG_Grid_Stack(void) : CSG_Stack(sizeof(TSG_Point_Int)) {}
1046
1047 //-----------------------------------------------------
1048 const TSG_Point_Int & operator [] (size_t i) const { return( *((TSG_Point_Int *)Get_Record(i)) ); }
1049
1050 //-----------------------------------------------------
1051 virtual bool Push (int x, int y)
1052 {
1053 TSG_Point_Int *pPoint = (TSG_Point_Int *)Get_Record_Push();
1054
1055 if( pPoint )
1056 {
1057 pPoint->x = x;
1058 pPoint->y = y;
1059
1060 return( true );
1061 }
1062
1063 return( false );
1064 }
1065
1066 //-----------------------------------------------------
1067 virtual bool Pop (int &x, int &y)
1068 {
1069 TSG_Point_Int *pPoint = (TSG_Point_Int *)Get_Record_Pop();
1070
1071 if( pPoint )
1072 {
1073 x = pPoint->x;
1074 y = pPoint->y;
1075
1076 return( true );
1077 }
1078
1079 return( false );
1080 }
1081
1082 };
1083
1084
1086 // //
1087 // //
1088 // //
1090
1091 //---------------------------------------------------------
1092 #define SG_GRIDCELLADDR_PARM_SQUARE 0x01
1093 #define SG_GRIDCELLADDR_PARM_CIRCLE 0x02
1094 #define SG_GRIDCELLADDR_PARM_ANNULUS 0x04
1095 #define SG_GRIDCELLADDR_PARM_SECTOR 0x08
1096 #define SG_GRIDCELLADDR_PARM_SIZEDBL 0x10
1097 #define SG_GRIDCELLADDR_PARM_MAPUNIT 0x20
1098 #define SG_GRIDCELLADDR_PARM_WEIGHTING 0x40
1099 #define SG_GRIDCELLADDR_PARM_DEFAULT (SG_GRIDCELLADDR_PARM_SQUARE|SG_GRIDCELLADDR_PARM_CIRCLE)
1100
1101 //---------------------------------------------------------
1102 class SAGA_API_DLL_EXPORT CSG_Grid_Cell_Addressor
1103 {
1104 public:
1105 CSG_Grid_Cell_Addressor(void);
1106
1107 bool Destroy (void);
1108
1109 static bool Enable_Parameters (class CSG_Parameters &Parameters);
1110 static bool Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", int Style = SG_GRIDCELLADDR_PARM_DEFAULT);
1111 bool Set_Parameters (class CSG_Parameters &Parameters, int Type = 0);
1112
1113 bool Set_Square (class CSG_Parameters &Parameters);
1114 bool Set_Circle (class CSG_Parameters &Parameters);
1115 bool Set_Annulus (class CSG_Parameters &Parameters);
1116 bool Set_Sector (class CSG_Parameters &Parameters);
1117
1118 CSG_Distance_Weighting & Get_Weighting (void) { return( m_Weighting ); }
1119
1120 bool is_Square (void) const { return( m_Type == 0 ); }
1121 bool is_Circle (void) const { return( m_Type == 1 ); }
1122 bool is_Annulus (void) const { return( m_Type == 2 ); }
1123 bool is_Sector (void) const { return( m_Type == 3 ); }
1124
1125 bool Set_Radius (double Radius, bool bSquare = false);
1126 bool Set_Square (double Radius);
1127 bool Set_Circle (double Radius);
1128 bool Set_Annulus (double Radius_Inner, double Radius_Outer);
1129 bool Set_Sector (double Radius, double Direction, double Tolerance);
1130
1131 double Get_Radius (bool bOuter = true) const { return( bOuter ? m_Radius : m_Radius_0 ); }
1132 double Get_Radius_Inner (void) const { return( m_Radius_0 ); }
1133 double Get_Radius_Outer (void) const { return( m_Radius ); }
1134 double Get_Direction (void) const { return( m_Direction ); }
1135 double Get_Tolerance (void) const { return( m_Tolerance ); }
1136
1137 int Get_Count (void) const { return( (int)m_Kernel.Get_Count() ); }
1138 int Get_X (int Index, int Offset = 0) const { return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (0) + Offset : Offset ); }
1139 int Get_Y (int Index, int Offset = 0) const { return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (1) + Offset : Offset ); }
1140 double Get_Distance (int Index ) const { return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(2) : -1. ); }
1141 double Get_Weight (int Index ) const { return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(3) : 0. ); }
1142 bool Get_Values (int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset = false) const
1143 {
1144 if( Index >= 0 && Index < m_Kernel.Get_Count() )
1145 {
1146 CSG_Table_Record &Cell = m_Kernel[Index];
1147
1148 x = bOffset ? x + Cell.asInt(0) : Cell.asInt(0);
1149 y = bOffset ? y + Cell.asInt(1) : Cell.asInt(1);
1150 Distance = Cell.asDouble(2);
1151 Weight = Cell.asDouble(3);
1152
1153 return( true );
1154 }
1155
1156 return( false );
1157 }
1158
1159
1160 private:
1161
1162 int m_Type;
1163
1164 double m_Radius, m_Radius_0, m_Direction, m_Tolerance;
1165
1166 CSG_Distance_Weighting m_Weighting;
1167
1168 CSG_Table m_Kernel;
1169
1170
1171 bool _Set_Kernel (int Type, double Radius, double Radius_Inner, double Direction, double Tolerance);
1172
1173 };
1174
1175
1177 // //
1178 // //
1179 // //
1181
1182 //---------------------------------------------------------
1183 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grid_H
CSG_Grid_System::Get_IndexFromRowCol
sLong Get_IndexFromRowCol(int x, int y) const
Definition: grid.h:355
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_Grid_File_Info::m_Offset
sLong m_Offset
Definition: grid.h:439
CSG_Grid_System::Get_xGrid_to_World
double Get_xGrid_to_World(int xGrid) const
Definition: grid.h:275
CSG_Rect
Definition: geo_tools.h:471
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:734
CSG_Grid::Add_Value
virtual void Add_Value(int x, int y, double Value)
Definition: grid.h:808
CSG_Grid::is_InGrid
bool is_InGrid(int x, int y, bool bCheckNoData=true) const
Definition: grid.h:593
CSG_Grid_System::Get_xTo
static int Get_xTo(int Direction, int x=0)
Definition: grid.h:310
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
GRID_RESAMPLING_NearestNeighbour
@ GRID_RESAMPLING_NearestNeighbour
Definition: grid.h:157
SG_T
#define SG_T(s)
Definition: api_core.h:531
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
GRID_FILE_KEY_DESCRIPTION
@ GRID_FILE_KEY_DESCRIPTION
Definition: grid.h:103
SG_Grid_Cache_Set_Mode
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Mode(int Mode)
Definition: grid_memory.cpp:104
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Grid::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Definition: grid.h:514
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Grid_Cell_Addressor::Get_Radius_Inner
double Get_Radius_Inner(void) const
Definition: grid.h:1132
CSG_Grid_Cell_Addressor::Get_Tolerance
double Get_Tolerance(void) const
Definition: grid.h:1135
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
SG_ROUND_TO_INT
#define SG_ROUND_TO_INT(x)
Definition: mat_tools.h:140
CSG_Grid::is_InGrid_byPos
bool is_InGrid_byPos(double x, double y, bool bCheckNoData=true) const
Definition: grid.h:594
GRID_FILE_KEY_Z_FACTOR
@ GRID_FILE_KEY_Z_FACTOR
Definition: grid.h:114
CSG_Grid::is_Scaled
bool is_Scaled(void) const
Definition: grid.h:559
GRID_RESAMPLING_BicubicSpline
@ GRID_RESAMPLING_BicubicSpline
Definition: grid.h:159
CSG_Grid::asDouble
virtual double asDouble(int x, int y, bool bScaled=true) const
Definition: grid.h:770
CSG_Grid::asChar
virtual char asChar(sLong i, bool bScaled=true) const
Definition: grid.h:754
CSG_Table_Record
Definition: table.h:130
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
SG_Create_Grid
SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Grid::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grid.h:522
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
GRID_FILE_FORMAT_Compressed
@ GRID_FILE_FORMAT_Compressed
Definition: grid.h:94
CSG_Stack::Get_Record_Pop
void * Get_Record_Pop(void)
Definition: api_core.h:955
CSG_Stack
Definition: api_core.h:923
CSG_Grid_File_Info::m_bSwapBytes
bool m_bSwapBytes
Definition: grid.h:437
GRID_FILE_FORMAT_Undefined
@ GRID_FILE_FORMAT_Undefined
Definition: grid.h:90
CSG_Grid_System
Definition: grid.h:200
GRID_FILE_KEY_BYTEORDER_BIG
@ GRID_FILE_KEY_BYTEORDER_BIG
Definition: grid.h:108
TSG_Grid_Resampling
TSG_Grid_Resampling
Definition: grid.h:156
CSG_Histogram
Definition: mat_tools.h:986
GRID_FILE_KEY_DATAFORMAT
@ GRID_FILE_KEY_DATAFORMAT
Definition: grid.h:107
CSG_Grid::Get_nValueBytes
int Get_nValueBytes(void) const
Definition: grid.h:521
GRID_FILE_FORMAT_GeoTIFF
@ GRID_FILE_FORMAT_GeoTIFF
Definition: grid.h:95
CSG_Grid_System::Get_yWorld_to_Grid
int Get_yWorld_to_Grid(double yWorld) const
Definition: grid.h:291
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
GRID_FILE_KEY_POSITION_YMIN
@ GRID_FILE_KEY_POSITION_YMIN
Definition: grid.h:110
GRID_RESAMPLING_Undefined
@ GRID_RESAMPLING_Undefined
Definition: grid.h:168
CSG_Grid::is_InGrid_byPos
bool is_InGrid_byPos(const TSG_Point &p, bool bCheckNoData=true) const
Definition: grid.h:595
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Data_Object::Save
virtual bool Save(const CSG_String &File, int Format=0)=0
GRID_OPERATION_Multiplication
@ GRID_OPERATION_Multiplication
Definition: grid.h:177
CSG_Grid_System::Get_yGrid_to_World
double Get_yGrid_to_World(int yGrid) const
Definition: grid.h:276
CSG_Grid_System::Get_yTo
static int Get_yTo(int Direction, int y=0)
Definition: grid.h:324
GRID_RESAMPLING_Maximum
@ GRID_RESAMPLING_Maximum
Definition: grid.h:165
CSG_Grid::is_NoData
virtual bool is_NoData(sLong i) const
Definition: grid.h:700
SG_ROUND_TO_SLONG
#define SG_ROUND_TO_SLONG(x)
Definition: mat_tools.h:143
CSG_Grid_File_Info::m_System
CSG_Grid_System m_System
Definition: grid.h:447
CSG_Grid::Mul_Value
virtual void Mul_Value(int x, int y, double Value)
Definition: grid.h:811
SG_Grid_Cache_Set_Directory
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Directory(const SG_Char *Directory)
Definition: grid_memory.cpp:87
GRID_FILE_KEY_CELLSIZE
@ GRID_FILE_KEY_CELLSIZE
Definition: grid.h:113
GRID_FILE_KEY_NODATA_VALUE
@ GRID_FILE_KEY_NODATA_VALUE
Definition: grid.h:116
GRID_OPERATION_Subtraction
@ GRID_OPERATION_Subtraction
Definition: grid.h:176
TSG_Grid_File_Format
TSG_Grid_File_Format
Definition: grid.h:89
SSG_Point
Definition: geo_tools.h:128
CSG_Grid_Cell_Addressor::Get_Weight
double Get_Weight(int Index) const
Definition: grid.h:1141
CSG_Grid_Cell_Addressor::is_Sector
bool is_Sector(void) const
Definition: grid.h:1123
CSG_Stack::Get_Record
void * Get_Record(size_t i) const
Definition: api_core.h:945
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_Grid::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grid.h:546
CSG_File
Definition: api_core.h:1116
CSG_Grid_Cell_Addressor::Get_Count
int Get_Count(void) const
Definition: grid.h:1137
GRID_OPERATION_Addition
@ GRID_OPERATION_Addition
Definition: grid.h:175
SSG_Rect
Definition: geo_tools.h:464
CSG_Grid_System::Get_Cellarea
double Get_Cellarea(void) const
Definition: grid.h:232
SG_Grid_Cache_Set_Threshold_MB
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
Definition: grid_memory.cpp:133
CSG_Grid::Add_Value
virtual void Add_Value(sLong i, double Value)
Definition: grid.h:809
SG_GRIDCELLADDR_PARM_DEFAULT
#define SG_GRIDCELLADDR_PARM_DEFAULT
Definition: grid.h:1099
SG_Grid_Get_File_Format_Default
SAGA_API_DLL_EXPORT TSG_Grid_File_Format SG_Grid_Get_File_Format_Default(void)
Definition: grid_io.cpp:123
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:548
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:539
CSG_Vector
Definition: mat_tools.h:345
CSG_Data_Object
Definition: dataobject.h:180
GRID_FILE_KEY_NAME
@ GRID_FILE_KEY_NAME
Definition: grid.h:102
gSG_Grid_File_Key_Names
const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32]
Definition: grid.h:123
GRID_RESAMPLING_Bilinear
@ GRID_RESAMPLING_Bilinear
Definition: grid.h:158
CSG_Grid::Set_Index
bool Set_Index(bool bOn=true)
Definition: grid.h:650
CSG_Grid_Stack::CSG_Grid_Stack
CSG_Grid_Stack(void)
Definition: grid.h:1045
CSG_Grid::Get_Cellarea
double Get_Cellarea(void) const
Definition: grid.h:540
GRID_RESAMPLING_Mean_Cells
@ GRID_RESAMPLING_Mean_Cells
Definition: grid.h:163
CSG_Grid_System::Get_World_to_Grid
bool Get_World_to_Grid(int &xGrid, int &yGrid, TSG_Point ptWorld) const
Definition: grid.h:298
CSG_Grid_File_Info::m_Unit
CSG_String m_Unit
Definition: grid.h:445
CSG_Grid_System::Get_yToSave
int Get_yToSave(int Direction, int y) const
Definition: grid.h:342
GRID_FILE_KEY_DATAFILE_NAME
@ GRID_FILE_KEY_DATAFILE_NAME
Definition: grid.h:105
CSG_Grid_System::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grid.h:245
SG_Grid_Cache_Set_Threshold
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold(int nBytes)
Definition: grid_memory.cpp:124
CSG_Grid_Cell_Addressor::Get_Weighting
CSG_Distance_Weighting & Get_Weighting(void)
Definition: grid.h:1118
SG_Grid_Get_File_Extension_Default
SAGA_API_DLL_EXPORT CSG_String SG_Grid_Get_File_Extension_Default(void)
Definition: grid_io.cpp:129
CSG_Grid::Get_Memory_Size
sLong Get_Memory_Size(void) const
Definition: grid.h:601
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
CSG_Grid_Cell_Addressor
Definition: grid.h:1103
CSG_Data_Object::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
sLong
signed long long sLong
Definition: api_core.h:158
SG_Grid_Set_File_Format_Default
SAGA_API_DLL_EXPORT bool SG_Grid_Set_File_Format_Default(int Format)
Definition: grid_io.cpp:106
SG_ROUND_TO_CHAR
#define SG_ROUND_TO_CHAR(x)
Definition: mat_tools.h:136
SG_ROUND_TO_WORD
#define SG_ROUND_TO_WORD(x)
Definition: mat_tools.h:137
CSG_Grid_File_Info::m_Type
TSG_Data_Type m_Type
Definition: grid.h:443
CSG_Grid::Get_Sorted
bool Get_Sorted(sLong Position, int &x, int &y, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:682
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Grid::Get_Unit
const CSG_String & Get_Unit(void) const
Definition: grid.h:525
GRID_FILE_KEY_TOPTOBOTTOM
@ GRID_FILE_KEY_TOPTOBOTTOM
Definition: grid.h:117
CSG_Grid::Mul_Value
virtual void Mul_Value(sLong i, double Value)
Definition: grid.h:812
CSG_Distance_Weighting
Definition: geo_tools.h:700
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:544
CSG_Grid::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: grid.h:508
CSG_Grid_System::Get_Grid_to_World
TSG_Point Get_Grid_to_World(int xGrid, int yGrid) const
Definition: grid.h:278
GRID_FILE_FORMAT_Binary_old
@ GRID_FILE_FORMAT_Binary_old
Definition: grid.h:91
CSG_Grid_System::Get_UnitLength
static double Get_UnitLength(int Direction)
Definition: grid.h:350
CSG_Grid_Cell_Addressor::Get_Radius_Outer
double Get_Radius_Outer(void) const
Definition: grid.h:1133
CSG_Grid_File_Info::m_Projection
CSG_Projection m_Projection
Definition: grid.h:449
CSG_Stack::Get_Record_Push
void * Get_Record_Push(void)
Definition: api_core.h:950
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Grid_System::is_InGrid
bool is_InGrid(int x, int y) const
Definition: grid.h:346
GRID_RESAMPLING_BSpline
@ GRID_RESAMPLING_BSpline
Definition: grid.h:160
CSG_Grid_System::Fit_yto_Grid_System
double Fit_yto_Grid_System(double y) const
Aligns the world coordinate y to the columns of the grid system and returns it.
Definition: grid.h:262
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
CSG_Grid::Get_Sorted
bool Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:677
CSG_Grid::asShort
virtual short asShort(int x, int y, bool bScaled=true) const
Definition: grid.h:755
CSG_Grid::Get_Sorted
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:662
SG_ROUND_TO_BYTE
#define SG_ROUND_TO_BYTE(x)
Definition: mat_tools.h:135
TSG_Grid_File_Key
TSG_Grid_File_Key
Definition: grid.h:101
CSG_Grid_File_Info::m_zScale
double m_zScale
Definition: grid.h:441
grid_pyramid.h
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Grid_System::Get_Length
double Get_Length(int Direction) const
Definition: grid.h:349
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
SG_ROUND_TO_ULONG
#define SG_ROUND_TO_ULONG(x)
Definition: mat_tools.h:142
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
CSG_Grid_System::Get_XMax
double Get_XMax(bool bCells=false) const
Definition: grid.h:241
CSG_Grid_System::Get_yFrom
static int Get_yFrom(int Direction, int y=0)
Definition: grid.h:339
SG_Grid_Cache_Get_Threshold_MB
SAGA_API_DLL_EXPORT double SG_Grid_Cache_Get_Threshold_MB(void)
Definition: grid_memory.cpp:145
CSG_Grid::Set_NoData
virtual void Set_NoData(sLong i)
Definition: grid.h:703
CSG_Projection
Definition: geo_tools.h:833
SG_Grid_Cache_Get_Directory
SAGA_API_DLL_EXPORT const SG_Char * SG_Grid_Cache_Get_Directory(void)
Definition: grid_memory.cpp:81
CSG_Grid_Cell_Addressor::Get_Direction
double Get_Direction(void) const
Definition: grid.h:1134
SG_Grid_Cache_Get_Mode
SAGA_API_DLL_EXPORT int SG_Grid_Cache_Get_Mode(void)
Definition: grid_memory.cpp:110
CSG_Grid_Stack::operator[]
const TSG_Point_Int & operator[](size_t i) const
Definition: grid.h:1048
CSG_Table
Definition: table.h:283
CSG_Grid_System::Get_xFromSave
int Get_xFromSave(int Direction, int x) const
Definition: grid.h:343
CSG_Grid::Set_NoData
virtual void Set_NoData(int x, int y)
Definition: grid.h:702
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:274
CSG_Grid::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grid.h:550
SG_ROUND_TO_DWORD
#define SG_ROUND_TO_DWORD(x)
Definition: mat_tools.h:139
CSG_Grid_Cell_Addressor::Get_Y
int Get_Y(int Index, int Offset=0) const
Definition: grid.h:1139
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
CSG_Grid::Set_Value
virtual void Set_Value(int x, int y, double Value, bool bScaled=true)
Definition: grid.h:820
CSG_Grid::Save
virtual bool Save(const char *File, int Format=0)
Definition: grid.h:507
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:238
GRID_OPERATION_Division
@ GRID_OPERATION_Division
Definition: grid.h:178
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Grid_Cell_Addressor::Get_Values
bool Get_Values(int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset=false) const
Definition: grid.h:1142
CSG_String
Definition: api_core.h:557
SG_Grid_Cache_Get_Threshold
SAGA_API_DLL_EXPORT sLong SG_Grid_Cache_Get_Threshold(void)
Definition: grid_memory.cpp:139
GRID_RESAMPLING_Majority
@ GRID_RESAMPLING_Majority
Definition: grid.h:166
CSG_Grid::asLong
virtual sLong asLong(int x, int y, bool bScaled=true) const
Definition: grid.h:759
GRID_RESAMPLING_Mean_Nodes
@ GRID_RESAMPLING_Mean_Nodes
Definition: grid.h:162
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
SSG_Point_Int
Definition: geo_tools.h:418
CSG_Grid_Cell_Addressor::Get_X
int Get_X(int Index, int Offset=0) const
Definition: grid.h:1138
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
GRID_FILE_KEY_UNITNAME
@ GRID_FILE_KEY_UNITNAME
Definition: grid.h:104
CSG_Grid::asFloat
virtual float asFloat(int x, int y, bool bScaled=true) const
Definition: grid.h:761
CSG_Grid_System::Fit_to_Grid_System
TSG_Point Fit_to_Grid_System(TSG_Point ptWorld) const
Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it.
Definition: grid.h:265
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Grid_Cell_Addressor::is_Square
bool is_Square(void) const
Definition: grid.h:1120
CSG_Grid::Get_Memory_Size_MB
double Get_Memory_Size_MB(void) const
Definition: grid.h:602
N_MEGABYTE_BYTES
#define N_MEGABYTE_BYTES
Definition: mat_tools.h:117
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Grid_System::Get_xWorld_to_Grid
int Get_xWorld_to_Grid(double xWorld) const
Definition: grid.h:290
CSG_Grid_System::Get_xFrom
static int Get_xFrom(int Direction, int x=0)
Definition: grid.h:338
SG_ROUND_TO_SHORT
#define SG_ROUND_TO_SHORT(x)
Definition: mat_tools.h:138
GRID_FILE_KEY_CELLCOUNT_X
@ GRID_FILE_KEY_CELLCOUNT_X
Definition: grid.h:111
GRID_FILE_KEY_Z_OFFSET
@ GRID_FILE_KEY_Z_OFFSET
Definition: grid.h:115
CSG_Grid::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:542
SSG_Point_Int::y
int y
Definition: geo_tools.h:419
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:605
CSG_Grid
Definition: grid.h:473
CSG_Grid_System::Get_World_to_Grid
bool Get_World_to_Grid(int &xGrid, int &yGrid, double xWorld, double yWorld) const
Definition: grid.h:293
CSG_Grid_Stack::Pop
virtual bool Pop(int &x, int &y)
Definition: grid.h:1067
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Grid_System::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grid.h:246
GRID_RESAMPLING_Minimum
@ GRID_RESAMPLING_Minimum
Definition: grid.h:164
CSG_Grid_System::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grid.h:242
CSG_Grid_Cell_Addressor::Get_Distance
double Get_Distance(int Index) const
Definition: grid.h:1140
CSG_Grid::asFloat
virtual float asFloat(sLong i, bool bScaled=true) const
Definition: grid.h:762
CSG_Grid::asLong
virtual sLong asLong(sLong i, bool bScaled=true) const
Definition: grid.h:760
CSG_Grid_Cell_Addressor::is_Annulus
bool is_Annulus(void) const
Definition: grid.h:1122
CSG_Grid::asByte
virtual BYTE asByte(sLong i, bool bScaled=true) const
Definition: grid.h:752
CSG_Grid::asByte
virtual BYTE asByte(int x, int y, bool bScaled=true) const
Definition: grid.h:751
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
CSG_Grid_Stack::Push
virtual bool Push(int x, int y)
Definition: grid.h:1051
CSG_Grid_System::Get_RowColFromIndex
bool Get_RowColFromIndex(int &x, int &y, sLong i) const
Definition: grid.h:365
CSG_Grid::asChar
virtual char asChar(int x, int y, bool bScaled=true) const
Definition: grid.h:753
CSG_Grid_Cell_Addressor::Get_Radius
double Get_Radius(bool bOuter=true) const
Definition: grid.h:1131
CSG_Parameters
Definition: parameters.h:1650
CSG_Grid_Cell_Addressor::is_Circle
bool is_Circle(void) const
Definition: grid.h:1121
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
GRID_FILE_KEY_CELLCOUNT_Y
@ GRID_FILE_KEY_CELLCOUNT_Y
Definition: grid.h:112
CSG_Grid::asShort
virtual short asShort(sLong i, bool bScaled=true) const
Definition: grid.h:756
GRID_FILE_FORMAT_Binary
@ GRID_FILE_FORMAT_Binary
Definition: grid.h:92
GRID_FILE_KEY_Count
@ GRID_FILE_KEY_Count
Definition: grid.h:118
CSG_Grid_System::Get_yFromSave
int Get_yFromSave(int Direction, int y) const
Definition: grid.h:344
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:699
GRID_FILE_KEY_POSITION_XMIN
@ GRID_FILE_KEY_POSITION_XMIN
Definition: grid.h:109
SSG_Point_Int::x
int x
Definition: geo_tools.h:419
GRID_FILE_FORMAT_ASCII
@ GRID_FILE_FORMAT_ASCII
Definition: grid.h:93
CSG_Grid_System::Get_Neighbor_Pos
bool Get_Neighbor_Pos(int Direction, int x, int y, int &xPos, int &yPos) const
Definition: grid.h:305
CSG_Grid::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grid.h:533
CSG_Grid_System::Fit_xto_Grid_System
double Fit_xto_Grid_System(double x) const
Aligns the world coordinate x to the rows of the grid system and returns it.
Definition: grid.h:259
GRID_FILE_KEY_DATAFILE_OFFSET
@ GRID_FILE_KEY_DATAFILE_OFFSET
Definition: grid.h:106
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Grid_System::Get_xToSave
int Get_xToSave(int Direction, int x) const
Definition: grid.h:341
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
table.h
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Grid_Stack
Definition: grid.h:1043
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Grid::Get_XMax
double Get_XMax(bool bCells=false) const
Definition: grid.h:545
CSG_Grid_System::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:236
CSG_Grid::asInt
virtual int asInt(sLong i, bool bScaled=true) const
Definition: grid.h:758
CSG_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:537
CSG_Grid_File_Info
Definition: grid.h:408
TSG_Grid_Operation
TSG_Grid_Operation
Definition: grid.h:174
CSG_Grid_System::is_InGrid
bool is_InGrid(int x, int y, int Rand) const
Definition: grid.h:347
CSG_Grid::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grid.h:549
CSG_Grid::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grid.h:636
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_io.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions | Variables
grid_io.cpp File Reference
#include <stdint.h>
#include <string.h>
#include <WinSock2.h>
#include "grid.h"
#include "data_manager.h"
#include "tool_library.h"

Go to the source code of this file.

Macros

#define GRID_FILE_PRINT(Key, Val) { CSG_String s(gSG_Grid_File_Key_Names[Key]); s += "\t= " + Val + "\n"; Stream.Write(s); }

Functions

bool | SG_Grid_Set_File_Format_Default (int Format)
TSG_Grid_File_Format | SG_Grid_Get_File_Format_Default (void)
CSG_String | SG_Grid_Get_File_Extension_Default (void)

Variables

static TSG_Grid_File_Format gSG_Grid_File_Format_Default = GRID_FILE_FORMAT_Binary_old

Macro Definition Documentation

◆ GRID_FILE_PRINT

#define GRID_FILE_PRINT | ( | Key,
 |  | Val
 | ) | { CSG_String s(gSG_Grid_File_Key_Names[Key]); s += "\t= " + Val + "\n"; Stream.Write(s); }

Function Documentation

◆ SG_Grid_Get_File_Extension_Default()

CSG_String SG_Grid_Get_File_Extension_Default ( void )

Definition at line 129 of file grid_io.cpp.

References GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF, and gSG_Grid_File_Format_Default.

◆ SG_Grid_Get_File_Format_Default()

TSG_Grid_File_Format SG_Grid_Get_File_Format_Default ( void )

Definition at line 123 of file grid_io.cpp.

References gSG_Grid_File_Format_Default.

◆ SG_Grid_Set_File_Format_Default()

bool SG_Grid_Set_File_Format_Default ( int Format )

Definition at line 106 of file grid_io.cpp.

References GRID_FILE_FORMAT_ASCII, GRID_FILE_FORMAT_Binary, GRID_FILE_FORMAT_Binary_old, GRID_FILE_FORMAT_Compressed, GRID_FILE_FORMAT_GeoTIFF, and gSG_Grid_File_Format_Default.

Variable Documentation

◆ gSG_Grid_File_Format_Default

TSG_Grid_File_Format gSG_Grid_File_Format_Default = GRID_FILE_FORMAT_Binary_old
static

Definition at line 103 of file grid_io.cpp.

Referenced by CSG_Grid::Save(), SG_Grid_Get_File_Extension_Default(), SG_Grid_Get_File_Format_Default(), and SG_Grid_Set_File_Format_Default().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_io.cpp Source File

  • saga_core
  • saga_api
grid_io.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid_io.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include <stdint.h>
52 #include <string.h>
53
54 #ifdef _SAGA_LINUX
55 #include "config.h"
56 #include <arpa/inet.h>
57 #include <netinet/in.h>
58 #else
59 #include <WinSock2.h>
60 #endif
61
62 #include "grid.h"
63 #include "data_manager.h"
64 #include "tool_library.h"
65
66
68 // //
69 // //
70 // //
72
73 //---------------------------------------------------------
74 bool CSG_Grid::On_Reload(void)
75 {
76 return( Create(Get_File_Name(false)) );
77 }
78
79 //---------------------------------------------------------
80 bool CSG_Grid::On_Delete(void)
81 {
82 CSG_String FileName = Get_File_Name(true);
83
84 SG_File_Set_Extension(FileName, "sg-grd-z"); SG_File_Delete(FileName);
85 SG_File_Set_Extension(FileName, "sg-grd" ); SG_File_Delete(FileName);
86 SG_File_Set_Extension(FileName, "sgrd" ); SG_File_Delete(FileName);
87 SG_File_Set_Extension(FileName, "sdat" ); SG_File_Delete(FileName); SG_File_Delete(FileName + ".aux.xml");
88 SG_File_Set_Extension(FileName, "mgrd" ); SG_File_Delete(FileName);
89 SG_File_Set_Extension(FileName, "dgm" ); SG_File_Delete(FileName);
90 SG_File_Set_Extension(FileName, "dat" ); SG_File_Delete(FileName);
91
92 return( true );
93 }
94
95
97 // //
98 // //
99 // //
101
102 //---------------------------------------------------------
103 static TSG_Grid_File_Format gSG_Grid_File_Format_Default = GRID_FILE_FORMAT_Binary_old;
104
105 //---------------------------------------------------------
106 bool SG_Grid_Set_File_Format_Default (int Format)
107 {
108 switch( Format )
109 {
110 case GRID_FILE_FORMAT_Binary_old:
111 case GRID_FILE_FORMAT_Binary :
112 case GRID_FILE_FORMAT_Compressed:
113 case GRID_FILE_FORMAT_ASCII :
114 case GRID_FILE_FORMAT_GeoTIFF :
115 gSG_Grid_File_Format_Default = (TSG_Grid_File_Format)Format;
116 return( true );
117 }
118
119 return( false );
120 }
121
122 //---------------------------------------------------------
123 TSG_Grid_File_Format SG_Grid_Get_File_Format_Default (void)
124 {
125 return( gSG_Grid_File_Format_Default );
126 }
127
128 //---------------------------------------------------------
129 CSG_String SG_Grid_Get_File_Extension_Default (void)
130 {
131 switch( gSG_Grid_File_Format_Default )
132 {
133 default:
134 case GRID_FILE_FORMAT_Compressed: return( "sg-grd-z" );
135 case GRID_FILE_FORMAT_Binary : return( "sg-grd" );
136 case GRID_FILE_FORMAT_Binary_old: return( "sgrd" );
137 case GRID_FILE_FORMAT_GeoTIFF : return( "tif" );
138 }
139 }
140
141
143 // //
145
146 //---------------------------------------------------------
147 bool CSG_Grid::Save(const CSG_String &FileName, int Format)
148 {
149 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid"), FileName.c_str()), true);
150
151 //-----------------------------------------------------
152 if( Format == GRID_FILE_FORMAT_Undefined )
153 {
154 Format = gSG_Grid_File_Format_Default;
155
156 if( SG_File_Cmp_Extension(FileName, "sg-grd-z") ) Format = GRID_FILE_FORMAT_Compressed;
157 if( SG_File_Cmp_Extension(FileName, "sg-grd" ) ) Format = GRID_FILE_FORMAT_Binary ;
158 if( SG_File_Cmp_Extension(FileName, "sgrd" ) ) Format = GRID_FILE_FORMAT_Binary_old;
159 if( SG_File_Cmp_Extension(FileName, "tif" ) ) Format = GRID_FILE_FORMAT_GeoTIFF ;
160 }
161
162 //-----------------------------------------------------
163 bool bResult = false;
164
165 switch( Format )
166 {
167 default:
168 bResult = _Save_Native(FileName, (TSG_Grid_File_Format)Format);
169 break;
170
171 case GRID_FILE_FORMAT_Compressed:
172 bResult = _Save_Compressed(FileName);
173 break;
174
175 case GRID_FILE_FORMAT_GeoTIFF:
176 SG_UI_Msg_Lock(true);
177 SG_RUN_TOOL(bResult, "io_gdal", 2, // Export GeoTIFF
178 SG_TOOL_PARAMLIST_ADD("GRIDS" , this)
179 && SG_TOOL_PARAMETER_SET("FILE" , FileName)
180 && SG_TOOL_PARAMETER_SET("OPTIONS" , SG_T("COMPRESS=LZW BIGTIFF=YES")) // enable bigtiff as the 'if needed' default setting is not available for compressed files
181 );
182 SG_UI_Msg_Lock(false);
183 break;
184 }
185
186 SG_UI_Process_Set_Ready();
187
188 //-----------------------------------------------------
189 if( bResult )
190 {
191 Set_Modified(false);
192
193 Set_File_Name(FileName, true);
194
195 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
196
197 return( true );
198 }
199
200 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
201
202 return( false );
203 }
204
205
207 // //
208 // //
209 // //
211
212 //---------------------------------------------------------
213 bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLoadData)
214 {
215 bool bResult = false;
216
217 CSG_Data_Manager Data;
218
219 CSG_Tool *pTool = NULL;
220
221 SG_UI_Msg_Lock(true);
222
223 //-----------------------------------------------------
224 // Image Import
225
226 if( ( SG_File_Cmp_Extension(FileName, "bmp")
227 || SG_File_Cmp_Extension(FileName, "gif")
228 || SG_File_Cmp_Extension(FileName, "jpg")
229 || SG_File_Cmp_Extension(FileName, "png")
230 || SG_File_Cmp_Extension(FileName, "pcx") )
231 && !bResult && (pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL )
232 {
233 pTool->Settings_Push(&Data);
234
235 bResult = pTool->Set_Parameter("FILE", FileName)
236 && pTool->Execute();
237
238 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
239 }
240
241 //-----------------------------------------------------
242 // GDAL Import
243
244 if( !bResult && (pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 0)) != NULL )
245 {
246 pTool->Settings_Push(&Data);
247
248 bResult = pTool->Set_Parameter("FILES" , FileName)
249 && pTool->Set_Parameter("MULTIPLE", 0 ) // output as single grid(s)
250 && pTool->Execute();
251
252 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
253 }
254
255 SG_UI_Msg_Lock(false);
256
257 //-----------------------------------------------------
258 if( bResult && Data.Get_Grid_System(0) && Data.Get_Grid_System(0)->Get(0) && Data.Get_Grid_System(0)->Get(0)->is_Valid() )
259 {
260 CSG_Grid *pGrid = (CSG_Grid *)Data.Get_Grid_System(0)->Get(0);
261
262 if( pGrid->is_Cached() )
263 {
264 return( Create(*pGrid) );
265 }
266
267 Set_File_Name(FileName, false);
268
269 Set_Name (pGrid->Get_Name());
270 Set_Description (pGrid->Get_Description());
271
272 m_System = pGrid->m_System;
273 m_Type = pGrid->m_Type;
274 m_Values = pGrid->m_Values; pGrid->m_Values = NULL; // take ownership of data array
275
276 m_zOffset = pGrid->m_zOffset;
277 m_zScale = pGrid->m_zScale;
278 m_Unit = pGrid->m_Unit;
279
280 m_nBytes_Value = pGrid->m_nBytes_Value;
281 m_nBytes_Line = pGrid->m_nBytes_Line;
282
283 Get_MetaData () = pGrid->Get_MetaData ();
284 Get_Projection() = pGrid->Get_Projection();
285
286 Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_Value(true));
287
288 return( true );
289 }
290
291 return( false );
292 }
293
294 //---------------------------------------------------------
295 bool CSG_Grid::_Load_PGSQL(const CSG_String &FileName, bool bCached, bool bLoadData)
296 {
297 bool bResult = false;
298
299 if( FileName.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
300 {
301 CSG_String s(FileName);
302
303 s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
304 s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
305 s = s.AfterFirst(':'); CSG_String DBName(s.BeforeFirst(':'));
306 s = s.AfterFirst(':'); CSG_String Table (s.BeforeFirst(':'));
307 s = s.AfterFirst(':'); CSG_String rid (s.BeforeFirst(':').AfterFirst('='));
308
309 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 0, true); // CGet_Connections
310
311 if( pTool != NULL )
312 {
313 SG_UI_ProgressAndMsg_Lock(true);
314
315 //---------------------------------------------
316 CSG_Table Connections; CSG_String Connection(DBName + " [" + Host + ":" + Port + "]");
317
318 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
319
320 if( SG_TOOL_PARAMETER_SET("CONNECTIONS", &Connections) && pTool->Execute() ) // CGet_Connections
321 {
322 for(int i=0; !bResult && i<Connections.Get_Count(); i++)
323 {
324 if( !Connection.Cmp(Connections[i].asString(0)) )
325 {
326 bResult = true;
327 }
328 }
329 }
330
331 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
332
333 //---------------------------------------------
334 if( bResult && (bResult = (pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 33, true)) != NULL) == true ) // CPGIS_Raster_Load_Band
335 {
336 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
337
338 bResult = SG_TOOL_PARAMETER_SET("CONNECTION", Connection)
339 && SG_TOOL_PARAMETER_SET("DB_TABLE" , Table )
340 && SG_TOOL_PARAMETER_SET("RID" , rid )
341 && SG_TOOL_PARAMETER_SET("GRID" , this )
342 && pTool->Execute();
343
344 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
345 }
346
347 SG_UI_ProgressAndMsg_Lock(false);
348 }
349 }
350
351 return( bResult );
352 }
353
354
356 // //
357 // Native //
358 // //
360
361 //---------------------------------------------------------
362 bool CSG_Grid::_Load_Native(const CSG_String &FileName, bool bCached, bool bLoadData)
363 {
364 CSG_Grid_File_Info Info;
365
366 if( !Info.Create(FileName) )
367 {
368 return( false );
369 }
370
371 Set_File_Name(FileName, true);
372
373 Set_Name (Info.m_Name);
374 Set_Description (Info.m_Description);
375 Set_Unit (Info.m_Unit);
376
377 Set_NoData_Value_Range(Info.m_NoData[0], Info.m_NoData[1]);
378
379 m_System = Info.m_System;
380 m_Type = Info.m_Type;
381 m_zScale = Info.m_zScale;
382 m_zOffset = Info.m_zOffset;
383
384 m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
385 m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
386
387 Get_Projection().Load(SG_File_Make_Path("", FileName, "prj"), SG_PROJ_FMT_WKT);
388
389 if( !bLoadData )
390 {
391 return( _Memory_Create(bCached) );
392 }
393
394 Load_MetaData(FileName);
395
396 //-----------------------------------------------------
397 CSG_File Stream;
398
399 if( !SG_Data_Type_is_Numeric(m_Type) ) // ASCII...
400 {
401 if( Stream.Open(Info.m_Data_File , SG_FILE_R, false)
402 || Stream.Open(SG_File_Make_Path("", FileName, "dat"), SG_FILE_R, false)
403 || Stream.Open(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_R, false) )
404 {
405 Stream.Seek(Info.m_Offset);
406
407 return( _Load_ASCII(Stream, bCached, Info.m_bFlip) );
408 }
409 }
410
411 //-----------------------------------------------------
412 else // Binary...
413 {
414 if( bCached || _Cache_Check() )
415 {
416 if( _Cache_Create(Info.m_Data_File , m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
417 || _Cache_Create(SG_File_Make_Path("", FileName, "dat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
418 || _Cache_Create(SG_File_Make_Path("", FileName, "sdat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip) )
419 {
420 return( true );
421 }
422 }
423
424 m_Cache_File = Info.m_Data_File;
425 m_Cache_Offset = Info.m_Offset;
426 m_Cache_bSwap = Info.m_bSwapBytes;
427 m_Cache_bFlip = Info.m_bFlip;
428
429 if( _Memory_Create(bCached) )
430 {
431 if( Stream.Open(Info.m_Data_File , SG_FILE_R, true)
432 || Stream.Open(SG_File_Make_Path("", FileName, "dat"), SG_FILE_R, true)
433 || Stream.Open(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_R, true) )
434 {
435 Stream.Seek(Info.m_Offset);
436
437 return( _Load_Binary(Stream, m_Type, Info.m_bFlip, Info.m_bSwapBytes) );
438 }
439 }
440 }
441
442 return( false );
443 }
444
445 //---------------------------------------------------------
446 bool CSG_Grid::_Save_Native(const CSG_String &_FileName, TSG_Grid_File_Format Format)
447 {
448 #ifdef WORDS_BIGENDIAN
449 bool bBigEndian = true;
450 #else
451 bool bBigEndian = false;
452 #endif
453
454 CSG_String FileName(_FileName);
455
456 bool bBinary;
457
458 if( Format == GRID_FILE_FORMAT_ASCII )
459 {
460 bBinary = false;
461 }
462 else if( Format == GRID_FILE_FORMAT_Binary_old )
463 {
464 bBinary = true; SG_File_Set_Extension(FileName, "sgrd");
465 }
466 else
467 {
468 bBinary = true; SG_File_Set_Extension(FileName, "sg-grd");
469 }
470
471 CSG_Grid_File_Info Info(*this);
472
473 if( Info.Save(FileName, bBinary) )
474 {
475 CSG_File Stream(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_W, true);
476
477 if( bBinary ? _Save_Binary(Stream, m_Type, false, bBigEndian) : _Save_ASCII (Stream) )
478 {
479 Save_MetaData(FileName);
480
481 Get_Projection().Save(SG_File_Make_Path("", FileName, "prj"), SG_PROJ_FMT_WKT);
482
483 Info.Save_AUX_XML(SG_File_Make_Path("", FileName, "sdat"));
484
485 return( true );
486 }
487 }
488
489 return( false );
490 }
491
492
494 // //
495 // Compressed //
496 // //
498
499 //---------------------------------------------------------
500 bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool bLoadData)
501 {
502 Set_File_Name(_FileName, true);
503
504 CSG_File_Zip Stream(_FileName, SG_FILE_R);
505
506 if( !Stream.is_Reading() )
507 {
508 return( false );
509 }
510
511 //-----------------------------------------------------
512 CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
513
514 if( !Stream.Get_File(FileName + "sgrd" )
515 && !Stream.Get_File(FileName + "sg-grd") )
516 {
517 FileName.Clear();
518
519 for(size_t i=0; i<Stream.Get_File_Count(); i++)
520 {
521 if( SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sgrd" )
522 || SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sg-grd") )
523 {
524 FileName = SG_File_Get_Name(Stream.Get_File_Name(i), false) + ".";
525 Stream.Get_File(Stream.Get_File_Name(i));
526 break;
527 }
528 }
529
530 if( FileName.is_Empty() )
531 {
532 return( false );
533 }
534 }
535
536 //-----------------------------------------------------
537 CSG_Grid_File_Info Info;
538
539 if( !Info.Create(Stream) )
540 {
541 return( false );
542 }
543
544 Set_Name (Info.m_Name);
545 Set_Description (Info.m_Description);
546 Set_Unit (Info.m_Unit);
547
548 Set_NoData_Value_Range(Info.m_NoData[0], Info.m_NoData[1]);
549
550 m_System = Info.m_System;
551 m_Type = Info.m_Type;
552 m_zScale = Info.m_zScale;
553 m_zOffset = Info.m_zOffset;
554
555 m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
556 m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
557
558 if( Stream.Get_File(FileName + "prj") )
559 {
560 Get_Projection().Load(Stream, SG_PROJ_FMT_WKT);
561 }
562
563 if( !bLoadData )
564 {
565 return( _Memory_Create(bCached) );
566 }
567
568 if( Stream.Get_File(FileName + "mgrd") )
569 {
570 Load_MetaData(Stream);
571 }
572
573 //-----------------------------------------------------
574 if( _Cache_Check() )
575 {
576 bCached = true;
577 }
578
579 return( Stream.Get_File(FileName + "sdat") && _Memory_Create(bCached)
580 && _Load_Binary(Stream, m_Type, Info.m_bFlip, Info.m_bSwapBytes)
581 );
582 }
583
584 //---------------------------------------------------------
585 bool CSG_Grid::_Save_Compressed(const CSG_String &_FileName)
586 {
587 #ifdef WORDS_BIGENDIAN
588 bool bBigEndian = true;
589 #else
590 bool bBigEndian = false;
591 #endif
592
593 CSG_File_Zip Stream(_FileName, SG_FILE_W);
594
595 if( Stream.is_Writing() )
596 {
597 CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
598
599 CSG_Grid_File_Info Info(*this);
600
601 if( Stream.Add_File(FileName + "sgrd") && Info.Save(Stream, true)
602 && Stream.Add_File(FileName + "sdat") && _Save_Binary(Stream, m_Type, false, bBigEndian) )
603 {
604 Stream.Add_File(FileName + "mgrd" ); Save_MetaData(Stream);
605 Stream.Add_File(FileName + "prj" ); Get_Projection().Save(Stream, SG_PROJ_FMT_WKT);
606 Stream.Add_File(FileName + "sdat.aux.xml"); Info.Save_AUX_XML(Stream);
607
608 return( true );
609 }
610 }
611
612 return( false );
613 }
614
615
617 // //
618 // Binary //
619 // //
621
622 //---------------------------------------------------------
623 void CSG_Grid::_Swap_Bytes(char *Bytes, int nBytes) const
624 {
625 if( nBytes == 2 )
626 {
627 uint16_t val, valSwapped;
628 memcpy(&val, Bytes, nBytes);
629 valSwapped = ntohs(val);
630 memcpy(Bytes, &valSwapped, nBytes);
631 }
632 else if( nBytes == 4 )
633 {
634 uint32_t val, valSwapped;
635 memcpy(&val, Bytes, nBytes);
636 valSwapped = ntohl(val);
637 memcpy(Bytes, &valSwapped, nBytes);
638 }
639 }
640
641 //---------------------------------------------------------
642 bool CSG_Grid::_Load_Binary(CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes)
643 {
644 if( !Stream.is_Open() || !is_Valid() )
645 {
646 return( false );
647 }
648
649 Set_File_Type(GRID_FILE_FORMAT_Binary);
650
651 //-----------------------------------------------------
652 if( File_Type == SG_DATATYPE_Bit )
653 {
654 int nLineBytes = Get_NX() / 8 + 1;
655
656 if( m_Type == File_Type && !is_Cached() )
657 {
658 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
659 {
660 Stream.Read(m_Values[bFlip ? Get_NY() - y - 1 : y], sizeof(char), nLineBytes);
661 }
662 }
663 else
664 {
665 CSG_Array Line(1, nLineBytes);
666
667 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
668 {
669 Stream.Read(Line.Get_Array(), nLineBytes);
670
671 char *pValue = (char *)Line.Get_Array();
672
673 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); pValue++)
674 {
675 for(int i=0; i<8 && x<Get_NX(); i++, x++)
676 {
677 Set_Value(x, yy, (*pValue & m_Bitmask[i]) == 0 ? 0.0 : 1.0);
678 }
679 }
680 }
681 }
682 }
683
684 //-----------------------------------------------------
685 else
686 {
687 int nValueBytes = (int)SG_Data_Type_Get_Size(File_Type);
688 int nLineBytes = Get_NX() * nValueBytes;
689
690 if( m_Type == File_Type && !is_Cached() && !bSwapBytes )
691 {
692 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
693 {
694 Stream.Read(m_Values[bFlip ? Get_NY() - y - 1 : y], nLineBytes);
695 }
696 }
697 else
698 {
699 CSG_Array Line(1, nLineBytes);
700
701 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
702 {
703 Stream.Read(Line.Get_Array(), nLineBytes);
704
705 char *pValue = (char *)Line.Get_Array();
706
707 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); x++, pValue+=nValueBytes)
708 {
709 if( bSwapBytes )
710 {
711 _Swap_Bytes(pValue, nValueBytes);
712 }
713
714 switch( File_Type )
715 {
716 case SG_DATATYPE_Byte : Set_Value(x, yy, *(BYTE *)pValue, false); break;
717 case SG_DATATYPE_Char : Set_Value(x, yy, *(char *)pValue, false); break;
718 case SG_DATATYPE_Word : Set_Value(x, yy, *(WORD *)pValue, false); break;
719 case SG_DATATYPE_Short : Set_Value(x, yy, *(short *)pValue, false); break;
720 case SG_DATATYPE_DWord : Set_Value(x, yy, *(DWORD *)pValue, false); break;
721 case SG_DATATYPE_Int : Set_Value(x, yy, *(int *)pValue, false); break;
722 case SG_DATATYPE_Float : Set_Value(x, yy, *(float *)pValue, false); break;
723 case SG_DATATYPE_Double: Set_Value(x, yy, *(double *)pValue, false); break;
724 default: break;
725 }
726 }
727 }
728 }
729 }
730
731 //-----------------------------------------------------
732 return( true );
733 }
734
735 //---------------------------------------------------------
736 bool CSG_Grid::_Save_Binary(CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes)
737 {
738 //-----------------------------------------------------
739 if( !Stream.is_Writing() || !is_Valid() )
740 {
741 return( false );
742 }
743
744 Set_File_Type(GRID_FILE_FORMAT_Binary);
745
746 //-----------------------------------------------------
747 if( File_Type == SG_DATATYPE_Bit )
748 {
749 int nLineBytes = Get_NX() / 8 + 1;
750
751 if( m_Type == File_Type && !is_Cached() )
752 {
753 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
754 {
755 Stream.Write((char *)m_Values[bFlip ? Get_NY() - y - 1 : y], sizeof(char), nLineBytes);
756 }
757 }
758 else
759 {
760 CSG_Array Line(1, nLineBytes);
761
762 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
763 {
764 char *pValue = (char *)Line.Get_Array();
765
766 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); pValue++)
767 {
768 for(int i=0; i<8 && x<Get_NX(); i++, x++)
769 {
770 *pValue = asChar(x, yy) != 0.0 ? *pValue | m_Bitmask[i] : *pValue & (~m_Bitmask[i]);
771 }
772 }
773
774 Stream.Write(Line.Get_Array(), nLineBytes);
775 }
776 }
777 }
778
779 //-----------------------------------------------------
780 else
781 {
782 int nValueBytes = (int)SG_Data_Type_Get_Size(File_Type);
783 int nLineBytes = Get_NX() * nValueBytes;
784
785 if( m_Type == File_Type && !is_Cached() && !bSwapBytes )
786 {
787 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
788 {
789 Stream.Write((char *)m_Values[bFlip ? Get_NY() - y - 1 : y], nLineBytes);
790 }
791 }
792 else
793 {
794 CSG_Array Line(1, nLineBytes);
795
796 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
797 {
798 char *pValue = (char *)Line.Get_Array();
799
800 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); x++, pValue+=nValueBytes)
801 {
802 switch( File_Type )
803 {
804 case SG_DATATYPE_Byte : *(BYTE *)pValue = asByte (x, yy, false); break;
805 case SG_DATATYPE_Char : *(char *)pValue = asChar (x, yy, false); break;
806 case SG_DATATYPE_Word : *(WORD *)pValue = asShort (x, yy, false); break;
807 case SG_DATATYPE_Short : *(short *)pValue = asShort (x, yy, false); break;
808 case SG_DATATYPE_DWord : *(DWORD *)pValue = asInt (x, yy, false); break;
809 case SG_DATATYPE_Int : *(int *)pValue = asInt (x, yy, false); break;
810 case SG_DATATYPE_Float : *(float *)pValue = asFloat (x, yy, false); break;
811 case SG_DATATYPE_Double: *(double *)pValue = asDouble(x, yy, false); break;
812 default: break;
813 }
814
815 if( bSwapBytes )
816 {
817 _Swap_Bytes(pValue, nValueBytes);
818 }
819 }
820
821 Stream.Write(Line.Get_Array(), nLineBytes);
822 }
823 }
824 }
825
826 //-----------------------------------------------------
827 return( true );
828 }
829
830
832 // //
833 // ASCII //
834 // //
836
837 //---------------------------------------------------------
838 bool CSG_Grid::_Load_ASCII(CSG_File &Stream, bool bCached, bool bFlip)
839 {
840 if( !Stream.is_Reading() || !_Memory_Create(bCached) )
841 {
842 return( false );
843 }
844
845 Set_File_Type(GRID_FILE_FORMAT_ASCII);
846
847 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
848 {
849 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); x++)
850 {
851 Set_Value(x, yy, Stream.Scan_Double());
852 }
853 }
854
855 return( true );
856 }
857
858 //---------------------------------------------------------
859 bool CSG_Grid::_Save_ASCII(CSG_File &Stream, bool bFlip)
860 {
861 if( !Stream.is_Writing() || !is_Valid() )
862 {
863 return( false );
864 }
865
866 Set_File_Type(GRID_FILE_FORMAT_ASCII);
867
868 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
869 {
870 for(int x=0, yy=bFlip ? Get_NY()-y-1 : y; x<Get_NX(); x++)
871 {
872 Stream.Printf("%lf ", asDouble(x, yy));
873 }
874
875 Stream.Printf("\n");
876 }
877
878 return( true );
879 }
880
881
883 // //
885
886 //---------------------------------------------------------
887 bool CSG_Grid::_Load_Surfer(const CSG_String &FileName, bool bCached, bool bLoadData)
888 {
889 const float NoData = 1.70141e38f;
890
891 if( !SG_File_Cmp_Extension(FileName, "grd") )
892 {
893 return( false );
894 }
895
896 Set_File_Name(FileName, true);
897
898 //-----------------------------------------------------
899 CSG_File Stream;
900
901 if( !Stream.Open(FileName, SG_FILE_R, true) )
902 {
903 return( false );
904 }
905
906 char Identifier[4];
907
908 Stream.Read(Identifier, sizeof(char), 4);
909
910 //-----------------------------------------------------
911 if( !strncmp(Identifier, "DSBB", 4) ) // Binary...
912 {
913 short nx, ny;
914 double d;
915 TSG_Rect r;
916
917 Stream.Read(&nx , sizeof(short ));
918 Stream.Read(&ny , sizeof(short ));
919 Stream.Read(&r.xMin, sizeof(double));
920 Stream.Read(&r.xMax, sizeof(double));
921 Stream.Read(&r.yMin, sizeof(double));
922 Stream.Read(&r.yMax, sizeof(double));
923 Stream.Read(&d , sizeof(double)); // zMin
924 Stream.Read(&d , sizeof(double)); // zMax
925
926 d = (r.xMax - r.xMin) / (nx - 1.0);
927 // d = (r.yMax - r.yMin) / (ny - 1.0); // we could proof for equal cellsize in direction of y...
928
929 //-------------------------------------------------
930 if( !Create(SG_DATATYPE_Float, nx, ny, d, r.xMin, r.yMin, bCached) || Stream.is_EOF() )
931 {
932 return( false );
933 }
934
935 //-------------------------------------------------
936 if( bLoadData )
937 {
938 CSG_Array Line(sizeof(float), Get_NX()); float *Values = (float *)Line.Get_Array();
939
940 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
941 {
942 Stream.Read(Values, sizeof(float), Get_NX());
943
944 for(int x=0; x<Get_NX(); x++)
945 {
946 if( Values[x] == NoData )
947 {
948 Set_NoData(x, y);
949 }
950 else
951 {
952 Set_Value(x, y, Values[x]);
953 }
954 }
955 }
956 }
957
958 Get_MetaData().Add_Child("SURFER_GRID", "Surfer Grid (Binary)");
959 }
960
961 //-----------------------------------------------------
962 else if( !strncmp(Identifier, "DSAA", 4) ) // ASCII...
963 {
964 int nx = Stream.Scan_Int ();
965 int ny = Stream.Scan_Int ();
966 double xMin = Stream.Scan_Double();
967 double xMax = Stream.Scan_Double();
968 double yMin = Stream.Scan_Double(); Stream.Scan_Double();
969 // double yMax = Stream.Scan_Double();
970 double dx = Stream.Scan_Double(); Stream.Scan_Double();
971 // double dy = Stream.Scan_Double();
972
973 dx = (xMax - xMin) / (nx - 1.0);
974 // dy = (yMax - yMin) / (ny - 1.0); // we could proof for equal cellsize in direction of y...
975
976 //-------------------------------------------------
977 if( !Create(SG_DATATYPE_Float, nx, ny, dx, xMin, yMin, bCached) || Stream.is_EOF() )
978 {
979 return( false );
980 }
981
982 //-------------------------------------------------
983 if( bLoadData )
984 {
985 for(int y=0; y<Get_NY() && !Stream.is_EOF() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
986 {
987 for(int x=0; x<Get_NX(); x++)
988 {
989 double Value;
990
991 if( Stream.Scan(Value) && Value != NoData )
992 {
993 Set_Value(x, y, Value);
994 }
995 else
996 {
997 Set_NoData(x, y);
998 }
999 }
1000 }
1001 }
1002
1003 Get_MetaData().Add_Child("SURFER_GRID", "Surfer Grid (ASCII)");
1004 }
1005
1006 //-------------------------------------------------
1007 SG_UI_Process_Set_Ready();
1008
1009 Set_File_Name(FileName);
1010 Load_MetaData(FileName);
1011
1012 return( true );
1013 }
1014
1015
1017 // //
1018 // //
1019 // //
1021
1022 //---------------------------------------------------------
1023 CSG_Grid_File_Info::CSG_Grid_File_Info(void)
1024 {
1025 _On_Construction();
1026 }
1027
1028 void CSG_Grid_File_Info::_On_Construction(void)
1029 {
1030 m_Name .Clear();
1031 m_Description .Clear();
1032 m_Unit .Clear();
1033 m_System .Assign(0.0, 0.0, 0.0, 0, 0);
1034 m_Type = SG_DATATYPE_Float; // defaults to float
1035 m_zScale = 1.0;
1036 m_zOffset = 0;
1037 m_NoData[0] = -99999.0;
1038 m_NoData[1] = -99999.0;
1039 m_Data_File .Clear();
1040 m_bFlip = false;
1041 m_bSwapBytes = false;
1042 m_Offset = 0;
1043 m_Projection .Destroy();
1044 }
1045
1046 //---------------------------------------------------------
1047 CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_Grid_File_Info &Info)
1048 {
1049 Create(Info);
1050 }
1051
1052 bool CSG_Grid_File_Info::Create(const CSG_Grid_File_Info &Info)
1053 {
1054 m_Name = Info.m_Name;
1055 m_Description = Info.m_Description;
1056 m_Unit = Info.m_Unit;
1057 m_System = Info.m_System;
1058 m_Type = Info.m_Type;
1059 m_zScale = Info.m_zScale;
1060 m_zOffset = Info.m_zOffset;
1061 m_NoData[0] = Info.m_NoData[0];
1062 m_NoData[1] = Info.m_NoData[1];
1063 m_Data_File = Info.m_Data_File;
1064 m_bFlip = Info.m_bFlip;
1065 m_bSwapBytes = Info.m_bSwapBytes;
1066 m_Offset = Info.m_Offset;
1067 m_Projection = Info.m_Projection;
1068
1069 return( true );
1070 }
1071
1072 //---------------------------------------------------------
1073 CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_Grid &Grid)
1074 {
1075 Create(Grid);
1076 }
1077
1078 bool CSG_Grid_File_Info::Create(const CSG_Grid &Grid)
1079 {
1080 m_Name = Grid.Get_Name();
1081 m_Description = Grid.Get_Description();
1082 m_Unit = Grid.Get_Unit();
1083 m_System = Grid.Get_System();
1084 m_Type = Grid.Get_Type();
1085 m_zScale = Grid.Get_Scaling();
1086 m_zOffset = Grid.Get_Offset();
1087 m_NoData[0] = Grid.Get_NoData_Value();
1088 m_NoData[1] = Grid.Get_NoData_Value(true);
1089 m_Data_File .Clear();
1090 m_bFlip = false;
1091 m_bSwapBytes = false;
1092 m_Offset = 0;
1093 m_Projection = Grid.Get_Projection();
1094
1095 return( true );
1096 }
1097
1098 //---------------------------------------------------------
1099 CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_String &FileName)
1100 {
1101 Create(FileName);
1102 }
1103
1104 bool CSG_Grid_File_Info::Create(const CSG_String &FileName)
1105 {
1106 if( !SG_File_Cmp_Extension(FileName, "sg-grd-z") )
1107 {
1108 if( SG_File_Cmp_Extension(FileName, "sgrd")
1109 || SG_File_Cmp_Extension(FileName, "sg-grd") )
1110 {
1111 CSG_File Stream(FileName, SG_FILE_R, false);
1112
1113 return( Create(Stream) );
1114 }
1115
1116 return( false );
1117 }
1118
1119 //-----------------------------------------------------
1120 CSG_File_Zip Stream(FileName, SG_FILE_R);
1121
1122 if( Stream.is_Reading() )
1123 {
1124 CSG_String File(SG_File_Get_Name(FileName, false) + ".");
1125
1126 if( !Stream.Get_File(File + "sgrd" )
1127 && !Stream.Get_File(File + "sg-grd") )
1128 {
1129 for(size_t i=0; i<Stream.Get_File_Count(); i++)
1130 {
1131 if( SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sgrd" )
1132 || SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sg-grd") )
1133 {
1134 Stream.Get_File(Stream.Get_File_Name(i));
1135 break;
1136 }
1137 }
1138 }
1139
1140 return( Create(Stream) );
1141 }
1142
1143 //-----------------------------------------------------
1144 return( false );
1145 }
1146
1147 //---------------------------------------------------------
1148 CSG_Grid_File_Info::CSG_Grid_File_Info(CSG_File &Stream)
1149 {
1150 Create(Stream);
1151 }
1152
1153 bool CSG_Grid_File_Info::Create(CSG_File &Stream)
1154 {
1155 _On_Construction();
1156
1157 //-----------------------------------------------------
1158 if( !Stream.is_Reading() )
1159 {
1160 return( false );
1161 }
1162
1163 //-----------------------------------------------------
1164 sLong NX = 0, NY = 0;
1165 double Cellsize = 0.0, xMin = 0.0, yMin = 0.0;
1166
1167 do
1168 {
1169 CSG_String Value;
1170
1171 switch( _Get_Key(Stream, Value) )
1172 {
1173 case GRID_FILE_KEY_NAME : m_Name = Value; break;
1174 case GRID_FILE_KEY_DESCRIPTION : m_Description = Value; break;
1175 case GRID_FILE_KEY_UNITNAME : m_Unit = Value; break;
1176
1177 case GRID_FILE_KEY_CELLCOUNT_X : NX = Value.asInt (); break;
1178 case GRID_FILE_KEY_CELLCOUNT_Y : NY = Value.asInt (); break;
1179 case GRID_FILE_KEY_POSITION_XMIN : xMin = Value.asDouble(); break;
1180 case GRID_FILE_KEY_POSITION_YMIN : yMin = Value.asDouble(); break;
1181 case GRID_FILE_KEY_CELLSIZE : Cellsize = Value.asDouble(); break;
1182
1183 case GRID_FILE_KEY_Z_FACTOR : m_zScale = Value.asDouble(); break;
1184 case GRID_FILE_KEY_Z_OFFSET : m_zOffset = Value.asDouble(); break;
1185 case GRID_FILE_KEY_NODATA_VALUE : m_NoData[0] = Value.asDouble();
1186 Value = Value.AfterFirst(';'); m_NoData[1] = Value.is_Empty() ? m_NoData[0] : Value.asDouble(); break;
1187
1188 case GRID_FILE_KEY_DATAFILE_OFFSET: m_Offset = Value.asInt (); break;
1189 case GRID_FILE_KEY_BYTEORDER_BIG : m_bSwapBytes = Value.Find(GRID_FILE_KEY_TRUE) >= 0; break;
1190 case GRID_FILE_KEY_TOPTOBOTTOM : m_bFlip = Value.Find(GRID_FILE_KEY_TRUE) >= 0; break;
1191
1192 case GRID_FILE_KEY_DATAFILE_NAME:
1193 if( SG_File_Get_Path(Value).Length() > 0 )
1194 {
1195 m_Data_File = Value;
1196 }
1197 else
1198 {
1199 m_Data_File = SG_File_Make_Path(SG_File_Get_Path(Stream.Get_File_Name()), Value);
1200 }
1201 break;
1202
1203 case GRID_FILE_KEY_DATAFORMAT:
1204 {
1205 for(int i=0; i<SG_DATATYPE_Undefined; i++)
1206 {
1207 if( Value.Find(gSG_Data_Type_Identifier[i]) >= 0 )
1208 {
1209 m_Type = (TSG_Data_Type)i;
1210
1211 break;
1212 }
1213 }
1214 }
1215 break;
1216 }
1217 }
1218 while( !Stream.is_EOF() );
1219
1220 //-----------------------------------------------------
1221 return( m_System.Assign(Cellsize, xMin, yMin, (int)NX, (int)NY) );
1222 }
1223
1224 //---------------------------------------------------------
1225 int CSG_Grid_File_Info::_Get_Key(CSG_File &Stream, CSG_String &Value)
1226 {
1227 int i;
1228 CSG_String sLine;
1229
1230 if( Stream.Read_Line(sLine) && (i = sLine.Find('=')) > 0 )
1231 {
1232 Value = sLine.AfterFirst('=');
1233 Value.Trim();
1234
1235 sLine.Remove(i);
1236
1237 for(i=0; i<GRID_FILE_KEY_Count; i++)
1238 {
1239 CSG_String s(gSG_Grid_File_Key_Names[i]);
1240
1241 if( s.Find(sLine.Left(s.Length())) >= 0 )
1242 {
1243 return( i );
1244 }
1245 }
1246 }
1247
1248 return( -1 );
1249 }
1250
1251
1253 // //
1255
1256 //---------------------------------------------------------
1257 bool CSG_Grid_File_Info::Save(const CSG_String &FileName, bool bBinary)
1258 {
1259 return( Save(CSG_File(FileName, SG_FILE_W, false), bBinary) );
1260 }
1261
1262 //---------------------------------------------------------
1263 bool CSG_Grid_File_Info::Save(const CSG_File &Stream, bool bBinary)
1264 {
1265 if( !Stream.is_Writing() )
1266 {
1267 return( false );
1268 }
1269
1270 #define GRID_FILE_PRINT(Key, Val) { CSG_String s(gSG_Grid_File_Key_Names[Key]); s += "\t= " + Val + "\n"; Stream.Write(s); }
1271
1272 GRID_FILE_PRINT(GRID_FILE_KEY_NAME , CSG_String::Format("%s" , m_Name .c_str() ));
1273 GRID_FILE_PRINT(GRID_FILE_KEY_DESCRIPTION , CSG_String::Format("%s" , m_Description.c_str() ));
1274 GRID_FILE_PRINT(GRID_FILE_KEY_UNITNAME , CSG_String::Format("%s" , m_Unit .c_str() ));
1275 GRID_FILE_PRINT(GRID_FILE_KEY_DATAFORMAT , CSG_String::Format("%s" , CSG_String(bBinary ? gSG_Data_Type_Identifier[m_Type] : "ASCII").c_str()));
1276 GRID_FILE_PRINT(GRID_FILE_KEY_DATAFILE_OFFSET, CSG_String::Format("%d" , 0 ));
1277 #ifdef WORDS_BIGENDIAN
1278 GRID_FILE_PRINT(GRID_FILE_KEY_BYTEORDER_BIG , CSG_String::Format("%s" , GRID_FILE_KEY_TRUE ));
1279 #else
1280 GRID_FILE_PRINT(GRID_FILE_KEY_BYTEORDER_BIG , CSG_String::Format("%s" , GRID_FILE_KEY_FALSE ));
1281 #endif
1282 GRID_FILE_PRINT(GRID_FILE_KEY_TOPTOBOTTOM , CSG_String::Format("%s" , GRID_FILE_KEY_FALSE ));
1283 GRID_FILE_PRINT(GRID_FILE_KEY_POSITION_XMIN , CSG_String::Format("%.*f" , CSG_Grid_System::Get_Precision(), m_System.Get_XMin()));
1284 GRID_FILE_PRINT(GRID_FILE_KEY_POSITION_YMIN , CSG_String::Format("%.*f" , CSG_Grid_System::Get_Precision(), m_System.Get_YMin()));
1285 GRID_FILE_PRINT(GRID_FILE_KEY_CELLCOUNT_X , CSG_String::Format("%d" , m_System.Get_NX() ));
1286 GRID_FILE_PRINT(GRID_FILE_KEY_CELLCOUNT_Y , CSG_String::Format("%d" , m_System.Get_NY() ));
1287 GRID_FILE_PRINT(GRID_FILE_KEY_CELLSIZE , CSG_String::Format("%.*f" , CSG_Grid_System::Get_Precision(), m_System.Get_Cellsize()));
1288 GRID_FILE_PRINT(GRID_FILE_KEY_Z_FACTOR , CSG_String::Format("%f" , m_zScale ));
1289 GRID_FILE_PRINT(GRID_FILE_KEY_Z_OFFSET , CSG_String::Format("%f" , m_zOffset ));
1290 GRID_FILE_PRINT(GRID_FILE_KEY_NODATA_VALUE , CSG_String::Format("%f;%f", m_NoData[0], m_NoData[1]));
1291
1292 return( true );
1293 }
1294
1295 //---------------------------------------------------------
1296 bool CSG_Grid_File_Info::Save(const CSG_String &FileName, const CSG_Grid &Grid, bool bBinary)
1297 {
1298 CSG_Grid_File_Info Info(Grid);
1299
1300 return( Info.Save(FileName, bBinary) );
1301 }
1302
1303 //---------------------------------------------------------
1304 bool CSG_Grid_File_Info::Save(const CSG_File &Stream, const CSG_Grid &Grid, bool bBinary)
1305 {
1306 CSG_Grid_File_Info Info(Grid);
1307
1308 return( Info.Save(Stream, bBinary) );
1309 }
1310
1311
1313 // //
1315
1316 //---------------------------------------------------------
1317 bool CSG_Grid_File_Info::Save_AUX_XML(const CSG_String &FileName)
1318 {
1319 CSG_File Stream;
1320
1321 return( m_Projection.is_Okay() && Stream.Open(FileName + ".aux.xml", SG_FILE_W, false) && Save_AUX_XML(Stream) );
1322 }
1323
1324 //---------------------------------------------------------
1325 bool CSG_Grid_File_Info::Save_AUX_XML(CSG_File &Stream)
1326 {
1327 if( m_Projection.is_Okay() && Stream.is_Writing() ) // store srs information that is recognized by ArcGIS
1328 {
1329 Stream.Write("<PAMDataset>\n<SRS>");
1330 Stream.Write(m_Projection.Get_WKT());
1331 Stream.Write("</SRS>\n</PAMDataset>\n");
1332
1333 return( true );
1334 }
1335
1336 return( false );
1337 }
1338
1339
1341 // //
1342 // //
1343 // //
1345
1346 //---------------------------------------------------------
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_Grid_File_Info::m_Offset
sLong m_Offset
Definition: grid.h:439
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
SG_File_Get_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_File_Zip::Get_File
bool Get_File(const CSG_String &Name)
Definition: api_file.cpp:690
CSG_Grid_File_Info::Save_AUX_XML
bool Save_AUX_XML(const CSG_String &File)
Definition: grid_io.cpp:1317
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Grid_System::Get_Precision
static int Get_Precision(void)
Definition: grid_system.cpp:77
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
GRID_FILE_KEY_DESCRIPTION
@ GRID_FILE_KEY_DESCRIPTION
Definition: grid.h:103
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:96
CSG_Grid_File_Info::m_zOffset
double m_zOffset
Definition: grid.h:441
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
GRID_FILE_KEY_Z_FACTOR
@ GRID_FILE_KEY_Z_FACTOR
Definition: grid.h:114
CSG_String::Remove
CSG_String & Remove(size_t pos)
Definition: api_string.cpp:569
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
data_manager.h
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
GRID_FILE_FORMAT_Compressed
@ GRID_FILE_FORMAT_Compressed
Definition: grid.h:94
CSG_Grid_File_Info::m_bSwapBytes
bool m_bSwapBytes
Definition: grid.h:437
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_File::Seek
bool Seek(sLong Offset, int Origin=SG_FILE_START) const
Definition: api_file.cpp:232
CSG_Grid_File_Info::CSG_Grid_File_Info
CSG_Grid_File_Info(void)
Definition: grid_io.cpp:1023
GRID_FILE_FORMAT_Undefined
@ GRID_FILE_FORMAT_Undefined
Definition: grid.h:90
GRID_FILE_KEY_BYTEORDER_BIG
@ GRID_FILE_KEY_BYTEORDER_BIG
Definition: grid.h:108
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
GRID_FILE_KEY_DATAFORMAT
@ GRID_FILE_KEY_DATAFORMAT
Definition: grid.h:107
GRID_FILE_FORMAT_GeoTIFF
@ GRID_FILE_FORMAT_GeoTIFF
Definition: grid.h:95
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
GRID_FILE_KEY_TRUE
#define GRID_FILE_KEY_TRUE
Definition: grid.h:144
SG_Data_Type_Get_Size
size_t SG_Data_Type_Get_Size(TSG_Data_Type Type)
Definition: api_core.h:1052
GRID_FILE_KEY_POSITION_YMIN
@ GRID_FILE_KEY_POSITION_YMIN
Definition: grid.h:110
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
CSG_Tool
Definition: tool.h:149
CSG_File::Scan
bool Scan(int &Value) const
Definition: api_file.cpp:475
CSG_Grid_File_Info::m_NoData
double m_NoData[2]
Definition: grid.h:441
grid.h
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Grid_File_Info::m_System
CSG_Grid_System m_System
Definition: grid.h:447
CSG_File::Scan_Int
int Scan_Int(void) const
Definition: api_file.cpp:537
SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:257
CSG_Grid_File_Info::Save
bool Save(const CSG_String &File, bool bBinary=true)
Definition: grid_io.cpp:1257
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
GRID_FILE_KEY_CELLSIZE
@ GRID_FILE_KEY_CELLSIZE
Definition: grid.h:113
GRID_FILE_KEY_NODATA_VALUE
@ GRID_FILE_KEY_NODATA_VALUE
Definition: grid.h:116
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
SG_Grid_Get_File_Extension_Default
CSG_String SG_Grid_Get_File_Extension_Default(void)
Definition: grid_io.cpp:129
CSG_Projection::Get_WKT
const CSG_String & Get_WKT(void) const
Definition: geo_tools.h:879
TSG_Grid_File_Format
TSG_Grid_File_Format
Definition: grid.h:89
CSG_Data_Manager::Get_Grid_System
CSG_Grid_Collection * Get_Grid_System(size_t i) const
Definition: data_manager.h:175
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:394
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Grid::Get_Scaling
double Get_Scaling(void) const
Definition: grid.cpp:430
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
SG_TOOL_PARAMLIST_ADD
#define SG_TOOL_PARAMLIST_ADD(IDENTIFIER, VALUE)
Definition: tool_library.h:353
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_Grid::On_Delete
virtual bool On_Delete(void)
Definition: grid_io.cpp:80
GRID_FILE_KEY_NAME
@ GRID_FILE_KEY_NAME
Definition: grid.h:102
gSG_Grid_File_Key_Names
const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32]
Definition: grid.h:123
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:590
CSG_Grid_File_Info::Create
bool Create(const CSG_Grid_File_Info &Info)
Definition: grid_io.cpp:1052
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
CSG_Grid_File_Info::m_Unit
CSG_String m_Unit
Definition: grid.h:445
GRID_FILE_KEY_FALSE
#define GRID_FILE_KEY_FALSE
Definition: grid.h:145
GRID_FILE_KEY_DATAFILE_NAME
@ GRID_FILE_KEY_DATAFILE_NAME
Definition: grid.h:105
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_File_Zip::Get_File_Count
size_t Get_File_Count(void)
Definition: api_core.h:1204
CSG_File::Scan_Double
double Scan_Double(void) const
Definition: api_file.cpp:542
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
sLong
signed long long sLong
Definition: api_core.h:158
SG_Grid_Set_File_Format_Default
bool SG_Grid_Set_File_Format_Default(int Format)
Definition: grid_io.cpp:106
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_Data_Type_is_Numeric
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
Definition: api_core.cpp:197
CSG_Grid_File_Info::m_Type
TSG_Data_Type m_Type
Definition: grid.h:443
CSG_Grid::Get_Unit
const CSG_String & Get_Unit(void) const
Definition: grid.h:525
GRID_FILE_KEY_TOPTOBOTTOM
@ GRID_FILE_KEY_TOPTOBOTTOM
Definition: grid.h:117
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
CSG_Grid::Get_Offset
double Get_Offset(void) const
Definition: grid.cpp:436
CSG_Data_Object::Set_File_Type
void Set_File_Type(int Type)
Definition: dataobject.h:263
GRID_FILE_FORMAT_Binary_old
@ GRID_FILE_FORMAT_Binary_old
Definition: grid.h:91
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Grid_File_Info::m_Projection
CSG_Projection m_Projection
Definition: grid.h:449
CSG_Grid_File_Info::m_Name
CSG_String m_Name
Definition: grid.h:445
CSG_Grid::asShort
virtual short asShort(int x, int y, bool bScaled=true) const
Definition: grid.h:755
CSG_Grid::On_Reload
virtual bool On_Reload(void)
Definition: grid_io.cpp:74
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1135
CSG_Grid_File_Info::m_zScale
double m_zScale
Definition: grid.h:441
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_File_Zip::Get_File_Name
virtual CSG_String Get_File_Name(size_t Index)
Definition: api_file.cpp:707
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
CSG_Table
Definition: table.h:283
gSG_Grid_File_Format_Default
static TSG_Grid_File_Format gSG_Grid_File_Format_Default
Definition: grid_io.cpp:103
CSG_Grid::Set_NoData
virtual void Set_NoData(int x, int y)
Definition: grid.h:702
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:705
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
SG_Grid_Get_File_Format_Default
TSG_Grid_File_Format SG_Grid_Get_File_Format_Default(void)
Definition: grid_io.cpp:123
CSG_Grid::Save
virtual bool Save(const char *File, int Format=0)
Definition: grid.h:507
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
CSG_Grid_File_Info::m_Description
CSG_String m_Description
Definition: grid.h:445
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Data_Manager
Definition: data_manager.h:164
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
CSG_Grid_File_Info::m_Data_File
CSG_String m_Data_File
Definition: grid.h:445
GRID_FILE_KEY_UNITNAME
@ GRID_FILE_KEY_UNITNAME
Definition: grid.h:104
CSG_Grid::asFloat
virtual float asFloat(int x, int y, bool bScaled=true) const
Definition: grid.h:761
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:600
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
GRID_FILE_KEY_CELLCOUNT_X
@ GRID_FILE_KEY_CELLCOUNT_X
Definition: grid.h:111
GRID_FILE_PRINT
#define GRID_FILE_PRINT(Key, Val)
GRID_FILE_KEY_Z_OFFSET
@ GRID_FILE_KEY_Z_OFFSET
Definition: grid.h:115
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:605
CSG_Grid
Definition: grid.h:473
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
CSG_Grid::asByte
virtual BYTE asByte(int x, int y, bool bScaled=true) const
Definition: grid.h:751
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Grid::asChar
virtual char asChar(int x, int y, bool bScaled=true) const
Definition: grid.h:753
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
GRID_FILE_KEY_CELLCOUNT_Y
@ GRID_FILE_KEY_CELLCOUNT_Y
Definition: grid.h:112
GRID_FILE_FORMAT_Binary
@ GRID_FILE_FORMAT_Binary
Definition: grid.h:92
CSG_Grid::Set_Unit
void Set_Unit(const CSG_String &Unit)
Definition: grid.cpp:408
GRID_FILE_KEY_Count
@ GRID_FILE_KEY_Count
Definition: grid.h:118
GRID_FILE_KEY_POSITION_XMIN
@ GRID_FILE_KEY_POSITION_XMIN
Definition: grid.h:109
CSG_Grid_File_Info::m_bFlip
bool m_bFlip
Definition: grid.h:437
CSG_File::is_EOF
bool is_EOF(void) const
Definition: api_file.cpp:226
GRID_FILE_FORMAT_ASCII
@ GRID_FILE_FORMAT_ASCII
Definition: grid.h:93
GRID_FILE_KEY_DATAFILE_OFFSET
@ GRID_FILE_KEY_DATAFILE_OFFSET
Definition: grid.h:106
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
CSG_File_Zip
Definition: api_core.h:1188
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_File::Get_File_Name
virtual const CSG_String & Get_File_Name(void) const
Definition: api_core.h:1127
CSG_Grid_File_Info
Definition: grid.h:408
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Grid::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grid.h:636
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_memory.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions | Variables
grid_memory.cpp File Reference
#include <memory.h>
#include "grid.h"
#include "parameters.h"

Go to the source code of this file.

Macros

#define | CACHE_FILE_POS(x, y) (m_Cache_Offset + (m_Cache_bFlip ? Get_NY() - 1 - y : y) * m_nBytes_Line + x * m_nBytes_Value)
#define | CACHE_FILE_SEEK _fseeki64

Functions

const SG_Char * | SG_Grid_Cache_Get_Directory (void)
void | SG_Grid_Cache_Set_Directory (const SG_Char *Directory)
void | SG_Grid_Cache_Set_Mode (int Mode)
int | SG_Grid_Cache_Get_Mode (void)
void | SG_Grid_Cache_Set_Threshold (int nBytes)
void | SG_Grid_Cache_Set_Threshold_MB (double nMegabytes)
sLong | SG_Grid_Cache_Get_Threshold (void)
double | SG_Grid_Cache_Get_Threshold_MB (void)

Variables

static CSG_String | gSG_Grid_Cache_Directory
static int | gSG_Grid_Cache_Mode = 0
static sLong | gSG_Grid_Cache_Threshold = 0

Macro Definition Documentation

◆ CACHE_FILE_POS

#define CACHE_FILE_POS | ( | x,
 |  | y
 | ) | (m_Cache_Offset + (m_Cache_bFlip ? Get_NY() - 1 - y : y) * m_nBytes_Line + x * m_nBytes_Value)

Definition at line 247 of file grid_memory.cpp.

◆ CACHE_FILE_SEEK

#define CACHE_FILE_SEEK _fseeki64

Definition at line 253 of file grid_memory.cpp.

Function Documentation

◆ SG_Grid_Cache_Get_Directory()

const SG_Char* SG_Grid_Cache_Get_Directory ( void )

Get default directory for grid caching

Definition at line 81 of file grid_memory.cpp.

References gSG_Grid_Cache_Directory.

◆ SG_Grid_Cache_Get_Mode()

int SG_Grid_Cache_Get_Mode ( void )

Definition at line 110 of file grid_memory.cpp.

References gSG_Grid_Cache_Mode.

◆ SG_Grid_Cache_Get_Threshold()

sLong SG_Grid_Cache_Get_Threshold ( void )

Definition at line 139 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold.

◆ SG_Grid_Cache_Get_Threshold_MB()

double SG_Grid_Cache_Get_Threshold_MB ( void )

Definition at line 145 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold, and N_MEGABYTE_BYTES.

◆ SG_Grid_Cache_Set_Directory()

void SG_Grid_Cache_Set_Directory ( const SG_Char * Directory )

Set default directory for grid caching

Definition at line 87 of file grid_memory.cpp.

References gSG_Grid_Cache_Directory, and SG_Dir_Exists().

◆ SG_Grid_Cache_Set_Mode()

void SG_Grid_Cache_Set_Mode ( int Mode )

Definition at line 104 of file grid_memory.cpp.

References gSG_Grid_Cache_Mode.

◆ SG_Grid_Cache_Set_Threshold()

void SG_Grid_Cache_Set_Threshold ( int nBytes )

Definition at line 124 of file grid_memory.cpp.

References gSG_Grid_Cache_Threshold.

Referenced by SG_Grid_Cache_Set_Threshold_MB().

◆ SG_Grid_Cache_Set_Threshold_MB()

void SG_Grid_Cache_Set_Threshold_MB ( double nMegabytes )

Definition at line 133 of file grid_memory.cpp.

References N_MEGABYTE_BYTES, and SG_Grid_Cache_Set_Threshold().

Variable Documentation

◆ gSG_Grid_Cache_Directory

CSG_String gSG_Grid_Cache_Directory
static

Definition at line 78 of file grid_memory.cpp.

Referenced by SG_Grid_Cache_Get_Directory(), and SG_Grid_Cache_Set_Directory().

◆ gSG_Grid_Cache_Mode

int gSG_Grid_Cache_Mode = 0
static

Definition at line 101 of file grid_memory.cpp.

Referenced by SG_Grid_Cache_Get_Mode(), and SG_Grid_Cache_Set_Mode().

◆ gSG_Grid_Cache_Threshold

sLong gSG_Grid_Cache_Threshold = 0
static

Definition at line 121 of file grid_memory.cpp.

Referenced by SG_Grid_Cache_Get_Threshold(), SG_Grid_Cache_Get_Threshold_MB(), and SG_Grid_Cache_Set_Threshold().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_memory.cpp Source File

  • saga_core
  • saga_api
grid_memory.cpp
Go to the documentation of this file.
1 /**********************************************************
2 * Version $Id$
3 *********************************************************/
4
6 // //
7 // SAGA //
8 // //
9 // System for Automated Geoscientific Analyses //
10 // //
11 // Application Programming Interface //
12 // //
13 // Library: SAGA_API //
14 // //
15 //-------------------------------------------------------//
16 // //
17 // grid_memory.cpp //
18 // //
19 // Copyright (C) 2005 by Olaf Conrad //
20 // //
21 //-------------------------------------------------------//
22 // //
23 // This file is part of 'SAGA - System for Automated //
24 // Geoscientific Analyses'. //
25 // //
26 // This library is free software; you can redistribute //
27 // it and/or modify it under the terms of the GNU Lesser //
28 // General Public License as published by the Free //
29 // Software Foundation, either version 2.1 of the //
30 // License, or (at your option) any later version. //
31 // //
32 // This library is distributed in the hope that it will //
33 // be useful, but WITHOUT ANY WARRANTY; without even the //
34 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
35 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
36 // License for more details. //
37 // //
38 // You should have received a copy of the GNU Lesser //
39 // General Public License along with this program; if //
40 // not, see <http://www.gnu.org/licenses/>. //
41 // //
42 //-------------------------------------------------------//
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Goettingen //
47 // Goldschmidtstr. 5 //
48 // 37077 Goettingen //
49 // Germany //
50 // //
51 // e-mail: oconrad@saga-gis.org //
52 // //
54
55 //---------------------------------------------------------
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 #include <memory.h>
66
67 #include "grid.h"
68 #include "parameters.h"
69
70
72 // //
73 // Caching Options //
74 // //
76
77 //---------------------------------------------------------
78 static CSG_String gSG_Grid_Cache_Directory;
79
80 //---------------------------------------------------------
81 const SG_Char * SG_Grid_Cache_Get_Directory(void)
82 {
83 return( gSG_Grid_Cache_Directory );
84 }
85
86 //---------------------------------------------------------
87 void SG_Grid_Cache_Set_Directory(const SG_Char *Directory)
88 {
89 if( SG_Dir_Exists(Directory) )
90 {
91 gSG_Grid_Cache_Directory = Directory;
92 }
93 }
94
95
97 // //
99
100 //---------------------------------------------------------
101 static int gSG_Grid_Cache_Mode = 0;
102
103 //---------------------------------------------------------
104 void SG_Grid_Cache_Set_Mode(int Mode)
105 {
106 gSG_Grid_Cache_Mode = Mode;
107 }
108
109 //---------------------------------------------------------
110 int SG_Grid_Cache_Get_Mode(void)
111 {
112 return( gSG_Grid_Cache_Mode );
113 }
114
115
117 // //
119
120 //---------------------------------------------------------
121 static sLong gSG_Grid_Cache_Threshold = 0;
122
123 //---------------------------------------------------------
124 void SG_Grid_Cache_Set_Threshold(int nBytes)
125 {
126 if( nBytes >= 0 )
127 {
128 gSG_Grid_Cache_Threshold = nBytes;
129 }
130 }
131
132 //---------------------------------------------------------
133 void SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
134 {
135 SG_Grid_Cache_Set_Threshold((int)(nMegabytes * N_MEGABYTE_BYTES));
136 }
137
138 //---------------------------------------------------------
139 sLong SG_Grid_Cache_Get_Threshold(void)
140 {
141 return( gSG_Grid_Cache_Threshold );
142 }
143
144 //---------------------------------------------------------
145 double SG_Grid_Cache_Get_Threshold_MB(void)
146 {
147 return( (double)gSG_Grid_Cache_Threshold / (double)N_MEGABYTE_BYTES );
148 }
149
150
152 // //
153 // Memory //
154 // //
156
157 //---------------------------------------------------------
158 bool CSG_Grid::_Memory_Create(bool bCached)
159 {
160 if( !m_System.is_Valid() || m_Type == SG_DATATYPE_Undefined )
161 {
162 return( false );
163 }
164
165 _Memory_Destroy();
166
167 if( bCached || _Cache_Check() )
168 {
169 return( _Cache_Create() );
170 }
171
172 return( _Array_Create() );
173 }
174
175 //---------------------------------------------------------
176 void CSG_Grid::_Memory_Destroy(void)
177 {
178 SG_FREE_SAFE(m_Index);
179
180 if( is_Cached() )
181 {
182 _Cache_Destroy(false);
183 }
184
185 _Array_Destroy();
186 }
187
188
190 // //
191 // Array //
192 // //
194
195 //---------------------------------------------------------
196 bool CSG_Grid::_Array_Create(void)
197 {
198 if( m_System.is_Valid() && m_Type != SG_DATATYPE_Undefined )
199 {
200 _Array_Destroy();
201
202 if( (m_Values = (void **)SG_Malloc(Get_NY() * sizeof(void *))) != NULL )
203 {
204 if( (m_Values[0] = (void *)SG_Calloc(Get_NY(), Get_nLineBytes())) != NULL )
205 {
206 char *pLine = (char *)m_Values[0];
207
208 for(int y=0; y<Get_NY(); y++, pLine+=Get_nLineBytes())
209 {
210 m_Values[y] = pLine;
211 }
212
213 return( true );
214 }
215
216 SG_Free(m_Values);
217
218 m_Values = NULL;
219 }
220
221 SG_UI_Msg_Add_Error(CSG_String::Format("%s: %s [%.2fmb]", _TL("grid"), _TL("memory allocation failed"), (double)Get_NY() * Get_nLineBytes() / N_MEGABYTE_BYTES));
222 }
223
224 return( false );
225 }
226
227 //---------------------------------------------------------
228 void CSG_Grid::_Array_Destroy(void)
229 {
230 if( m_Values )
231 {
232 SG_Free(m_Values[0]);
233 SG_Free(m_Values);
234
235 m_Values = NULL;
236 }
237 }
238
239
241 // //
242 // Cache //
243 // //
245
246 //---------------------------------------------------------
247 #define CACHE_FILE_POS(x, y) (m_Cache_Offset + (m_Cache_bFlip ? Get_NY() - 1 - y : y) * m_nBytes_Line + x * m_nBytes_Value)
248
249 //---------------------------------------------------------
250 #if defined(_SAGA_LINUX)
251 #define CACHE_FILE_SEEK fseek
252 #else
253 #define CACHE_FILE_SEEK _fseeki64
254 #endif
255
256 //---------------------------------------------------------
257 bool CSG_Grid::Set_Cache(bool bOn)
258 {
259 if( bOn )
260 {
261 return( is_Cached()
262 || _Cache_Create(m_Cache_File , m_Type, m_Cache_Offset, m_Cache_bSwap, m_Cache_bFlip)
263 || _Cache_Create(SG_File_Make_Path("", Get_File_Name(), "dat"), m_Type, m_Cache_Offset, m_Cache_bSwap, m_Cache_bFlip)
264 || _Cache_Create(SG_File_Make_Path("", Get_File_Name(), "sdat"), m_Type, m_Cache_Offset, m_Cache_bSwap, m_Cache_bFlip)
265 || _Cache_Create()
266 );
267 }
268
269 return( !is_Cached() || _Cache_Destroy(true) );
270 }
271
272
274 // //
276
277 //---------------------------------------------------------
278 bool CSG_Grid::_Cache_Check(void)
279 {
280 sLong nBytes = m_System.Get_NCells() * Get_nValueBytes();
281
282 if( SG_Grid_Cache_Get_Mode() > 0 && nBytes > SG_Grid_Cache_Get_Threshold() )
283 {
284 if( SG_Grid_Cache_Get_Mode() == 2 ) // confirm
285 {
286 CSG_String s;
287
288 s.Printf("%s\n%s\n%s: %.2fMB",
289 _TL("Shall I activate file caching for new grid."),
290 m_System.Get_Name(),
291 _TL("Total memory size"),
292 (double)nBytes / (double)N_MEGABYTE_BYTES
293 );
294
295 return( SG_UI_Dlg_Continue(s, _TL("Activate Grid File Cache?")) );
296 }
297
298 return( true );
299 }
300
301 return( false );
302 }
303
304
306 // //
308
309 //---------------------------------------------------------
310 bool CSG_Grid::_Cache_Create(const CSG_String &File, TSG_Data_Type Data_Type, sLong Offset, bool bSwap, bool bFlip) // open existing file for caching
311 {
312 if( !m_System.is_Valid() || m_Type != Data_Type || !SG_File_Exists(File) )
313 {
314 return( false );
315 }
316
317 if( (m_Cache_Stream = fopen(File, "r+b")) == NULL // read and write
318 && (m_Cache_Stream = fopen(File, "rb" )) == NULL ) // read only
319 {
320 return( false );
321 }
322
323 m_Cache_File = File;
324 m_Cache_bTemp = false;
325 m_Cache_Offset = Offset;
326 m_Cache_bSwap = m_Type == SG_DATATYPE_Bit ? false : bSwap;
327 m_Cache_bFlip = bFlip;
328
329 _Array_Destroy();
330
331 return( true );
332 }
333
334 //---------------------------------------------------------
335 bool CSG_Grid::_Cache_Create(void) // create temporary cache file
336 {
337 if( !m_System.is_Valid() || (m_Type == SG_DATATYPE_Undefined && is_Cached()) )
338 {
339 return( false );
340 }
341
342 CSG_String File = SG_File_Get_Name_Temp("sg_grd", SG_Grid_Cache_Get_Directory());
343
344 if( (m_Cache_Stream = fopen(File, "w+b")) == NULL ) // read and write, create empty
345 {
346 return( false );
347 }
348
349 m_Cache_File = File;
350 m_Cache_bTemp = true;
351 m_Cache_Offset = 0;
352 m_Cache_bSwap = false;
353 m_Cache_bFlip = false;
354
355 CSG_Array Values(1, m_Values ? 0 : Get_nLineBytes()); // dummy
356
357 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
358 {
359 fwrite(m_Values ? m_Values[y] : Values.Get_Array(), 1, Get_nLineBytes(), m_Cache_Stream);
360 }
361
362 SG_UI_Process_Set_Ready();
363
364 _Array_Destroy();
365
366 return( true );
367 }
368
369 //---------------------------------------------------------
370 bool CSG_Grid::_Cache_Destroy(bool bMemory_Restore)
371 {
372 if( is_Cached() )
373 {
374 if( bMemory_Restore && _Array_Create() && !CACHE_FILE_SEEK(m_Cache_Stream, m_Cache_Offset, SEEK_SET) )
375 {
376 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
377 {
378 fread(m_Values[m_Cache_bFlip ? Get_NY() - 1 - y : y], 1, Get_nLineBytes(), m_Cache_Stream);
379
380 if( m_Cache_bSwap )
381 {
382 char *pValue = (char *)m_Values[y];
383
384 for(int x=0; x<Get_NX(); x++, pValue+=Get_nValueBytes())
385 {
386 _Swap_Bytes(pValue, Get_nValueBytes());
387 }
388 }
389 }
390
391 SG_UI_Process_Set_Ready();
392 }
393
394 //-------------------------------------------------
395 fclose(m_Cache_Stream);
396
397 m_Cache_Stream = NULL;
398
399 if( m_Cache_bTemp )
400 {
401 SG_File_Delete(m_Cache_File);
402 }
403
404 return( true );
405 }
406
407 return( false );
408 }
409
410
412 // //
414
415 //---------------------------------------------------------
416 void CSG_Grid::_Cache_Set_Value(int x, int y, double Value)
417 {
418 char Buffer[8];
419
420 switch( m_Type )
421 {
422 case SG_DATATYPE_Float : (*(float *)Buffer) = (float )(Value); break;
423 case SG_DATATYPE_Double: (*(double *)Buffer) = (double )(Value); break;
424 case SG_DATATYPE_Byte : (*(BYTE *)Buffer) = SG_ROUND_TO_BYTE (Value); break;
425 case SG_DATATYPE_Char : (*(char *)Buffer) = SG_ROUND_TO_CHAR (Value); break;
426 case SG_DATATYPE_Word : (*(WORD *)Buffer) = SG_ROUND_TO_WORD (Value); break;
427 case SG_DATATYPE_Short : (*(short *)Buffer) = SG_ROUND_TO_SHORT(Value); break;
428 case SG_DATATYPE_DWord : (*(DWORD *)Buffer) = SG_ROUND_TO_DWORD(Value); break;
429 case SG_DATATYPE_Int : (*(int *)Buffer) = SG_ROUND_TO_INT (Value); break;
430 case SG_DATATYPE_Long : (*(sLong *)Buffer) = SG_ROUND_TO_SLONG(Value); break;
431
432 default:
433 return;
434 }
435
436 if( m_Cache_bSwap )
437 {
438 _Swap_Bytes(Buffer, Get_nValueBytes());
439 }
440
441 if( !CACHE_FILE_SEEK(m_Cache_Stream, CACHE_FILE_POS(x, y), SEEK_SET) )
442 {
443 fwrite(Buffer, 1, Get_nValueBytes(), m_Cache_Stream);
444 }
445 }
446
447 //---------------------------------------------------------
448 double CSG_Grid::_Cache_Get_Value(int x, int y) const
449 {
450 if( !CACHE_FILE_SEEK(m_Cache_Stream, CACHE_FILE_POS(x, y), SEEK_SET) )
451 {
452 char Buffer[8];
453
454 if( fread(Buffer, 1, Get_nValueBytes(), m_Cache_Stream) == (size_t)Get_nValueBytes() )
455 {
456 switch( m_Type )
457 {
458 case SG_DATATYPE_Byte : return( (double)(*(BYTE *)Buffer) );
459 case SG_DATATYPE_Char : return( (double)(*(char *)Buffer) );
460 case SG_DATATYPE_Word : return( (double)(*(WORD *)Buffer) );
461 case SG_DATATYPE_Short : return( (double)(*(short *)Buffer) );
462 case SG_DATATYPE_DWord : return( (double)(*(DWORD *)Buffer) );
463 case SG_DATATYPE_Int : return( (double)(*(int *)Buffer) );
464 case SG_DATATYPE_Long : return( (double)(*(sLong *)Buffer) );
465 case SG_DATATYPE_Float : return( (double)(*(float *)Buffer) );
466 case SG_DATATYPE_Double: return( (double)(*(double *)Buffer) );
467
468 default:
469 break;
470 }
471
472 if( m_Cache_bSwap )
473 {
474 _Swap_Bytes(Buffer, Get_nValueBytes());
475 }
476 }
477 }
478
479 return( 0.0 );
480 }
481
482
484 // //
485 // //
486 // //
488
489 //---------------------------------------------------------
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
SG_UI_Dlg_Continue
bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:380
SG_ROUND_TO_INT
#define SG_ROUND_TO_INT(x)
Definition: mat_tools.h:140
SG_Dir_Exists
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
Definition: api_file.cpp:727
CSG_Grid::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grid.h:522
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Grid::Get_nValueBytes
int Get_nValueBytes(void) const
Definition: grid.h:521
gSG_Grid_Cache_Mode
static int gSG_Grid_Cache_Mode
Definition: grid_memory.cpp:101
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
grid.h
CACHE_FILE_POS
#define CACHE_FILE_POS(x, y)
Definition: grid_memory.cpp:247
SG_ROUND_TO_SLONG
#define SG_ROUND_TO_SLONG(x)
Definition: mat_tools.h:143
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Grid::Set_Cache
bool Set_Cache(bool bOn)
Definition: grid_memory.cpp:257
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
SG_Grid_Cache_Get_Threshold
sLong SG_Grid_Cache_Get_Threshold(void)
Definition: grid_memory.cpp:139
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Grid_System::Get_Name
const SG_Char * Get_Name(bool bShort=true)
Definition: grid_system.cpp:249
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
SG_Grid_Cache_Set_Threshold_MB
void SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
Definition: grid_memory.cpp:133
sLong
signed long long sLong
Definition: api_core.h:158
CACHE_FILE_SEEK
#define CACHE_FILE_SEEK
Definition: grid_memory.cpp:253
SG_ROUND_TO_CHAR
#define SG_ROUND_TO_CHAR(x)
Definition: mat_tools.h:136
SG_ROUND_TO_WORD
#define SG_ROUND_TO_WORD(x)
Definition: mat_tools.h:137
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
SG_Grid_Cache_Set_Threshold
void SG_Grid_Cache_Set_Threshold(int nBytes)
Definition: grid_memory.cpp:124
SG_ROUND_TO_BYTE
#define SG_ROUND_TO_BYTE(x)
Definition: mat_tools.h:135
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_Grid_Cache_Set_Mode
void SG_Grid_Cache_Set_Mode(int Mode)
Definition: grid_memory.cpp:104
SG_ROUND_TO_DWORD
#define SG_ROUND_TO_DWORD(x)
Definition: mat_tools.h:139
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
gSG_Grid_Cache_Directory
static CSG_String gSG_Grid_Cache_Directory
Definition: grid_memory.cpp:78
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
SG_Grid_Cache_Get_Directory
const SG_Char * SG_Grid_Cache_Get_Directory(void)
Definition: grid_memory.cpp:81
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
N_MEGABYTE_BYTES
#define N_MEGABYTE_BYTES
Definition: mat_tools.h:117
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
SG_ROUND_TO_SHORT
#define SG_ROUND_TO_SHORT(x)
Definition: mat_tools.h:138
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:605
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
SG_Grid_Cache_Get_Threshold_MB
double SG_Grid_Cache_Get_Threshold_MB(void)
Definition: grid_memory.cpp:145
SG_File_Get_Name_Temp
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix)
Definition: api_file.cpp:846
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_Grid_Cache_Set_Directory
void SG_Grid_Cache_Set_Directory(const SG_Char *Directory)
Definition: grid_memory.cpp:87
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
gSG_Grid_Cache_Threshold
static sLong gSG_Grid_Cache_Threshold
Definition: grid_memory.cpp:121
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
SG_Grid_Cache_Get_Mode
int SG_Grid_Cache_Get_Mode(void)
Definition: grid_memory.cpp:110
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Grid_System::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:236
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_operation.cpp File Reference

  • saga_core
  • saga_api
grid_operation.cpp File Reference
#include <memory.h>
#include "grid.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_operation.cpp Source File

  • saga_core
  • saga_api
grid_operation.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid_operation.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <memory.h>
54
55 #include "grid.h"
56
57
59 // //
60 // Data Assignments - Value //
61 // //
63
64 //---------------------------------------------------------
65 void CSG_Grid::Assign_NoData(void)
66 {
67 double Value = Get_NoData_Value();
68
69 #pragma omp parallel for
70 for(int y=0; y<Get_NY(); y++) for(int x=0; x<Get_NX(); x++)
71 {
72 Set_Value(x, y, Value, false);
73 }
74 }
75
76 //---------------------------------------------------------
77 bool CSG_Grid::Assign(double Value)
78 {
79 if( !is_Valid() )
80 {
81 return( false );
82 }
83
84 if( Value == 0. && !is_Cached() )
85 {
86 #pragma omp parallel for
87 for(int y=0; y<Get_NY(); y++)
88 {
89 memset(m_Values[y], 0, Get_nLineBytes());
90 }
91 }
92 else
93 {
94 #pragma omp parallel for
95 for(int y=0; y<Get_NY(); y++)
96 {
97 for(int x=0; x<Get_NX(); x++)
98 {
99 Set_Value(x, y, Value);
100 }
101 }
102 }
103
104 //-----------------------------------------------------
105 Get_History().Destroy();
106
107 m_Statistics.Invalidate();
108
109 Set_Update_Flag(false);
110
111 return( true );
112 }
113
114
116 // //
117 // Data Assignments - Grid //
118 // //
120
121 //---------------------------------------------------------
122 bool CSG_Grid::Assign(CSG_Data_Object *pObject)
123 {
124 return( pObject && pObject->is_Valid() && pObject->Get_ObjectType() == Get_ObjectType()
125 && Assign((CSG_Grid *)pObject, GRID_RESAMPLING_Undefined) );
126 }
127
128 bool CSG_Grid::Assign(CSG_Grid *pGrid, TSG_Grid_Resampling Interpolation)
129 {
130 //-----------------------------------------------------
131 if( !is_Valid() || !pGrid || !pGrid->is_Valid() || is_Intersecting(pGrid->Get_Extent()) == INTERSECTION_None )
132 {
133 return( false );
134 }
135
136 bool bResult = false;
137
138 //---------------------------------------------------------
139 if( m_System == pGrid->m_System )
140 {
141 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
142 {
143 #pragma omp parallel for
144 for(int x=0; x<Get_NX(); x++)
145 {
146 if( pGrid->is_NoData(x, y) )
147 {
148 Set_NoData(x, y);
149 }
150 else
151 {
152 Set_Value(x, y, pGrid->asDouble(x, y));
153 }
154 }
155 }
156
157 bResult = true;
158 }
159
160 else if( Get_Cellsize() == pGrid->Get_Cellsize() // No-Scaling...
161 && fmod(Get_XMin() - pGrid->Get_XMin(), Get_Cellsize()) == 0.
162 && fmod(Get_YMin() - pGrid->Get_YMin(), Get_Cellsize()) == 0. )
163 {
164 bResult = _Assign_Interpolated(pGrid, GRID_RESAMPLING_NearestNeighbour);
165 }
166
167 //---------------------------------------------------------
168 else switch( Interpolation )
169 {
170 case GRID_RESAMPLING_NearestNeighbour:
171 case GRID_RESAMPLING_Bilinear:
172 case GRID_RESAMPLING_BicubicSpline:
173 case GRID_RESAMPLING_BSpline:
174 bResult = _Assign_Interpolated(pGrid, Interpolation);
175 break;
176
177 case GRID_RESAMPLING_Mean_Nodes:
178 case GRID_RESAMPLING_Mean_Cells:
179 bResult = _Assign_MeanValue (pGrid, Interpolation != GRID_RESAMPLING_Mean_Nodes);
180 break;
181
182 case GRID_RESAMPLING_Minimum:
183 case GRID_RESAMPLING_Maximum:
184 bResult = _Assign_ExtremeValue(pGrid, Interpolation == GRID_RESAMPLING_Maximum);
185 break;
186
187 case GRID_RESAMPLING_Majority:
188 bResult = _Assign_Majority (pGrid);
189 break;
190
191 default:
192 if( Get_Cellsize() < pGrid->Get_Cellsize() ) // Down-Scaling...
193 {
194 bResult = _Assign_Interpolated(pGrid, GRID_RESAMPLING_BSpline);
195 }
196 else // Up-Scaling...
197 {
198 bResult = _Assign_MeanValue(pGrid, Interpolation != GRID_RESAMPLING_Mean_Nodes);
199 }
200 break;
201 }
202
203 //---------------------------------------------------------
204 if( bResult )
205 {
206 Set_Unit(pGrid->Get_Unit());
207
208 if( pGrid->Get_Projection().is_Okay() )
209 {
210 Get_Projection() = pGrid->Get_Projection();
211 }
212
213 Get_History() = pGrid->Get_History();
214 }
215
216 //---------------------------------------------------------
217 SG_UI_Process_Set_Ready();
218
219 return( bResult );
220 }
221
222 //---------------------------------------------------------
223 bool CSG_Grid::_Assign_Interpolated(CSG_Grid *pGrid, TSG_Grid_Resampling Interpolation)
224 {
225 double py = Get_YMin();
226
227 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++, py+=Get_Cellsize())
228 {
229 #pragma omp parallel for
230 for(int x=0; x<Get_NX(); x++)
231 {
232 double z;
233
234 if( pGrid->Get_Value(Get_XMin() + x * Get_Cellsize(), py, z, Interpolation) )
235 {
236 Set_Value(x, y, z);
237 }
238 else
239 {
240 Set_NoData(x, y);
241 }
242 }
243 }
244
245 return( true );
246 }
247
248 //---------------------------------------------------------
249 bool CSG_Grid::_Assign_ExtremeValue(CSG_Grid *pGrid, bool bMaximum)
250 {
251 if( Get_Cellsize() < pGrid->Get_Cellsize() )
252 {
253 return( false );
254 }
255
256 //-----------------------------------------------------
257 Assign_NoData();
258
259 double ax = 0.5 + (pGrid->Get_XMin() - Get_XMin()) / Get_Cellsize();
260 double py = 0.5 + (pGrid->Get_YMin() - Get_YMin()) / Get_Cellsize();
261
262 double d = pGrid->Get_Cellsize() / Get_Cellsize();
263
264 for(int y=0; y<pGrid->Get_NY() && SG_UI_Process_Set_Progress(y, pGrid->Get_NY()); y++, py+=d)
265 {
266 int iy = (int)floor(py);
267
268 if( iy >= 0 && iy < Get_NY() )
269 {
270 #pragma omp parallel for
271 for(int x=0; x<pGrid->Get_NX(); x++)
272 {
273 if( !pGrid->is_NoData(x, y) )
274 {
275 int ix = (int)floor(ax + x * d);
276
277 if( ix >= 0 && ix < Get_NX() )
278 {
279 double z = pGrid->asDouble(x, y);
280
281 if( is_NoData(ix, iy)
282 || (bMaximum == true && z > asDouble(ix, iy))
283 || (bMaximum == false && z < asDouble(ix, iy)) )
284 {
285 Set_Value(ix, iy, z);
286 }
287 }
288 }
289 }
290 }
291 }
292
293 //-----------------------------------------------------
294 return( true );
295 }
296
297 //---------------------------------------------------------
298 bool CSG_Grid::_Assign_MeanValue(CSG_Grid *pGrid, bool bAreaProportional)
299 {
300 if( Get_Cellsize() < pGrid->Get_Cellsize() )
301 {
302 return( false );
303 }
304
305 //-----------------------------------------------------
306 double d = Get_Cellsize() / pGrid->Get_Cellsize();
307
308 double ox = (Get_XMin(true) - pGrid->Get_XMin()) / pGrid->Get_Cellsize();
309 double py = (Get_YMin(true) - pGrid->Get_YMin()) / pGrid->Get_Cellsize();
310
311 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++, py+=d)
312 {
313 int ay = (int)(bAreaProportional ? floor(py ) : ceil (py ));
314 int by = (int)(bAreaProportional ? ceil (py + d) : floor(py + d));
315
316 //-------------------------------------------------
317 #pragma omp parallel for
318 for(int x=0; x<Get_NX(); x++)
319 {
320 double px = ox + x * d;
321
322 int ax = (int)(bAreaProportional ? floor(px ) : ceil (px ));
323 int bx = (int)(bAreaProportional ? ceil (px + d) : floor(px + d));
324
325 CSG_Rect rMean(px, py, px + d, py + d);
326
327 CSG_Simple_Statistics s;
328
329 for(int iy=ay; iy<=by; iy++)
330 {
331 if( iy >= 0 && iy < pGrid->Get_NY() )
332 {
333 for(int ix=ax; ix<=bx; ix++)
334 {
335 if( ix >= 0 && ix < pGrid->Get_NX() && !pGrid->is_NoData(ix, iy) )
336 {
337 if( bAreaProportional )
338 {
339 CSG_Rect r(ix - 0.5, iy - 0.5, ix + 0.5, iy + 0.5);
340
341 if( r.Intersect(rMean) )
342 {
343 s.Add_Value(pGrid->asDouble(ix, iy), r.Get_Area());
344 }
345 }
346 else
347 {
348 s.Add_Value(pGrid->asDouble(ix, iy));
349 }
350 }
351 }
352 }
353 }
354
355 //---------------------------------------------
356 if( s.Get_Count() > 0 )
357 {
358 Set_Value(x, y, s.Get_Mean());
359 }
360 else
361 {
362 Set_NoData(x, y);
363 }
364 }
365 }
366
367 //-----------------------------------------------------
368 return( true );
369 }
370
371
373 // //
375
376 //---------------------------------------------------------
377 bool CSG_Grid::_Assign_Majority(CSG_Grid *pGrid)
378 {
379 if( Get_Cellsize() < pGrid->Get_Cellsize() )
380 {
381 return( false );
382 }
383
384 //-----------------------------------------------------
385 Set_NoData_Value(pGrid->Get_NoData_Value());
386
387 Assign_NoData();
388
389 //-----------------------------------------------------
390 int ay, by = (int)(1. + (((0 - 0.5) * Get_Cellsize() + Get_YMin()) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());
391
392 for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
393 {
394 ay = by;
395 by = (int)(1. + (((y + 0.5) * Get_Cellsize() + Get_YMin()) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());
396
397 if( ay < pGrid->Get_NY() && by > 0 )
398 {
399 if( ay < 0 )
400 {
401 ay = 0;
402 }
403
404 if( by > pGrid->Get_NY() )
405 {
406 by = pGrid->Get_NY();
407 }
408
409 int ax, bx = (int)(1. + (((0 - 0.5) * Get_Cellsize() + Get_XMin()) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
410
411 for(int x=0; x<Get_NX(); x++)
412 {
413 ax = bx;
414 bx = (int)(1. + (((x + 0.5) * Get_Cellsize() + Get_XMin()) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
415
416 if( ax < pGrid->Get_NX() && bx > 0 )
417 {
418 CSG_Unique_Number_Statistics s;
419
420 if( ax < 0 )
421 {
422 ax = 0;
423 }
424
425 if( bx > pGrid->Get_NX() )
426 {
427 bx = pGrid->Get_NX();
428 }
429
430 for(int iy=ay; iy<by; iy++)
431 {
432 for(int ix=ax; ix<bx; ix++)
433 {
434 if( !pGrid->is_NoData(ix, iy) )
435 {
436 s += pGrid->asDouble(ix, iy);
437 }
438 }
439 }
440
441 int n; double z;
442
443 if( s.Get_Majority(z, n) )//&& n > 1 )
444 {
445 Set_Value(x, y, z);
446 }
447 }
448 }
449 }
450 }
451
452 //-----------------------------------------------------
453 return( true );
454 }
455
456
458 // //
459 // Operatoren //
460 // //
462
463 //---------------------------------------------------------
464 CSG_Grid & CSG_Grid::operator = (const CSG_Grid &Grid)
465 {
466 Assign((CSG_Grid *)&Grid, GRID_RESAMPLING_Undefined);
467
468 return( *this );
469 }
470
471 CSG_Grid & CSG_Grid::operator = (double Value)
472 {
473 Assign(Value);
474
475 return( *this );
476 }
477
478 //---------------------------------------------------------
479 CSG_Grid CSG_Grid::operator + (const CSG_Grid &Grid) const
480 {
481 CSG_Grid g(*this);
482
483 return( g._Operation_Arithmetic(Grid, GRID_OPERATION_Addition) );
484 }
485
486 CSG_Grid CSG_Grid::operator + (double Value) const
487 {
488 CSG_Grid g(*this);
489
490 return( g._Operation_Arithmetic(Value, GRID_OPERATION_Addition) );
491 }
492
493 CSG_Grid & CSG_Grid::operator += (const CSG_Grid &Grid)
494 {
495 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Addition) );
496 }
497
498 CSG_Grid & CSG_Grid::operator += (double Value)
499 {
500 return( _Operation_Arithmetic(Value, GRID_OPERATION_Addition) );
501 }
502
503 CSG_Grid & CSG_Grid::Add (const CSG_Grid &Grid)
504 {
505 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Addition) );
506 }
507
508 CSG_Grid & CSG_Grid::Add (double Value)
509 {
510 return( _Operation_Arithmetic(Value, GRID_OPERATION_Addition) );
511 }
512
513 //---------------------------------------------------------
514 CSG_Grid CSG_Grid::operator - (const CSG_Grid &Grid) const
515 {
516 CSG_Grid g(*this);
517
518 return( g._Operation_Arithmetic(Grid, GRID_OPERATION_Subtraction) );
519 }
520
521 CSG_Grid CSG_Grid::operator - (double Value) const
522 {
523 CSG_Grid g(*this);
524
525 return( g._Operation_Arithmetic(Value, GRID_OPERATION_Subtraction) );
526 }
527
528 CSG_Grid & CSG_Grid::operator -= (const CSG_Grid &Grid)
529 {
530 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Subtraction) );
531 }
532
533 CSG_Grid & CSG_Grid::operator -= (double Value)
534 {
535 return( _Operation_Arithmetic(Value, GRID_OPERATION_Subtraction) );
536 }
537
538 CSG_Grid & CSG_Grid::Subtract (const CSG_Grid &Grid)
539 {
540 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Subtraction) );
541 }
542
543 CSG_Grid & CSG_Grid::Subtract (double Value)
544 {
545 return( _Operation_Arithmetic(Value, GRID_OPERATION_Subtraction) );
546 }
547
548 //---------------------------------------------------------
549 CSG_Grid CSG_Grid::operator * (const CSG_Grid &Grid) const
550 {
551 CSG_Grid g(*this);
552
553 return( g._Operation_Arithmetic(Grid, GRID_OPERATION_Multiplication) );
554 }
555
556 CSG_Grid CSG_Grid::operator * (double Value) const
557 {
558 CSG_Grid g(*this);
559
560 return( g._Operation_Arithmetic(Value, GRID_OPERATION_Multiplication) );
561 }
562
563 CSG_Grid & CSG_Grid::operator *= (const CSG_Grid &Grid)
564 {
565 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Multiplication) );
566 }
567
568 CSG_Grid & CSG_Grid::operator *= (double Value)
569 {
570 return( _Operation_Arithmetic(Value, GRID_OPERATION_Multiplication) );
571 }
572
573 CSG_Grid & CSG_Grid::Multiply (const CSG_Grid &Grid)
574 {
575 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Multiplication) );
576 }
577
578 CSG_Grid & CSG_Grid::Multiply (double Value)
579 {
580 return( _Operation_Arithmetic(Value, GRID_OPERATION_Multiplication) );
581 }
582
583 //---------------------------------------------------------
584 CSG_Grid CSG_Grid::operator / (const CSG_Grid &Grid) const
585 {
586 CSG_Grid g(*this);
587
588 return( g._Operation_Arithmetic(Grid, GRID_OPERATION_Division) );
589 }
590
591 CSG_Grid CSG_Grid::operator / (double Value) const
592 {
593 CSG_Grid g(*this);
594
595 return( g._Operation_Arithmetic(Value, GRID_OPERATION_Division) );
596 }
597
598 CSG_Grid & CSG_Grid::operator /= (const CSG_Grid &Grid)
599 {
600 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Division) );
601 }
602
603 CSG_Grid & CSG_Grid::operator /= (double Value)
604 {
605 return( _Operation_Arithmetic(Value, GRID_OPERATION_Division) );
606 }
607
608 CSG_Grid & CSG_Grid::Divide (const CSG_Grid &Grid)
609 {
610 return( _Operation_Arithmetic(Grid, GRID_OPERATION_Division) );
611 }
612
613 CSG_Grid & CSG_Grid::Divide (double Value)
614 {
615 return( _Operation_Arithmetic(Value, GRID_OPERATION_Division) );
616 }
617
618
620 // //
621 // Operatoren //
622 // //
624
625 //---------------------------------------------------------
626 CSG_Grid & CSG_Grid::_Operation_Arithmetic(const CSG_Grid &Grid, TSG_Grid_Operation Operation)
627 {
628 if( is_Intersecting(Grid.Get_Extent()) )
629 {
630 TSG_Grid_Resampling Interpolation =
631 Get_Cellsize() == Grid.Get_Cellsize() && fmod(Get_XMin() - Grid.Get_XMin(), Get_Cellsize()) == 0.
632 && Get_Cellsize() == Grid.Get_Cellsize() && fmod(Get_YMin() - Grid.Get_YMin(), Get_Cellsize()) == 0.
633 ? GRID_RESAMPLING_NearestNeighbour
634 : GRID_RESAMPLING_BSpline;
635
636 #pragma omp parallel for
637 for(int y=0; y<Get_NY(); y++)
638 {
639 double yWorld = Get_YMin() + y * Get_Cellsize();
640
641 for(int x=0; x<Get_NX(); x++)
642 {
643 if( !is_NoData(x, y) )
644 {
645 double xWorld = Get_XMin() + x * Get_Cellsize(), Value;
646
647 if( Grid.Get_Value(xWorld, yWorld, Value, Interpolation) )
648 {
649 switch( Operation )
650 {
651 case GRID_OPERATION_Addition : Add_Value(x, y, Value); break;
652 case GRID_OPERATION_Subtraction : Add_Value(x, y, -Value); break;
653 case GRID_OPERATION_Multiplication: Mul_Value(x, y, Value); break;
654 case GRID_OPERATION_Division :
655 if( Value != 0. )
656 {
657 Mul_Value(x, y, 1. / Value);
658 }
659 else
660 {
661 Set_NoData(x, y);
662 }
663 break;
664 }
665 }
666 }
667 }
668 }
669 }
670
671 return( *this );
672 }
673
674 //---------------------------------------------------------
675 CSG_Grid & CSG_Grid::_Operation_Arithmetic(double Value, TSG_Grid_Operation Operation)
676 {
677 switch( Operation )
678 {
679 case GRID_OPERATION_Addition :
680 if( Value == 0. )
681 return( *this );
682 break;
683
684 case GRID_OPERATION_Subtraction :
685 if( Value == 0. )
686 return( *this );
687 Value = -Value;
688 break;
689
690 case GRID_OPERATION_Multiplication:
691 if( Value == 1. )
692 return( *this );
693 break;
694
695 case GRID_OPERATION_Division :
696 if( Value == 0. )
697 return( *this );
698 Value = 1. / Value;
699 break;
700 }
701
702 //-----------------------------------------------------
703 #pragma omp parallel for
704 for(int y=0; y<Get_NY(); y++)
705 {
706 for(int x=0; x<Get_NX(); x++)
707 {
708 if( !is_NoData(x, y) )
709 {
710 switch( Operation )
711 {
712 case GRID_OPERATION_Addition :
713 case GRID_OPERATION_Subtraction : Add_Value(x, y, Value); break;
714
715 case GRID_OPERATION_Multiplication:
716 case GRID_OPERATION_Division : Mul_Value(x, y, Value); break;
717 }
718 }
719 }
720 }
721
722 //-----------------------------------------------------
723 return( *this );
724 }
725
726
728 // //
729 // Grid-Operations - A //
730 // //
732
733 //---------------------------------------------------------
734 void CSG_Grid::Invert(void)
735 {
736 if( is_Valid() && Get_Range() > 0. )
737 {
738 double Min = Get_Min();
739 double Max = Get_Max();
740
741 #pragma omp parallel for
742 for(int y=0; y<Get_NY(); y++)
743 {
744 for(int x=0; x<Get_NX(); x++)
745 {
746 if( !is_NoData(x, y) )
747 {
748 Set_Value(x, y, Max - (asDouble(x, y) - Min));
749 }
750 }
751 }
752 }
753 }
754
755 //---------------------------------------------------------
756 void CSG_Grid::Flip(void)
757 {
758 if( is_Valid() )
759 {
760 #pragma omp parallel for
761 for(int x=0; x<Get_NX(); x++)
762 {
763 for(int yA=0, yB=Get_NY()-1; yA<yB; yA++, yB--)
764 {
765 double d = asDouble(x, yA);
766 Set_Value(x, yA, asDouble(x, yB));
767 Set_Value(x, yB, d);
768 }
769 }
770 }
771 }
772
773 //---------------------------------------------------------
774 void CSG_Grid::Mirror(void)
775 {
776 if( is_Valid() )
777 {
778 #pragma omp parallel for
779 for(int y=0; y<Get_NY(); y++)
780 {
781 for(int xA=0, xB=Get_NX()-1; xA<xB; xA++, xB--)
782 {
783 double d = asDouble(xA, y);
784 Set_Value(xA, y, asDouble(xB, y));
785 Set_Value(xB, y, d);
786 }
787 }
788 }
789 }
790
791
793 // //
794 // Grid-Operations - B //
795 // //
797
798 //---------------------------------------------------------
799 bool CSG_Grid::Normalise(void)
800 {
801 if( is_Valid() && Get_Range() > 0. )
802 {
803 double Min = Get_Min ();
804 double Range = Get_Range();
805
806 #pragma omp parallel for
807 for(int y=0; y<Get_NY(); y++)
808 {
809 for(int x=0; x<Get_NX(); x++)
810 {
811 if( !is_NoData(x, y) )
812 {
813 Set_Value(x, y, (asDouble(x, y) - Min) / Range);
814 }
815 }
816 }
817
818 return( true );
819 }
820
821 return( false );
822 }
823
824 //---------------------------------------------------------
825 bool CSG_Grid::DeNormalise(double Minimum, double Maximum)
826 {
827 if( is_Valid() && Minimum < Maximum )
828 {
829 #pragma omp parallel for
830 for(int y=0; y<Get_NY(); y++)
831 {
832 for(int x=0; x<Get_NX(); x++)
833 {
834 if( !is_NoData(x, y) )
835 {
836 Set_Value(x, y, Minimum + asDouble(x, y) * (Maximum - Minimum));
837 }
838 }
839 }
840
841 return( true );
842 }
843
844 return( false );
845 }
846
847 //---------------------------------------------------------
848 bool CSG_Grid::Standardise(void)
849 {
850 if( is_Valid() && Get_StdDev() > 0. )
851 {
852 double Mean = Get_Mean ();
853 double StdDev = Get_StdDev();
854
855 #pragma omp parallel for
856 for(int y=0; y<Get_NY(); y++)
857 {
858 for(int x=0; x<Get_NX(); x++)
859 {
860 if( !is_NoData(x, y) )
861 {
862 Set_Value(x, y, (asDouble(x, y) - Mean) / StdDev);
863 }
864 }
865 }
866
867 return( true );
868 }
869
870 return( false );
871 }
872
873 //---------------------------------------------------------
874 bool CSG_Grid::DeStandardise(double Mean, double StdDev)
875 {
876 if( is_Valid() && StdDev > 0. )
877 {
878 #pragma omp parallel for
879 for(int y=0; y<Get_NY(); y++)
880 {
881 for(int x=0; x<Get_NX(); x++)
882 {
883 if( !is_NoData(x, y) )
884 {
885 Set_Value(x, y, Mean + asDouble(x, y) * StdDev);
886 }
887 }
888 }
889
890 return( true );
891 }
892
893 return( false );
894 }
895
896
898 // //
899 // //
900 // //
902
903 //---------------------------------------------------------
915 //---------------------------------------------------------
916 int CSG_Grid::Get_Gradient_NeighborDir(int x, int y, bool bDown, bool bNoEdges) const
917 {
918 int Direction = -1;
919
920 if( is_InGrid(x, y) )
921 {
922 double z = asDouble(x, y), dzMax = 0.;
923
924 for(int i=0; i<8; i++)
925 {
926 int ix = m_System.Get_xTo(i, x);
927 int iy = m_System.Get_yTo(i, y);
928
929 if( is_InGrid(ix, iy) )
930 {
931 double dz = (z - asDouble(ix, iy)) / m_System.Get_Length(i);
932
933 if( (!bDown || dz > 0.) && (Direction < 0 || dzMax < dz) )
934 {
935 dzMax = dz;
936 Direction = i;
937 }
938 }
939 else if( bNoEdges )
940 {
941 return( -1 );
942 }
943 }
944 }
945
946 return( Direction );
947 }
948
949 //---------------------------------------------------------
957 //---------------------------------------------------------
958 bool CSG_Grid::Get_Gradient(int x, int y, double &Slope, double &Aspect) const
959 {
960 if( is_InGrid(x, y) )
961 {
962 double z = asDouble(x, y), dz[4];
963
964 for(int i=0, iDir=0, ix, iy; i<4; i++, iDir+=2)
965 {
966 if( is_InGrid(
967 ix = m_System.Get_xTo (iDir, x),
968 iy = m_System.Get_yTo (iDir, y)) )
969 {
970 dz[i] = asDouble(ix, iy) - z;
971 }
972 else if( is_InGrid(
973 ix = m_System.Get_xFrom(iDir, x),
974 iy = m_System.Get_yFrom(iDir, y)) )
975 {
976 dz[i] = z - asDouble(ix, iy);
977 }
978 else
979 {
980 dz[i] = 0.;
981 }
982 }
983
984 double G = (dz[0] - dz[2]) / (2. * Get_Cellsize());
985 double H = (dz[1] - dz[3]) / (2. * Get_Cellsize());
986
987 Slope = atan(sqrt(G*G + H*H));
988 Aspect = G != 0. ? M_PI_180 + atan2(H, G) : H > 0. ? M_PI_270 : H < 0. ? M_PI_090 : -1.;
989
990 return( true );
991 }
992
993 Slope = 0.;
994 Aspect = -1.;
995
996 return( false );
997 }
998
999 //---------------------------------------------------------
1006 //---------------------------------------------------------
1007 bool CSG_Grid::Get_Gradient(double x, double y, double &Slope, double &Aspect, TSG_Grid_Resampling Interpolation) const
1008 {
1009 double z, iz, dz[4];
1010
1011 if( Get_Value(x, y, z, Interpolation) )
1012 {
1013 for(int i=0, iDir=0; i<4; i++, iDir+=2)
1014 {
1015 if( Get_Value(
1016 x + Get_Cellsize() * m_System.Get_xTo (iDir),
1017 y + Get_Cellsize() * m_System.Get_yTo (iDir), iz, Interpolation) )
1018 {
1019 dz[i] = iz - z;
1020 }
1021 else if( Get_Value(
1022 x + Get_Cellsize() * m_System.Get_xFrom(iDir),
1023 y + Get_Cellsize() * m_System.Get_yFrom(iDir), iz, Interpolation) )
1024 {
1025 dz[i] = z - iz;
1026 }
1027 else
1028 {
1029 dz[i] = 0.;
1030 }
1031 }
1032
1033 double G = (dz[0] - dz[2]) / (2. * Get_Cellsize());
1034 double H = (dz[1] - dz[3]) / (2. * Get_Cellsize());
1035
1036 Slope = atan(sqrt(G*G + H*H));
1037 Aspect = G != 0. ? M_PI_180 + atan2(H, G) : H > 0. ? M_PI_270 : H < 0. ? M_PI_090 : -1.;
1038
1039 return( true );
1040 }
1041
1042 Slope = 0.;
1043 Aspect = -1.;
1044
1045 return( false );
1046 }
1047
1048 //---------------------------------------------------------
1055 //---------------------------------------------------------
1056 bool CSG_Grid::Get_Gradient(const TSG_Point &p, double &Incline, double &Azimuth, TSG_Grid_Resampling Interpolation) const
1057 {
1058 return( Get_Gradient(p.x, p.y, Incline, Azimuth, Interpolation) );
1059 }
1060
1061
1063 // //
1064 // //
1065 // //
1067
1068 //---------------------------------------------------------
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Rect
Definition: geo_tools.h:471
CSG_Grid::DeStandardise
bool DeStandardise(double Mean, double StdDev)
Definition: grid_operation.cpp:874
CSG_Grid::is_InGrid
bool is_InGrid(int x, int y, bool bCheckNoData=true) const
Definition: grid.h:593
CSG_Grid::Add_Value
virtual void Add_Value(int x, int y, double Value)
Definition: grid.h:808
CSG_Grid_System::Get_xTo
static int Get_xTo(int Direction, int x=0)
Definition: grid.h:310
GRID_RESAMPLING_NearestNeighbour
@ GRID_RESAMPLING_NearestNeighbour
Definition: grid.h:157
CSG_Grid::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Definition: grid.h:514
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
GRID_RESAMPLING_BicubicSpline
@ GRID_RESAMPLING_BicubicSpline
Definition: grid.h:159
CSG_Grid::operator/=
virtual CSG_Grid & operator/=(const CSG_Grid &Grid)
Definition: grid_operation.cpp:598
CSG_Grid::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grid.h:522
CSG_Grid::is_Intersecting
TSG_Intersection is_Intersecting(const CSG_Rect &Extent) const
Definition: grid.cpp:460
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Grid::Normalise
bool Normalise(void)
Definition: grid_operation.cpp:799
CSG_Unique_Number_Statistics
Definition: mat_tools.h:822
TSG_Grid_Resampling
TSG_Grid_Resampling
Definition: grid.h:156
CSG_Grid::Flip
void Flip(void)
Definition: grid_operation.cpp:756
CSG_Grid::operator+=
virtual CSG_Grid & operator+=(const CSG_Grid &Grid)
Definition: grid_operation.cpp:493
GRID_RESAMPLING_Undefined
@ GRID_RESAMPLING_Undefined
Definition: grid.h:168
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
GRID_OPERATION_Multiplication
@ GRID_OPERATION_Multiplication
Definition: grid.h:177
grid.h
CSG_Grid_System::Get_yTo
static int Get_yTo(int Direction, int y=0)
Definition: grid.h:324
GRID_RESAMPLING_Maximum
@ GRID_RESAMPLING_Maximum
Definition: grid.h:165
CSG_Grid::operator/
virtual CSG_Grid operator/(const CSG_Grid &Grid) const
Definition: grid_operation.cpp:584
CSG_Grid::Mul_Value
virtual void Mul_Value(int x, int y, double Value)
Definition: grid.h:811
CSG_Data_Object::Get_ObjectType
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.
GRID_OPERATION_Subtraction
@ GRID_OPERATION_Subtraction
Definition: grid.h:176
SSG_Point
Definition: geo_tools.h:128
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
GRID_OPERATION_Addition
@ GRID_OPERATION_Addition
Definition: grid.h:175
CSG_Grid::Multiply
virtual CSG_Grid & Multiply(const CSG_Grid &Grid)
Definition: grid_operation.cpp:573
CSG_Grid::Add
virtual CSG_Grid & Add(const CSG_Grid &Grid)
Definition: grid_operation.cpp:503
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:548
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:539
CSG_Data_Object
Definition: dataobject.h:180
GRID_RESAMPLING_Bilinear
@ GRID_RESAMPLING_Bilinear
Definition: grid.h:158
CSG_Grid::Get_Mean
double Get_Mean(void)
Definition: grid.cpp:1019
CSG_Grid::Subtract
virtual CSG_Grid & Subtract(const CSG_Grid &Grid)
Definition: grid_operation.cpp:538
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
GRID_RESAMPLING_Mean_Cells
@ GRID_RESAMPLING_Mean_Cells
Definition: grid.h:163
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Grid::Get_Max
double Get_Max(void)
Definition: grid.cpp:1029
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
CSG_Unique_Number_Statistics::Get_Majority
bool Get_Majority(double &Value) const
Definition: mat_tools.h:843
CSG_Grid::Get_Gradient
bool Get_Gradient(int x, int y, double &Slope, double &Aspect) const
Definition: grid_operation.cpp:958
CSG_Grid::Get_Unit
const CSG_String & Get_Unit(void) const
Definition: grid.h:525
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
M_PI_180
#define M_PI_180
Definition: mat_tools.h:104
CSG_Grid::Assign
virtual bool Assign(double Value=0.0)
Definition: grid_operation.cpp:77
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:544
CSG_Grid::Standardise
bool Standardise(void)
Definition: grid_operation.cpp:848
CSG_Grid::Get_Value
double Get_Value(double x, double y, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, bool bByteWise=false) const
Definition: grid.cpp:547
CSG_Grid::operator-=
virtual CSG_Grid & operator-=(const CSG_Grid &Grid)
Definition: grid_operation.cpp:528
GRID_RESAMPLING_BSpline
@ GRID_RESAMPLING_BSpline
Definition: grid.h:160
CSG_Grid::operator-
virtual CSG_Grid operator-(const CSG_Grid &Grid) const
Definition: grid_operation.cpp:514
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
CSG_Grid_System::Get_Length
double Get_Length(int Direction) const
Definition: grid.h:349
CSG_Grid::Assign_NoData
void Assign_NoData(void)
Definition: grid_operation.cpp:65
CSG_Grid::DeNormalise
bool DeNormalise(double Minimum, double Maximum)
Definition: grid_operation.cpp:825
CSG_Grid::operator+
virtual CSG_Grid operator+(const CSG_Grid &Grid) const
Definition: grid_operation.cpp:479
CSG_Grid_System::Get_yFrom
static int Get_yFrom(int Direction, int y=0)
Definition: grid.h:339
CSG_Grid::operator=
virtual CSG_Grid & operator=(const CSG_Grid &Grid)
Definition: grid_operation.cpp:464
M_PI_270
#define M_PI_270
Definition: mat_tools.h:106
CSG_Grid::Set_NoData
virtual void Set_NoData(int x, int y)
Definition: grid.h:702
CSG_Grid::Get_Gradient_NeighborDir
int Get_Gradient_NeighborDir(int x, int y, bool bDown=true, bool bNoEdges=true) const
Definition: grid_operation.cpp:916
GRID_OPERATION_Division
@ GRID_OPERATION_Division
Definition: grid.h:178
CSG_Grid::Get_Range
double Get_Range(void)
Definition: grid.cpp:1034
GRID_RESAMPLING_Majority
@ GRID_RESAMPLING_Majority
Definition: grid.h:166
M_PI_090
#define M_PI_090
Definition: mat_tools.h:102
GRID_RESAMPLING_Mean_Nodes
@ GRID_RESAMPLING_Mean_Nodes
Definition: grid.h:162
CSG_Simple_Statistics::Add_Value
void Add_Value(double Value, double Weight=1.)
Definition: mat_tools.cpp:527
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Grid::Get_Min
double Get_Min(void)
Definition: grid.cpp:1024
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Grid_System::Get_xFrom
static int Get_xFrom(int Direction, int x=0)
Definition: grid.h:338
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid::Divide
virtual CSG_Grid & Divide(const CSG_Grid &Grid)
Definition: grid_operation.cpp:608
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:605
CSG_Grid
Definition: grid.h:473
GRID_RESAMPLING_Minimum
@ GRID_RESAMPLING_Minimum
Definition: grid.h:164
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Grid::operator*
virtual CSG_Grid operator*(const CSG_Grid &Grid) const
Definition: grid_operation.cpp:549
CSG_Grid::Mirror
void Mirror(void)
Definition: grid_operation.cpp:774
CSG_Grid::Invert
void Invert(void)
Definition: grid_operation.cpp:734
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
CSG_Grid::Set_Unit
void Set_Unit(const CSG_String &Unit)
Definition: grid.cpp:408
CSG_Grid::operator*=
virtual CSG_Grid & operator*=(const CSG_Grid &Grid)
Definition: grid_operation.cpp:563
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:699
CSG_Grid::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grid.h:533
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Grid::Get_StdDev
double Get_StdDev(void)
Definition: grid.cpp:1039
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
TSG_Grid_Operation
TSG_Grid_Operation
Definition: grid.h:174
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_pyramid.cpp File Reference

  • saga_core
  • saga_api
grid_pyramid.cpp File Reference
#include "grid_pyramid.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_pyramid.cpp Source File

  • saga_core
  • saga_api
grid_pyramid.cpp
Go to the documentation of this file.
1 /**********************************************************
2 * Version $Id$
3 *********************************************************/
4
6 // //
7 // SAGA //
8 // //
9 // System for Automated Geoscientific Analyses //
10 // //
11 // Application Programming Interface //
12 // //
13 // Library: SAGA_API //
14 // //
15 //-------------------------------------------------------//
16 // //
17 // grid_pyramids.cpp //
18 // //
19 // Copyright (C) 2009 by Olaf Conrad //
20 // //
21 //-------------------------------------------------------//
22 // //
23 // This file is part of 'SAGA - System for Automated //
24 // Geoscientific Analyses'. //
25 // //
26 // This library is free software; you can redistribute //
27 // it and/or modify it under the terms of the GNU Lesser //
28 // General Public License as published by the Free //
29 // Software Foundation, either version 2.1 of the //
30 // License, or (at your option) any later version. //
31 // //
32 // This library is distributed in the hope that it will //
33 // be useful, but WITHOUT ANY WARRANTY; without even the //
34 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
35 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
36 // License for more details. //
37 // //
38 // You should have received a copy of the GNU Lesser //
39 // General Public License along with this program; if //
40 // not, see <http://www.gnu.org/licenses/>. //
41 // //
42 //-------------------------------------------------------//
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Bundesstr. 55 //
48 // 20146 Hamburg //
49 // Germany //
50 // //
51 // e-mail: oconrad@saga-gis.org //
52 // //
54
55 //---------------------------------------------------------
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 #include "grid_pyramid.h"
66
67
69 // //
70 // //
71 // //
73
74 //---------------------------------------------------------
75 CSG_Grid_Pyramid::CSG_Grid_Pyramid(void)
76 {
77 m_nLevels = 0;
78 m_pLevels = NULL;
79 m_pGrid = NULL;
80 }
81
82 //---------------------------------------------------------
83 CSG_Grid_Pyramid::CSG_Grid_Pyramid(CSG_Grid *pGrid, double Grow, TSG_Grid_Pyramid_Generalisation Generalisation, TSG_Grid_Pyramid_Grow_Type Grow_Type)
84 {
85 m_nLevels = 0;
86 m_pLevels = NULL;
87 m_pGrid = NULL;
88
89 Create(pGrid, Grow, Generalisation, Grow_Type);
90 }
91
92 //---------------------------------------------------------
93 CSG_Grid_Pyramid::CSG_Grid_Pyramid(CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation, TSG_Grid_Pyramid_Grow_Type Grow_Type)
94 {
95 m_nLevels = 0;
96 m_pLevels = NULL;
97 m_pGrid = NULL;
98
99 Create(pGrid, Grow, Start, nMaxLevels, Generalisation, Grow_Type);
100 }
101
102 //---------------------------------------------------------
103 CSG_Grid_Pyramid::~CSG_Grid_Pyramid(void)
104 {
105 Destroy();
106 }
107
108
110 // //
111 // //
112 // //
114
115 //---------------------------------------------------------
116 bool CSG_Grid_Pyramid::Create(CSG_Grid *pGrid, double Grow, TSG_Grid_Pyramid_Generalisation Generalisation, TSG_Grid_Pyramid_Grow_Type Grow_Type)
117 {
118 if( pGrid && pGrid->is_Valid() && Grow > 1.0 && (pGrid->Get_NX() > Grow || pGrid->Get_NY() > Grow) )
119 {
120 Destroy();
121
122 m_Grow_Type = Grow_Type;
123 m_nMaxLevels = 0;
124 m_pGrid = pGrid;
125 m_Grow = Grow;
126 m_Generalisation = Generalisation;
127
128 _Get_Next_Level(pGrid);
129
130 return( true );
131 }
132
133 return( false );
134 }
135
136 //---------------------------------------------------------
137 bool CSG_Grid_Pyramid::Create(CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation, TSG_Grid_Pyramid_Grow_Type Grow_Type)
138 {
139 if( pGrid && pGrid->is_Valid() && Grow > 0.0 && (pGrid->Get_NX() > Grow || pGrid->Get_NY() > Grow) )
140 {
141 Destroy();
142
143 m_Grow_Type = Grow_Type;
144 m_nMaxLevels = nMaxLevels;
145 m_pGrid = pGrid;
146 m_Grow = Grow;
147 m_Generalisation = Generalisation;
148
149 if( Start > 0.0 )
150 {
151 _Get_Next_Level(pGrid, Start);
152 }
153 else
154 {
155 _Get_Next_Level(pGrid);
156 }
157
158 return( true );
159 }
160
161 return( false );
162 }
163
164 //---------------------------------------------------------
165 bool CSG_Grid_Pyramid::Destroy(void)
166 {
167 if( m_pLevels )
168 {
169 for(int i=0; i<m_nLevels; i++)
170 {
171 delete(m_pLevels[i]);
172 }
173
174 SG_Free(m_pLevels);
175
176 m_nLevels = 0;
177 m_pLevels = NULL;
178 m_pGrid = NULL;
179 }
180
181 return( true );
182 }
183
184
186 // //
187 // //
188 // //
190
191 //---------------------------------------------------------
192 bool CSG_Grid_Pyramid::_Get_Next_Level(CSG_Grid *pGrid)
193 {
194 if( (m_nMaxLevels <= 0 || m_nLevels < m_nMaxLevels) )
195 {
196 int nx, ny;
197 double Cellsize;
198
199 switch( m_Grow_Type )
200 {
201 case GRID_PYRAMID_Arithmetic: Cellsize = pGrid->Get_Cellsize() + m_Grow; break;
202 case GRID_PYRAMID_Geometric: Cellsize = pGrid->Get_Cellsize() * m_Grow; break;
203 default: Cellsize = pGrid->Get_Cellsize() * m_Grow; break;
204 }
205
206 nx = (int)(1.5 + m_pGrid->Get_XRange() / Cellsize); if( nx < 1 ) nx = 1;
207 ny = (int)(1.5 + m_pGrid->Get_YRange() / Cellsize); if( ny < 1 ) ny = 1;
208
209 if( nx > 1 || ny > 1 )
210 {
211 CSG_Grid *pNext = SG_Create_Grid(SG_DATATYPE_Float, nx, ny, Cellsize, pGrid->Get_XMin(), pGrid->Get_YMin());
212
213 pNext->Set_NoData_Value(pGrid->Get_NoData_Value());
214 pNext->Assign(pGrid);
215
216 m_pLevels = (CSG_Grid **)SG_Realloc(m_pLevels, (m_nLevels + 1) * sizeof(CSG_Grid *));
217 m_pLevels[m_nLevels++] = pNext;
218
219 _Get_Next_Level(pNext);
220
221 return( true );
222 }
223 }
224
225 return( false );
226 }
227
228 //---------------------------------------------------------
229 bool CSG_Grid_Pyramid::_Get_Next_Level(CSG_Grid *pGrid, double Cellsize)
230 {
231 if( (m_nMaxLevels <= 0 || m_nLevels < m_nMaxLevels) )
232 {
233 int nx, ny;
234
235 nx = (int)(1.5 + m_pGrid->Get_XRange() / Cellsize); if( nx < 1 ) nx = 1;
236 ny = (int)(1.5 + m_pGrid->Get_YRange() / Cellsize); if( ny < 1 ) ny = 1;
237
238 if( nx > 1 || ny > 1 )
239 {
240 CSG_Grid *pNext = SG_Create_Grid(SG_DATATYPE_Float, nx, ny, Cellsize, pGrid->Get_XMin(), pGrid->Get_YMin());
241
242 pNext->Set_NoData_Value(pGrid->Get_NoData_Value());
243 pNext->Assign(pGrid);
244
245 m_pLevels = (CSG_Grid **)SG_Realloc(m_pLevels, (m_nLevels + 1) * sizeof(CSG_Grid *));
246 m_pLevels[m_nLevels++] = pNext;
247
248 _Get_Next_Level(pNext);
249
250 return( true );
251 }
252 }
253
254 return( false );
255 }
256
257
259 // //
260 // //
261 // //
263
264 //---------------------------------------------------------
CSG_Grid_Pyramid::~CSG_Grid_Pyramid
virtual ~CSG_Grid_Pyramid(void)
Definition: grid_pyramid.cpp:103
GRID_PYRAMID_Geometric
@ GRID_PYRAMID_Geometric
Definition: grid_pyramid.h:102
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
TSG_Grid_Pyramid_Generalisation
TSG_Grid_Pyramid_Generalisation
Definition: grid_pyramid.h:90
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Grid::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grid.h:546
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:548
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:539
TSG_Grid_Pyramid_Grow_Type
TSG_Grid_Pyramid_Grow_Type
Definition: grid_pyramid.h:100
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Grid::Assign
virtual bool Assign(double Value=0.0)
Definition: grid_operation.cpp:77
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:544
grid_pyramid.h
CSG_Grid_Pyramid::Create
bool Create(class CSG_Grid *pGrid, double Grow=2.0, TSG_Grid_Pyramid_Generalisation Generalisation=GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type=GRID_PYRAMID_Geometric)
Definition: grid_pyramid.cpp:116
CSG_Grid::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grid.h:550
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
CSG_Grid
Definition: grid.h:473
CSG_Grid_Pyramid::Destroy
bool Destroy(void)
Definition: grid_pyramid.cpp:165
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Grid_Pyramid::CSG_Grid_Pyramid
CSG_Grid_Pyramid(void)
Definition: grid_pyramid.cpp:75
GRID_PYRAMID_Arithmetic
@ GRID_PYRAMID_Arithmetic
Definition: grid_pyramid.h:101
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_pyramid.h File Reference

  • saga_core
  • saga_api
Classes | Enumerations
grid_pyramid.h File Reference
#include "grid.h"

Go to the source code of this file.

Classes

class CSG_Grid_Pyramid

Enumerations

enum | TSG_Grid_Pyramid_Generalisation { GRID_PYRAMID_Mean = 0, GRID_PYRAMID_Max, GRID_PYRAMID_Min, GRID_PYRAMID_MaxCount }
enum | TSG_Grid_Pyramid_Grow_Type { GRID_PYRAMID_Arithmetic = 0, GRID_PYRAMID_Geometric }

Detailed Description

A class for the automated construction of pyramids for a given raster data set, i.e. a set of aggregated raster cell values for increasing raster cell sizes.

See also
CSG_Grid_Pyramid

Definition in file grid_pyramid.h.

Enumeration Type Documentation

◆ TSG_Grid_Pyramid_Generalisation

enum TSG_Grid_Pyramid_Generalisation
Enumerator
GRID_PYRAMID_Mean
GRID_PYRAMID_Max
GRID_PYRAMID_Min
GRID_PYRAMID_MaxCount

Definition at line 89 of file grid_pyramid.h.

◆ TSG_Grid_Pyramid_Grow_Type

enum TSG_Grid_Pyramid_Grow_Type
Enumerator
GRID_PYRAMID_Arithmetic
GRID_PYRAMID_Geometric

Definition at line 99 of file grid_pyramid.h.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_pyramid.h Source File

  • saga_core
  • saga_api
grid_pyramid.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid_pyramids.h //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Bundesstr. 55 //
45 // 20146 Hamburg //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__grid_pyramid_H
54 #define HEADER_INCLUDED__SAGA_API__grid_pyramid_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
72 // //
74 // //
75 // //
77
78 //---------------------------------------------------------
79 #include "grid.h"
80
81
83 // //
84 // //
85 // //
87
88 //---------------------------------------------------------
89 typedef enum
90 {
91 GRID_PYRAMID_Mean = 0,
92 GRID_PYRAMID_Max,
93 GRID_PYRAMID_Min,
94 GRID_PYRAMID_MaxCount
95 }
96 TSG_Grid_Pyramid_Generalisation;
97
98 //---------------------------------------------------------
99 typedef enum
100 {
101 GRID_PYRAMID_Arithmetic = 0,
102 GRID_PYRAMID_Geometric
103 }
104 TSG_Grid_Pyramid_Grow_Type;
105
106
108 // //
109 // //
110 // //
112
113 //---------------------------------------------------------
114 class SAGA_API_DLL_EXPORT CSG_Grid_Pyramid
115 {
116 public:
117 CSG_Grid_Pyramid(void);
118
119 CSG_Grid_Pyramid (class CSG_Grid *pGrid, double Grow = 2.0, TSG_Grid_Pyramid_Generalisation Generalisation = GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type = GRID_PYRAMID_Geometric);
120 bool Create (class CSG_Grid *pGrid, double Grow = 2.0, TSG_Grid_Pyramid_Generalisation Generalisation = GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type = GRID_PYRAMID_Geometric);
121
122 CSG_Grid_Pyramid (class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation = GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type = GRID_PYRAMID_Geometric);
123 bool Create (class CSG_Grid *pGrid, double Grow, double Start, int nMaxLevels, TSG_Grid_Pyramid_Generalisation Generalisation = GRID_PYRAMID_Mean, TSG_Grid_Pyramid_Grow_Type Grow_Type = GRID_PYRAMID_Geometric);
124
125 virtual ~CSG_Grid_Pyramid(void);
126
127 bool Destroy (void);
128
129
130 int Get_Count (void) { return( m_nLevels ); }
131 class CSG_Grid * Get_Grid (int iLevel) { return( iLevel >= 0 && iLevel < m_nLevels ? m_pLevels[iLevel] : m_pGrid ); }
132
133
134 private:
135
136 int m_nLevels, m_nMaxLevels;
137
138 double m_Grow;
139
140 TSG_Grid_Pyramid_Generalisation m_Generalisation;
141
142 TSG_Grid_Pyramid_Grow_Type m_Grow_Type;
143
144 class CSG_Grid **m_pLevels, *m_pGrid;
145
146
147 bool _Get_Next_Level (class CSG_Grid *pGrid);
148 bool _Get_Next_Level (class CSG_Grid *pGrid, double Cellsize);
149
150 };
151
152
154 // //
155 // //
156 // //
158
159 //---------------------------------------------------------
160 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grid_pyramid_H
GRID_PYRAMID_Min
@ GRID_PYRAMID_Min
Definition: grid_pyramid.h:93
CSG_Grid_Pyramid::Get_Grid
class CSG_Grid * Get_Grid(int iLevel)
Definition: grid_pyramid.h:131
CSG_Grid_Pyramid::Get_Count
int Get_Count(void)
Definition: grid_pyramid.h:130
GRID_PYRAMID_Geometric
@ GRID_PYRAMID_Geometric
Definition: grid_pyramid.h:102
TSG_Grid_Pyramid_Generalisation
TSG_Grid_Pyramid_Generalisation
Definition: grid_pyramid.h:90
grid.h
GRID_PYRAMID_Mean
@ GRID_PYRAMID_Mean
Definition: grid_pyramid.h:91
CSG_Grid_Pyramid
Definition: grid_pyramid.h:115
TSG_Grid_Pyramid_Grow_Type
TSG_Grid_Pyramid_Grow_Type
Definition: grid_pyramid.h:100
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Grid
Definition: grid.h:473
GRID_PYRAMID_MaxCount
@ GRID_PYRAMID_MaxCount
Definition: grid_pyramid.h:94
GRID_PYRAMID_Arithmetic
@ GRID_PYRAMID_Arithmetic
Definition: grid_pyramid.h:101
GRID_PYRAMID_Max
@ GRID_PYRAMID_Max
Definition: grid_pyramid.h:92
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grid_system.cpp File Reference

  • saga_core
  • saga_api
Macros
grid_system.cpp File Reference
#include "grid.h"
#include "shapes.h"
#include "parameters.h"

Go to the source code of this file.

Macros

#define ADD_CELL(x, y, Distance)

Macro Definition Documentation

◆ ADD_CELL

#define ADD_CELL | ( | x,
 |  | y,
 |  | Distance
 | ) |
Value:
{\
CSG_Table_Record &Cell = *Kernel.Add_Record();\
Cell.Set_Value(0, x);\
Cell.Set_Value(1, y);\
Cell.Set_Value(2, Distance);\
Cell.Set_Value(3, m_Weighting.Get_Weight(d));\
}
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grid_system.cpp Source File

  • saga_core
  • saga_api
grid_system.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid_system.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "grid.h"
52 #include "shapes.h"
53 #include "parameters.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 int CSG_Grid_System::m_Precision = 16; // 16 decimal digits, default precision used for storing cellsize and extent
64
65 //---------------------------------------------------------
66 int CSG_Grid_System::Set_Precision(int Decimals)
67 {
68 if( Decimals >= 0 )
69 {
70 m_Precision = Decimals;
71 }
72
73 return( m_Precision );
74 }
75
76 //---------------------------------------------------------
77 int CSG_Grid_System::Get_Precision(void)
78 {
79 return( m_Precision );
80 }
81
82
84 // //
86
87 //---------------------------------------------------------
88 CSG_Grid_System::CSG_Grid_System(void)
89 {
90 Destroy();
91 }
92
93 //---------------------------------------------------------
94 CSG_Grid_System::CSG_Grid_System(const CSG_Grid_System &System)
95 {
96 Create(System);
97 }
98
99 //---------------------------------------------------------
100 CSG_Grid_System::CSG_Grid_System(double Cellsize, const CSG_Rect &Extent)
101 {
102 Create(Cellsize, Extent);
103 }
104
105 //---------------------------------------------------------
106 CSG_Grid_System::CSG_Grid_System(double Cellsize, double xMin, double yMin, double xMax, double yMax)
107 {
108 Create(Cellsize, xMin, yMin, xMax, yMax);
109 }
110
111 //---------------------------------------------------------
112 CSG_Grid_System::CSG_Grid_System(double Cellsize, double xMin, double yMin, int NX, int NY)
113 {
114 Create(Cellsize, xMin, yMin, NX, NY);
115 }
116
117 //---------------------------------------------------------
118 CSG_Grid_System::~CSG_Grid_System(void)
119 {
120 Destroy();
121 }
122
123
125 // //
127
128 //---------------------------------------------------------
129 bool CSG_Grid_System::Create(const CSG_Grid_System &System)
130 {
131 m_NX = System.m_NX;
132 m_NY = System.m_NY;
133 m_NCells = System.m_NCells;
134
135 m_Cellsize = System.m_Cellsize;
136 m_Cellarea = System.m_Cellarea;
137 m_Diagonal = System.m_Diagonal;
138
139 m_Extent = System.m_Extent;
140 m_Extent_Cells = System.m_Extent_Cells;
141
142 return( is_Valid() );
143 }
144
145 //---------------------------------------------------------
146 bool CSG_Grid_System::Create(double Cellsize, const CSG_Rect &Extent)
147 {
148 if( Cellsize > 0. && Extent.Get_XRange() >= 0. && Extent.Get_YRange() >= 0. )
149 {
150 int nx = 1 + (int)(0.5 + Extent.Get_XRange() / Cellsize);
151 int ny = 1 + (int)(0.5 + Extent.Get_YRange() / Cellsize);
152
153 double x = fabs(Cellsize - Extent.Get_XRange() / (nx - 1.)) <= 0. ? Extent.Get_XMin() : Extent.Get_Center().x - Cellsize * (nx - 1.) / 2.;
154 double y = fabs(Cellsize - Extent.Get_YRange() / (ny - 1.)) <= 0. ? Extent.Get_YMin() : Extent.Get_Center().y - Cellsize * (ny - 1.) / 2.;
155
156 return( Create(Cellsize, x, y, nx, ny) );
157 }
158
159 Destroy();
160
161 return( false );
162 }
163
164 //---------------------------------------------------------
165 bool CSG_Grid_System::Create(double Cellsize, double xMin, double yMin, double xMax, double yMax)
166 {
167 return( Create(Cellsize, CSG_Rect(xMin, yMin, xMax, yMax)) );
168 }
169
170 //---------------------------------------------------------
171 bool CSG_Grid_System::Create(double Cellsize, double xMin, double yMin, int NX, int NY)
172 {
173 if( Cellsize > 0. && NX > 0 && NY > 0 )
174 {
175 Cellsize = SG_Get_Rounded(Cellsize, m_Precision);
176 xMin = SG_Get_Rounded(xMin , m_Precision);
177 yMin = SG_Get_Rounded(yMin , m_Precision);
178
179 if( Cellsize > 0. )
180 {
181 m_NX = NX;
182 m_NY = NY;
183 m_NCells = (sLong)NY * NX;
184
185 m_Cellsize = Cellsize;
186 m_Cellarea = Cellsize * Cellsize;
187 m_Diagonal = Cellsize * sqrt(2.);
188
189 m_Extent.xMin = xMin;
190 m_Extent.yMin = yMin;
191 m_Extent.xMax = xMin + (NX - 1.) * Cellsize;
192 m_Extent.yMax = yMin + (NY - 1.) * Cellsize;
193
194 m_Extent_Cells = m_Extent;
195 m_Extent_Cells.Inflate(0.5 * Cellsize, false);
196
197 return( true );
198 }
199 }
200
201 //-----------------------------------------------------
202 m_NX = 0;
203 m_NY = 0;
204 m_NCells = 0;
205
206 m_Cellsize = 0.;
207 m_Cellarea = 0.;
208 m_Diagonal = 0.;
209
210 m_Extent .Assign(0., 0., 0., 0.);
211 m_Extent_Cells .Assign(0., 0., 0., 0.);
212
213 return( false );
214 }
215
216 //---------------------------------------------------------
217 bool CSG_Grid_System::Destroy(void)
218 {
219 Create(0., 0., 0., 0, 0);
220
221 return( true );
222 }
223
224 //---------------------------------------------------------
225 bool CSG_Grid_System::Assign(const CSG_Grid_System &System)
226 { return( Create(System) ); }
227
228 bool CSG_Grid_System::Assign(double Cellsize, const CSG_Rect &Extent)
229 { return( Create(Cellsize, Extent) ); }
230
231 bool CSG_Grid_System::Assign(double Cellsize, double xMin, double yMin, double xMax, double yMax)
232 { return( Create(Cellsize, xMin, yMin, xMax, yMax) ); }
233
234 bool CSG_Grid_System::Assign(double Cellsize, double xMin, double yMin, int NX, int NY)
235 { return( Create(Cellsize, xMin, yMin, NX, NY) ); }
236
237
239 // //
241
242 //---------------------------------------------------------
243 bool CSG_Grid_System::is_Valid(void) const
244 {
245 return( m_Cellsize > 0. );
246 }
247
248 //---------------------------------------------------------
249 const SG_Char * CSG_Grid_System::Get_Name(bool bShort)
250 {
251 if( is_Valid() )
252 {
253 if( bShort )
254 {
255 m_Name.Printf("%.*f; %dx %dy; %.*fx %.*fy",
256 SG_Get_Significant_Decimals(Get_Cellsize()), Get_Cellsize(),
257 Get_NX(), Get_NY(),
258 SG_Get_Significant_Decimals(Get_XMin ()), Get_XMin (),
259 SG_Get_Significant_Decimals(Get_YMin ()), Get_YMin ()
260 );
261 }
262 else
263 {
264 m_Name.Printf("%s: %f, %s: %dx/%dy, %s: %fx/%fy",
265 _TL("Cell size" ), Get_Cellsize(),
266 _TL("Number of cells" ), Get_NX(), Get_NY(),
267 _TL("Lower left corner"), Get_XMin(), Get_YMin()
268 );
269 }
270 }
271 else
272 {
273 m_Name = _TL("<not set>");
274 }
275
276 return( m_Name );
277 }
278
279
281 // //
283
284 //---------------------------------------------------------
285 bool CSG_Grid_System::operator == (const CSG_Grid_System &System) const
286 {
287 return( is_Equal(System) );
288 }
289
290 //---------------------------------------------------------
291 void CSG_Grid_System::operator = (const CSG_Grid_System &System)
292 {
293 Create(System);
294 }
295
296
298 // //
300
301 //---------------------------------------------------------
302 bool CSG_Grid_System::is_Equal(const CSG_Grid_System &System) const
303 {
304 return( m_Cellsize == System.m_Cellsize
305 && m_NX == System.m_NX
306 && m_NY == System.m_NY
307 && m_Extent.xMin == System.m_Extent.xMin
308 && m_Extent.yMin == System.m_Extent.yMin
309 );
310 }
311
312 //---------------------------------------------------------
313 bool CSG_Grid_System::is_Equal(double Cellsize, const TSG_Rect &Extent) const
314 {
315 return( m_Cellsize == Cellsize && m_Extent == Extent );
316 }
317
318
320 // //
321 // //
322 // //
324
325 //---------------------------------------------------------
326 CSG_Grid_Cell_Addressor::CSG_Grid_Cell_Addressor(void)
327 {
328 m_Kernel.Add_Field("X", SG_DATATYPE_Int );
329 m_Kernel.Add_Field("Y", SG_DATATYPE_Int );
330 m_Kernel.Add_Field("D", SG_DATATYPE_Double);
331 m_Kernel.Add_Field("W", SG_DATATYPE_Double);
332 }
333
334 //---------------------------------------------------------
335 bool CSG_Grid_Cell_Addressor::Destroy(void)
336 {
337 m_Kernel.Del_Records();
338
339 m_Radius = 1.;
340 m_Radius_0 = 0.;
341 m_Direction = 0.;
342 m_Tolerance = 0.;
343
344 return( true );
345 }
346
347
349 // //
351
352 //---------------------------------------------------------
353 bool CSG_Grid_Cell_Addressor::Add_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, int Style)
354 {
355 CSG_String Types;
356
357 if( (Style & SG_GRIDCELLADDR_PARM_SQUARE ) != 0 )
358 {
359 Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SQUARE , _TL("Square" ));
360 }
361
362 if( (Style & SG_GRIDCELLADDR_PARM_CIRCLE ) != 0 )
363 {
364 Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_CIRCLE , _TL("Circle" ));
365 }
366
367 if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
368 {
369 Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_ANNULUS, _TL("Annulus"));
370 }
371
372 if( (Style & SG_GRIDCELLADDR_PARM_SECTOR ) != 0 )
373 {
374 Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SECTOR , _TL("Sector" ));
375 }
376
377 Parameters.Add_Choice(Parent, "KERNEL_TYPE", _TL("Kernel Type"),
378 _TL("The kernel's shape."),
379 Types, 1
380 );
381
382 Parameters.Set_Enabled("KERNEL_TYPE", Parameters("KERNEL_TYPE")->asChoice()->Get_Count() > 1);
383
384 //-----------------------------------------------------
385 CSG_String Unit_Radius((Style & SG_GRIDCELLADDR_PARM_MAPUNIT) == 0 ? _TL("cells") : _TL("map units"));
386
387 if( (Style & SG_GRIDCELLADDR_PARM_SIZEDBL) != 0 )
388 {
389 if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
390 {
391 Parameters.Add_Double("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0., 0., true);
392 }
393
394 Parameters .Add_Double("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 1., 0., true);
395 }
396 else
397 {
398 if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
399 {
400 Parameters.Add_Int ("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0 , 0 , true);
401 }
402
403 Parameters .Add_Int ("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 2 , 0 , true);
404 }
405
406 //-----------------------------------------------------
407 if( (Style & SG_GRIDCELLADDR_PARM_SECTOR) != 0 )
408 {
409 Parameters.Add_Double("KERNEL_TYPE", "KERNEL_DIRECTION", _TL("Direction"), _TL("degree"), 0., -360., true, 360., true);
410 Parameters.Add_Double("KERNEL_TYPE", "KERNEL_TOLERANCE", _TL("Tolerance"), _TL("degree"), 5., 0., true, 180., true);
411 }
412
413 if( (Style & SG_GRIDCELLADDR_PARM_WEIGHTING) != 0 )
414 {
415 CSG_Distance_Weighting::Add_Parameters(Parameters,
416 Parameters("KERNEL_TYPE")->is_Enabled() ? CSG_String("KERNEL_TYPE") : Parent
417 );
418 }
419
420 return( true );
421 }
422
423 //---------------------------------------------------------
424 bool CSG_Grid_Cell_Addressor::Set_Parameters(CSG_Parameters &Parameters, int Type)
425 {
426 if( Type == 0 && Parameters("KERNEL_TYPE") )
427 {
428 Parameters("KERNEL_TYPE")->asChoice()->Get_Data(Type);
429 }
430
431 switch( Type )
432 {
433 case SG_GRIDCELLADDR_PARM_SQUARE:
434 return( Set_Radius(
435 Parameters("KERNEL_RADIUS" )->asDouble(),
436 true
437 ));
438
439 case SG_GRIDCELLADDR_PARM_CIRCLE:
440 return( Set_Radius(
441 Parameters("KERNEL_RADIUS" )->asDouble(),
442 false
443 ));
444
445 case SG_GRIDCELLADDR_PARM_ANNULUS:
446 return( Set_Annulus(
447 Parameters("KERNEL_INNER" )->asDouble(),
448 Parameters("KERNEL_RADIUS" )->asDouble()
449 ));
450
451 case SG_GRIDCELLADDR_PARM_SECTOR:
452 return( Set_Sector(
453 Parameters("KERNEL_RADIUS" )->asDouble(),
454 Parameters("KERNEL_DIRECTION")->asDouble() * M_DEG_TO_RAD,
455 Parameters("KERNEL_TOLERANCE")->asDouble() * M_DEG_TO_RAD
456 ));
457 }
458
459 return( false );
460 }
461
462 //---------------------------------------------------------
463 bool CSG_Grid_Cell_Addressor::Set_Square (CSG_Parameters &Parameters) { return( Set_Parameters(Parameters, SG_GRIDCELLADDR_PARM_SQUARE ) ); }
464 bool CSG_Grid_Cell_Addressor::Set_Circle (CSG_Parameters &Parameters) { return( Set_Parameters(Parameters, SG_GRIDCELLADDR_PARM_CIRCLE ) ); }
465 bool CSG_Grid_Cell_Addressor::Set_Annulus(CSG_Parameters &Parameters) { return( Set_Parameters(Parameters, SG_GRIDCELLADDR_PARM_ANNULUS) ); }
466 bool CSG_Grid_Cell_Addressor::Set_Sector (CSG_Parameters &Parameters) { return( Set_Parameters(Parameters, SG_GRIDCELLADDR_PARM_SECTOR ) ); }
467
468
470 // //
472
473 //---------------------------------------------------------
474 bool CSG_Grid_Cell_Addressor::Enable_Parameters(CSG_Parameters &Parameters)
475 {
476 if( Parameters("KERNEL_TYPE") )
477 {
478 int Type = Parameters("KERNEL_TYPE")->asChoice()->Get_Item_Data(Parameters("KERNEL_TYPE")->asInt()).asInt();
479
480 Parameters.Set_Enabled("KERNEL_INNER" , Type == SG_GRIDCELLADDR_PARM_ANNULUS);
481 Parameters.Set_Enabled("KERNEL_DIRECTION", Type == SG_GRIDCELLADDR_PARM_SECTOR );
482 Parameters.Set_Enabled("KERNEL_TOLERANCE", Type == SG_GRIDCELLADDR_PARM_SECTOR );
483 }
484
485 CSG_Distance_Weighting::Enable_Parameters(Parameters);
486
487 return( true );
488 }
489
490
492 // //
494
495 //---------------------------------------------------------
496 bool CSG_Grid_Cell_Addressor::_Set_Kernel(int Type, double Radius, double Radius_Inner, double Direction, double Tolerance)
497 {
498 Destroy();
499
500 m_Type = Type;
501 m_Radius = Radius;
502 m_Radius_0 = Radius_Inner;
503 m_Direction = fmod(Direction, M_PI_360); if( Direction < 0. ) Direction += M_PI_360;
504 m_Tolerance = fmod(Tolerance, M_PI_180); if( Tolerance < 0. ) Tolerance += M_PI_180;
505
506 if( m_Radius < 0. || m_Radius < m_Radius_0 )
507 {
508 return( false );
509 }
510
511 CSG_Vector Sector(2);
512
513 if( m_Type == 3 ) // sector
514 {
515 Sector[0] = fmod(Direction - Tolerance, M_PI_360); if( Sector[0] < 0. ) Sector[0] += M_PI_360;
516 Sector[1] = fmod(Direction + Tolerance, M_PI_360); if( Sector[1] < 0. ) Sector[1] += M_PI_360;
517 }
518
519 //-----------------------------------------------------
520 #define ADD_CELL(x, y, Distance) {\
521 CSG_Table_Record &Cell = *Kernel.Add_Record();\
522 Cell.Set_Value(0, x);\
523 Cell.Set_Value(1, y);\
524 Cell.Set_Value(2, Distance);\
525 Cell.Set_Value(3, m_Weighting.Get_Weight(d));\
526 }
527
528 CSG_Table Kernel(&m_Kernel);
529
530 int Size = (int)ceil(m_Radius);
531
532 //-----------------------------------------------------
533 for(int y=-Size; y<=Size; y++)
534 {
535 if( abs(y) > m_Radius )
536 continue;
537
538 for(int x=-Size; x<=Size; x++)
539 {
540 if( abs(x) > m_Radius )
541 continue;
542
543 double d = SG_Get_Length(x, y);
544
545 switch( m_Type )
546 {
547 default: // square
548 ADD_CELL(x, y, d);
549 break;
550
551 case 1: // circle
552 if( d <= m_Radius )
553 {
554 ADD_CELL(x, y, d);
555 }
556 break;
557
558 case 2: // annulus
559 if( d <= m_Radius && d >= m_Radius_0 )
560 {
561 ADD_CELL(x, y, d);
562 }
563 break;
564
565 case 3: // sector
566 if( d <= m_Radius && d >= m_Radius_0 && ((x == 0 && y == 0) || SG_is_Angle_Between(SG_Get_Angle_Of_Direction(x, y), Sector[0], Sector[1], false)) )
567 {
568 ADD_CELL(x, y, d);
569 }
570 break;
571 }
572 }
573 }
574
575 //-----------------------------------------------------
576 if( Kernel.Get_Count() < 1 )
577 {
578 return( false );
579 }
580
581 Kernel.Set_Index(2, TABLE_INDEX_Ascending);
582
583 for(int i=0; i<Kernel.Get_Count(); i++)
584 {
585 m_Kernel.Add_Record(Kernel.Get_Record_byIndex(i));
586 }
587
588 return( true );
589 }
590
591 //---------------------------------------------------------
592 bool CSG_Grid_Cell_Addressor::Set_Radius(double Radius, bool bSquare)
593 {
594 return( bSquare ? Set_Square(Radius) : Set_Circle(Radius) );
595 }
596
597 //---------------------------------------------------------
598 bool CSG_Grid_Cell_Addressor::Set_Square(double Radius)
599 {
600 return( _Set_Kernel(0, Radius, 0., 0., 0.) );
601 }
602
603 //---------------------------------------------------------
604 bool CSG_Grid_Cell_Addressor::Set_Circle(double Radius)
605 {
606 return( _Set_Kernel(1, Radius, 0., 0., 0.) );
607 }
608
609 //---------------------------------------------------------
610 bool CSG_Grid_Cell_Addressor::Set_Annulus(double Radius_Inner, double Radius_Outer)
611 {
612 return( _Set_Kernel(2, Radius_Outer, Radius_Inner, 0., 0.) );
613 }
614
615 //---------------------------------------------------------
616 bool CSG_Grid_Cell_Addressor::Set_Sector(double Radius, double Direction, double Tolerance)
617 {
618 return( _Set_Kernel(3, Radius, 0., Direction, Tolerance) );
619 }
620
621
623 // //
624 // //
625 // //
627
628 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:111
CSG_Rect
Definition: geo_tools.h:471
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Grid_System::Get_Precision
static int Get_Precision(void)
Definition: grid_system.cpp:77
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Distance_Weighting::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1418
SG_GRIDCELLADDR_PARM_SECTOR
#define SG_GRIDCELLADDR_PARM_SECTOR
Definition: grid.h:1095
SG_Get_Rounded
double SG_Get_Rounded(double Value, int Decimals)
Definition: mat_tools.cpp:83
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
CSG_Grid_System
Definition: grid.h:200
SG_GRIDCELLADDR_PARM_SQUARE
#define SG_GRIDCELLADDR_PARM_SQUARE
Definition: grid.h:1092
grid.h
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Grid_Cell_Addressor::Set_Square
bool Set_Square(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:463
SG_GRIDCELLADDR_PARM_WEIGHTING
#define SG_GRIDCELLADDR_PARM_WEIGHTING
Definition: grid.h:1098
SG_Get_Angle_Of_Direction
double SG_Get_Angle_Of_Direction(double dx, double dy)
Definition: geo_functions.cpp:216
CSG_Grid_System::Create
bool Create(const CSG_Grid_System &System)
Definition: grid_system.cpp:129
CSG_Grid_Cell_Addressor::Destroy
bool Destroy(void)
Definition: grid_system.cpp:335
CSG_Grid_Cell_Addressor::Get_Count
int Get_Count(void) const
Definition: grid.h:1137
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Grid_Cell_Addressor::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:474
SG_GRIDCELLADDR_PARM_CIRCLE
#define SG_GRIDCELLADDR_PARM_CIRCLE
Definition: grid.h:1093
CSG_Grid_System::CSG_Grid_System
CSG_Grid_System(void)
Definition: grid_system.cpp:88
CSG_Grid_System::Get_Name
const SG_Char * Get_Name(bool bShort=true)
Definition: grid_system.cpp:249
CSG_Grid_System::Set_Precision
static int Set_Precision(int Decimals)
Definition: grid_system.cpp:66
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Vector
Definition: mat_tools.h:345
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Grid_System::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: grid_system.cpp:302
CSG_Grid_Cell_Addressor::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", int Style=SG_GRIDCELLADDR_PARM_DEFAULT)
Definition: grid_system.cpp:353
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Grid_Cell_Addressor::Set_Parameters
bool Set_Parameters(class CSG_Parameters &Parameters, int Type=0)
Definition: grid_system.cpp:424
SG_GRIDCELLADDR_PARM_ANNULUS
#define SG_GRIDCELLADDR_PARM_ANNULUS
Definition: grid.h:1094
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
CSG_Grid_System::Destroy
bool Destroy(void)
Definition: grid_system.cpp:217
SG_Get_Length
double SG_Get_Length(double dx, double dy)
Definition: geo_functions.cpp:97
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
M_PI_180
#define M_PI_180
Definition: mat_tools.h:104
SG_Get_Significant_Decimals
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
Definition: api_string.cpp:1274
CSG_Grid_Cell_Addressor::Set_Radius
bool Set_Radius(double Radius, bool bSquare=false)
Definition: grid_system.cpp:592
SG_is_Angle_Between
bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange)
Definition: geo_functions.cpp:257
CSG_Grid_Cell_Addressor::CSG_Grid_Cell_Addressor
CSG_Grid_Cell_Addressor(void)
Definition: grid_system.cpp:326
CSG_Grid_Cell_Addressor::Set_Circle
bool Set_Circle(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:464
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
ADD_CELL
#define ADD_CELL(x, y, Distance)
SG_GRIDCELLADDR_PARM_SIZEDBL
#define SG_GRIDCELLADDR_PARM_SIZEDBL
Definition: grid.h:1096
SG_Char
#define SG_Char
Definition: api_core.h:530
shapes.h
CSG_String
Definition: api_core.h:557
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Distance_Weighting::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1380
CSG_Grid_System::operator=
void operator=(const CSG_Grid_System &System)
Definition: grid_system.cpp:291
CSG_Rect::Get_Center
CSG_Point Get_Center(void) const
Definition: geo_tools.h:514
CSG_Grid_Cell_Addressor::Set_Sector
bool Set_Sector(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:466
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
M_PI_360
#define M_PI_360
Definition: mat_tools.h:108
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point::y
double y
Definition: geo_tools.h:129
SG_GRIDCELLADDR_PARM_MAPUNIT
#define SG_GRIDCELLADDR_PARM_MAPUNIT
Definition: grid.h:1097
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
CSG_Grid_Cell_Addressor::Set_Annulus
bool Set_Annulus(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:465
CSG_Parameters
Definition: parameters.h:1650
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
CSG_Grid_System::operator==
bool operator==(const CSG_Grid_System &System) const
Definition: grid_system.cpp:285
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Grid_System::~CSG_Grid_System
~CSG_Grid_System(void)
Definition: grid_system.cpp:118
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grids.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
grids.cpp File Reference
#include "saga_api.h"
#include "grids.h"
#include "data_manager.h"
#include "tool_library.h"

Go to the source code of this file.

Macros

#define | ADD_TO_SPLINE(i) if( i < 0 || i >= Get_NZ() || !m_pGrids[i]->Get_Value(x, y, Value, Resampling) ) return( false ); s.Add(Get_Z(i), Value);
#define | SORT_SWAP(a, b) {itemp=(a);(a)=(b);(b)=itemp;}
#define | SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255

Functions

CSG_Grids * | SG_Create_Grids (void)
CSG_Grids * | SG_Create_Grids (const CSG_Grids &Grids)
CSG_Grids * | SG_Create_Grids (const CSG_Grids *_pGrids, bool bCopyData)
CSG_Grids * | SG_Create_Grids (const char *FileName, bool bLoadData)
CSG_Grids * | SG_Create_Grids (const wchar_t *FileName, bool bLoadData)
CSG_Grids * | SG_Create_Grids (const CSG_String &FileName, bool bLoadData)
CSG_Grids * | SG_Create_Grids (const CSG_Grid_System &System, int NZ, double zMin, TSG_Data_Type Type)
CSG_Grids * | SG_Create_Grids (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute, TSG_Data_Type Type, bool bCreateGrids)
CSG_Grids * | SG_Create_Grids (int NX, int NY, int NZ, double Cellsize, double xMin, double yMin, double zMin, TSG_Data_Type Type)

Macro Definition Documentation

◆ ADD_TO_SPLINE

#define ADD_TO_SPLINE ( i ) if( i < 0 || i >= Get_NZ() || !m_pGrids[i]->Get_Value(x, y, Value, Resampling) ) return( false ); s.Add(Get_Z(i), Value);

◆ SG_GRID_HISTOGRAM_CLASSES_DEFAULT

#define SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255

Definition at line 1555 of file grids.cpp.

◆ SORT_SWAP

#define SORT_SWAP | ( | a,
 |  | b
 | ) | {itemp=(a);(a)=(b);(b)=itemp;}

Definition at line 1175 of file grids.cpp.

Function Documentation

◆ SG_Create_Grids() [1/9]

CSG_Grids* SG_Create_Grids | ( | const char * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 87 of file grids.cpp.

References SG_Create_Grids().

◆ SG_Create_Grids() [2/9]

CSG_Grids* SG_Create_Grids | ( | const CSG_Grid_System & | System,
 |  | const CSG_Table & | Attributes,
 |  | int | zAttribute = 0,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCreateGrids = false
 | ) |  |

Safe construction of a grid collection

Definition at line 105 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [3/9]

CSG_Grids* SG_Create_Grids | ( | const CSG_Grid_System & | System,
 |  | int | NZ = 0,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Safe construction of a grid collection

Definition at line 97 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [4/9]

CSG_Grids* SG_Create_Grids ( const CSG_Grids & Grids )

Safe construction of a grid collection

Definition at line 71 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [5/9]

CSG_Grids* SG_Create_Grids | ( | const CSG_Grids * | pGrids,
 |  | bool | bCopyData = false
 | ) |  |

Safe construction of a grid collection

Definition at line 79 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [6/9]

CSG_Grids* SG_Create_Grids | ( | const CSG_String & | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 89 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [7/9]

CSG_Grids* SG_Create_Grids | ( | const wchar_t * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 88 of file grids.cpp.

References SG_Create_Grids().

◆ SG_Create_Grids() [8/9]

CSG_Grids* SG_Create_Grids | ( | int | NX,
 |  | int | NY,
 |  | int | NZ = 0,
 |  | double | Cellsize = 0.,
 |  | double | xMin = 0.,
 |  | double | yMin = 0.,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Safe construction of a grid collection

Definition at line 113 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [9/9]

CSG_Grids* SG_Create_Grids ( void )

Safe construction of a grid collection

Definition at line 65 of file grids.cpp.

Referenced by CSG_Parameters_Grid_Target::Get_Grids(), and SG_Create_Grids().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grids.cpp Source File

  • saga_core
  • saga_api
grids.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grids.cpp //
15 // //
16 // Copyright (C) 2017 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // e-mail: oconrad@saga-gis.org //
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Germany //
48 // //
50
51 //---------------------------------------------------------
52 #include "saga_api.h"
53 #include "grids.h"
54 #include "data_manager.h"
55 #include "tool_library.h"
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 CSG_Grids * SG_Create_Grids(void)
66 {
67 return( new CSG_Grids );
68 }
69
70 //---------------------------------------------------------
71 CSG_Grids * SG_Create_Grids(const CSG_Grids &Grids)
72 {
73 CSG_Grids *pGrids = new CSG_Grids(Grids);
74
75 if( !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
76 }
77
78 //---------------------------------------------------------
79 CSG_Grids * SG_Create_Grids(const CSG_Grids *_pGrids, bool bCopyData)
80 {
81 CSG_Grids *pGrids = new CSG_Grids(_pGrids, bCopyData);
82
83 if( !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
84 }
85
86 //---------------------------------------------------------
87 CSG_Grids * SG_Create_Grids(const char *FileName, bool bLoadData) { return( SG_Create_Grids(CSG_String(FileName), bLoadData) ); }
88 CSG_Grids * SG_Create_Grids(const wchar_t *FileName, bool bLoadData) { return( SG_Create_Grids(CSG_String(FileName), bLoadData) ); }
89 CSG_Grids * SG_Create_Grids(const CSG_String &FileName, bool bLoadData)
90 {
91 CSG_Grids *pGrids = new CSG_Grids(FileName, bLoadData);
92
93 if( !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
94 }
95
96 //---------------------------------------------------------
97 CSG_Grids * SG_Create_Grids(const CSG_Grid_System &System, int NZ, double zMin, TSG_Data_Type Type)
98 {
99 CSG_Grids *pGrids = new CSG_Grids(System, NZ, zMin, Type);
100
101 if( !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
102 }
103
104 //---------------------------------------------------------
105 CSG_Grids * SG_Create_Grids(const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute, TSG_Data_Type Type, bool bCreateGrids)
106 {
107 CSG_Grids *pGrids = new CSG_Grids(System, Attributes, zAttribute, Type, bCreateGrids);
108
109 if( bCreateGrids && !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
110 }
111
112 //---------------------------------------------------------
113 CSG_Grids * SG_Create_Grids(int NX, int NY, int NZ, double Cellsize, double xMin, double yMin, double zMin, TSG_Data_Type Type)
114 {
115 CSG_Grids *pGrids = new CSG_Grids(NX, NY, NZ, Cellsize, xMin, yMin, zMin, Type);
116
117 if( !pGrids->is_Valid() ) { delete(pGrids); pGrids = NULL; } return( pGrids );
118 }
119
120
122 // //
123 // //
124 // //
126
127 //---------------------------------------------------------
131 //---------------------------------------------------------
132 CSG_Grids::CSG_Grids(void)
133 {
134 _On_Construction();
135 }
136
137 //---------------------------------------------------------
141 CSG_Grids::~CSG_Grids(void)
142 {
143 Destroy();
144
145 delete(m_pGrids[0]); // The Dummy
146 }
147
148 //---------------------------------------------------------
152 //---------------------------------------------------------
153 CSG_Grids::CSG_Grids(const CSG_Grids &Grids)
154 {
155 _On_Construction();
156
157 Create(Grids);
158 }
159
160 //---------------------------------------------------------
167 //---------------------------------------------------------
168 CSG_Grids::CSG_Grids(const CSG_Grids *pGrids, bool bCopyData)
169 {
170 _On_Construction();
171
172 Create(pGrids, bCopyData);
173 }
174
175 //---------------------------------------------------------
179 //---------------------------------------------------------
180 CSG_Grids::CSG_Grids(const char *FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
181 CSG_Grids::CSG_Grids(const wchar_t *FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
182 CSG_Grids::CSG_Grids(const CSG_String &FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
183
184 //---------------------------------------------------------
188 //---------------------------------------------------------
189 CSG_Grids::CSG_Grids(int NX, int NY, int NZ, double Cellsize, double xMin, double yMin, double zMin, TSG_Data_Type Type)
190 {
191 _On_Construction();
192
193 Create(NX, NY, NZ, Cellsize, xMin, yMin, zMin, Type);
194 }
195
196 //---------------------------------------------------------
200 //---------------------------------------------------------
201 CSG_Grids::CSG_Grids(const CSG_Grid_System &System, int NZ, double zMin, TSG_Data_Type Type)
202 {
203 _On_Construction();
204
205 Create(System, NZ, zMin, Type);
206 }
207
208 //---------------------------------------------------------
212 //---------------------------------------------------------
213 CSG_Grids::CSG_Grids(const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute, TSG_Data_Type Type, bool bCreateGrids)
214 {
215 _On_Construction();
216
217 Create(System, Attributes, zAttribute, Type, bCreateGrids);
218 }
219
220
222 // //
224
225 //---------------------------------------------------------
226 void CSG_Grids::_On_Construction(void)
227 {
228 m_pGrids = (CSG_Grid **)m_Grids.Create(1);
229 m_pGrids[0] = SG_Create_Grid(); // The Dummy
230 m_pGrids[0]->Set_Owner(this);
231
232 m_Attributes.Set_Owner(this);
233
234 m_Index = NULL;
235
236 Destroy();
237
238 Set_Update_Flag();
239 }
240
241 //---------------------------------------------------------
245 bool CSG_Grids::Destroy(void)
246 {
247 for(size_t i=1; i<m_Grids.Get_uSize(); i++)
248 {
249 delete(m_pGrids[i]); // do not delete the dummy before deconstruction
250 }
251
252 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(1);
253
254 m_pGrids[0]->Destroy(); // The Dummy
255
256 SG_FREE_SAFE(m_Index);
257
258 m_Attributes.Destroy();
259 m_Attributes.Add_Field("Z", SG_DATATYPE_Double);
260 m_Z_Attribute = m_Z_Name = 0;
261
262 return( CSG_Data_Object::Destroy() );
263 }
264
265
267 // //
269
270 //---------------------------------------------------------
271 bool CSG_Grids::Create(const CSG_Grids &Grids)
272 {
273 return( Create((CSG_Grids *)&Grids, true) );
274 }
275
276 //---------------------------------------------------------
277 bool CSG_Grids::Create(const CSG_Grids *pGrids, bool bCopyData)
278 {
279 if( pGrids && pGrids->is_Valid() && Create(pGrids->Get_System(), 0, 0., pGrids->Get_Type()) )
280 {
281 Set_NoData_Value_Range(pGrids->Get_NoData_Value(), pGrids->Get_NoData_Value(true));
282
283 m_Attributes.Create(&pGrids->m_Attributes);
284 Set_Z_Attribute (pGrids->Get_Z_Attribute ());
285 Set_Z_Name_Field(pGrids->Get_Z_Name_Field());
286
287 if( bCopyData )
288 {
289 for(int i=0; i<pGrids->Get_NZ(); i++)
290 {
291 Add_Grid(pGrids->Get_Attributes(i), pGrids->Get_Grid_Ptr(i));
292 }
293 }
294
295 Get_MetaData_DB().Del_Children();
296 Get_MetaData_DB().Add_Children(pGrids->Get_MetaData_DB());
297
298 Get_Projection().Create(pGrids->Get_Projection());
299
300 return( true );
301 }
302
303 return( false );
304 }
305
306 //---------------------------------------------------------
307 bool CSG_Grids::Create(const char *FileName, bool bLoadData) { return( Load(CSG_String(FileName), bLoadData) ); }
308 bool CSG_Grids::Create(const wchar_t *FileName, bool bLoadData) { return( Load(CSG_String(FileName), bLoadData) ); }
309 bool CSG_Grids::Create(const CSG_String &FileName, bool bLoadData) { return( Load( FileName , bLoadData) ); }
310
311 //---------------------------------------------------------
312 bool CSG_Grids::Create(const CSG_Grid_System &System, int NZ, double zMin, TSG_Data_Type Type)
313 {
314 Destroy();
315
316 if( m_pGrids[0]->Create(System, Type) )
317 {
318 Set_NoData_Value_Range(m_pGrids[0]->Get_NoData_Value(), m_pGrids[0]->Get_NoData_Value(true));
319
320 for(int i=0; i<NZ; i++, zMin+=System.Get_Cellsize())
321 {
322 if( !Add_Grid(zMin) )
323 {
324 return( false );
325 }
326 }
327
328 return( true );
329 }
330
331 return( false );
332 }
333
334 //---------------------------------------------------------
335 bool CSG_Grids::Create(const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute, TSG_Data_Type Type, bool bCreateGrids)
336 {
337 Destroy();
338
339 if( m_Attributes.Create(&Attributes) && m_pGrids[0]->Create(System, Type) )
340 {
341 Set_Z_Attribute(zAttribute);
342
343 if( bCreateGrids )
344 {
345 for(int i=0; i<Attributes.Get_Count(); i++)
346 {
347 if( !Add_Grid(Attributes[i]) )
348 {
349 return( false );
350 }
351 }
352 }
353
354 return( true );
355 }
356
357 return( false );
358 }
359
360 //---------------------------------------------------------
361 bool CSG_Grids::Create(int NX, int NY, int NZ, double Cellsize, double xMin, double yMin, double zMin, TSG_Data_Type Type)
362 {
363 return( Create(CSG_Grid_System(Cellsize, xMin, yMin, NX, NY), NZ, zMin, Type) );
364 }
365
366
368 // //
369 // Header //
370 // //
372
373 //---------------------------------------------------------
374 void CSG_Grids::Set_Unit(const CSG_String &Unit)
375 {
376 m_pGrids[0]->Set_Unit(Unit);
377 }
378
379 //---------------------------------------------------------
380 void CSG_Grids::Set_Scaling(double Scale, double Offset)
381 {
382 m_pGrids[0]->Set_Scaling(Scale, Offset);
383
384 for(int i=1; i<Get_Grid_Count(); i++)
385 {
386 m_pGrids[i]->Set_Scaling(Scale, Offset);
387 }
388
389 Set_Update_Flag();
390 }
391
392 //---------------------------------------------------------
393 bool CSG_Grids::Set_NoData_Value_Range(double loValue, double hiValue)
394 {
395 if( CSG_Data_Object::Set_NoData_Value_Range(loValue, hiValue) ) // this is a CSG_Data_Object base class property
396 {
397 m_pGrids[0]->Set_NoData_Value_Range(loValue, hiValue);
398
399 for(int i=1; i<Get_Grid_Count(); i++)
400 {
401 m_pGrids[i]->Set_NoData_Value_Range(loValue, hiValue);
402 }
403
404 return( true );
405 }
406
407 return( false );
408 }
409
410 //---------------------------------------------------------
411 void CSG_Grids::_Synchronize(CSG_Grid *pGrid)
412 {
413 if( !Get_Projection().is_Okay() && pGrid->Get_Projection().is_Okay() )
414 {
415 Get_Projection().Create(pGrid->Get_Projection());
416 }
417
418 pGrid->Set_Owner(this);
419
420 if( pGrid == m_pGrids[0] )
421 {
422 Set_Scaling(pGrid->Get_Scaling(), pGrid->Get_Offset());
423 Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_Value(true));
424 }
425 else // if( pGrid != m_pGrids[0] )
426 {
427 pGrid->Set_Scaling(Get_Scaling(), Get_Offset());
428 pGrid->Set_NoData_Value_Range(Get_NoData_Value(), Get_NoData_Value(true));
429 }
430 }
431
432
434 // //
435 // Checks //
436 // //
438
439 //---------------------------------------------------------
440 bool CSG_Grids::is_Valid(void) const
441 {
442 return( Get_System().is_Valid() );
443 }
444
445 //---------------------------------------------------------
446 bool CSG_Grids::is_Compatible(CSG_Grid *pGrid) const
447 {
448 return( pGrid && is_Compatible(pGrid->Get_System()) && Get_Type() == pGrid->Get_Type() );
449 }
450
451 bool CSG_Grids::is_Compatible(CSG_Grids *pGrids) const
452 {
453 return( pGrids && is_Compatible(pGrids->Get_System()) && Get_NZ() == pGrids->Get_NZ() );//&& Get_Type() == pGrids->Get_Type() );
454 }
455
456 bool CSG_Grids::is_Compatible(const CSG_Grid_System &System) const
457 {
458 return( Get_System() == System );
459 }
460
461 bool CSG_Grids::is_Compatible(int NX, int NY, double Cellsize, double xMin, double yMin) const
462 {
463 return( is_Compatible(CSG_Grid_System(Cellsize, xMin, yMin, NX, NY)) );
464 }
465
466
468 // //
469 // Attributes //
470 // //
472
473 //---------------------------------------------------------
474 bool CSG_Grids::Add_Attribute(const CSG_String &Name, TSG_Data_Type Type, int i)
475 {
476 return( m_Attributes.Add_Field(Name, Type, i) );
477 }
478
479 //---------------------------------------------------------
480 bool CSG_Grids::Del_Attribute(int i)
481 {
482 if( i != m_Z_Attribute && m_Attributes.Get_Field_Count() > 0 && m_Attributes.Del_Field(i) )
483 {
484 if( m_Z_Attribute > i )
485 {
486 m_Z_Attribute--;
487 }
488
489 if( m_Z_Name > i )
490 {
491 m_Z_Name--;
492 }
493 else if( m_Z_Name == i )
494 {
495 m_Z_Name = -1; // same as m_Z_Attribute
496 }
497
498 return( true );
499 }
500
501 return( false );
502 }
503
504 //---------------------------------------------------------
505 bool CSG_Grids::Set_Z_Attribute(int i)
506 {
507 if( i >= 0 && i < m_Attributes.Get_Field_Count() )
508 {
509 m_Z_Attribute = i;
510
511 return( Update_Z_Order() );
512 }
513
514 return( false );
515 }
516
517 //---------------------------------------------------------
518 bool CSG_Grids::Set_Z_Name_Field(int i)
519 {
520 if( i >= 0 && i < m_Attributes.Get_Field_Count() )
521 {
522 m_Z_Name = i;
523
524 return( true );
525 }
526
527 return( false );
528 }
529
530 int CSG_Grids::Get_Z_Name_Field(void) const
531 {
532 return( m_Z_Name >= 0 && m_Z_Name < m_Attributes.Get_Field_Count() ? m_Z_Name : m_Z_Attribute );
533 }
534
535 //---------------------------------------------------------
536 bool CSG_Grids::Set_Z(int i, double Value)
537 {
538 return( i >= 0 && i < Get_NZ() && m_Attributes[i].Set_Value(m_Z_Attribute, Value) );
539 }
540
541 //---------------------------------------------------------
542 bool CSG_Grids::Update_Z_Order(void)
543 {
544 bool bChanged = false;
545
546 CSG_Table Attributes(m_Attributes);
547
548 if( Attributes.Set_Index(m_Z_Attribute, TABLE_INDEX_Ascending) )
549 {
550 CSG_Array_Pointer Grids; CSG_Grid **pGrids = (CSG_Grid **)Grids.Create(m_Grids);
551
552 for(int i=0; i<Get_Grid_Count(); i++)
553 {
554 int Index = (int)Attributes[i].Get_Index();
555
556 if( Index != i )
557 {
558 bChanged = true;
559
560 m_pGrids[i] = pGrids[Index];
561
562 m_Attributes[i].Assign(&Attributes[i]);
563 }
564 }
565
566 for(int i=0; i<Get_Grid_Count(); i++)
567 {
568 pGrids[i]->Set_Name(Get_Grid_Name(i));
569 }
570 }
571
572 return( bChanged );
573 }
574
575
577 // //
578 // //
579 // //
581
582 //---------------------------------------------------------
583 bool CSG_Grids::Set_Grid_Count(int Count)
584 {
585 if( Count == Get_NZ() )
586 {
587 return( true );
588 }
589
590 if( Count < 0 || !Get_System().is_Valid() ) // only allowed for initialized grid systems)
591 {
592 return( false );
593 }
594
595 if( Count == 0 )
596 {
597 return( Del_Grids() );
598 }
599
600 //-----------------------------------------------------
601 SG_FREE_SAFE(m_Index); // invalidate index
602
603 if( Count < Get_NZ() )
604 {
605 for(int i=Count; i<Get_NZ(); i++)
606 {
607 delete(m_pGrids[i]);
608 }
609
610 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(Count);
611
612 m_Attributes.Set_Count(Count);
613 }
614
615 //-----------------------------------------------------
616 else if( Count > Get_NZ() )
617 {
618 double z = Get_ZMax();
619
620 for(int i=Get_NZ(); i<=Count; i++, z+=Get_Cellsize())
621 {
622 if( !Add_Grid(z) )
623 {
624 return( false );
625 }
626 }
627 }
628
629 return( true );
630 }
631
632
634 // //
636
637 //---------------------------------------------------------
638 bool CSG_Grids::Add_Grid(double Z)
639 {
640 CSG_Table Attributes(&m_Attributes);
641
642 Attributes.Add_Record();
643
644 Attributes[0].Set_Value(m_Z_Attribute, Z);
645
646 return( Add_Grid(Attributes[0]) );
647 }
648
649 //---------------------------------------------------------
650 bool CSG_Grids::Add_Grid(double Z, CSG_Grid *pGrid, bool bAttach)
651 {
652 CSG_Table Attributes(&m_Attributes);
653
654 Attributes.Add_Record();
655
656 Attributes[0].Set_Value(m_Z_Attribute, Z);
657
658 return( Add_Grid(Attributes[0], pGrid, bAttach) );
659 }
660
661 //---------------------------------------------------------
662 bool CSG_Grids::Add_Grid(CSG_Table_Record &Attributes)
663 {
664 if( !Get_System().is_Valid() ) // only allowed for initialized grid systems
665 {
666 return( false );
667 }
668
669 //-----------------------------------------------------
670 int n = Get_NZ();
671
672 if( n < 1 ) // do some initializations
673 {
674 _Synchronize(m_pGrids[0]);
675 }
676 else // use dummy grid (m_pGrids[0] is always present)
677 {
678 CSG_Grid *pGrid = SG_Create_Grid(Get_System(), Get_Type());
679
680 if( !pGrid )
681 {
682 return( false );
683 }
684
685 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(n + 1);
686 m_pGrids[n] = pGrid;
687
688 _Synchronize(pGrid);
689 }
690
691 //-----------------------------------------------------
692 m_Attributes.Add_Record(&Attributes);
693
694 SG_FREE_SAFE(m_Index); // invalidate index
695
696 Update_Z_Order();
697
698 return( true );
699 }
700
701 //---------------------------------------------------------
702 bool CSG_Grids::Add_Grid(CSG_Table_Record &Attributes, CSG_Grid *pGrid, bool bAttach)
703 {
704 if( !pGrid || !pGrid->is_Valid() )
705 {
706 return( false );
707 }
708
709 if( Get_NZ() > 0 && !is_Compatible(pGrid) ) // not allowed
710 {
711 return( false );
712 }
713
714 //-----------------------------------------------------
715 int n = Get_NZ();
716
717 if( n > 0 )
718 {
719 if( !bAttach && (pGrid = SG_Create_Grid(*pGrid)) == NULL ) // get a copy
720 {
721 return( false );
722 }
723
724 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(n + 1);
725 m_pGrids[n] = pGrid;
726 }
727 else if( bAttach ) // if( n == 0 )
728 {
729 delete(m_pGrids[0]);
730
731 m_pGrids[0] = pGrid; // simply replace dummy
732 }
733 else if( m_pGrids[0]->Create(*pGrid) ) // make dummy a copy of grid
734 {
735 pGrid = m_pGrids[0];
736 }
737 else
738 {
739 return( false );
740 }
741
742 _Synchronize(pGrid);
743
744 //-----------------------------------------------------
745 m_Attributes.Add_Record(&Attributes);
746
747 if( !Get_Projection().is_Okay() && pGrid->Get_Projection().is_Okay() )
748 {
749 Get_Projection() = pGrid->Get_Projection();
750 }
751
752 SG_FREE_SAFE(m_Index); // invalidate index
753
754 Update_Z_Order();
755
756 return( true );
757 }
758
759
761 // //
763
764 //---------------------------------------------------------
765 bool CSG_Grids::Del_Grid(int i, bool bDetach)
766 {
767 if( m_Attributes.Del_Record(i) ) // Get_NZ() is now decreased by one
768 {
769 SG_FREE_SAFE(m_Index); // invalidate index
770
771 if( Get_NZ() > 0 )
772 {
773 if( bDetach )
774 {
775 m_pGrids[i]->Set_Owner(NULL);
776 }
777 else
778 {
779 delete(m_pGrids[i]);
780 }
781
782 for( ; i<Get_NZ(); i++)
783 {
784 m_pGrids[i] = m_pGrids[i + 1];
785 }
786
787 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(Get_NZ());
788 }
789 else if( bDetach ) // if( Get_NZ() == 0 )
790 {
791 m_pGrids[0]->Set_Owner(NULL);
792 m_pGrids[0] = SG_Create_Grid(*m_pGrids[0]); // needs a new dummy
793 m_pGrids[0]->Set_Owner(this);
794 }
795
796 return( true );
797 }
798
799 return( false );
800 }
801
802 //---------------------------------------------------------
803 bool CSG_Grids::Del_Grids(bool bDetach)
804 {
805 SG_FREE_SAFE(m_Index); // invalidate index
806
807 if( bDetach )
808 {
809 for(size_t i=0; i<m_Grids.Get_uSize(); i++)
810 {
811 if( m_pGrids[i]->Get_Owner() == this )
812 {
813 m_pGrids[i]->Set_Owner(NULL);
814 }
815 }
816
817 m_pGrids[0] = SG_Create_Grid(*m_pGrids[0]); // needs a new dummy
818 m_pGrids[0]->Set_Owner(this);
819 }
820 else
821 {
822 for(size_t i=1; i<m_Grids.Get_uSize(); i++)
823 {
824 delete(m_pGrids[i]); // do not delete the dummy before deconstruction
825 }
826 }
827
828 m_pGrids = (CSG_Grid **)m_Grids.Get_Array(1);
829
830 m_Attributes.Del_Records();
831
832 return( true );
833 }
834
835
837 // //
839
840 //---------------------------------------------------------
841 CSG_String CSG_Grids::Get_Grid_Name(int i, int Style) const
842 {
843 CSG_String s;
844
845 if( i >= 0 && i < Get_Grid_Count() )
846 {
847 if( Style == 0 )
848 {
849 Style = SG_GRIDS_NAME_OWNER|SG_GRIDS_NAME_GRID;
850 }
851
852 if( (Style & SG_GRIDS_NAME_OWNER) != 0 )
853 {
854 s = CSG_String(Get_Name());
855 }
856
857 if( (Style & SG_GRIDS_NAME_INDEX) != 0 )
858 {
859 if( !s.is_Empty() ) s += ".";
860
861 s.Printf("%s %d", _TL("Band"), i + 1);
862 }
863
864 if( (Style & SG_GRIDS_NAME_VALUE) != 0 )
865 {
866 if( !s.is_Empty() ) s += ".";
867
868 s += SG_Get_String(Get_Z(i), -10);
869 }
870
871 if( (Style & SG_GRIDS_NAME_GRID ) != 0 )
872 {
873 if( !s.is_Empty() ) s += ".";
874
875 s += m_Attributes[i].asString(Get_Z_Name_Field());
876 }
877 }
878
879 return( s );
880 }
881
882
884 // //
885 // //
886 // //
888
889 //---------------------------------------------------------
890 void CSG_Grids::Assign_NoData(void)
891 {
892 for(int i=0; i<Get_Grid_Count(); i++)
893 {
894 m_pGrids[i]->Assign_NoData();
895 }
896 }
897
898 //---------------------------------------------------------
899 bool CSG_Grids::Assign(double Value)
900 {
901 for(int i=0; i<Get_Grid_Count(); i++)
902 {
903 m_pGrids[i]->Assign(Value);
904 }
905
906 return( true );
907 }
908
909 //---------------------------------------------------------
910 bool CSG_Grids::Assign(CSG_Data_Object *pObject)
911 {
912 if( pObject )
913 {
914 switch( pObject->Get_ObjectType() )
915 {
916 case SG_DATAOBJECT_TYPE_Grid:
917 {
918 bool bResult = true;
919
920 for(int i=0; i<Get_Grid_Count(); i++)
921 {
922 if( !m_pGrids[i]->Assign((CSG_Grid *)pObject) )
923 {
924 bResult = false;
925 }
926 }
927
928 return( bResult );
929 }
930
931 case SG_DATAOBJECT_TYPE_Grids:
932 return( Assign((CSG_Grids *)pObject) );
933
934 default:
935 break;
936 }
937 }
938
939 return( false );
940 }
941
942 //---------------------------------------------------------
943 bool CSG_Grids::Assign(CSG_Grids *pGrids, TSG_Grid_Resampling Interpolation)
944 {
945 if( pGrids && Get_Grid_Count() == pGrids->Get_Grid_Count() )
946 {
947 bool bResult = true;
948
949 for(int i=0; i<Get_Grid_Count(); i++)
950 {
951 if( !m_pGrids[i]->Assign(pGrids->m_pGrids[i], Interpolation) )
952 {
953 bResult = false;
954 }
955 }
956
957 return( bResult );
958 }
959
960 return( false );
961 }
962
963
965 // //
967
968 //---------------------------------------------------------
969 CSG_Grids & CSG_Grids::operator = (const CSG_Grids &Grids)
970 {
971 Create(Grids); return( *this );
972 }
973
974 CSG_Grids & CSG_Grids::operator = (double Value)
975 {
976 Assign(Value); return( *this );
977 }
978
979 //---------------------------------------------------------
980 CSG_Grids & CSG_Grids::operator += (double Value)
981 {
982 return( Add(Value) );
983 }
984
985 CSG_Grids & CSG_Grids::Add(double Value)
986 {
987 for(int i=0; i<Get_Grid_Count(); i++)
988 {
989 m_pGrids[i]->Add(Value);
990 }
991
992 return( *this );
993 }
994
995 //---------------------------------------------------------
996 CSG_Grids & CSG_Grids::operator -= (double Value)
997 {
998 return( Subtract(Value) );
999 }
1000
1001 CSG_Grids & CSG_Grids::Subtract(double Value)
1002 {
1003 for(int i=0; i<Get_Grid_Count(); i++)
1004 {
1005 m_pGrids[i]->Subtract(Value);
1006 }
1007
1008 return( *this );
1009 }
1010
1011 //---------------------------------------------------------
1012 CSG_Grids & CSG_Grids::operator *= (double Value)
1013 {
1014 return( Multiply(Value) );
1015 }
1016
1017 CSG_Grids & CSG_Grids::Multiply(double Value)
1018 {
1019 for(int i=0; i<Get_Grid_Count(); i++)
1020 {
1021 m_pGrids[i]->Multiply(Value);
1022 }
1023
1024 return( *this );
1025 }
1026
1027 //---------------------------------------------------------
1028 CSG_Grids & CSG_Grids::operator /= (double Value)
1029 {
1030 return( Divide(Value) );
1031 }
1032
1033 CSG_Grids & CSG_Grids::Divide(double Value)
1034 {
1035 for(int i=0; i<Get_Grid_Count(); i++)
1036 {
1037 m_pGrids[i]->Divide(Value);
1038 }
1039
1040 return( *this );
1041 }
1042
1043
1045 // //
1046 // Value access by Position (-> Interpolation) //
1047 // //
1049
1050 //---------------------------------------------------------
1051 double CSG_Grids::Get_Value(const TSG_Point_3D &p, TSG_Grid_Resampling Resampling, TSG_Grid_Resampling ZResampling) const
1052 {
1053 double Value;
1054
1055 return( Get_Value(p.x, p.y, p.z, Value, Resampling, ZResampling) ? Value : Get_NoData_Value() );
1056 }
1057
1058 double CSG_Grids::Get_Value(double x, double y, double z, TSG_Grid_Resampling Resampling, TSG_Grid_Resampling ZResampling) const
1059 {
1060 double Value;
1061
1062 return( Get_Value(x, y, z, Value, Resampling, ZResampling) ? Value : Get_NoData_Value() );
1063 }
1064
1065 bool CSG_Grids::Get_Value(const TSG_Point_3D &p, double &Value, TSG_Grid_Resampling Resampling, TSG_Grid_Resampling ZResampling) const
1066 {
1067 return( Get_Value(p.x, p.y, p.z, Value, Resampling, ZResampling) );
1068 }
1069
1070 //---------------------------------------------------------
1071 bool CSG_Grids::Get_Value(double x, double y, double z, double &Value, TSG_Grid_Resampling Resampling, TSG_Grid_Resampling ZResampling) const
1072 {
1073 if( !Get_System().Get_Extent(true).Contains(x, y) )
1074 {
1075 return( false );
1076 }
1077
1078 int iz; double dz;
1079
1080 if( !_Get_Z(z, iz, dz) )
1081 {
1082 return( false );
1083 }
1084
1085 if( dz == 0. )
1086 {
1087 return( m_pGrids[iz]->Get_Value(x, y, Value, Resampling) );
1088 }
1089
1090 if( ZResampling == GRID_RESAMPLING_Undefined )
1091 {
1092 ZResampling = Resampling;
1093 }
1094
1095 if( (ZResampling == GRID_RESAMPLING_BicubicSpline || ZResampling == GRID_RESAMPLING_BSpline)
1096 && (iz < 1 || iz >= m_Attributes.Get_Count() - 2) )
1097 {
1098 ZResampling = GRID_RESAMPLING_Bilinear;
1099 }
1100
1101 switch( ZResampling )
1102 {
1103 case GRID_RESAMPLING_NearestNeighbour: default:
1104 return( m_pGrids[dz < 0.5 ? iz : iz + 1]->Get_Value(x, y, Value, Resampling) );
1105
1106 case GRID_RESAMPLING_Bilinear:
1107 {
1108 double v[2];
1109
1110 if( m_pGrids[iz ]->Get_Value(x, y, v[0], Resampling)
1111 && m_pGrids[iz + 1]->Get_Value(x, y, v[1], Resampling) )
1112 {
1113 Value = v[0] + dz * (v[1] - v[0]);
1114
1115 return( true );
1116 }
1117
1118 return( false );
1119 }
1120
1121 case GRID_RESAMPLING_BicubicSpline:
1122 case GRID_RESAMPLING_BSpline:
1123 {
1124 CSG_Spline s;
1125
1126 #define ADD_TO_SPLINE(i) if( i < 0 || i >= Get_NZ() || !m_pGrids[i]->Get_Value(x, y, Value, Resampling) ) return( false ); s.Add(Get_Z(i), Value);
1127
1128 ADD_TO_SPLINE(iz - 1);
1129 ADD_TO_SPLINE(iz );
1130 ADD_TO_SPLINE(iz + 1);
1131 ADD_TO_SPLINE(iz + 2);
1132
1133 return( s.Get_Value(z, Value) );
1134 }
1135 break;
1136 }
1137
1138 return( false );
1139 }
1140
1141 //---------------------------------------------------------
1142 bool CSG_Grids::_Get_Z(double z, int &iz, double &dz) const
1143 {
1144 if( z < m_Attributes[0 ].asDouble(m_Z_Attribute)
1145 || z > m_Attributes[m_Attributes.Get_Count() - 1].asDouble(m_Z_Attribute) )
1146 {
1147 return( false );
1148 }
1149
1150 double z0, z1 = m_Attributes[0].asDouble(m_Z_Attribute);
1151
1152 for(iz=0; iz<m_Attributes.Get_Count()-1; iz++)
1153 {
1154 z0 = z1; z1 = m_Attributes[iz + 1].asDouble(m_Z_Attribute);
1155
1156 if( z < z1 )
1157 {
1158 dz = z0 < z1 ? (z - z0) / (z1 - z0) : 0.;
1159
1160 return( true );
1161 }
1162 }
1163
1164 return( (dz = z - z1) == 0. );
1165 }
1166
1167
1169 // //
1170 // Index //
1171 // //
1173
1174 //---------------------------------------------------------
1175 #define SORT_SWAP(a,b) {itemp=(a);(a)=(b);(b)=itemp;}
1176
1177 bool CSG_Grids::_Set_Index(void)
1178 {
1179 //-----------------------------------------------------
1180 if( m_Index == NULL && (m_Index = (sLong *)SG_Malloc((size_t)Get_NCells() * sizeof(sLong))) == NULL )
1181 {
1182 SG_UI_Msg_Add_Error(_TL("could not create index: insufficient memory"));
1183
1184 return( false );
1185 }
1186
1187 //-----------------------------------------------------
1188 const sLong M = 7;
1189
1190 sLong i, j, k, l, ir, n, *istack, jstack, nstack, indxt, itemp, nData;
1191 double a;
1192
1193 //-----------------------------------------------------
1194 SG_UI_Process_Set_Text(CSG_String::Format("%s: %s", _TL("Create index"), Get_Name()));
1195
1196 for(i=0, j=0, nData=Get_NCells(); i<Get_NCells(); i++)
1197 {
1198 if( is_NoData(i) )
1199 {
1200 m_Index[--nData] = i;
1201 }
1202 else // if( !is_NoData(i) )
1203 {
1204 m_Index[j++] = i;
1205 }
1206 }
1207
1208 //-----------------------------------------------------
1209 l = 0;
1210 n = 0;
1211 ir = nData - 1;
1212
1213 nstack = 64;
1214 istack = (sLong *)SG_Malloc((size_t)nstack * sizeof(sLong));
1215 jstack = 0;
1216
1217 for(;;)
1218 {
1219 if( ir - l < M )
1220 {
1221 if( !SG_UI_Process_Set_Progress((double)(n += M - 1), (double)nData) )
1222 {
1223 SG_FREE_SAFE(istack);
1224 SG_FREE_SAFE(m_Index);
1225
1226 SG_UI_Msg_Add_Error(_TL("index creation stopped by user"));
1227 SG_UI_Process_Set_Ready();
1228
1229 return( false );
1230 }
1231
1232 for(j=l+1; j<=ir; j++)
1233 {
1234 indxt = m_Index[j];
1235 a = asDouble(indxt);
1236
1237 for(i=j-1; i>=0; i--)
1238 {
1239 if( asDouble(m_Index[i]) <= a )
1240 {
1241 break;
1242 }
1243
1244 m_Index[i + 1] = m_Index[i];
1245 }
1246
1247 m_Index[i + 1] = indxt;
1248 }
1249
1250 if( jstack == 0 )
1251 {
1252 break;
1253 }
1254
1255 ir = istack[jstack--];
1256 l = istack[jstack--];
1257 }
1258
1259 //-------------------------------------------------
1260 else
1261 {
1262 k = (l + ir) >> 1;
1263
1264 SORT_SWAP(m_Index[k], m_Index[l + 1]);
1265
1266 if( asDouble( m_Index[l + 1]) > asDouble(m_Index[ir]) )
1267 SORT_SWAP(m_Index[l + 1], m_Index[ir]);
1268
1269 if( asDouble( m_Index[l ]) > asDouble(m_Index[ir]) )
1270 SORT_SWAP(m_Index[l ], m_Index[ir]);
1271
1272 if( asDouble( m_Index[l + 1]) > asDouble(m_Index[l ]) )
1273 SORT_SWAP(m_Index[l + 1], m_Index[l ]);
1274
1275 i = l + 1;
1276 j = ir;
1277 indxt = m_Index[l];
1278 a = asDouble(indxt);
1279
1280 for(;;)
1281 {
1282 do i++; while(asDouble(m_Index[i]) < a);
1283 do j--; while(asDouble(m_Index[j]) > a);
1284
1285 if( j < i )
1286 {
1287 break;
1288 }
1289
1290 SORT_SWAP(m_Index[i], m_Index[j]);
1291 }
1292
1293 m_Index[l] = m_Index[j];
1294 m_Index[j] = indxt;
1295 jstack += 2;
1296
1297 if( jstack >= nstack )
1298 {
1299 nstack += 64;
1300 istack = (sLong *)SG_Realloc(istack, (size_t)nstack * sizeof(int));
1301 }
1302
1303 if( ir - i + 1 >= j - l )
1304 {
1305 istack[jstack] = ir;
1306 istack[jstack - 1] = i;
1307 ir = j - 1;
1308 }
1309 else
1310 {
1311 istack[jstack] = j - 1;
1312 istack[jstack - 1] = l;
1313 l = i;
1314 }
1315 }
1316 }
1317
1318 //-----------------------------------------------------
1319 SG_Free(istack);
1320
1321 SG_UI_Process_Set_Ready();
1322
1323 return( true );
1324 }
1325 #undef SORT_SWAP
1326
1327
1329 // //
1330 // Statistics //
1331 // //
1333
1334 //---------------------------------------------------------
1335 bool CSG_Grids::On_Update(void)
1336 {
1337 if( is_Valid() )
1338 {
1339 SG_FREE_SAFE(m_Index);
1340
1341 m_Statistics.Invalidate();
1342 m_Histogram.Destroy();
1343
1344 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
1345
1346 if( Get_Max_Samples() > 0 && Get_Max_Samples() < Get_NCells() )
1347 {
1348 double d = (double)Get_NCells() / (double)Get_Max_Samples();
1349
1350 for(double i=0; i<(double)Get_NCells(); i+=d)
1351 {
1352 double Value = asDouble((sLong)i, false);
1353
1354 if( !is_NoData_Value(Value) )
1355 {
1356 m_Statistics += Scaling ? Offset + Scaling * Value : Value;
1357 }
1358 }
1359
1360 m_Statistics.Set_Count(m_Statistics.Get_Count() >= Get_Max_Samples() ? Get_NCells() // any no-data cells ?
1361 : (sLong)(Get_NCells() * (double)m_Statistics.Get_Count() / (double)Get_Max_Samples())
1362 );
1363 }
1364 else
1365 {
1366 for(sLong i=0; i<Get_NCells(); i++)
1367 {
1368 double Value = asDouble(i, false);
1369
1370 if( !is_NoData_Value(Value) )
1371 {
1372 m_Statistics += Scaling ? Offset + Scaling * Value : Value;
1373 }
1374 }
1375 }
1376 }
1377
1378 return( true );
1379 }
1380
1381 //---------------------------------------------------------
1382 double CSG_Grids::Get_Mean(void)
1383 {
1384 Update(); return( m_Statistics.Get_Mean() );
1385 }
1386
1387 double CSG_Grids::Get_Min(void)
1388 {
1389 Update(); return( m_Statistics.Get_Minimum() );
1390 }
1391
1392 double CSG_Grids::Get_Max(void)
1393 {
1394 Update(); return( m_Statistics.Get_Maximum() );
1395 }
1396
1397 double CSG_Grids::Get_Range(void)
1398 {
1399 Update(); return( m_Statistics.Get_Range() );
1400 }
1401
1402 double CSG_Grids::Get_StdDev(void)
1403 {
1404 Update(); return( m_Statistics.Get_StdDev() );
1405 }
1406
1407 double CSG_Grids::Get_Variance(void)
1408 {
1409 Update(); return( m_Statistics.Get_Variance() );
1410 }
1411
1412 //---------------------------------------------------------
1413 sLong CSG_Grids::Get_Data_Count(void)
1414 {
1415 Update(); return( m_Statistics.Get_Count() );
1416 }
1417
1418 sLong CSG_Grids::Get_NoData_Count(void)
1419 {
1420 Update(); return( Get_NCells() - m_Statistics.Get_Count() );
1421 }
1422
1423 //---------------------------------------------------------
1424 double CSG_Grids::Get_Quantile(double Quantile, bool bFromHistogram)
1425 {
1426 if( Quantile <= 0. ) { return( Get_Min() ); }
1427 if( Quantile >= 1. ) { return( Get_Max() ); }
1428
1429 if( bFromHistogram )
1430 {
1431 return( Get_Histogram().Get_Quantile(Quantile) );
1432 }
1433 else
1434 {
1435 sLong n = (sLong)(Quantile * (Get_Data_Count() - 1));
1436
1437 if( Get_Sorted(n, n, false) )
1438 {
1439 return( asDouble(n) );
1440 }
1441 }
1442
1443 return( Get_NoData_Value() );
1444 }
1445
1446 //---------------------------------------------------------
1447 double CSG_Grids::Get_Percentile(double Percentile, bool bFromHistogram)
1448 {
1449 return( Get_Quantile(0.01 * Percentile, bFromHistogram) );
1450 }
1451
1452
1454 // //
1456
1457 //---------------------------------------------------------
1464 const CSG_Simple_Statistics & CSG_Grids::Get_Statistics(void)
1465 {
1466 Update(); return( m_Statistics );
1467 }
1468
1469 //---------------------------------------------------------
1475 //---------------------------------------------------------
1476 bool CSG_Grids::Get_Statistics(const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues) const
1477 {
1478 int xMin = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMin()); if( xMin < 0 ) xMin = 0;
1479 int yMin = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMin()); if( yMin < 0 ) yMin = 0;
1480 int xMax = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMax()); if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
1481 int yMax = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMax()); if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
1482
1483 if( xMin > xMax || yMin > yMax )
1484 {
1485 return( false ); // no overlap
1486 }
1487
1488 Statistics.Create(bHoldValues);
1489
1490 int nx = 1 + (xMax - xMin);
1491 int ny = 1 + (yMax - yMin);
1492 sLong nCells = nx * ny;
1493
1494 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
1495
1496 if( Get_Max_Samples() > 0 && Get_Max_Samples() < nCells )
1497 {
1498 double d = (double)nCells / (double)Get_Max_Samples();
1499
1500 for(double i=0; i<(double)nCells; i+=d)
1501 {
1502 int y = yMin + (int)i / nx;
1503 int x = xMin + (int)i % nx;
1504
1505 for(int z=0; z<Get_NZ(); z++)
1506 {
1507 double Value = asDouble(x, y, z, false);
1508
1509 if( !is_NoData_Value(Value) )
1510 {
1511 Statistics += Scaling ? Offset + Scaling * Value : Value;
1512 }
1513 }
1514 }
1515 }
1516 else
1517 {
1518 for(int x=xMin; x<=xMax; x++)
1519 {
1520 for(int y=yMin; y<=yMax; y++)
1521 {
1522 for(int z=0; z<Get_NZ(); z++)
1523 {
1524 double Value = asDouble(x, y, z, false);
1525
1526 if( !is_NoData_Value(Value) )
1527 {
1528 Statistics += Scaling ? Offset + Scaling * Value : Value;
1529 }
1530 }
1531 }
1532 }
1533 }
1534
1535 return( Statistics.Get_Count() > 0 );
1536 }
1537
1538 //---------------------------------------------------------
1539 bool CSG_Grids::Set_Max_Samples(sLong Max_Samples)
1540 {
1541 if( CSG_Data_Object::Set_Max_Samples(Max_Samples) )
1542 {
1543 for(int i=0; i<Get_Grid_Count(); i++)
1544 {
1545 Get_Grid_Ptr(i)->Set_Max_Samples(Max_Samples);
1546 }
1547
1548 return( true );
1549 }
1550
1551 return( false );
1552 }
1553
1554 //---------------------------------------------------------
1555 #define SG_GRID_HISTOGRAM_CLASSES_DEFAULT 255
1556
1557 //---------------------------------------------------------
1562 const CSG_Histogram & CSG_Grids::Get_Histogram(size_t nClasses)
1563 {
1564 Update();
1565
1566 if( nClasses > 1 && nClasses != m_Histogram.Get_Class_Count() )
1567 {
1568 m_Histogram.Destroy();
1569 }
1570
1571 if( m_Histogram.Get_Statistics().Get_Count() < 1 )
1572 {
1573 m_Histogram.Create(nClasses > 1 ? nClasses : SG_GRID_HISTOGRAM_CLASSES_DEFAULT, Get_Min(), Get_Max(), this, (size_t)Get_Max_Samples());
1574 }
1575
1576 return( m_Histogram );
1577 }
1578
1579 //---------------------------------------------------------
1580 bool CSG_Grids::Get_Histogram(const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses) const
1581 {
1582 CSG_Simple_Statistics Statistics;
1583
1584 if( !Get_Statistics(rWorld, Statistics) )
1585 {
1586 return( false );
1587 }
1588
1589 int xMin = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMin()); if( xMin < 0 ) xMin = 0;
1590 int yMin = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMin()); if( yMin < 0 ) yMin = 0;
1591 int xMax = Get_System().Get_xWorld_to_Grid(rWorld.Get_XMax()); if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
1592 int yMax = Get_System().Get_yWorld_to_Grid(rWorld.Get_YMax()); if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
1593
1594 if( xMin > xMax || yMin > yMax )
1595 {
1596 return( false ); // no overlap
1597 }
1598
1599 Histogram.Create(nClasses > 1 ? nClasses : SG_GRID_HISTOGRAM_CLASSES_DEFAULT, Statistics.Get_Minimum(), Statistics.Get_Maximum());
1600
1601 int nx = 1 + (xMax - xMin);
1602 int ny = 1 + (yMax - yMin);
1603 sLong nCells = nx * ny;
1604
1605 double Offset = Get_Offset(), Scaling = is_Scaled() ? Get_Scaling() : 0.;
1606
1607 if( Get_Max_Samples() > 0 && Get_Max_Samples() < nCells )
1608 {
1609 double d = (double)nCells / (double)Get_Max_Samples();
1610
1611 for(double i=0; i<(double)nCells; i+=d)
1612 {
1613 int y = yMin + (int)i / nx;
1614 int x = xMin + (int)i % nx;
1615
1616 for(int z=0; z<Get_NZ(); z++)
1617 {
1618 double Value = asDouble(x, y, z, false);
1619
1620 if( !is_NoData_Value(Value) )
1621 {
1622 Histogram += Scaling ? Offset + Scaling * Value : Value;
1623 }
1624 }
1625 }
1626 }
1627 else
1628 {
1629 for(int x=xMin; x<=xMax; x++)
1630 {
1631 for(int y=yMin; y<=yMax; y++)
1632 {
1633 for(int z=0; z<Get_NZ(); z++)
1634 {
1635 double Value = asDouble(x, y, z, false);
1636
1637 if( !is_NoData_Value(Value) )
1638 {
1639 Histogram += Scaling ? Offset + Scaling * Value : Value;
1640 }
1641 }
1642 }
1643 }
1644 }
1645
1646 return( Histogram.Update() );
1647 }
1648
1649
1651 // //
1652 // //
1653 // //
1655
1656 //---------------------------------------------------------
1657 bool CSG_Grids::On_Reload(void)
1658 {
1659 return( Create(Get_File_Name(false)) );
1660 }
1661
1662 //---------------------------------------------------------
1663 bool CSG_Grids::On_Delete(void)
1664 {
1665 CSG_String FileName = Get_File_Name(true);
1666
1667 SG_File_Set_Extension(FileName, "sg-gds-z"); SG_File_Delete(FileName);
1668 SG_File_Set_Extension(FileName, "sg-gds" ); SG_File_Delete(FileName);
1669 SG_File_Set_Extension(FileName, "sg-info" ); SG_File_Delete(FileName);
1670 SG_File_Set_Extension(FileName, "sg-prj" ); SG_File_Delete(FileName);
1671
1672 int i = 0;
1673
1674 do
1675 {
1676 SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", ++i));
1677 }
1678 while( SG_File_Delete(FileName) );
1679
1680 return( true );
1681 }
1682
1683
1685 // //
1687
1688 //---------------------------------------------------------
1689 bool CSG_Grids::Load(const CSG_String &FileName, bool bLoadData)
1690 {
1691 Destroy();
1692
1693 SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Loading grid collection"), FileName.c_str()), true);
1694
1695 if( _Load_PGSQL (FileName)
1696 || _Load_Normal (FileName)
1697 || _Load_Compressed(FileName)
1698 || _Load_External (FileName) )
1699 {
1700 Set_Modified(false);
1701
1702 Set_Name(SG_File_Get_Name(FileName, false));
1703
1704 SG_UI_Process_Set_Ready();
1705 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
1706
1707 return( true );
1708 }
1709
1710 SG_UI_Process_Set_Ready();
1711 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
1712
1713 return( false );
1714 }
1715
1716 //---------------------------------------------------------
1717 bool CSG_Grids::Save(const CSG_String &FileName, int Format)
1718 {
1719 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid collection"), FileName.c_str()), true);
1720
1721 if( Format == GRIDS_FILE_FORMAT_Undefined )
1722 {
1723 Format = GRIDS_FILE_FORMAT_Compressed; // default
1724
1725 if( SG_File_Cmp_Extension(FileName, "sg-gds" ) ) Format = GRIDS_FILE_FORMAT_Normal ;
1726 if( SG_File_Cmp_Extension(FileName, "sg-gds-z") ) Format = GRIDS_FILE_FORMAT_Compressed;
1727 if( SG_File_Cmp_Extension(FileName, "tif" ) ) Format = GRIDS_FILE_FORMAT_GeoTIFF ;
1728 }
1729
1730 bool bResult = false;
1731
1732 switch( Format )
1733 {
1734 case GRIDS_FILE_FORMAT_Normal :
1735 bResult = _Save_Normal (FileName);
1736 break;
1737
1738 case GRIDS_FILE_FORMAT_Compressed: default:
1739 bResult = _Save_Compressed(FileName);
1740 break;
1741
1742 case GRIDS_FILE_FORMAT_GeoTIFF :
1743 SG_RUN_TOOL(bResult, "io_gdal", 2, // Export GeoTIFF
1744 SG_TOOL_PARAMLIST_ADD("GRIDS", this)
1745 && SG_TOOL_PARAMETER_SET("FILE" , FileName)
1746 );
1747 break;
1748 }
1749
1750 //-----------------------------------------------------
1751 SG_UI_Process_Set_Ready();
1752
1753 if( bResult )
1754 {
1755 Set_Modified(false);
1756
1757 Set_File_Name(FileName, true);
1758
1759 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
1760
1761 return( true );
1762 }
1763
1764 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
1765
1766 return( false );
1767 }
1768
1769
1771 // //
1773
1774 //---------------------------------------------------------
1775 bool CSG_Grids::_Load_External(const CSG_String &FileName)
1776 {
1777 bool bResult = false;
1778
1779 CSG_Data_Manager Data;
1780
1781 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 0); // import raster
1782
1783 SG_UI_Msg_Lock(true);
1784
1785 if( pTool && pTool->On_Before_Execution() && pTool->Settings_Push(&Data)
1786 && pTool->Set_Parameter("FILES" , FileName)
1787 && pTool->Set_Parameter("MULTIPLE", 1 ) // output as grid collection
1788 && pTool->Execute()
1789 && Data.Grid_System_Count() > 0 && Data.Get_Grid_System(0)->Count() > 0 && Data.Get_Grid_System(0)->Get(0)->is_Valid() )
1790 {
1791 CSG_Grids *pGrids = (CSG_Grids *)Data.Get_Grid_System(0)->Get(0);
1792
1793 m_Attributes.Create(&pGrids->m_Attributes);
1794
1795 for(int i=0; i<pGrids->Get_Grid_Count(); i++)
1796 {
1797 Add_Grid(pGrids->Get_Attributes(i), pGrids->Get_Grid_Ptr(i), true);
1798 }
1799
1800 Set_File_Name(FileName, false);
1801
1802 Set_Name (pGrids->Get_Name ());
1803 Set_Description (pGrids->Get_Description ());
1804 Set_Z_Attribute (pGrids->Get_Z_Attribute ());
1805 Set_Z_Name_Field(pGrids->Get_Z_Name_Field());
1806
1807 pGrids->Del_Grids(true);
1808
1809 bResult = true;
1810 }
1811
1812 SG_UI_Msg_Lock(false);
1813
1814 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
1815
1816 return( bResult );
1817 }
1818
1819 //---------------------------------------------------------
1820 bool CSG_Grids::_Load_PGSQL(const CSG_String &FileName)
1821 {
1822 bool bResult = false;
1823
1824 if( FileName.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
1825 {
1826 CSG_String s(FileName);
1827
1828 s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
1829 s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
1830 s = s.AfterFirst(':'); CSG_String DBName(s.BeforeFirst(':'));
1831 s = s.AfterFirst(':'); CSG_String Table (s.BeforeFirst(':'));
1832 s = s.AfterFirst(':'); CSG_String rid (s.BeforeFirst(':').AfterFirst('='));
1833
1834 //-------------------------------------------------
1835 CSG_String_Tokenizer rids(rid, ","); rid.Clear();
1836
1837 while( rids.Has_More_Tokens() )
1838 {
1839 if( !rid.is_Empty() )
1840 {
1841 rid += " OR ";
1842 }
1843
1844 rid += "rid=\'" + rids.Get_Next_Token() + "\'";
1845 }
1846
1847 //-------------------------------------------------
1848 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 0, true); // CGet_Connections
1849
1850 if( pTool != NULL )
1851 {
1852 SG_UI_ProgressAndMsg_Lock(true);
1853
1854 //---------------------------------------------
1855 CSG_Table Connections;
1856 CSG_String Connection = DBName + " [" + Host + ":" + Port + "]";
1857
1858 pTool->Set_Manager(NULL);
1859 pTool->On_Before_Execution();
1860
1861 if( SG_TOOL_PARAMETER_SET("CONNECTIONS", &Connections) && pTool->Execute() ) // CGet_Connections
1862 {
1863 for(int i=0; !bResult && i<Connections.Get_Count(); i++)
1864 {
1865 if( !Connection.Cmp(Connections[i].asString(0)) )
1866 {
1867 bResult = true;
1868 }
1869 }
1870 }
1871
1872 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
1873
1874 //---------------------------------------------
1875 if( bResult && (bResult = (pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 30, true)) != NULL) == true ) // CPGIS_Raster_Load
1876 {
1877 CSG_Data_Manager Grids;
1878
1879 pTool->On_Before_Execution();
1880 pTool->Settings_Push(&Grids);
1881
1882 bResult = SG_TOOL_PARAMETER_SET("CONNECTION", Connection)
1883 && SG_TOOL_PARAMETER_SET("TABLES" , Table)
1884 && SG_TOOL_PARAMETER_SET("MULTIPLE" , 1) // grid collection
1885 && SG_TOOL_PARAMETER_SET("WHERE" , rid)
1886 && pTool->Execute();
1887
1888 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
1889
1890 //-----------------------------------------
1891 if( Grids.Grid_System_Count() > 0 && Grids.Get_Grid_System(0)->Get(0) && Grids.Get_Grid_System(0)->Get(0)->is_Valid() )
1892 {
1893 CSG_Grids *pGrids = (CSG_Grids *)Grids.Get_Grid_System(0)->Get(0);
1894
1895 Set_File_Name(FileName);
1896
1897 Create(pGrids);
1898
1899 for(int i=0; i<pGrids->Get_Grid_Count(); i++)
1900 {
1901 Add_Grid(pGrids->Get_Attributes(i), pGrids->Get_Grid_Ptr(i), true);
1902 }
1903
1904 pGrids->Del_Grids(true);
1905 }
1906 }
1907
1908 SG_UI_ProgressAndMsg_Lock(false);
1909 }
1910 }
1911
1912 return( Get_NZ() > 0 );
1913 }
1914
1915
1917 // //
1919
1920 //---------------------------------------------------------
1921 bool CSG_Grids::_Load_Normal(const CSG_String &_FileName)
1922 {
1923 if( !SG_File_Cmp_Extension(_FileName, "sg-gds") ) // GRIDS_FILETYPE_Normal
1924 {
1925 return( false );
1926 }
1927
1928 CSG_String FileName(_FileName);
1929
1930 CSG_File Stream;
1931
1932 //-----------------------------------------------------
1933 if( !Stream.Open(FileName, SG_FILE_R, false) || !_Load_Header(Stream) )
1934 {
1935 return( false );
1936 }
1937
1938 SG_File_Set_Extension(FileName, "sg-att");
1939
1940 if( m_Attributes.Get_Count() <= 0 ) // <<< DEPRECATED
1941 if( !Stream.Open(FileName, SG_FILE_R, false) || !_Load_Attributes(Stream) )
1942 {
1943 return( false );
1944 }
1945
1946 //-----------------------------------------------------
1947 for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
1948 {
1949 SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", i + 1));
1950
1951 if( !Stream.Open(FileName, SG_FILE_R, true) || !_Load_Data(Stream, m_pGrids[i]) )
1952 {
1953 return( false );
1954 }
1955 }
1956
1957 //-----------------------------------------------------
1958 Set_File_Name(_FileName, true);
1959
1960 Load_MetaData(FileName);
1961
1962 Get_Projection().Load(SG_File_Make_Path("", FileName, "sg-prj"), SG_PROJ_FMT_WKT);
1963
1964 return( true );
1965 }
1966
1967 //---------------------------------------------------------
1968 bool CSG_Grids::_Save_Normal(const CSG_String &_FileName)
1969 {
1970 CSG_String FileName(_FileName);
1971
1972 CSG_File Stream;
1973
1974 //-----------------------------------------------------
1975 SG_File_Set_Extension(FileName, "sg-gds");
1976
1977 if( !Stream.Open(FileName, SG_FILE_W, false) || !_Save_Header(Stream) )
1978 {
1979 return( false );
1980 }
1981
1982 SG_File_Set_Extension(FileName, "sg-att");
1983
1984 if( !Stream.Open(FileName, SG_FILE_W, false) || !_Save_Attributes(Stream) )
1985 {
1986 return( false );
1987 }
1988
1989 //-----------------------------------------------------
1990 for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
1991 {
1992 SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", i + 1));
1993
1994 if( !Stream.Open(FileName, SG_FILE_W, true) || !_Save_Data(Stream, m_pGrids[i]) )
1995 {
1996 return( false );
1997 }
1998 }
1999
2000 //-----------------------------------------------------
2001 Save_MetaData(FileName);
2002
2003 Get_Projection().Save(SG_File_Make_Path("", FileName, "sg-prj"), SG_PROJ_FMT_WKT);
2004
2005 return( true );
2006 }
2007
2008
2010 // //
2012
2013 //---------------------------------------------------------
2014 bool CSG_Grids::_Load_Compressed(const CSG_String &_FileName)
2015 {
2016 if( !SG_File_Cmp_Extension(_FileName, "sg-gds-z") ) // GRIDS_FILETYPE_Compressed
2017 {
2018 return( false );
2019 }
2020
2021 CSG_File_Zip Stream(_FileName, SG_FILE_R);
2022
2023 CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
2024
2025 //-----------------------------------------------------
2026 if( !Stream.Get_File(FileName + "sg-gds") || !_Load_Header(Stream) )
2027 {
2028 return( false );
2029 }
2030
2031 if( m_Attributes.Get_Count() <= 0 ) // <<< DEPRECATED
2032 if( !Stream.Get_File(FileName + "sg-att") || !_Load_Attributes(Stream) )
2033 {
2034 return( false );
2035 }
2036
2037 //-----------------------------------------------------
2038 for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
2039 {
2040 if( !Stream.Get_File(FileName + CSG_String::Format("sg-%03d", i + 1)) || !_Load_Data(Stream, m_pGrids[i]) )
2041 {
2042 return( false );
2043 }
2044 }
2045
2046 //-----------------------------------------------------
2047 Set_File_Name(_FileName, true);
2048
2049 if( Stream.Get_File(FileName + "sg-info") )
2050 {
2051 Load_MetaData(Stream);
2052 }
2053
2054 if( Stream.Get_File(FileName + "sg-prj") )
2055 {
2056 Get_Projection().Load(Stream, SG_PROJ_FMT_WKT);
2057 }
2058
2059 return( true );
2060 }
2061
2062 //---------------------------------------------------------
2063 bool CSG_Grids::_Save_Compressed(const CSG_String &_FileName)
2064 {
2065 CSG_File_Zip Stream(_FileName, SG_FILE_W);
2066
2067 CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
2068
2069 //-----------------------------------------------------
2070 if( !Stream.Add_File(FileName + "sg-gds") || !_Save_Header(Stream) )
2071 {
2072 return( false );
2073 }
2074
2075 if( !Stream.Add_File(FileName + "sg-att") || !_Save_Attributes(Stream) )
2076 {
2077 return( false );
2078 }
2079
2080 //-----------------------------------------------------
2081 for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
2082 {
2083 if( !Stream.Add_File(FileName + CSG_String::Format("sg-%03d", i + 1)) || !_Save_Data(Stream, m_pGrids[i]) )
2084 {
2085 return( false );
2086 }
2087 }
2088
2089 //-----------------------------------------------------
2090 if( Stream.Add_File(FileName + "sg-info") )
2091 {
2092 Save_MetaData(Stream);
2093 }
2094
2095 if( Stream.Add_File(FileName + "sg-prj") )
2096 {
2097 Get_Projection().Save(Stream, SG_PROJ_FMT_WKT);
2098 }
2099
2100 return( true );
2101 }
2102
2103
2105 // //
2107
2108 //---------------------------------------------------------
2109 bool CSG_Grids::_Load_Header(CSG_File &Stream)
2110 {
2111 CSG_MetaData Header;
2112
2113 if( !Header.Load(Stream) )
2114 {
2115 return( false );
2116 }
2117
2118 //-----------------------------------------------------
2119 if( !Header("NX") || !Header("NY") || !Header("XMIN") || !Header("YMIN") || !Header("CELLSIZE") || !Header("TYPE") ) // necessary minimum information !!!
2120 {
2121 return( false );
2122 }
2123
2124 CSG_Grid_System System(Header["CELLSIZE"].Get_Content().asDouble(),
2125 Header["XMIN"].Get_Content().asDouble(), Header["YMIN"].Get_Content().asDouble(),
2126 Header["NX" ].Get_Content().asInt (), Header["NY" ].Get_Content().asInt ()
2127 );
2128
2129 TSG_Data_Type Type = SG_Data_Type_Get_Type(Header["TYPE"].Get_Content());
2130
2131 if( !System.is_Valid() || Type == SG_DATATYPE_Undefined || !m_pGrids[0]->Create(System, Type) )
2132 {
2133 return( false );
2134 }
2135
2136 //-----------------------------------------------------
2137 if( Header("NAME" ) ) Set_Name (Header["NAME" ].Get_Content());
2138 if( Header("DESCRIPTION") ) Set_Description(Header["DESCRIPTION"].Get_Content());
2139 if( Header("UNIT" ) ) Set_Unit (Header["UNIT" ].Get_Content());
2140
2141 Set_Scaling(
2142 Header("SCALE" ) ? Header["SCALE" ].Get_Content().asDouble() : 1.,
2143 Header("OFFSET") ? Header["OFFSET"].Get_Content().asDouble() : 0.
2144 );
2145
2146 if( Header("NODATA_MIN") )
2147 {
2148 if( Header("NODATA_MAX") )
2149 {
2150 Set_NoData_Value_Range(
2151 Header["NODATA_MIN"].Get_Content().asDouble(),
2152 Header["NODATA_MAX"].Get_Content().asDouble()
2153 );
2154 }
2155 else
2156 {
2157 Set_NoData_Value(
2158 Header["NODATA_MIN"].Get_Content().asDouble()
2159 );
2160 }
2161 }
2162
2163 //-----------------------------------------------------
2164 m_Attributes.Destroy();
2165
2166 if( Header("ATTRIBUTES") && Header["ATTRIBUTES"]("FIELDS") == NULL )
2167 {
2168 const CSG_MetaData &Fields = Header["ATTRIBUTES"];
2169
2170 for(int iField=0; iField<Fields.Get_Children_Count(); iField++)
2171 {
2172 if( Fields[iField].Cmp_Name("FIELD") && Fields[iField].Get_Property("TYPE") )
2173 {
2174 m_Attributes.Add_Field(Fields[iField].Get_Content(), SG_Data_Type_Get_Type(Fields[iField].Get_Property("TYPE")));
2175 }
2176 }
2177
2178 if( !Fields.Get_Property("Z_FIELD", m_Z_Attribute) || m_Z_Attribute >= m_Attributes.Get_Field_Count() )
2179 {
2180 m_Z_Attribute = 0;
2181 }
2182
2183 if( !Fields.Get_Property("Z_NAME", m_Z_Name ) || m_Z_Name >= m_Attributes.Get_Field_Count() )
2184 {
2185 m_Z_Name = -1; // same as m_Z_Attribute
2186 }
2187 }
2188
2189 //-----------------------------------------------------
2190 // >>> DEPRECATED >>> //
2191 if( Header("ATTRIBUTES") && Header["ATTRIBUTES"]("FIELDS") != NULL )
2192 {
2193 if( !Header["ATTRIBUTES"].Get_Property("ZATTRIBUTE", m_Z_Attribute) )
2194 {
2195 m_Z_Attribute = 0;
2196 }
2197
2198 int iField;
2199
2200 const CSG_MetaData &Fields = Header["ATTRIBUTES"]["FIELDS"];
2201
2202 for(iField=0; iField<Fields.Get_Children_Count(); iField++)
2203 {
2204 if( Fields[iField].Cmp_Name("FIELD") && Fields[iField].Get_Property("TYPE") )
2205 {
2206 m_Attributes.Add_Field(Fields[iField].Get_Content(), SG_Data_Type_Get_Type(Fields[iField].Get_Property("TYPE")));
2207 }
2208 }
2209
2210 if( m_Attributes.Get_Field_Count() > 0 && Header["ATTRIBUTES"]("RECORDS") )
2211 {
2212 CSG_Table Attributes(m_Attributes);
2213
2214 const CSG_MetaData &Records = Header["ATTRIBUTES"]["RECORDS"];
2215
2216 for(int iRecord=0; iRecord<Records.Get_Children_Count(); iRecord++)
2217 {
2218 if( Records[iRecord].Cmp_Name("RECORD") )
2219 {
2220 CSG_String_Tokenizer Values(Records[iRecord].Get_Content(), ";");
2221
2222 if( Values.Get_Tokens_Count() == (size_t)Attributes.Get_Field_Count() )
2223 {
2224 CSG_Table_Record *pRecord = Attributes.Add_Record();
2225
2226 for(int iField=0; iField<m_Attributes.Get_Field_Count(); iField++)
2227 {
2228 pRecord->Set_Value(iField, Values.Get_Next_Token());
2229 }
2230
2231 if( !Add_Grid(*pRecord) )
2232 {
2233 return( false );
2234 }
2235 }
2236 }
2237 }
2238 }
2239 }
2240 else if( Header("NZ") && Header["NZ"].Get_Content().asInt() > 0 )
2241 {
2242 m_Attributes.Add_Field("ID", SG_DATATYPE_Int);
2243
2244 for(int i=0, n=Header["NZ"].Get_Content().asInt(); i<n; i++)
2245 {
2246 if( !Add_Grid(i + 1.) )
2247 {
2248 return( false );
2249 }
2250 }
2251 }
2252 // <<< DEPRECATED <<< //
2253
2254 //-----------------------------------------------------
2255 return( m_Attributes.Get_Field_Count() > 0 );
2256 }
2257
2258 //---------------------------------------------------------
2259 bool CSG_Grids::_Save_Header(CSG_File &Stream)
2260 {
2261 CSG_MetaData Header;
2262
2263 Header.Set_Name("GRIDS");
2264
2265 Header.Add_Property("saga-version", SAGA_VERSION);
2266
2267 //-----------------------------------------------------
2268 // general
2269
2270 Header.Add_Child("NAME" , Get_Name ());
2271 Header.Add_Child("DESCRIPTION", Get_Description());
2272 Header.Add_Child("UNIT" , Get_Unit ());
2273
2274 Header.Add_Child("SCALE" , Get_Scaling ());
2275 Header.Add_Child("OFFSET" , Get_Offset ());
2276
2277 Header.Add_Child("NODATA_MIN" , Get_NoData_Value(false));
2278 Header.Add_Child("NODATA_MAX" , Get_NoData_Value(true ));
2279
2280 Header.Add_Child("TYPE" , SG_Data_Type_Get_Identifier(Get_Type()));
2281
2282 //-----------------------------------------------------
2283 // grid system
2284
2285 Header.Add_Child("NX" , Get_NX ());
2286 Header.Add_Child("NY" , Get_NY ());
2287 Header.Add_Child("CELLSIZE" , Get_Cellsize());
2288 Header.Add_Child("XMIN" , Get_XMin ());
2289 Header.Add_Child("YMIN" , Get_YMin ());
2290
2291 //-----------------------------------------------------
2292 // attributes
2293
2294 CSG_MetaData &Attributes = *Header.Add_Child("ATTRIBUTES");
2295
2296 Attributes.Add_Property("Z_FIELD", m_Z_Attribute);
2297 Attributes.Add_Property("Z_NAME" , m_Z_Name );
2298
2299 for(int iField=0; iField<m_Attributes.Get_Field_Count(); iField++)
2300 {
2301 Attributes.Add_Child("FIELD", m_Attributes.Get_Field_Name(iField))->Add_Property(
2302 "TYPE", SG_Data_Type_Get_Identifier(m_Attributes.Get_Field_Type(iField))
2303 );
2304 }
2305
2306 //-----------------------------------------------------
2307 return( Header.Save(Stream) );
2308 }
2309
2310
2312 // //
2314
2315 //---------------------------------------------------------
2316 bool CSG_Grids::_Load_Attributes(CSG_File &Stream)
2317 {
2318 CSG_Table Attributes(m_Attributes);
2319
2320 CSG_String sLine;
2321
2322 while( Stream.Read_Line(sLine) && !sLine.is_Empty() )
2323 {
2324 CSG_String_Tokenizer Values(sLine, "\t", SG_TOKEN_RET_EMPTY_ALL);
2325
2326 if( Values.Get_Tokens_Count() == (size_t)Attributes.Get_Field_Count() )
2327 {
2328 CSG_Table_Record *pRecord = Attributes.Add_Record();
2329
2330 for(int iField=0; iField<m_Attributes.Get_Field_Count(); iField++)
2331 {
2332 pRecord->Set_Value(iField, Values.Get_Next_Token());
2333 }
2334
2335 if( !Add_Grid(*pRecord) )
2336 {
2337 return( false );
2338 }
2339 }
2340 }
2341
2342 return( true );
2343 }
2344
2345 //---------------------------------------------------------
2346 bool CSG_Grids::_Save_Attributes(CSG_File &Stream)
2347 {
2348 for(int iRecord=0; iRecord<m_Attributes.Get_Count(); iRecord++)
2349 {
2350 for(int iField=0; iField<m_Attributes.Get_Field_Count(); iField++)
2351 {
2352 Stream.Write(m_Attributes[iRecord].asString(iField));
2353 Stream.Write(iField < m_Attributes.Get_Field_Count() - 1 ? "\t" : "\n");
2354 }
2355 }
2356
2357 return( true );
2358 }
2359
2360
2362 // //
2364
2365 //---------------------------------------------------------
2366 bool CSG_Grids::_Load_Data(CSG_File &Stream, CSG_Grid *pGrid)
2367 {
2368 if( !pGrid )
2369 {
2370 return( false );
2371 }
2372
2373 TSG_Data_Type Type = Get_Type();
2374
2375 CSG_Array Line(1, Get_nLineBytes());
2376
2377 for(int y=0; y<Get_NY(); y++)
2378 {
2379 if( !Stream.Read(Line.Get_Array(), Get_nLineBytes()) )
2380 {
2381 return( false );
2382 }
2383
2384 char *pValue = (char *)Line.Get_Array();
2385
2386 for(int x=0, n=Get_nValueBytes(); x<Get_NX(); x++, pValue+=n)
2387 {
2388 switch( Type )
2389 {
2390 case SG_DATATYPE_Byte : pGrid->Set_Value(x, y, *(BYTE *)pValue, false); break;
2391 case SG_DATATYPE_Char : pGrid->Set_Value(x, y, *(char *)pValue, false); break;
2392 case SG_DATATYPE_Word : pGrid->Set_Value(x, y, *(WORD *)pValue, false); break;
2393 case SG_DATATYPE_Short : pGrid->Set_Value(x, y, *(short *)pValue, false); break;
2394 case SG_DATATYPE_DWord : pGrid->Set_Value(x, y, *(DWORD *)pValue, false); break;
2395 case SG_DATATYPE_Int : pGrid->Set_Value(x, y, *(int *)pValue, false); break;
2396 case SG_DATATYPE_Float : pGrid->Set_Value(x, y, *(float *)pValue, false); break;
2397 case SG_DATATYPE_Double: pGrid->Set_Value(x, y, *(double *)pValue, false); break;
2398 default: break;
2399 }
2400 }
2401 }
2402
2403 return( true );
2404 }
2405
2406 //---------------------------------------------------------
2407 bool CSG_Grids::_Save_Data(CSG_File &Stream, CSG_Grid *pGrid)
2408 {
2409 TSG_Data_Type Type = Get_Type();
2410
2411 CSG_Array Line(1, Get_nLineBytes());
2412
2413 for(int y=0; y<Get_NY(); y++)
2414 {
2415 char *pValue = (char *)Line.Get_Array();
2416
2417 for(int x=0, n=Get_nValueBytes(); x<Get_NX(); x++, pValue+=n)
2418 {
2419 switch( Type )
2420 {
2421 case SG_DATATYPE_Byte : *(BYTE *)pValue = pGrid->asByte (x, y, false); break;
2422 case SG_DATATYPE_Char : *(char *)pValue = pGrid->asChar (x, y, false); break;
2423 case SG_DATATYPE_Word : *(WORD *)pValue = pGrid->asShort (x, y, false); break;
2424 case SG_DATATYPE_Short : *(short *)pValue = pGrid->asShort (x, y, false); break;
2425 case SG_DATATYPE_DWord : *(DWORD *)pValue = pGrid->asInt (x, y, false); break;
2426 case SG_DATATYPE_Int : *(int *)pValue = pGrid->asInt (x, y, false); break;
2427 case SG_DATATYPE_Float : *(float *)pValue = pGrid->asFloat (x, y, false); break;
2428 case SG_DATATYPE_Double: *(double *)pValue = pGrid->asDouble(x, y, false); break;
2429 default: break;
2430 }
2431 }
2432
2433 if( !Stream.Write(Line.Get_Array(), Get_nLineBytes()) )
2434 {
2435 return( false );
2436 }
2437 }
2438
2439 return( true );
2440 }
2441
2442
2444 // //
2446
2447 //-----------------------------------------------------
2448 bool CSG_Grids::_Assign_Interpolated (CSG_Grids *pSource, TSG_Grid_Resampling Interpolation) { return( false ); }
2449 bool CSG_Grids::_Assign_MeanValue (CSG_Grids *pSource, bool bVolumeProportional ) { return( false ); }
2450 bool CSG_Grids::_Assign_ExtremeValue (CSG_Grids *pSource, bool bMaximum ) { return( false ); }
2451 bool CSG_Grids::_Assign_Majority (CSG_Grids *pSource ) { return( false ); }
2452
2453
2455 // //
2457
2458 //-----------------------------------------------------
2459 CSG_Grids & CSG_Grids::_Operation_Arithmetic(const CSG_Grids &Grids, TSG_Grid_Operation Operation) { return( *this ); }
2460 CSG_Grids & CSG_Grids::_Operation_Arithmetic(double Value , TSG_Grid_Operation Operation) { return( *this ); }
2461
2462
2464 // //
2465 // //
2466 // //
2468
2469 //---------------------------------------------------------
CSG_Grids::Set_Unit
void Set_Unit(const CSG_String &Unit)
Definition: grids.cpp:374
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Rect
Definition: geo_tools.h:471
CSG_Grids::Subtract
virtual CSG_Grids & Subtract(double Value)
Definition: grids.cpp:1001
GRIDS_FILE_FORMAT_Normal
@ GRIDS_FILE_FORMAT_Normal
Definition: grids.h:93
CSG_Grids::Get_NY
int Get_NY(void) const
Definition: grids.h:186
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
CSG_Grids::Multiply
virtual CSG_Grids & Multiply(double Value)
Definition: grids.cpp:1017
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_Grids::CSG_Grids
CSG_Grids(void)
Definition: grids.cpp:132
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_Data_Object::Get_Max_Samples
sLong Get_Max_Samples(void) const
Definition: dataobject.h:254
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Grids::Set_Z
bool Set_Z(int i, double Value)
Definition: grids.cpp:536
GRID_RESAMPLING_NearestNeighbour
@ GRID_RESAMPLING_NearestNeighbour
Definition: grid.h:157
CSG_Grids::asInt
virtual int asInt(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:379
CSG_Grids::Get_Data_Count
sLong Get_Data_Count(void)
Definition: grids.cpp:1413
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
CSG_Table::Set_Count
virtual bool Set_Count(sLong nRecords)
Definition: table.cpp:930
CSG_Histogram::Update
bool Update(void)
Definition: mat_tools.cpp:1363
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Grids::Get_Sorted
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
Definition: grids.h:438
CSG_Grids::Get_Offset
double Get_Offset(void) const
Definition: grids.h:259
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:96
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
CSG_Grids::Del_Attribute
bool Del_Attribute(int iField)
Definition: grids.cpp:480
CSG_Grids::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grids.h:410
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_Grids::~CSG_Grids
virtual ~CSG_Grids(void)
Definition: grids.cpp:141
CSG_Grids::operator=
virtual CSG_Grids & operator=(const CSG_Grids &Grids)
Definition: grids.cpp:969
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
GRID_RESAMPLING_BicubicSpline
@ GRID_RESAMPLING_BicubicSpline
Definition: grid.h:159
SG_TOKEN_RET_EMPTY_ALL
@ SG_TOKEN_RET_EMPTY_ALL
Definition: api_core.h:746
CSG_Table_Record
Definition: table.h:130
CSG_Grids::Assign
virtual bool Assign(double Value=0.)
Definition: grids.cpp:899
CSG_Grids::Get_Scaling
double Get_Scaling(void) const
Definition: grids.h:258
CSG_Simple_Statistics::Get_Variance
double Get_Variance(void)
Definition: mat_tools.h:737
data_manager.h
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Grids::Get_Attributes
const CSG_Table & Get_Attributes(void) const
Definition: grids.h:216
CSG_Grids::Get_Range
double Get_Range(void)
Definition: grids.cpp:1397
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CSG_Grid_System
Definition: grid.h:200
CSG_Table::Del_Field
virtual bool Del_Field(int iField)
Definition: table.cpp:526
TSG_Grid_Resampling
TSG_Grid_Resampling
Definition: grid.h:156
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Histogram
Definition: mat_tools.h:986
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Grids::Get_Grid_Name
CSG_String Get_Grid_Name(int i, int Style=0) const
Definition: grids.cpp:841
CSG_Grids::On_Update
virtual bool On_Update(void)
Definition: grids.cpp:1335
CSG_Grids::Get_Grid_Count
int Get_Grid_Count(void) const
Definition: grids.h:237
CSG_Grids::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: grids.cpp:1717
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
CSG_Grid_System::Get_yWorld_to_Grid
int Get_yWorld_to_Grid(double yWorld) const
Definition: grid.h:291
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
GRID_RESAMPLING_Undefined
@ GRID_RESAMPLING_Undefined
Definition: grid.h:168
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Grids::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grids.h:183
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
saga_api.h
CSG_Tool
Definition: tool.h:149
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Grids::On_Delete
virtual bool On_Delete(void)
Definition: grids.cpp:1663
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Histogram::Create
bool Create(const CSG_Histogram &Histogram)
Definition: mat_tools.cpp:1495
CSG_Grids::Get_NCells
sLong Get_NCells(void) const
Definition: grids.h:188
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Grids::is_Valid
virtual bool is_Valid(void) const
Definition: grids.cpp:440
CSG_Grids::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grids.h:169
SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:257
CSG_Grids::Get_Z_Attribute
int Get_Z_Attribute(void) const
Definition: grids.h:222
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Grids::is_Scaled
bool is_Scaled(void) const
Definition: grids.h:260
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Get_ObjectType
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.
CSG_Data_Object::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:558
CSG_Grids::Get_Percentile
double Get_Percentile(double Percentile, bool bFromHistogram=true)
Definition: grids.cpp:1447
CSG_Grids::operator/=
virtual CSG_Grids & operator/=(double Value)
Definition: grids.cpp:1028
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_Grids::operator+=
virtual CSG_Grids & operator+=(double Value)
Definition: grids.cpp:980
CSG_Data_Manager::Get_Grid_System
CSG_Grid_Collection * Get_Grid_System(size_t i) const
Definition: data_manager.h:175
CSG_Array_Pointer::Create
void ** Create(const CSG_Array_Pointer &Array)
Definition: api_memory.cpp:469
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Grids::Set_Z_Attribute
bool Set_Z_Attribute(int i)
Definition: grids.cpp:505
SG_GRIDS_NAME_INDEX
#define SG_GRIDS_NAME_INDEX
Definition: grids.h:101
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Grids::On_Reload
virtual bool On_Reload(void)
Definition: grids.cpp:1657
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Grids::Set_Z_Name_Field
bool Set_Z_Name_Field(int i)
Definition: grids.cpp:518
CSG_Data_Object::Get_Owner
CSG_Data_Object * Get_Owner(void) const
Definition: dataobject.h:222
CSG_Grids::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: grids.cpp:1539
GRIDS_FILE_FORMAT_Undefined
@ GRIDS_FILE_FORMAT_Undefined
Definition: grids.h:92
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
SG_Data_Type_Get_Identifier
CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
Definition: api_core.cpp:146
CSG_Grid::Destroy
virtual bool Destroy(void)
Definition: grid.cpp:350
CSG_Grids::is_Compatible
bool is_Compatible(CSG_Grid *pGrid) const
Definition: grids.cpp:446
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Grids::Get_Unit
const SG_Char * Get_Unit(void) const
Definition: grids.h:175
CSG_Grid::Get_Scaling
double Get_Scaling(void) const
Definition: grid.cpp:430
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
SG_TOOL_PARAMLIST_ADD
#define SG_TOOL_PARAMLIST_ADD(IDENTIFIER, VALUE)
Definition: tool_library.h:353
CSG_Grids::Get_NX
int Get_NX(void) const
Definition: grids.h:185
CSG_Grid::Multiply
virtual CSG_Grid & Multiply(const CSG_Grid &Grid)
Definition: grid_operation.cpp:573
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_Grids::Create
virtual bool Create(const CSG_Grids &Grids)
Definition: grids.cpp:271
CSG_Grid::Add
virtual CSG_Grid & Add(const CSG_Grid &Grid)
Definition: grid_operation.cpp:503
SG_GRIDS_NAME_VALUE
#define SG_GRIDS_NAME_VALUE
Definition: grids.h:102
CSG_Data_Object
Definition: dataobject.h:180
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
GRID_RESAMPLING_Bilinear
@ GRID_RESAMPLING_Bilinear
Definition: grid.h:158
CSG_Grids::Add_Attribute
bool Add_Attribute(const CSG_String &Name, TSG_Data_Type Type, int iField=-1)
Definition: grids.cpp:474
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Grids::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grids.h:181
CSG_Grid::Subtract
virtual CSG_Grid & Subtract(const CSG_Grid &Grid)
Definition: grid_operation.cpp:538
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
CSG_Grids::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grids.h:172
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
CSG_Grids::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grids.h:201
CSG_Array_Pointer::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:382
CSG_Grids::Get_Value
double Get_Value(double x, double y, double z, TSG_Grid_Resampling Resampling=GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling=GRID_RESAMPLING_Undefined) const
Definition: grids.cpp:1058
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
CSG_Grid::Set_Scaling
void Set_Scaling(double Scale=1.0, double Offset=0.0)
Definition: grid.cpp:414
CSG_Grids::is_NoData
virtual bool is_NoData(int x, int y, int z) const
Definition: grids.h:358
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Grids::Get_StdDev
double Get_StdDev(void)
Definition: grids.cpp:1402
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Grids::operator-=
virtual CSG_Grids & operator-=(double Value)
Definition: grids.cpp:996
CSG_Simple_Statistics::Get_StdDev
double Get_StdDev(void)
Definition: mat_tools.h:738
CSG_Grids::Update_Z_Order
bool Update_Z_Order(void)
Definition: grids.cpp:542
CSG_Grids::Get_Grid_Ptr
CSG_Grid * Get_Grid_Ptr(int i) const
Definition: grids.h:248
GRIDS_FILE_FORMAT_Compressed
@ GRIDS_FILE_FORMAT_Compressed
Definition: grids.h:94
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Grids::Get_Histogram
const CSG_Histogram & Get_Histogram(size_t nClasses=0)
Definition: grids.cpp:1562
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Grids::Set_Scaling
void Set_Scaling(double Scale=1., double Offset=0.)
Definition: grids.cpp:380
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
CSG_Grid::Get_Offset
double Get_Offset(void) const
Definition: grid.cpp:436
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
CSG_Grid::Assign
virtual bool Assign(double Value=0.0)
Definition: grid_operation.cpp:77
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Grids::Destroy
virtual bool Destroy(void)
Definition: grids.cpp:245
GRID_RESAMPLING_BSpline
@ GRID_RESAMPLING_BSpline
Definition: grid.h:160
CSG_Grid::asShort
virtual short asShort(int x, int y, bool bScaled=true) const
Definition: grid.h:755
CSG_Table::Set_Value
virtual bool Set_Value(sLong Index, int iField, const SG_Char *Value)
Definition: table.cpp:1135
SG_GRIDS_NAME_GRID
#define SG_GRIDS_NAME_GRID
Definition: grids.h:103
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Grids::Set_Grid_Count
bool Set_Grid_Count(int Count)
Definition: grids.cpp:583
CSG_Grids::Assign_NoData
void Assign_NoData(void)
Definition: grids.cpp:890
CSG_Grids::Get_Min
double Get_Min(void)
Definition: grids.cpp:1387
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Grid::Assign_NoData
void Assign_NoData(void)
Definition: grid_operation.cpp:65
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_Histogram::Get_Class_Count
size_t Get_Class_Count(void) const
Definition: mat_tools.h:1018
CSG_Simple_Statistics::Set_Count
bool Set_Count(sLong Count)
Definition: mat_tools.cpp:424
SG_Create_Grids
CSG_Grids * SG_Create_Grids(void)
Definition: grids.cpp:65
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Grids::Get_ZMax
double Get_ZMax(bool bCells=false) const
Definition: grids.h:206
CSG_Grids::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grids.h:197
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_Grids::Load
virtual bool Load(const CSG_String &File, bool bLoadData=true)
Definition: grids.cpp:1689
CSG_Grids::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grids.h:387
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
CSG_Spline
Definition: mat_tools.h:1399
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
CSG_Spline::Get_Value
bool Get_Value(double x, double &y)
Definition: mat_spline.cpp:206
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
CSG_Grids::Get_Z
double Get_Z(int i) const
Definition: grids.h:228
CSG_Grids::Add
virtual CSG_Grids & Add(double Value)
Definition: grids.cpp:985
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Histogram::Destroy
bool Destroy(void)
Definition: mat_tools.cpp:1272
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_Simple_Statistics::Get_Range
double Get_Range(void)
Definition: mat_tools.h:733
CSG_Data_Object::Get_MetaData_DB
CSG_MetaData & Get_MetaData_DB(void) const
Definition: dataobject.h:226
CSG_Grid::asFloat
virtual float asFloat(int x, int y, bool bScaled=true) const
Definition: grid.h:761
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:600
ADD_TO_SPLINE
#define ADD_TO_SPLINE(i)
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_GRIDS_NAME_OWNER
#define SG_GRIDS_NAME_OWNER
Definition: grids.h:100
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Simple_Statistics::Create
bool Create(bool bHoldValues=false)
Definition: mat_tools.cpp:350
CSG_Grid_System::Get_xWorld_to_Grid
int Get_xWorld_to_Grid(double xWorld) const
Definition: grid.h:290
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Grids::Get_Mean
double Get_Mean(void)
Definition: grids.cpp:1382
SORT_SWAP
#define SORT_SWAP(a, b)
Definition: grids.cpp:1175
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_Data_Object::Set_Owner
void Set_Owner(CSG_Data_Object *pOwner)
Definition: dataobject.h:223
CSG_Grids::Get_Z_Name_Field
int Get_Z_Name_Field(void) const
Definition: grids.cpp:530
CSG_Grid::Divide
virtual CSG_Grid & Divide(const CSG_Grid &Grid)
Definition: grid_operation.cpp:608
CSG_Grid
Definition: grid.h:473
CSG_Grids::Get_Variance
double Get_Variance(void)
Definition: grids.cpp:1407
CSG_Grids::Get_Cellsize
double Get_Cellsize(void) const
Definition: grids.h:192
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_Grids::Get_Max
double Get_Max(void)
Definition: grids.cpp:1392
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Data_Manager::Grid_System_Count
size_t Grid_System_Count(void) const
Definition: data_manager.h:174
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Grids::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grids.h:302
CSG_Grid::asByte
virtual BYTE asByte(int x, int y, bool bScaled=true) const
Definition: grid.h:751
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_Grids::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double loValue, double hiValue)
Definition: grids.cpp:393
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_Grids::Add_Grid
bool Add_Grid(double Z)
Definition: grids.cpp:638
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Grid::asChar
virtual char asChar(int x, int y, bool bScaled=true) const
Definition: grid.h:753
CSG_Grids::Get_NoData_Count
sLong Get_NoData_Count(void)
Definition: grids.cpp:1418
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
SG_Data_Type_Get_Type
TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
Definition: api_core.cpp:152
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
SG_GRID_HISTOGRAM_CLASSES_DEFAULT
#define SG_GRID_HISTOGRAM_CLASSES_DEFAULT
Definition: grids.cpp:1555
CSG_Grid::Set_Unit
void Set_Unit(const CSG_String &Unit)
Definition: grid.cpp:408
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_String_Tokenizer
Definition: api_core.h:754
CSG_Grids::Del_Grid
bool Del_Grid(int i, bool bDetach=false)
Definition: grids.cpp:765
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
CSG_Grids
Definition: grids.h:119
CSG_Grids::Get_nValueBytes
int Get_nValueBytes(void) const
Definition: grids.h:171
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Grids::Get_Quantile
double Get_Quantile(double Quantile, bool bFromHistogram=true)
Definition: grids.cpp:1424
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Grids::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(void)
Definition: grids.cpp:1464
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
CSG_File_Zip
Definition: api_core.h:1188
CSG_Grids::operator*=
virtual CSG_Grids & operator*=(double Value)
Definition: grids.cpp:1012
CSG_Grids::Divide
virtual CSG_Grids & Divide(double Value)
Definition: grids.cpp:1033
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Histogram::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(void) const
Definition: mat_tools.h:1051
CSG_Grids::Del_Grids
bool Del_Grids(bool bDetach=false)
Definition: grids.cpp:803
TSG_Grid_Operation
TSG_Grid_Operation
Definition: grid.h:174
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Grids::Get_NZ
int Get_NZ(void) const
Definition: grids.h:187
GRIDS_FILE_FORMAT_GeoTIFF
@ GRIDS_FILE_FORMAT_GeoTIFF
Definition: grids.h:95
grids.h
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: grids.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Enumerations | Functions
grids.h File Reference
#include "grid.h"

Go to the source code of this file.

Classes

class CSG_Grids

Macros

#define | SG_GRIDS_NAME_OWNER 0x01
#define | SG_GRIDS_NAME_INDEX 0x02
#define | SG_GRIDS_NAME_VALUE 0x04
#define | SG_GRIDS_NAME_GRID 0x08
#define | SG_GRIDS_PTR_SAFE_SET_NODATA(g, x, y, z) { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_NoData(x, y, z ); } }
#define | SG_GRIDS_PTR_SAFE_SET_VALUE(g, x, y, z, v) { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_Value (x, y, z, v); } }

Enumerations

enum TSG_Grids_File_Format { GRIDS_FILE_FORMAT_Undefined = 0, GRIDS_FILE_FORMAT_Normal, GRIDS_FILE_FORMAT_Compressed, GRIDS_FILE_FORMAT_GeoTIFF }

Functions

SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (void)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const CSG_Grids &Grids)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const CSG_Grids *pGrids, bool bCopyData=false)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const char *FileName, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const wchar_t *FileName, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const CSG_String &FileName, bool bLoadData=true)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const CSG_Grid_System &System, int NZ=0, double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute=0, TSG_Data_Type Type=SG_DATATYPE_Undefined, bool bCreateGrids=false)
SAGA_API_DLL_EXPORT CSG_Grids * | SG_Create_Grids (int NX, int NY, int NZ=0, double Cellsize=0., double xMin=0., double yMin=0., double zMin=0., TSG_Data_Type Type=SG_DATATYPE_Undefined)

Detailed Description

Classes for multi-dimensional raster data management, so called grid collections.

See also
CSG_Data_Object
CSG_Grid_System
CSG_Grid
CSG_Grids

Definition in file grids.h.

Macro Definition Documentation

◆ SG_GRIDS_NAME_GRID

#define SG_GRIDS_NAME_GRID 0x08

Definition at line 103 of file grids.h.

◆ SG_GRIDS_NAME_INDEX

#define SG_GRIDS_NAME_INDEX 0x02

Definition at line 101 of file grids.h.

◆ SG_GRIDS_NAME_OWNER

#define SG_GRIDS_NAME_OWNER 0x01

Definition at line 100 of file grids.h.

◆ SG_GRIDS_NAME_VALUE

#define SG_GRIDS_NAME_VALUE 0x04

Definition at line 102 of file grids.h.

◆ SG_GRIDS_PTR_SAFE_SET_NODATA

#define SG_GRIDS_PTR_SAFE_SET_NODATA | ( | g,
 |  | x,
 |  | y,
 |  | z
 | ) | { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_NoData(x, y, z ); } }

Definition at line 561 of file grids.h.

◆ SG_GRIDS_PTR_SAFE_SET_VALUE

#define SG_GRIDS_PTR_SAFE_SET_VALUE | ( | g,
 |  | x,
 |  | y,
 |  | z,
 |  | v
 | ) | { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_Value (x, y, z, v); } }

Definition at line 562 of file grids.h.

Enumeration Type Documentation

◆ TSG_Grids_File_Format

enum TSG_Grids_File_Format
Enumerator
GRIDS_FILE_FORMAT_Undefined
GRIDS_FILE_FORMAT_Normal
GRIDS_FILE_FORMAT_Compressed
GRIDS_FILE_FORMAT_GeoTIFF

Definition at line 90 of file grids.h.

Function Documentation

◆ SG_Create_Grids() [1/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const char * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 87 of file grids.cpp.

References SG_Create_Grids().

◆ SG_Create_Grids() [2/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const CSG_Grid_System & | System,
 |  | const CSG_Table & | Attributes,
 |  | int | zAttribute = 0,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined,
 |  | bool | bCreateGrids = false
 | ) |  |

Safe construction of a grid collection

Definition at line 105 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [3/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const CSG_Grid_System & | System,
 |  | int | NZ = 0,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Safe construction of a grid collection

Definition at line 97 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [4/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids ( const CSG_Grids & Grids )

Safe construction of a grid collection

Definition at line 71 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [5/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const CSG_Grids * | pGrids,
 |  | bool | bCopyData = false
 | ) |  |

Safe construction of a grid collection

Definition at line 79 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [6/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const CSG_String & | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 89 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [7/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | const wchar_t * | FileName,
 |  | bool | bLoadData = true
 | ) |  |

Safe construction of a grid collection

Definition at line 88 of file grids.cpp.

References SG_Create_Grids().

◆ SG_Create_Grids() [8/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids | ( | int | NX,
 |  | int | NY,
 |  | int | NZ = 0,
 |  | double | Cellsize = 0.,
 |  | double | xMin = 0.,
 |  | double | yMin = 0.,
 |  | double | zMin = 0.,
 |  | TSG_Data_Type | Type = SG_DATATYPE_Undefined
 | ) |  |

Safe construction of a grid collection

Definition at line 113 of file grids.cpp.

References CSG_Grids::is_Valid().

◆ SG_Create_Grids() [9/9]

SAGA_API_DLL_EXPORT CSG_Grids* SG_Create_Grids ( void )

Safe construction of a grid collection

Definition at line 65 of file grids.cpp.

Referenced by CSG_Parameters_Grid_Target::Get_Grids(), and SG_Create_Grids().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: grids.h Source File

  • saga_core
  • saga_api
grids.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grids.h //
15 // //
16 // Copyright (C) 2017 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // e-mail: oconrad@saga-gis.org //
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Germany //
48 // //
50
51 //---------------------------------------------------------
52 #ifndef HEADER_INCLUDED__SAGA_API__grids_H
53 #define HEADER_INCLUDED__SAGA_API__grids_H
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
73 // //
75 // //
76 // //
78
79 //---------------------------------------------------------
80 #include "grid.h"
81
82
84 // //
85 // CSG_Grids //
86 // //
88
89 //---------------------------------------------------------
90 typedef enum
91 {
92 GRIDS_FILE_FORMAT_Undefined = 0,
93 GRIDS_FILE_FORMAT_Normal,
94 GRIDS_FILE_FORMAT_Compressed,
95 GRIDS_FILE_FORMAT_GeoTIFF
96 }
97 TSG_Grids_File_Format;
98
99 //---------------------------------------------------------
100 #define SG_GRIDS_NAME_OWNER 0x01
101 #define SG_GRIDS_NAME_INDEX 0x02
102 #define SG_GRIDS_NAME_VALUE 0x04
103 #define SG_GRIDS_NAME_GRID 0x08
104
105
107 // //
108 // CSG_Grids //
109 // //
111
112 //---------------------------------------------------------
117 //---------------------------------------------------------
118 class SAGA_API_DLL_EXPORT CSG_Grids : public CSG_Data_Object
119 {
120 //---------------------------------------------------------
121 public:
122
123 //-----------------------------------------------------
124 CSG_Grids(void);
125 virtual ~CSG_Grids(void);
126
127 CSG_Grids (const CSG_Grids &Grids);
128 virtual bool Create (const CSG_Grids &Grids);
129
130 CSG_Grids (const CSG_Grids *pGrids, bool bCopyData = false);
131 virtual bool Create (const CSG_Grids *pGrids, bool bCopyData = false);
132
133 CSG_Grids (const char *FileName, bool bLoadData = true);
134 virtual bool Create (const char *FileName, bool bLoadData = true);
135 CSG_Grids (const wchar_t *FileName, bool bLoadData = true);
136 virtual bool Create (const wchar_t *FileName, bool bLoadData = true);
137 CSG_Grids (const CSG_String &FileName, bool bLoadData = true);
138 virtual bool Create (const CSG_String &FileName, bool bLoadData = true);
139
140 CSG_Grids (const CSG_Grid_System &System, int NZ = 0, double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
141 virtual bool Create (const CSG_Grid_System &System, int NZ = 0, double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
142
143 CSG_Grids (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute = 0, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCreateGrids = false);
144 virtual bool Create (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute = 0, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCreateGrids = false);
145
146 CSG_Grids (int NX, int NY, int NZ = 0, double Cellsize = 0., double xMin = 0., double yMin = 0., double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
147 virtual bool Create (int NX, int NY, int NZ = 0, double Cellsize = 0., double xMin = 0., double yMin = 0., double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
148
149 virtual bool Destroy (void);
150
151
152 //-----------------------------------------------------
153 virtual bool Load (const CSG_String &File, bool bLoadData = true);
154
155 virtual bool Save (const CSG_String &File, int Format = 0);
156 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
157 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
158
159
160 //-----------------------------------------------------
163 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_Grids ); }
164
165
166 //-----------------------------------------------------
167 // Data-Info...
168
169 TSG_Data_Type Get_Type (void) const { return( m_pGrids[0]->Get_Type() ); }
170
171 int Get_nValueBytes (void) const { return( m_pGrids[0]->Get_nValueBytes() ); }
172 int Get_nLineBytes (void) const { return( m_pGrids[0]->Get_nLineBytes () ); }
173
174 void Set_Unit (const CSG_String &Unit);
175 const SG_Char * Get_Unit (void) const { return( m_pGrids[0]->Get_Unit() ); }
176
177
178 //-----------------------------------------------------
179 // Georeference...
180
181 const CSG_Grid_System & Get_System (void) const { return( m_pGrids[0]->Get_System() ); }
182
183 virtual const CSG_Rect & Get_Extent (void) { return( Get_System().Get_Extent() ); }
184
185 int Get_NX (void) const { return( m_pGrids[0]->Get_System().Get_NX() ); }
186 int Get_NY (void) const { return( m_pGrids[0]->Get_System().Get_NY() ); }
187 int Get_NZ (void) const { return( (int)m_Attributes.Get_Count() ); }
188 sLong Get_NCells (void) const { return( Get_System().Get_NCells() * Get_NZ() ); }
189 sLong Get_Data_Count (void);
190 sLong Get_NoData_Count (void);
191
192 double Get_Cellsize (void) const { return( m_pGrids[0]->Get_System().Get_Cellsize() ); }
193 double Get_Cellarea (void) const { return( m_pGrids[0]->Get_System().Get_Cellarea() ); }
194
195 const CSG_Rect & Get_Extent (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_Extent(bCells) ); }
196
197 double Get_XMin (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_XMin (bCells) ); }
198 double Get_XMax (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_XMax (bCells) ); }
199 double Get_XRange (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_XRange(bCells) ); }
200
201 double Get_YMin (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_YMin (bCells) ); }
202 double Get_YMax (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_YMax (bCells) ); }
203 double Get_YRange (bool bCells = false) const { return( m_pGrids[0]->Get_System().Get_YRange(bCells) ); }
204
205 double Get_ZMin (bool bCells = false) const { return( m_Attributes.Get_Minimum(m_Z_Attribute) ); }
206 double Get_ZMax (bool bCells = false) const { return( m_Attributes.Get_Maximum(m_Z_Attribute) ); }
207 double Get_ZRange (bool bCells = false) const { return( m_Attributes.Get_Range (m_Z_Attribute) ); }
208
209
210 //-----------------------------------------------------
211 // Attributes...
212
213 bool Add_Attribute (const CSG_String &Name, TSG_Data_Type Type, int iField = -1);
214 bool Del_Attribute (int iField);
215
216 const CSG_Table & Get_Attributes (void) const { return( m_Attributes ); }
217 CSG_Table * Get_Attributes_Ptr (void) { return( &m_Attributes ); }
218
219 CSG_Table_Record & Get_Attributes (int i) const { return( m_Attributes[i] ); }
220
221 bool Set_Z_Attribute (int i);
222 int Get_Z_Attribute (void) const { return( m_Z_Attribute ); }
223
224 bool Set_Z_Name_Field (int i);
225 int Get_Z_Name_Field (void) const;
226
227 bool Set_Z (int i, double Value);
228 double Get_Z (int i) const { return( m_Attributes[i].asDouble(m_Z_Attribute) ); }
229
230 bool Update_Z_Order (void);
231
232
233 //-----------------------------------------------------
234 // Grids...
235
236 bool Set_Grid_Count (int Count);
237 int Get_Grid_Count (void) const { return( (int)m_Attributes.Get_Count() ); }
238
239 bool Add_Grid (double Z);
240 bool Add_Grid (double Z, CSG_Grid *pGrid, bool bAttach = false);
241 bool Add_Grid (CSG_Table_Record &Attributes);
242 bool Add_Grid (CSG_Table_Record &Attributes, CSG_Grid *pGrid, bool bAttach = false);
243
244 bool Del_Grid (int i, bool bDetach = false);
245 bool Del_Grids ( bool bDetach = false);
246
247 const CSG_Grid & Get_Grid (int i) const { return( *m_pGrids[i] ); }
248 CSG_Grid * Get_Grid_Ptr (int i) const { return( m_pGrids[i] ); }
249 CSG_String Get_Grid_Name (int i, int Style = 0) const;
250
251 sLong Get_Memory_Size (void) const { return( m_pGrids[0]->Get_Memory_Size() * Get_NZ() ); }
252
253
254 //-----------------------------------------------------
255 // Values...
256
257 void Set_Scaling (double Scale = 1., double Offset = 0.);
258 double Get_Scaling (void) const { return( m_pGrids[0]->Get_Scaling() ); }
259 double Get_Offset (void) const { return( m_pGrids[0]->Get_Offset () ); }
260 bool is_Scaled (void) const { return( m_pGrids[0]->is_Scaled () ); }
261
262 double Get_Mean (void);
263 double Get_Min (void);
264 double Get_Max (void);
265 double Get_Range (void);
266 double Get_StdDev (void);
267 double Get_Variance (void);
268 double Get_Quantile (double Quantile, bool bFromHistogram = true);
269 double Get_Percentile (double Percentile, bool bFromHistogram = true);
270
271 const CSG_Simple_Statistics & Get_Statistics (void);
272 bool Get_Statistics (const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues = false) const;
273
274 const CSG_Histogram & Get_Histogram (size_t nClasses = 0);
275 bool Get_Histogram (const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses = 0) const;
276
277 virtual bool Set_Max_Samples (sLong Max_Samples);
278
279
280 //-----------------------------------------------------
281 // Checks...
282
283 virtual bool is_Valid (void) const;
284
285 TSG_Intersection is_Intersecting (const CSG_Rect &Extent) const { return( m_pGrids[0]->is_Intersecting(Extent) ); }
286 TSG_Intersection is_Intersecting (const TSG_Rect &Extent) const { return( m_pGrids[0]->is_Intersecting(Extent) ); }
287 TSG_Intersection is_Intersecting (double xMin, double yMin, double xMax, double yMax) const { return( m_pGrids[0]->is_Intersecting(xMin, yMin, xMax, yMax) ); }
288
289 bool is_Compatible (CSG_Grid *pGrid ) const;
290 bool is_Compatible (CSG_Grids *pGrids) const;
291 bool is_Compatible (const CSG_Grid_System &System) const;
292 bool is_Compatible (int NX, int NY, double Cellsize, double xMin, double yMin) const;
293
294 bool is_InGrid (int x, int y, int z, bool bCheckNoData = true) const { return( Get_System().is_InGrid(x, y) && z >= 0 && z < Get_NZ() && (!bCheckNoData || !is_NoData(x, y, z)) ); }
295 bool is_InGrid_byPos (double x, double y, double z, bool bCheckNoData = true) const { return( Get_Extent(true).Contains(x, y) && z >= Get_ZMin() && z <= Get_ZMax() && (!bCheckNoData || !is_NoData(Get_System().Get_xWorld_to_Grid(x), Get_System().Get_yWorld_to_Grid(y), (int)z)) ); }
296 bool is_InGrid_byPos (const TSG_Point_3D &p, bool bCheckNoData = true) const { return( is_InGrid_byPos(p.x, p.y, p.z, bCheckNoData) ); }
297
298
299 //-----------------------------------------------------
300 // Set update flag when modified...
301
302 virtual void Set_Modified (bool bModified = true)
303 {
304 CSG_Data_Object::Set_Modified(bModified);
305
306 m_Attributes.Set_Modified(bModified);
307
308 if( bModified )
309 {
310 Set_Update_Flag();
311 }
312 }
313
314 virtual bool is_Modified (void) const
315 {
316 return( CSG_Data_Object::is_Modified() || m_Attributes.is_Modified() );
317 }
318
319
320 //-----------------------------------------------------
321 // Operations...
322
323 void Assign_NoData (void);
324
325 virtual bool Assign (double Value = 0.);
326 virtual bool Assign (CSG_Data_Object *pObject);
327 virtual bool Assign (CSG_Grids *pGrids, TSG_Grid_Resampling Interpolation);
328
329
330 //-----------------------------------------------------
331 // Operators...
332
333 virtual CSG_Grids & operator = (const CSG_Grids &Grids);
334 virtual CSG_Grids & operator = (double Value );
335
336 virtual CSG_Grids & operator += (double Value );
337 virtual CSG_Grids & Add (double Value );
338
339 virtual CSG_Grids & operator -= (double Value );
340 virtual CSG_Grids & Subtract (double Value );
341
342 virtual CSG_Grids & operator *= (double Value );
343 virtual CSG_Grids & Multiply (double Value );
344
345 virtual CSG_Grids & operator /= (double Value );
346 virtual CSG_Grids & Divide (double Value );
347
348 virtual double operator () (int x, int y, int z) const { return( asDouble(x, y, z) ); }
349
350 virtual CSG_Grid & operator [] (int i) { return( *m_pGrids[i] ); }
351
352
353 //-----------------------------------------------------
354 // No Data Value...
355
356 virtual bool Set_NoData_Value_Range (double loValue, double hiValue);
357
358 virtual bool is_NoData (int x, int y, int z) const { return( is_NoData_Value(asDouble(x, y, z, false)) ); }
359 virtual bool is_NoData (sLong i) const { return( is_NoData_Value(asDouble( i, false)) ); }
360
361 virtual void Set_NoData (int x, int y, int z) { Set_Value(x, y, z, Get_NoData_Value(), false); }
362 virtual void Set_NoData (sLong i) { Set_Value( i, Get_NoData_Value(), false); }
363
364
365 //-----------------------------------------------------
366 // Get Value...
367
368 double Get_Value (double x, double y, double z, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling = GRID_RESAMPLING_Undefined) const;
369 double Get_Value (const TSG_Point_3D &p, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling = GRID_RESAMPLING_Undefined) const;
370 bool Get_Value (double x, double y, double z, double &Value, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling = GRID_RESAMPLING_Undefined) const;
371 bool Get_Value (const TSG_Point_3D &p, double &Value, TSG_Grid_Resampling Resampling = GRID_RESAMPLING_BSpline, TSG_Grid_Resampling ZResampling = GRID_RESAMPLING_Undefined) const;
372
373 virtual BYTE asByte (int x, int y, int z, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble(x, y, z, bScaled)) ); }
374 virtual BYTE asByte (sLong i, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble( i, bScaled)) ); }
375 virtual char asChar (int x, int y, int z, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble(x, y, z, bScaled)) ); }
376 virtual char asChar (sLong i, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble( i, bScaled)) ); }
377 virtual short asShort (int x, int y, int z, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble(x, y, z, bScaled)) ); }
378 virtual short asShort (sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble( i, bScaled)) ); }
379 virtual int asInt (int x, int y, int z, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble(x, y, z, bScaled)) ); }
380 virtual int asInt (sLong i, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble( i, bScaled)) ); }
381 virtual sLong asLong (int x, int y, int z, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble(x, y, z, bScaled)) ); }
382 virtual sLong asLong (sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble( i, bScaled)) ); }
383 virtual float asFloat (int x, int y, int z, bool bScaled = true) const { return( (float) (asDouble(x, y, z, bScaled)) ); }
384 virtual float asFloat (sLong i, bool bScaled = true) const { return( (float) (asDouble( i, bScaled)) ); }
385
386 //-----------------------------------------------------
387 virtual double asDouble(sLong i, bool bScaled = true) const
388 {
389 int z = (int)(i / m_pGrids[0]->Get_NCells());
390
391 return( m_pGrids[z]->asDouble((sLong)(i % m_pGrids[0]->Get_NCells()), bScaled) );
392 }
393
394 virtual double asDouble(int x, int y, int z, bool bScaled = true) const
395 {
396 return( m_pGrids[z]->asDouble(x, y, bScaled) );
397 }
398
399
400 //-----------------------------------------------------
401 // Set Value...
402
403 virtual void Add_Value(int x, int y, int z, double Value) { Set_Value(x, y, z, asDouble(x, y, z) + Value ); }
404 virtual void Add_Value(sLong i, double Value) { Set_Value( i, asDouble( i) + Value ); }
405
406 virtual void Mul_Value(int x, int y, int z, double Value) { Set_Value(x, y, z, asDouble(x, y, z) * Value ); }
407 virtual void Mul_Value(sLong i, double Value) { Set_Value( i, asDouble( i) * Value ); }
408
409 //-----------------------------------------------------
410 virtual void Set_Value(sLong i, double Value, bool bScaled = true)
411 {
412 int z = (int)(i / m_pGrids[0]->Get_NCells());
413
414 m_pGrids[z]->Set_Value((sLong)(i % m_pGrids[0]->Get_NCells()), Value, bScaled);
415 }
416
417 virtual void Set_Value(int x, int y, int z, double Value, bool bScaled = true)
418 {
419 m_pGrids[z]->Set_Value(x, y, Value, bScaled);
420 }
421
422
423 //-----------------------------------------------------
424 // Index...
425
426 bool Set_Index (bool bOn = true)
427 {
428 if( !bOn )
429 {
430 SG_FREE_SAFE(m_Index);
431
432 return( true );
433 }
434
435 return( _Get_Index() );
436 }
437
438 sLong Get_Sorted (sLong Position, bool bDown = true, bool bCheckNoData = true)
439 {
440 if( Position >= 0 && Position < Get_NCells() && _Get_Index() )
441 {
442 Position = m_Index[bDown ? Get_NCells() - Position - 1 : Position];
443
444 if( !bCheckNoData || !is_NoData(Position) )
445 {
446 return( Position );
447 }
448 }
449
450 return( -1 );
451 }
452
453 bool Get_Sorted (sLong Position, sLong &i, bool bDown = true, bool bCheckNoData = true)
454 {
455 return( (i = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
456 }
457
458 bool Get_Sorted (sLong Position, int &x, int &y, int &z, bool bDown = true, bool bCheckNoData = true)
459 {
460 if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
461 {
462 z = (int)(Position / m_pGrids[0]->Get_NCells());
463
464 Position = Position % m_pGrids[0]->Get_NCells();
465
466 x = (int)(Position % Get_NX());
467 y = (int)(Position / Get_NX());
468
469 return( true );
470 }
471
472 return( false );
473 }
474
475
476 //---------------------------------------------------------
477 protected:
478
479 virtual bool On_Update (void);
480 virtual bool On_Reload (void);
481 virtual bool On_Delete (void);
482
483
484 //---------------------------------------------------------
485 private:
486
487 int m_Z_Attribute, m_Z_Name;
488
489 sLong *m_Index;
490
491 CSG_Table m_Attributes;
492
493 CSG_Array_Pointer m_Grids;
494
495 CSG_Grid **m_pGrids;
496
497 CSG_Simple_Statistics m_Statistics;
498
499 CSG_Histogram m_Histogram;
500
501
502 //-----------------------------------------------------
503 void _On_Construction (void);
504
505 void _Synchronize (CSG_Grid *pGrid);
506
507 //-----------------------------------------------------
508 bool _Get_Z (double Value, int &iz, double &dz) const;
509
510 //-----------------------------------------------------
511 bool _Set_Index (void);
512 bool _Get_Index (void)
513 {
514 if( Get_Update_Flag() )
515 {
516 Update();
517 }
518
519 return( m_Index || _Set_Index() );
520 }
521
522 //-----------------------------------------------------
523 bool _Load_External (const CSG_String &FileName);
524 bool _Load_PGSQL (const CSG_String &FileName);
525
526 bool _Load_Normal (const CSG_String &FileName);
527 bool _Save_Normal (const CSG_String &FileName);
528
529 bool _Load_Compressed (const CSG_String &FileName);
530 bool _Save_Compressed (const CSG_String &FileName);
531
532 bool _Load_Header (CSG_File &Stream);
533 bool _Save_Header (CSG_File &Stream);
534
535 bool _Load_Attributes (CSG_File &Stream);
536 bool _Save_Attributes (CSG_File &Stream);
537
538 bool _Load_Data (CSG_File &Stream, CSG_Grid *pGrid);
539 bool _Save_Data (CSG_File &Stream, CSG_Grid *pGrid);
540
541 //-----------------------------------------------------
542 bool _Assign_Interpolated (CSG_Grids *pSource, TSG_Grid_Resampling Interpolation);
543 bool _Assign_MeanValue (CSG_Grids *pSource, bool bVolumeProportional);
544 bool _Assign_ExtremeValue (CSG_Grids *pSource, bool bMaximum);
545 bool _Assign_Majority (CSG_Grids *pSource);
546
547 //-----------------------------------------------------
548 CSG_Grids & _Operation_Arithmetic (const CSG_Grids &Grids, TSG_Grid_Operation Operation);
549 CSG_Grids & _Operation_Arithmetic (double Value , TSG_Grid_Operation Operation);
550
551 };
552
553
555 // //
556 // Functions //
557 // //
559
560 //---------------------------------------------------------
561 #define SG_GRIDS_PTR_SAFE_SET_NODATA(g, x, y, z) { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_NoData(x, y, z ); } }
562 #define SG_GRIDS_PTR_SAFE_SET_VALUE(g, x, y, z, v) { if( g && g->is_InGrid(x, y, z, false) ) { g->Set_Value (x, y, z, v); } }
563
564 //---------------------------------------------------------
566 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (void);
567
569 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const CSG_Grids &Grids);
570
572 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const CSG_Grids *pGrids, bool bCopyData = false);
573
575 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const char *FileName, bool bLoadData = true);
577 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const wchar_t *FileName, bool bLoadData = true);
579 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const CSG_String &FileName, bool bLoadData = true);
580
582 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const CSG_Grid_System &System, int NZ = 0, double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
583
585 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (const CSG_Grid_System &System, const CSG_Table &Attributes, int zAttribute = 0, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCreateGrids = false);
586
588 SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids (int NX, int NY, int NZ = 0, double Cellsize = 0., double xMin = 0., double yMin = 0., double zMin = 0., TSG_Data_Type Type = SG_DATATYPE_Undefined);
589
590
592 // //
593 // //
594 // //
596
597 //---------------------------------------------------------
598 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grids_H
CSG_Grids::asChar
virtual char asChar(sLong i, bool bScaled=true) const
Definition: grids.h:376
CSG_Grids::is_InGrid
bool is_InGrid(int x, int y, int z, bool bCheckNoData=true) const
Definition: grids.h:294
CSG_Rect
Definition: geo_tools.h:471
GRIDS_FILE_FORMAT_Normal
@ GRIDS_FILE_FORMAT_Normal
Definition: grids.h:93
CSG_Grids::is_Intersecting
TSG_Intersection is_Intersecting(const CSG_Rect &Extent) const
Definition: grids.h:285
CSG_Grids::Get_NY
int Get_NY(void) const
Definition: grids.h:186
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:734
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Grids::Set_NoData
virtual void Set_NoData(int x, int y, int z)
Definition: grids.h:361
CSG_Grids::asInt
virtual int asInt(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:379
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Grids::Get_ZRange
double Get_ZRange(bool bCells=false) const
Definition: grids.h:207
CSG_Grids::is_NoData
virtual bool is_NoData(sLong i) const
Definition: grids.h:359
CSG_Grids::Mul_Value
virtual void Mul_Value(sLong i, double Value)
Definition: grids.h:407
TSG_Grids_File_Format
TSG_Grids_File_Format
Definition: grids.h:91
CSG_Grids::Get_Sorted
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
Definition: grids.h:438
CSG_Grids::Get_Offset
double Get_Offset(void) const
Definition: grids.h:259
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Grids::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grids.h:410
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_Grids::is_Intersecting
TSG_Intersection is_Intersecting(double xMin, double yMin, double xMax, double yMax) const
Definition: grids.h:287
SG_ROUND_TO_INT
#define SG_ROUND_TO_INT(x)
Definition: mat_tools.h:140
CSG_Table_Record
Definition: table.h:130
CSG_Grids::Get_Scaling
double Get_Scaling(void) const
Definition: grids.h:258
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Grids::Get_Attributes
const CSG_Table & Get_Attributes(void) const
Definition: grids.h:216
CSG_Grid_System
Definition: grid.h:200
TSG_Grid_Resampling
TSG_Grid_Resampling
Definition: grid.h:156
CSG_Histogram
Definition: mat_tools.h:986
CSG_Grids::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grids.h:203
CSG_Grids::Get_Attributes
CSG_Table_Record & Get_Attributes(int i) const
Definition: grids.h:219
CSG_Grids::Get_Grid_Count
int Get_Grid_Count(void) const
Definition: grids.h:237
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
GRID_RESAMPLING_Undefined
@ GRID_RESAMPLING_Undefined
Definition: grid.h:168
CSG_Grids::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grids.h:183
CSG_Grids::is_InGrid_byPos
bool is_InGrid_byPos(double x, double y, double z, bool bCheckNoData=true) const
Definition: grids.h:295
CSG_Data_Object::Save
virtual bool Save(const CSG_String &File, int Format=0)=0
CSG_Grids::Add_Value
virtual void Add_Value(sLong i, double Value)
Definition: grids.h:404
grid.h
CSG_Grids::asByte
virtual BYTE asByte(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:373
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Grids::Get_NCells
sLong Get_NCells(void) const
Definition: grids.h:188
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
SG_ROUND_TO_SLONG
#define SG_ROUND_TO_SLONG(x)
Definition: mat_tools.h:143
CSG_Grids::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grids.h:169
CSG_Grids::Get_Z_Attribute
int Get_Z_Attribute(void) const
Definition: grids.h:222
CSG_Grids::is_Scaled
bool is_Scaled(void) const
Definition: grids.h:260
CSG_Data_Object::Set_Max_Samples
virtual bool Set_Max_Samples(sLong Max_Samples)
Definition: dataobject.cpp:558
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Grids::asDouble
virtual double asDouble(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:394
CSG_File
Definition: api_core.h:1116
SSG_Rect
Definition: geo_tools.h:464
GRIDS_FILE_FORMAT_Undefined
@ GRIDS_FILE_FORMAT_Undefined
Definition: grids.h:92
CSG_Grids::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grids.h:202
CSG_Grids::Get_Unit
const SG_Char * Get_Unit(void) const
Definition: grids.h:175
CSG_Grids::Get_Sorted
bool Get_Sorted(sLong Position, int &x, int &y, int &z, bool bDown=true, bool bCheckNoData=true)
Definition: grids.h:458
CSG_Grids::asLong
virtual sLong asLong(sLong i, bool bScaled=true) const
Definition: grids.h:382
CSG_Grids::Get_NX
int Get_NX(void) const
Definition: grids.h:185
CSG_Grids::asShort
virtual short asShort(sLong i, bool bScaled=true) const
Definition: grids.h:378
CSG_Data_Object
Definition: dataobject.h:180
CSG_Grids::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grids.h:181
CSG_Grids::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grids.h:172
CSG_Grids::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grids.h:201
CSG_Grids::asLong
virtual sLong asLong(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:381
CSG_Grids::asByte
virtual BYTE asByte(sLong i, bool bScaled=true) const
Definition: grids.h:374
CSG_Grids::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grids.h:199
CSG_Grids::Add_Value
virtual void Add_Value(int x, int y, int z, double Value)
Definition: grids.h:403
CSG_Data_Object::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Grids::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grids.h:195
CSG_Grids::is_NoData
virtual bool is_NoData(int x, int y, int z) const
Definition: grids.h:358
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Grids::asShort
virtual short asShort(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:377
SG_ROUND_TO_CHAR
#define SG_ROUND_TO_CHAR(x)
Definition: mat_tools.h:136
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Grids::Get_Grid_Ptr
CSG_Grid * Get_Grid_Ptr(int i) const
Definition: grids.h:248
GRIDS_FILE_FORMAT_Compressed
@ GRIDS_FILE_FORMAT_Compressed
Definition: grids.h:94
CSG_Data_Object::is_Modified
virtual bool is_Modified(void) const
Definition: dataobject.h:219
CSG_Grids::is_InGrid_byPos
bool is_InGrid_byPos(const TSG_Point_3D &p, bool bCheckNoData=true) const
Definition: grids.h:296
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
GRID_RESAMPLING_BSpline
@ GRID_RESAMPLING_BSpline
Definition: grid.h:160
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
SG_ROUND_TO_BYTE
#define SG_ROUND_TO_BYTE(x)
Definition: mat_tools.h:135
CSG_Grids::Get_XMax
double Get_XMax(bool bCells=false) const
Definition: grids.h:198
CSG_Grids::Set_Index
bool Set_Index(bool bOn=true)
Definition: grids.h:426
CSG_Grids::Get_Memory_Size
sLong Get_Memory_Size(void) const
Definition: grids.h:251
CSG_Grids::Get_ZMax
double Get_ZMax(bool bCells=false) const
Definition: grids.h:206
CSG_Grids::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grids.h:197
CSG_Table
Definition: table.h:283
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:274
CSG_Grids::Save
virtual bool Save(const char *File, int Format=0)
Definition: grids.h:156
CSG_Grids::asFloat
virtual float asFloat(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:383
CSG_Grids::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grids.h:387
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Grids::Get_Z
double Get_Z(int i) const
Definition: grids.h:228
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Grids::asFloat
virtual float asFloat(sLong i, bool bScaled=true) const
Definition: grids.h:384
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_Grids::asChar
virtual char asChar(int x, int y, int z, bool bScaled=true) const
Definition: grids.h:375
CSG_Grids::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: grids.h:157
SG_ROUND_TO_SHORT
#define SG_ROUND_TO_SHORT(x)
Definition: mat_tools.h:138
CSG_Grids::Get_Cellarea
double Get_Cellarea(void) const
Definition: grids.h:193
CSG_Grid
Definition: grid.h:473
CSG_Grids::Get_Cellsize
double Get_Cellsize(void) const
Definition: grids.h:192
CSG_Grids::is_Modified
virtual bool is_Modified(void) const
Definition: grids.h:314
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Grids::is_Intersecting
TSG_Intersection is_Intersecting(const TSG_Rect &Extent) const
Definition: grids.h:286
SG_Create_Grids
SAGA_API_DLL_EXPORT CSG_Grids * SG_Create_Grids(void)
Definition: grids.cpp:65
CSG_Grids::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grids.h:302
CSG_Grids::Set_NoData
virtual void Set_NoData(sLong i)
Definition: grids.h:362
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Grids::Set_Value
virtual void Set_Value(int x, int y, int z, double Value, bool bScaled=true)
Definition: grids.h:417
CSG_Grids::Get_ZMin
double Get_ZMin(bool bCells=false) const
Definition: grids.h:205
CSG_Grids::asInt
virtual int asInt(sLong i, bool bScaled=true) const
Definition: grids.h:380
CSG_Grids::Mul_Value
virtual void Mul_Value(int x, int y, int z, double Value)
Definition: grids.h:406
CSG_Grids
Definition: grids.h:119
CSG_Grids::Get_nValueBytes
int Get_nValueBytes(void) const
Definition: grids.h:171
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Grids::Get_Attributes_Ptr
CSG_Table * Get_Attributes_Ptr(void)
Definition: grids.h:217
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Grids::Get_Grid
const CSG_Grid & Get_Grid(int i) const
Definition: grids.h:247
TSG_Grid_Operation
TSG_Grid_Operation
Definition: grid.h:174
CSG_Grids::Get_Sorted
bool Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
Definition: grids.h:453
CSG_Grids::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Definition: grids.h:163
CSG_Grids::Get_NZ
int Get_NZ(void) const
Definition: grids.h:187
GRIDS_FILE_FORMAT_GeoTIFF
@ GRIDS_FILE_FORMAT_GeoTIFF
Definition: grids.h:95
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: kdtree.cpp File Reference

  • saga_core
  • saga_api
kdtree.cpp File Reference
#include "pointcloud.h"
#include "nanoflann/nanoflann.hpp"
#include "parameters.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: kdtree.cpp Source File

  • saga_core
  • saga_api
kdtree.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // kdtree.cpp //
15 // //
16 // Copyright (C) 2019 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // e-mail: oconrad@saga-gis.org //
42 // //
43 // contact: Olaf Conrad //
44 // Institute of Geography //
45 // University of Hamburg //
46 // Germany //
47 // //
49
50 //---------------------------------------------------------
51 #include "pointcloud.h"
52
53 #include "nanoflann/nanoflann.hpp"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 class CSG_KDTree_Adaptor
64 {
65 public:
66 CSG_KDTree_Adaptor(void) { m_pData = NULL; m_zScale = 1.; }
67 virtual ~CSG_KDTree_Adaptor(void) {}
68
69 typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, CSG_KDTree_Adaptor>,
70 CSG_KDTree_Adaptor, 2> kd_tree_2d;
71
72 typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, CSG_KDTree_Adaptor>,
73 CSG_KDTree_Adaptor, 3> kd_tree_3d;
74
75 //-----------------------------------------------------
76 virtual size_t kdtree_get_point_count (void) const = 0;
77 virtual double kdtree_get_pt (const size_t Index, int Dimension) const = 0;
78
79 template <class BBOX> bool kdtree_get_bbox (BBOX &bb) const
80 {
81 double Extent[3][2];
82
83 if( !Get_Extent(Extent) )
84 {
85 return( false );
86 }
87
88 bb[0].low = Extent[0][0]; bb[0].high = Extent[0][1];
89 bb[1].low = Extent[1][0]; bb[1].high = Extent[1][1];
90
91 if( bb.size() > 2 )
92 {
93 bb[2].low = Extent[2][0]; bb[2].high = Extent[2][1];
94 }
95
96 return( true );
97 }
98
99 //-----------------------------------------------------
100 CSG_Data_Object * Get_Data_Object (void) { return( m_pData ); }
101
102
103 protected:
104
105 double m_zScale;
106
107 CSG_Data_Object *m_pData;
108
109
110 virtual bool Get_Extent (double Extent[3][2]) const { return( false ); }
111
112 };
113
114 //---------------------------------------------------------
115 class CSG_KDTree_Adaptor_Points : public CSG_KDTree_Adaptor
116 {
117 public:
118 CSG_KDTree_Adaptor_Points(CSG_Shapes *pPoints, int zField = -1, double zScale = 1.)
119 {
120 m_pData = m_pPoints = pPoints;
121 m_zField = m_pPoints && zField < m_pPoints->Get_Count() ? zField : -1;
122 m_zScale = zScale;
123 }
124
125 virtual ~CSG_KDTree_Adaptor_Points(void) {}
126
127 virtual size_t kdtree_get_point_count (void) const
128 {
129 return( m_pPoints->Get_Count() );
130 }
131
132 virtual double kdtree_get_pt (const size_t Index, int Dimension) const
133 {
134 CSG_Shape *pPoint = m_pPoints->Get_Shape(Index);
135
136 if( Dimension == 0 ) { return( pPoint->Get_Point().x ); }
137 if( Dimension == 1 ) { return( pPoint->Get_Point().y ); }
138 if( Dimension == 2 ) { return( (m_zField < 0 ? pPoint->Get_Z() : pPoint->asDouble(m_zField)) * m_zScale); }
139
140 return( 0. );
141 }
142
143
144 protected:
145
146 int m_zField;
147
148 CSG_Shapes *m_pPoints;
149
150
151 virtual bool Get_Extent (double Extent[3][2]) const
152 {
153 Extent[0][0] = m_pPoints->Get_Extent().Get_XMin();
154 Extent[0][1] = m_pPoints->Get_Extent().Get_XMax();
155 Extent[1][0] = m_pPoints->Get_Extent().Get_YMin();
156 Extent[1][1] = m_pPoints->Get_Extent().Get_YMax();
157 Extent[2][0] = m_zField < 0 ? m_pPoints->Get_ZMin() : m_pPoints->Get_Minimum(m_zField);
158 Extent[2][1] = m_zField < 0 ? m_pPoints->Get_ZMax() : m_pPoints->Get_Maximum(m_zField);
159
160 return( true );
161 }
162
163 };
164
165 //---------------------------------------------------------
166 class CSG_KDTree_Adaptor_PointCloud : public CSG_KDTree_Adaptor
167 {
168 public:
169 CSG_KDTree_Adaptor_PointCloud(CSG_PointCloud *pPoints, double zScale = 1.)
170 {
171 m_pData = m_pPoints = pPoints;
172 m_zScale = zScale;
173 }
174
175 virtual ~CSG_KDTree_Adaptor_PointCloud(void) {}
176
177 virtual size_t kdtree_get_point_count (void) const
178 {
179 return( m_pPoints->Get_Count() );
180 }
181
182 virtual double kdtree_get_pt (const size_t Index, int Dimension) const
183 {
184 if( Dimension == 0 ) { return( m_pPoints->Get_X((sLong)Index) ); }
185 if( Dimension == 1 ) { return( m_pPoints->Get_Y((sLong)Index) ); }
186 if( Dimension == 2 ) { return( m_pPoints->Get_Z((sLong)Index) * m_zScale ); }
187
188 return( 0. );
189 }
190
191
192 protected:
193
194 CSG_PointCloud *m_pPoints;
195
196
197 virtual bool Get_Extent (double Extent[3][2]) const
198 {
199 Extent[0][0] = m_pPoints->Get_Extent().Get_XMin();
200 Extent[0][1] = m_pPoints->Get_Extent().Get_XMax();
201 Extent[1][0] = m_pPoints->Get_Extent().Get_YMin();
202 Extent[1][1] = m_pPoints->Get_Extent().Get_YMax();
203 Extent[2][0] = m_pPoints-> Get_ZMin();
204 Extent[2][1] = m_pPoints-> Get_ZMax();
205
206 return( true );
207 }
208
209 };
210
211 //---------------------------------------------------------
212 class CSG_KDTree_Adaptor_Coordinates : public CSG_KDTree_Adaptor
213 {
214 public:
215 CSG_KDTree_Adaptor_Coordinates(const double **Points, size_t nPoints)
216 {
217 m_Points = Points;
218 m_nPoints = nPoints;
219 }
220
221 virtual ~CSG_KDTree_Adaptor_Coordinates(void) {}
222
223 virtual size_t kdtree_get_point_count (void) const
224 {
225 return( m_nPoints );
226 }
227
228 virtual double kdtree_get_pt (const size_t Index, int Dimension) const
229 {
230 return( m_Points[Index][Dimension] );
231 }
232
233
234 protected:
235
236 size_t m_nPoints;
237
238 const double **m_Points;
239
240 };
241
242
244 // //
245 // //
246 // //
248
249 //---------------------------------------------------------
250 CSG_KDTree::CSG_KDTree(void)
251 {
252 _On_Construction();
253 }
254
255 //---------------------------------------------------------
256 CSG_KDTree::~CSG_KDTree(void)
257 {}
258
259 //---------------------------------------------------------
260 void CSG_KDTree::_On_Construction(void)
261 {
262 m_pKDTree = NULL;
263 m_pAdaptor = NULL;
264 }
265
266 //---------------------------------------------------------
267 const char * CSG_KDTree::Get_Version(void)
268 {
269 static CSG_String Version(CSG_String::Format("nanoflann %d.%d.%d",
270 (NANOFLANN_VERSION&0xf00)/0x100,
271 (NANOFLANN_VERSION&0x0f0)/0x010,
272 (NANOFLANN_VERSION&0x00f)/0x001)
273 );
274
275 return( Version );
276 }
277
278 //---------------------------------------------------------
279 bool CSG_KDTree::Destroy(void)
280 {
281 SG_DELETE_SAFE(m_pAdaptor);
282
283 m_Points .Destroy();
284 m_Indices .Destroy();
285 m_Distances.Destroy();
286
287 return( true );
288 }
289
290 //---------------------------------------------------------
291 CSG_Shape * CSG_KDTree::Get_Match_Shape(size_t i) const
292 {
293 if( i < Get_Match_Count() )
294 {
295 CSG_Shapes *pShapes = m_pAdaptor && m_pAdaptor->Get_Data_Object() ? m_pAdaptor->Get_Data_Object()->asShapes() : NULL;
296
297 if( pShapes )
298 {
299 return( pShapes->Get_Shape(Get_Match_Index(i)) );
300 }
301 }
302
303 return( NULL );
304 }
305
306
308 // //
309 // //
310 // //
312
313 //---------------------------------------------------------
317 //---------------------------------------------------------
318 CSG_KDTree_2D::CSG_KDTree_2D(void)
319 {
320 _On_Construction();
321 }
322
323 //---------------------------------------------------------
324 CSG_KDTree_2D::~CSG_KDTree_2D(void)
325 {
326 Destroy();
327 }
328
329 //---------------------------------------------------------
335 //---------------------------------------------------------
336 CSG_KDTree_2D::CSG_KDTree_2D(CSG_Shapes *pPoints, int Field)
337 {
338 _On_Construction();
339
340 Create(pPoints, Field);
341 }
342
343 bool CSG_KDTree_2D::Create(CSG_Shapes *pPoints, int Field)
344 {
345 Destroy();
346
347 //-----------------------------------------------------
348 if( Field >= 0 && Field < pPoints->Get_Field_Count() )
349 {
350 m_Points.Create(3, (int)pPoints->Get_Count());
351
352 int n = 0;
353
354 for(int i=0; i<pPoints->Get_Count(); i++)
355 {
356 CSG_Shape *pPoint = pPoints->Get_Shape(i);
357
358 if( !pPoint->is_NoData(Field) )
359 {
360 m_Points[n][0] = pPoint->Get_Point().x;
361 m_Points[n][1] = pPoint->Get_Point().y;
362 m_Points[n][2] = pPoint->asDouble(Field);
363
364 n++;
365 }
366 }
367
368 m_Points.Set_Rows(n); // resize if there are no-data values
369
370 if( n < 1 )
371 {
372 Destroy();
373
374 return( false );
375 }
376
377 m_pAdaptor = new CSG_KDTree_Adaptor_Coordinates(m_Points, m_Points.Get_NRows());
378 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_2d(2, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
379
380 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->buildIndex();
381
382 return( true );
383 }
384
385 //-----------------------------------------------------
386 if( pPoints->Get_Count() < 1 )
387 {
388 return( false );
389 }
390
391 m_pAdaptor = new CSG_KDTree_Adaptor_Points(pPoints);
392 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_2d(2, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
393
394 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->buildIndex();
395
396 return( true );
397 }
398
399 //---------------------------------------------------------
403 //---------------------------------------------------------
404 CSG_KDTree_2D::CSG_KDTree_2D(CSG_PointCloud *pPoints)
405 {
406 _On_Construction();
407
408 Create(pPoints);
409 }
410
411 bool CSG_KDTree_2D::Create(CSG_PointCloud *pPoints)
412 {
413 if( pPoints->Get_Count() < 1 )
414 {
415 return( false );
416 }
417
418 Destroy();
419
420 m_pAdaptor = new CSG_KDTree_Adaptor_PointCloud(pPoints);
421 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_2d(2, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
422
423 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->buildIndex();
424
425 return( true );
426 }
427
428 //---------------------------------------------------------
433 //---------------------------------------------------------
434 CSG_KDTree_2D::CSG_KDTree_2D(const CSG_Matrix &Points)
435 {
436 _On_Construction();
437
438 Create(Points);
439 }
440
441 bool CSG_KDTree_2D::Create(const CSG_Matrix &Points)
442 {
443 if( Points.Get_NCols() < 2 )
444 {
445 return( false );
446 }
447
448 return( Create((const double **)Points.Get_Data(), Points.Get_NRows()) );
449 }
450
451 //---------------------------------------------------------
456 //---------------------------------------------------------
457 CSG_KDTree_2D::CSG_KDTree_2D(const double **Points, size_t nPoints)
458 {
459 _On_Construction();
460
461 Create(Points, nPoints);
462 }
463
464 bool CSG_KDTree_2D::Create(const double **Points, size_t nPoints)
465 {
466 if( nPoints < 1 )
467 {
468 return( false );
469 }
470
471 Destroy();
472
473 m_pAdaptor = new CSG_KDTree_Adaptor_Coordinates(Points, nPoints);
474 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_2d(2, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
475
476 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->buildIndex();
477
478 return( true );
479 }
480
481 //---------------------------------------------------------
482 bool CSG_KDTree_2D::Destroy(void)
483 {
484 if( m_pKDTree )
485 {
486 delete((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree);
487
488 m_pKDTree = NULL;
489 }
490
491 return( CSG_KDTree::Destroy() );
492 }
493
494
496 // //
498
499 //---------------------------------------------------------
500 size_t CSG_KDTree_2D::Get_Nearest_Points(double Coordinate[2], size_t Count, double Radius)
501 {
502 return( Get_Nearest_Points(Coordinate, Count, Radius, m_Indices, m_Distances) );
503 }
504
505 //---------------------------------------------------------
506 size_t CSG_KDTree_2D::Get_Nearest_Points(double Coordinate[2], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
507 {
508 if( Radius > 0. )
509 {
510 nanoflann::SearchParams SearchParams;
511
512 SearchParams.sorted = Count > 0;
513
514 std::vector<std::pair<size_t, double>> Matches;
515
516 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->radiusSearch(Coordinate, Radius*Radius, Matches, SearchParams);
517
518 if( Count == 0 || Count > Matches.size() )
519 {
520 Count = Matches.size();
521 }
522
523 Indices .Create(Count);
524 Distances.Create(Count);
525
526 for(size_t i=0; i<Count; i++)
527 {
528 Indices [i] = (int)Matches[i]. first ;
529 Distances[i] = sqrt(Matches[i].second);
530 }
531 }
532 else if( Count > 0 )
533 {
534 size_t *_Indices = new size_t[Count];
535
536 Distances.Create(Count);
537
538 Count = Get_Nearest_Points(Coordinate, Count, _Indices, Distances.Get_Data());
539
540 if( Count < (size_t)Distances.Get_N() )
541 {
542 Distances.Set_Rows(Count);
543 }
544
545 Indices.Create(Count);
546
547 for(size_t i=0; i<Count; i++)
548 {
549 Indices[i] = (int)(_Indices[i]);
550 }
551
552 delete[](_Indices);
553 }
554
555 return( Count );
556 }
557
558 //---------------------------------------------------------
559 size_t CSG_KDTree_2D::Get_Nearest_Points(double Coordinate[2], size_t Count, size_t *Indices, double *Distances)
560 {
561 Count = ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->knnSearch(Coordinate, Count, Indices, Distances);
562
563 for(size_t i=0; i<Count; i++)
564 {
565 Distances[i] = sqrt(Distances[i]);
566 }
567
568 return( Count );
569 }
570
571 //---------------------------------------------------------
572 bool CSG_KDTree_2D::Get_Nearest_Point(double Coordinate[2], size_t &Index, double &Distance)
573 {
574 return( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 );
575 }
576
577 //---------------------------------------------------------
578 bool CSG_KDTree_2D::Get_Nearest_Point(double Coordinate[2], size_t &Index)
579 {
580 double Distance;
581
582 return( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 );
583 }
584
585 //---------------------------------------------------------
586 bool CSG_KDTree_2D::Get_Nearest_Value(double Coordinate[2], double &Value)
587 {
588 size_t Index; double Distance;
589
590 if( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 )
591 {
592 Value = m_Points.Get_Data() ? Get_Point_Value(Index) : (double)Index;
593
594 return( true );
595 }
596
597 return( false );
598 }
599
600 //---------------------------------------------------------
601 CSG_Shape * CSG_KDTree_2D::Get_Nearest_Shape(double Coordinate[2])
602 {
603 size_t Index; CSG_Shapes *pShapes = m_pAdaptor && m_pAdaptor->Get_Data_Object() ? m_pAdaptor->Get_Data_Object()->asShapes() : NULL;
604
605 return( pShapes && Get_Nearest_Point(Coordinate, Index) ? pShapes->Get_Shape((sLong)Index) : NULL );
606 }
607
608 //---------------------------------------------------------
609 size_t CSG_KDTree_2D::Get_Duplicates(double Coordinate[2], CSG_Array_Int &Indices, CSG_Vector &Distances)
610 {
611 nanoflann::SearchParams SearchParams;
612
613 SearchParams.sorted = false;
614
615 std::vector<std::pair<size_t, double>> Matches;
616
617 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->radiusSearch(Coordinate, 0.0000001, Matches, SearchParams);
618
619 Indices .Create(Matches.size());
620 Distances.Create(Matches.size());
621
622 size_t Count = 0;
623
624 for(size_t i=0; i<Matches.size(); i++)
625 {
626 if( Matches[i].second > 0. )
627 {
628 Indices.Dec_Array();
629 }
630 else
631 {
632 Indices[Count++] = (int)Matches[i].first;
633 }
634 }
635
636 return( Count );
637 }
638
639 //---------------------------------------------------------
640 size_t CSG_KDTree_2D::Get_Duplicates(double Coordinate[2])
641 {
642 return( Get_Duplicates(Coordinate, m_Indices, m_Distances) );
643 }
644
645 //---------------------------------------------------------
646 size_t CSG_KDTree_2D::Get_Nearest_Points(double x, double y, size_t Count, double Radius)
647 {
648 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Points(c, Count, Radius) );
649 }
650
651 size_t CSG_KDTree_2D::Get_Nearest_Points(double x, double y, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
652 {
653 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Points(c, Count, Radius, Indices, Distances) );
654 }
655
656 size_t CSG_KDTree_2D::Get_Nearest_Points(double x, double y, size_t Count, size_t *Indices, double *Distances)
657 {
658 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Points(c, Count, Indices, Distances) );
659 }
660
661 bool CSG_KDTree_2D::Get_Nearest_Point(double x, double y, size_t &Index, double &Distance)
662 {
663 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Point(c, Index, Distance) );
664 }
665
666 bool CSG_KDTree_2D::Get_Nearest_Point(double x, double y, size_t &Index)
667 {
668 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Point(c, Index) );
669 }
670
671 bool CSG_KDTree_2D::Get_Nearest_Value(double x, double y, double &Value)
672 {
673 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Value(c, Value) );
674 }
675
676 CSG_Shape * CSG_KDTree_2D::Get_Nearest_Shape(double x, double y)
677 {
678 double c[2]; c[0] = x; c[1] = y; return( Get_Nearest_Shape(c) );
679 }
680
681 size_t CSG_KDTree_2D::Get_Duplicates(double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances)
682 {
683 double c[2]; c[0] = x; c[1] = y; return( Get_Duplicates(c, Indices, Distances) );
684 }
685
686 size_t CSG_KDTree_2D::Get_Duplicates(double x, double y)
687 {
688 double c[2]; c[0] = x; c[1] = y; return( Get_Duplicates(c) );
689 }
690
691
693 // //
694 // //
695 // //
697
698 //---------------------------------------------------------
699 CSG_KDTree_3D::CSG_KDTree_3D(void)
700 {
701 _On_Construction();
702 }
703
704 //---------------------------------------------------------
705 CSG_KDTree_3D::~CSG_KDTree_3D(void)
706 {
707 Destroy();
708 }
709
710 //---------------------------------------------------------
719 //---------------------------------------------------------
720 CSG_KDTree_3D::CSG_KDTree_3D(CSG_Shapes *pPoints, int Field, int zField, double zScale)
721 {
722 _On_Construction();
723
724 Create(pPoints, Field, zField, zScale);
725 }
726
727 bool CSG_KDTree_3D::Create(CSG_Shapes *pPoints, int Field, int zField, double zScale)
728 {
729 Destroy();
730
731 //-----------------------------------------------------
732 if( Field >= 0 && Field < pPoints->Get_Field_Count() )
733 {
734 m_Points.Create(4, (int)pPoints->Get_Count());
735
736 int n = 0;
737
738 for(int i=0; i<pPoints->Get_Count(); i++)
739 {
740 CSG_Shape *pPoint = pPoints->Get_Shape(i);
741
742 if( !pPoint->is_NoData(Field) )
743 {
744 m_Points[n][0] = pPoint->Get_Point().x;
745 m_Points[n][1] = pPoint->Get_Point().y;
746 m_Points[n][2] = zScale * (zField < 0 ? pPoint->Get_Z() : pPoint->asDouble(zField));
747 m_Points[n][3] = pPoint->asDouble(Field);
748
749 n++;
750 }
751 }
752
753 m_Points.Set_Rows(n); // resize if there are no-data values
754
755 if( n < 1 )
756 {
757 Destroy();
758
759 return( false );
760 }
761
762 m_pAdaptor = new CSG_KDTree_Adaptor_Coordinates(m_Points, m_Points.Get_NRows());
763 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_3d(3, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
764
765 ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->buildIndex();
766
767 return( true );
768 }
769
770 //-----------------------------------------------------
771 if( pPoints->Get_Count() < 1 )
772 {
773 return( false );
774 }
775
776 m_pAdaptor = new CSG_KDTree_Adaptor_Points(pPoints, zField, zScale);
777 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_3d(3, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
778
779 ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->buildIndex();
780
781 return( true );
782 }
783
784 //---------------------------------------------------------
785 CSG_KDTree_3D::CSG_KDTree_3D(CSG_PointCloud *pPoints)
786 {
787 _On_Construction();
788
789 Create(pPoints);
790 }
791
792 bool CSG_KDTree_3D::Create(CSG_PointCloud *pPoints)
793 {
794 if( pPoints->Get_Count() < 1 )
795 {
796 return( false );
797 }
798
799 Destroy();
800
801 m_pAdaptor = new CSG_KDTree_Adaptor_PointCloud(pPoints);
802 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_3d(3, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
803
804 ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->buildIndex();
805
806 return( true );
807 }
808
809 //---------------------------------------------------------
814 //---------------------------------------------------------
815 CSG_KDTree_3D::CSG_KDTree_3D(const CSG_Matrix &Points)
816 {
817 _On_Construction();
818
819 Create(Points);
820 }
821
822 bool CSG_KDTree_3D::Create(const CSG_Matrix &Points)
823 {
824 if( Points.Get_NCols() < 3 )
825 {
826 return( false );
827 }
828
829 return( Create((const double **)Points.Get_Data(), Points.Get_NRows()) );
830 }
831
832 //---------------------------------------------------------
837 //---------------------------------------------------------
838 CSG_KDTree_3D::CSG_KDTree_3D(const double **Points, size_t nPoints)
839 {
840 _On_Construction();
841
842 Create(Points, nPoints);
843 }
844
845 bool CSG_KDTree_3D::Create(const double **Points, size_t nPoints)
846 {
847 if( nPoints < 1 )
848 {
849 return( false );
850 }
851
852 Destroy();
853
854 m_pAdaptor = new CSG_KDTree_Adaptor_Coordinates(Points, nPoints);
855 m_pKDTree = new CSG_KDTree_Adaptor::kd_tree_3d(3, *m_pAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10));
856
857 ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->buildIndex();
858
859 return( true );
860 }
861
862 //---------------------------------------------------------
863 bool CSG_KDTree_3D::Destroy(void)
864 {
865 if( m_pKDTree )
866 {
867 delete((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree);
868
869 m_pKDTree = NULL;
870 }
871
872 return( CSG_KDTree::Destroy() );
873 }
874
875
877 // //
879
880 //---------------------------------------------------------
881 size_t CSG_KDTree_3D::Get_Nearest_Points(double Coordinate[3], size_t Count, double Radius)
882 {
883 return( Get_Nearest_Points(Coordinate, Count, Radius, m_Indices, m_Distances) );
884 }
885
886 //---------------------------------------------------------
887 size_t CSG_KDTree_3D::Get_Nearest_Points(double Coordinate[3], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
888 {
889 if( Radius > 0. )
890 {
891 nanoflann::SearchParams SearchParams;
892
893 SearchParams.sorted = Count > 0;
894
895 std::vector<std::pair<size_t, double>> Matches;
896
897 ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->radiusSearch(Coordinate, Radius*Radius, Matches, SearchParams);
898
899 if( Count == 0 || Count > Matches.size() )
900 {
901 Count = Matches.size();
902 }
903
904 Indices .Create(Count);
905 Distances.Create(Count);
906
907 for(size_t i=0; i<Count; i++)
908 {
909 Indices [i] = (int)Matches[i]. first ;
910 Distances[i] = sqrt(Matches[i].second);
911 }
912 }
913 else if( Count > 0 )
914 {
915 size_t *_Indices = new size_t[Count];
916
917 Distances.Create(Count);
918
919 Count = Get_Nearest_Points(Coordinate, Count, _Indices, Distances.Get_Data());
920
921 if( Count < (size_t)Distances.Get_N() )
922 {
923 Distances.Set_Rows(Count);
924 }
925
926 Indices.Create(Count);
927
928 for(size_t i=0; i<Count; i++)
929 {
930 Indices[i] = (int)(_Indices[i]);
931 }
932
933 delete[](_Indices);
934 }
935
936 return( Count );
937 }
938
939 //---------------------------------------------------------
940 size_t CSG_KDTree_3D::Get_Nearest_Points(double Coordinate[3], size_t Count, size_t *Indices, double *Distances)
941 {
942 Count = ((CSG_KDTree_Adaptor::kd_tree_3d *)m_pKDTree)->knnSearch(Coordinate, Count, Indices, Distances);
943
944 for(size_t i=0; i<Count; i++)
945 {
946 Distances[i] = sqrt(Distances[i]);
947 }
948
949 return( Count );
950 }
951
952 //---------------------------------------------------------
953 bool CSG_KDTree_3D::Get_Nearest_Point(double Coordinate[3], size_t &Index, double &Distance)
954 {
955 return( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 );
956 }
957
958 //---------------------------------------------------------
959 bool CSG_KDTree_3D::Get_Nearest_Point(double Coordinate[3], size_t &Index)
960 {
961 double Distance;
962
963 return( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 );
964 }
965
966 //---------------------------------------------------------
967 bool CSG_KDTree_3D::Get_Nearest_Value(double Coordinate[3], double &Value)
968 {
969 size_t Index; double Distance;
970
971 if( Get_Nearest_Points(Coordinate, 1, &Index, &Distance) == 1 )
972 {
973 Value = m_Points.Get_Data() ? Get_Point_Value(Index) : (double)Index;
974
975 return( true );
976 }
977
978 return( false );
979 }
980
981 //---------------------------------------------------------
982 CSG_Shape * CSG_KDTree_3D::Get_Nearest_Shape(double Coordinate[3])
983 {
984 size_t Index; CSG_Shapes *pShapes = m_pAdaptor && m_pAdaptor->Get_Data_Object() ? m_pAdaptor->Get_Data_Object()->asShapes() : NULL;
985
986 return( pShapes && Get_Nearest_Point(Coordinate, Index) ? pShapes->Get_Shape((sLong)Index) : NULL );
987 }
988
989 //---------------------------------------------------------
990 size_t CSG_KDTree_3D::Get_Duplicates(double Coordinate[3], CSG_Array_Int &Indices, CSG_Vector &Distances)
991 {
992 nanoflann::SearchParams SearchParams;
993
994 SearchParams.sorted = false;
995
996 std::vector<std::pair<size_t, double>> Matches;
997
998 ((CSG_KDTree_Adaptor::kd_tree_2d *)m_pKDTree)->radiusSearch(Coordinate, 0.0000001, Matches, SearchParams);
999
1000 Indices .Create(Matches.size());
1001 Distances.Create(Matches.size());
1002
1003 size_t Count = 0;
1004
1005 for(size_t i=0; i<Matches.size(); i++)
1006 {
1007 if( Matches[i].second > 0. )
1008 {
1009 Indices.Dec_Array();
1010 }
1011 else
1012 {
1013 Indices[Count++] = (int)Matches[i].first;
1014 }
1015 }
1016
1017 return( Count );
1018 }
1019
1020 //---------------------------------------------------------
1021 size_t CSG_KDTree_3D::Get_Duplicates(double Coordinate[3])
1022 {
1023 return( Get_Duplicates(Coordinate, m_Indices, m_Distances) );
1024 }
1025
1026 //---------------------------------------------------------
1027 size_t CSG_KDTree_3D::Get_Nearest_Points(double x, double y, double z, size_t Count, double Radius)
1028 {
1029 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Points(c, Count, Radius) );
1030 }
1031
1032 size_t CSG_KDTree_3D::Get_Nearest_Points(double x, double y, double z, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances)
1033 {
1034 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Points(c, Count, Radius, Indices, Distances) );
1035 }
1036
1037 size_t CSG_KDTree_3D::Get_Nearest_Points(double x, double y, double z, size_t Count, size_t *Indices, double *Distances)
1038 {
1039 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Points(c, Count, Indices, Distances) );
1040 }
1041
1042 bool CSG_KDTree_3D::Get_Nearest_Point(double x, double y, double z, size_t &Index, double &Distance)
1043 {
1044 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Point(c, Index, Distance) );
1045 }
1046
1047 bool CSG_KDTree_3D::Get_Nearest_Point(double x, double y, double z, size_t &Index)
1048 {
1049 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Point(c, Index) );
1050 }
1051
1052 bool CSG_KDTree_3D::Get_Nearest_Value(double x, double y, double z, double &Value)
1053 {
1054 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Value(c, Value) );
1055 }
1056
1057 CSG_Shape * CSG_KDTree_3D::Get_Nearest_Shape(double x, double y, double z)
1058 {
1059 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Nearest_Shape(c) );
1060 }
1061
1062 size_t CSG_KDTree_3D::Get_Duplicates(double x, double y, double z, CSG_Array_Int &Indices, CSG_Vector &Distances)
1063 {
1064 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Duplicates(c, Indices, Distances) );
1065 }
1066
1067 size_t CSG_KDTree_3D::Get_Duplicates(double x, double y, double z)
1068 {
1069 double c[3]; c[0] = x; c[1] = y; c[2] = z; return( Get_Duplicates(c) );
1070 }
1071
1072
1074 // //
1075 // //
1076 // //
1078
1079 //---------------------------------------------------------
1080 #include "parameters.h"
1081
1082 //---------------------------------------------------------
1083 CSG_Parameters_Point_Search::CSG_Parameters_Point_Search(void)
1084 {
1085 m_pParameters = NULL;
1086
1087 m_minPoints = 1;
1088 m_maxPoints = 0;
1089 m_Radius = 0.;
1090 }
1091
1092 //---------------------------------------------------------
1093 bool CSG_Parameters_Point_Search::Create(CSG_Parameters *pParameters, const CSG_String &Parent, size_t minPoints)
1094 {
1095 if( pParameters == NULL || m_pParameters != NULL )
1096 {
1097 return( false );
1098 }
1099
1100 m_pParameters = pParameters;
1101
1102 if( !Parent.is_Empty() && !(*m_pParameters)(Parent) )
1103 {
1104 m_pParameters->Add_Node("", Parent, _TL("Search Options"), _TL(""));
1105 }
1106
1107 //-----------------------------------------------------
1108 m_pParameters->Add_Choice(Parent,
1109 "SEARCH_RANGE" , _TL("Search Range"),
1110 _TL(""),
1111 CSG_String::Format("%s|%s",
1112 _TL("local"),
1113 _TL("global")
1114 ), 1
1115 );
1116
1117 m_pParameters->Add_Double("SEARCH_RANGE",
1118 "SEARCH_RADIUS" , _TL("Maximum Search Distance"),
1119 _TL("local maximum search distance given in map units"),
1120 1000., 0., true
1121 );
1122
1123 m_pParameters->Add_Choice(Parent,
1124 "SEARCH_POINTS_ALL" , _TL("Number of Points"),
1125 _TL(""),
1126 CSG_String::Format("%s|%s",
1127 _TL("maximum number of nearest points"),
1128 _TL("all points within search distance")
1129 ), 1
1130 );
1131
1132 if( minPoints > 0 )
1133 {
1134 m_pParameters->Add_Int("SEARCH_POINTS_ALL",
1135 "SEARCH_POINTS_MIN" , _TL("Minimum"),
1136 _TL("minimum number of points to use"),
1137 (int)minPoints, 1, true
1138 );
1139 }
1140
1141 m_pParameters->Add_Int("SEARCH_POINTS_ALL",
1142 "SEARCH_POINTS_MAX" , _TL("Maximum"),
1143 _TL("maximum number of nearest points"),
1144 20, 1, true
1145 );
1146
1147 return( true );
1148 }
1149
1150
1152 // //
1154
1155 //---------------------------------------------------------
1156 bool CSG_Parameters_Point_Search::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
1157 {
1158 if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) || !pParameter || !pParameter->asShapes() )
1159 {
1160 return( false );
1161 }
1162
1163 pParameters->Set_Parameter("SEARCH_RADIUS", SG_Get_Rounded_To_SignificantFigures(
1164 5 * sqrt(pParameter->asShapes()->Get_Extent().Get_Area() / pParameter->asShapes()->Get_Count()), 1
1165 ));
1166
1167 return( true );
1168 }
1169
1170 //---------------------------------------------------------
1171 bool CSG_Parameters_Point_Search::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
1172 {
1173 if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) || !pParameter )
1174 {
1175 return( false );
1176 }
1177
1178 if( pParameter->Cmp_Identifier("SEARCH_RANGE") )
1179 {
1180 pParameters->Set_Enabled("SEARCH_RADIUS" , pParameter->asInt() == 0); // local
1181 pParameters->Set_Enabled("SEARCH_POINTS_MIN", pParameter->asInt() == 0); // when global, no minimum number of points
1182 }
1183
1184 if( pParameter->Cmp_Identifier("SEARCH_POINTS_ALL") )
1185 {
1186 pParameters->Set_Enabled("SEARCH_POINTS_MAX", pParameter->asInt() == 0); // maximum number of points
1187 pParameters->Set_Enabled("SEARCH_DIRECTION" , pParameter->asInt() == 0); // maximum number of points per quadrant
1188 }
1189
1190 return( true );
1191 }
1192
1193
1195 // //
1197
1198 //---------------------------------------------------------
1199 bool CSG_Parameters_Point_Search::Update(void)
1200 {
1201 if( m_pParameters )
1202 {
1203 m_minPoints = (*m_pParameters)("SEARCH_POINTS_MIN")
1204 ? (*m_pParameters)("SEARCH_POINTS_MIN")->asInt () : 0;
1205 m_maxPoints = (*m_pParameters)("SEARCH_POINTS_ALL")->asInt () == 0
1206 ? (*m_pParameters)("SEARCH_POINTS_MAX")->asInt () : 0;
1207 m_Radius = (*m_pParameters)("SEARCH_RANGE" )->asInt () == 0
1208 ? (*m_pParameters)("SEARCH_RADIUS" )->asDouble() : 0.;
1209
1210 return( true );
1211 }
1212
1213 return( false );
1214 }
1215
1216 //---------------------------------------------------------
1217 bool CSG_Parameters_Point_Search::Do_Use_All(bool bUpdate)
1218 {
1219 if( bUpdate )
1220 {
1221 Update();
1222 }
1223
1224 return( m_maxPoints == 0 && m_Radius <= 0. );
1225 }
1226
1227
1229 // //
1230 // //
1231 // //
1233
1234 //---------------------------------------------------------
1235 CSG_Parameters_Point_Search_KDTree_2D::CSG_Parameters_Point_Search_KDTree_2D(void)
1236 {
1237 Finalize();
1238 }
1239
1240
1242 // //
1244
1245 //---------------------------------------------------------
1246 bool CSG_Parameters_Point_Search_KDTree_2D::Initialize(CSG_Shapes *pPoints, int zField)
1247 {
1248 if( !Finalize() || !m_pParameters || !pPoints || pPoints->Get_Count() < 1 || !Update() )
1249 {
1250 return( false );
1251 }
1252
1253 if( Do_Use_All() )
1254 {
1255 m_pPoints = pPoints;
1256 m_zField = zField;
1257
1258 return( true );
1259 }
1260
1261 return( m_Search.Create(pPoints, m_zField = zField) );
1262 }
1263
1264 //---------------------------------------------------------
1265 bool CSG_Parameters_Point_Search_KDTree_2D::Finalize(void)
1266 {
1267 m_pPoints = NULL;
1268 m_zField = -1;
1269
1270 m_Search.Destroy();
1271
1272 return( true );
1273 }
1274
1275
1277 // //
1279
1280 //---------------------------------------------------------
1281 sLong CSG_Parameters_Point_Search_KDTree_2D::Set_Location(double x, double y)
1282 {
1283 if( m_pPoints ) // without search engine
1284 {
1285 return( m_pPoints->Get_Count() );
1286 }
1287 else // using search engine
1288 {
1289 return( m_Search.Get_Nearest_Points(x, y, m_maxPoints, m_Radius) );
1290 }
1291 }
1292
1293 //---------------------------------------------------------
1294 sLong CSG_Parameters_Point_Search_KDTree_2D::Set_Location(const CSG_Point &p)
1295 {
1296 return( Set_Location(p.x, p.y) );
1297 }
1298
1299
1301 // //
1303
1304 //---------------------------------------------------------
1305 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Point(sLong Index, double &x, double &y, double &z)
1306 {
1307 if( m_pPoints ) // without search engine
1308 {
1309 CSG_Shape *pPoint = m_pPoints->Get_Shape(Index);
1310
1311 if( pPoint && !pPoint->is_NoData(m_zField) )
1312 {
1313 x = pPoint->Get_Point().x;
1314 y = pPoint->Get_Point().y;
1315
1316 z = m_zField < 0 ? (double)Index : pPoint->asDouble(m_zField);
1317
1318 return( true );
1319 }
1320 }
1321 else // using search engine
1322 {
1323 if( Index >= 0 && (size_t)Index < m_Search.Get_Match_Count() )
1324 {
1325 if( m_zField >= 0 )
1326 {
1327 double *p = m_Search.Get_Point((size_t)Index);
1328
1329 x = p[0]; y = p[1]; z = p[2];
1330
1331 return( true );
1332 }
1333 else
1334 {
1335 CSG_Shape *pPoint = m_Search.Get_Match_Shape((size_t)Index);
1336
1337 if( pPoint )
1338 {
1339 x = pPoint->Get_Point().x;
1340 y = pPoint->Get_Point().y;
1341
1342 z = (double)Index;
1343
1344 return( true );
1345 }
1346 }
1347 }
1348 }
1349
1350 return( false );
1351 }
1352
1353
1355 // //
1357
1358 //---------------------------------------------------------
1359 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(double x, double y, CSG_Points_3D &Points)
1360 {
1361 CSG_Array_Int Index; if( Get_Points(x, y, Index) )
1362 {
1363 Points.Clear();
1364
1365 for(sLong i=0; i<Index.Get_Size(); i++)
1366 {
1367 if( m_zField >= 0 )
1368 {
1369 double *p = m_Search.Get_Point((size_t)Index[i]);
1370
1371 Points.Add(p[0], p[1], p[2]);
1372 }
1373 else
1374 {
1375 CSG_Shape *pPoint = m_Search.Get_Match_Shape((size_t)Index[i]);
1376
1377 if( pPoint )
1378 {
1379 Points.Add(pPoint->Get_Point().x, pPoint->Get_Point().y, (double)Index[i]);
1380 }
1381 }
1382 }
1383
1384 return( true );
1385 }
1386
1387 return( false );
1388 }
1389
1390 //---------------------------------------------------------
1391 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(const CSG_Point &p, CSG_Points_3D &Points)
1392 {
1393 return( Get_Points(p.x, p.y, Points) );
1394 }
1395
1396
1398 // //
1400
1401 //---------------------------------------------------------
1402 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(double x, double y, CSG_Array_Int &Indices)
1403 {
1404 if( m_pPoints ) // without search engine
1405 {
1406 return( m_pPoints->Get_Count() );
1407 }
1408 else // using search engine
1409 {
1410 CSG_Vector Distances;
1411
1412 return( m_Search.Get_Nearest_Points(x, y, m_maxPoints, m_Radius, Indices, Distances) >= m_minPoints );
1413 }
1414 }
1415
1416 //---------------------------------------------------------
1417 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(const CSG_Point &p, CSG_Array_Int &Indices)
1418 {
1419 return( Get_Points(p.x, p.y, Indices) );
1420 }
1421
1422 //---------------------------------------------------------
1423 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances)
1424 {
1425 if( m_pPoints ) // without search engine
1426 {
1427 return( m_pPoints->Get_Count() );
1428 }
1429 else // using search engine
1430 {
1431 return( m_Search.Get_Nearest_Points(x, y, m_maxPoints, m_Radius, Indices, Distances) >= m_minPoints );
1432 }
1433 }
1434
1435 //---------------------------------------------------------
1436 bool CSG_Parameters_Point_Search_KDTree_2D::Get_Points(const CSG_Point &p, CSG_Array_Int &Indices, CSG_Vector &Distances)
1437 {
1438 return( Get_Points(p.x, p.y, Indices, Distances) );
1439 }
1440
1441
1443 // //
1444 // //
1445 // //
1447
1448 //---------------------------------------------------------
CSG_KDTree_2D::~CSG_KDTree_2D
virtual ~CSG_KDTree_2D(void)
Definition: kdtree.cpp:324
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_KDTree_3D::Get_Nearest_Value
virtual bool Get_Nearest_Value(double Coordinate[3], double &Value)
Definition: kdtree.cpp:967
CSG_Points_3D
Definition: geo_tools.h:320
CSG_KDTree::m_Points
CSG_Matrix m_Points
Definition: shapes.h:1249
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Parameters_Point_Search::Create
virtual bool Create(class CSG_Parameters *pParameters, const CSG_String &Parent="", size_t minPoints=0)
Definition: kdtree.cpp:1093
CSG_Points_3D::Add
bool Add(double x, double y, double z)
Definition: geo_classes.cpp:582
CSG_Vector::Get_Data
double * Get_Data(void) const
Definition: mat_tools.h:369
CSG_KDTree::Get_Match_Shape
CSG_Shape * Get_Match_Shape(size_t i) const
Definition: kdtree.cpp:291
CSG_KDTree_2D::Get_Duplicates
virtual size_t Get_Duplicates(double Coordinate[2], CSG_Array_Int &Indices, CSG_Vector &Distances)
Definition: kdtree.cpp:609
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_KDTree_2D::Get_Nearest_Shape
virtual CSG_Shape * Get_Nearest_Shape(double Coordinate[2])
Definition: kdtree.cpp:601
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
CSG_KDTree_3D::Destroy
virtual bool Destroy(void)
Definition: kdtree.cpp:863
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
CSG_KDTree_3D::Get_Nearest_Point
virtual bool Get_Nearest_Point(double Coordinate[3], size_t &Index, double &Distance)
Definition: kdtree.cpp:953
CSG_Parameters_Point_Search::Do_Use_All
bool Do_Use_All(void) const
Definition: shapes.h:1374
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Parameters_Point_Search::On_Parameters_Enable
virtual bool On_Parameters_Enable(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
Definition: kdtree.cpp:1171
CSG_Parameters_Point_Search::On_Parameter_Changed
virtual bool On_Parameter_Changed(class CSG_Parameters *pParameters, class CSG_Parameter *pParameter)
Definition: kdtree.cpp:1156
CSG_KDTree::m_pKDTree
void * m_pKDTree
Definition: shapes.h:1243
SG_Get_Rounded_To_SignificantFigures
double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
Definition: mat_tools.cpp:107
CSG_KDTree_2D::Get_Nearest_Value
virtual bool Get_Nearest_Value(double Coordinate[2], double &Value)
Definition: kdtree.cpp:586
CSG_Array_Int::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:434
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:371
CSG_Array_Int::Create
int * Create(const CSG_Array_Int &Array)
Definition: api_memory.cpp:551
CSG_KDTree::m_Distances
CSG_Vector m_Distances
Definition: shapes.h:1247
CSG_Parameters_Point_Search_KDTree_2D::Set_Location
sLong Set_Location(double x, double y)
Definition: kdtree.cpp:1281
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:508
CSG_KDTree::_On_Construction
void _On_Construction(void)
Definition: kdtree.cpp:260
CSG_KDTree_3D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1332
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:326
CSG_KDTree::~CSG_KDTree
virtual ~CSG_KDTree(void)
Definition: kdtree.cpp:256
CSG_Shapes::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:813
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Matrix::Get_Data
double ** Get_Data(void) const
Definition: mat_tools.h:511
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Matrix::Get_NCols
sLong Get_NCols(void) const
Definition: mat_tools.h:507
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_KDTree_2D::Create
bool Create(CSG_Shapes *pPoints, int Field=-1)
Definition: kdtree.cpp:343
CSG_Parameters_Point_Search::CSG_Parameters_Point_Search
CSG_Parameters_Point_Search(void)
Definition: kdtree.cpp:1083
CSG_Vector
Definition: mat_tools.h:345
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Parameter
Definition: parameters.h:207
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Array_Int::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:442
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Parameter::asShapes
CSG_Shapes * asShapes(void) const
Definition: parameter.cpp:979
CSG_Parameters_Point_Search_KDTree_2D::Get_Point
bool Get_Point(sLong Index, double &x, double &y, double &z)
Definition: kdtree.cpp:1305
CSG_KDTree::CSG_KDTree
CSG_KDTree(void)
Definition: kdtree.cpp:250
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
CSG_KDTree_3D::CSG_KDTree_3D
CSG_KDTree_3D(void)
Definition: kdtree.cpp:699
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Parameters_Point_Search_KDTree_2D::Get_Points
bool Get_Points(double x, double y, CSG_Points_3D &Points)
Definition: kdtree.cpp:1359
CSG_Parameters_Point_Search::Update
bool Update(void)
Definition: kdtree.cpp:1199
CSG_Parameters_Point_Search_KDTree_2D::Finalize
bool Finalize(void)
Definition: kdtree.cpp:1265
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
CSG_KDTree_2D::Get_Nearest_Points
virtual size_t Get_Nearest_Points(double Coordinate[2], size_t Count, double Radius)
Definition: kdtree.cpp:500
CSG_PointCloud::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: pointcloud.cpp:1399
CSG_Array_Int
Definition: api_core.h:421
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Table::Get_Maximum
double Get_Maximum(int iField) const
Definition: table.h:369
CSG_KDTree::m_pAdaptor
class CSG_KDTree_Adaptor * m_pAdaptor
Definition: shapes.h:1241
pointcloud.h
CSG_Matrix::Set_Rows
bool Set_Rows(sLong nRows)
Definition: mat_matrix.cpp:974
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_KDTree_2D::Destroy
virtual bool Destroy(void)
Definition: kdtree.cpp:482
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_KDTree_3D::Get_Nearest_Points
virtual size_t Get_Nearest_Points(double Coordinate[3], size_t Count, double Radius)
Definition: kdtree.cpp:881
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1685
CSG_KDTree_3D::Get_Duplicates
virtual size_t Get_Duplicates(double Coordinate[3], CSG_Array_Int &Indices, CSG_Vector &Distances)
Definition: kdtree.cpp:990
CSG_KDTree_3D::Get_Nearest_Shape
virtual CSG_Shape * Get_Nearest_Shape(double Coordinate[3])
Definition: kdtree.cpp:982
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
CSG_Parameters_Point_Search::m_pParameters
class CSG_Parameters * m_pParameters
Definition: shapes.h:1391
CSG_String
Definition: api_core.h:557
CSG_KDTree::Get_Match_Index
size_t Get_Match_Index(size_t i) const
Definition: shapes.h:1226
CSG_Parameters_Point_Search::m_maxPoints
size_t m_maxPoints
Definition: shapes.h:1387
CSG_KDTree_3D::Create
bool Create(CSG_Shapes *pPoints, int Field=-1, int zField=-1, double zScale=1.)
Definition: kdtree.cpp:727
CSG_Table::Get_Minimum
double Get_Minimum(int iField) const
Definition: table.h:368
CSG_KDTree_2D::Get_Nearest_Point
virtual bool Get_Nearest_Point(double Coordinate[2], size_t &Index, double &Distance)
Definition: kdtree.cpp:572
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Parameters_Point_Search::m_minPoints
size_t m_minPoints
Definition: shapes.h:1387
SG_DELETE_SAFE
#define SG_DELETE_SAFE(PTR)
Definition: api_core.h:206
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Matrix::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:923
CSG_Parameters_Point_Search_KDTree_2D::Initialize
bool Initialize(CSG_Shapes *pPoints, int zField=-1)
Definition: kdtree.cpp:1246
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_KDTree::Get_Version
static const char * Get_Version(void)
Definition: kdtree.cpp:267
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_KDTree::m_Indices
CSG_Array_Int m_Indices
Definition: shapes.h:1245
CSG_KDTree::Destroy
virtual bool Destroy(void)
Definition: kdtree.cpp:279
CSG_KDTree::Get_Point
double * Get_Point(int i) const
Definition: shapes.h:1231
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1348
CSG_Parameters_Point_Search_KDTree_2D::CSG_Parameters_Point_Search_KDTree_2D
CSG_Parameters_Point_Search_KDTree_2D(void)
Definition: kdtree.cpp:1235
CSG_Shapes
Definition: shapes.h:773
CSG_PointCloud
Definition: pointcloud.h:105
CSG_KDTree::Get_Match_Count
size_t Get_Match_Count(void) const
Definition: shapes.h:1225
CSG_Parameters
Definition: parameters.h:1650
CSG_KDTree_2D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1282
CSG_Parameter::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameter.cpp:552
CSG_Vector::Set_Rows
bool Set_Rows(sLong nRows)
Definition: mat_matrix.cpp:140
CSG_KDTree_3D::~CSG_KDTree_3D
virtual ~CSG_KDTree_3D(void)
Definition: kdtree.cpp:705
CSG_Matrix
Definition: mat_tools.h:463
CSG_Array_Int::Destroy
void Destroy(void)
Definition: api_core.h:429
CSG_Shape
Definition: shapes.h:141
CSG_KDTree_2D::CSG_KDTree_2D
CSG_KDTree_2D(void)
Definition: kdtree.cpp:318
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
CSG_Parameters_Point_Search::m_Radius
double m_Radius
Definition: shapes.h:1389
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_formula.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions | Variables
mat_formula.cpp File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <ctype.h>
#include "mat_tools.h"
#include "grid.h"

Go to the source code of this file.

Macros

#define | MAX_PARMS 3
#define | MAX_CTABLE 255
#define | STD_FNC_NUM 19
#define | GET_VALUE_BUFSIZE 500
#define | EPSILON 1e-9

Functions

static double | f_atan2 (double x, double val)
static double | f_pow (double x, double val)
static double | f_gt (double x, double val)
static double | f_lt (double x, double val)
static double | f_eq (double x, double val)
static double | f_min (double a, double b)
static double | f_max (double a, double b)
static double | f_pi (void)
static double | f_int (double x)
static double | f_sqr (double x)
static double | f_fmod (double x, double val)
static double | f_rand_u (double min, double max)
static double | f_rand_g (double mean, double stdv)
static double | f_and (double x, double y)
static double | f_or (double x, double y)
static double | f_ifelse (double condition, double x, double y)

Variables

static CSG_Formula::TSG_Function gSG_Functions [MAX_CTABLE]

Macro Definition Documentation

◆ EPSILON

#define EPSILON 1e-9

Definition at line 92 of file mat_formula.cpp.

◆ GET_VALUE_BUFSIZE

#define GET_VALUE_BUFSIZE 500

Definition at line 89 of file mat_formula.cpp.

◆ MAX_CTABLE

#define MAX_CTABLE 255

Definition at line 84 of file mat_formula.cpp.

◆ MAX_PARMS

#define MAX_PARMS 3

Definition at line 83 of file mat_formula.cpp.

◆ STD_FNC_NUM

#define STD_FNC_NUM 19

Definition at line 86 of file mat_formula.cpp.

Function Documentation

◆ f_and()

static double f_and | ( | double | x,
 |  | double | y
 | ) |  |
static

Definition at line 180 of file mat_formula.cpp.

◆ f_atan2()

static double f_atan2 | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 102 of file mat_formula.cpp.

◆ f_eq()

static double f_eq | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 126 of file mat_formula.cpp.

References EPSILON.

◆ f_fmod()

static double f_fmod | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 162 of file mat_formula.cpp.

◆ f_gt()

static double f_gt | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 114 of file mat_formula.cpp.

◆ f_ifelse()

static double f_ifelse | ( | double | condition,
 |  | double | x,
 |  | double | y
 | ) |  |
static

Definition at line 192 of file mat_formula.cpp.

◆ f_int()

static double f_int ( double x )
static

Definition at line 150 of file mat_formula.cpp.

◆ f_lt()

static double f_lt | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 120 of file mat_formula.cpp.

◆ f_max()

static double f_max | ( | double | a,
 |  | double | b
 | ) |  |
static

Definition at line 138 of file mat_formula.cpp.

◆ f_min()

static double f_min | ( | double | a,
 |  | double | b
 | ) |  |
static

Definition at line 132 of file mat_formula.cpp.

◆ f_or()

static double f_or | ( | double | x,
 |  | double | y
 | ) |  |
static

Definition at line 186 of file mat_formula.cpp.

◆ f_pi()

static double f_pi ( void )
static

Definition at line 144 of file mat_formula.cpp.

References M_PI.

◆ f_pow()

static double f_pow | ( | double | x,
 |  | double | val
 | ) |  |
static

Definition at line 108 of file mat_formula.cpp.

◆ f_rand_g()

static double f_rand_g | ( | double | mean,
 |  | double | stdv
 | ) |  |
static

Definition at line 174 of file mat_formula.cpp.

References CSG_Random::Get_Gaussian().

◆ f_rand_u()

static double f_rand_u | ( | double | min,
 |  | double | max
 | ) |  |
static

Definition at line 168 of file mat_formula.cpp.

References CSG_Random::Get_Uniform().

◆ f_sqr()

static double f_sqr ( double x )
static

Definition at line 156 of file mat_formula.cpp.

Variable Documentation

◆ gSG_Functions

CSG_Formula::TSG_Function gSG_Functions[MAX_CTABLE]
static

Definition at line 206 of file mat_formula.cpp.

Referenced by CSG_Formula::CSG_Formula().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_formula.cpp Source File

  • saga_core
  • saga_api
mat_formula.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_formula.cpp //
15 // //
16 // Copyright (C) 2002 by Andre Ringeler //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // e-mail: aringel@saga-gis.org //
42 // //
43 // contact: Andre Ringeler //
44 // Institute of Geography //
45 // University of Goettingen //
46 // Goldschmidtstr. 5 //
47 // 37077 Goettingen //
48 // Germany //
49 // //
50 //-------------------------------------------------------//
51 // //
52 // Based on //
53 // FORMULC.C 2.22 as of 2/19/98 //
54 // Copyright (c) 1993 - 98 by Harald Helfgott //
55 // //
56 // Modified for Grid Data by Andre Ringeler 2001 //
57 // Modified for Function-Fitting by Andre Ringeler 2002 //
58 // Converted to C++ by Andre Ringeler 2002 //
59 // //
60 // Modified to fit SAGA needs by Olaf Conrad 2002 //
61 // //
63
64 //---------------------------------------------------------
65 #include <string.h>
66 #include <stdlib.h>
67 #include <stdio.h>
68 #include <stdarg.h>
69 #include <errno.h>
70 #include <ctype.h>
71
72 #include "mat_tools.h"
73 #include "grid.h"
74
75
77 // //
78 // //
79 // //
81
82 //---------------------------------------------------------
83 #define MAX_PARMS 3
84 #define MAX_CTABLE 255
85
86 #define STD_FNC_NUM 19
87
88 //---------------------------------------------------------
89 #define GET_VALUE_BUFSIZE 500
90
91 //---------------------------------------------------------
92 #define EPSILON 1e-9
93
94
96 // //
97 // //
98 // //
100
101 //---------------------------------------------------------
102 static double f_atan2(double x, double val)
103 {
104 return( atan2(x, val) );
105 }
106
107 //---------------------------------------------------------
108 static double f_pow(double x, double val)
109 {
110 return( pow(x, val) );
111 }
112
113 //---------------------------------------------------------
114 static double f_gt(double x, double val)
115 {
116 return( x > val ? 1.0 : 0.0 );
117 }
118
119 //---------------------------------------------------------
120 static double f_lt(double x, double val)
121 {
122 return( x < val ? 1.0 : 0.0 );
123 }
124
125 //---------------------------------------------------------
126 static double f_eq(double x, double val)
127 {
128 return( fabs(x - val) < EPSILON ? 1.0 : 0.0 );
129 }
130
131 //---------------------------------------------------------
132 static double f_min(double a, double b)
133 {
134 return( a < b ? a : b );
135 }
136
137 //---------------------------------------------------------
138 static double f_max(double a, double b)
139 {
140 return( a > b ? a : b );
141 }
142
143 //---------------------------------------------------------
144 static double f_pi(void)
145 {
146 return( M_PI );
147 }
148
149 //---------------------------------------------------------
150 static double f_int(double x)
151 {
152 return( (int)(x) );
153 }
154
155 //---------------------------------------------------------
156 static double f_sqr(double x)
157 {
158 return( x*x );
159 }
160
161 //---------------------------------------------------------
162 static double f_fmod(double x, double val)
163 {
164 return( fmod(x, val) );
165 }
166
167 //---------------------------------------------------------
168 static double f_rand_u(double min, double max)
169 {
170 return( CSG_Random::Get_Uniform(min, max) );
171 }
172
173 //---------------------------------------------------------
174 static double f_rand_g(double mean, double stdv)
175 {
176 return( CSG_Random::Get_Gaussian(mean, stdv) );
177 }
178
179 //---------------------------------------------------------
180 static double f_and(double x, double y)
181 {
182 return( x != 0.0 && y != 0.0 ? 1.0 : 0.0 );
183 }
184
185 //---------------------------------------------------------
186 static double f_or(double x, double y)
187 {
188 return( x != 0.0 || y != 0.0 ? 1.0 : 0.0 );
189 }
190
191 //---------------------------------------------------------
192 static double f_ifelse(double condition, double x, double y)
193 {
194 return( condition ? x : y );
195 // return( fabs(condition) >= EPSILON ? x : y );
196 }
197
198
200 // //
201 // //
202 // //
204
205 //---------------------------------------------------------
206 static CSG_Formula::TSG_Function gSG_Functions[MAX_CTABLE] =
207 {
208 { "exp" , (TSG_Formula_Function_1)exp , 1, false }, // 1
209 { "ln" , (TSG_Formula_Function_1)log , 1, false }, // 2
210 { "sin" , (TSG_Formula_Function_1)sin , 1, false }, // 3
211 { "cos" , (TSG_Formula_Function_1)cos , 1, false }, // 4
212 { "tan" , (TSG_Formula_Function_1)tan , 1, false }, // 5
213 { "asin" , (TSG_Formula_Function_1)asin , 1, false }, // 6
214 { "acos" , (TSG_Formula_Function_1)acos , 1, false }, // 7
215 { "atan" , (TSG_Formula_Function_1)atan , 1, false }, // 8
216 { "atan2" , (TSG_Formula_Function_1)f_atan2 , 2, false }, // 9
217 { "abs" , (TSG_Formula_Function_1)fabs , 1, false }, // 10
218 { "sqrt" , (TSG_Formula_Function_1)sqrt , 1, false }, // 11
219 { "gt" , (TSG_Formula_Function_1)f_gt , 2, false }, // 12
220 { "lt" , (TSG_Formula_Function_1)f_lt , 2, false }, // 13
221 { "eq" , (TSG_Formula_Function_1)f_eq , 2, false }, // 14
222 { "pi" , (TSG_Formula_Function_1)f_pi , 0, false }, // 15
223 { "int" , (TSG_Formula_Function_1)f_int , 1, false }, // 16
224 { "mod" , (TSG_Formula_Function_1)f_fmod , 2, false }, // 17
225 { "ifelse", (TSG_Formula_Function_1)f_ifelse, 3, false }, // 18
226 { "log" , (TSG_Formula_Function_1)log10 , 1, false }, // 19
227 { "pow" , (TSG_Formula_Function_1)f_pow , 2, false }, // 20
228 { "sqr" , (TSG_Formula_Function_1)f_sqr , 1, false }, // 21
229 { "rand_u", (TSG_Formula_Function_1)f_rand_u, 2, true }, // 22
230 { "rand_g", (TSG_Formula_Function_1)f_rand_g, 2, true }, // 23
231 { "and" , (TSG_Formula_Function_1)f_and , 2, false }, // 24
232 { "or" , (TSG_Formula_Function_1)f_or , 2, false }, // 25
233 { "min" , (TSG_Formula_Function_1)f_min , 2, false }, // 26
234 { "max" , (TSG_Formula_Function_1)f_max , 2, false }, // 27
235 { NULL , (TSG_Formula_Function_1) NULL , 0, false }
236 };
237
238
240 // //
241 // //
242 // //
244
245 //---------------------------------------------------------
246 CSG_Formula::CSG_Formula(void)
247 {
248 m_Formula.code = NULL;
249 m_Formula.ctable = NULL;
250
251 m_bError = false;
252
253 m_ctable = NULL;
254 m_error = NULL;
255
256 //-----------------------------------------------------
257 m_Functions = (TSG_Function *)SG_Calloc(MAX_CTABLE, sizeof(TSG_Function));
258
259 for(int i=0; i<MAX_CTABLE; i++)
260 {
261 m_Functions[i].Name = gSG_Functions[i].Name;
262 m_Functions[i].Function = gSG_Functions[i].Function;
263 m_Functions[i].nParameters = gSG_Functions[i].nParameters;
264 m_Functions[i].bVarying = gSG_Functions[i].bVarying;
265 }
266 }
267
268 //---------------------------------------------------------
269 CSG_Formula::~CSG_Formula(void)
270 {
271 Destroy();
272
273 SG_Free(m_Functions);
274 }
275
276 //---------------------------------------------------------
277 bool CSG_Formula::Destroy(void)
278 {
279 SG_FREE_SAFE(m_Formula.code);
280 SG_FREE_SAFE(m_Formula.ctable);
281
282 m_bError = false;
283
284 return( true );
285 }
286
287
289 // //
290 // //
291 // //
293
294 //---------------------------------------------------------
295 CSG_String CSG_Formula::Get_Help_Operators(bool bHTML, const CSG_String Additional[][2])
296 {
297 const int nOperators = 35;
298
299 CSG_String Operators[nOperators][2] =
300 {
301 { "+" , _TL("Addition") },
302 { "-" , _TL("Subtraction") },
303 { "*" , _TL("Multiplication") },
304 { "/" , _TL("Division") },
305 { "abs(x)" , _TL("Absolute Value") },
306 { "mod(x, y)" , _TL("Returns the floating point remainder of x/y") },
307 { "int(x)" , _TL("Returns the integer part of floating point value x") },
308 { "sqr(x)" , _TL("Square") },
309 { "sqrt(x)" , _TL("Square Root") },
310 { "exp(x)" , _TL("Exponential") },
311 { "pow(x, y)" , _TL("Returns x raised to the power of y") },
312 { "x ^ y" , _TL("Returns x raised to the power of y") },
313 { "ln(x)" , _TL("Natural Logarithm") },
314 { "log(x)" , _TL("Base 10 Logarithm") },
315 { "pi()" , _TL("Returns the value of Pi") },
316 { "sin(x)" , _TL("Sine, expects radians") },
317 { "cos(x)" , _TL("Cosine, expects radians") },
318 { "tan(x)" , _TL("Tangent, expects radians") },
319 { "asin(x)" , _TL("Arcsine, returns radians") },
320 { "acos(x)" , _TL("Arccosine, returns radians") },
321 { "atan(x)" , _TL("Arctangent, returns radians") },
322 { "atan2(x, y)" , _TL("Arctangent of x/y, returns radians") },
323 { "min(x, y)" , _TL("Returns the minimum of values x and y") },
324 { "max(x, y)" , _TL("Returns the maximum of values x and y") },
325 { "gt(x, y)" , _TL("Returns true (1), if x is greater than y, else false (0)") },
326 { "x > y" , _TL("Returns true (1), if x is greater than y, else false (0)") },
327 { "lt(x, y)" , _TL("Returns true (1), if x is less than y, else false (0)") },
328 { "x < y" , _TL("Returns true (1), if x is less than y, else false (0)") },
329 { "eq(x, y)" , _TL("Returns true (1), if x equals y, else false (0)") },
330 { "x = y" , _TL("Returns true (1), if x equals y, else false (0)") },
331 { "and(x, y)" , _TL("Returns true (1), if both x and y are true (i.e. not 0)") },
332 { "or(x, y)" , _TL("Returns true (1), if at least one of both x and y is true (i.e. not 0)") },
333 { "ifelse(c, x, y)", _TL("Returns x, if condition c is true (i.e. not 0), else y") },
334 { "rand_u(x, y)" , _TL("Random number, uniform distribution with minimum x and maximum y") },
335 { "rand_g(x, y)" , _TL("Random number, Gaussian distribution with mean x and standard deviation y") }
336 };
337
338 //-----------------------------------------------------
339 int i;
340 CSG_String s;
341
342 if( bHTML )
343 {
344 s += "<table border=\"0\">";
345
346 for(i=0; i<nOperators; i++)
347 {
348 CSG_String op = Operators[i][0]; op.Replace("<", "&lt;");
349
350 s += "<tr><td><b>" + op + "</b></td><td>" + Operators[i][1] + "</td></tr>";
351 }
352
353 if( Additional )
354 {
355 for(i=0; !Additional[i][0].is_Empty(); i++)
356 {
357 CSG_String op = Additional[i][0]; op.Replace("<", "&lt;");
358
359 s += "<tr><td><b>" + op + "</b></td><td>" + Additional[i][1] + "</td></tr>";
360 }
361 }
362
363 s += "</table>";
364 }
365 else
366 {
367 for(i=0; i<nOperators; i++)
368 {
369 s += Operators[i][0] + " - " + Operators[i][1] + "\n";
370 }
371
372 if( Additional )
373 {
374 for(i=0; !Additional[i][0].is_Empty(); i++)
375 {
376 s += Additional[i][0] + " - " + Additional[i][1] + "\n";
377 }
378 }
379 }
380
381 return( s );
382 }
383
384 //---------------------------------------------------------
385 bool CSG_Formula::Get_Error(CSG_String &Message)
386 {
387 if( m_bError )
388 {
389 Message = CSG_String::Format("%s %s %d\n", _TL("Error in formula"), _TL("at position"), m_Error_Position);
390
391 if( m_Error_Position < 0 || m_Error_Position >= (int)m_sFormula.Length() )
392 {
393 Message += m_sFormula;
394 }
395 else
396 {
397 Message += m_sFormula.Left (m_Error_Position) + " ["
398 + m_sFormula [m_Error_Position] + "] "
399 + m_sFormula.Right(m_sFormula.Length() - (m_Error_Position + 1));
400 }
401
402 Message += "\n";
403 Message += m_sError;
404 Message += "\n";
405
406 return( true );
407 }
408
409 return( false );
410 }
411
412 //---------------------------------------------------------
413 void CSG_Formula::_Set_Error(const CSG_String &Error)
414 {
415 if( Error.is_Empty() )
416 {
417 m_bError = false;
418 m_sError .Clear();
419 }
420 else
421 {
422 m_bError = true;
423 m_sError = Error;
424 }
425 }
426
427
429 // //
431
432 //---------------------------------------------------------
433 void CSG_Formula::Set_Variable(char Var, double Value)
434 {
435 m_Parameters[Var - 'a'] = Value;
436 }
437
438 //---------------------------------------------------------
439 bool CSG_Formula::Set_Formula(const CSG_String &Formula)
440 {
441 if( Formula.Length() > 0 )
442 {
443 Destroy();
444
445 m_sFormula = Formula;
446 m_Formula = _Translate(Formula, "abcdefghijklmnopqrstuvwxyz", &m_Length, &m_Error_Position);
447
448 if( m_Formula.code != NULL )
449 {
450 return( true );
451 }
452 }
453
454 Destroy();
455
456 return( false );
457 }
458
459
461 // //
463
464 //---------------------------------------------------------
465 double CSG_Formula::Get_Value(void) const
466 {
467 return( _Get_Value(m_Parameters, m_Formula) );
468 }
469
470 //---------------------------------------------------------
471 double CSG_Formula::Get_Value(double x) const
472 {
473 double Parameters[32];
474
475 memcpy(Parameters, m_Parameters, 32 * sizeof(double));
476
477 Parameters['x'-'a'] = x;
478
479 return( _Get_Value(Parameters, m_Formula) );
480 }
481
482 //---------------------------------------------------------
483 double CSG_Formula::Get_Value(const CSG_Vector &Values) const
484 {
485 return( Get_Value(Values.Get_Data(), Values.Get_N()) );
486 }
487
488 //---------------------------------------------------------
489 double CSG_Formula::Get_Value(double *Values, int nValues) const
490 {
491 double Parameters[32];
492
493 for(int i=0; i<nValues; i++)
494 {
495 Parameters[i] = Values[i];
496 }
497
498 return( _Get_Value(Parameters, m_Formula) );
499 }
500
501 //---------------------------------------------------------
502 double CSG_Formula::Get_Value(const char *Args, ...) const
503 {
504 double Parameters[32];
505
506 va_list ap;
507
508 va_start(ap, Args);
509
510 while( *Args )
511 {
512 Parameters[(*Args++) - 'a'] = va_arg(ap, double);
513 }
514
515 va_end(ap);
516
517 return( _Get_Value(Parameters, m_Formula) );
518 }
519
520 //---------------------------------------------------------
521 double CSG_Formula::_Get_Value(const double *Parameters, TSG_Formula func) const
522 {
523 double x, y, z, buffer[GET_VALUE_BUFSIZE];
524
525 double *bufp = buffer; // points to the first free space in the buffer
526 char *function = func.code;
527 double *ctable = func.ctable;
528 double result;
529
530 if( !function )
531 {
532 return( 0 ); // _Set_Error(_TL("empty coded function"));
533 }
534
535 for( ; ; )
536 {
537 switch( *function++ )
538 {
539 case '\0':
540 return( buffer[0] );
541
542 case 'D':
543 *bufp++ = ctable[*function++];
544 break;
545
546 case 'V':
547 *bufp++ = Parameters[(*function++) - 'a'];
548 break;
549
550 case 'M':
551 result = -(*--bufp);
552 *bufp++ = result;
553 break;
554
555 case '+':
556 y = *(--bufp);
557 result = y + *(--bufp);
558 *bufp++ = result;
559 break;
560
561 case '-':
562 y = *--bufp;
563 result = *(--bufp) - y;
564 *bufp++ = result;
565 break;
566
567 case '*':
568 y = *(--bufp);
569 result = *(--bufp) * y;
570 *bufp++ = result;
571 break;
572
573 case '/':
574 y = *--bufp;
575 result = *(--bufp) / y;
576 *bufp++ = result;
577 break;
578
579 case '^':
580 y = *--bufp;
581 result = pow(*(--bufp), y);
582 *bufp++ = result;
583 break;
584
585 case '=':
586 y = *--bufp;
587 result = y == *(--bufp) ? 1.0 : 0.0;
588 *bufp++ = result;
589 break;
590
591 case '>':
592 y = *--bufp;
593 result = y < *(--bufp) ? 1.0 : 0.0;
594 *bufp++ = result;
595 break;
596
597 case '<':
598 y = *--bufp;
599 result = y > *(--bufp) ? 1.0 : 0.0;
600 *bufp++ = result;
601 break;
602
603 case '&':
604 y = *--bufp;
605 result = y && *(--bufp) ? 1.0 : 0.0;
606 *bufp++ = result;
607 break;
608
609 case '|':
610 y = *--bufp;
611 result = y || *(--bufp) ? 1.0 : 0.0;
612 *bufp++ = result;
613 break;
614
615 case 'F':
616 switch (m_Functions[*function].nParameters)
617 {
618 case 0:
619 *bufp++ = ((TSG_Formula_Function_0)m_Functions[*function++].Function)();
620 break;
621
622 case 1:
623 x = *--bufp;
624 *bufp++ = ((TSG_Formula_Function_1)m_Functions[*function++].Function)(x);
625 break;
626
627 case 2:
628 y = *--bufp;
629 x = *--bufp;
630 *bufp++ = ((TSG_Formula_Function_2)m_Functions[*function++].Function)(x, y);
631 break;
632
633 case 3:
634 z = *--bufp;
635 y = *--bufp;
636 x = *--bufp;
637 *bufp++ = ((TSG_Formula_Function_3)m_Functions[*function++].Function)(x, y, z);
638 break;
639
640 default:
641 return( 0 ); // _Set_Error(_TL("I2: too many parameters"));
642 }
643 break;
644
645 default:
646 return( 0 ); // _Set_Error(_TL("I1: unrecognizable operator"));
647 }
648 }
649
650 // if( (bufp - buffer) != 1 ) // _Set_Error(_TL("I3: corrupted buffer"));
651
652 return( buffer[0] );
653 }
654
655
657 // //
658 // //
659 // //
661
662 //---------------------------------------------------------
663 const char * CSG_Formula::Get_Used_Variables(void)
664 {
665 static CSG_String ret;
666
667 ret.Clear();
668
669 for(int i=0; i<'z'-'a'; i++)
670 {
671 if( m_Vars_Used[i] == true )
672 {
673 ret.Append((char)(i + 'a'));
674 }
675 }
676
677 return( ret );
678 }
679
680
682 // //
683 // //
684 // //
686
687 //---------------------------------------------------------
688 // int varying; Does the result of the function vary
689 // even when the parameters stay the same?
690 // varying = 1 for e.g. random - number generators.
691 // Result: 0 is rendered if there is an error
692 // 1 is rendered otherwise
693 //
694 bool CSG_Formula::Add_Function(const char *Name, TSG_Formula_Function_1 Function, int nParameters, bool bVarying)
695 {
696 if( nParameters < 0 || nParameters > 3 )
697 {
698 _Set_Error(_TL("invalid number of parameters"));
699
700 return( false );
701 }
702
703 TSG_Function *pFunction;
704
705 for(pFunction=m_Functions; pFunction->Function && strcmp(Name, pFunction->Name); pFunction++)
706 {}
707
708 if( pFunction->Function != NULL ) // old function is superseded
709 {
710 pFunction->Function = Function;
711 pFunction->nParameters = nParameters;
712 pFunction->bVarying = bVarying;
713
714 _Set_Error();
715
716 return( true );
717 }
718
719 if( (pFunction - m_Functions) >= MAX_CTABLE - 1 )
720 {
721 _Set_Error(_TL("function table full"));
722
723 return( false );
724 }
725
726 pFunction->Name = Name;
727 pFunction->Function = Function;
728 pFunction->nParameters = nParameters;
729 pFunction->bVarying = bVarying;
730
731 _Set_Error();
732
733 return( true );
734 }
735
736
738 // //
740
741 //---------------------------------------------------------
742 int CSG_Formula::_Get_Function(int i, char *Name, int *nParameters, int *bVarying)
743 {
744 if( !m_Functions[i].Function )
745 {
746 _Set_Error(_TL("index out of bounds"));
747
748 return( 0 );
749 }
750
751 strcpy(Name , m_Functions[i].Name);
752 *nParameters = m_Functions[i].nParameters;
753 *bVarying = m_Functions[i].bVarying ? 1 : 0;
754
755 _Set_Error();
756
757 return( 1 );
758 }
759
760 //---------------------------------------------------------
761 // If the function exists, _Get_Function() returns the index
762 // of its name in the table. Otherwise, it returns -1.
763 //
764 int CSG_Formula::_Get_Function(const char *Name)
765 {
766 TSG_Function *pFunction;
767
768 for(pFunction=m_Functions; pFunction->Function && strcmp(Name, pFunction->Name); pFunction++)
769 {}
770
771 if( pFunction->Function == NULL )
772 {
773 _Set_Error(_TL("function not found"));
774
775 return( -1 );
776 }
777
778 _Set_Error();
779
780 return( (int)(pFunction - m_Functions) );
781 }
782
783
785 // //
786 // //
787 // //
789
790 //---------------------------------------------------------
791 inline int CSG_Formula::_is_Operand(char c)
792 {
793 return( (c == '+')
794 || (c == '-')
795 || (c == '*')
796 || (c == '/')
797 || (c == '^')
798 || (c == '=')
799 || (c == '<')
800 || (c == '>')
801 || (c == '&')
802 || (c == '|')
803 );
804 }
805
806 //---------------------------------------------------------
807 inline int CSG_Formula::_is_Operand_Code(char c)
808 {
809 return( (c == '+')
810 || (c == '-')
811 || (c == '*')
812 || (c == '/')
813 || (c == '^')
814 || (c == '=')
815 || (c == '<')
816 || (c == '>')
817 || (c == '&')
818 || (c == '|')
819 || (c == 'M')
820 );
821 }
822
823 //---------------------------------------------------------
824 inline int CSG_Formula::_is_Number(char c)
825 {
826 return( isdigit(c) || c == '.' || c == 'E' );
827 }
828
829
831 // //
832 // //
833 // //
835
837 // Interpreting functions //
839
840 //---------------------------------------------------------
841 CSG_Formula::TSG_Formula CSG_Formula::_Translate(const char *sourc, const char *args, int *leng, int *error)
842 {
843 const char *scan, *scarg;
844 char *result, *source, *code, *nfunc;
845 size_t size_estim;
846 double *ctable;
847 TSG_Formula returned;
848
849 //-----------------------------------------------------
850 *leng = 0;
851 *error = 0;
852 m_error = NULL;
853 returned.code = NULL;
854 returned.ctable = NULL;
855
856 //-----------------------------------------------------
857 source = (char *)SG_Malloc((strlen(sourc) + 1) * sizeof(char));
858
859 if( source == NULL )
860 {
861 _Set_Error(_TL("no memory"));
862
863 return( returned );
864 }
865
866 strcpy(source, sourc);
867
868 for(scan=source; *scan!='\0'; scan++)
869 {
870 if( islower(*scan) && !isalpha(*(scan + 1)) && (scan == source || !isalpha(*(scan - 1))) )
871 {
872 for(scarg=args; *scarg!='\0' && *scarg != *scan; scarg++)
873 {}
874
875 if( *scarg == '\0' )
876 {
877 _Set_Error(_TL("undeclared parameter"));
878
879 m_error = scan;
880 *error = (int)(m_error - source);
881
882 SG_Free(source);
883
884 return (returned);
885 }
886 }
887 }
888
889 //-----------------------------------------------------
890 size_estim = _max_size(source);
891
892 if( !(code = (char *)SG_Malloc(size_estim)) )
893 {
894 _Set_Error(_TL("no memory"));
895
896 *error = -1;
897
898 SG_Free(source);
899
900 return (returned);
901 }
902
903
904 //-----------------------------------------------------
905 m_pctable = 0;
906
907 if( !(m_ctable = (double *)SG_Malloc(MAX_CTABLE * sizeof(double))) )
908 {
909 _Set_Error(_TL("no memory"));
910
911 *error = -1;
912
913 SG_Free(source);
914 SG_Free(code);
915
916 return (returned);
917 }
918
919 ctable = m_ctable;
920
921 //-----------------------------------------------------
922 _Set_Error();
923
924 result = _i_trans(code, (char *)source, (char *)source + strlen(source));
925
926 if( !result || m_bError )
927 {
928 *error = (int)(m_error ? m_error - source : -1);
929
930 SG_Free(source);
931 SG_Free(code);
932 SG_Free(m_ctable);
933
934 return (returned);
935 }
936 else
937 {
938 *result = '\0';
939 *error = -1;
940 *leng = (int)(result - code);
941
942 if( ((*leng) + 1) * sizeof(char) > size_estim )
943 {
944 _Set_Error(_TL("I4: size estimate too small"));
945
946 SG_Free(source);
947
948 return( returned );
949 }
950 else if( ((*leng) + 1) * sizeof(char) < size_estim )
951 {
952 nfunc = (char *)SG_Malloc(((*leng) + 1) * sizeof(char));
953
954 if (nfunc)
955 {
956 memcpy(nfunc, code, ((*leng) + 1) * sizeof(char));
957 SG_Free(code);
958 code = nfunc;
959 }
960 }
961
962 if( m_pctable < MAX_CTABLE )
963 {
964 ctable = (double *)SG_Malloc(m_pctable * sizeof(double));
965
966 if( ctable )
967 {
968 memcpy(ctable, m_ctable, m_pctable * sizeof(double));
969
970 SG_Free(m_ctable);
971 }
972 else
973 {
974 ctable = m_ctable;
975 }
976 }
977 else
978 {
979 ctable = m_ctable;
980 }
981
982 returned.code = code;
983 returned.ctable = ctable;
984
985 _Set_Error();
986
987 SG_Free(source);
988
989 return (returned);
990 }
991 }
992
993
995 // //
996 // //
997 // //
999
1000 //---------------------------------------------------------
1001 char * CSG_Formula::_i_trans(char *function, char *begin, char *end)
1002 {
1003 char tempch, *scan, *endf, *tempu, *temp3, *temps = NULL, *par_buf, *paramstr[MAX_PARMS];
1004 int i, pars, space, n_function;
1005 double tempd;
1006
1007 if( begin >= end )
1008 {
1009 _Set_Error(_TL("missing operand"));
1010 m_error = begin;
1011 return NULL;
1012 }
1013
1014 for(pars = 0, scan = begin; scan < end && pars >= 0; scan++)
1015 {
1016 if( *scan == '(' ) { pars++; } else
1017 if( *scan == ')' ) { pars--; }
1018 }
1019
1020 if( pars < 0 || pars > 0 )
1021 {
1022 _Set_Error(_TL("unmatched parentheses"));
1023 m_error = scan - 1;
1024 return NULL;
1025 }
1026
1027 for(pars = 0, scan = end - 1; scan >= begin; scan--)
1028 {
1029 if( *scan == '(' ) pars++; else
1030 if( *scan == ')' ) pars--; else
1031 if( !pars && (*scan == '+' || ((*scan == '-') && scan != begin)) && (scan == begin || *(scan - 1) != 'E') )
1032 break;
1033 }
1034
1035 if( scan >= begin )
1036 {
1037 if ((tempu = _i_trans(function, begin, scan)) &&
1038 (temp3 = _i_trans(tempu, scan + 1, end)))
1039 {
1040 *temp3++ = *scan;
1041 temp3 = _comp_time(function, temp3, 2);
1042 if( m_bError )
1043 return NULL;
1044 else
1045 return temp3;
1046 }
1047 else
1048 return NULL;
1049 }
1050
1051 for (pars = 0, scan = end - 1; scan >= begin; scan--)
1052 {
1053 if (*scan == '(') pars++;
1054 else if (*scan == ')')
1055 pars--;
1056 else if (!pars &&(*scan == '*' || *scan == '/'))
1057 break;
1058 }
1059 if (scan >= begin)
1060 {
1061 if ((tempu = _i_trans(function, begin, scan)) &&
1062 (temp3 = _i_trans(tempu, scan + 1, end)))
1063 {
1064 *temp3++ = *scan;
1065 temp3 = _comp_time(function, temp3, 2);
1066 if (m_bError)
1067 return NULL;
1068 else
1069 return temp3;
1070 }
1071 else
1072 return NULL;
1073 }
1074
1075 /* unary minus */
1076 if (*begin == '-')
1077 {
1078 tempu = _i_trans(function, begin + 1, end);
1079 if (tempu)
1080 {
1081 *tempu++ = 'M';
1082 tempu = _comp_time(function, tempu, 1);
1083 if (m_bError)
1084 return NULL;
1085 else
1086 return tempu;
1087 }
1088 else
1089 return NULL;
1090 }
1091
1092 for (pars = 0, scan = end - 1; scan >= begin; scan--)
1093 {
1094 if (*scan == '(') pars++;
1095 else if (*scan == ')')
1096 pars--;
1097 else if (!pars &&(*scan == '^'))
1098 break;
1099 else if (!pars &&(*scan == '='))
1100 break;
1101 else if (!pars &&(*scan == '>'))
1102 break;
1103 else if (!pars &&(*scan == '<'))
1104 break;
1105 else if (!pars &&(*scan == '&'))
1106 break;
1107 else if (!pars &&(*scan == '|'))
1108 break;
1109 }
1110
1111 if (scan >= begin)
1112 {
1113 if ((tempu = _i_trans(function, begin, scan)) &&
1114 (temp3 = _i_trans(tempu, scan + 1, end)))
1115 {
1116 *temp3++ = *scan;
1117 temp3 = _comp_time(function, temp3, 2);
1118 if (m_bError)
1119 return NULL;
1120 else
1121 return temp3;
1122 }
1123 else
1124 return NULL;
1125 }
1126
1127 /* erase white space */
1128 while (isspace(*begin))
1129 begin++;
1130 while (isspace(*(end - 1)))
1131 end--;
1132
1133 if (*begin == '(' && *(end - 1) == ')')
1134 return _i_trans(function, begin + 1, end - 1);
1135
1136 if (end == begin + 1 && islower(*begin))
1137 {
1138 *function++ = 'V';
1139 *function++ = *begin;
1140 return function;
1141 }
1142
1143 tempch = *end;
1144 *end = '\0';
1145 tempd = strtod(begin, (char **)&tempu);
1146 *end = tempch;
1147
1148 if( (char *)tempu == end )
1149 {
1150 *function++ = 'D';
1151 if (m_pctable < MAX_CTABLE)
1152 {
1153 m_ctable[m_pctable] = tempd;
1154 *function++ = (char)m_pctable++;
1155 }
1156 else
1157 {
1158 _Set_Error(_TL("too many constants"));
1159 m_error = begin;
1160 return NULL;
1161 }
1162 return function;
1163 }
1164
1165 /*function*/
1166 if (!isalpha(*begin) && *begin != '_')
1167 {
1168 _Set_Error(_TL("syntax error"));
1169 m_error = begin;
1170 return NULL;
1171 }
1172
1173 for(endf = begin + 1; endf < end &&(isalnum(*endf) || *endf == '_'); endf++)
1174 {}
1175
1176 tempch = *endf;
1177 *endf = '\0';
1178 if ((n_function = _Get_Function(begin)) == -1)
1179 {
1180 *endf = tempch;
1181 m_error = begin;
1182 return NULL;
1183 }
1184 *endf = tempch;
1185 if (*endf != '(' || *(end - 1) != ')')
1186 {
1187 _Set_Error(_TL("improper function syntax"));
1188 m_error = endf;
1189 return NULL;
1190 }
1191
1192 if( m_Functions[n_function].nParameters == 0 )
1193 {
1194 /*function without parameters(e.g. pi()) */
1195 space = 1;
1196 for (scan = endf + 1; scan <(end - 1); scan++)
1197 if (!isspace(*scan))
1198 space = 0;
1199 if (space)
1200 {
1201 *function++ = 'F';
1202 *function++ = n_function;
1203 function = _comp_time(function - 2, function, 0);
1204 if (m_bError)
1205 return NULL; /* internal error in _comp_time */
1206 else
1207 return function;
1208 }
1209 else
1210 {
1211 m_error = endf + 1;
1212 _Set_Error(_TL("too many parameters"));
1213 return NULL;
1214 }
1215 }
1216 else
1217 { /*function with parameters*/
1218 tempch = *(end - 1);
1219 *(end - 1) = '\0';
1220 par_buf = (char *)SG_Malloc(sizeof(char) * (strlen(endf + 1) + 1));
1221
1222 if (!par_buf)
1223 {
1224 _Set_Error(_TL("no memory"));
1225 m_error = NULL;
1226 return NULL;
1227 }
1228
1229 strcpy(par_buf, endf + 1);
1230 *(end - 1) = tempch;
1231
1232 for (i = 0; i < m_Functions[n_function].nParameters; i++)
1233 {
1234 if ((temps = _my_strtok((i == 0) ? par_buf : NULL)) == NULL)
1235 break;
1236 paramstr[i] = temps;
1237 }
1238
1239 if (temps == NULL)
1240 {
1241 SG_Free(par_buf);
1242 m_error = end - 2;
1243 _Set_Error(_TL("too few parameters"));
1244 return NULL;
1245 }
1246
1247 if ((temps = _my_strtok(NULL)) != NULL)
1248 {
1249 SG_Free(par_buf);
1250 m_error =(temps - par_buf) +(endf + 1);
1251 _Set_Error(_TL("too many parameters"));
1252 return NULL;
1253 }
1254
1255 tempu = function;
1256 for (i = 0; i < m_Functions[n_function].nParameters; i++)
1257 if( !(tempu = _i_trans(tempu, paramstr[i], paramstr[i] + strlen(paramstr[i]))) )
1258 {
1259 m_error =(m_error - par_buf) +(endf + 1);
1260 SG_Free(par_buf);
1261
1262 return NULL;
1263 }
1264
1265 /* OK */
1266 SG_Free(par_buf);
1267 *tempu++ = 'F';
1268 *tempu++ = n_function;
1269 tempu = _comp_time(function, tempu, m_Functions[n_function].nParameters);
1270 if (m_bError)
1271 return NULL; /* internal error in _comp_time */
1272 else
1273 return tempu;
1274 }
1275 }
1276
1277 //---------------------------------------------------------
1278 char * CSG_Formula::_comp_time(char *function, char *fend, int npars)
1279 {
1280 char *scan, temp;
1281 int i;
1282 double tempd;
1283 TSG_Formula trans;
1284
1285 scan = function;
1286 for (i = 0; i < npars; i++)
1287 {
1288 if (*scan++ != 'D')
1289 return fend;
1290 scan++;
1291 }
1292
1293 if (!((scan == fend -(sizeof((char) 'F') + sizeof(char))
1294 && *(fend - 2) == 'F' && m_Functions[*(fend - 1)].bVarying == 0) ||
1295 (scan == fend - sizeof(char)
1296 && _is_Operand_Code(*(fend - 1))))
1297 )
1298 return fend;
1299
1300 temp = *fend;
1301 *fend = '\0';
1302
1303 trans.code = function;
1304 trans.ctable = m_ctable;
1305 tempd = _Get_Value(m_Parameters, trans);
1306 *fend = temp;
1307 *function++ = 'D';
1308 m_pctable -= npars;
1309 *function++ =(char) m_pctable;
1310 m_ctable[m_pctable++] = tempd;
1311
1312 return function;
1313 }
1314
1315 //---------------------------------------------------------
1316 int CSG_Formula::_max_size(const char *source)
1317 {
1318 int numbers = 0;
1319 int functions = 0;
1320 int operators = 0;
1321 int variables = 0;
1322
1323 const size_t var_size = 2 * sizeof(char);
1324 const size_t num_size = sizeof(char) + sizeof(double);
1325 const size_t op_size = sizeof(char);
1326 const size_t end_size = sizeof('\0');
1327
1328 for(int i=0; i<'z'-'a'; i++)
1329 {
1330 m_Vars_Used[i] = false;
1331 }
1332
1333 for(const char *scan=source; *scan; scan++)
1334 {
1335 if( isalpha(*scan) && (*scan != 'E') )
1336 {
1337 if( isalpha(*(scan + 1)) || isdigit(*(scan + 1)) )
1338 {
1339 // must be a function name (combination of letters and digits, e.g. sin(..), atan2(..))
1340 }
1341 else if( *(scan + 1) == '(' )
1342 {
1343 functions++;
1344 }
1345 else
1346 {
1347 variables++;
1348 m_Vars_Used[(int)(*scan - 'a')] = true;
1349 }
1350 }
1351 }
1352
1353 if( _is_Operand(*source) )
1354 {
1355 operators++;
1356 }
1357
1358 if( *source != '\0' )
1359 {
1360 for(const char *scan=source+1; *scan; scan++)
1361 {
1362 if( _is_Operand(*scan) && *(scan - 1) != 'E' )
1363 {
1364 operators++;
1365 }
1366 }
1367 }
1368
1369 const char *scan = source;
1370
1371 while( *scan )
1372 {
1373 if( _is_Number(*scan) || ((*scan == '+' || *scan == '-') && scan > source && *(scan - 1) == 'E') )
1374 {
1375 numbers++;
1376 scan++;
1377
1378 while( _is_Number(*scan) ||((*scan == '+' || *scan == '-') && scan > source && *(scan - 1) == 'E') )
1379 scan++;
1380 }
1381 else
1382 {
1383 scan++;
1384 }
1385 }
1386
1387 return( numbers*num_size + operators*op_size + functions*num_size + variables*var_size + end_size );
1388 }
1389
1390 //---------------------------------------------------------
1391 char * CSG_Formula::_my_strtok(char *s)
1392 {
1393 static char *token = NULL;
1394
1395 if( s != NULL )
1396 token = s;
1397 else if( token != NULL )
1398 s = token;
1399 else
1400 return( NULL );
1401
1402 for(int pars=0; *s != '\0' && (*s != ',' || pars != 0); s++)
1403 {
1404 if (*s == '(') ++pars;
1405 if (*s == ')') --pars;
1406 }
1407
1408 if( *s == '\0' )
1409 {
1410 s = token;
1411 token = NULL;
1412 }
1413 else
1414 {
1415 *s = '\0';
1416 char *next_token = s + 1;
1417 s = token;
1418 token = next_token;
1419 }
1420
1421 return( s );
1422 }
1423
1424
1426 // //
1427 // //
1428 // //
1430
1431 //---------------------------------------------------------
CSG_Formula::Add_Function
bool Add_Function(const char *Name, TSG_Formula_Function_1 Function, int nParameters, bool bVarying=false)
Definition: mat_formula.cpp:694
CSG_Formula::Get_Error
bool Get_Error(CSG_String &Message)
Definition: mat_formula.cpp:385
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Formula::SSG_Function::Function
TSG_Formula_Function_1 Function
Definition: mat_tools.h:1882
CSG_Formula::CSG_Formula
CSG_Formula(void)
Definition: mat_formula.cpp:246
gSG_Functions
static CSG_Formula::TSG_Function gSG_Functions[MAX_CTABLE]
Definition: mat_formula.cpp:206
CSG_String::Append
CSG_String & Append(const CSG_String &String)
Definition: api_string.cpp:355
_TL
#define _TL(s)
Definition: api_core.h:1480
f_fmod
static double f_fmod(double x, double val)
Definition: mat_formula.cpp:162
f_rand_g
static double f_rand_g(double mean, double stdv)
Definition: mat_formula.cpp:174
CSG_Vector::Get_Data
double * Get_Data(void) const
Definition: mat_tools.h:369
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
f_pi
static double f_pi(void)
Definition: mat_formula.cpp:144
CSG_Random::Get_Uniform
static double Get_Uniform(void)
Definition: mat_tools.cpp:274
MAX_CTABLE
#define MAX_CTABLE
Definition: mat_formula.cpp:84
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Random::Get_Gaussian
static double Get_Gaussian(double mean, double stddev)
Definition: mat_tools.cpp:298
CSG_Formula::SSG_Function
Definition: mat_tools.h:1879
MAX_PARMS
#define MAX_PARMS
Definition: mat_formula.cpp:83
grid.h
CSG_Formula::Set_Formula
bool Set_Formula(const CSG_String &Formula)
Definition: mat_formula.cpp:439
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
f_sqr
static double f_sqr(double x)
Definition: mat_formula.cpp:156
f_rand_u
static double f_rand_u(double min, double max)
Definition: mat_formula.cpp:168
f_min
static double f_min(double a, double b)
Definition: mat_formula.cpp:132
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
f_ifelse
static double f_ifelse(double condition, double x, double y)
Definition: mat_formula.cpp:192
mat_tools.h
f_pow
static double f_pow(double x, double val)
Definition: mat_formula.cpp:108
CSG_Vector
Definition: mat_tools.h:345
CSG_Formula::Get_Help_Operators
static CSG_String Get_Help_Operators(bool bHTML=true, const CSG_String Additional[][2]=NULL)
Definition: mat_formula.cpp:295
CSG_Formula::Set_Variable
void Set_Variable(char Variable, double Value)
Definition: mat_formula.cpp:433
CSG_Formula::Get_Used_Variables
const char * Get_Used_Variables(void)
Definition: mat_formula.cpp:663
TSG_Formula_Function_0
double(* TSG_Formula_Function_0)(void)
Definition: mat_tools.h:1843
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Formula::Destroy
bool Destroy(void)
Definition: mat_formula.cpp:277
CSG_Formula::SSG_Function::nParameters
int nParameters
Definition: mat_tools.h:1884
f_eq
static double f_eq(double x, double val)
Definition: mat_formula.cpp:126
f_int
static double f_int(double x)
Definition: mat_formula.cpp:150
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
f_or
static double f_or(double x, double y)
Definition: mat_formula.cpp:186
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:705
CSG_Formula::Get_Value
double Get_Value(void) const
Definition: mat_formula.cpp:465
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
TSG_Formula_Function_2
double(* TSG_Formula_Function_2)(double, double)
Definition: mat_tools.h:1845
M_PI
#define M_PI
Definition: mat_tools.h:98
CSG_String
Definition: api_core.h:557
CSG_Formula::SSG_Function::Name
const char * Name
Definition: mat_tools.h:1880
TSG_Formula_Function_1
double(* TSG_Formula_Function_1)(double)
Definition: mat_tools.h:1844
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
f_and
static double f_and(double x, double y)
Definition: mat_formula.cpp:180
CSG_Formula::~CSG_Formula
virtual ~CSG_Formula(void)
Definition: mat_formula.cpp:269
CSG_Formula::TSG_Function
struct CSG_Formula::SSG_Function TSG_Function
CSG_Formula::SSG_Function::bVarying
bool bVarying
Definition: mat_tools.h:1886
TSG_Formula_Function_3
double(* TSG_Formula_Function_3)(double, double, double)
Definition: mat_tools.h:1846
GET_VALUE_BUFSIZE
#define GET_VALUE_BUFSIZE
Definition: mat_formula.cpp:89
f_lt
static double f_lt(double x, double val)
Definition: mat_formula.cpp:120
f_gt
static double f_gt(double x, double val)
Definition: mat_formula.cpp:114
f_max
static double f_max(double a, double b)
Definition: mat_formula.cpp:138
f_atan2
static double f_atan2(double x, double val)
Definition: mat_formula.cpp:102
EPSILON
#define EPSILON
Definition: mat_formula.cpp:92
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_grid_radius.cpp File Reference

  • saga_core
  • saga_api
mat_grid_radius.cpp File Reference
#include "mat_tools.h"
#include "grid.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_grid_radius.cpp Source File

  • saga_core
  • saga_api
mat_grid_radius.cpp
Go to the documentation of this file.
1 /**********************************************************
2 * Version $Id$
3 *********************************************************/
4
6 // //
7 // SAGA //
8 // //
9 // System for Automated Geoscientific Analyses //
10 // //
11 // Application Programming Interface //
12 // //
13 // Library: SAGA_API //
14 // //
15 //-------------------------------------------------------//
16 // //
17 // mat_grid_radius.cpp //
18 // //
19 // Copyright (C) 2005 by Olaf Conrad //
20 // //
21 //-------------------------------------------------------//
22 // //
23 // This file is part of 'SAGA - System for Automated //
24 // Geoscientific Analyses'. //
25 // //
26 // This library is free software; you can redistribute //
27 // it and/or modify it under the terms of the GNU Lesser //
28 // General Public License as published by the Free //
29 // Software Foundation, either version 2.1 of the //
30 // License, or (at your option) any later version. //
31 // //
32 // This library is distributed in the hope that it will //
33 // be useful, but WITHOUT ANY WARRANTY; without even the //
34 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
35 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
36 // License for more details. //
37 // //
38 // You should have received a copy of the GNU Lesser //
39 // General Public License along with this program; if //
40 // not, see <http://www.gnu.org/licenses/>. //
41 // //
42 //-------------------------------------------------------//
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Goettingen //
47 // Goldschmidtstr. 5 //
48 // 37077 Goettingen //
49 // Germany //
50 // //
51 // e-mail: oconrad@saga-gis.org //
52 // //
54
55 //---------------------------------------------------------
56
57
59 // //
60 // Grid Radius //
61 // //
63
64 //---------------------------------------------------------
65 #include "mat_tools.h"
66 #include "grid.h"
67
68
70 // //
71 // //
72 // //
74
75 //---------------------------------------------------------
76 CSG_Grid_Radius::CSG_Grid_Radius(int maxRadius)
77 {
78 m_maxRadius = 0;
79 m_nPoints = 0;
80 m_Points = NULL;
81 m_nPoints_R = NULL;
82 m_Points_R = NULL;
83
84 Create(maxRadius);
85 }
86
87 //---------------------------------------------------------
88 CSG_Grid_Radius::~CSG_Grid_Radius(void)
89 {
90 Destroy();
91 }
92
93
95 // //
96 // //
97 // //
99
100 //---------------------------------------------------------
101 bool CSG_Grid_Radius::Create(int maxRadius)
102 {
103 Destroy();
104
105 //-----------------------------------------------------
106 if( maxRadius > 0 && maxRadius != m_maxRadius )
107 {
108 int x, y, i, n;
109 double d;
110
111 m_maxRadius = maxRadius;
112
113 m_nPoints_R = (int *)SG_Calloc(m_maxRadius + 1, sizeof(int));
114
115 for(y=-m_maxRadius; y<=m_maxRadius; y++)
116 {
117 for(x=-m_maxRadius; x<=m_maxRadius; x++)
118 {
119 if( (d = M_GET_LENGTH(x, y)) <= m_maxRadius )
120 {
121 m_nPoints++;
122 m_nPoints_R[(int)d]++;
123 }
124 }
125 }
126
127 //-------------------------------------------------
128 if( m_nPoints > 0 )
129 {
130 m_Points = (TSG_Grid_Radius *)SG_Calloc(m_nPoints , sizeof(TSG_Grid_Radius ));
131 m_Points_R = (TSG_Grid_Radius **)SG_Calloc(m_maxRadius + 1, sizeof(TSG_Grid_Radius *));
132
133 for(i=0, n=0; i<=m_maxRadius; i++)
134 {
135 m_Points_R [i] = m_Points + n;
136 n += m_nPoints_R[i];
137 m_nPoints_R[i] = 0;
138 }
139
140 //---------------------------------------------
141 for(y=-m_maxRadius; y<=m_maxRadius; y++)
142 {
143 for(x=-m_maxRadius; x<=m_maxRadius; x++)
144 {
145 if( (d = M_GET_LENGTH(x, y)) <= m_maxRadius )
146 {
147 i = (int)d;
148 n = m_nPoints_R[i]++;
149
150 m_Points_R[i][n].x = x;
151 m_Points_R[i][n].y = y;
152 m_Points_R[i][n].d = d;
153 }
154 }
155 }
156
157 return( true );
158 }
159 }
160
161 //-----------------------------------------------------
162 Destroy();
163
164 return( false );
165 }
166
167 //---------------------------------------------------------
168 void CSG_Grid_Radius::Destroy(void)
169 {
170 if( m_Points )
171 {
172 SG_Free(m_Points);
173 }
174
175 if( m_nPoints_R )
176 {
177 SG_Free(m_nPoints_R);
178 }
179
180 if( m_Points_R )
181 {
182 SG_Free(m_Points_R);
183 }
184
185 m_maxRadius = 0;
186 m_nPoints = 0;
187 m_Points = NULL;
188 m_nPoints_R = NULL;
189 m_Points_R = NULL;
190 }
191
192
194 // //
195 // //
196 // //
198
199 //---------------------------------------------------------
M_GET_LENGTH
#define M_GET_LENGTH(x, y)
Definition: mat_tools.h:126
grid.h
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
mat_tools.h
CSG_Grid_Radius::Create
bool Create(int maxRadius)
Definition: mat_grid_radius.cpp:101
CSG_Grid_Radius::~CSG_Grid_Radius
~CSG_Grid_Radius(void)
Definition: mat_grid_radius.cpp:88
CSG_Grid_Radius::Destroy
void Destroy(void)
Definition: mat_grid_radius.cpp:168
CSG_Grid_Radius::CSG_Grid_Radius
CSG_Grid_Radius(int maxRadius=0)
Definition: mat_grid_radius.cpp:76
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_indexing.cpp File Reference

  • saga_core
  • saga_api
Macros
mat_indexing.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Macros

#define SG_INDEX_SWAP(a, b) {itemp=(a);(a)=(b);(b)=itemp;}

Macro Definition Documentation

◆ SG_INDEX_SWAP

#define SG_INDEX_SWAP | ( | a,
 |  | b
 | ) | {itemp=(a);(a)=(b);(b)=itemp;}

Definition at line 370 of file mat_indexing.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_indexing.cpp Source File

  • saga_core
  • saga_api
mat_indexing.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_indexing.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Index::CSG_Index(void)
64 {
65 _On_Construction();
66 }
67
68 //---------------------------------------------------------
69 void CSG_Index::_On_Construction(void)
70 {
71 m_nValues = 0;
72 m_Index = NULL;
73 m_bProgress = false;
74 }
75
76 //---------------------------------------------------------
77 CSG_Index::~CSG_Index(void)
78 {
79 Destroy();
80 }
81
82 //---------------------------------------------------------
83 bool CSG_Index::Destroy(void)
84 {
85 if( m_Index )
86 {
87 SG_Free(m_Index);
88 }
89
90 m_nValues = 0;
91 m_Index = NULL;
92
93 return( true );
94 }
95
96
98 // //
100
101 //---------------------------------------------------------
102 CSG_Index::CSG_Index(sLong nValues, CSG_Index_Compare &Compare)
103 {
104 _On_Construction();
105
106 Create(nValues, Compare);
107 }
108
109 //---------------------------------------------------------
110 bool CSG_Index::Create(sLong nValues, CSG_Index_Compare &Compare)
111 {
112 if( _Set_Array(nValues) && _Set_Index(&Compare) )
113 {
114 return( true );
115 }
116
117 Destroy();
118
119 return( false );
120 }
121
122 //---------------------------------------------------------
123 CSG_Index::CSG_Index(sLong nValues, CSG_Index_Compare *pCompare)
124 {
125 _On_Construction();
126
127 Create(nValues, pCompare);
128 }
129
130 //---------------------------------------------------------
131 bool CSG_Index::Create(sLong nValues, CSG_Index_Compare *pCompare)
132 {
133 if( pCompare && _Set_Array(nValues) && _Set_Index(pCompare) )
134 {
135 return( true );
136 }
137
138 Destroy();
139
140 return( false );
141 }
142
143
145 // //
147
148 //---------------------------------------------------------
149 class CSG_Index_Compare_Int : public CSG_Index::CSG_Index_Compare
150 {
151 public:
152 int *m_Values; bool m_Ascending;
153
154 CSG_Index_Compare_Int(int *Values, bool Ascending) : m_Values(Values), m_Ascending(Ascending) {}
155
156 virtual int Compare (const sLong _a, const sLong _b)
157 {
158 sLong a = m_Ascending ? _a : _b;
159 sLong b = m_Ascending ? _b : _a;
160
161 return( m_Values[a] - m_Values[b] );
162 }
163 };
164
165 //---------------------------------------------------------
166 CSG_Index::CSG_Index(sLong nValues, int *Values, bool bAscending)
167 {
168 _On_Construction();
169
170 Create(nValues, Values, bAscending);
171 }
172
173 //---------------------------------------------------------
174 bool CSG_Index::Create(sLong nValues, int *Values, bool bAscending)
175 {
176 CSG_Index_Compare_Int Compare(Values, bAscending);
177
178 return( Create(nValues, &Compare) );
179 }
180
181
183 // //
185
186 //---------------------------------------------------------
187 class CSG_Index_Compare_Double : public CSG_Index::CSG_Index_Compare
188 {
189 public:
190 double *m_Values; bool m_Ascending;
191
192 CSG_Index_Compare_Double(double *Values, bool Ascending) : m_Values(Values), m_Ascending(Ascending) {}
193
194 virtual int Compare (const sLong _a, const sLong _b)
195 {
196 sLong a = m_Ascending ? _a : _b;
197 sLong b = m_Ascending ? _b : _a;
198
199 double d = m_Values[a] - m_Values[b];
200
201 return( d < 0. ? -1 : d > 0. ? 1 : 0 );
202 }
203 };
204
205 //---------------------------------------------------------
206 CSG_Index::CSG_Index(sLong nValues, double *Values, bool bAscending)
207 {
208 _On_Construction();
209
210 Create(nValues, Values, bAscending);
211 }
212
213 //---------------------------------------------------------
214 bool CSG_Index::Create(sLong nValues, double *Values, bool bAscending)
215 {
216 CSG_Index_Compare_Double Compare(Values, bAscending);
217
218 return( Create(nValues, &Compare) );
219 }
220
221
223 // //
225
226 //---------------------------------------------------------
227 class CSG_Index_Compare_Function : public CSG_Index::CSG_Index_Compare
228 {
229 public:
230 TSG_PFNC_Compare m_Function;
231
232 CSG_Index_Compare_Function(TSG_PFNC_Compare Function) : m_Function(Function) {}
233
234 virtual int Compare (const sLong _a, const sLong _b)
235 {
236 return( m_Function(_a, _b) );
237 }
238 };
239
240 //---------------------------------------------------------
241 CSG_Index::CSG_Index(sLong nValues, TSG_PFNC_Compare fCompare)
242 {
243 _On_Construction();
244
245 Create(nValues, fCompare);
246 }
247
248 //---------------------------------------------------------
249 bool CSG_Index::Create(sLong nValues, TSG_PFNC_Compare fCompare)
250 {
251 CSG_Index_Compare_Function Compare(fCompare);
252
253 return( Create(nValues, &Compare) );
254 }
255
256
258 // //
260
261 //---------------------------------------------------------
262 void CSG_Index::Show_Progress(bool bProgress)
263 {
264 m_bProgress = bProgress;
265 }
266
267 //---------------------------------------------------------
268 bool CSG_Index::Add_Entry(sLong Position)
269 {
270 if( Position < 0 || Position >= m_nValues - 1 )
271 {
272 return( _Set_Array(m_nValues + 1) );
273 }
274
275 if( _Set_Array(m_nValues + 1) )
276 {
277 for(sLong i=Position, Value=m_nValues-1; i<m_nValues; i++)
278 {
279 sLong v = m_Index[i]; m_Index[i] = Value; Value = v;
280 }
281
282 return( true );
283 }
284
285 return( false );
286 }
287
288 //---------------------------------------------------------
289 bool CSG_Index::Del_Entry(sLong Position)
290 {
291 if( Position < 0 || Position >= m_nValues - 1 )
292 {
293 return( _Set_Array(m_nValues - 1) );
294 }
295
296 sLong Value = m_Index[Position];
297
298 for(sLong i=Position; i<m_nValues-1; i++)
299 {
300 m_Index[i] = m_Index[i + 1];
301 }
302
303 m_Index[m_nValues - 1] = Value;
304
305 return( _Set_Array(m_nValues - 1) );
306 }
307
308 //---------------------------------------------------------
309 bool CSG_Index::_Set_Array(sLong nValues)
310 {
311 if( nValues < 1 )
312 {
313 return( Destroy() );
314 }
315
316 if( nValues == m_nValues )
317 {
318 return( true );
319 }
320
321 if( m_nValues > nValues ) // keep current sorting as far as possible...
322 {
323 for(sLong i=0, j=nValues; i<nValues && j<m_nValues; i++)
324 {
325 if( m_Index[i] >= nValues )
326 {
327 while( m_Index[j] >= nValues )
328 {
329 j++;
330
331 if( j >= m_nValues )
332 {
333 return( false ); // this should never happen!
334 }
335 }
336
337 sLong c = m_Index[i]; m_Index[i] = m_Index[j]; m_Index[j] = c;
338 }
339 }
340 }
341
342 sLong *Index = (sLong *)SG_Realloc(m_Index, nValues * sizeof(sLong));
343
344 if( !Index )
345 {
346 return( false );
347 }
348
349 m_Index = Index;
350
351 if( m_nValues < nValues ) // keep current sorting as far as possible...
352 {
353 for(sLong i=m_nValues; i<nValues; i++)
354 {
355 m_Index[i] = i;
356 }
357 }
358
359 m_nValues = nValues;
360
361 return( true );
362 }
363
364
366 // //
368
369 //---------------------------------------------------------
370 #define SG_INDEX_SWAP(a, b) {itemp=(a);(a)=(b);(b)=itemp;}
371
372 //---------------------------------------------------------
373 bool CSG_Index::_Set_Index(CSG_Index_Compare *pCompare)
374 {
375 const int M = 7;
376
377 sLong indxt, itemp,
378 i, j, k, a,
379 l = 0,
380 ir = m_nValues - 1,
381 nstack = 64,
382 jstack = 0;
383
384 //-----------------------------------------------------
385 CSG_Array_sLong istack(nstack);
386
387 sLong nProcessed = 0;
388
389 //-----------------------------------------------------
390 for(;;)
391 {
392 if( ir - l < M )
393 {
394 if( m_bProgress && !SG_UI_Process_Set_Progress(nProcessed += M - 1, m_nValues) )
395 {
396 SG_UI_Msg_Add_Error(_TL("index creation stopped by user"));
397
398 SG_UI_Process_Set_Ready();
399
400 return( false );
401 }
402
403 for(j=l+1; j<=ir; j++)
404 {
405 a = indxt = m_Index[j];
406
407 for(i=j-1; i>=0; i--)
408 {
409 if( pCompare->Compare(m_Index[i], a) <= 0 )
410 {
411 break;
412 }
413
414 m_Index[i + 1] = m_Index[i];
415 }
416
417 m_Index[i + 1] = indxt;
418 }
419
420 if( jstack == 0 )
421 {
422 break;
423 }
424
425 ir = istack[jstack--];
426 l = istack[jstack--];
427 }
428 else
429 {
430 k = (l + ir) >> 1;
431 SG_INDEX_SWAP(m_Index[k], m_Index[l + 1]);
432
433 if( pCompare->Compare(m_Index[l + 1], m_Index[ir]) > 0 )
434 SG_INDEX_SWAP (m_Index[l + 1], m_Index[ir]);
435
436 if( pCompare->Compare(m_Index[l ], m_Index[ir]) > 0 )
437 SG_INDEX_SWAP (m_Index[l ], m_Index[ir]);
438
439 if( pCompare->Compare(m_Index[l + 1], m_Index[l ]) > 0 )
440 SG_INDEX_SWAP (m_Index[l + 1], m_Index[l ]);
441
442 i = l + 1;
443 j = ir;
444 a = indxt = m_Index[l];
445
446 for(;;)
447 {
448 do i++; while( pCompare->Compare(m_Index[i], a) < 0 );
449 do j--; while( pCompare->Compare(m_Index[j], a) > 0 );
450
451 if( j < i )
452 {
453 break;
454 }
455
456 SG_INDEX_SWAP(m_Index[i], m_Index[j]);
457 }
458
459 m_Index[l] = m_Index[j];
460 m_Index[j] = indxt;
461 jstack += 2;
462
463 if( jstack >= nstack )
464 {
465 istack.Set_Array(nstack += 64l);
466 }
467
468 if( ir - i + 1 >= j - l )
469 {
470 istack[jstack ] = ir;
471 istack[jstack - 1] = i;
472 ir = j - 1;
473 }
474 else
475 {
476 istack[jstack ] = j - 1;
477 istack[jstack - 1] = l;
478 l = i;
479 }
480 }
481 }
482
483 //-----------------------------------------------------
484 if( m_bProgress )
485 {
486 SG_UI_Process_Set_Ready();
487 }
488
489 return( true );
490 }
491
493 // //
494 // //
495 // //
497
498 //---------------------------------------------------------
499 CSG_PriorityQueue::CSG_PriorityQueue(size_t maxSize) : m_Items(NULL), m_nItems(0), m_maxSize(0)
500 {
501 m_pLeaf[0] = m_pLeaf[1] = NULL;
502
503 Create(maxSize);
504 }
505
506 //---------------------------------------------------------
507 CSG_PriorityQueue::~CSG_PriorityQueue(void)
508 {
509 Destroy();
510 }
511
512 //---------------------------------------------------------
513 void CSG_PriorityQueue::Create(size_t maxSize)
514 {
515 Destroy();
516
517 if( maxSize > 1 )
518 {
519 m_maxSize = maxSize;
520
521 m_Items = (CSG_PriorityQueueItem **)SG_Malloc(m_maxSize * sizeof(CSG_PriorityQueueItem *));
522 }
523 }
524
525 //---------------------------------------------------------
526 void CSG_PriorityQueue::Destroy(void)
527 {
528 if( m_Items )
529 {
530 SG_Free(m_Items);
531
532 m_Items = NULL;
533 }
534
535 if( m_pLeaf[0] )
536 {
537 delete(m_pLeaf[0]);
538
539 m_pLeaf[0] = NULL;
540 }
541
542 if( m_pLeaf[1] )
543 {
544 delete(m_pLeaf[1]);
545
546 m_pLeaf[1] = NULL;
547 }
548 }
549
550
552 // //
554
555 //---------------------------------------------------------
556 size_t CSG_PriorityQueue::_Insert_Position(CSG_PriorityQueueItem *pItem)
557 {
558 if( m_nItems == 0 )
559 {
560 return( 0 );
561 }
562
563 size_t a = 0;
564 size_t b = m_nItems - 1;
565
566 if( pItem->Compare(m_Items[a]) < 0 )
567 {
568 return( a );
569 }
570
571 if( pItem->Compare(m_Items[b]) > 0 )
572 {
573 return( b + 1 );
574 }
575
576 for(size_t d=(b-a)/2 ; d>0; d/=2)
577 {
578 size_t i = a + d;
579
580 if( pItem->Compare(m_Items[i]) > 0 )
581 {
582 a = a < i ? i : a + 1;
583 }
584 else
585 {
586 b = b > i ? i : b - 1;
587 }
588 }
589
590 for(size_t i=a; i<=b; i++)
591 {
592 if( pItem->Compare(m_Items[i]) < 0 )
593 {
594 return( i );
595 }
596 }
597
598 return( b );
599 }
600
601 //---------------------------------------------------------
602 void CSG_PriorityQueue::Add(CSG_PriorityQueueItem *pItem)
603 {
604 if( m_Items && m_nItems < m_maxSize )
605 {
606 size_t Position = _Insert_Position(pItem);
607
608 memmove(m_Items + Position + 1, m_Items + Position, sizeof(CSG_PriorityQueueItem *) * (m_nItems - Position));
609
610 m_Items[Position] = pItem;
611 }
612 else
613 {
614 if( !m_pLeaf[0] )
615 {
616 size_t Divide = m_maxSize / 2;
617
618 m_pLeaf[0] = new CSG_PriorityQueue(m_maxSize);
619 m_pLeaf[1] = new CSG_PriorityQueue(m_maxSize);
620
621 m_pLeaf[0]->m_nItems = Divide;
622 m_pLeaf[1]->m_nItems = m_maxSize - Divide;
623
624 memcpy(m_pLeaf[0]->m_Items, m_Items , m_pLeaf[0]->m_nItems * sizeof(CSG_PriorityQueueItem *));
625 memcpy(m_pLeaf[1]->m_Items, m_Items + m_pLeaf[0]->m_nItems, m_pLeaf[1]->m_nItems * sizeof(CSG_PriorityQueueItem *));
626
627 SG_Free(m_Items);
628 m_Items = NULL;
629 }
630
631 if( pItem->Compare(m_pLeaf[1]->Minimum()) > 0 )
632 {
633 m_pLeaf[1]->Add(pItem);
634 }
635 else
636 {
637 m_pLeaf[0]->Add(pItem);
638 }
639 }
640
641 m_nItems++;
642 }
643
644
646 // //
648
649 //---------------------------------------------------------
650 CSG_PriorityQueue::CSG_PriorityQueueItem * CSG_PriorityQueue::Poll(void)
651 {
652 if( m_nItems > 0 )
653 {
654 m_nItems--;
655
656 if( m_Items )
657 {
658 return( m_Items[m_nItems] );
659 } // else if( m_pLeaf[0] )
660
661 CSG_PriorityQueueItem *pItem = m_pLeaf[1]->Poll();
662
663 if( m_pLeaf[1]->m_nItems == 0 )
664 {
665 delete(m_pLeaf[1]);
666
667 CSG_PriorityQueue *pLeaf = m_pLeaf[0];
668
669 // m_nItems = pLeaf->m_nItems;
670 m_Items = pLeaf->m_Items;
671 m_pLeaf[0] = pLeaf->m_pLeaf[0];
672 m_pLeaf[1] = pLeaf->m_pLeaf[1];
673
674 pLeaf->m_Items = NULL;
675 pLeaf->m_pLeaf[0] = NULL;
676 pLeaf->m_pLeaf[1] = NULL;
677 delete(pLeaf);
678 }
679
680 return( pItem );
681 }
682
683 return( NULL );
684 }
685
686
688 // //
689 // //
690 // //
692
693 //---------------------------------------------------------
CSG_Index::Show_Progress
void Show_Progress(bool bProgress=true)
Definition: mat_indexing.cpp:262
CSG_Array_sLong::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:494
CSG_PriorityQueue::CSG_PriorityQueue
CSG_PriorityQueue(size_t maxSize=256)
Definition: mat_indexing.cpp:499
CSG_Index::CSG_Index
CSG_Index(void)
Definition: mat_indexing.cpp:63
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_INDEX_SWAP
#define SG_INDEX_SWAP(a, b)
Definition: mat_indexing.cpp:370
CSG_PriorityQueue::CSG_PriorityQueueItem::Compare
virtual int Compare(CSG_PriorityQueueItem *pItem)=0
CSG_Index::~CSG_Index
virtual ~CSG_Index(void)
Definition: mat_indexing.cpp:77
CSG_Index::CSG_Index_Compare
Definition: mat_tools.h:188
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Index::CSG_Index_Compare::Compare
virtual int Compare(const sLong a, const sLong b)=0
CSG_PriorityQueue::Poll
CSG_PriorityQueueItem * Poll(void)
Definition: mat_indexing.cpp:650
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
mat_tools.h
CSG_PriorityQueue::~CSG_PriorityQueue
virtual ~CSG_PriorityQueue(void)
Definition: mat_indexing.cpp:507
CSG_PriorityQueue::Add
void Add(CSG_PriorityQueueItem *pItem)
Definition: mat_indexing.cpp:602
CSG_Index::Create
bool Create(sLong nValues, CSG_Index_Compare &Compare)
Definition: mat_indexing.cpp:110
TSG_PFNC_Compare
int(* TSG_PFNC_Compare)(const sLong a, const sLong b)
Definition: mat_tools.h:181
sLong
signed long long sLong
Definition: api_core.h:158
CSG_PriorityQueue::Create
void Create(size_t maxSize=256)
Definition: mat_indexing.cpp:513
CSG_Index::Add_Entry
bool Add_Entry(sLong Position=-1)
Definition: mat_indexing.cpp:268
CSG_PriorityQueue::Minimum
CSG_PriorityQueueItem * Minimum(void) const
Definition: mat_tools.h:292
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_PriorityQueue
Definition: mat_tools.h:260
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
CSG_Array_sLong
Definition: api_core.h:475
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_PriorityQueue::CSG_PriorityQueueItem
Definition: mat_tools.h:265
CSG_Index::Del_Entry
bool Del_Entry(sLong Position=-1)
Definition: mat_indexing.cpp:289
CSG_Index::Destroy
bool Destroy(void)
Definition: mat_indexing.cpp:83
CSG_PriorityQueue::Destroy
void Destroy(void)
Definition: mat_indexing.cpp:526
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_matrix.cpp File Reference

  • saga_core
  • saga_api
Functions
mat_matrix.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Functions

bool | SG_Matrix_Triangular_Decomposition (CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e)
bool | SG_Matrix_Tridiagonal_QL (CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e)
CSG_Vector | operator* (double Scalar, const CSG_Vector &Vector)
bool | SG_VectorR2_Rotate (double &x, double &y, double Angle)
bool | SG_VectorR2_Rotate (double Vector[2], double Angle)
bool | SG_VectorR2_Rotate (CSG_Vector &Vector, double Angle)
bool | SG_VectorR3_Rotate (double Vector[3], size_t Axis, double Angle)
bool | SG_VectorR3_Rotate (CSG_Vector &Vector, size_t Axis, double Angle)
CSG_Matrix | operator* (double Scalar, const CSG_Matrix &Matrix)
CSG_Matrix | SG_Matrix_Get_Rotation (double R, bool bDegree)
CSG_Matrix | SG_Matrix_Get_Rotation (double Rx, double Ry, double Rz, bool bDegree)
bool | SG_Matrix_Solve (CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
bool | SG_Matrix_Eigen_Reduction (const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent)
bool | SG_Matrix_LU_Decomposition (int n, int *Permutation, double **Matrix, bool bSilent, int *nRowChanges)
bool | SG_Matrix_LU_Solve (int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent)

Function Documentation

◆ operator*() [1/2]

CSG_Matrix operator* | ( | double | Scalar,
 |  | const CSG_Matrix & | Matrix
 | ) |  |

Definition at line 1699 of file mat_matrix.cpp.

◆ operator*() [2/2]

CSG_Vector operator* | ( | double | Scalar,
 |  | const CSG_Vector & | Vector
 | ) |  |

Definition at line 579 of file mat_matrix.cpp.

◆ SG_Matrix_Eigen_Reduction()

bool SG_Matrix_Eigen_Reduction | ( | const CSG_Matrix & | Matrix,
 |  | CSG_Matrix & | Eigen_Vectors,
 |  | CSG_Vector & | Eigen_Values,
 |  | bool | bSilent
 | ) |  |

Definition at line 1933 of file mat_matrix.cpp.

References SG_Matrix_Triangular_Decomposition(), and SG_Matrix_Tridiagonal_QL().

◆ SG_Matrix_Get_Rotation() [1/2]

CSG_Matrix SG_Matrix_Get_Rotation | ( | double | R,
 |  | bool | bDegree
 | ) |  |

Returns a rotation matrix applicable to 2d vectors for given rotation angle (R).

Definition at line 1866 of file mat_matrix.cpp.

References M_DEG_TO_RAD.

◆ SG_Matrix_Get_Rotation() [2/2]

CSG_Matrix SG_Matrix_Get_Rotation | ( | double | Rx,
 |  | double | Ry,
 |  | double | Rz,
 |  | bool | bDegree
 | ) |  |

Returns a rotation matrix applicable to 3d vectors for rotations about the x-, y-, and z-axis (Rx, Ry, Rz).

Definition at line 1885 of file mat_matrix.cpp.

References M_DEG_TO_RAD.

◆ SG_Matrix_LU_Decomposition()

bool SG_Matrix_LU_Decomposition | ( | int | n,
 |  | int * | Permutation,
 |  | double ** | Matrix,
 |  | bool | bSilent,
 |  | int * | nRowChanges
 | ) |  |

Definition at line 1948 of file mat_matrix.cpp.

References M_TINY, SG_UI_Process_Get_Okay(), and SG_UI_Process_Set_Progress().

Referenced by CSG_Matrix::Get_Determinant(), CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().

◆ SG_Matrix_LU_Solve()

bool SG_Matrix_LU_Solve | ( | int | n,
 |  | const int * | Permutation,
 |  | const double ** | Matrix,
 |  | double * | Vector,
 |  | bool | bSilent
 | ) |  |

Definition at line 2053 of file mat_matrix.cpp.

References SG_UI_Process_Set_Progress().

Referenced by CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().

◆ SG_Matrix_Solve()

bool SG_Matrix_Solve | ( | CSG_Matrix & | Matrix,
 |  | CSG_Vector & | Vector,
 |  | bool | bSilent
 | ) |  |

Definition at line 1910 of file mat_matrix.cpp.

References CSG_Array::Get_Array(), CSG_Vector::Get_Data(), CSG_Matrix::Get_Data(), CSG_Vector::Get_N(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), SG_Matrix_LU_Decomposition(), and SG_Matrix_LU_Solve().

Referenced by CSG_Thin_Plate_Spline::Create().

◆ SG_Matrix_Triangular_Decomposition()

bool SG_Matrix_Triangular_Decomposition | ( | CSG_Matrix & | A,
 |  | CSG_Vector & | d,
 |  | CSG_Vector & | e
 | ) |  |

Definition at line 2097 of file mat_matrix.cpp.

References A, and CSG_Vector::Create().

Referenced by SG_Matrix_Eigen_Reduction().

◆ SG_Matrix_Tridiagonal_QL()

bool SG_Matrix_Tridiagonal_QL | ( | CSG_Matrix & | Q,
 |  | CSG_Vector & | d,
 |  | CSG_Vector & | e
 | ) |  |

Definition at line 2227 of file mat_matrix.cpp.

References CSG_Vector::Get_N(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), and M_SET_SIGN.

Referenced by SG_Matrix_Eigen_Reduction().

◆ SG_VectorR2_Rotate() [1/3]

bool SG_VectorR2_Rotate | ( | CSG_Vector & | Vector,
 |  | double | Angle
 | ) |  |

Definition at line 770 of file mat_matrix.cpp.

References CSG_Vector::Get_Size(), and SG_VectorR2_Rotate().

◆ SG_VectorR2_Rotate() [2/3]

bool SG_VectorR2_Rotate | ( | double & | x,
 |  | double & | y,
 |  | double | Angle
 | ) |  |

Definition at line 750 of file mat_matrix.cpp.

Referenced by SG_VectorR2_Rotate().

◆ SG_VectorR2_Rotate() [3/3]

bool SG_VectorR2_Rotate | ( | double | Vector[2],
 |  | double | Angle
 | ) |  |

Definition at line 764 of file mat_matrix.cpp.

References SG_VectorR2_Rotate().

◆ SG_VectorR3_Rotate() [1/2]

bool SG_VectorR3_Rotate | ( | CSG_Vector & | Vector,
 |  | size_t | Axis,
 |  | double | Angle
 | ) |  |

Definition at line 810 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and SG_VectorR3_Rotate().

◆ SG_VectorR3_Rotate() [2/2]

bool SG_VectorR3_Rotate | ( | double | Vector[3],
 |  | size_t | Axis,
 |  | double | Angle
 | ) |  |

Definition at line 776 of file mat_matrix.cpp.

Referenced by SG_VectorR3_Rotate().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_matrix.cpp Source File

  • saga_core
  • saga_api
mat_matrix.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_matrix.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 bool SG_Matrix_Triangular_Decomposition (CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e);
64 bool SG_Matrix_Tridiagonal_QL (CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e);
65
66
68 // //
69 // //
70 // //
72
73 //---------------------------------------------------------
74 CSG_Vector::CSG_Vector(void)
75 {
76 m_Array.Create(sizeof(double), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_2);
77 }
78
79 //---------------------------------------------------------
80 CSG_Vector::CSG_Vector(const CSG_Vector &Vector)
81 {
82 m_Array.Create(sizeof(double), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_2);
83
84 Create(Vector);
85 }
86
87 bool CSG_Vector::Create(const CSG_Vector &Vector)
88 {
89 return( Assign(Vector) );
90 }
91
92 //---------------------------------------------------------
93 CSG_Vector::CSG_Vector(sLong n, const double *Data)
94 {
95 m_Array.Create(sizeof(double), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_2);
96
97 Create(n, Data);
98 }
99
100 bool CSG_Vector::Create(sLong n, const double *Data)
101 {
102 if( n > 0 )
103 {
104 if( m_Array.Set_Array(n) )
105 {
106 if( Data )
107 {
108 memcpy(Get_Data(), Data, n * sizeof(double));
109 }
110 else
111 {
112 memset(Get_Data(), 0, n * sizeof(double));
113 }
114
115 return( true );
116 }
117 }
118
119 Destroy();
120
121 return( false );
122 }
123
124 //---------------------------------------------------------
125 CSG_Vector::~CSG_Vector(void)
126 {
127 Destroy();
128 }
129
130 bool CSG_Vector::Destroy(void)
131 {
132 return( m_Array.Set_Array(0) );
133 }
134
135 //---------------------------------------------------------
140 bool CSG_Vector::Set_Rows(sLong nRows)
141 {
142 if( nRows > Get_Size() )
143 {
144 return( Add_Rows(nRows - Get_Size()) );
145 }
146
147 if( nRows < Get_Size() )
148 {
149 return( Del_Rows(Get_Size() - nRows) );
150 }
151
152 return( true );
153 }
154
155 //---------------------------------------------------------
156 bool CSG_Vector::Add_Rows(sLong nRows)
157 {
158 if( nRows > 0 && m_Array.Set_Array(Get_Size() + nRows) )
159 {
160 for(sLong i=Get_Size()-nRows; i<Get_Size(); i++)
161 {
162 Get_Data()[i] = 0.;
163 }
164
165 return( true );
166 }
167
168 return( false );
169 }
170
171 //---------------------------------------------------------
177 bool CSG_Vector::Del_Rows(sLong nRows)
178 {
179 if( nRows >= Get_Size() )
180 {
181 return( Destroy() );
182 }
183
184 return( nRows < 1 ? false : m_Array.Set_Array(Get_Size() - nRows) );
185 }
186
187 //---------------------------------------------------------
188 bool CSG_Vector::Add_Row(double Value)
189 {
190 if( m_Array.Inc_Array() )
191 {
192 Get_Data()[Get_Size() - 1] = Value;
193
194 return( true );
195 }
196
197 return( false );
198 }
199
200 //---------------------------------------------------------
201 bool CSG_Vector::Del_Row(sLong Row)
202 {
203 if( Row < Get_Size() )
204 {
205 if( Row >= 0 ) // just remove last entry => if( Row < 0 )
206 {
207 for(sLong i=Row, j=Row+1; j<Get_Size(); i++, j++)
208 {
209 Get_Data()[i] = Get_Data()[j];
210 }
211 }
212
213 return( m_Array.Dec_Array() );
214 }
215
216 return( false );
217 }
218
219
221 // //
223
224 //---------------------------------------------------------
225 CSG_String CSG_Vector::to_String(int Width, int Precision, bool bScientific, const SG_Char *Separator) const
226 {
227 CSG_String s, sep(Separator && *Separator ? Separator : SG_T(" "));
228
229 for(sLong i=0; i<Get_Size(); i++)
230 {
231 s += sep + SG_Get_Double_asString(Get_Data(i), Width, Precision, bScientific);
232 }
233
234 return( s );
235 }
236
237 //---------------------------------------------------------
238 bool CSG_Vector::from_String(const CSG_String &String)
239 {
240 Destroy();
241
242 CSG_String_Tokenizer Line(String);
243
244 while( Line.Has_More_Tokens() )
245 {
246 double d; CSG_String s(Line.Get_Next_Token());
247
248 if( s.asDouble(d) )
249 {
250 Add_Row(d);
251 }
252 }
253
254 return( Get_Size() > 0 );
255 }
256
257
259 // //
261
262 //---------------------------------------------------------
263 bool CSG_Vector::is_Null(void) const
264 {
265 for(sLong i=0; i<Get_N(); i++)
266 {
267 if( Get_Data(i) != 0. )
268 {
269 return( false );
270 }
271 }
272
273 return( true );
274 }
275
276 //---------------------------------------------------------
277 bool CSG_Vector::is_Equal(const CSG_Vector &Vector) const
278 {
279 if( Get_Size() == Vector.Get_Size() )
280 {
281 for(sLong i=0; i<Get_N(); i++)
282 {
283 if( Get_Data(i) != Vector.Get_Data(i) )
284 {
285 return( false );
286 }
287 }
288
289 return( true );
290 }
291
292 return( false );
293 }
294
295 //---------------------------------------------------------
296 bool CSG_Vector::is_Collinear(const CSG_Vector &Vector) const
297 {
298 if( Get_Size() == Vector.Get_Size() && !is_Null() && !Vector.is_Null() )
299 {
300 double b = Vector.Get_Length() / Get_Length();
301
302 for(sLong i=0; i<Get_N(); i++)
303 {
304 if( b * Get_Data(i) != Vector.Get_Data(i) )
305 {
306 return( false );
307 }
308 }
309
310 return( true );
311 }
312
313 return( false );
314 }
315
316 //---------------------------------------------------------
317 bool CSG_Vector::Assign(double Scalar)
318 {
319 if( Get_Size() > 0 )
320 {
321 for(sLong i=0; i<Get_Size(); i++)
322 {
323 Get_Data()[i] = Scalar;
324 }
325
326 return( true );
327 }
328
329 return( false );
330 }
331
332 //---------------------------------------------------------
333 bool CSG_Vector::Assign(const CSG_Vector &Vector)
334 {
335 if( Create(Vector.Get_Size()) )
336 {
337 memcpy(Get_Data(), Vector.Get_Data(), Get_Size() * sizeof(double));
338
339 return( true );
340 }
341
342 return( false );
343 }
344
345 //---------------------------------------------------------
346 bool CSG_Vector::Add(double Scalar)
347 {
348 if( Get_Size() > 0 )
349 {
350 for(sLong i=0; i<Get_Size(); i++)
351 {
352 Get_Data()[i] += Scalar;
353 }
354
355 return( true );
356 }
357
358 return( false );
359 }
360
361 //---------------------------------------------------------
362 bool CSG_Vector::Add(const CSG_Vector &Vector)
363 {
364 if( Get_Size() == Vector.Get_Size() && Get_Size() > 0 )
365 {
366 for(sLong i=0; i<Get_Size(); i++)
367 {
368 Get_Data()[i] += Vector.Get_Data()[i];
369 }
370
371 return( true );
372 }
373
374 return( false );
375 }
376
377 //---------------------------------------------------------
378 bool CSG_Vector::Subtract(const CSG_Vector &Vector)
379 {
380 if( Get_Size() == Vector.Get_Size() && Get_Size() > 0 )
381 {
382 for(sLong i=0; i<Get_Size(); i++)
383 {
384 Get_Data()[i] -= Vector.Get_Data()[i];
385 }
386
387 return( true );
388 }
389
390 return( false );
391 }
392
393 //---------------------------------------------------------
394 bool CSG_Vector::Multiply(double Scalar)
395 {
396 if( Get_Size() > 0 )
397 {
398 for(sLong i=0; i<Get_Size(); i++)
399 {
400 Get_Data()[i] *= Scalar;
401 }
402
403 return( true );
404 }
405
406 return( false );
407 }
408
409 //---------------------------------------------------------
410 bool CSG_Vector::Multiply(const CSG_Vector &Vector)
411 {
412 return( Multiply_Cross(Vector) );
413 }
414
415 //---------------------------------------------------------
416 bool CSG_Vector::Multiply_Cross(const CSG_Vector &Vector)
417 {
418 if( Get_Size() == Vector.Get_Size() && Get_Size() == 3 )
419 {
420 CSG_Vector v(*this);
421
422 Get_Data()[0] = v[1] * Vector[2] - v[2] * Vector[1];
423 Get_Data()[1] = v[2] * Vector[0] - v[0] * Vector[2];
424 Get_Data()[2] = v[0] * Vector[1] - v[1] * Vector[0];
425
426 return( true );
427 }
428
429 return( false );
430 }
431
432 //---------------------------------------------------------
433 double CSG_Vector::Multiply_Scalar(const CSG_Vector &Vector) const
434 {
435 double z = 0.;
436
437 if( Get_Size() == Vector.Get_Size() )
438 {
439 for(sLong i=0; i<Get_Size(); i++)
440 {
441 z += Get_Data()[i] * Vector[i];
442 }
443 }
444
445 return( z );
446 }
447
448 //---------------------------------------------------------
449 bool CSG_Vector::Multiply(const class CSG_Matrix &Matrix)
450 {
451 return( Assign(Matrix.Multiply(*this)) );
452 }
453
454
456 // //
458
459 //---------------------------------------------------------
460 CSG_Vector & CSG_Vector::operator = (double Scalar)
461 {
462 Assign(Scalar);
463
464 return( *this );
465 }
466
467 CSG_Vector & CSG_Vector::operator = (const CSG_Vector &Vector)
468 {
469 Assign(Vector);
470
471 return( *this );
472 }
473
474 //---------------------------------------------------------
475 CSG_Vector & CSG_Vector::operator += (double Scalar)
476 {
477 Add(Scalar);
478
479 return( *this );
480 }
481
482 CSG_Vector & CSG_Vector::operator += (const CSG_Vector &Vector)
483 {
484 Add(Vector);
485
486 return( *this );
487 }
488
489 //---------------------------------------------------------
490 CSG_Vector & CSG_Vector::operator -= (double Scalar)
491 {
492 Add(-Scalar);
493
494 return( *this );
495 }
496
497 CSG_Vector & CSG_Vector::operator -= (const CSG_Vector &Vector)
498 {
499 Subtract(Vector);
500
501 return( *this );
502 }
503
504 //---------------------------------------------------------
505 CSG_Vector & CSG_Vector::operator *= (double Scalar)
506 {
507 Multiply(Scalar);
508
509 return( *this );
510 }
511
512 CSG_Vector & CSG_Vector::operator *= (const CSG_Vector &Vector)
513 {
514 Multiply(Vector);
515
516 return( *this );
517 }
518
519 CSG_Vector & CSG_Vector::operator *= (const class CSG_Matrix &Matrix)
520 {
521 Multiply(Matrix);
522
523 return( *this );
524 }
525
526 //---------------------------------------------------------
527 CSG_Vector CSG_Vector::operator + (double Scalar) const
528 {
529 CSG_Vector v(*this);
530
531 v.Add(Scalar);
532
533 return( v );
534 }
535
536 CSG_Vector CSG_Vector::operator + (const CSG_Vector &Vector) const
537 {
538 CSG_Vector v(*this);
539
540 v.Add(Vector);
541
542 return( v );
543 }
544
545 //---------------------------------------------------------
546 CSG_Vector CSG_Vector::operator - (double Scalar) const
547 {
548 CSG_Vector v(*this);
549
550 v.Add(-Scalar);
551
552 return( v );
553 }
554
555 CSG_Vector CSG_Vector::operator - (const CSG_Vector &Vector) const
556 {
557 CSG_Vector v(*this);
558
559 v.Subtract(Vector);
560
561 return( v );
562 }
563
564 //---------------------------------------------------------
565 CSG_Vector CSG_Vector::operator * (double Scalar) const
566 {
567 CSG_Vector v(*this);
568
569 v.Multiply(Scalar);
570
571 return( v );
572 }
573
574 double CSG_Vector::operator * (const CSG_Vector &Vector) const
575 {
576 return( Multiply_Scalar(Vector) );
577 }
578
579 CSG_Vector operator * (double Scalar, const CSG_Vector &Vector)
580 {
581 return( Vector * Scalar );
582 }
583
584
586 // //
588
589 //---------------------------------------------------------
590 bool CSG_Vector::Set_Zero(void)
591 {
592 return( Create(Get_Size()) );
593 }
594
595 //---------------------------------------------------------
596 bool CSG_Vector::Set_Unity(void)
597 {
598 double Length = Get_Length();
599
600 if( Length > 0. )
601 {
602 for(sLong i=0; i<Get_Size(); i++)
603 {
604 Get_Data()[i] /= Length;
605 }
606
607 return( true );
608 }
609
610 return( false );
611 }
612
613
615 // //
617
618 //---------------------------------------------------------
619 bool CSG_Vector::Flip_Values(void)
620 {
621 if( Get_Size() > 1 )
622 {
623 double *v = Get_Data();
624
625 for(sLong i=0, j=Get_Size()-1; i<j; i++, j--)
626 {
627 double d = v[i]; v[i] = v[j]; v[j] = d;
628 }
629
630 return( true );
631 }
632
633 return( false );
634 }
635
636
638 // //
640
641 //---------------------------------------------------------
642 bool CSG_Vector::Sort(bool bAscending)
643 {
644 if( Get_Size() > 0 )
645 {
646 qsort(Get_Data(), Get_Size(), sizeof(double), SG_Compare_Double);
647
648 if( bAscending == false )
649 {
650 Flip_Values();
651 }
652
653 return( true );
654 }
655
656 return( false );
657 }
658
659
661 // //
663
664 //---------------------------------------------------------
665 CSG_Vector CSG_Vector::Get_Scalar_Product(const CSG_Vector &Vector) const
666 {
667 CSG_Vector v(*this);
668
669 v.Multiply_Scalar(Vector);
670
671 return( v );
672 }
673
674 //---------------------------------------------------------
675 CSG_Vector CSG_Vector::Get_Cross_Product(const CSG_Vector &Vector) const
676 {
677 CSG_Vector v(*this);
678
679 v.Multiply_Cross(Vector);
680
681 return( v );
682 }
683
684 //---------------------------------------------------------
685 double CSG_Vector::Get_Length(void) const
686 {
687 if( Get_Size() > 0 )
688 {
689 double z = 0., *Z = Get_Data();
690
691 for(sLong i=0; i<Get_Size(); i++)
692 {
693 z += Z[i] * Z[i];
694 }
695
696 return( sqrt(z) );
697 }
698
699 return( 0. );
700 }
701
702 //---------------------------------------------------------
703 double CSG_Vector::Get_Angle(const CSG_Vector &Vector) const
704 {
705 if( Get_Size() > Vector.Get_Size() )
706 {
707 return( Vector.Get_Angle(*this) );
708 }
709
710 double A, B;
711
712 if( (A = Get_Length()) > 0. && (B = Vector.Get_Length()) > 0. )
713 {
714 double z = 0., *Z = Get_Data();
715
716 for(sLong i=0; i<Get_Size(); i++)
717 {
718 z += Vector[i] * Z[i];
719 }
720
721 for(sLong i=Get_Size(); i<Vector.Get_Size(); i++)
722 {
723 z += Vector[i];
724 }
725
726 return( acos(z / (A * B)) );
727 }
728
729 return( 0. );
730 }
731
732 //---------------------------------------------------------
733 CSG_Vector CSG_Vector::Get_Unity(void) const
734 {
735 CSG_Vector v(*this);
736
737 v.Set_Unity();
738
739 return( v );
740 }
741
742
744 // //
745 // //
746 // //
748
749 //---------------------------------------------------------
750 bool SG_VectorR2_Rotate(double &x, double &y, double Angle)
751 {
752 double sin_a = sin(Angle);
753 double cos_a = cos(Angle);
754
755 double t = x;
756
757 x = t * cos_a - y * sin_a;
758 y = t * sin_a + y * cos_a;
759
760 return( true );
761 }
762
763 //---------------------------------------------------------
764 bool SG_VectorR2_Rotate(double Vector[2], double Angle)
765 {
766 return( SG_VectorR2_Rotate(Vector[0], Vector[1], Angle) );
767 }
768
769 //---------------------------------------------------------
770 bool SG_VectorR2_Rotate(CSG_Vector &Vector , double Angle)
771 {
772 return( Vector.Get_Size() >= 2 && SG_VectorR2_Rotate(Vector[0], Vector[1], Angle) );
773 }
774
775 //---------------------------------------------------------
776 bool SG_VectorR3_Rotate(double Vector[3], size_t Axis, double Angle)
777 {
778 if( Axis <= 3 )
779 {
780 CSG_Vector v(3, Vector);
781
782 double sin_a = sin(Angle);
783 double cos_a = cos(Angle);
784
785 switch( Axis )
786 {
787 case 0:
788 Vector[1] = v[1] * cos_a - v[2] * sin_a;
789 Vector[2] = v[1] * sin_a + v[2] * cos_a;
790 break;
791
792 case 1:
793 Vector[0] = v[0] * cos_a + v[2] * sin_a;
794 Vector[2] =-v[0] * sin_a + v[2] * cos_a;
795 break;
796
797 case 2:
798 Vector[0] = v[0] * cos_a - v[1] * sin_a;
799 Vector[1] = v[0] * sin_a + v[1] * cos_a;
800 break;
801 }
802
803 return( true );
804 }
805
806 return( false );
807 }
808
809 //---------------------------------------------------------
810 bool SG_VectorR3_Rotate(CSG_Vector &Vector , size_t Axis, double Angle)
811 {
812 return( Vector.Get_Size() >= 3 && SG_VectorR3_Rotate(Vector.Get_Data(), Axis, Angle) );
813 }
814
815
817 // //
818 // //
819 // //
821
822 //---------------------------------------------------------
823 CSG_Matrix::CSG_Matrix(void)
824 {
825 _On_Construction();
826 }
827
828 //---------------------------------------------------------
829 CSG_Matrix::CSG_Matrix(const CSG_Matrix &Matrix)
830 {
831 _On_Construction();
832
833 Create(Matrix);
834 }
835
836 bool CSG_Matrix::Create(const CSG_Matrix &Matrix)
837 {
838 return( Create(Matrix.m_nx, Matrix.m_ny, Matrix.m_z[0]) );
839 }
840
841 //---------------------------------------------------------
842 CSG_Matrix::CSG_Matrix(sLong nCols, sLong nRows, const double *Data)
843 {
844 _On_Construction();
845
846 Create(nCols, nRows, Data);
847 }
848
849 bool CSG_Matrix::Create(sLong nCols, sLong nRows, const double *Data)
850 {
851 if( nCols < 1 || nRows < 1 )
852 {
853 Destroy();
854
855 return( false );
856 }
857
858 if( nCols != m_nx || nRows != m_ny )
859 {
860 Destroy();
861
862 if( (m_z = (double **)SG_Malloc(nRows * sizeof(double *))) == NULL
863 || (m_z[0] = (double *)SG_Malloc(nRows * nCols * sizeof(double ))) == NULL )
864 {
865 Destroy();
866
867 return( false );
868 }
869
870 m_nx = nCols;
871 m_ny = nRows;
872
873 for(sLong y=1; y<m_ny; y++)
874 {
875 m_z[y] = m_z[y - 1] + m_nx;
876 }
877 }
878
879 if( Data )
880 {
881 memcpy(m_z[0], Data, m_ny * m_nx * sizeof(double));
882 }
883 else
884 {
885 memset(m_z[0], 0, m_ny * m_nx * sizeof(double));
886 }
887
888 return( true );
889 }
890
891 //---------------------------------------------------------
892 CSG_Matrix::CSG_Matrix(sLong nCols, sLong nRows, const double **Data)
893 {
894 _On_Construction();
895
896 Create(nCols, nRows, Data);
897 }
898
899 bool CSG_Matrix::Create(sLong nCols, sLong nRows, const double **Data)
900 {
901 if( Create(nCols, nRows) )
902 {
903 if( Data )
904 {
905 for(sLong y=0; y<m_ny; y++)
906 {
907 memcpy(m_z[y], Data[y], m_nx * sizeof(double));
908 }
909 }
910
911 return( true );
912 }
913
914 return( false );
915 }
916
917 //---------------------------------------------------------
918 CSG_Matrix::~CSG_Matrix(void)
919 {
920 Destroy();
921 }
922
923 bool CSG_Matrix::Destroy(void)
924 {
925 if( m_z )
926 {
927 if( m_z[0] )
928 {
929 SG_Free(m_z[0]);
930 }
931
932 SG_Free(m_z);
933 }
934
935 _On_Construction();
936
937 return( true );
938 }
939
940 //---------------------------------------------------------
941 void CSG_Matrix::_On_Construction(void)
942 {
943 m_z = NULL; m_nx = m_ny = 0;
944 }
945
946
948 // //
950
951 //---------------------------------------------------------
952 bool CSG_Matrix::Set_Size(sLong nRows, sLong nCols)
953 {
954 return( nRows > 0 && nCols > 0 && Set_Rows(nRows) && Set_Cols(nCols) );
955 }
956
957 //---------------------------------------------------------
958 bool CSG_Matrix::Set_Cols(sLong nCols)
959 {
960 if( nCols > m_nx )
961 {
962 return( Add_Cols(nCols - m_nx) );
963 }
964
965 if( nCols < m_nx )
966 {
967 return( Del_Cols(m_nx - nCols) );
968 }
969
970 return( true );
971 }
972
973 //---------------------------------------------------------
974 bool CSG_Matrix::Set_Rows(sLong nRows)
975 {
976 if( nRows > m_ny )
977 {
978 return( Add_Rows(nRows - m_ny) );
979 }
980
981 if( nRows < m_ny )
982 {
983 return( Del_Rows(m_ny - nRows) );
984 }
985
986 return( true );
987 }
988
989 //---------------------------------------------------------
990 bool CSG_Matrix::Add_Cols(sLong nCols)
991 {
992 if( nCols > 0 && m_ny > 0 )
993 {
994 CSG_Matrix Tmp(*this);
995
996 if( Create(Tmp.m_nx + nCols, Tmp.m_ny) )
997 {
998 for(sLong y=0; y<Tmp.m_ny; y++)
999 {
1000 memcpy(m_z[y], Tmp.m_z[y], Tmp.m_nx * sizeof(double));
1001 }
1002
1003 return( true );
1004 }
1005 }
1006
1007 return( false );
1008 }
1009
1010 //---------------------------------------------------------
1011 bool CSG_Matrix::Add_Rows(sLong nRows)
1012 {
1013 if( nRows > 0 && m_nx > 0 )
1014 {
1015 m_ny += nRows;
1016
1017 m_z = (double **)SG_Realloc(m_z , m_ny * sizeof(double *));
1018 m_z[0] = (double *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double ));
1019
1020 for(sLong y=1; y<m_ny; y++)
1021 {
1022 m_z[y] = m_z[y - 1] + m_nx;
1023 }
1024
1025 memset(m_z[m_ny - nRows], 0, nRows * m_nx * sizeof(double));
1026
1027 return( true );
1028 }
1029
1030 return( false );
1031 }
1032
1033 //---------------------------------------------------------
1037 bool CSG_Matrix::Del_Cols(sLong nCols)
1038 {
1039 if( nCols > 0 && m_ny > 0 && nCols < m_nx )
1040 {
1041 CSG_Matrix Tmp(*this);
1042
1043 if( Create(Tmp.m_nx - nCols, Tmp.m_ny) )
1044 {
1045 for(sLong y=0; y<Tmp.m_ny; y++)
1046 {
1047 memcpy(m_z[y], Tmp.m_z[y], m_nx * sizeof(double));
1048 }
1049
1050 return( true );
1051 }
1052 }
1053
1054 return( false );
1055 }
1056
1057 //---------------------------------------------------------
1061 bool CSG_Matrix::Del_Rows(sLong nRows)
1062 {
1063 if( nRows > 0 && m_nx > 0 && nRows < m_ny )
1064 {
1065 m_ny -= nRows;
1066
1067 m_z = (double **)SG_Realloc(m_z , m_ny * sizeof(double *));
1068 m_z[0] = (double *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double ));
1069
1070 return( true );
1071 }
1072
1073 return( false );
1074 }
1075
1076 //---------------------------------------------------------
1077 bool CSG_Matrix::Add_Col(const double *Data)
1078 {
1079 if( Add_Cols(1) )
1080 {
1081 Set_Col(m_nx - 1, Data);
1082
1083 return( true );
1084 }
1085
1086 return( false );
1087 }
1088
1089 bool CSG_Matrix::Add_Col(const CSG_Vector &Data)
1090 {
1091 if( m_nx == 0 )
1092 {
1093 return( Create(1, Data.Get_Size()) && Set_Col(0, Data.Get_Data()) );
1094 }
1095
1096 return( m_ny <= Data.Get_Size() && Add_Col(Data.Get_Data()) );
1097 }
1098
1099 //---------------------------------------------------------
1100 bool CSG_Matrix::Add_Row(const double *Data)
1101 {
1102 if( Add_Rows(1) )
1103 {
1104 Set_Row(m_ny - 1, Data);
1105
1106 return( true );
1107 }
1108
1109 return( false );
1110 }
1111
1112 bool CSG_Matrix::Add_Row(const CSG_Vector &Data)
1113 {
1114 if( m_ny == 0 )
1115 {
1116 return( Create(Data.Get_Size(), 1) && Set_Row(0, Data.Get_Data()) );
1117 }
1118
1119 return( m_nx <= Data.Get_Size() && Add_Row(Data.Get_Data()) );
1120 }
1121
1122 //---------------------------------------------------------
1123 bool CSG_Matrix::Ins_Col(sLong Col, const double *Data)
1124 {
1125 if( Col >= 0 && Col <= m_nx )
1126 {
1127 CSG_Matrix Tmp(*this);
1128
1129 if( Create(Tmp.m_nx + 1, Tmp.m_ny) )
1130 {
1131 for(sLong y=0; y<m_ny; y++)
1132 {
1133 double *pz = m_z[y], *pz_tmp = Tmp.m_z[y];
1134
1135 for(sLong x=0; x<m_nx; x++, pz++)
1136 {
1137 if( x != Col )
1138 {
1139 *pz = *pz_tmp; pz_tmp++;
1140 }
1141 else if( Data )
1142 {
1143 *pz = Data[y];
1144 }
1145 }
1146 }
1147
1148 return( true );
1149 }
1150 }
1151
1152 return( false );
1153 }
1154
1155 bool CSG_Matrix::Ins_Col(sLong Col, const CSG_Vector &Data)
1156 {
1157 return( m_nx == 0 ? Add_Col(Data) : m_ny <= Data.Get_Size() ? Ins_Col(Col, Data.Get_Data()) : false );
1158 }
1159
1160 //---------------------------------------------------------
1161 bool CSG_Matrix::Ins_Row(sLong Row, const double *Data)
1162 {
1163 if( Row >= 0 && Row <= m_ny )
1164 {
1165 CSG_Matrix Tmp(*this);
1166
1167 if( Create(Tmp.m_nx, Tmp.m_ny + 1) )
1168 {
1169 for(sLong y=0, y_tmp=0; y<m_ny; y++)
1170 {
1171 if( y != Row )
1172 {
1173 memcpy(m_z[y], Tmp.m_z[y_tmp++], m_nx * sizeof(double));
1174 }
1175 else if( Data )
1176 {
1177 memcpy(m_z[y], Data, m_nx * sizeof(double));
1178 }
1179 }
1180
1181 return( true );
1182 }
1183 }
1184
1185 return( false );
1186 }
1187
1188 bool CSG_Matrix::Ins_Row(sLong Row, const CSG_Vector &Data)
1189 {
1190 return( m_ny == 0 ? Add_Row(Data) : m_nx <= Data.Get_Size() ? Ins_Row(Row, Data.Get_Data()) : false );
1191 }
1192
1193 //---------------------------------------------------------
1194 bool CSG_Matrix::Set_Col(sLong Col, const double *Data)
1195 {
1196 if( Data && Col >= 0 && Col < m_nx )
1197 {
1198 for(int y=0; y<m_ny; y++)
1199 {
1200 m_z[y][Col] = Data[y];
1201 }
1202
1203 return( true );
1204 }
1205
1206 return( false );
1207 }
1208
1209 bool CSG_Matrix::Set_Col(sLong Col, const CSG_Vector &Data)
1210 {
1211 return( m_ny <= Data.Get_Size() ? Set_Col(Col, Data.Get_Data()) : false );
1212 }
1213
1214 //---------------------------------------------------------
1218 bool CSG_Matrix::Set_Col(const CSG_Vector &Data)
1219 {
1220 return( Create(1, Data.Get_Size()) && Set_Col(0, Data.Get_Data()) );
1221 }
1222
1223 //---------------------------------------------------------
1224 bool CSG_Matrix::Set_Row(sLong Row, const double *Data)
1225 {
1226 if( Data && Row >= 0 && Row < m_ny )
1227 {
1228 memcpy(m_z[Row], Data, m_nx * sizeof(double));
1229
1230 return( true );
1231 }
1232
1233 return( false );
1234 }
1235
1236 bool CSG_Matrix::Set_Row(sLong Row, const CSG_Vector &Data)
1237 {
1238 return( m_nx <= Data.Get_Size() ? Set_Row(Row, Data.Get_Data()) : false );
1239 }
1240
1241 //---------------------------------------------------------
1245 bool CSG_Matrix::Set_Row(const CSG_Vector &Data)
1246 {
1247 return( Create(Data.Get_Size(), 1) && Set_Row(0, Data.Get_Data()) );
1248 }
1249
1250 //---------------------------------------------------------
1251 bool CSG_Matrix::Del_Col(sLong Col)
1252 {
1253 if( m_nx == 1 )
1254 {
1255 return( Destroy() );
1256 }
1257
1258 if( Col >= 0 && Col < m_nx )
1259 {
1260 CSG_Matrix Tmp(*this);
1261
1262 if( Create(Tmp.m_nx - 1, Tmp.m_ny) )
1263 {
1264 for(sLong y=0; y<m_ny; y++)
1265 {
1266 double *pz = m_z[y], *pz_tmp = Tmp.m_z[y];
1267
1268 for(sLong x_tmp=0; x_tmp<Tmp.m_nx; x_tmp++, pz_tmp++)
1269 {
1270 if( x_tmp != Col )
1271 {
1272 *pz = *pz_tmp; pz++;
1273 }
1274 }
1275 }
1276
1277 return( true );
1278 }
1279 }
1280
1281 return( false );
1282 }
1283
1284 //---------------------------------------------------------
1285 bool CSG_Matrix::Del_Row(sLong Row)
1286 {
1287 if( m_ny == 1 )
1288 {
1289 return( Destroy() );
1290 }
1291
1292 if( Row >= 0 && Row < m_ny )
1293 {
1294 CSG_Matrix Tmp(*this);
1295
1296 if( Create(Tmp.m_nx, Tmp.m_ny - 1) )
1297 {
1298 for(sLong y=0, y_tmp=0; y_tmp<Tmp.m_ny; y_tmp++)
1299 {
1300 if( y_tmp != Row )
1301 {
1302 memcpy(m_z[y++], Tmp.m_z[y_tmp], m_nx * sizeof(double));
1303 }
1304 }
1305
1306 return( true );
1307 }
1308 }
1309
1310 return( false );
1311 }
1312
1313 //---------------------------------------------------------
1314 CSG_Vector CSG_Matrix::Get_Col(sLong Col) const
1315 {
1316 CSG_Vector Vector;
1317
1318 if( Col >= 0 && Col < m_nx )
1319 {
1320 Vector.Create(m_ny);
1321
1322 for(int y=0; y<m_ny; y++)
1323 {
1324 Vector[y] = m_z[y][Col];
1325 }
1326 }
1327
1328 return( Vector );
1329 }
1330
1331 //---------------------------------------------------------
1332 CSG_Vector CSG_Matrix::Get_Row(sLong Row) const
1333 {
1334 CSG_Vector Vector;
1335
1336 if( Row >= 0 && Row < m_ny )
1337 {
1338 Vector.Create(m_nx, m_z[Row]);
1339 }
1340
1341 return( Vector );
1342 }
1343
1344
1346 // //
1348
1349 //---------------------------------------------------------
1350 CSG_String CSG_Matrix::to_String(int Width, int Precision, bool bScientific, const SG_Char *Separator) const
1351 {
1352 CSG_String s, sep(Separator && *Separator ? Separator : SG_T(" "));
1353
1354 int nDigits = SG_Get_Digit_Count(1 + (int)m_ny);
1355
1356 for(sLong y=0; y<m_ny; y++)
1357 {
1358 s += CSG_String::Format("\n%0*ld:", nDigits, y + 1);
1359
1360 for(sLong x=0; x<m_nx; x++)
1361 {
1362 s += sep + SG_Get_Double_asString(m_z[y][x], Width, Precision, bScientific);
1363 }
1364 }
1365
1366 s += "\n";
1367
1368 return( s );
1369 }
1370
1371 //---------------------------------------------------------
1372 bool CSG_Matrix::from_String(const CSG_String &String)
1373 {
1374 Destroy();
1375
1376 CSG_String_Tokenizer Lines(String, "\r\n");
1377
1378 while( Lines.Has_More_Tokens() )
1379 {
1380 CSG_Vector Row; CSG_String_Tokenizer Line(Lines.Get_Next_Token().AfterFirst(':'));
1381
1382 while( Line.Has_More_Tokens() )
1383 {
1384 double z; CSG_String s(Line.Get_Next_Token());
1385
1386 if( s.asDouble(z) )
1387 {
1388 Row.Add_Row(z);
1389 }
1390 }
1391
1392 Add_Row(Row);
1393 }
1394
1395 return( Get_NRows() > 0 );
1396 }
1397
1398
1400 // //
1402
1403 //---------------------------------------------------------
1404 bool CSG_Matrix::is_Equal(const CSG_Matrix &Matrix) const
1405 {
1406 if( m_nx < Matrix.m_nx || m_ny < Matrix.m_ny )
1407 {
1408 return( false );
1409 }
1410
1411 for(sLong y=0; y<m_ny; y++) for(sLong x=0; x<m_nx; x++)
1412 {
1413 if( m_z[y][x] != Matrix.m_z[y][x] )
1414 {
1415 return( false );
1416 }
1417 }
1418
1419 return( true );
1420 }
1421
1422 //---------------------------------------------------------
1423 bool CSG_Matrix::Assign(double Scalar)
1424 {
1425 if( m_nx > 0 && m_ny > 0 )
1426 {
1427 for(sLong y=0; y<m_ny; y++)
1428 {
1429 for(sLong x=0; x<m_nx; x++)
1430 {
1431 m_z[y][x] = Scalar;
1432 }
1433 }
1434
1435 return( true );
1436 }
1437
1438 return( false );
1439 }
1440
1441 //---------------------------------------------------------
1442 bool CSG_Matrix::Assign(const CSG_Matrix &Matrix)
1443 {
1444 return( Create(Matrix) );
1445 }
1446
1447 //---------------------------------------------------------
1448 bool CSG_Matrix::Add(double Scalar)
1449 {
1450 if( m_nx > 0 && m_ny > 0 )
1451 {
1452 for(sLong y=0; y<m_ny; y++)
1453 {
1454 for(sLong x=0; x<m_nx; x++)
1455 {
1456 m_z[y][x] += Scalar;
1457 }
1458 }
1459
1460 return( true );
1461 }
1462
1463 return( false );
1464 }
1465
1466 //---------------------------------------------------------
1467 bool CSG_Matrix::Add(const CSG_Matrix &Matrix)
1468 {
1469 if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
1470 {
1471 for(sLong y=0; y<m_ny; y++)
1472 {
1473 for(sLong x=0; x<m_nx; x++)
1474 {
1475 m_z[y][x] += Matrix.m_z[y][x];
1476 }
1477 }
1478
1479 return( true );
1480 }
1481
1482 return( false );
1483 }
1484
1485 //---------------------------------------------------------
1486 bool CSG_Matrix::Subtract(const CSG_Matrix &Matrix)
1487 {
1488 if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
1489 {
1490 for(sLong y=0; y<m_ny; y++)
1491 {
1492 for(sLong x=0; x<m_nx; x++)
1493 {
1494 m_z[y][x] -= Matrix.m_z[y][x];
1495 }
1496 }
1497
1498 return( true );
1499 }
1500
1501 return( false );
1502 }
1503
1504 //---------------------------------------------------------
1505 bool CSG_Matrix::Multiply(double Scalar)
1506 {
1507 if( m_nx > 0 && m_ny > 0 )
1508 {
1509 for(sLong y=0; y<m_ny; y++)
1510 {
1511 for(sLong x=0; x<m_nx; x++)
1512 {
1513 m_z[y][x] *= Scalar;
1514 }
1515 }
1516
1517 return( true );
1518 }
1519
1520 return( false );
1521 }
1522
1523 CSG_Vector CSG_Matrix::Multiply(const CSG_Vector &Vector) const
1524 {
1525 CSG_Vector v;
1526
1527 if( m_nx == Vector.Get_Size() && v.Create(m_ny) )
1528 {
1529 for(sLong y=0; y<m_ny; y++)
1530 {
1531 double z = 0.;
1532
1533 for(sLong x=0; x<m_nx; x++)
1534 {
1535 z += m_z[y][x] * Vector(x);
1536 }
1537
1538 v[y] = z;
1539 }
1540 }
1541
1542 return( v );
1543 }
1544
1545 CSG_Matrix CSG_Matrix::Multiply(const CSG_Matrix &Matrix) const
1546 {
1547 CSG_Matrix m;
1548
1549 if( m_nx == Matrix.m_ny && m.Create(Matrix.m_nx, m_ny) )
1550 {
1551 for(int y=0; y<m.m_ny; y++)
1552 {
1553 for(int x=0; x<m.m_nx; x++)
1554 {
1555 double z = 0.;
1556
1557 for(int n=0; n<m_nx; n++)
1558 {
1559 z += m_z[y][n] * Matrix.m_z[n][x];
1560 }
1561
1562 m.m_z[y][x] = z;
1563 }
1564 }
1565 }
1566
1567 return( m );
1568 }
1569
1570
1572 // //
1574
1575 //---------------------------------------------------------
1576 bool CSG_Matrix::operator == (const CSG_Matrix &Matrix) const
1577 {
1578 return( is_Equal(Matrix) );
1579 }
1580
1581 //---------------------------------------------------------
1582 CSG_Matrix & CSG_Matrix::operator = (double Scalar)
1583 {
1584 Assign(Scalar);
1585
1586 return( *this );
1587 }
1588
1589 CSG_Matrix & CSG_Matrix::operator = (const CSG_Matrix &Matrix)
1590 {
1591 Assign(Matrix);
1592
1593 return( *this );
1594 }
1595
1596 //---------------------------------------------------------
1597 CSG_Matrix & CSG_Matrix::operator += (double Scalar)
1598 {
1599 Add(Scalar);
1600
1601 return( *this );
1602 }
1603
1604 CSG_Matrix & CSG_Matrix::operator += (const CSG_Matrix &Matrix)
1605 {
1606 Add(Matrix);
1607
1608 return( *this );
1609 }
1610
1611 //---------------------------------------------------------
1612 CSG_Matrix & CSG_Matrix::operator -= (double Scalar)
1613 {
1614 Add(-Scalar);
1615
1616 return( *this );
1617 }
1618
1619 CSG_Matrix & CSG_Matrix::operator -= (const CSG_Matrix &Matrix)
1620 {
1621 Subtract(Matrix);
1622
1623 return( *this );
1624 }
1625
1626 //---------------------------------------------------------
1627 CSG_Matrix & CSG_Matrix::operator *= (double Scalar)
1628 {
1629 Multiply(Scalar);
1630
1631 return( *this );
1632 }
1633
1634 CSG_Matrix & CSG_Matrix::operator *= (const CSG_Matrix &Matrix)
1635 {
1636 Multiply(Matrix);
1637
1638 return( *this );
1639 }
1640
1641 //---------------------------------------------------------
1642 CSG_Matrix CSG_Matrix::operator + (double Scalar) const
1643 {
1644 CSG_Matrix m(*this);
1645
1646 m.Add(Scalar);
1647
1648 return( m );
1649 }
1650
1651 CSG_Matrix CSG_Matrix::operator + (const CSG_Matrix &Matrix) const
1652 {
1653 CSG_Matrix m(*this);
1654
1655 m.Add(Matrix);
1656
1657 return( m );
1658 }
1659
1660 //---------------------------------------------------------
1661 CSG_Matrix CSG_Matrix::operator - (double Scalar) const
1662 {
1663 CSG_Matrix m(*this);
1664
1665 m.Add(-Scalar);
1666
1667 return( m );
1668 }
1669
1670 CSG_Matrix CSG_Matrix::operator - (const CSG_Matrix &Matrix) const
1671 {
1672 CSG_Matrix m(*this);
1673
1674 m.Subtract(Matrix);
1675
1676 return( m );
1677 }
1678
1679 //---------------------------------------------------------
1680 CSG_Matrix CSG_Matrix::operator * (double Scalar) const
1681 {
1682 CSG_Matrix m(*this);
1683
1684 m.Multiply(Scalar);
1685
1686 return( m );
1687 }
1688
1689 CSG_Vector CSG_Matrix::operator * (const CSG_Vector &Vector) const
1690 {
1691 return( Multiply(Vector) );
1692 }
1693
1694 CSG_Matrix CSG_Matrix::operator * (const CSG_Matrix &Matrix) const
1695 {
1696 return( Multiply(Matrix) );
1697 }
1698
1699 CSG_Matrix operator * (double Scalar, const CSG_Matrix &Matrix)
1700 {
1701 return( Matrix * Scalar );
1702 }
1703
1704
1706 // //
1708
1709 //---------------------------------------------------------
1710 bool CSG_Matrix::Set_Zero(void)
1711 {
1712 return( Create(m_nx, m_ny) );
1713 }
1714
1715 //---------------------------------------------------------
1716 bool CSG_Matrix::Set_Identity(void)
1717 {
1718 if( m_nx > 0 && m_ny > 0 )
1719 {
1720 for(int y=0; y<m_ny; y++)
1721 {
1722 for(int x=0; x<m_nx; x++)
1723 {
1724 m_z[y][x] = x == y ? 1. : 0.;
1725 }
1726 }
1727
1728 return( true );
1729 }
1730
1731 return( false );
1732 }
1733
1734 //---------------------------------------------------------
1735 bool CSG_Matrix::Set_Transpose(void)
1736 {
1737 CSG_Matrix m;
1738
1739 if( m.Create(*this) && Create(m_ny, m_nx) )
1740 {
1741 for(int y=0; y<m_ny; y++)
1742 {
1743 for(int x=0; x<m_nx; x++)
1744 {
1745 m_z[y][x] = m.m_z[x][y];
1746 }
1747 }
1748
1749 return( true );
1750 }
1751
1752 return( false );
1753 }
1754
1755 //---------------------------------------------------------
1756 bool CSG_Matrix::Set_Inverse(bool bSilent, int nSubSquare)
1757 {
1758 int n = 0;
1759
1760 if( nSubSquare > 0 )
1761 {
1762 if( nSubSquare <= m_nx && nSubSquare <= m_ny )
1763 {
1764 n = nSubSquare;
1765 }
1766 }
1767 else if( is_Square() )
1768 {
1769 n = (int)m_nx;
1770 }
1771
1772 //-----------------------------------------------------
1773 if( n > 0 )
1774 {
1775 CSG_Matrix m(*this); CSG_Array p(sizeof(int), n);
1776
1777 if( SG_Matrix_LU_Decomposition(n, (int *)p.Get_Array(), m.Get_Data(), bSilent) )
1778 {
1779 CSG_Vector v(n);
1780
1781 for(int j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
1782 {
1783 v.Set_Zero(); v[j] = 1.;
1784
1785 SG_Matrix_LU_Solve(n, (int *)p.Get_Array(), m, v.Get_Data(), true);
1786
1787 for(int i=0; i<n; i++)
1788 {
1789 m_z[i][j] = v[i];
1790 }
1791 }
1792
1793 return( true );
1794 }
1795 }
1796
1797 return( false );
1798 }
1799
1800
1802 // //
1804
1805 //---------------------------------------------------------
1806 double CSG_Matrix::Get_Determinant(void) const
1807 {
1808 double d = 0.;
1809
1810 if( is_Square() ) // det is only defined for squared matrices !
1811 {
1812 int n; CSG_Matrix m(*this); CSG_Array p(sizeof(int), Get_NX());
1813
1814 if( SG_Matrix_LU_Decomposition(Get_NX(), (int *)p.Get_Array(), m.Get_Data(), true, &n) )
1815 {
1816 d = n % 2 ? -1. : 1.;
1817
1818 for(int i=0; i<Get_NX(); i++)
1819 {
1820 d *= m[i][i];
1821 }
1822 }
1823 }
1824
1825 return( d );
1826 }
1827
1828 //---------------------------------------------------------
1829 CSG_Matrix CSG_Matrix::Get_Transpose(void) const
1830 {
1831 CSG_Matrix m(m_ny, m_nx);
1832
1833 for(sLong y=0; y<m_ny; y++)
1834 {
1835 for(sLong x=0; x<m_nx; x++)
1836 {
1837 m.m_z[x][y] = m_z[y][x];
1838 }
1839 }
1840
1841 return( m );
1842 }
1843
1844 //---------------------------------------------------------
1845 CSG_Matrix CSG_Matrix::Get_Inverse(bool bSilent, int nSubSquare) const
1846 {
1847 CSG_Matrix m(*this);
1848
1849 m.Set_Inverse(bSilent, nSubSquare);
1850
1851 return( m );
1852 }
1853
1854
1856 // //
1857 // //
1858 // //
1860
1861 //---------------------------------------------------------
1866 CSG_Matrix SG_Matrix_Get_Rotation(double R, bool bDegree)
1867 {
1868 if( bDegree ) { R *= M_DEG_TO_RAD; }
1869
1870 double sin_a = sin(R), cos_a = cos(R);
1871
1872 CSG_Matrix M(2, 2);
1873
1874 M[0][0] = cos_a; M[0][1] = -sin_a;
1875 M[1][0] = sin_a; M[1][1] = cos_a;
1876
1877 return( M );
1878 }
1879
1880 //---------------------------------------------------------
1885 CSG_Matrix SG_Matrix_Get_Rotation(double Rx, double Ry, double Rz, bool bDegree)
1886 {
1887 if( bDegree ) { Rx *= M_DEG_TO_RAD; Ry *= M_DEG_TO_RAD; Rz *= M_DEG_TO_RAD; }
1888
1889 double sin_a = sin(Rx), cos_a = cos(Rx);
1890 double sin_b = sin(Ry), cos_b = cos(Ry);
1891 double sin_c = sin(Rz), cos_c = cos(Rz);
1892
1893 CSG_Matrix M(3, 3);
1894
1895 M[0][0] = cos_a * cos_b; M[0][1] = cos_a * sin_b * sin_c - sin_a * cos_c; M[0][2] = cos_a * sin_b * cos_c + sin_a * sin_c;
1896 M[1][0] = sin_a * cos_b; M[1][1] = sin_a * sin_b * sin_c + cos_a * cos_c; M[1][2] = sin_a * sin_b * cos_c - cos_a * sin_c;
1897 M[2][0] = -sin_b; M[2][1] = cos_b * sin_c ; M[2][2] = cos_b * cos_c ;
1898
1899 return( M );
1900 }
1901
1902
1904 // //
1905 // //
1906 // //
1908
1909 //---------------------------------------------------------
1910 bool SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
1911 {
1912 int n = Vector.Get_N(); // ...it makes no sense to perform this operation on long long arrays! ...maybe in (far) future ;-)
1913
1914 if( n > 0 && n == Matrix.Get_NX() && n == Matrix.Get_NY() )
1915 {
1916 CSG_Array Permutation(sizeof(int), n);
1917
1918 if( SG_Matrix_LU_Decomposition(n, (int *)Permutation.Get_Array(), Matrix.Get_Data(), bSilent) )
1919 {
1920 return( SG_Matrix_LU_Solve(n, (int *)Permutation.Get_Array(), Matrix, Vector.Get_Data(), bSilent) );
1921 }
1922 }
1923
1924 return( false );
1925 }
1926
1927
1929 // //
1931
1932 //---------------------------------------------------------
1933 bool SG_Matrix_Eigen_Reduction(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent)
1934 {
1935 CSG_Vector Intermediate; Eigen_Vectors = Matrix;
1936
1937 return( SG_Matrix_Triangular_Decomposition(Eigen_Vectors, Eigen_Values, Intermediate) // Triangular decomposition (Householder's method)
1938 && SG_Matrix_Tridiagonal_QL (Eigen_Vectors, Eigen_Values, Intermediate) // Reduction of symmetric tridiagonal matrix
1939 );
1940 }
1941
1942
1944 // //
1946
1947 //---------------------------------------------------------
1948 bool SG_Matrix_LU_Decomposition(int n, int *Permutation, double **Matrix, bool bSilent, int *nRowChanges)
1949 {
1950 CSG_Vector Vector(n); if( nRowChanges ) { (*nRowChanges) = 0; }
1951
1952 for(int i=0; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
1953 {
1954 double dMax = 0.;
1955
1956 for(int j=0; j<n; j++)
1957 {
1958 double d = fabs(Matrix[i][j]);
1959
1960 if( d > dMax )
1961 {
1962 dMax = d;
1963 }
1964 }
1965
1966 if( dMax <= 0. ) // singular matrix !!!...
1967 {
1968 return( false );
1969 }
1970
1971 Vector[i] = 1. / dMax;
1972 }
1973
1974 int iMax = 0;
1975
1976 for(int j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
1977 {
1978 for(int i=0; i<j; i++)
1979 {
1980 double Sum = Matrix[i][j];
1981
1982 for(int k=0; k<i; k++)
1983 {
1984 Sum -= Matrix[i][k] * Matrix[k][j];
1985 }
1986
1987 Matrix[i][j] = Sum;
1988 }
1989
1990 double dMax = 0.;
1991
1992 for(int i=j; i<n; i++)
1993 {
1994 double Sum = Matrix[i][j];
1995
1996 for(int k=0; k<j; k++)
1997 {
1998 Sum -= Matrix[i][k] * Matrix[k][j];
1999 }
2000
2001 Matrix[i][j] = Sum;
2002
2003 double d = Vector[i] * fabs(Sum);
2004
2005 if( d >= dMax )
2006 {
2007 dMax = d;
2008 iMax = i;
2009 }
2010 }
2011
2012 if( j != iMax )
2013 {
2014 for(int k=0; k<n; k++)
2015 {
2016 double d = Matrix[iMax][k];
2017 Matrix[iMax][k] = Matrix[j ][k];
2018 Matrix[j ][k] = d;
2019 }
2020
2021 Vector[iMax] = Vector[j];
2022
2023 if( nRowChanges ) { (*nRowChanges)++; }
2024 }
2025
2026 Permutation[j] = iMax;
2027
2028 if( Matrix[j][j] == 0. )
2029 {
2030 Matrix[j][j] = M_TINY;
2031 }
2032
2033 if( j != n )
2034 {
2035 double d = 1. / (Matrix[j][j]);
2036
2037 for(int i=j+1; i<n; i++)
2038 {
2039 Matrix[i][j] *= d;
2040 }
2041 }
2042 }
2043
2044 return( bSilent || SG_UI_Process_Get_Okay(false) );
2045 }
2046
2047
2049 // //
2051
2052 //---------------------------------------------------------
2053 bool SG_Matrix_LU_Solve(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent)
2054 {
2055 for(int i=0, k=-1; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
2056 {
2057 double Sum = Vector[Permutation[i]]; Vector[Permutation[i]] = Vector[i];
2058
2059 if( k >= 0 )
2060 {
2061 for(int j=k; j<=i-1; j++)
2062 {
2063 Sum -= Matrix[i][j] * Vector[j];
2064 }
2065 }
2066 else if( Sum )
2067 {
2068 k = i;
2069 }
2070
2071 Vector[i] = Sum;
2072 }
2073
2074 for(int i=n-1; i>=0 && (bSilent || SG_UI_Process_Set_Progress(n-i, n)); i--)
2075 {
2076 double Sum = Vector[i];
2077
2078 for(int j=i+1; j<n; j++)
2079 {
2080 Sum -= Matrix[i][j] * Vector[j];
2081 }
2082
2083 Vector[i] = Sum / Matrix[i][i];
2084 }
2085
2086 return( true );
2087 }
2088
2089
2091 // //
2093
2094 //---------------------------------------------------------
2095 // Householder reduction of matrix a to tridiagonal form.
2096
2097 bool SG_Matrix_Triangular_Decomposition(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e)
2098 {
2099 if( A.Get_NX() != A.Get_NY() )
2100 {
2101 return( false );
2102 }
2103
2104 int n = A.Get_NX();
2105
2106 if( !d.Create(n) || !e.Create(n) )
2107 {
2108 return( false );
2109 }
2110
2111 for(int i=n-1, l=n-2; i>=1; i--, l--)
2112 {
2113 double h = 0.;
2114
2115 if( l > 0 )
2116 {
2117 double scale = 0.;
2118
2119 for(int k=0; k<=l; k++)
2120 {
2121 scale += fabs(A[i][k]);
2122 }
2123
2124 if( scale == 0. )
2125 {
2126 e[i] = A[i][l];
2127 }
2128 else
2129 {
2130 for(int k=0; k<=l; k++)
2131 {
2132 A[i][k] /= scale;
2133 h += A[i][k] * A[i][k];
2134 }
2135
2136 double f = A[i][l];
2137 double g = f > 0. ? -sqrt(h) : sqrt(h);
2138 e[i] = scale * g;
2139 h -= f * g;
2140 A[i][l] = f - g;
2141 f = 0.;
2142
2143 for(int j=0; j<=l; j++)
2144 {
2145 A[j][i] = A[i][j]/h;
2146 g = 0.;
2147
2148 for(int k=0; k<=j; k++)
2149 {
2150 g += A[j][k] * A[i][k];
2151 }
2152
2153 for(int k=j+1; k<=l; k++)
2154 {
2155 g += A[k][j] * A[i][k];
2156 }
2157
2158 e[j] = g / h;
2159 f += e[j] * A[i][j];
2160 }
2161
2162 double hh = f / (h + h);
2163
2164 for(int j=0; j<=l; j++)
2165 {
2166 f = A[i][j];
2167 e[j] = g = e[j] - hh * f;
2168
2169 for(int k=0; k<=j; k++)
2170 {
2171 A[j][k] -= (f * e[k] + g * A[i][k]);
2172 }
2173 }
2174 }
2175 }
2176 else
2177 {
2178 e[i] = A[i][l];
2179 }
2180
2181 d[i] = h;
2182 }
2183
2184 d[0] = 0.;
2185 e[0] = 0.;
2186
2187 for(int i=0, l=-1; i<n; i++, l++)
2188 {
2189 if( d[i] )
2190 {
2191 for(int j=0; j<=l; j++)
2192 {
2193 double g = 0.;
2194
2195 for(int k=0; k<=l; k++)
2196 {
2197 g += A[i][k] * A[k][j];
2198 }
2199
2200 for(int k=0; k<=l; k++)
2201 {
2202 A[k][j] -= g * A[k][i];
2203 }
2204 }
2205 }
2206
2207 d[i] = A[i][i];
2208 A[i][i] = 1.;
2209
2210 for(int j=0; j<=l; j++)
2211 {
2212 A[j][i] = A[i][j] = 0.;
2213 }
2214 }
2215
2216 return( true );
2217 }
2218
2219
2221 // //
2223
2224 //---------------------------------------------------------
2225 // Tridiagonal QL algorithm -- Implicit
2226
2227 bool SG_Matrix_Tridiagonal_QL(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e)
2228 {
2229 if( Q.Get_NX() != Q.Get_NY() || Q.Get_NX() != d.Get_N() || Q.Get_NX() != e.Get_N() )
2230 {
2231 return( false );
2232 }
2233
2234 int m, l, iter, i, k, n;
2235 double s, r, p, g, f, dd, c, b;
2236
2237 n = d.Get_N();
2238
2239 for(i=1; i<n; i++)
2240 {
2241 e[i - 1] = e[i];
2242 }
2243
2244 e[n - 1] = 0.;
2245
2246 for(l=0; l<n; l++)
2247 {
2248 iter = 0;
2249
2250 do
2251 {
2252 for(m=l; m<n-1; m++)
2253 {
2254 dd = fabs(d[m]) + fabs(d[m + 1]);
2255
2256 if( fabs(e[m]) + dd == dd )
2257 {
2258 break;
2259 }
2260 }
2261
2262 if( m != l )
2263 {
2264 if( iter++ == 30 )
2265 {
2266 return( false ); // no convergence in TLQI !
2267 }
2268
2269 g = (d[l+1] - d[l]) / (2. * e[l]);
2270 r = sqrt((g * g) + 1.);
2271 g = d[m] - d[l] + e[l] / (g + M_SET_SIGN(r, g));
2272 s = c = 1.;
2273 p = 0.;
2274
2275 for(i = m-1; i >= l; i--)
2276 {
2277 f = s * e[i];
2278 b = c * e[i];
2279
2280 if (fabs(f) >= fabs(g))
2281 {
2282 c = g / f;
2283 r = sqrt((c * c) + 1.);
2284 e[i+1] = f * r;
2285 c *= (s = 1. / r);
2286 }
2287 else
2288 {
2289 s = f / g;
2290 r = sqrt((s * s) + 1.);
2291 e[i+1] = g * r;
2292 s *= (c = 1. / r);
2293 }
2294
2295 g = d[i+1] - p;
2296 r = (d[i] - g) * s + 2. * c * b;
2297 p = s * r;
2298 d[i+1] = g + p;
2299 g = c * r - b;
2300
2301 for(k=0; k<n; k++)
2302 {
2303 f = Q[k][i+1];
2304 Q[k][i+1] = s * Q[k][i] + c * f;
2305 Q[k][i] = c * Q[k][i] - s * f;
2306 }
2307 }
2308
2309 d[l] = d[l] - p;
2310 e[l] = g;
2311 e[m] = 0.;
2312 }
2313 }
2314 while( m != l );
2315 }
2316
2317 return( true );
2318 }
2319
2320
2322 // //
2323 // //
2324 // //
2326
2327 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:111
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_Matrix::to_String
CSG_String to_String(int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
Definition: mat_matrix.cpp:1350
CSG_Vector::from_String
bool from_String(const CSG_String &String)
Definition: mat_matrix.cpp:238
CSG_Matrix::Get_Inverse
CSG_Matrix Get_Inverse(bool bSilent=true, int nSubSquare=0) const
Definition: mat_matrix.cpp:1845
CSG_Matrix::is_Equal
bool is_Equal(const CSG_Matrix &Matrix) const
Definition: mat_matrix.cpp:1404
SG_Get_Double_asString
CSG_String SG_Get_Double_asString(double Number, int Width, int Precision, bool bScientific)
Definition: mat_tools.cpp:159
CSG_Vector::is_Collinear
bool is_Collinear(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:296
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String_Tokenizer::Has_More_Tokens
bool Has_More_Tokens(void) const
Definition: api_string.cpp:1464
CSG_Matrix::Set_Identity
bool Set_Identity(void)
Definition: mat_matrix.cpp:1716
CSG_Vector::Get_Data
double * Get_Data(void) const
Definition: mat_tools.h:369
CSG_Vector::operator=
CSG_Vector & operator=(double Scalar)
Definition: mat_matrix.cpp:460
CSG_Matrix::Del_Rows
bool Del_Rows(sLong nRows)
Definition: mat_matrix.cpp:1061
CSG_Vector::to_String
CSG_String to_String(int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
Definition: mat_matrix.cpp:225
CSG_Matrix::Set_Inverse
bool Set_Inverse(bool bSilent=true, int nSubSquare=0)
Definition: mat_matrix.cpp:1756
M_SET_SIGN
#define M_SET_SIGN(x, sign)
Definition: mat_tools.h:132
SG_VectorR2_Rotate
bool SG_VectorR2_Rotate(double &x, double &y, double Angle)
Definition: mat_matrix.cpp:750
A
#define A
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Matrix::Del_Col
bool Del_Col(sLong Col)
Definition: mat_matrix.cpp:1251
CSG_Matrix::~CSG_Matrix
virtual ~CSG_Matrix(void)
Definition: mat_matrix.cpp:918
CSG_Matrix::Add
bool Add(double Scalar)
Definition: mat_matrix.cpp:1448
CSG_Matrix::CSG_Matrix
CSG_Matrix(void)
Definition: mat_matrix.cpp:823
CSG_Vector::Get_Unity
CSG_Vector Get_Unity(void) const
Definition: mat_matrix.cpp:733
CSG_Vector::Del_Row
bool Del_Row(sLong Row=-1)
Definition: mat_matrix.cpp:201
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Vector::Set_Unity
bool Set_Unity(void)
Definition: mat_matrix.cpp:596
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
CSG_Matrix::operator+
CSG_Matrix operator+(double Scalar) const
Definition: mat_matrix.cpp:1642
CSG_Matrix::Set_Cols
bool Set_Cols(sLong nCols)
Definition: mat_matrix.cpp:958
CSG_Matrix::Add_Rows
bool Add_Rows(sLong nRows)
Definition: mat_matrix.cpp:1011
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Vector::Get_Cross_Product
CSG_Vector Get_Cross_Product(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:675
SG_VectorR3_Rotate
bool SG_VectorR3_Rotate(double Vector[3], size_t Axis, double Angle)
Definition: mat_matrix.cpp:776
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Vector::operator*
CSG_Vector operator*(double Scalar) const
Definition: mat_matrix.cpp:565
CSG_Matrix::Del_Row
bool Del_Row(sLong Row)
Definition: mat_matrix.cpp:1285
CSG_Vector::operator-
CSG_Vector operator-(double Scalar) const
Definition: mat_matrix.cpp:546
SG_Compare_Double
int SG_Compare_Double(const void *a, const void *b)
Definition: mat_tools.cpp:199
CSG_Matrix::Get_Col
CSG_Vector Get_Col(sLong Col) const
Definition: mat_matrix.cpp:1314
CSG_Matrix::Set_Row
bool Set_Row(sLong Row, const double *Data)
Definition: mat_matrix.cpp:1224
CSG_Vector::Get_Length
double Get_Length(void) const
Definition: mat_matrix.cpp:685
CSG_Vector::CSG_Vector
CSG_Vector(void)
Definition: mat_matrix.cpp:74
CSG_Matrix::from_String
bool from_String(const CSG_String &String)
Definition: mat_matrix.cpp:1372
CSG_Matrix::Get_Data
double ** Get_Data(void) const
Definition: mat_tools.h:511
CSG_Matrix::Add_Cols
bool Add_Cols(sLong nCols)
Definition: mat_matrix.cpp:990
mat_tools.h
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Vector::Flip_Values
bool Flip_Values(void)
Definition: mat_matrix.cpp:619
CSG_Vector
Definition: mat_tools.h:345
CSG_Vector::Set_Zero
bool Set_Zero(void)
Definition: mat_matrix.cpp:590
CSG_Matrix::Set_Transpose
bool Set_Transpose(void)
Definition: mat_matrix.cpp:1735
CSG_Matrix::Multiply
bool Multiply(double Scalar)
Definition: mat_matrix.cpp:1505
CSG_Vector::operator+
CSG_Vector operator+(double Scalar) const
Definition: mat_matrix.cpp:527
SG_Matrix_Triangular_Decomposition
bool SG_Matrix_Triangular_Decomposition(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e)
Definition: mat_matrix.cpp:2097
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Vector::Assign
bool Assign(double Scalar)
Definition: mat_matrix.cpp:317
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Matrix::Assign
bool Assign(double Scalar)
Definition: mat_matrix.cpp:1423
CSG_Matrix::Subtract
bool Subtract(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:1486
SG_Matrix_LU_Decomposition
bool SG_Matrix_LU_Decomposition(int n, int *Permutation, double **Matrix, bool bSilent, int *nRowChanges)
Definition: mat_matrix.cpp:1948
CSG_Vector::Get_Angle
double Get_Angle(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:703
CSG_Vector::Get_Scalar_Product
CSG_Vector Get_Scalar_Product(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:665
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Vector::operator-=
CSG_Vector & operator-=(double Scalar)
Definition: mat_matrix.cpp:490
CSG_Vector::Multiply_Cross
bool Multiply_Cross(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:416
CSG_Matrix::Del_Cols
bool Del_Cols(sLong nCols)
Definition: mat_matrix.cpp:1037
CSG_Vector::Subtract
bool Subtract(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:378
SG_Matrix_LU_Solve
bool SG_Matrix_LU_Solve(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent)
Definition: mat_matrix.cpp:2053
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Matrix::Set_Rows
bool Set_Rows(sLong nRows)
Definition: mat_matrix.cpp:974
CSG_Vector::is_Null
bool is_Null(void) const
Definition: mat_matrix.cpp:263
CSG_Vector::~CSG_Vector
virtual ~CSG_Vector(void)
Definition: mat_matrix.cpp:125
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Matrix::Set_Col
bool Set_Col(sLong Col, const double *Data)
Definition: mat_matrix.cpp:1194
SG_Matrix_Solve
bool SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
Definition: mat_matrix.cpp:1910
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_Matrix_Eigen_Reduction
bool SG_Matrix_Eigen_Reduction(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent)
Definition: mat_matrix.cpp:1933
CSG_Matrix::Get_Transpose
CSG_Matrix Get_Transpose(void) const
Definition: mat_matrix.cpp:1829
CSG_Vector::Multiply
bool Multiply(double Scalar)
Definition: mat_matrix.cpp:394
CSG_Matrix::is_Square
bool is_Square(void) const
Definition: mat_tools.h:521
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_Vector::is_Equal
bool is_Equal(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:277
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
CSG_Vector::Add
bool Add(double Scalar)
Definition: mat_matrix.cpp:346
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
CSG_Array
Definition: api_core.h:308
CSG_Matrix::operator+=
CSG_Matrix & operator+=(double Scalar)
Definition: mat_matrix.cpp:1597
B
#define B
CSG_String
Definition: api_core.h:557
SG_Get_Digit_Count
int SG_Get_Digit_Count(int Number)
Definition: mat_tools.cpp:144
CSG_Array::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_memory.cpp:425
SG_Matrix_Get_Rotation
CSG_Matrix SG_Matrix_Get_Rotation(double R, bool bDegree)
Definition: mat_matrix.cpp:1866
CSG_Matrix::Set_Zero
bool Set_Zero(void)
Definition: mat_matrix.cpp:1710
CSG_Matrix::Ins_Col
bool Ins_Col(sLong Col, const double *Data=NULL)
Definition: mat_matrix.cpp:1123
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Vector::Del_Rows
bool Del_Rows(sLong nRows)
Definition: mat_matrix.cpp:177
CSG_Matrix::operator-
CSG_Matrix operator-(double Scalar) const
Definition: mat_matrix.cpp:1661
CSG_Matrix::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:923
CSG_Matrix::Get_Row
CSG_Vector Get_Row(sLong Row) const
Definition: mat_matrix.cpp:1332
CSG_Matrix::operator==
bool operator==(const CSG_Matrix &Matrix) const
Definition: mat_matrix.cpp:1576
CSG_Matrix::Add_Col
bool Add_Col(const double *Data=NULL)
Definition: mat_matrix.cpp:1077
CSG_Matrix::operator*=
CSG_Matrix & operator*=(double Scalar)
Definition: mat_matrix.cpp:1627
CSG_Matrix::Get_Determinant
double Get_Determinant(void) const
Definition: mat_matrix.cpp:1806
CSG_Matrix::Add_Row
bool Add_Row(const double *Data=NULL)
Definition: mat_matrix.cpp:1100
CSG_Vector::operator+=
CSG_Vector & operator+=(double Scalar)
Definition: mat_matrix.cpp:475
CSG_Matrix::operator=
CSG_Matrix & operator=(double Scalar)
Definition: mat_matrix.cpp:1582
SG_Matrix_Tridiagonal_QL
bool SG_Matrix_Tridiagonal_QL(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e)
Definition: mat_matrix.cpp:2227
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
M_TINY
#define M_TINY
Definition: mat_tools.h:121
CSG_Vector::Multiply_Scalar
double Multiply_Scalar(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:433
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Vector::operator*=
CSG_Vector & operator*=(double Scalar)
Definition: mat_matrix.cpp:505
CSG_Matrix::Set_Size
bool Set_Size(sLong nRows, sLong nCols)
Definition: mat_matrix.cpp:952
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
CSG_Vector::Set_Rows
bool Set_Rows(sLong nRows)
Definition: mat_matrix.cpp:140
CSG_String_Tokenizer
Definition: api_core.h:754
CSG_Matrix
Definition: mat_tools.h:463
CSG_Matrix::operator*
CSG_Matrix operator*(double Scalar) const
Definition: mat_matrix.cpp:1680
CSG_String_Tokenizer::Get_Next_Token
CSG_String Get_Next_Token(void)
Definition: api_string.cpp:1442
CSG_Vector::Sort
bool Sort(bool bAscending=true)
Definition: mat_matrix.cpp:642
CSG_Vector::Add_Rows
bool Add_Rows(sLong nRows)
Definition: mat_matrix.cpp:156
CSG_Matrix::Get_NY
int Get_NY(void) const
Definition: mat_tools.h:506
CSG_Matrix::Ins_Row
bool Ins_Row(sLong Row, const double *Data=NULL)
Definition: mat_matrix.cpp:1161
CSG_Matrix::Get_NX
int Get_NX(void) const
Definition: mat_tools.h:505
CSG_Matrix::operator-=
CSG_Matrix & operator-=(double Scalar)
Definition: mat_matrix.cpp:1612
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_mRMR.cpp File Reference

  • saga_core
  • saga_api
mat_mRMR.cpp File Reference

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_mRMR.cpp Source File

  • saga_core
  • saga_api
mat_mRMR.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mRMR.cpp //
15 // //
16 // Copyright (C) 2014 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // e-mail: oconrad@saga-gis.org //
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Germany //
48 // //
50
51 //---------------------------------------------------------
52 #ifdef WITH_MRMR
53
54 //---------------------------------------------------------
55 // A C++ program to implement the mRMR selection using mutual information
56 // written by Hanchuan Peng.
57 //
58 // Disclaimer: The author of program is Hanchuan Peng
59 // at <penghanchuan@yahoo.com>.
60 //
61 // The CopyRight is reserved by the author.
62 //
63 // Last modification: Jan/25/2007
64 //
65 // by Hanchuan Peng
66 // 2005-10-24: finalize the computing parts of the whole program
67 // 2005-10-25: add non-discretization for the classification variable. Also slightly change some output info for the web application
68 // 2005-11-01: add control to the user-defined max variable number and sample number
69 // 2006-01-26: add gnu_getline.c to convert the code to be compilable under Max OS.
70 // 2007-01-25: change the address info
71
72 //---------------------------------------------------------
73 #include "mat_tools.h"
74 #include "parameters.h"
75 #include "table.h"
76
77
79 // //
80 // //
81 // //
83
84 //---------------------------------------------------------
85 #define DELETE_ARRAY(p) if( p ) { delete[]p; p = NULL; }
86
87 //---------------------------------------------------------
88 enum ESG_mRMR_Selection
89 {
90 SG_mRMR_SELECTION_RANK = 0,
91 SG_mRMR_SELECTION_INDEX,
92 SG_mRMR_SELECTION_NAME,
93 SG_mRMR_SELECTION_SCORE
94 };
95
96
98 // //
100
101 //---------------------------------------------------------
102 CSG_mRMR::CSG_mRMR(void)
103 {
104 m_Samples = NULL;
105 m_nSamples = 0;
106 m_nVars = 0;
107 m_bDiscretized = false; // initialize the data as continous
108 m_bVerbose = false;
109
110 m_pSelection = new CSG_Table;
111
112 m_pSelection->Add_Field("RANK" , SG_DATATYPE_Int ); // mRMR_SELFLD_RANK
113 m_pSelection->Add_Field("INDEX", SG_DATATYPE_Int ); // mRMR_SELFLD_INDEX
114 m_pSelection->Add_Field("NAME" , SG_DATATYPE_String); // mRMR_SELFLD_NAME
115 m_pSelection->Add_Field("SCORE", SG_DATATYPE_Double); // mRMR_SELFLD_SCORE
116 }
117
118 //---------------------------------------------------------
119 CSG_mRMR::~CSG_mRMR(void)
120 {
121 Destroy();
122
123 delete(m_pSelection);
124 }
125
126 //---------------------------------------------------------
127 void CSG_mRMR::Destroy(void)
128 {
129 if( m_Samples )
130 {
131 DELETE_ARRAY(m_Samples[0]);
132 DELETE_ARRAY(m_Samples);
133 }
134
135 m_VarNames .Clear();
136 m_nSamples = 0;
137 m_nVars = 0;
138 m_bDiscretized = false; // initialize the data as continous
139
140 m_pSelection ->Del_Records();
141 }
142
143
145 // //
147
148 //---------------------------------------------------------
149 CSG_String CSG_mRMR::Get_Description(void)
150 {
151 return( _TW(
152 "The minimum Redundancy Maximum Relevance (mRMR) feature selection "
153 "algorithm has been developed by Hanchuan Peng <hanchuan.peng@gmail.com>.\n"
154 "\n"
155 "References:\n"
156 "Feature selection based on mutual information: criteria of max-dependency, max-relevance, and min-redundancy. "
157 "Hanchuan Peng, Fuhui Long, and Chris Ding, "
158 "IEEE Transactions on Pattern Analysis and Machine Intelligence, "
159 "Vol. 27, No. 8, pp.1226-1238, 2005.\n"
160 "\n"
161 "Minimum redundancy feature selection from microarray gene expression data,\n"
162 "Chris Ding, and Hanchuan Peng, "
163 "Journal of Bioinformatics and Computational Biology, "
164 "Vol. 3, No. 2, pp.185-205, 2005.\n"
165 "\n"
166 "Hanchuan Peng's mRMR Homepage at "
167 "<a target=\"_blank\" href=\"http://penglab.janelia.org/proj/mRMR/\">"
168 "http://penglab.janelia.org/proj/mRMR/</a>\n"
169 ));
170 }
171
172
174 // //
176
177 //---------------------------------------------------------
178 bool CSG_mRMR::Parameters_Add(CSG_Parameters *pParameters, CSG_Parameter *pNode)
179 {
180 CSG_String ParentID(pNode ? pNode->Get_Identifier() : SG_T(""));
181
182 pParameters->Add_Int(
183 ParentID, "mRMR_NFEATURES" , _TL("Number of Features"),
184 _TL(""),
185 50, 1, true
186 );
187
188 pParameters->Add_Bool(
189 ParentID, "mRMR_DISCRETIZE" , _TL("Discretization"),
190 _TL("uncheck this means no discretizaton (i.e. data is already integer)"),
191 true
192 );
193
194 pParameters->Add_Double(
195 ParentID, "mRMR_THRESHOLD" , _TL("Discretization Threshold"),
196 _TL("a double number of the discretization threshold; set to 0 to make binarization"),
197 1.0, 0.0, true
198 );
199
200 pParameters->Add_Choice(
201 ParentID, "mRMR_METHOD" , _TL("Selection Method"),
202 _TL(""),
203 CSG_String::Format("%s|%s|",
204 _TL("Mutual Information Difference (MID)"),
205 _TL("Mutual Information Quotient (MIQ)")
206 ), 0
207 );
208
209 return( true );
210 }
211
212 //---------------------------------------------------------
213 int CSG_mRMR::Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
214 {
215 if( pParameter->Cmp_Identifier("mRMR_DISCRETIZE") )
216 {
217 pParameters->Set_Enabled("mRMR_THRESHOLD", pParameter->asBool());
218 }
219
220 return( 1 );
221 }
222
223 //---------------------------------------------------------
224 bool CSG_mRMR::Set_Data(CSG_Table &Data, int ClassField, CSG_Parameters *pParameters)
225 {
226 bool bDiscretize = (*pParameters)("mRMR_DISCRETIZE") ? (*pParameters)("mRMR_DISCRETIZE")->asBool () : true;
227 double Threshold = (*pParameters)("mRMR_THRESHOLD" ) ? (*pParameters)("mRMR_THRESHOLD" )->asDouble() : 1.0;
228
229 return( Set_Data(Data, ClassField, bDiscretize ? Threshold : -1.0) );
230 }
231
232 bool CSG_mRMR::Set_Data(CSG_Matrix &Data, int ClassField, CSG_Parameters *pParameters)
233 {
234 bool bDiscretize = (*pParameters)("mRMR_DISCRETIZE") ? (*pParameters)("mRMR_DISCRETIZE")->asBool () : true;
235 double Threshold = (*pParameters)("mRMR_THRESHOLD" ) ? (*pParameters)("mRMR_THRESHOLD" )->asDouble() : 1.0;
236
237 return( Set_Data(Data, ClassField, bDiscretize ? Threshold : -1.0) );
238 }
239
240 //---------------------------------------------------------
241 bool CSG_mRMR::Get_Selection(CSG_Parameters *pParameters)
242 {
243 int nFeatures = (*pParameters)("mRMR_NFEATURES") ? (*pParameters)("mRMR_NFEATURES")->asInt() : 50;
244 int Method = (*pParameters)("mRMR_METHOD" ) ? (*pParameters)("mRMR_METHOD" )->asInt() : 0;
245
246 return( Get_Selection(nFeatures, Method) );
247 }
248
249
251 // //
253
254 //---------------------------------------------------------
255 int CSG_mRMR::Get_Count (void) const
256 {
257 return( (int)m_pSelection->Get_Count() );
258 }
259
260 int CSG_mRMR::Get_Index(int i) const
261 {
262 return( m_pSelection->Get_Record(i)->asInt (SG_mRMR_SELECTION_INDEX) );
263 }
264
265 CSG_String CSG_mRMR::Get_Name(int i) const
266 {
267 return( m_pSelection->Get_Record(i)->asString(SG_mRMR_SELECTION_NAME ) );
268 }
269
270 double CSG_mRMR::Get_Score(int i) const
271 {
272 return( m_pSelection->Get_Record(i)->asDouble(SG_mRMR_SELECTION_SCORE) );
273 }
274
275
277 // //
279
280 //---------------------------------------------------------
281 #define ADD_MESSAGE(Message) if( m_bVerbose ) SG_UI_Msg_Add_Execution(CSG_String(Message) + "\n", false);
282 #define ADD_WARNING(Message) if( m_bVerbose ) SG_UI_Msg_Add_Execution(_TL("Warning") + CSG_String(": ") + CSG_String(Message) + "\n", false, SG_UI_MSG_STYLE_FAILURE);
283
284
286 // //
288
289 //---------------------------------------------------------
290 bool CSG_mRMR::Get_Memory(int nVars, int nSamples)
291 {
292 Destroy();
293
294 //-----------------------------------------------------
295 m_nVars = nVars;
296
297 if( m_nVars <= 0 )
298 {
299 SG_UI_Msg_Add_Error("no features");
300
301 return( false );
302 }
303
304 m_nSamples = nSamples;
305
306 if( m_nSamples <= 0 )
307 {
308 SG_UI_Msg_Add_Error("no samples");
309
310 return( false );
311 }
312
313 //-----------------------------------------------------
314 m_Samples = new double *[m_nSamples];
315
316 if( !m_Samples )
317 {
318 SG_UI_Msg_Add_Error("failed to allocate memory.");
319
320 return( false );
321 }
322
323 m_Samples[0] = new double[m_nSamples * m_nVars];
324
325 if( !m_Samples[0] )
326 {
327 SG_UI_Msg_Add_Error("failed to allocate memory.");
328
329 return( false );
330 }
331
332 return( true );
333 }
334
335 //---------------------------------------------------------
336 bool CSG_mRMR::Set_Data(CSG_Table &Data, int ClassField, double Threshold)
337 {
338 if( !Get_Memory(Data.Get_Field_Count(), (int)Data.Get_Count()) )
339 {
340 return( false );
341 }
342
343 //-----------------------------------------------------
344 if( ClassField < 0 || ClassField >= m_nVars )
345 {
346 ClassField = 0;
347 }
348
349 Data.Set_Index(ClassField, TABLE_INDEX_Ascending);
350
351 CSG_String s;
352
353 for(int iSample=0, Class=0; iSample<m_nSamples; iSample++)
354 {
355 double *pData = m_Samples[iSample] = m_Samples[0] + iSample * m_nVars;
356
357 if( s.Cmp(Data[iSample].asString(ClassField)) )
358 {
359 s = Data[iSample].asString(ClassField);
360
361 Class++;
362 }
363
364 *pData++ = Class;
365
366 for(int iVar=0; iVar<m_nVars; iVar++)
367 {
368 if( iVar != ClassField )
369 {
370 *pData++ = Data[iSample].asDouble(iVar);
371 }
372 }
373 }
374
375 Data.Del_Index();
376
377 m_VarNames += Data.Get_Field_Name(ClassField);
378
379 for(int iVar=0; iVar<m_nVars; iVar++)
380 {
381 if( iVar != ClassField )
382 {
383 m_VarNames += Data.Get_Field_Name(iVar);
384 }
385 }
386
387 //-----------------------------------------------------
388 if( Threshold >= 0.0 ) // discretization
389 {
390 Discretize(Threshold);
391 }
392
393 return( true );
394 }
395
396 //---------------------------------------------------------
397 bool CSG_mRMR::Set_Data(CSG_Matrix &Data, int ClassField, double Threshold)
398 {
399 if( !Get_Memory(Data.Get_NX(), Data.Get_NY()) )
400 {
401 return( false );
402 }
403
404 //-----------------------------------------------------
405 if( ClassField < 0 || ClassField >= m_nVars )
406 {
407 ClassField = 0;
408 }
409
410 for(int iSample=0; iSample<m_nSamples; iSample++)
411 {
412 double *pData = m_Samples[iSample] = m_Samples[0] + iSample * m_nVars;
413
414 *pData++ = Data[iSample][ClassField];
415
416 for(int iVar=0; iVar<m_nVars; iVar++)
417 {
418 if( iVar != ClassField )
419 {
420 *pData++ = Data[iSample][iVar];
421 }
422 }
423 }
424
425 m_VarNames += "CLASS";
426
427 for(int iVar=0; iVar<m_nVars; iVar++)
428 {
429 if( iVar != ClassField )
430 {
431 m_VarNames += CSG_String::Format(SG_T("FEATURE_%02d"), iVar);
432 }
433 }
434
435 //-----------------------------------------------------
436 if( Threshold >= 0.0 ) // discretization
437 {
438 Discretize(Threshold);
439 }
440
441 return( true );
442 }
443
444
446 // //
448
449 //---------------------------------------------------------
450 bool CSG_mRMR::Discretize(double Threshold)
451 {
452 if( !m_Samples[0] || Threshold < 0.0 || m_bDiscretized )
453 {
454 return( false );
455 }
456
457 long i, j; // exclude the first column
458
459 //-----------------------------------------------------
460 for(j=1; j<m_nVars; j++) // z-score
461 {
462 double cursum = 0;
463 double curmean = 0;
464 double curstd = 0;
465
466 for(i=0; i<m_nSamples; i++)
467 {
468 cursum += m_Samples[i][j];
469 }
470
471 curmean = cursum / m_nSamples;
472 cursum = 0;
473
474 double tmpf;
475
476 for(i=0; i<m_nSamples; i++)
477 {
478 tmpf = m_Samples[i][j] - curmean;
479 cursum += tmpf * tmpf;
480 }
481
482 curstd = (m_nSamples == 1) ? 0 : sqrt(cursum / (m_nSamples - 1)); // m_nSamples -1 is an unbiased version for Gaussian
483
484 for(i=0; i<m_nSamples; i++)
485 {
486 m_Samples[i][j] = (m_Samples[i][j] - curmean) / curstd;
487 }
488 }
489
490 //-----------------------------------------------------
491 for(j=1; j<m_nVars; j++)
492 {
493 double tmpf;
494
495 for(i=0; i<m_nSamples; i++)
496 {
497 tmpf = m_Samples[i][j];
498
499 if( tmpf > Threshold )
500 {
501 tmpf = 1;
502 }
503 else if( tmpf < -Threshold )
504 {
505 tmpf = -1;
506 }
507 else
508 {
509 tmpf = 0;
510 }
511
512 m_Samples[i][j] = tmpf;
513 }
514 }
515
516 m_bDiscretized = true;
517
518 return( true );
519 }
520
521
523 // //
525
526 //---------------------------------------------------------
527 #define ADD_FEATURE(rank, score) {\
528 CSG_Table_Record *pFeature = m_pSelection->Add_Record();\
529 \
530 pFeature->Set_Value(SG_mRMR_SELECTION_RANK , rank + 1);\
531 pFeature->Set_Value(SG_mRMR_SELECTION_INDEX, feaInd[rank]);\
532 pFeature->Set_Value(SG_mRMR_SELECTION_NAME , m_VarNames[(size_t)feaInd[rank]]);\
533 pFeature->Set_Value(SG_mRMR_SELECTION_SCORE, score);\
534 \
535 ADD_MESSAGE(CSG_String::Format(SG_T("%d \t %d \t %s \t %5.3f"),\
536 rank + 1, feaInd[rank], m_VarNames[(size_t)feaInd[rank]].c_str(), score)\
537 );\
538 }
539
540 //---------------------------------------------------------
541 int CSG_mRMR::Pool_Compare(const void *a, const void *b)
542 {
543 if( ((TPool *)a)->mival < ((TPool *)b)->mival )
544 return( -1 );
545
546 if( ((TPool *)a)->mival > ((TPool *)b)->mival )
547 return( 1 );
548
549 return( 0 );
550 }
551
552 //---------------------------------------------------------
553 bool CSG_mRMR::Get_Selection(int nFeatures, int Method)
554 {
555 m_pSelection->Del_Records();
556
557 if( !m_Samples[0] )
558 {
559 SG_UI_Msg_Add_Error("The input data is NULL.");
560
561 return( false );
562 }
563
564 if( nFeatures < 0 )
565 {
566 SG_UI_Msg_Add_Error("The input number of features is negative.");
567
568 return( false );
569 }
570
571 long poolUseFeaLen = 500;
572 if( poolUseFeaLen > m_nVars - 1 ) // there is a target variable (the first one), that is why must remove one
573 poolUseFeaLen = m_nVars - 1;
574
575 if( nFeatures > poolUseFeaLen )
576 nFeatures = poolUseFeaLen;
577
578 long *feaInd = new long[nFeatures];
579
580 if( !feaInd )
581 {
582 SG_UI_Msg_Add_Error("Fail to allocate memory.");
583
584 return( false );
585 }
586
587 //-----------------------------------------------------
588 // determine the pool
589
590 TPool *Pool = (TPool *)SG_Malloc(m_nVars * sizeof(TPool));
591
592 if( !Pool )
593 {
594 SG_UI_Msg_Add_Error("Fail to allocate memory.");
595
596 return( false );
597 }
598
599 //-----------------------------------------------------
600 long i, j, k;
601
602 for(i=0; i<m_nVars; i++) // the Pool[0].mival is the entropy of target classification variable
603 {
604 Pool[i].mival = -Get_MutualInfo(0, i); // set as negative for sorting purpose
605 Pool[i].Index = i;
606 Pool[i].Mask = 1; // initialized to be everything in pool would be considered
607 }
608
609 qsort(Pool + 1, m_nVars - 1, sizeof(TPool), Pool_Compare);
610
611 Pool[0].mival = -Pool[0].mival;
612
613 ADD_MESSAGE(CSG_String::Format(
614 SG_T("\nTarget classification variable (#%d column in the input data) has name=%s \tentropy score=%5.3f"),
615 0 + 1, m_VarNames[0].c_str(), Pool[0].mival
616 ));
617
618 ADD_MESSAGE("\n*** MaxRel features ***");
619 ADD_MESSAGE("Order\tFea\tName\tScore");
620
621 for(i=1; i<m_nVars-1; i++)
622 {
623 Pool[i].mival = -Pool[i].mival;
624
625 if( i <= nFeatures )
626 {
627 ADD_MESSAGE(CSG_String::Format(SG_T("%d \t %d \t %s \t %5.3f"),
628 i, (int)Pool[i].Index, m_VarNames[(int)Pool[i].Index].c_str(), Pool[i].mival
629 ));
630 }
631 }
632
633 //-----------------------------------------------------
634 // mRMR selection
635
636 long poolFeaIndMin = 1;
637 long poolFeaIndMax = poolFeaIndMin + poolUseFeaLen - 1;
638
639 feaInd[0] = Pool[1].Index;
640 Pool[feaInd[0]].Mask = 0; // after selection, no longer consider this feature
641 Pool[0 ].Mask = 0; // of course the first one, which corresponds to the classification variable, should not be considered. Just set the mask as 0 for safety.
642
643 ADD_MESSAGE("\n*** mRMR features ***");
644 ADD_MESSAGE("Order\tFea\tName\tScore");
645
646 ADD_FEATURE(0, Pool[1].mival);
647
648 for(k=1; k<nFeatures; k++) //the first one, feaInd[0] has been determined already
649 {
650 double relevanceVal, redundancyVal, tmpscore, selectscore;
651 long selectind;
652 int b_firstSelected = 0;
653
654 for(i=poolFeaIndMin; i<=poolFeaIndMax; i++)
655 {
656 if( Pool[Pool[i].Index].Mask == 0 )
657 {
658 continue; // skip this feature as it was selected already
659 }
660
661 relevanceVal = Get_MutualInfo(0, Pool[i].Index); // actually no necessary to re-compute it, this value can be retrieved from Pool[].mival vector
662 redundancyVal = 0;
663
664 for(j=0; j<k; j++)
665 {
666 redundancyVal += Get_MutualInfo(feaInd[j], Pool[i].Index);
667 }
668
669 redundancyVal /= k;
670
671 switch( Method )
672 {
673 default: // fprintf(stderr, "Undefined selection method=%d. Use MID instead.\n", mymethod);
674 case SG_mRMR_Method_MID: tmpscore = relevanceVal - redundancyVal; break;
675 case SG_mRMR_Method_MIQ: tmpscore = relevanceVal / (redundancyVal + 0.0001); break;
676 }
677
678 if( b_firstSelected == 0 )
679 {
680 selectscore = tmpscore;
681 selectind = Pool[i].Index;
682 b_firstSelected = 1;
683 }
684 else if( tmpscore > selectscore )
685 { //update the best feature found and the score
686 selectscore = tmpscore;
687 selectind = Pool[i].Index;
688 }
689 }
690
691 feaInd[k] = selectind;
692 Pool[selectind].Mask = 0;
693
694 ADD_FEATURE(k, selectscore);
695 }
696
697 //-----------------------------------------------------
698 return( true );
699 }
700
701
703 // //
705
706 //---------------------------------------------------------
707 double CSG_mRMR::Get_MutualInfo(long v1, long v2)
708 {
709 double mi = -1; // initialized as an illegal value
710
711 if( !m_Samples[0] )
712 {
713 SG_UI_Msg_Add_Error("The input data is NULL.");
714
715 return mi;
716 }
717
718 if( v1 >= m_nVars || v2 >= m_nVars || v1 < 0 || v2 < 0 )
719 {
720 SG_UI_Msg_Add_Error("The input variable indexes are invalid (out of range).");
721
722 return mi;
723 }
724
725 //-----------------------------------------------------
726 // copy data
727
728 int *v1data = new int[m_nSamples];
729 int *v2data = new int[m_nSamples];
730
731 if( !v1data || !v2data )
732 {
733 SG_UI_Msg_Add_Error("Fail to allocate memory.");
734
735 return mi;
736 }
737
738 for(long i=0; i<m_nSamples; i++)
739 {
740 v1data[i] = (int)m_Samples[i][v1]; // the double already been discretized, should be safe now
741 v2data[i] = (int)m_Samples[i][v2];
742 }
743
744 //-----------------------------------------------------
745 // compute mutual info
746
747 long nstate = 3; // always true for DataTable, which was discretized as three states
748
749 int nstate1 = 0, nstate2 = 0;
750
751 double *pab = Get_JointProb(v1data, v2data, m_nSamples, nstate, nstate1, nstate2);
752
753 mi = Get_MutualInfo(pab, nstate1, nstate2);
754
755 //-----------------------------------------------------
756 // free memory and return
757
758 DELETE_ARRAY(v1data);
759 DELETE_ARRAY(v2data);
760 DELETE_ARRAY(pab );
761
762 return mi;
763 }
764
765 //---------------------------------------------------------
766 double CSG_mRMR::Get_MutualInfo(double *pab, long pabhei, long pabwid)
767 {
768 //-----------------------------------------------------
769 // check if parameters are correct
770
771 if( !pab )
772 {
773 SG_UI_Msg_Add_Error("Got illeagal parameter in compute_mutualinfo().");
774
775 return( -1.0 );
776 }
777
778 //-----------------------------------------------------
779 long i, j;
780
781 double **pab2d = new double *[pabwid];
782
783 for(j=0; j<pabwid; j++)
784 {
785 pab2d[j] = pab + (long)j * pabhei;
786 }
787
788 double *p1 = 0, *p2 = 0;
789 long p1len = 0, p2len = 0;
790 int b_findmarginalprob = 1;
791
792 //-----------------------------------------------------
793 //generate marginal probability arrays
794
795 if( b_findmarginalprob != 0 )
796 {
797 p1len = pabhei;
798 p2len = pabwid;
799 p1 = new double[p1len];
800 p2 = new double[p2len];
801
802 for (i = 0; i < p1len; i++) p1[i] = 0;
803 for (j = 0; j < p2len; j++) p2[j] = 0;
804
805 for (i = 0; i < p1len; i++) //p1len = pabhei
806 {
807 for (j = 0; j < p2len; j++) //p2len = panwid
808 {
809 // printf("%f ",pab2d[j][i]);
810 p1[i] += pab2d[j][i];
811 p2[j] += pab2d[j][i];
812 }
813 }
814 }
815
816 //-----------------------------------------------------
817 // calculate the mutual information
818
819 double muInf = 0;
820
821 muInf = 0.0;
822
823 for (j = 0; j < pabwid; j++) // should for p2
824 {
825 for (i = 0; i < pabhei; i++) // should for p1
826 {
827 if (pab2d[j][i] != 0 && p1[i] != 0 && p2[j] != 0)
828 {
829 muInf += pab2d[j][i] * log (pab2d[j][i] / p1[i] / p2[j]);
830 // printf("%f %fab %fa %fb\n",muInf,pab2d[j][i]/p1[i]/p2[j],p1[i],p2[j]);
831 }
832 }
833 }
834
835 muInf /= log(2.0);
836
837 //-----------------------------------------------------
838 // free memory
839
840 DELETE_ARRAY(pab2d);
841
842 if( b_findmarginalprob != 0 )
843 {
844 DELETE_ARRAY(p1);
845 DELETE_ARRAY(p2);
846 }
847
848 return muInf;
849 }
850
851
853 // //
855
856 //---------------------------------------------------------
857 template <class T> double * CSG_mRMR::Get_JointProb(T * img1, T * img2, long len, long maxstatenum, int &nstate1, int &nstate2)
858 {
859 long i, j;
860
861 //-----------------------------------------------------
862 // get and check size information
863
864 if (!img1 || !img2 || len < 0)
865 {
866 SG_UI_Msg_Add_Error("At least one of the input vectors is invalid.");
867
868 return( NULL );
869 }
870
871 // int b_findstatenum = 1; // int nstate1 = 0, nstate2 = 0;
872 int b_returnprob = 1;
873
874 //-----------------------------------------------------
875 // copy data into new INT type array (hence quantization) and then reange them begin from 0 (i.e. state1)
876
877 int *vec1 = new int[len];
878 int *vec2 = new int[len];
879
880 if( !vec1 || !vec2 )
881 {
882 SG_UI_Msg_Add_Error("Fail to allocate memory.\n");
883
884 return( NULL );
885 }
886
887 int nrealstate1 = 0, nrealstate2 = 0;
888
889 Copy_Vector(img1, len, vec1, nrealstate1);
890 Copy_Vector(img2, len, vec2, nrealstate2);
891
892 //update the #state when necessary
893 nstate1 = (nstate1 < nrealstate1) ? nrealstate1 : nstate1;
894 //printf("First vector #state = %i\n",nrealstate1);
895 nstate2 = (nstate2 < nrealstate2) ? nrealstate2 : nstate2;
896 //printf("Second vector #state = %i\n",nrealstate2);
897
898 // if (nstate1!=maxstatenum || nstate2!=maxstatenum)
899 // printf("find nstate1=%d nstate2=%d\n", nstate1, nstate2);
900
901 //-----------------------------------------------------
902 // generate the joint-distribution table
903
904 double *hab = new double[nstate1 * nstate2];
905 double **hab2d = new double *[nstate2];
906
907 if( !hab || !hab2d )
908 {
909 SG_UI_Msg_Add_Error("Fail to allocate memory.");
910
911 return( NULL );
912 }
913
914 for(j=0; j<nstate2; j++)
915 {
916 hab2d[j] = hab + (long)j * nstate1;
917 }
918
919 for(i=0; i<nstate1; i++)
920 {
921 for(j=0; j<nstate2; j++)
922 {
923 hab2d[j][i] = 0;
924 }
925 }
926
927 for(i=0; i<len; i++)
928 {
929 // old method -- slow
930 // indx = (long)(vec2[i]) * nstate1 + vec1[i];
931 // hab[indx] += 1;
932
933 // new method -- fast
934 hab2d[vec2[i]][vec1[i]] += 1;
935 //printf("vec2[%d]=%d vec1[%d]=%d\n", i, vec2[i], i, vec1[i]);
936 }
937
938 //-----------------------------------------------------
939 // return the probabilities, otherwise return count numbers
940
941 if( b_returnprob )
942 {
943 for(i=0; i<nstate1; i++)
944 {
945 for(j=0; j<nstate2; j++)
946 {
947 hab2d[j][i] /= len;
948 }
949 }
950 }
951
952 //-----------------------------------------------------
953 // finish
954
955 DELETE_ARRAY(hab2d);
956 DELETE_ARRAY(vec1);
957 DELETE_ARRAY(vec2);
958
959 return hab;
960 }
961
962 //---------------------------------------------------------
963 template <class T> void CSG_mRMR::Copy_Vector(T *srcdata, long len, int *desdata, int &nstate)
964 {
965 if (!srcdata || !desdata)
966 {
967 SG_UI_Msg_Add_Error("no points in Copy_Vector()!");
968
969 return;
970 }
971
972 // note: originally I added 0.5 before rounding, however seems the negative numbers and
973 // positive numbers are all rounded towarded 0; hence int(-1+0.5)=0 and int(1+0.5)=1;
974 // This is unwanted because I need the above to be -1 and 1.
975 // for this reason I just round with 0.5 adjustment for positive and negative differently
976
977 // copy data
978 int minn, maxx;
979 if (srcdata[0] > 0)
980 {
981 maxx = minn = int (srcdata[0] + 0.5);
982 }
983 else
984 {
985 maxx = minn = int (srcdata[0] - 0.5);
986 }
987
988 long i;
989 int tmp;
990 double tmp1;
991
992 for (i = 0; i < len; i++)
993 {
994 tmp1 = double (srcdata[i]);
995 tmp = (tmp1 > 0) ? (int) (tmp1 + 0.5) : (int) (tmp1 - 0.5); //round to integers
996 minn = (minn < tmp) ? minn : tmp;
997 maxx = (maxx > tmp) ? maxx : tmp;
998 desdata[i] = tmp;
999 // printf("%i ",desdata[i]);
1000 }
1001
1002 // make the vector data begin from 0 (i.e. 1st state)
1003 for (i = 0; i < len; i++)
1004 {
1005 desdata[i] -= minn;
1006 }
1007
1008 // return the #state
1009 nstate = (maxx - minn + 1);
1010
1011 return;
1012 }
1013
1014
1016 // //
1017 // //
1018 // //
1020
1021 //---------------------------------------------------------
1022 #endif // WITH_MRMR
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
SG_T
#define SG_T(s)
Definition: api_core.h:531
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
_TW
#define _TW(s)
Definition: api_core.h:1481
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
mat_tools.h
CSG_Parameter
Definition: parameters.h:207
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
CSG_Table::Del_Index
bool Del_Index(void)
Definition: table.cpp:1341
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
CSG_String
Definition: api_core.h:557
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Parameters
Definition: parameters.h:1650
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Parameter::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameter.cpp:552
CSG_Matrix
Definition: mat_tools.h:463
table.h
CSG_Matrix::Get_NY
int Get_NY(void) const
Definition: mat_tools.h:506
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
CSG_Matrix::Get_NX
int Get_NX(void) const
Definition: mat_tools.h:505
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression.cpp File Reference

  • saga_core
  • saga_api
Functions
mat_regression.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Functions

double SG_Regression_Get_Adjusted_R2 (double r2, int n, int p, TSG_Regression_Correction Correction)

Function Documentation

◆ SG_Regression_Get_Adjusted_R2()

double SG_Regression_Get_Adjusted_R2 | ( | double | r2,
 |  | int | n,
 |  | int | p,
 |  | TSG_Regression_Correction | Correction
 | ) |  |

Definition at line 63 of file mat_regression.cpp.

References REGRESSION_CORR_Claudy_3, REGRESSION_CORR_None, REGRESSION_CORR_Olkin_Pratt, REGRESSION_CORR_Pratt, REGRESSION_CORR_Smith, REGRESSION_CORR_Wherry_1, and REGRESSION_CORR_Wherry_2.

Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Regression::Calculate().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression.cpp Source File

  • saga_core
  • saga_api
mat_regression.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_regression.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 double SG_Regression_Get_Adjusted_R2(double r2, int n, int p, TSG_Regression_Correction Correction)
64 {
65 double r = 1. - r2;
66
67 switch( Correction )
68 {
69 case REGRESSION_CORR_None: default:
70 return( r2 );
71
72 case REGRESSION_CORR_Smith:
73 r2 = 1. - ((n ) / (n - p )) * r;
74 break;
75
76 case REGRESSION_CORR_Wherry_1:
77 r2 = 1. - ((n - 1.) / (n - p - 1.)) * r;
78 break;
79
80 case REGRESSION_CORR_Wherry_2:
81 r2 = 1. - ((n - 1.) / (n - p )) * r;
82 break;
83
84 case REGRESSION_CORR_Olkin_Pratt:
85 // r2 = 1. - ((n - 3.) / (n - p - 2.)) * (r + (2. / (n - p)) * r*r);
86 r2 = 1. - ((n - 3.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p + 1.));
87 break;
88
89 case REGRESSION_CORR_Pratt:
90 r2 = 1. - ((n - 3.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p - 2.3));
91 break;
92
93 case REGRESSION_CORR_Claudy_3:
94 r2 = 1. - ((n - 4.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p + 1.));
95 break;
96 }
97
98 return( r2 < 0. ? 0. : r2 > 1. ? 1. : r2 );
99 }
100
101
103 // //
104 // //
105 // //
107
108 //---------------------------------------------------------
109 CSG_Regression::CSG_Regression(void)
110 {
111 Destroy();
112 }
113
114 //---------------------------------------------------------
115 CSG_Regression::~CSG_Regression(void)
116 {
117 Destroy();
118 }
119
120
122 // //
124
125 //---------------------------------------------------------
126 void CSG_Regression::Destroy(void)
127 {
128 m_R2 = -1.; // mark as invalid (or unprocessed)
129
130 m_Type = REGRESSION_Linear;
131
132 m_x.Destroy();
133 m_y.Destroy();
134 }
135
136
138 // //
140
141 //---------------------------------------------------------
142 bool CSG_Regression::Add_Values(double x, double y)
143 {
144 return( m_y.Add_Row(y) && m_x.Add_Row(x) );
145 }
146
147 //---------------------------------------------------------
148 bool CSG_Regression::Set_Values(int nValues, double *x, double *y)
149 {
150 Destroy();
151
152 return( m_y.Create(nValues, y) && m_x.Create(nValues, x) );
153 }
154
155
157 // //
159
160 //---------------------------------------------------------
161 const SG_Char * CSG_Regression::asString(void)
162 {
163 static CSG_String s; s.Clear();
164
165 s += CSG_String::Format("\nNumber of observations = %d\n", Get_Count());
166 s += CSG_String::Format("\nPredictor variable (x):\n min. = %.6f, max. = %.6f, mean = %.6f, stddev. = %.6f\n", m_xMin, m_xMax, m_xMean, sqrt(m_xVar));
167 s += CSG_String::Format("\nDependent variable (y):\n min. = %.6f, max. = %.6f, mean = %.6f, stddev. = %.6f\n", m_yMin, m_yMax, m_yMean, sqrt(m_yVar));
168 s += CSG_String::Format(SG_T("\nRegression (r = %.4f, r² = %.4f):\n\n y = "), m_R, m_R2);
169
170 switch( m_Type )
171 {
172 case REGRESSION_Linear: s += CSG_String::Format("%.6f %+.6f * x" , m_RConst, m_RCoeff); break; // Y = a + b * X
173 case REGRESSION_Rez_X : s += CSG_String::Format("%.6f %+.6f / x" , m_RConst, m_RCoeff); break; // Y = a + b / X
174 case REGRESSION_Rez_Y : s += CSG_String::Format("%.6f / (%.6f - x)" , m_RConst, m_RCoeff); break; // Y = a / (b - X)
175 case REGRESSION_Pow : s += CSG_String::Format("%.6f * x^%.6f" , m_RConst, m_RCoeff); break; // Y = a * X^b
176 case REGRESSION_Exp : s += CSG_String::Format("%.6f * e^(%.6f * x)", m_RConst, m_RCoeff); break; // Y = a * e^(b * X)
177 case REGRESSION_Log : s += CSG_String::Format("%.6f %+.6f * ln(x)" , m_RConst, m_RCoeff); break; // Y = a + b * ln(X)
178 }
179
180 s += "\n";
181
182 return( s );
183 }
184
185
187 // //
189
190 //---------------------------------------------------------
191 double CSG_Regression::Get_x(double y) const
192 {
193 if( m_R2 >= 0. )
194 {
195 switch( m_Type )
196 {
197 case REGRESSION_Linear: // Y = a + b * X -> X = (Y - a) / b
198 if( m_RCoeff != 0. )
199 return( (m_RConst * y) / m_RCoeff );
200 break;
201
202 case REGRESSION_Rez_X: // Y = a + b / X -> X = b / (Y - a)
203 if( (y = y - m_RConst) != 0. )
204 return( m_RCoeff / y );
205 break;
206
207 case REGRESSION_Rez_Y: // Y = a / (b - X) -> X = b - a / Y
208 if( y != 0. )
209 return( m_RCoeff - m_RConst / y );
210 break;
211
212 case REGRESSION_Pow: // Y = a * X^b -> X = (Y / a)^(1 / b)
213 if( m_RConst != 0. && m_RCoeff != 0. )
214 return( pow(y / m_RConst, 1. / m_RCoeff) );
215 break;
216
217 case REGRESSION_Exp: // Y = a * e^(b * X) -> X = ln(Y / a) / b
218 if( m_RConst != 0. && (y = y / m_RConst) > 0. && m_RCoeff != 0. )
219 return( log(y) / m_RCoeff );
220 break;
221
222 case REGRESSION_Log: // Y = a + b * ln(X) -> X = e^((Y - a) / b)
223 if( m_RCoeff != 0. )
224 return( exp((y - m_RConst) / m_RCoeff) );
225 break;
226 }
227 }
228
229 return( sqrt(-1.) ); // NaN
230 }
231
232 //---------------------------------------------------------
233 double CSG_Regression::Get_y(double x) const
234 {
235 if( m_R2 >= 0. )
236 {
237 switch( m_Type )
238 {
239 case REGRESSION_Linear: // Y = a + b * X
240 return( m_RConst + m_RCoeff * x );
241
242 case REGRESSION_Rez_X: // Y = a + b / X
243 if( x != 0. )
244 return( m_RConst + m_RCoeff / x );
245 break;
246
247 case REGRESSION_Rez_Y: // Y = a / (b - X)
248 if( (x = m_RCoeff - x) != 0. )
249 return( m_RConst / x );
250 break;
251
252 case REGRESSION_Pow: // Y = a * X^b
253 return( m_RConst * pow(x, m_RCoeff) );
254
255 case REGRESSION_Exp: // Y = a e^(b * X)
256 return( m_RConst * exp(m_RCoeff * x) );
257
258 case REGRESSION_Log: // Y = a + b * ln(X)
259 if( x > 0. )
260 return( m_RConst + m_RCoeff * log(x) );
261 break;
262 }
263 }
264
265 return( sqrt(-1.) );
266 }
267
268
270 // //
272
273 //---------------------------------------------------------
274 inline double CSG_Regression::_Y_Transform(double y)
275 {
276 switch( m_Type )
277 {
278 default:
279 return( y );
280
281 case REGRESSION_Rez_Y:
282 if( y == 0. ) { y = M_ALMOST_ZERO; }
283 return( 1. / y );
284
285 case REGRESSION_Pow:
286 case REGRESSION_Exp:
287 if( y <= 0. ) { y = M_ALMOST_ZERO; }
288 return( log(y) );
289 }
290 }
291
292 //---------------------------------------------------------
293 inline double CSG_Regression::_X_Transform(double x)
294 {
295 switch( m_Type )
296 {
297 default:
298 return( x );
299
300 case REGRESSION_Rez_X:
301 if( x == 0. ) { x = M_ALMOST_ZERO; }
302 return( 1. / x );
303
304 case REGRESSION_Pow:
305 case REGRESSION_Log:
306 if( x <= 0. ) { x = M_ALMOST_ZERO; }
307 return( log(x) );
308 }
309 }
310
311
313 // //
315
316 //---------------------------------------------------------
317 bool CSG_Regression::Calculate(TSG_Regression_Type Type, bool bStdError)
318 {
319 m_R2 = -1.; // mark as invalid (unprocessed)
320 m_Type = Type;
321
322 if( Get_Count() < 2 )
323 {
324 return( false );
325 }
326
327 CSG_Simple_Statistics sx, sy;
328
329 for(int i=0; i<Get_Count(); i++)
330 {
331 sx += _X_Transform(m_x[i]);
332 sy += _Y_Transform(m_y[i]);
333 }
334
335 m_xMin = sx.Get_Minimum(); m_xMax = sx.Get_Maximum(); m_xMean = sx.Get_Mean(); m_xVar = sx.Get_Variance();
336 m_yMin = sy.Get_Minimum(); m_yMax = sy.Get_Maximum(); m_yMean = sy.Get_Mean(); m_yVar = sy.Get_Variance();
337
338 if( m_xMin >= m_xMax || m_yMin >= m_yMax )
339 {
340 return( false );
341 }
342
343 //-----------------------------------------------------
344 double s_x = 0., s_y = 0., s_xx = 0., s_xy = 0., s_dx2 = 0., s_dy2 = 0., s_dxdy = 0.;
345
346 for(int i=0; i<Get_Count(); i++)
347 {
348 double x = _X_Transform(m_x[i]);
349 double y = _Y_Transform(m_y[i]);
350
351 s_x += x;
352 s_y += y;
353 s_xx += x * x;
354 s_xy += x * y;
355
356 x -= m_xMean;
357 y -= m_yMean;
358
359 s_dx2 += x * x;
360 s_dy2 += y * y;
361 s_dxdy += x * y;
362 }
363
364 //-----------------------------------------------------
365 m_RCoeff = s_dxdy / s_dx2;
366 m_RConst = (s_xx * s_y - s_x * s_xy) / (Get_Count() * s_xx - s_x * s_x);
367 m_R = s_dxdy / sqrt(s_dx2 * s_dy2);
368 m_R2 = m_R*m_R;
369 m_R2_Adj = SG_Regression_Get_Adjusted_R2(m_R2, Get_Count(), 1);
370 m_P = CSG_Test_Distribution::Get_F_Tail_from_R2(m_R2, 1, Get_Count());
371
372 //-----------------------------------------------------
373 if( !bStdError )
374 {
375 m_SE = -1.;
376 }
377 else
378 {
379 m_SE = 0.;
380
381 for(int i=0; i<Get_Count(); i++)
382 {
383 double d = fabs(m_y[i] - Get_y(m_x[i]));
384
385 m_SE += d;
386 }
387
388 m_SE /= Get_Count();
389 }
390
391 //-----------------------------------------------------
392 switch( m_Type )
393 {
394 default: // case REGRESSION_Linear:
395 return( true );
396
397 case REGRESSION_Rez_X: {
398 m_xVar = 1. / m_xVar;
399 break; }
400
401 case REGRESSION_Rez_Y: {
402 double d = m_RConst;
403 m_RConst = 1. / m_RCoeff;
404 m_RCoeff = d * m_RCoeff;
405 m_yVar = 1. / m_yVar;
406 break; }
407
408 case REGRESSION_Pow: {
409 m_RConst = exp(m_RConst);
410 m_xVar = exp(m_xVar);
411 m_yVar = exp(m_yVar);
412 break; }
413
414 case REGRESSION_Exp: {
415 m_RConst = exp(m_RConst);
416 m_yVar = exp(m_yVar);
417 break; }
418
419 case REGRESSION_Log: {
420 m_xVar = exp(m_xVar);
421 break; }
422 }
423
424 CSG_Simple_Statistics s;
425
426 if( !s.Create(m_x) ) { return( false ); } m_xMin = s.Get_Minimum(); m_xMean = s.Get_Mean(); m_xMax = s.Get_Maximum(); m_xVar = s.Get_Variance();
427 if( !s.Create(m_y) ) { return( false ); } m_yMin = s.Get_Minimum(); m_yMean = s.Get_Mean(); m_yMax = s.Get_Maximum(); m_yVar = s.Get_Variance();
428
429 return( true );
430 }
431
432 //---------------------------------------------------------
433 bool CSG_Regression::Calculate(int nValues, double *x, double *y, TSG_Regression_Type Type, bool bStdError)
434 {
435 return( Set_Values(nValues, x, y) && Calculate(Type, bStdError) );
436 }
437
438
440 // //
441 // //
442 // //
444
445 //---------------------------------------------------------
REGRESSION_CORR_Pratt
@ REGRESSION_CORR_Pratt
Definition: mat_tools.h:1558
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Regression::Get_x
double Get_x(double y) const
Definition: mat_regression.cpp:191
REGRESSION_CORR_Olkin_Pratt
@ REGRESSION_CORR_Olkin_Pratt
Definition: mat_tools.h:1557
CSG_Regression::CSG_Regression
CSG_Regression(void)
Definition: mat_regression.cpp:109
CSG_Regression::m_yMax
double m_yMax
Definition: mat_tools.h:1644
CSG_Simple_Statistics::Get_Variance
double Get_Variance(void)
Definition: mat_tools.h:737
CSG_Regression::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1595
CSG_Regression::m_yVar
double m_yVar
Definition: mat_tools.h:1644
CSG_Regression::m_xVar
double m_xVar
Definition: mat_tools.h:1643
CSG_Regression::m_xMin
double m_xMin
Definition: mat_tools.h:1643
CSG_Regression::Destroy
void Destroy(void)
Definition: mat_regression.cpp:126
CSG_Regression::m_RConst
double m_RConst
Definition: mat_tools.h:1642
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Regression::m_yMin
double m_yMin
Definition: mat_tools.h:1644
REGRESSION_CORR_Wherry_1
@ REGRESSION_CORR_Wherry_1
Definition: mat_tools.h:1555
REGRESSION_Log
@ REGRESSION_Log
Definition: mat_tools.h:1579
CSG_Regression::m_SE
double m_SE
Definition: mat_tools.h:1642
CSG_Regression::m_R
double m_R
Definition: mat_tools.h:1642
CSG_Regression::Get_y
double Get_y(double x) const
Definition: mat_regression.cpp:233
mat_tools.h
REGRESSION_Linear
@ REGRESSION_Linear
Definition: mat_tools.h:1574
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
REGRESSION_CORR_Claudy_3
@ REGRESSION_CORR_Claudy_3
Definition: mat_tools.h:1559
CSG_Regression::Set_Values
bool Set_Values(int nValues, double *x, double *y)
Definition: mat_regression.cpp:148
REGRESSION_CORR_Wherry_2
@ REGRESSION_CORR_Wherry_2
Definition: mat_tools.h:1556
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
CSG_Regression::m_x
CSG_Vector m_x
Definition: mat_tools.h:1646
CSG_Regression::m_xMean
double m_xMean
Definition: mat_tools.h:1643
CSG_Regression::m_R2
double m_R2
Definition: mat_tools.h:1642
CSG_Regression::_X_Transform
double _X_Transform(double y)
Definition: mat_regression.cpp:293
CSG_Regression::m_P
double m_P
Definition: mat_tools.h:1642
CSG_Regression::Calculate
bool Calculate(TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false)
Definition: mat_regression.cpp:317
CSG_Regression::m_Type
TSG_Regression_Type m_Type
Definition: mat_tools.h:1648
REGRESSION_Rez_X
@ REGRESSION_Rez_X
Definition: mat_tools.h:1575
REGRESSION_Rez_Y
@ REGRESSION_Rez_Y
Definition: mat_tools.h:1576
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
REGRESSION_Pow
@ REGRESSION_Pow
Definition: mat_tools.h:1577
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
TSG_Regression_Type
TSG_Regression_Type
Definition: mat_tools.h:1573
TSG_Regression_Correction
TSG_Regression_Correction
Definition: mat_tools.h:1552
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
CSG_Regression::Add_Values
bool Add_Values(double x, double y)
Definition: mat_regression.cpp:142
CSG_Regression::m_y
CSG_Vector m_y
Definition: mat_tools.h:1646
CSG_Regression::m_yMean
double m_yMean
Definition: mat_tools.h:1644
CSG_Regression::m_R2_Adj
double m_R2_Adj
Definition: mat_tools.h:1642
CSG_Regression::~CSG_Regression
virtual ~CSG_Regression(void)
Definition: mat_regression.cpp:115
CSG_Simple_Statistics::Create
bool Create(bool bHoldValues=false)
Definition: mat_tools.cpp:350
CSG_Regression::m_RCoeff
double m_RCoeff
Definition: mat_tools.h:1642
CSG_Regression::asString
const SG_Char * asString(void)
Definition: mat_regression.cpp:161
CSG_Test_Distribution::Get_F_Tail_from_R2
static double Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3271
SG_Regression_Get_Adjusted_R2
double SG_Regression_Get_Adjusted_R2(double r2, int n, int p, TSG_Regression_Correction Correction)
Definition: mat_regression.cpp:63
REGRESSION_Exp
@ REGRESSION_Exp
Definition: mat_tools.h:1578
REGRESSION_CORR_Smith
@ REGRESSION_CORR_Smith
Definition: mat_tools.h:1554
M_ALMOST_ZERO
#define M_ALMOST_ZERO
Definition: mat_tools.h:120
CSG_Simple_Statistics
Definition: mat_tools.h:708
REGRESSION_CORR_None
@ REGRESSION_CORR_None
Definition: mat_tools.h:1553
CSG_Regression::m_xMax
double m_xMax
Definition: mat_tools.h:1643
CSG_Regression::_Y_Transform
double _Y_Transform(double x)
Definition: mat_regression.cpp:274
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression_multiple.cpp File Reference

  • saga_core
  • saga_api
Enumerations
mat_regression_multiple.cpp File Reference
#include "mat_tools.h"
#include "table.h"

Go to the source code of this file.

Enumerations

enum ESG_Multiple_Regression_Info_Model {
MLR_MODEL_R2 = 0, MLR_MODEL_R2_ADJ, MLR_MODEL_SE, MLR_MODEL_SSR,
MLR_MODEL_SSE, MLR_MODEL_SST, MLR_MODEL_MSR, MLR_MODEL_MSE,
MLR_MODEL_F, MLR_MODEL_SIG, MLR_MODEL_NPREDICT, MLR_MODEL_NSAMPLES,
MLR_MODEL_CV_MSE, MLR_MODEL_CV_RMSE, MLR_MODEL_CV_NRMSE, MLR_MODEL_CV_R2,
MLR_MODEL_CV_NSAMPLES
}
enum ESG_Multiple_Regression_Info_Steps {
MLR_STEP_NR = 0, MLR_STEP_R, MLR_STEP_R2, MLR_STEP_R2_ADJ,
MLR_STEP_SE, MLR_STEP_SSR, MLR_STEP_SSE, MLR_STEP_MSR,
MLR_STEP_MSE, MLR_STEP_DF, MLR_STEP_F, MLR_STEP_SIG,
MLR_STEP_VAR_F, MLR_STEP_VAR_SIG, MLR_STEP_DIR, MLR_STEP_VAR
}

Enumeration Type Documentation

◆ ESG_Multiple_Regression_Info_Model

enum ESG_Multiple_Regression_Info_Model
Enumerator
MLR_MODEL_R2
MLR_MODEL_R2_ADJ
MLR_MODEL_SE
MLR_MODEL_SSR
MLR_MODEL_SSE
MLR_MODEL_SST
MLR_MODEL_MSR
MLR_MODEL_MSE
MLR_MODEL_F
MLR_MODEL_SIG
MLR_MODEL_NPREDICT
MLR_MODEL_NSAMPLES
MLR_MODEL_CV_MSE
MLR_MODEL_CV_RMSE
MLR_MODEL_CV_NRMSE
MLR_MODEL_CV_R2
MLR_MODEL_CV_NSAMPLES

Definition at line 64 of file mat_regression_multiple.cpp.

◆ ESG_Multiple_Regression_Info_Steps

enum ESG_Multiple_Regression_Info_Steps
Enumerator
MLR_STEP_NR
MLR_STEP_R
MLR_STEP_R2
MLR_STEP_R2_ADJ
MLR_STEP_SE
MLR_STEP_SSR
MLR_STEP_SSE
MLR_STEP_MSR
MLR_STEP_MSE
MLR_STEP_DF
MLR_STEP_F
MLR_STEP_SIG
MLR_STEP_VAR_F
MLR_STEP_VAR_SIG
MLR_STEP_DIR
MLR_STEP_VAR

Definition at line 86 of file mat_regression_multiple.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression_multiple.cpp Source File

  • saga_core
  • saga_api
mat_regression_multiple.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_regression_multiple.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54 #include "table.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 enum ESG_Multiple_Regression_Info_Model
65 {
66 MLR_MODEL_R2 = 0,
67 MLR_MODEL_R2_ADJ,
68 MLR_MODEL_SE,
69 MLR_MODEL_SSR,
70 MLR_MODEL_SSE,
71 MLR_MODEL_SST,
72 MLR_MODEL_MSR,
73 MLR_MODEL_MSE,
74 MLR_MODEL_F,
75 MLR_MODEL_SIG,
76 MLR_MODEL_NPREDICT,
77 MLR_MODEL_NSAMPLES,
78 MLR_MODEL_CV_MSE,
79 MLR_MODEL_CV_RMSE,
80 MLR_MODEL_CV_NRMSE,
81 MLR_MODEL_CV_R2,
82 MLR_MODEL_CV_NSAMPLES
83 };
84
85 //---------------------------------------------------------
86 enum ESG_Multiple_Regression_Info_Steps
87 {
88 MLR_STEP_NR = 0,
89 MLR_STEP_R,
90 MLR_STEP_R2,
91 MLR_STEP_R2_ADJ,
92 MLR_STEP_SE,
93 MLR_STEP_SSR,
94 MLR_STEP_SSE,
95 MLR_STEP_MSR,
96 MLR_STEP_MSE,
97 MLR_STEP_DF,
98 MLR_STEP_F,
99 MLR_STEP_SIG,
100 MLR_STEP_VAR_F,
101 MLR_STEP_VAR_SIG,
102 MLR_STEP_DIR,
103 MLR_STEP_VAR
104 };
105
106
108 // //
109 // //
110 // //
112
113 //---------------------------------------------------------
114 CSG_Regression_Multiple::CSG_Regression_Multiple(bool bIntercept)
115 {
116 m_pRegression = new CSG_Table;
117
118 m_pRegression ->Add_Field("VAR_ID" , SG_DATATYPE_Int); // MLR_VAR_ID
119 m_pRegression ->Add_Field("VAR_NAME" , SG_DATATYPE_String); // MLR_VAR_NAME
120 m_pRegression ->Add_Field("REGCOEFF" , SG_DATATYPE_Double); // MLR_VAR_RCOEFF
121 m_pRegression ->Add_Field("R" , SG_DATATYPE_Double); // MLR_VAR_R
122 m_pRegression ->Add_Field("R2" , SG_DATATYPE_Double); // MLR_VAR_R2
123 m_pRegression ->Add_Field("R2_ADJ" , SG_DATATYPE_Double); // MLR_VAR_R2_ADJ
124 m_pRegression ->Add_Field("STD_ERROR" , SG_DATATYPE_Double); // MLR_VAR_SE
125 m_pRegression ->Add_Field("T" , SG_DATATYPE_Double); // MLR_VAR_T
126 m_pRegression ->Add_Field("SIG" , SG_DATATYPE_Double); // MLR_VAR_SIG
127 m_pRegression ->Add_Field("P" , SG_DATATYPE_Double); // MLR_VAR_P
128
129 //-----------------------------------------------------
130 m_pSteps = new CSG_Table;
131
132 m_pSteps ->Add_Field("MODEL" , SG_DATATYPE_Int); // MLR_STEP_NR
133 m_pSteps ->Add_Field("R" , SG_DATATYPE_Double); // MLR_STEP_R
134 m_pSteps ->Add_Field("R2" , SG_DATATYPE_Double); // MLR_STEP_R2
135 m_pSteps ->Add_Field("R2_ADJ" , SG_DATATYPE_Double); // MLR_STEP_R2_ADJ
136 m_pSteps ->Add_Field("STD_ERROR" , SG_DATATYPE_Double); // MLR_STEP_SE
137 m_pSteps ->Add_Field("SSR" , SG_DATATYPE_Double); // MLR_STEP_SSR
138 m_pSteps ->Add_Field("SSE" , SG_DATATYPE_Double); // MLR_STEP_SSE
139 m_pSteps ->Add_Field("MSR" , SG_DATATYPE_Double); // MLR_STEP_MSR
140 m_pSteps ->Add_Field("MSE" , SG_DATATYPE_Double); // MLR_STEP_MSE
141 m_pSteps ->Add_Field("DF" , SG_DATATYPE_Double); // MLR_STEP_DF
142 m_pSteps ->Add_Field("F" , SG_DATATYPE_Double); // MLR_STEP_F
143 m_pSteps ->Add_Field("SIG" , SG_DATATYPE_Double); // MLR_STEP_SIG
144 m_pSteps ->Add_Field("VAR_F" , SG_DATATYPE_Double); // MLR_STEP_VAR_F
145 m_pSteps ->Add_Field("VAR_SIG" , SG_DATATYPE_Double); // MLR_STEP_VAR_SIG
146 m_pSteps ->Add_Field("DIR" , SG_DATATYPE_String); // MLR_STEP_DIR
147 m_pSteps ->Add_Field("VARIABLE" , SG_DATATYPE_String); // MLR_STEP_VAR
148
149 //-----------------------------------------------------
150 m_pModel = new CSG_Table;
151
152 m_pModel ->Add_Field("PARAMETER" , SG_DATATYPE_String);
153 m_pModel ->Add_Field("VALUE" , SG_DATATYPE_Double);
154
155 m_pModel ->Add_Record()->Set_Value(0, SG_T("R2" )); // MLR_MODEL_R2
156 m_pModel ->Add_Record()->Set_Value(0, SG_T("R2_ADJ" )); // MLR_MODEL_R2_ADJ
157 m_pModel ->Add_Record()->Set_Value(0, SG_T("STD_ERROR" )); // MLR_MODEL_SE
158 m_pModel ->Add_Record()->Set_Value(0, SG_T("SSR" )); // MLR_MODEL_SSR
159 m_pModel ->Add_Record()->Set_Value(0, SG_T("SSE" )); // MLR_MODEL_SSE
160 m_pModel ->Add_Record()->Set_Value(0, SG_T("SST" )); // MLR_MODEL_SST
161 m_pModel ->Add_Record()->Set_Value(0, SG_T("MSR" )); // MLR_MODEL_MSR
162 m_pModel ->Add_Record()->Set_Value(0, SG_T("MSE" )); // MLR_MODEL_MSE
163 m_pModel ->Add_Record()->Set_Value(0, SG_T("F" )); // MLR_MODEL_F
164 m_pModel ->Add_Record()->Set_Value(0, SG_T("SIG" )); // MLR_MODEL_SIG
165 m_pModel ->Add_Record()->Set_Value(0, SG_T("PREDICTORS" )); // MLR_MODEL_NPREDICT
166 m_pModel ->Add_Record()->Set_Value(0, SG_T("SAMPLES" )); // MLR_MODEL_NSAMPLES
167 m_pModel ->Add_Record()->Set_Value(0, SG_T("CV_MSE" )); // MLR_MODEL_CV_MSE
168 m_pModel ->Add_Record()->Set_Value(0, SG_T("CV_RMSE" )); // MLR_MODEL_CV_RMSE
169 m_pModel ->Add_Record()->Set_Value(0, SG_T("CV_NRMSE" )); // MLR_MODEL_CV_RMSE
170 m_pModel ->Add_Record()->Set_Value(0, SG_T("CV_R2" )); // MLR_MODEL_CV_R2
171 m_pModel ->Add_Record()->Set_Value(0, SG_T("CV_SAMPLES" )); // MLR_MODEL_CV_NSAMPLES
172
173 //-----------------------------------------------------
174 m_Predictor = NULL;
175 m_nPredictors = 0;
176
177 m_bIntercept = bIntercept;
178 }
179
180 //---------------------------------------------------------
181 CSG_Regression_Multiple::~CSG_Regression_Multiple(void)
182 {
183 Destroy();
184
185 delete(m_pRegression);
186 delete(m_pModel);
187 delete(m_pSteps);
188 }
189
190
192 // //
194
195 //---------------------------------------------------------
196 void CSG_Regression_Multiple::Destroy(void)
197 {
198 m_Names .Clear ();
199 m_Samples .Destroy();
200 m_Samples_Model.Destroy();
201
202 m_pRegression->Del_Records();
203 m_pSteps ->Del_Records();
204
205 for(int i=0; i<m_pModel->Get_Count(); i++)
206 {
207 m_pModel->Get_Record(i)->Set_NoData(1);
208 }
209
210 if( m_Predictor )
211 {
212 delete[](m_bIncluded);
213 delete[](m_Predictor);
214
215 m_Predictor = NULL;
216 m_nPredictors = 0;
217 }
218 }
219
220
222 // //
224
225 //---------------------------------------------------------
226 bool CSG_Regression_Multiple::Set_Data(const CSG_Matrix &Samples, CSG_Strings *pNames)
227 {
228 Destroy();
229
230 int nPredictors = Samples.Get_NX() - 1;
231
232 if( nPredictors < 1 || Samples.Get_NY() <= nPredictors )
233 {
234 return( false );
235 }
236
237 //-------------------------------------------------
238 for(int i=0; i<=nPredictors; i++)
239 {
240 m_Names += pNames && pNames->Get_Count() == Samples.Get_NCols() ? pNames->Get_String(i) : i == 0
241 ? CSG_String::Format( "%s", _TL("Dependent"))
242 : CSG_String::Format("%d. %s", i + 1, _TL("Predictor"));
243 }
244
245 m_Samples = Samples;
246
247 m_bIncluded = new int[nPredictors];
248 m_Predictor = new int[nPredictors];
249
250 //-------------------------------------------------
251 return( true );
252 }
253
254 //---------------------------------------------------------
255 bool CSG_Regression_Multiple::_Initialize(bool bInclude)
256 {
257 int nPredictors = m_Samples.Get_NX() - 1;
258
259 if( nPredictors < 1 || m_Samples.Get_NY() <= nPredictors )
260 {
261 return( false );
262 }
263
264 //-------------------------------------------------
265 if( bInclude )
266 {
267 m_nPredictors = nPredictors;
268 m_Samples_Model.Create(m_Samples);
269 }
270 else
271 {
272 m_nPredictors = 0;
273 m_Samples_Model.Set_Col(m_Samples.Get_Col(0));
274 }
275
276 for(int i=0; i<nPredictors; i++)
277 {
278 m_Predictor[i] = i;
279 m_bIncluded[i] = bInclude;
280 }
281
282 for(int i=0; i<m_pModel->Get_Count(); i++)
283 {
284 m_pModel->Get_Record(i)->Set_NoData(1);
285 }
286
287 //-------------------------------------------------
288 return( true );
289 }
290
291
293 // //
295
296 //---------------------------------------------------------
297 bool CSG_Regression_Multiple::Get_Model(const CSG_Matrix &Samples, CSG_Strings *pNames)
298 {
299 return( Set_Data(Samples, pNames) && Get_Model() );
300 }
301
302 bool CSG_Regression_Multiple::Get_Model_Forward(const CSG_Matrix &Samples, double P_in, CSG_Strings *pNames)
303 {
304 return( Set_Data(Samples, pNames) && Get_Model_Forward(P_in) );
305 }
306
307 bool CSG_Regression_Multiple::Get_Model_Backward(const CSG_Matrix &Samples, double P_out, CSG_Strings *pNames)
308 {
309 return( Set_Data(Samples, pNames) && Get_Model_Backward(P_out) );
310 }
311
312 bool CSG_Regression_Multiple::Get_Model_Stepwise(const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames)
313 {
314 return( Set_Data(Samples, pNames) && Get_Model_Stepwise(P_in, P_out) );
315 }
316
317 //---------------------------------------------------------
318 bool CSG_Regression_Multiple::Get_Model(void)
319 {
320 return( _Initialize(true) && _Get_Regression(m_Samples) );
321 }
322
323 //---------------------------------------------------------
324 bool CSG_Regression_Multiple::Get_Model_Forward(double P_in)
325 {
326 if( _Initialize(false) )
327 {
328 double R2 = 0.;
329
330 while( _Get_Step_In(m_Samples_Model, P_in, R2, m_Samples) >= 0 );
331
332 return( _Set_Step_Info(m_Samples_Model) );
333 }
334
335 return( false );
336 }
337
338 //---------------------------------------------------------
339 bool CSG_Regression_Multiple::Get_Model_Backward(double P_out)
340 {
341 if( _Initialize(true) )
342 {
343 double R2 = 0.;
344
345 while( _Get_Step_Out(m_Samples_Model, P_out, R2) >= 0 );
346
347 return( _Set_Step_Info(m_Samples_Model) );
348 }
349
350 return( false );
351 }
352
353 //---------------------------------------------------------
354 bool CSG_Regression_Multiple::Get_Model_Stepwise(double P_in, double P_out)
355 {
356 if( _Initialize(false) )
357 {
358 double R2 = 0.;
359
360 if( P_out <= P_in )
361 {
362 P_out = P_in + 0.001;
363 }
364
365 while( _Get_Step_In(m_Samples_Model, P_in, R2, m_Samples) >= 0 && SG_UI_Process_Get_Okay() )
366 {
367 if( m_nPredictors > 1 )
368 {
369 _Get_Step_Out(m_Samples_Model, P_out, R2);
370 }
371 }
372
373 return( _Set_Step_Info(m_Samples_Model) );
374 }
375
376 return( false );
377 }
378
379
381 // //
383
384 //---------------------------------------------------------
385 bool CSG_Regression_Multiple::Get_CrossValidation(int nSubSamples)
386 {
387 if( m_Samples_Model.Get_NCols() <= 1 )
388 {
389 return( false );
390 }
391
392 //-----------------------------------------------------
393 CSG_Regression_Multiple Model(m_bIntercept);
394 CSG_Simple_Statistics Stats, SR, SE;
395
396 int i, nModels = 0;
397
398 for(i=0; i<m_Samples_Model.Get_NRows(); i++)
399 {
400 Stats += m_Samples_Model[i][0];
401 }
402
403 //-----------------------------------------------------
404 // leave-one-out cross validation (LOOCV)
405 if( nSubSamples <= 1 || nSubSamples > m_Samples_Model.Get_NRows() / 2 )
406 {
407 for(i=0; i<m_Samples_Model.Get_NRows() && SG_UI_Process_Get_Okay(); i++)
408 {
409 CSG_Matrix Samples(m_Samples_Model);
410 Samples.Del_Row(i);
411
412 if( Model.Get_Model(Samples) )
413 {
414 nModels++;
415
416 double dObsrv = m_Samples_Model[i][0];
417 double dModel = Model.Get_Value(CSG_Vector(m_nPredictors, m_Samples_Model[i] + 1));
418
419 SE += SG_Get_Square(dModel - dObsrv);
420 SR += SG_Get_Square(dModel - (Stats.Get_Sum() - dObsrv) / Samples.Get_NRows());
421 }
422 }
423 }
424
425 //-----------------------------------------------------
426 // k-fold cross validation
427 else
428 {
429 int *SubSet = new int[m_Samples_Model.Get_NRows()];
430
431 for(i=0; i<m_Samples_Model.Get_NRows(); i++)
432 {
433 SubSet[i] = i % nSubSamples;
434 }
435
436 //-------------------------------------------------
437 for(int iSubSet=0; iSubSet<nSubSamples && SG_UI_Process_Get_Okay(); iSubSet++)
438 {
439 CSG_Simple_Statistics Samples_Stats;
440 CSG_Matrix Samples(m_Samples_Model), Validation;
441
442 for(i=Samples.Get_NY()-1; i>=0; i--)
443 {
444 if( SubSet[i] == iSubSet )
445 {
446 Validation.Add_Row(Samples.Get_Row(i));
447 Samples .Del_Row(i);
448 }
449 else
450 {
451 Samples_Stats += Samples[i][0];
452 }
453 }
454
455 //---------------------------------------------
456 if( Model.Get_Model(Samples) )
457 {
458 nModels++;
459
460 for(i=0; i<Validation.Get_NRows(); i++)
461 {
462 double dObsrv = Validation[i][0];
463 double dModel = Model.Get_Value(CSG_Vector(m_nPredictors, Validation[i] + 1));
464
465 SE += SG_Get_Square(dModel - dObsrv);
466 SR += SG_Get_Square(dModel - Samples_Stats.Get_Mean());
467 }
468 }
469 }
470
471 delete[](SubSet);
472 }
473
474 //-----------------------------------------------------
475 m_pModel->Get_Record(MLR_MODEL_CV_MSE )->Set_Value(1, SE.Get_Mean());
476 m_pModel->Get_Record(MLR_MODEL_CV_RMSE )->Set_Value(1, sqrt(SE.Get_Mean()));
477 m_pModel->Get_Record(MLR_MODEL_CV_NRMSE )->Set_Value(1, sqrt(SE.Get_Mean()) / Stats.Get_Range());
478 m_pModel->Get_Record(MLR_MODEL_CV_R2 )->Set_Value(1, SR.Get_Sum() / (SR.Get_Sum() + SE.Get_Sum()));
479 m_pModel->Get_Record(MLR_MODEL_CV_NSAMPLES)->Set_Value(1, nModels);
480
481 //-----------------------------------------------------
482 return( true );
483 }
484
485
487 // //
488 // //
489 // //
491
492 //---------------------------------------------------------
493 double CSG_Regression_Multiple::Get_Value(const CSG_Vector &Predictors) const
494 {
495 double Value; Get_Value(Predictors, Value); return( Value );
496 }
497
498 bool CSG_Regression_Multiple::Get_Value(const CSG_Vector &Predictors, double &Value) const
499 {
500 if( m_nPredictors == Predictors.Get_N() )
501 {
502 Value = Get_RConst();
503
504 for(int i=0; i<m_nPredictors; i++)
505 {
506 Value += Get_RCoeff(i) * Predictors(i);
507 }
508
509 return( true );
510 }
511
512 Value = 0.;
513
514 return( false );
515 }
516
517 //---------------------------------------------------------
518 double CSG_Regression_Multiple::Get_Residual(int iSample) const
519 {
520 double Value; Get_Residual(iSample, Value); return( Value );
521 }
522
523 bool CSG_Regression_Multiple::Get_Residual(int iSample, double &Residual) const
524 {
525 if( iSample >= 0 && iSample < m_Samples_Model.Get_NRows() )
526 {
527 Residual = Get_RConst();
528
529 for(int i=0; i<m_nPredictors; i++)
530 {
531 Residual += Get_RCoeff(i) * m_Samples_Model[iSample][1 + i];
532 }
533
534 Residual -= m_Samples_Model[iSample][0];
535
536 return( true );
537 }
538
539 Residual = 0.;
540
541 return( false );
542 }
543
544 //---------------------------------------------------------
545 bool CSG_Regression_Multiple::Get_Residuals(CSG_Vector &Residuals) const
546 {
547 Residuals.Create(m_Samples_Model.Get_NRows());
548
549 for(int i=0; i<Residuals.Get_N(); i++)
550 {
551 Get_Residual(i, Residuals[i]);
552 }
553
554 return( Residuals.Get_N() > 0 );
555 }
556
557
559 // //
561
562 //---------------------------------------------------------
563 inline double CSG_Regression_Multiple::_Get_F(int nPredictors, int nSamples, double r2_full, double r2_reduced)
564 {
565 return( (nSamples - nPredictors - 1) * (r2_full - r2_reduced) / (1. - r2_full) );
566 }
567
568 //---------------------------------------------------------
569 inline double CSG_Regression_Multiple::_Get_P(int nPredictors, int nSamples, double r2_full, double r2_reduced)
570 {
571 double f = _Get_F(nPredictors, nSamples, r2_full, r2_reduced);
572
573 return( CSG_Test_Distribution::Get_F_Tail(f, nPredictors, nSamples - nPredictors - 1, TESTDIST_TYPE_Right) );
574 }
575
576
578 // //
580
581 //---------------------------------------------------------
582 bool CSG_Regression_Multiple::_Get_Regression(const CSG_Matrix &Samples)
583 {
584 int nPredictors = Samples.Get_NX() - 1;
585 int nSamples = Samples.Get_NY();
586
587 //-----------------------------------------------------
588 int i, j;
589 double Ym, SSR, SSE, SST, MSR, MSE, SE, R2, F;
590 CSG_Vector Y, Yr, B;
591 CSG_Matrix X, Xt, C;
592
593 Y.Create(nSamples);
594 X.Create(nPredictors + (m_bIntercept ? 1 : 0), nSamples);
595
596 //-----------------------------------------------------
597 for(i=0, Ym=0.; i<nSamples; i++)
598 {
599 Ym += Y[i] = Samples[i][0];
600
601 if( m_bIntercept )
602 {
603 X [i][0] = 1.;
604
605 for(j=1; j<=nPredictors; j++)
606 {
607 X[i][j] = Samples[i][j];
608 }
609 }
610 else
611 {
612 for(j=0; j<nPredictors; j++)
613 {
614 X[i][j] = Samples[i][j + 1];
615 }
616 }
617 }
618
619 Ym /= nSamples;
620
621 //-----------------------------------------------------
622 Xt = X.Get_Transpose();
623
624 C = (Xt * X).Get_Inverse();
625
626 B = C * (Xt * Y);
627
628 //-----------------------------------------------------
629 Yr = X * B;
630
631 for(i=0, SSE=0., SSR=0., SST=0.; i<nSamples; i++)
632 {
633 SSE += SG_Get_Square(Yr[i] - Y[i]);
634 SSR += SG_Get_Square(Yr[i] - Ym);
635 // SST += SG_Get_Square(Y [i] - Ym);
636 }
637
638 // SSE = SST - SSR;
639 SST = SSR + SSE;
640 MSR = SSR / nPredictors;
641 MSE = SSE / (nSamples - nPredictors - 1);
642 SE = sqrt(SSE / (nSamples - nPredictors));
643 R2 = SSR / SST;
644 F = MSR / MSE; // = (nSamples - nPredictors - 1) * (R2 / nPredictors) / (1. - R2);
645
646 //-----------------------------------------------------
647 m_pModel->Get_Record(MLR_MODEL_R2 )->Set_Value(1, R2);
648 m_pModel->Get_Record(MLR_MODEL_R2_ADJ )->Set_Value(1, SG_Regression_Get_Adjusted_R2(R2, nSamples, nPredictors));
649 m_pModel->Get_Record(MLR_MODEL_SE )->Set_Value(1, SE);
650 m_pModel->Get_Record(MLR_MODEL_SSR )->Set_Value(1, SSR);
651 m_pModel->Get_Record(MLR_MODEL_SSE )->Set_Value(1, SSE);
652 m_pModel->Get_Record(MLR_MODEL_SST )->Set_Value(1, SST);
653 m_pModel->Get_Record(MLR_MODEL_MSR )->Set_Value(1, MSR);
654 m_pModel->Get_Record(MLR_MODEL_MSE )->Set_Value(1, MSE);
655 m_pModel->Get_Record(MLR_MODEL_F )->Set_Value(1, F);
656 m_pModel->Get_Record(MLR_MODEL_SIG )->Set_Value(1, CSG_Test_Distribution::Get_F_Tail_from_R2(R2, nPredictors, nSamples));
657 m_pModel->Get_Record(MLR_MODEL_NPREDICT)->Set_Value(1, nPredictors);
658 m_pModel->Get_Record(MLR_MODEL_NSAMPLES)->Set_Value(1, nSamples);
659
660 //-----------------------------------------------------
661 CSG_Matrix P = SG_Get_Correlation_Matrix(Samples, true).Get_Inverse(); // get partial correlation
662
663 if( !m_bIntercept )
664 {
665 m_pRegression->Add_Record()->Set_Value(MLR_VAR_NAME, m_Names[0]);
666 }
667
668 for(j=0; j<B.Get_N(); j++)
669 {
670 double se = SE * sqrt(fabs(C[j][j]));
671 double b = B[j];
672 double t = b / se;
673 int k = (m_bIntercept ? j : j + 1);
674 double r = -P[k][0] / sqrt(P[k][k] * P[0][0]);
675
676 CSG_Table_Record *pRecord = m_pRegression->Add_Record();
677
678 pRecord->Set_Value(MLR_VAR_ID , m_bIntercept ? j - 1 : j);
679 pRecord->Set_Value(MLR_VAR_NAME , m_Names[k]);
680 pRecord->Set_Value(MLR_VAR_RCOEFF , b);
681 pRecord->Set_Value(MLR_VAR_R , r);
682 pRecord->Set_Value(MLR_VAR_R2 , r*r);
683 pRecord->Set_Value(MLR_VAR_R2_ADJ , SG_Regression_Get_Adjusted_R2(r*r, nSamples, nPredictors));
684 pRecord->Set_Value(MLR_VAR_SE , se);
685 pRecord->Set_Value(MLR_VAR_T , t);
686 pRecord->Set_Value(MLR_VAR_SIG , CSG_Test_Distribution::Get_T_Tail(t, nSamples - nPredictors, TESTDIST_TYPE_TwoTail));
687 }
688
689 //-----------------------------------------------------
690 return( true );
691 }
692
693
695 // //
696 // //
697 // //
699
700 //---------------------------------------------------------
701 int CSG_Regression_Multiple::_Get_Step_In(CSG_Matrix &X, double P_in, double &R2, const CSG_Matrix &Samples)
702 {
703 int iBest, iPredictor; double rBest;
704
705 CSG_Regression_Multiple R(m_bIntercept);
706
707 X.Add_Cols(1);
708
709 //-----------------------------------------------------
710 for(iPredictor=0, iBest=-1, rBest=0.; iPredictor<Samples.Get_NX()-1; iPredictor++)
711 {
712 if( !m_bIncluded[iPredictor] )
713 {
714 X.Set_Col(1 + m_nPredictors, Samples.Get_Col(1 + iPredictor));
715
716 if( R.Get_Model(X) && (iBest < 0 || rBest < R.Get_R2()) )
717 {
718 iBest = iPredictor;
719 rBest = R.Get_R2();
720 }
721 }
722 }
723
724 //-----------------------------------------------------
725 if( iBest >= 0 && _Get_P(1, Samples.Get_NY() - m_nPredictors, rBest, R2) <= P_in )
726 {
727 m_bIncluded[iBest] = true;
728 m_Predictor[m_nPredictors] = iBest;
729
730 m_nPredictors++;
731
732 X.Set_Col(m_nPredictors, Samples.Get_Col(1 + iBest));
733 _Set_Step_Info(X, R2, iBest, true);
734 R2 = rBest;
735
736 return( iBest );
737 }
738
739 X.Del_Col(X.Get_NX() - 1);
740
741 return( -1 );
742 }
743
744 //---------------------------------------------------------
745 int CSG_Regression_Multiple::_Get_Step_Out(CSG_Matrix &X, double P_out, double &R2)
746 {
747 int iBest, iPredictor; double rBest;
748
749 CSG_Regression_Multiple R(m_bIntercept);
750
751 if( R2 <= 0. )
752 {
753 R.Get_Model(X);
754
755 R2 = R.Get_R2();
756 }
757
758 //-----------------------------------------------------
759 for(iPredictor=0, iBest=-1, rBest=0.; iPredictor<m_nPredictors; iPredictor++)
760 {
761 CSG_Matrix X_reduced(X);
762
763 X_reduced.Del_Col(1 + iPredictor);
764
765 if( R.Get_Model(X_reduced) && (iBest < 0 || rBest < R.Get_R2()) )
766 {
767 iBest = iPredictor;
768 rBest = R.Get_R2();
769 }
770 }
771
772 //-----------------------------------------------------
773 if( iBest >= 0 && _Get_P(1, X.Get_NY() - (m_nPredictors - 1), R2, rBest) > P_out )
774 {
775 m_nPredictors--;
776
777 X.Del_Col(1 + iBest);
778 _Set_Step_Info(X, R2, m_Predictor[iBest], false);
779 R2 = rBest;
780
781 m_bIncluded[m_Predictor[iBest]] = false;
782
783 for(iPredictor=iBest; iPredictor<m_nPredictors; iPredictor++)
784 {
785 m_Predictor[iPredictor] = m_Predictor[iPredictor + 1];
786 }
787
788 return( iBest );
789 }
790
791 return( -1 );
792 }
793
794
796 // //
797 // //
798 // //
800
801 //---------------------------------------------------------
802 bool CSG_Regression_Multiple::_Set_Step_Info(const CSG_Matrix &X)
803 {
804 CSG_Regression_Multiple R(m_bIntercept);
805
806 if( m_nPredictors > 0 && R.Get_Model(X) )
807 {
808 m_pModel ->Assign(R.m_pModel);
809 m_pRegression ->Assign(R.m_pRegression);
810
811 m_pRegression->Get_Record(0)->Set_Value(MLR_VAR_NAME, m_Names[0]);
812
813 for(int i=0; i<m_nPredictors; i++)
814 {
815 CSG_Table_Record *pRecord = m_pRegression->Get_Record(1 + i);
816
817 pRecord->Set_Value(MLR_VAR_ID , m_Predictor[i]);
818 pRecord->Set_Value(MLR_VAR_NAME, m_Names[1 + m_Predictor[i]]);
819 }
820
821 return( true );
822 }
823
824 return( false );
825 }
826
827 //---------------------------------------------------------
828 bool CSG_Regression_Multiple::_Set_Step_Info(const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn)
829 {
830 CSG_Regression_Multiple R(m_bIntercept);
831
832 R.Get_Model(X);
833
834 CSG_Table_Record *pRecord = m_pSteps->Add_Record();
835
836 pRecord->Set_Value(MLR_STEP_NR , (int)m_pSteps->Get_Count());
837 pRecord->Set_Value(MLR_STEP_R , sqrt(R.Get_R2()));
838 pRecord->Set_Value(MLR_STEP_R2 , R.Get_R2());
839 pRecord->Set_Value(MLR_STEP_R2_ADJ , R.Get_R2_Adj());
840 pRecord->Set_Value(MLR_STEP_SE , R.Get_StdError());
841 pRecord->Set_Value(MLR_STEP_SSR , R.m_pModel->Get_Record(MLR_MODEL_SSR)->asDouble(1));
842 pRecord->Set_Value(MLR_STEP_SSE , R.m_pModel->Get_Record(MLR_MODEL_SSE)->asDouble(1));
843 pRecord->Set_Value(MLR_STEP_MSR , R.m_pModel->Get_Record(MLR_MODEL_MSR)->asDouble(1));
844 pRecord->Set_Value(MLR_STEP_MSE , R.m_pModel->Get_Record(MLR_MODEL_MSE)->asDouble(1));
845 pRecord->Set_Value(MLR_STEP_DF , X.Get_NRows() - m_nPredictors - 1);
846 pRecord->Set_Value(MLR_STEP_F , R.m_pModel->Get_Record(MLR_MODEL_F )->asDouble(1));
847 pRecord->Set_Value(MLR_STEP_SIG , R.m_pModel->Get_Record(MLR_MODEL_SIG)->asDouble(1));
848 pRecord->Set_Value(MLR_STEP_VAR_F , _Get_F(1, X.Get_NY() - (m_nPredictors - 1), bIn ? R.Get_R2() : R2_prev, bIn ? R2_prev : R.Get_R2()));
849 pRecord->Set_Value(MLR_STEP_VAR_SIG , _Get_P(1, X.Get_NY() - (m_nPredictors - 1), bIn ? R.Get_R2() : R2_prev, bIn ? R2_prev : R.Get_R2()));
850 pRecord->Set_Value(MLR_STEP_DIR , bIn ? SG_T(">>") : SG_T("<<"));
851 pRecord->Set_Value(MLR_STEP_VAR , m_Names[1 + iVariable]);
852
853 return( true );
854 }
855
856
858 // //
859 // //
860 // //
862
863 //---------------------------------------------------------
864 double CSG_Regression_Multiple::Get_R2 (void) const { return( m_pModel->Get_Record(MLR_MODEL_R2 )->asDouble(1) ); }
865 double CSG_Regression_Multiple::Get_R2_Adj (void) const { return( m_pModel->Get_Record(MLR_MODEL_R2_ADJ )->asDouble(1) ); }
866 double CSG_Regression_Multiple::Get_StdError (void) const { return( m_pModel->Get_Record(MLR_MODEL_SE )->asDouble(1) ); }
867 double CSG_Regression_Multiple::Get_F (void) const { return( m_pModel->Get_Record(MLR_MODEL_F )->asDouble(1) ); }
868 double CSG_Regression_Multiple::Get_P (void) const { return( m_pModel->Get_Record(MLR_MODEL_SIG )->asDouble(1) ); }
869 double CSG_Regression_Multiple::Get_CV_RMSE (void) const { return( m_pModel->Get_Record(MLR_MODEL_CV_RMSE )->asDouble(1) ); }
870 double CSG_Regression_Multiple::Get_CV_NRMSE (void) const { return( m_pModel->Get_Record(MLR_MODEL_CV_NRMSE )->asDouble(1) ); }
871 double CSG_Regression_Multiple::Get_CV_R2 (void) const { return( m_pModel->Get_Record(MLR_MODEL_CV_R2 )->asDouble(1) ); }
872 int CSG_Regression_Multiple::Get_CV_nSamples (void) const { return( m_pModel->Get_Record(MLR_MODEL_CV_NSAMPLES)->asInt (1) ); }
873 int CSG_Regression_Multiple::Get_nPredictors (void) const { return( m_pModel->Get_Record(MLR_MODEL_NPREDICT )->asInt (1) ); }
874 int CSG_Regression_Multiple::Get_nSamples (void) const { return( m_pModel->Get_Record(MLR_MODEL_NSAMPLES )->asInt (1) ); }
875 int CSG_Regression_Multiple::Get_DegFreedom (void) const { return( Get_nSamples() - Get_nPredictors() - 1 ); }
876
877 //---------------------------------------------------------
878 const SG_Char * CSG_Regression_Multiple::Get_Name(int iVariable) const
879 {
880 if( iVariable >= 0 && iVariable < m_pRegression->Get_Count() - 1 )
881 {
882 return( m_pRegression->Get_Record(1 + iVariable)->asString(MLR_VAR_NAME) );
883 }
884
885 return( SG_T("") );
886 }
887
888 //---------------------------------------------------------
889 double CSG_Regression_Multiple::Get_RConst(void) const
890 {
891 if( m_pRegression->Get_Count() > 0 )
892 {
893 return( m_pRegression->Get_Record(0)->asDouble(MLR_VAR_RCOEFF) );
894 }
895
896 return( 0. );
897 }
898
899 //---------------------------------------------------------
900 double CSG_Regression_Multiple::Get_Parameter(int iVariable, int Parameter) const
901 {
902 if( iVariable >= 0 && iVariable < m_pRegression->Get_Count() - 1 && Parameter >= 0 && Parameter <= MLR_VAR_P )
903 {
904 return( m_pRegression->Get_Record(1 + iVariable)->asDouble(Parameter) );
905 }
906
907 return( 0. );
908 }
909
910
912 // //
914
915 //---------------------------------------------------------
916 CSG_String CSG_Regression_Multiple::Get_Info(void) const
917 {
918 CSG_String s;
919
920 if( Get_nPredictors() < 1 )
921 {
922 return( s );
923 }
924
925 //-----------------------------------------------------
926 if( m_pSteps->Get_Count() > 0 )
927 {
928 s += CSG_String::Format("\n%s:\n\n", _TL("Steps"));
929 s += CSG_String::Format("No. \tR \tR2 \tR2 adj\tStdErr\tF \tP \tF step\tP step\tVariable\n");
930 s += CSG_String::Format("------\t------\t------\t------\t------\t------\t------\t------\t------\t------\n");
931
932 for(int i=0; i<m_pSteps->Get_Count(); i++)
933 {
934 CSG_Table_Record *pRecord = m_pSteps->Get_Record(i);
935
936 s += CSG_String::Format("%d.\t%.2f\t%.2f\t%.2f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%s %s\n",
937 pRecord->asInt (MLR_STEP_NR ),
938 pRecord->asDouble(MLR_STEP_R ),
939 pRecord->asDouble(MLR_STEP_R2 ) * 100.,
940 pRecord->asDouble(MLR_STEP_R2_ADJ ) * 100.,
941 pRecord->asDouble(MLR_STEP_SE ),
942 pRecord->asDouble(MLR_STEP_F ),
943 pRecord->asDouble(MLR_STEP_SIG ) * 100.,
944 pRecord->asDouble(MLR_STEP_VAR_F ),
945 pRecord->asDouble(MLR_STEP_VAR_SIG) * 100.,
946 pRecord->asString(MLR_STEP_DIR ),
947 pRecord->asString(MLR_STEP_VAR )
948 );
949 }
950 }
951
952 //-----------------------------------------------------
953 s += CSG_String::Format("\n%s:\n\n", _TL("Correlation"));
954 s += CSG_String::Format("No. \tR \tR2 \tR2 adj\tStdErr\tt \tSig. \tb \t\tVariable\n");
955 s += CSG_String::Format("------\t------\t------\t------\t------\t------\t---------\t---------\t\t---------\n");
956
957 for(int i=0; i<m_pRegression->Get_Count(); i++)
958 {
959 CSG_Table_Record *pRecord = m_pRegression->Get_Record(i);
960
961 s += CSG_String::Format("%d.\t%.2f\t%.2f\t%.2f\t%.3f\t%.3f\t%.6f\t%.6f\t%s\n",
962 i,
963 pRecord->asDouble(MLR_VAR_R ),
964 pRecord->asDouble(MLR_VAR_R2 ) * 100.,
965 pRecord->asDouble(MLR_VAR_R2_ADJ) * 100.,
966 pRecord->asDouble(MLR_VAR_SE ),
967 pRecord->asDouble(MLR_VAR_T ),
968 pRecord->asDouble(MLR_VAR_SIG ) * 100.,
969 pRecord->asDouble(MLR_VAR_RCOEFF),
970 pRecord->asString(MLR_VAR_NAME )
971 );
972 }
973
974 //-----------------------------------------------------
975 s += CSG_String::Format("\n%s: %g", _TL("Formula"), Get_RConst());
976
977 for(int i=0; i<Get_nPredictors(); i++)
978 {
979 double b = Get_RCoeff(i);
980
981 s += CSG_String::Format(" %c %g * X%d", b < 0. ? '-' : '+', fabs(b), i + 1);
982 }
983
984 //-----------------------------------------------------
985 s += "\n\n";
986
987 s += CSG_String::Format("%s: %f (%s: %d)\n", _TL("Residual standard error"), Get_StdError(), _TL("degrees of freedom"), Get_DegFreedom());
988 s += CSG_String::Format("%s: %f (%s: %f)\n", _TL("Multiple R-squared"), 100. * Get_R2(), _TL("adjusted"), 100. * Get_R2_Adj());
989 s += CSG_String::Format("%s: %f (%d/%d DF), %s: %g\n", _TL("F-statistic"), Get_F(), Get_nPredictors(), Get_DegFreedom(), _TL("p-value"), Get_P());
990
991 //-----------------------------------------------------
992 return( s );
993 }
994
995
997 // //
998 // //
999 // //
1001
1002 //---------------------------------------------------------
CSG_Regression_Multiple::Destroy
void Destroy(void)
Definition: mat_regression_multiple.cpp:196
MLR_STEP_NR
@ MLR_STEP_NR
Definition: mat_regression_multiple.cpp:88
MLR_STEP_R2
@ MLR_STEP_R2
Definition: mat_regression_multiple.cpp:90
SG_Get_Correlation_Matrix
CSG_Matrix SG_Get_Correlation_Matrix(const CSG_Matrix &Values, bool bCovariances)
Definition: mat_tools.cpp:3473
MLR_MODEL_SIG
@ MLR_MODEL_SIG
Definition: mat_regression_multiple.cpp:75
CSG_Regression_Multiple::Get_RCoeff
double Get_RCoeff(int iVariable) const
Definition: mat_tools.h:1724
MLR_VAR_R2_ADJ
@ MLR_VAR_R2_ADJ
Definition: mat_tools.h:1669
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
MLR_STEP_SSE
@ MLR_STEP_SSE
Definition: mat_regression_multiple.cpp:94
CSG_Test_Distribution::Get_F_Tail
static double Get_F_Tail(double F, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3279
CSG_Regression_Multiple::m_pModel
class CSG_Table * m_pModel
Definition: mat_tools.h:1752
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_Regression_Multiple::Get_Value
double Get_Value(const CSG_Vector &Predictors) const
Definition: mat_regression_multiple.cpp:493
CSG_Matrix::Get_Inverse
CSG_Matrix Get_Inverse(bool bSilent=true, int nSubSquare=0) const
Definition: mat_matrix.cpp:1845
SG_T
#define SG_T(s)
Definition: api_core.h:531
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Regression_Multiple::Get_Residual
double Get_Residual(int iSample) const
Definition: mat_regression_multiple.cpp:518
CSG_Regression_Multiple::Get_Model_Stepwise
bool Get_Model_Stepwise(const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames=NULL)
Definition: mat_regression_multiple.cpp:312
CSG_Regression_Multiple::m_Samples_Model
CSG_Matrix m_Samples_Model
Definition: mat_tools.h:1750
TESTDIST_TYPE_Right
@ TESTDIST_TYPE_Right
Definition: mat_tools.h:1496
CSG_Regression_Multiple::Get_R2
double Get_R2(void) const
Definition: mat_regression_multiple.cpp:864
CSG_Regression_Multiple::~CSG_Regression_Multiple
virtual ~CSG_Regression_Multiple(void)
Definition: mat_regression_multiple.cpp:181
MLR_STEP_DIR
@ MLR_STEP_DIR
Definition: mat_regression_multiple.cpp:102
CSG_Regression_Multiple::Get_nPredictors
int Get_nPredictors(void) const
Definition: mat_regression_multiple.cpp:873
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Table_Record
Definition: table.h:130
CSG_Matrix::Del_Col
bool Del_Col(sLong Col)
Definition: mat_matrix.cpp:1251
MLR_VAR_RCOEFF
@ MLR_VAR_RCOEFF
Definition: mat_tools.h:1666
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_Regression_Multiple::_Set_Step_Info
bool _Set_Step_Info(const CSG_Matrix &X)
Definition: mat_regression_multiple.cpp:802
C
#define C
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
MLR_VAR_R2
@ MLR_VAR_R2
Definition: mat_tools.h:1668
MLR_STEP_SIG
@ MLR_STEP_SIG
Definition: mat_regression_multiple.cpp:99
MLR_STEP_VAR
@ MLR_STEP_VAR
Definition: mat_regression_multiple.cpp:103
CSG_Simple_Statistics::Get_Sum
double Get_Sum(void)
Definition: mat_tools.h:734
CSG_Regression_Multiple::Get_Residuals
bool Get_Residuals(CSG_Vector &Residuals) const
Definition: mat_regression_multiple.cpp:545
CSG_Regression_Multiple::m_nPredictors
int m_nPredictors
Definition: mat_tools.h:1746
CSG_Regression_Multiple::_Initialize
bool _Initialize(bool bInclude)
Definition: mat_regression_multiple.cpp:255
CSG_Regression_Multiple::Get_F
double Get_F(void) const
Definition: mat_regression_multiple.cpp:867
CSG_Regression_Multiple::Get_StdError
double Get_StdError(void) const
Definition: mat_regression_multiple.cpp:866
CSG_Regression_Multiple::_Get_F
double _Get_F(int nPredictors, int nSamples, double r2_full, double r2_reduced)
Definition: mat_regression_multiple.cpp:563
CSG_Regression_Multiple::Set_Data
bool Set_Data(const CSG_Matrix &Samples, CSG_Strings *pNames=NULL)
Definition: mat_regression_multiple.cpp:226
MLR_MODEL_CV_RMSE
@ MLR_MODEL_CV_RMSE
Definition: mat_regression_multiple.cpp:79
MLR_MODEL_SST
@ MLR_MODEL_SST
Definition: mat_regression_multiple.cpp:71
CSG_Matrix::Del_Row
bool Del_Row(sLong Row)
Definition: mat_matrix.cpp:1285
CSG_Regression_Multiple::Get_Model_Backward
bool Get_Model_Backward(const CSG_Matrix &Samples, double P_out, CSG_Strings *pNames=NULL)
Definition: mat_regression_multiple.cpp:307
CSG_Regression_Multiple::Get_Model_Forward
bool Get_Model_Forward(const CSG_Matrix &Samples, double P_in, CSG_Strings *pNames=NULL)
Definition: mat_regression_multiple.cpp:302
MLR_MODEL_SE
@ MLR_MODEL_SE
Definition: mat_regression_multiple.cpp:68
CSG_Matrix::Get_Col
CSG_Vector Get_Col(sLong Col) const
Definition: mat_matrix.cpp:1314
MLR_STEP_DF
@ MLR_STEP_DF
Definition: mat_regression_multiple.cpp:97
CSG_Regression_Multiple::Get_nSamples
int Get_nSamples(void) const
Definition: mat_regression_multiple.cpp:874
MLR_STEP_MSE
@ MLR_STEP_MSE
Definition: mat_regression_multiple.cpp:96
CSG_Matrix::Add_Cols
bool Add_Cols(sLong nCols)
Definition: mat_matrix.cpp:990
CSG_Regression_Multiple::Get_DegFreedom
int Get_DegFreedom(void) const
Definition: mat_regression_multiple.cpp:875
MLR_VAR_T
@ MLR_VAR_T
Definition: mat_tools.h:1671
CSG_Matrix::Get_NCols
sLong Get_NCols(void) const
Definition: mat_tools.h:507
CSG_Regression_Multiple::Get_CV_R2
double Get_CV_R2(void) const
Definition: mat_regression_multiple.cpp:871
mat_tools.h
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Regression_Multiple::m_Samples
CSG_Matrix m_Samples
Definition: mat_tools.h:1750
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Vector
Definition: mat_tools.h:345
MLR_VAR_R
@ MLR_VAR_R
Definition: mat_tools.h:1667
CSG_Regression_Multiple::Get_Info
CSG_String Get_Info(void) const
Definition: mat_regression_multiple.cpp:916
MLR_STEP_R
@ MLR_STEP_R
Definition: mat_regression_multiple.cpp:89
CSG_Regression_Multiple::Get_Name
const SG_Char * Get_Name(int iVariable) const
Definition: mat_regression_multiple.cpp:878
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
MLR_VAR_NAME
@ MLR_VAR_NAME
Definition: mat_tools.h:1665
CSG_Regression_Multiple::m_Predictor
int * m_Predictor
Definition: mat_tools.h:1746
MLR_STEP_SSR
@ MLR_STEP_SSR
Definition: mat_regression_multiple.cpp:93
MLR_MODEL_SSR
@ MLR_MODEL_SSR
Definition: mat_regression_multiple.cpp:69
MLR_MODEL_NSAMPLES
@ MLR_MODEL_NSAMPLES
Definition: mat_regression_multiple.cpp:77
CSG_Regression_Multiple::m_bIntercept
bool m_bIntercept
Definition: mat_tools.h:1744
MLR_MODEL_R2
@ MLR_MODEL_R2
Definition: mat_regression_multiple.cpp:66
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_Get_Square
double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Regression_Multiple::_Get_P
double _Get_P(int nPredictors, int nSamples, double r2_full, double r2_reduced)
Definition: mat_regression_multiple.cpp:569
MLR_MODEL_F
@ MLR_MODEL_F
Definition: mat_regression_multiple.cpp:74
ESG_Multiple_Regression_Info_Steps
ESG_Multiple_Regression_Info_Steps
Definition: mat_regression_multiple.cpp:87
CSG_Regression_Multiple::_Get_Step_Out
int _Get_Step_Out(CSG_Matrix &X, double P_out, double &R2)
Definition: mat_regression_multiple.cpp:745
CSG_Regression_Multiple::CSG_Regression_Multiple
CSG_Regression_Multiple(bool bIntercept=true)
Definition: mat_regression_multiple.cpp:114
MLR_MODEL_SSE
@ MLR_MODEL_SSE
Definition: mat_regression_multiple.cpp:70
CSG_Regression_Multiple::Get_Parameter
double Get_Parameter(int iVariable, int Parameter) const
Definition: mat_regression_multiple.cpp:900
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
CSG_Strings
Definition: api_core.h:693
CSG_Regression_Multiple::Get_CV_nSamples
int Get_CV_nSamples(void) const
Definition: mat_regression_multiple.cpp:872
CSG_Matrix::Set_Col
bool Set_Col(sLong Col, const double *Data)
Definition: mat_matrix.cpp:1194
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Strings::Get_String
CSG_String & Get_String(int Index) const
Definition: api_core.h:716
MLR_MODEL_CV_NRMSE
@ MLR_MODEL_CV_NRMSE
Definition: mat_regression_multiple.cpp:80
MLR_STEP_VAR_SIG
@ MLR_STEP_VAR_SIG
Definition: mat_regression_multiple.cpp:101
CSG_Matrix::Get_Transpose
CSG_Matrix Get_Transpose(void) const
Definition: mat_matrix.cpp:1829
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
CSG_Regression_Multiple::Get_P
double Get_P(void) const
Definition: mat_regression_multiple.cpp:868
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
TESTDIST_TYPE_TwoTail
@ TESTDIST_TYPE_TwoTail
Definition: mat_tools.h:1498
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Regression_Multiple::Get_CV_RMSE
double Get_CV_RMSE(void) const
Definition: mat_regression_multiple.cpp:869
MLR_MODEL_CV_MSE
@ MLR_MODEL_CV_MSE
Definition: mat_regression_multiple.cpp:78
B
#define B
CSG_String
Definition: api_core.h:557
MLR_MODEL_R2_ADJ
@ MLR_MODEL_R2_ADJ
Definition: mat_regression_multiple.cpp:67
CSG_Regression_Multiple::m_pSteps
class CSG_Table * m_pSteps
Definition: mat_tools.h:1752
CSG_Regression_Multiple::Get_Model
bool Get_Model(const CSG_Matrix &Samples, CSG_Strings *pNames=NULL)
Definition: mat_regression_multiple.cpp:297
CSG_Simple_Statistics::Get_Range
double Get_Range(void)
Definition: mat_tools.h:733
MLR_STEP_R2_ADJ
@ MLR_STEP_R2_ADJ
Definition: mat_regression_multiple.cpp:91
MLR_VAR_P
@ MLR_VAR_P
Definition: mat_tools.h:1673
CSG_Regression_Multiple::m_Names
CSG_Strings m_Names
Definition: mat_tools.h:1748
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Regression_Multiple::m_bIncluded
int * m_bIncluded
Definition: mat_tools.h:1746
CSG_Matrix::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:923
MLR_MODEL_MSR
@ MLR_MODEL_MSR
Definition: mat_regression_multiple.cpp:72
CSG_Regression_Multiple::Get_RConst
double Get_RConst(void) const
Definition: mat_regression_multiple.cpp:889
ESG_Multiple_Regression_Info_Model
ESG_Multiple_Regression_Info_Model
Definition: mat_regression_multiple.cpp:65
MLR_STEP_SE
@ MLR_STEP_SE
Definition: mat_regression_multiple.cpp:92
MLR_STEP_MSR
@ MLR_STEP_MSR
Definition: mat_regression_multiple.cpp:95
MLR_MODEL_CV_NSAMPLES
@ MLR_MODEL_CV_NSAMPLES
Definition: mat_regression_multiple.cpp:82
MLR_VAR_ID
@ MLR_VAR_ID
Definition: mat_tools.h:1664
MLR_MODEL_MSE
@ MLR_MODEL_MSE
Definition: mat_regression_multiple.cpp:73
CSG_Regression_Multiple::m_pRegression
class CSG_Table * m_pRegression
Definition: mat_tools.h:1752
CSG_Matrix::Add_Row
bool Add_Row(const double *Data=NULL)
Definition: mat_matrix.cpp:1100
CSG_Regression_Multiple::_Get_Step_In
int _Get_Step_In(CSG_Matrix &X, double P_in, double &R2, const CSG_Matrix &Samples)
Definition: mat_regression_multiple.cpp:701
MLR_VAR_SE
@ MLR_VAR_SE
Definition: mat_tools.h:1670
MLR_MODEL_CV_R2
@ MLR_MODEL_CV_R2
Definition: mat_regression_multiple.cpp:81
CSG_Regression_Multiple::Get_R2_Adj
double Get_R2_Adj(void) const
Definition: mat_regression_multiple.cpp:865
MLR_MODEL_NPREDICT
@ MLR_MODEL_NPREDICT
Definition: mat_regression_multiple.cpp:76
CSG_Test_Distribution::Get_F_Tail_from_R2
static double Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3271
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_Regression_Multiple::Get_Model
bool Get_Model(void)
Definition: mat_regression_multiple.cpp:318
CSG_Regression_Multiple::Get_CV_NRMSE
double Get_CV_NRMSE(void) const
Definition: mat_regression_multiple.cpp:870
CSG_Regression_Multiple::_Get_Regression
bool _Get_Regression(const class CSG_Matrix &Samples)
Definition: mat_regression_multiple.cpp:582
MLR_VAR_SIG
@ MLR_VAR_SIG
Definition: mat_tools.h:1672
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
SG_Regression_Get_Adjusted_R2
double SG_Regression_Get_Adjusted_R2(double r2, int n, int p, TSG_Regression_Correction Correction)
Definition: mat_regression.cpp:63
CSG_Matrix
Definition: mat_tools.h:463
CSG_Test_Distribution::Get_T_Tail
static double Get_T_Tail(double T, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3073
CSG_Simple_Statistics
Definition: mat_tools.h:708
table.h
CSG_Regression_Multiple::Get_CrossValidation
bool Get_CrossValidation(int nSubSamples=0)
Definition: mat_regression_multiple.cpp:385
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
CSG_Matrix::Get_NY
int Get_NY(void) const
Definition: mat_tools.h:506
MLR_STEP_F
@ MLR_STEP_F
Definition: mat_regression_multiple.cpp:98
MLR_STEP_VAR_F
@ MLR_STEP_VAR_F
Definition: mat_regression_multiple.cpp:100
CSG_Matrix::Get_NX
int Get_NX(void) const
Definition: mat_tools.h:505
CSG_Regression_Multiple
Definition: mat_tools.h:1678
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression_weighted.cpp File Reference

  • saga_core
  • saga_api
mat_regression_weighted.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_regression_weighted.cpp Source File

  • saga_core
  • saga_api
mat_regression_weighted.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_regression_multiple.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Hamburg //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Regression_Weighted::CSG_Regression_Weighted(void)
64 {
65 m_r2 = -1.0;
66
67 m_Log_maxIter = 30;
68 m_Log_Epsilon = 0.001;
69 m_Log_Difference = 1000.;
70 }
71
72 //---------------------------------------------------------
73 CSG_Regression_Weighted::~CSG_Regression_Weighted(void)
74 {
75 Destroy();
76 }
77
78 //---------------------------------------------------------
79 bool CSG_Regression_Weighted::Destroy(void)
80 {
81 m_r2 = -1.0;
82
83 m_y.Destroy();
84 m_w.Destroy();
85 m_X.Destroy();
86 m_b.Destroy();
87
88 return( true );
89 }
90
91
93 // //
95
96 //---------------------------------------------------------
97 bool CSG_Regression_Weighted::Add_Sample(double Weight, double Dependent, const CSG_Vector &Predictors)
98 {
99 if( m_X.Get_NRows() == 0 )
100 {
101 m_X.Create(Predictors.Get_N() + 1, 1);
102 }
103 else if( m_X.Get_NCols() == Predictors.Get_N() + 1 )
104 {
105 m_X.Add_Row();
106 }
107 else
108 {
109 return( false );
110 }
111
112 m_w.Add_Row(Weight );
113 m_y.Add_Row(Dependent);
114
115 double *y = m_X[m_X.Get_NRows() - 1];
116
117 y[0] = 1.0;
118
119 for(int i=0; i<Predictors.Get_N(); i++)
120 {
121 y[i + 1] = Predictors[i];
122 }
123
124 return( true );
125 }
126
127
129 // //
131
132 //---------------------------------------------------------
133 bool CSG_Regression_Weighted::Calculate(const CSG_Vector &Weights, const CSG_Vector &Dependents, const CSG_Matrix &Predictors, bool bLogistic)
134 {
135 Destroy();
136
137 if( Weights.Get_N() == Dependents.Get_N() && Weights.Get_N() == Predictors.Get_NRows() )
138 {
139 for(int i=0; i<Weights.Get_N(); i++)
140 {
141 Add_Sample(Weights[i], Dependents[i], Predictors.Get_Row(i));
142
143 return( Calculate(bLogistic) );
144 }
145 }
146
147 return( false );
148 }
149
150 //---------------------------------------------------------
151 bool CSG_Regression_Weighted::Calculate(bool bLogistic)
152 {
153 sLong nSamples = m_w.Get_Size(), nPredictors = m_X.Get_NCols() - 1;
154
155 if( nSamples <= nPredictors || nSamples < 2 )
156 {
157 return( false );
158 }
159
160 //-----------------------------------------------------
161 if( bLogistic )
162 {
163 m_b = _Log_Get_Beta(m_X, m_y, m_w);
164
165 if( m_b.Get_N() == 0 )
166 {
167 return( false );
168 }
169 }
170 else
171 {
172 CSG_Matrix YtW(nSamples, 1 + nPredictors);
173
174 for(sLong i=0; i<nSamples; i++)
175 {
176 YtW[0][i] = m_w[i];
177
178 for(sLong j=1; j<=nPredictors; j++)
179 {
180 YtW[j][i] = m_w[i] * m_X[i][j];
181 }
182 }
183
184 m_b = (YtW * m_X).Get_Inverse() * (YtW * m_y);
185 }
186
187 //-----------------------------------------------------
188 CSG_Simple_Statistics yStats(m_y);
189
190 double rss = 0., tss = 0.;
191
192 for(sLong i=0; i<nSamples; i++)
193 {
194 double yr = m_b[0];
195
196 for(sLong j=1; j<=nPredictors; j++)
197 {
198 yr += m_b[j] * m_X[i][j];
199 }
200
201 if( bLogistic )
202 {
203 yr = 1. / (1. + exp(-yr));
204 }
205
206 rss += m_w[i] * SG_Get_Square(m_y[i] - yr);
207 tss += m_w[i] * SG_Get_Square(m_y[i] - yStats.Get_Mean());
208 }
209
210 //-----------------------------------------------------
211 if( tss > 0.0 && tss >= rss )
212 {
213 m_r2 = fabs(tss - rss) / tss;
214
215 return( true );
216 }
217
218 m_r2 = -1.;
219
220 return( false );
221 }
222
223
225 // //
227
228 //---------------------------------------------------------
229 // Zhang, D., Ren, N., and Hou, X. (2018):
230 // An improved logistic regression model based on a spatially weighted technique
231 // (ILRBSWT v1.0) and its application to mineral prospectivity mapping.
232 // Geosci. Model Dev., 11, 2525-2539, https://doi.org/10.5194/gmd-11-2525-2018.
233
234 //---------------------------------------------------------
235 bool CSG_Regression_Weighted::Set_Log_maxIter(int maxIter)
236 {
237 if( maxIter > 0 )
238 {
239 m_Log_maxIter = maxIter;
240
241 return( true );
242 }
243
244 return( false );
245 }
246
247 //---------------------------------------------------------
248 bool CSG_Regression_Weighted::Set_Log_Epsilon(double Epsilon)
249 {
250 if( Epsilon >= 0. )
251 {
252 m_Log_Epsilon = Epsilon;
253
254 return( true );
255 }
256
257 return( false );
258 }
259
260 //---------------------------------------------------------
261 bool CSG_Regression_Weighted::Set_Log_Difference(double Difference)
262 {
263 if( Difference > 0. )
264 {
265 m_Log_Difference = Difference;
266
267 return( true );
268 }
269
270 return( false );
271 }
272
273 //---------------------------------------------------------
274 CSG_Vector CSG_Regression_Weighted::_Log_Get_Beta(const CSG_Matrix &X, const CSG_Vector &y, const CSG_Vector &w)
275 {
276 CSG_Vector b(X.Get_NCols()), b_best;
277
278 CSG_Vector p = _Log_Get_Props(X, b);
279
280 for(int i=0; i<m_Log_maxIter; ++i)
281 {
282 CSG_Vector b_new = _Log_Get_Beta(b, X, y, w, p);
283
284 if( b_new.Get_N() == 0 )
285 {
286 return( b_best );
287 }
288
289 for(int j=0; j<b_new.Get_N(); ++j)
290 {
291 if( SG_is_NaN(b_new[j]) )
292 {
293 return( b_best );
294 }
295 }
296
297 if( _Log_NoChange(b, b_new) )
298 {
299 return( b_new );
300 }
301
302 if( _Log_OutOfControl(b, b_new) )
303 {
304 return( b_best );
305 }
306
307 p = _Log_Get_Props(X, b_new);
308 b = b_new;
309 b_best = b;
310 }
311
312 return( b_best );
313 }
314
315 //---------------------------------------------------------
316 CSG_Vector CSG_Regression_Weighted::_Log_Get_Beta(const CSG_Vector &b, const CSG_Matrix &X, const CSG_Vector &y, const CSG_Vector &w, const CSG_Vector &p)
317 {
318 CSG_Matrix Xt = X.Get_Transpose() ; // X'
319 CSG_Matrix M = Xt * _Log_Get_Xwp(p, X, w); // X'* w * V(t-1) * X
320 CSG_Matrix N = M.Get_Inverse() * Xt ; // inv(X'* w * V(t-1) * X) * X'
321 CSG_Vector v = N * _Log_Get_Ywp(p, y, w); // inv(X'* w * V(t-1) * X) * X' * w * (y - p(t-1))
322
323 if( v.Get_N() == b.Get_N() )
324 {
325 return( b + v );
326 }
327
328 return( CSG_Vector() );
329 }
330
331 //---------------------------------------------------------
332 CSG_Matrix CSG_Regression_Weighted::_Log_Get_Xwp(const CSG_Vector &p, const CSG_Matrix &X, const CSG_Vector &w)
333 {
334 CSG_Matrix Xwp;
335
336 if( p.Get_N() == X.Get_NRows() && Xwp.Create(X.Get_NCols(), X.Get_NRows()) )
337 {
338 for(int i=0; i<X.Get_NRows(); ++i)
339 {
340 for(int j=0; j<X.Get_NCols(); ++j)
341 {
342 Xwp[i][j] = w[i] * p[i] * (1. - p[i]) * X[i][j]; // compute W(u) * V(u) * X
343 }
344 }
345 }
346
347 return( Xwp );
348 }
349
350 //---------------------------------------------------------
351 CSG_Vector CSG_Regression_Weighted::_Log_Get_Ywp(const CSG_Vector &p, const CSG_Vector &y, const CSG_Vector &w)
352 {
353 CSG_Vector Ywp(y.Get_N());
354
355 if( y.Get_N() == p.Get_N() && Ywp.Create(y.Get_N()) )
356 {
357 for(int i=0; i<Ywp.Get_N(); i++)
358 {
359 Ywp[i] = w[i] * (y[i] - p[i]); // compute W(u) * (y - p)
360 }
361 }
362
363 return( Ywp );
364 }
365
366 //---------------------------------------------------------
367 CSG_Vector CSG_Regression_Weighted::_Log_Get_Props(const CSG_Matrix &X, const CSG_Vector &b)
368 {
369 CSG_Vector p(X.Get_NRows());
370
371 for(int i=0; i<X.Get_NRows(); ++i)
372 {
373 double z = 0.;
374
375 for(int j=0; j<X.Get_NCols(); ++j)
376 {
377 z += X[i][j] * b[j];
378 }
379
380 p[i] = 1. / (1. + exp(-z));
381 }
382
383 return( p );
384 }
385
386 //---------------------------------------------------------
387 bool CSG_Regression_Weighted::_Log_NoChange(const CSG_Vector &b_old, const CSG_Vector &b_new)
388 {
389 for(int i=0; i<b_old.Get_N(); ++i)
390 {
391 if( fabs(b_old[i] - b_new[i]) > m_Log_Epsilon )
392 {
393 return( false );
394 }
395 }
396
397 return( true ); // if the new beta is equal to the old one under certain accuracy
398 }
399
400 //---------------------------------------------------------
401 bool CSG_Regression_Weighted::_Log_OutOfControl(const CSG_Vector &b_old, const CSG_Vector &b_new)
402 {
403 for(int i=0; i<b_old.Get_N(); ++i)
404 {
405 if( b_old[i] == 0.0 )
406 {
407 return( false );
408 }
409
410 if( fabs(b_old[i] - b_new[i]) / fabs(b_old[i]) > m_Log_Difference )
411 {
412 return( true );
413 }
414 }
415
416 return( false ); // if the new beta has obvious difference with the old one
417 }
418
419
421 // //
423
424 //---------------------------------------------------------
425 bool CSG_Regression_Weighted::Get_CrossValidation(int nSubSamples)
426 {
427 /* if( Get_Predictor_Count() <= 1 )
428 {
429 return( false );
430 }
431
432 //-----------------------------------------------------
433 CSG_Regression_Weighted Model;
434 CSG_Simple_Statistics Stats, SR, SE;
435
436 int i, nModels = 0;
437
438 for(i=0; i<m_Samples_Model.Get_NRows(); i++)
439 {
440 Stats += m_Samples_Model[i][0];
441 }
442
443 //-----------------------------------------------------
444 // leave-one-out cross validation (LOOCV)
445 if( nSubSamples <= 1 || nSubSamples > m_Samples_Model.Get_NRows() / 2 )
446 {
447 for(i=0; i<m_Samples_Model.Get_NRows() && SG_UI_Process_Get_Okay(); i++)
448 {
449 CSG_Vector w(m_w); w.Del_Row(i); Model
450 CSG_Vector x(m_y); x.Del_Row(i);
451 CSG_Matrix Y(m_X); Y.Del_Row(i);
452
453 if( Model.Calculate(w, x, Y) )
454 {
455 nModels++;
456
457 double dObsrv = m_Samples_Model[i][0];
458 double dModel = Model.Get_Value(CSG_Vector(m_nPredictors, m_Samples_Model[i] + 1));
459
460 SE += SG_Get_Square(dModel - dObsrv);
461 SR += SG_Get_Square(dModel - (Stats.Get_Sum() - dObsrv) / Samples.Get_NRows());
462 }
463 }
464 }
465
466 //-----------------------------------------------------
467 // k-fold cross validation
468 else
469 {
470 int *SubSet = new int[m_Samples_Model.Get_NRows()];
471
472 for(i=0; i<m_Samples_Model.Get_NRows(); i++)
473 {
474 SubSet[i] = i % nSubSamples;
475 }
476
477 //-------------------------------------------------
478 for(int iSubSet=0; iSubSet<nSubSamples && SG_UI_Process_Get_Okay(); iSubSet++)
479 {
480 CSG_Simple_Statistics Samples_Stats;
481 CSG_Matrix Samples(m_Samples_Model), Validation;
482
483 for(i=Samples.Get_NRows()-1; i>=0; i--)
484 {
485 if( SubSet[i] == iSubSet )
486 {
487 Validation.Add_Row(Samples.Get_Row(i));
488 Samples .Del_Row(i);
489 }
490 else
491 {
492 Samples_Stats += Samples[i][0];
493 }
494 }
495
496 //---------------------------------------------
497 if( Model.Get_Model(Samples) )
498 {
499 nModels++;
500
501 for(i=0; i<Validation.Get_NRows(); i++)
502 {
503 double dObsrv = Validation[i][0];
504 double dModel = Model.Get_Value(CSG_Vector(m_nPredictors, Validation[i] + 1));
505
506 SE += SG_Get_Square(dModel - dObsrv);
507 SR += SG_Get_Square(dModel - Samples_Stats.Get_Mean());
508 }
509 }
510 }
511
512 delete[](SubSet);
513 }
514
515 //-----------------------------------------------------
516 m_CV_RMSE = sqrt(SE.Get_Mean());
517 m_CV_NRMSE = sqrt(SE.Get_Mean()) / Stats.Get_Range();
518 m_CV_R2 = SR.Get_Sum() / (SR.Get_Sum() + SE.Get_Sum());
519 m_CV_nSamples = nModels;
520 */
521 //-----------------------------------------------------
522 return( true );
523 }
524
525
527 // //
528 // //
529 // //
531
532 //---------------------------------------------------------
CSG_Matrix::Get_Inverse
CSG_Matrix Get_Inverse(bool bSilent=true, int nSubSquare=0) const
Definition: mat_matrix.cpp:1845
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Matrix::Get_NCols
sLong Get_NCols(void) const
Definition: mat_tools.h:507
mat_tools.h
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Vector
Definition: mat_tools.h:345
CSG_Regression_Weighted::Get_CrossValidation
bool Get_CrossValidation(int nSubSamples=0)
Definition: mat_regression_weighted.cpp:425
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Square
double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
SG_is_NaN
#define SG_is_NaN(x)
Definition: api_core.h:168
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
CSG_Regression_Weighted::Set_Log_maxIter
bool Set_Log_maxIter(int maxIter)
Definition: mat_regression_weighted.cpp:235
CSG_Matrix::Get_Transpose
CSG_Matrix Get_Transpose(void) const
Definition: mat_matrix.cpp:1829
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
CSG_Regression_Weighted::Destroy
bool Destroy(void)
Definition: mat_regression_weighted.cpp:79
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
CSG_Regression_Weighted::Set_Log_Difference
bool Set_Log_Difference(double Difference)
Definition: mat_regression_weighted.cpp:261
CSG_Regression_Weighted::~CSG_Regression_Weighted
virtual ~CSG_Regression_Weighted(void)
Definition: mat_regression_weighted.cpp:73
CSG_Matrix::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:923
CSG_Matrix::Get_Row
CSG_Vector Get_Row(sLong Row) const
Definition: mat_matrix.cpp:1332
CSG_Regression_Weighted::Calculate
bool Calculate(const CSG_Vector &Weights, const CSG_Vector &Dependents, const CSG_Matrix &Predictors, bool bLogistic=false)
Definition: mat_regression_weighted.cpp:133
CSG_Regression_Weighted::CSG_Regression_Weighted
CSG_Regression_Weighted(void)
Definition: mat_regression_weighted.cpp:63
CSG_Matrix::Add_Row
bool Add_Row(const double *Data=NULL)
Definition: mat_matrix.cpp:1100
CSG_Regression_Weighted::Add_Sample
bool Add_Sample(double Weight, double Dependent, const CSG_Vector &Predictors)
Definition: mat_regression_weighted.cpp:97
CSG_Regression_Weighted::Set_Log_Epsilon
bool Set_Log_Epsilon(double Epsilon)
Definition: mat_regression_weighted.cpp:248
CSG_Matrix
Definition: mat_tools.h:463
CSG_Simple_Statistics
Definition: mat_tools.h:708
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_spline.cpp File Reference

  • saga_core
  • saga_api
mat_spline.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_spline.cpp Source File

  • saga_core
  • saga_api
mat_spline.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_spline.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "mat_tools.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Spline::CSG_Spline(void)
64 {
65 m_bCreated = false;
66 }
67
68 //---------------------------------------------------------
69 CSG_Spline::~CSG_Spline(void)
70 {
71 Destroy();
72 }
73
74
76 // //
78
79 //---------------------------------------------------------
80 void CSG_Spline::Destroy(void)
81 {
82 m_x.Destroy();
83 m_y.Destroy();
84 m_z.Destroy();
85
86 m_bCreated = false;
87 }
88
89 //---------------------------------------------------------
90 bool CSG_Spline::Create(double *xValues, double *yValues, int nValues, double yA, double yB)
91 {
92 Destroy();
93
94 for(int i=0; i<nValues; i++)
95 {
96 Add(xValues[i], yValues[i]);
97 }
98
99 return( _Create(yA, yB) );
100 }
101
102 //---------------------------------------------------------
103 bool CSG_Spline::Create(double yA, double yB)
104 {
105 return( _Create(yA, yB) );
106 }
107
108
110 // //
112
113 //---------------------------------------------------------
114 void CSG_Spline::Add(double x, double y)
115 {
116 m_bCreated = false;
117
118 m_x.Add_Row(x);
119 m_y.Add_Row(y);
120 }
121
122
124 // //
126
127 //---------------------------------------------------------
128 bool CSG_Spline::_Create(double yA, double yB)
129 {
130 if( Get_Count() < 3 )
131 {
132 return( false );
133 }
134
135 //-----------------------------------------------------
136 int i, k, n = Get_Count();
137 double p, qn, sig, un;
138 CSG_Vector u;
139
140 //-----------------------------------------------------
141 CSG_Index Index(n, m_x.Get_Data());
142 CSG_Vector x(m_x), y(m_y);
143
144 for(i=0; i<n; i++)
145 {
146 m_x[i] = x[Index[i]];
147 m_y[i] = y[Index[i]];
148 }
149
150 //-----------------------------------------------------
151 u .Create(n);
152 m_z.Create(n);
153
154 if( yA > 0.99e30 )
155 {
156 m_z[0] = u[0] = 0.;
157 }
158 else
159 {
160 m_z[0] = -0.5;
161 u [0] = (3. / (m_x[1] - m_x[0])) * ((m_y[1] - m_y[0]) / (m_x[1] - m_x[0]) - yA);
162 }
163
164 //-----------------------------------------------------
165 for(i=1; i<n-1; i++)
166 {
167 sig = (m_x[i] - m_x[i - 1]) / (m_x[i + 1] - m_x[i - 1]);
168 p = sig * m_z[i - 1] + 2.;
169 m_z[i] = (sig - 1.) / p;
170 u [i] = (m_y[i + 1] - m_y[i ]) / (m_x[i + 1] - m_x[i ])
171 - (m_y[i ] - m_y[i - 1]) / (m_x[i ] - m_x[i - 1]);
172 u [i] = (6. * u[i] / (m_x[i + 1] - m_x[i - 1]) - sig * u[i - 1]) / p;
173 }
174
175 if( yB > 0.99e30 )
176 {
177 qn = un = 0.;
178 }
179 else
180 {
181 qn = 0.5;
182 un = (3. / (m_x[n - 1] - m_x[n - 2]))
183 * (yB - (m_y[n - 1] - m_y[n - 2])
184 / (m_x[n - 1] - m_x[n - 2]));
185 }
186
187 m_z[n - 1] = (un - qn * u[n - 2]) / (qn * m_z[n - 2] + 1.);
188
189 for(k=n-2; k>=0; k--)
190 {
191 m_z[k] = m_z[k] * m_z[k + 1] + u[k];
192 }
193
194 //-----------------------------------------------------
195 m_bCreated = true;
196
197 return( true );
198 }
199
200
202 // //
204
205 //---------------------------------------------------------
206 bool CSG_Spline::Get_Value(double x, double &y)
207 {
208 if( m_bCreated || Create() )
209 {
210 int klo, khi, k;
211 double h, b, a;
212
213 klo = 0;
214 khi = Get_Count() - 1;
215
216 while( khi - klo > 1 )
217 {
218 k = (khi+klo) >> 1;
219
220 if( m_x[k] > x )
221 {
222 khi = k;
223 }
224 else
225 {
226 klo = k;
227 }
228 }
229
230 h = m_x[khi] - m_x[klo];
231
232 if( h != 0. )
233 {
234 a = (m_x[khi] - x) / h;
235 b = (x - m_x[klo]) / h;
236
237 y = a * m_y[klo] + b * m_y[khi]
238 + ((a*a*a - a) * m_z[klo] + (b*b*b - b) * m_z[khi]) * (h*h) / 6.;
239
240 return( true );
241 }
242 }
243
244 return( false );
245 }
246
247 //---------------------------------------------------------
248 double CSG_Spline::Get_Value(double x)
249 {
250 Get_Value(x, x);
251
252 return( x );
253 }
254
255
257 // //
258 // //
259 // //
261
262 //---------------------------------------------------------
263 //
264 // Based on:
265 //
266 // Thin Plate Spline demo/example in C++
267 // Copyright (C) 2003, 2005 by Jarno Elonen
268 //
269 // Permission to use, copy, modify, distribute and sell this software
270 // and its documentation for any purpose is hereby granted without fee,
271 // provided that the above copyright notice appear in all copies and
272 // that both that copyright notice and this permission notice appear
273 // in supporting documentation. The authors make no representations
274 // about the suitability of this software for any purpose.
275 // It is provided "as is" without express or implied warranty.
276 //
277 // Reference:
278 // - Donato, G., Belongie, S. (2002):
279 // 'Approximation Methods for Thin Plate Spline Mappings and Principal Warps'
280 //
281 //---------------------------------------------------------
282
284 // //
285 // //
286 // //
288
289 //---------------------------------------------------------
290 CSG_Thin_Plate_Spline::CSG_Thin_Plate_Spline(void)
291 {
292 }
293
294 //---------------------------------------------------------
295 CSG_Thin_Plate_Spline::~CSG_Thin_Plate_Spline(void)
296 {
297 Destroy();
298 }
299
300
302 // //
304
305 //---------------------------------------------------------
306 bool CSG_Thin_Plate_Spline::Destroy(void)
307 {
308 m_Points.Clear();
309 m_V.Destroy();
310
311 return( true );
312 }
313
314
316 // //
318
319 //---------------------------------------------------------
320 double CSG_Thin_Plate_Spline::_Get_hDistance(TSG_Point_3D A, TSG_Point_3D B)
321 {
322 A.x -= B.x;
323 A.y -= B.y;
324
325 return( sqrt(A.x*A.x + A.y*A.y) );
326 }
327
328 //---------------------------------------------------------
329 double CSG_Thin_Plate_Spline::_Get_Base_Funtion(double x)
330 {
331 return( x > 0. ? x*x * log(x) : 0. );
332 }
333
334 //---------------------------------------------------------
335 double CSG_Thin_Plate_Spline::_Get_Base_Funtion(TSG_Point_3D A, double x, double y)
336 {
337 x -= A.x;
338 y -= A.y;
339
340 double d = sqrt(x*x + y*y);
341
342 return( d > 0. ? d*d * log(d) : 0. );
343 }
344
345
347 // //
349
350 //---------------------------------------------------------
351 // Calculate Thin Plate Spline (TPS) weights from control points.
352 //
353 bool CSG_Thin_Plate_Spline::Create(double Regularization, bool bSilent)
354 {
355 sLong n = m_Points.Get_Count();
356
357 if( n < 3 ) // We need at least 3 points to define a plane
358 {
359 Destroy();
360
361 return( false );
362 }
363
364 CSG_Matrix M;
365
366 if( !M.Create(n + 3, n + 3) || !m_V.Create(n + 3) )
367 {
368 Destroy();
369
370 return( false );
371 }
372
373 //-----------------------------------------------------
374 // Fill K (n x n, upper left of L) and calculate
375 // mean edge length from control points
376 //
377 // K is symmetrical so we really have to
378 // calculate only about half of the coefficients.
379
380 double a = 0.;
381
382 for(sLong i=0; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); ++i)
383 {
384 TSG_Point_3D Point = m_Points[i];
385
386 for(sLong j=i+1; j<n; ++j)
387 {
388 double b = _Get_hDistance(Point, m_Points[j]); a += b * 2.; // same for upper & lower tri
389
390 M[i][j] = (M[j][i] = _Get_Base_Funtion(b));
391 }
392 }
393
394 a /= n*n;
395
396 //-------------------------------------------------
397 // Fill the rest of L
398
399 for(sLong i=0; i<n; ++i)
400 {
401 // P diagonal: reqularization parameters (lambda * a^2)
402 M[i][i] = Regularization * (a*a);
403
404 // P (n x 3, upper right), P transposed (3 x n, bottom left)
405 M[i][n + 0] = M[n + 0][i] = 1.;
406 M[i][n + 1] = M[n + 1][i] = m_Points[i].x;
407 M[i][n + 2] = M[n + 2][i] = m_Points[i].y;
408
409 // Fill the right hand vector m_V
410 m_V[i] = m_Points[i].z;
411 }
412
413 for(sLong i=n; i<n+3; ++i)
414 {
415 for(sLong j=n; j<n+3; ++j)
416 {
417 M[i][j] = 0.; // O (3 x 3, lower right)
418 }
419 }
420
421 m_V[n + 0] = m_V[n + 1] = m_V[n + 2] = 0.;
422
423 //-------------------------------------------------
424 // Solve the linear system "inplace"
425
426 if( !bSilent )
427 {
428 SG_UI_Process_Set_Text(_TL("Thin Plate Spline: solving matrix"));
429 }
430
431 if( !SG_Matrix_Solve(M, m_V, bSilent) )
432 {
433 Destroy();
434
435 return( false );
436 }
437
438 return( true );
439 }
440
441 //---------------------------------------------------------
442 double CSG_Thin_Plate_Spline::Get_Value(double x, double y)
443 {
444 if( m_V.Get_Size() > 0 )
445 {
446 sLong n = m_Points.Get_Count();
447 double z = m_V[n + 0] + m_V[n + 1] * x + m_V[n + 2] * y;
448
449 for(sLong i=0; i<n; i++)
450 {
451 z += m_V[i] * _Get_Base_Funtion(m_Points[i], x, y);
452 }
453
454 return( z );
455 }
456
457 return( 0. );
458 }
459
460
462 // //
463 // //
464 // //
466
467 //---------------------------------------------------------
CSG_Index
Definition: mat_tools.h:185
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Vector::Get_Data
double * Get_Data(void) const
Definition: mat_tools.h:369
A
#define A
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:336
CSG_Thin_Plate_Spline::Get_Value
double Get_Value(double x, double y)
Definition: mat_spline.cpp:442
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:326
CSG_Thin_Plate_Spline::Destroy
bool Destroy(void)
Definition: mat_spline.cpp:306
CSG_Spline::Create
bool Create(double *xValues, double *yValues, int nValues, double yA=1.0e30, double yB=1.0e30)
Definition: mat_spline.cpp:90
mat_tools.h
CSG_Spline::m_bCreated
bool m_bCreated
Definition: mat_tools.h:1423
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Vector
Definition: mat_tools.h:345
CSG_Thin_Plate_Spline::Create
bool Create(double Regularization=0., bool bSilent=true)
Definition: mat_spline.cpp:353
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Spline::Destroy
void Destroy(void)
Definition: mat_spline.cpp:80
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Spline::m_x
CSG_Vector m_x
Definition: mat_tools.h:1425
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
CSG_Spline::m_y
CSG_Vector m_y
Definition: mat_tools.h:1425
CSG_Spline::_Create
bool _Create(double yA, double yB)
Definition: mat_spline.cpp:128
SG_Matrix_Solve
bool SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
Definition: mat_matrix.cpp:1910
CSG_Spline::~CSG_Spline
virtual ~CSG_Spline(void)
Definition: mat_spline.cpp:69
CSG_Thin_Plate_Spline::CSG_Thin_Plate_Spline
CSG_Thin_Plate_Spline(void)
Definition: mat_spline.cpp:290
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
CSG_Spline::Get_Value
bool Get_Value(double x, double &y)
Definition: mat_spline.cpp:206
B
#define B
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Spline::CSG_Spline
CSG_Spline(void)
Definition: mat_spline.cpp:63
CSG_Spline::Add
void Add(double x, double y)
Definition: mat_spline.cpp:114
CSG_Spline::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1411
CSG_Matrix
Definition: mat_tools.h:463
CSG_Thin_Plate_Spline::~CSG_Thin_Plate_Spline
virtual ~CSG_Thin_Plate_Spline(void)
Definition: mat_spline.cpp:295
CSG_Spline::m_z
CSG_Vector m_z
Definition: mat_tools.h:1425
Generated on Thu Oct 5 2023 17:36:10 for SAGA API by doxygen 1.8.19


SAGA API: mat_tools.cpp File Reference

  • saga_core
  • saga_api
Functions
mat_tools.cpp File Reference
#include <time.h>
#include <cfloat>
#include "mat_tools.h"
#include "table.h"
#include "grid.h"
#include "grids.h"
#include "saga_api.h"

Go to the source code of this file.

Functions

double | SG_Get_Square (double Value)
double | SG_Get_Rounded (double Value, int Decimals)
double | SG_Get_Rounded_To_SignificantFigures (double Value, int Decimals)
int | SG_Get_Digit_Count (int Number)
CSG_String | SG_Get_Double_asString (double Number, int Width, int Precision, bool bScientific)
int | SG_Compare_Int (const void *a, const void *b)
int | SG_Compare_Double (const void *a, const void *b)
int | SG_Compare_Char_Ptr (const void *a, const void *b)
double | SG_Degree_To_Decimal (double Deg, double Min, double Sec)
void | SG_Decimal_To_Degree (double Value, double &Deg, double &Min, double &Sec)
CSG_Matrix | SG_Get_Correlation_Matrix (const CSG_Matrix &Values, bool bCovariances)

Function Documentation

◆ SG_Compare_Char_Ptr()

int SG_Compare_Char_Ptr | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 211 of file mat_tools.cpp.

◆ SG_Compare_Double()

int SG_Compare_Double | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 199 of file mat_tools.cpp.

Referenced by CSG_Simple_Statistics::Get_Gini(), CSG_Simple_Statistics::Get_Quantile(), and CSG_Vector::Sort().

◆ SG_Compare_Int()

int SG_Compare_Int | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 187 of file mat_tools.cpp.

◆ SG_Decimal_To_Degree()

void SG_Decimal_To_Degree | ( | double | Value,
 |  | double & | Deg,
 |  | double & | Min,
 |  | double & | Sec
 | ) |  |

Definition at line 233 of file mat_tools.cpp.

◆ SG_Degree_To_Decimal()

double SG_Degree_To_Decimal | ( | double | Deg,
 |  | double | Min,
 |  | double | Sec
 | ) |  |

Definition at line 224 of file mat_tools.cpp.

◆ SG_Get_Correlation_Matrix()

CSG_Matrix SG_Get_Correlation_Matrix | ( | const CSG_Matrix & | Values,
 |  | bool | bCovariances
 | ) |  |

Definition at line 3473 of file mat_tools.cpp.

References C, CSG_Simple_Statistics::Get_Mean(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), and CSG_Simple_Statistics::Get_StdDev().

Referenced by CSG_Regression_Multiple::_Get_Regression().

◆ SG_Get_Digit_Count()

int SG_Get_Digit_Count ( int Number )

Definition at line 144 of file mat_tools.cpp.

Referenced by CSG_Matrix::to_String().

◆ SG_Get_Double_asString()

CSG_String SG_Get_Double_asString | ( | double | Number,
 |  | int | Width,
 |  | int | Precision,
 |  | bool | bScientific
 | ) |  |

Definition at line 159 of file mat_tools.cpp.

References CSG_String::Format().

Referenced by CSG_Vector::to_String(), and CSG_Matrix::to_String().

◆ SG_Get_Rounded()

double SG_Get_Rounded | ( | double | Value,
 |  | int | Decimals
 | ) |  |

Definition at line 83 of file mat_tools.cpp.

Referenced by CSG_Grid_System::Create().

◆ SG_Get_Rounded_To_SignificantFigures()

double SG_Get_Rounded_To_SignificantFigures | ( | double | Value,
 |  | int | Decimals
 | ) |  |

Definition at line 107 of file mat_tools.cpp.

Referenced by CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ SG_Get_Square()

double SG_Get_Square ( double Value )

Definition at line 70 of file mat_tools.cpp.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Weighted::Calculate(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Trend::Get_Trend(), CSG_Trend_Polynom::Get_Trend(), and SG_Get_Distance_Polar().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_tools.cpp Source File

  • saga_core
  • saga_api
mat_tools.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_tools.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <time.h>
54 #include <cfloat>
55
56 #include "mat_tools.h"
57
58 #include "table.h"
59 #include "grid.h"
60 #include "grids.h"
61
62
64 // //
65 // //
66 // //
68
69 //---------------------------------------------------------
70 double SG_Get_Square(double Value)
71 {
72 return( Value * Value );
73 }
74
75
77 // //
78 // //
79 // //
81
82 //---------------------------------------------------------
83 double SG_Get_Rounded(double Value, int Decimals)
84 {
85 if( Decimals < 0 )
86 {
87 return( Value );
88 }
89
90 if( Decimals == 0 )
91 {
92 return( floor(0.5 + Value) );
93 }
94
95 double d = pow(10., Decimals);
96 double v = Value * d;
97
98 if( fabs(v - floor(v)) > 0. )
99 {
100 return( floor(0.5 + v) / d );
101 }
102
103 return( Value );
104 }
105
106 //---------------------------------------------------------
107 double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
108 {
109 if( Decimals <= 0 || Value == 0. )
110 {
111 return( (int)(0.5 + Value) );
112 }
113
114 Decimals = (int)(-(ceil(log10(fabs(Value))) - Decimals));
115
116 if( Decimals > 0 )
117 {
118 double d = pow(10., Decimals);
119
120 return( Value < 0.
121 ? -((int)(0.5 - Value * d)) / d
122 : ((int)(0.5 + Value * d)) / d
123 );
124 }
125 else
126 {
127 double d = pow(10., -Decimals);
128
129 return( Value < 0.
130 ? -((int)(0.5 - Value / d)) * d
131 : ((int)(0.5 + Value / d)) * d
132 );
133 }
134 }
135
136
138 // //
139 // //
140 // //
142
143 //---------------------------------------------------------
144 int SG_Get_Digit_Count(int Number)
145 {
146 Number = abs(Number);
147
148 return( Number < 10 ? 1 : 1 + (int)log10((double)Number) );
149 }
150
151
153 // //
154 // //
155 // //
157
158 //---------------------------------------------------------
159 CSG_String SG_Get_Double_asString(double Number, int Width, int Precision, bool bScientific)
160 {
161 if( bScientific )
162 {
163 if( Width > 0 && Precision >= 0 ) return( CSG_String::Format("%*.*e", Width, Precision, Number) );
164 if( Width > 0 ) return( CSG_String::Format("%*e" , Width , Number) );
165 if( Precision >= 0 ) return( CSG_String::Format("%.*e" , Precision, Number) );
166
167 return( CSG_String::Format("%e", Number) );
168 }
169 else
170 {
171 if( Width > 0 && Precision >= 0 ) return( CSG_String::Format("%*.*f", Width, Precision, Number) );
172 if( Width > 0 ) return( CSG_String::Format("%*f" , Width , Number) );
173 if( Precision >= 0 ) return( CSG_String::Format("%.*f" , Precision, Number) );
174
175 return( CSG_String::Format("%f", Number) );
176 }
177 }
178
179
181 // //
182 // //
183 // //
185
186 //---------------------------------------------------------
187 int SG_Compare_Int(const void *a, const void *b)
188 {
189 if( *((int *)a) < *((int *)b) )
190 return( -1 );
191
192 if( *((int *)a) > *((int *)b) )
193 return( 1 );
194
195 return( 0 );
196 }
197
198 //---------------------------------------------------------
199 int SG_Compare_Double(const void *a, const void *b)
200 {
201 if( *((double *)a) < *((double *)b) )
202 return( -1 );
203
204 if( *((double *)a) > *((double *)b) )
205 return( 1 );
206
207 return( 0 );
208 }
209
210 //---------------------------------------------------------
211 int SG_Compare_Char_Ptr(const void *a, const void *b)
212 {
213 return( strcmp((const char *)a, (const char *)b) );
214 }
215
216
218 // //
219 // //
220 // //
222
223 //---------------------------------------------------------
224 double SG_Degree_To_Decimal(double Deg, double Min, double Sec)
225 {
226 return( Deg > 0.
227 ? (Deg + Min / 60. + Sec / 3600.)
228 : (Deg - Min / 60. - Sec / 3600.)
229 );
230 }
231
232 //---------------------------------------------------------
233 void SG_Decimal_To_Degree(double Value, double &Deg, double &Min, double &Sec)
234 {
235 Sec = fmod(Value < 0. ? -Value : Value, 360.);
236
237 Deg = (int)Sec; Sec = 60. * (Sec - Deg);
238 Min = (int)Sec; Sec = 60. * (Sec - Min);
239
240 if( Value < 0. )
241 {
242 Deg = -Deg;
243 }
244 }
245
246
248 // //
249 // //
250 // //
252
253 //---------------------------------------------------------
254 CSG_Random::CSG_Random(void)
255 {
256 Initialize();
257 }
258
259 //---------------------------------------------------------
260 void CSG_Random::Initialize(void)
261 {
262 Initialize((unsigned)time(NULL));
263 }
264
265 //---------------------------------------------------------
266 void CSG_Random::Initialize(unsigned int Value)
267 {
268 srand(Value);
269 }
270
271 //---------------------------------------------------------
272 // Uniform distributed pseudo-random numbers in the range from 0 to 1.
273 //
274 double CSG_Random::Get_Uniform(void)
275 {
276 return( 1. * rand() / (double)RAND_MAX );
277 }
278
279 //---------------------------------------------------------
280 // Uniform distributed pseudo-random numbers in the range from min to max.
281 //
282 double CSG_Random::Get_Uniform(double min, double max)
283 {
284 return( min + (max - min) * rand() / (double)RAND_MAX );
285 }
286
287 //---------------------------------------------------------
288 // Generating Gaussian pseudo-random numbers using
289 // the polar form of the Box-Muller transformation.
290 //
291 // Box, G.E.P, Muller, M.E. (1958):
292 // 'A note on the generation of random normal deviates',
293 // Annals Math. Stat, V. 29, pp. 610-611
294 //
295 // Link: http://www.taygeta.com/random/gaussian.html
296 //
297 //---------------------------------------------------------
298 double CSG_Random::Get_Gaussian(double mean, double stddev)
299 {
300 double x1, x2, w;
301
302 do
303 {
304 x1 = 2. * Get_Uniform() - 1.;
305 x2 = 2. * Get_Uniform() - 1.;
306
307 w = x1 * x1 + x2 * x2;
308 }
309 while( w >= 1. );
310
311 w = sqrt((-2. * log(w)) / w);
312
313 return( mean + stddev * x1 * w );
314 }
315
316
318 // //
319 // //
320 // //
322
323 //---------------------------------------------------------
324 CSG_Simple_Statistics::CSG_Simple_Statistics(void)
325 {
326 Create(false);
327 }
328
329 CSG_Simple_Statistics::CSG_Simple_Statistics(bool bHoldValues)
330 {
331 Create(bHoldValues);
332 }
333
334 CSG_Simple_Statistics::CSG_Simple_Statistics(const CSG_Simple_Statistics &Statistics)
335 {
336 Create(Statistics);
337 }
338
339 CSG_Simple_Statistics::CSG_Simple_Statistics(double Mean, double StdDev, sLong Count)
340 {
341 Create(Mean, StdDev, Count);
342 }
343
344 CSG_Simple_Statistics::CSG_Simple_Statistics(const CSG_Vector &Values, bool bHoldValues)
345 {
346 Create(Values, bHoldValues);
347 }
348
349 //---------------------------------------------------------
350 bool CSG_Simple_Statistics::Create(bool bHoldValues)
351 {
352 Invalidate();
353
354 m_Values.Create(bHoldValues ? sizeof(double) : 0, 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
355
356 return( true );
357 }
358
359 bool CSG_Simple_Statistics::Create(const CSG_Simple_Statistics &Statistics)
360 {
361 m_bEvaluated = Statistics.m_bEvaluated;
362
363 m_nValues = Statistics.m_nValues;
364 m_Weights = Statistics.m_Weights;
365 m_Sum = Statistics.m_Sum;
366 m_Sum2 = Statistics.m_Sum2;
367
368 m_Minimum = Statistics.m_Minimum;
369 m_Maximum = Statistics.m_Maximum;
370 m_Range = Statistics.m_Range;
371 m_Mean = Statistics.m_Mean;
372 m_Variance = Statistics.m_Variance;
373 m_StdDev = Statistics.m_StdDev;
374
375 m_Kurtosis = Statistics.m_Kurtosis;
376 m_Skewness = Statistics.m_Skewness;
377
378 m_Gini = Statistics.m_Gini;
379
380 m_bSorted = Statistics.m_bSorted;
381 m_Values .Create(Statistics.m_Values);
382
383 return( true );
384 }
385
386 bool CSG_Simple_Statistics::Create(double Mean, double StdDev, sLong Count)
387 {
388 Invalidate();
389
390 m_bEvaluated = 1;
391
392 m_Mean = Mean;
393 m_StdDev = StdDev;
394 m_Variance = StdDev*StdDev;
395 m_nValues = Count;
396 m_Weights = (double)Count;
397
398 m_Sum = m_Weights * m_Mean;
399 m_Sum2 = m_Weights * (m_Mean*m_Mean + m_Variance);
400
401 m_Minimum = m_Mean - 1.5 * m_StdDev;
402 m_Maximum = m_Mean + 1.5 * m_StdDev;
403 m_Range = m_Maximum - m_Minimum;
404
405 return( true );
406 }
407
408 bool CSG_Simple_Statistics::Create(const CSG_Vector &Values, bool bHoldValues)
409 {
410 if( Create(bHoldValues) )
411 {
412 for(sLong i=0; i<Values.Get_Size(); i++)
413 {
414 Add_Value(Values[i]);
415 }
416
417 return( true );
418 }
419
420 return( false );
421 }
422
423 //---------------------------------------------------------
424 bool CSG_Simple_Statistics::Set_Count(sLong nValues)
425 {
426 if( m_nValues < 1 || nValues < 1 || m_nValues == nValues )
427 {
428 return( false );
429 }
430
431 double Scale = nValues / (double)m_nValues;
432
433 m_Weights *= Scale;
434 m_Sum *= Scale;
435 m_Sum2 *= Scale;
436
437 m_nValues = nValues;
438
439 m_bEvaluated = 0;
440
441 m_Values.Destroy();
442
443 return( true );
444 }
445
446 //---------------------------------------------------------
447 void CSG_Simple_Statistics::Invalidate(void)
448 {
449 m_bEvaluated = 0;
450
451 m_nValues = 0;
452 m_Weights = 0.;
453 m_Sum = 0.;
454 m_Sum2 = 0.;
455
456 m_Minimum = 0.;
457 m_Maximum = 0.;
458 m_Range = 0.;
459 m_Mean = 0.;
460 m_Variance = 0.;
461 m_StdDev = 0.;
462
463 m_Kurtosis = 0.;
464 m_Skewness = 0.;
465
466 m_Gini = -1.;
467
468 m_bSorted = false;
469 m_Values .Destroy();
470 }
471
472 //---------------------------------------------------------
473 bool CSG_Simple_Statistics::Evaluate(void)
474 {
475 _Evaluate();
476
477 return( is_Evaluated() > 0 );
478 }
479
480 //---------------------------------------------------------
481 void CSG_Simple_Statistics::Add(const CSG_Simple_Statistics &Statistics)
482 {
483 if( Statistics.m_nValues <= 0 )
484 {
485 return;
486 }
487
488 if( m_nValues == 0 )
489 {
490 Create(Statistics);
491
492 return;
493 }
494
495 //--------------------------------------------------------
496 if( (sLong)m_Values.Get_Size() == m_nValues && (sLong)Statistics.m_Values.Get_Size() == Statistics.m_nValues && m_Values.Set_Array((size_t)(m_nValues + Statistics.m_nValues)) )
497 {
498 for(sLong i=0, j=m_nValues; i<Statistics.m_nValues; i++, j++)
499 {
500 ((double *)m_Values.Get_Array())[j] = Statistics.Get_Value(i);
501 }
502 }
503 else
504 {
505 m_Values.Destroy();
506 }
507
508 m_nValues += Statistics.m_nValues;
509 m_Weights += Statistics.m_Weights;
510 m_Sum += Statistics.m_Sum;
511 m_Sum2 += Statistics.m_Sum2;
512
513 if( m_Minimum > Statistics.m_Minimum )
514 m_Minimum = Statistics.m_Minimum;
515
516 if( m_Maximum < Statistics.m_Maximum )
517 m_Maximum = Statistics.m_Maximum;
518
519 m_Kurtosis = 0.;
520 m_Skewness = 0.;
521
522 m_bEvaluated = 0;
523 m_bSorted = false;
524 }
525
526 //---------------------------------------------------------
527 void CSG_Simple_Statistics::Add_Value(double Value, double Weight)
528 {
529 if( m_nValues == 0 )
530 {
531 m_Minimum = m_Maximum = Value;
532 }
533 else if( m_Minimum > Value )
534 {
535 m_Minimum = Value;
536 }
537 else if( m_Maximum < Value )
538 {
539 m_Maximum = Value;
540 }
541
542 if( Weight > 0. )
543 {
544 m_Weights += Weight;
545 m_Sum += Weight * Value;
546 m_Sum2 += Weight * Value*Value;
547
548 m_bEvaluated = 0;
549
550 if( m_Values.Get_Value_Size() > 0 && m_Values.Inc_Array() )
551 {
552 m_bSorted = false;
553
554 ((double *)m_Values.Get_Array())[m_nValues] = Value;
555 }
556
557 m_nValues++;
558 }
559 }
560
561 //---------------------------------------------------------
562 void CSG_Simple_Statistics::_Evaluate(int Level)
563 {
564 if( m_bEvaluated == 0 && m_Weights > 0. )
565 {
566 m_bEvaluated = 1;
567
568 m_Range = m_Maximum - m_Minimum;
569 m_Mean = m_Sum / m_Weights;
570 m_Variance = m_Sum2 / m_Weights - m_Mean*m_Mean;
571 m_StdDev = m_Variance > 0. ? sqrt(m_Variance) : 0.;
572 }
573
574 //-----------------------------------------------------
575 if( m_bEvaluated == 1 && Level > 1 )
576 {
577 m_bEvaluated = 2;
578
579 m_Kurtosis = 0.;
580 m_Skewness = 0.;
581
582 if( Get_StdDev() > 0. && m_Values.Get_Size() > 0 )
583 {
584 for(sLong i=0; i<Get_Count(); i++)
585 {
586 double d = (Get_Value(i) - Get_Mean()) / Get_StdDev();
587
588 m_Kurtosis += d*d*d*d;
589 m_Skewness += d*d*d;
590 }
591
592 m_Kurtosis /= Get_Count();
593 m_Skewness /= Get_Count();
594 // m_Skewness *= Get_Count() / ((Get_Count() - 1) * (Get_Count() - 2));
595 }
596 }
597 }
598
599 //---------------------------------------------------------
606 double CSG_Simple_Statistics::Get_SkewnessPearson(void)
607 {
608 return( Get_StdDev() != 0. ? (Get_Mean() - Get_Median()) / Get_StdDev() : 0. );
609 }
610
611 //---------------------------------------------------------
618 double CSG_Simple_Statistics::Get_Quantile(double Quantile)
619 {
620 if( m_Values.Get_Size() < 1 )
621 {
622 return( m_Mean );
623 }
624
625 //-----------------------------------------------------
626 if( !m_bSorted )
627 {
628 qsort(m_Values.Get_Array(), m_Values.Get_Size(), sizeof(double), SG_Compare_Double);
629
630 m_bSorted = true;
631 }
632
633 if( Quantile <= 0. || m_Values.Get_Size() == 1 )
634 {
635 return( Get_Values()[0] );
636 }
637
638 if( Quantile >= 1. )
639 {
640 return( Get_Values()[m_Values.Get_Size() - 1] );
641 }
642
643 //-----------------------------------------------------
644 double r = Quantile * (m_Values.Get_Size() - 1);
645
646 sLong i = (sLong)r; r -= i;
647
648 return( r == 0. ? Get_Values()[i] : ((1. - r) * Get_Values()[i] + r * Get_Values()[i + 1]) );
649 }
650
651 //---------------------------------------------------------
658 double CSG_Simple_Statistics::Get_Percentile(double Percentile)
659 {
660 return( Get_Quantile(Percentile / 100.) );
661 }
662
663 //---------------------------------------------------------
669 double CSG_Simple_Statistics::Get_Median(void)
670 {
671 return( Get_Quantile(0.5) );
672 }
673
674 //---------------------------------------------------------
681 double CSG_Simple_Statistics::Get_Gini(void)
682 {
683 if( m_Gini < 0. && m_Values.Get_Size() > 1 )
684 {
685 if( !m_bSorted )
686 {
687 qsort(m_Values.Get_Array(), m_Values.Get_Size(), sizeof(double), SG_Compare_Double);
688
689 m_bSorted = true;
690 }
691
692 m_Gini = 0.;
693
694 for(sLong i=0; i<Get_Count(); i++)
695 {
696 m_Gini += (i + 1.) * Get_Value(i);
697 }
698
699 m_Gini = 2. * m_Gini / (Get_Count() * Get_Sum()) - (Get_Count() + 1.) / Get_Count();
700 }
701
702 return( m_Gini );
703 }
704
705 //---------------------------------------------------------
710 sLong CSG_Simple_Statistics::Get_IndexOfMinimum(void)
711 {
712 if( m_Values.Get_Size() == 0 ) { return( -1 ); }
713
714 size_t Index = 0;
715 double Value = Get_Values()[Index];
716
717 for(size_t i=1; i<(size_t)m_Values.Get_Size(); i++)
718 {
719 if( Value > Get_Values()[i] )
720 {
721 Index = i;
722 Value = Get_Values()[i];
723 }
724 }
725
726 return( (sLong)Index );
727 }
728
729 //---------------------------------------------------------
734 sLong CSG_Simple_Statistics::Get_IndexOfMaximum(void)
735 {
736 if( m_Values.Get_Size() == 0 ) { return( -1 ); }
737
738 size_t Index = 0;
739 double Value = Get_Values()[Index];
740
741 for(size_t i=1; i<(size_t)m_Values.Get_Size(); i++)
742 {
743 if( Value < Get_Values()[i] )
744 {
745 Index = i;
746 Value = Get_Values()[i];
747 }
748 }
749
750 return( (sLong)Index );
751 }
752
753 //---------------------------------------------------------
758 sLong CSG_Simple_Statistics::Get_nValues_Above(double Threshold, bool bEquals)
759 {
760 if( m_Values.Get_Size() == 0 ) { return( -1 ); }
761
762 sLong n = 0;
763
764 for(sLong i=0; i<Get_Count(); i++)
765 {
766 if( (bEquals && Get_Value(i) >= Threshold) || Get_Value(i) > Threshold )
767 {
768 n++;
769 }
770 }
771
772 return( n );
773 }
774
775 //---------------------------------------------------------
780 sLong CSG_Simple_Statistics::Get_nValues_Below(double Threshold, bool bEquals)
781 {
782 if( m_Values.Get_Size() == 0 ) { return( -1 ); }
783
784 sLong n = 0;
785
786 for(sLong i=0; i<Get_Count(); i++)
787 {
788 if( (bEquals && Get_Value(i) <= Threshold) || Get_Value(i) < Threshold )
789 {
790 n++;
791 }
792 }
793
794 return( n );
795 }
796
797
799 // //
800 // //
801 // //
803
804 //---------------------------------------------------------
805 int CSG_Unique_Value_Statistics::Get_Majority(bool bWeighted) const
806 {
807 int Index = 0;
808
809 bWeighted = bWeighted && m_bWeights;
810
811 for(int i=1; i<Get_Count(); i++)
812 {
813 if( bWeighted )
814 {
815 if( m_Weight[i] > m_Weight[Index] )
816 {
817 Index = i;
818 }
819 }
820 else
821 {
822 if( m_Count[i] > m_Count[Index] )
823 {
824 Index = i;
825 }
826 }
827 }
828
829 return( Index );
830 }
831
832 //---------------------------------------------------------
833 int CSG_Unique_Value_Statistics::Get_Minority(bool bWeighted) const
834 {
835 int Index = 0;
836
837 bWeighted = bWeighted && m_bWeights;
838
839 for(int i=1; i<Get_Count(); i++)
840 {
841 if( bWeighted )
842 {
843 if( m_Weight[i] < m_Weight[Index] )
844 {
845 Index = i;
846 }
847 }
848 else
849 {
850 if( m_Count[i] < m_Count[Index] )
851 {
852 Index = i;
853 }
854 }
855 }
856
857 return( Index );
858 }
859
860
862 // //
864
865 //---------------------------------------------------------
866 void CSG_Unique_Number_Statistics::Create(bool bWeights)
867 {
868 m_bWeights = bWeights;
869
870 m_Count.Destroy();
871 m_Value.Destroy();
872 }
873
874 //---------------------------------------------------------
875 void CSG_Unique_Number_Statistics::Add_Value(double Value, double Weight)
876 {
877 for(int i=0; i<Get_Count(); i++)
878 {
879 if( Value == m_Value[i] )
880 {
881 m_Count[i]++;
882
883 if( m_bWeights && Weight > 0. )
884 {
885 m_Weight[i] += Weight;
886 }
887
888 return;
889 }
890 }
891
892 m_Count.Add(1);
893 m_Value.Add_Row(Value);
894
895 if( m_bWeights && Weight > 0. )
896 {
897 m_Weight.Add_Row(Weight);
898 }
899 }
900
901 //---------------------------------------------------------
902 int CSG_Unique_Number_Statistics::Get_Class_Index(double Value) const
903 {
904 for(int i=0; i<Get_Count(); i++)
905 {
906 if( Value == m_Value[i] )
907 {
908 return( i );
909 }
910 }
911
912 return( -1 );
913 }
914
915
917 // //
919
920 //---------------------------------------------------------
921 void CSG_Unique_String_Statistics::Create(bool bWeights)
922 {
923 m_bWeights = bWeights;
924
925 m_Count.Destroy();
926 m_Value.Clear();
927 }
928
929 //---------------------------------------------------------
930 void CSG_Unique_String_Statistics::Add_Value(const CSG_String &Value, double Weight)
931 {
932 for(int i=0; i<Get_Count(); i++)
933 {
934 if( Value.Cmp(m_Value[i]) == 0 )
935 {
936 m_Count[i]++;
937
938 if( m_bWeights && Weight > 0. )
939 {
940 m_Weight[i] += Weight;
941 }
942
943 return;
944 }
945 }
946
947 m_Count.Add(1);
948 m_Value.Add(Value);
949
950 if( m_bWeights && Weight > 0. )
951 {
952 m_Weight.Add_Row(Weight);
953 }
954 }
955
956 //---------------------------------------------------------
957 int CSG_Unique_String_Statistics::Get_Class_Index(const CSG_String &Value) const
958 {
959 for(int i=0; i<Get_Count(); i++)
960 {
961 if( Value.Cmp(m_Value[i]) == 0 )
962 {
963 return( i );
964 }
965 }
966
967 return( -1 );
968 }
969
970
972 // //
973 // //
974 // //
976
977 //---------------------------------------------------------
978 CSG_Category_Statistics::CSG_Category_Statistics(TSG_Data_Type Type)
979 {
980 m_pTable = new CSG_Table;
981
982 Create(Type);
983 }
984
985 //---------------------------------------------------------
986 CSG_Category_Statistics::~CSG_Category_Statistics(void)
987 {
988 delete(m_pTable);
989 }
990
991 //---------------------------------------------------------
992 void CSG_Category_Statistics::Create(TSG_Data_Type Type)
993 {
994 m_pTable->Destroy();
995
996 m_pTable->Add_Field("VALUE", Type);
997 m_pTable->Add_Field("COUNT", SG_DATATYPE_ULong);
998 }
999
1000 //---------------------------------------------------------
1001 void CSG_Category_Statistics::Destroy(void)
1002 {
1003 m_pTable->Del_Records();
1004 }
1005
1006 //---------------------------------------------------------
1007 TSG_Data_Type CSG_Category_Statistics::Get_Category_Type(void) const
1008 {
1009 return( m_pTable->Get_Field_Type(0) );
1010 }
1011
1012
1014 // //
1016
1017 //---------------------------------------------------------
1018 int CSG_Category_Statistics::Get_Category(int Value) const
1019 {
1020 CSG_Table_Record *pRecord = m_pTable->Find_Record(0, Value, m_pTable->Get_Count() > 10);
1021
1022 return( pRecord ? (int)pRecord->Get_Index() : -1);
1023 }
1024
1025 //---------------------------------------------------------
1026 int CSG_Category_Statistics::Get_Category(double Value) const
1027 {
1028 CSG_Table_Record *pRecord = m_pTable->Find_Record(0, Value, m_pTable->Get_Count() > 10);
1029
1030 return( pRecord ? (int)pRecord->Get_Index() : -1);
1031 }
1032
1033 //---------------------------------------------------------
1034 int CSG_Category_Statistics::Get_Category(const CSG_String &Value) const
1035 {
1036 CSG_Table_Record *pRecord = m_pTable->Find_Record(0, Value, m_pTable->Get_Count() > 10);
1037
1038 return( pRecord ? (int)pRecord->Get_Index() : -1);
1039 }
1040
1041
1043 // //
1045
1046 //---------------------------------------------------------
1047 int CSG_Category_Statistics::Add_Value(int Value)
1048 {
1049 int i = Get_Category(Value);
1050
1051 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1052
1053 if( !pRecord )
1054 {
1055 i = (int)m_pTable->Get_Count();
1056
1057 (pRecord = m_pTable->Add_Record())->Set_Value(0, Value);
1058 }
1059
1060 pRecord->Add_Value(1, 1);
1061
1062 return( i );
1063 }
1064
1065 //---------------------------------------------------------
1066 int CSG_Category_Statistics::Add_Value(double Value)
1067 {
1068 int i = Get_Category(Value);
1069
1070 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1071
1072 if( !pRecord )
1073 {
1074 i = (int)m_pTable->Get_Count();
1075
1076 (pRecord = m_pTable->Add_Record())->Set_Value(0, Value);
1077 }
1078
1079 pRecord->Add_Value(1, 1);
1080
1081 return( i );
1082 }
1083
1084 //---------------------------------------------------------
1085 int CSG_Category_Statistics::Add_Value(const CSG_String &Value)
1086 {
1087 int i = Get_Category(Value);
1088
1089 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1090
1091 if( !pRecord )
1092 {
1093 i = (int)m_pTable->Get_Count();
1094
1095 (pRecord = m_pTable->Add_Record())->Set_Value(0, Value);
1096 }
1097
1098 pRecord->Add_Value(1, 1);
1099
1100 return( i );
1101 }
1102
1103 //---------------------------------------------------------
1104 // sort categories ascending
1105 bool CSG_Category_Statistics::Sort(void)
1106 {
1107 return( m_pTable->Set_Index(0, TABLE_INDEX_Ascending) );
1108 }
1109
1110
1112 // //
1114
1115 //---------------------------------------------------------
1116 // returns the number of categories.
1117 int CSG_Category_Statistics::Get_Count(void) const
1118 {
1119 return( (int)m_pTable->Get_Count() );
1120 }
1121
1122 //---------------------------------------------------------
1123 // returns the number of observations for the i'th category.
1124 int CSG_Category_Statistics::Get_Count(int i) const
1125 {
1126 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1127
1128 return( pRecord ? pRecord->asInt(1) : 0 );
1129 }
1130
1131 //---------------------------------------------------------
1132 int CSG_Category_Statistics::asInt(int i) const
1133 {
1134 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1135
1136 return( pRecord ? pRecord->asInt(0) : 0 );
1137 }
1138
1139 //---------------------------------------------------------
1140 double CSG_Category_Statistics::asDouble(int i) const
1141 {
1142 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1143
1144 return( pRecord ? pRecord->asDouble(0) : 0 );
1145 }
1146
1147 //---------------------------------------------------------
1148 CSG_String CSG_Category_Statistics::asString(int i) const
1149 {
1150 CSG_Table_Record *pRecord = m_pTable->Get_Record_byIndex(i);
1151
1152 return( pRecord ? pRecord->asString(0) : SG_T("") );
1153 }
1154
1155
1157 // //
1159
1160 //---------------------------------------------------------
1161 int CSG_Category_Statistics::Get_Majority(void)
1162 {
1163 if( m_pTable->Get_Count() > 0 )
1164 {
1165 int Index = 0, Count = m_pTable->Get_Record_byIndex(0)->asInt(1);
1166
1167 for(int i=1; i<m_pTable->Get_Count(); i++)
1168 {
1169 if( Count < m_pTable->Get_Record_byIndex(i)->asInt(1) )
1170 {
1171 Index = i;
1172 Count = m_pTable->Get_Record_byIndex(i)->asInt(1);
1173 }
1174 }
1175
1176 return( Index );
1177 }
1178
1179 return( -1 );
1180 }
1181
1182 //---------------------------------------------------------
1183 int CSG_Category_Statistics::Get_Minority(void)
1184 {
1185 if( m_pTable->Get_Count() > 0 )
1186 {
1187 int Index = 0, Count = m_pTable->Get_Record_byIndex(0)->asInt(1);
1188
1189 for(int i=1; i<m_pTable->Get_Count(); i++)
1190 {
1191 if( Count > m_pTable->Get_Record_byIndex(i)->asInt(1) )
1192 {
1193 Index = i;
1194 Count = m_pTable->Get_Record_byIndex(i)->asInt(1);
1195 }
1196 }
1197
1198 return( Index );
1199 }
1200
1201 return( -1 );
1202 }
1203
1204
1206 // //
1207 // //
1208 // //
1210
1211 //---------------------------------------------------------
1212 CSG_Histogram::CSG_Histogram(void)
1213 {
1214 _On_Construction();
1215 }
1216
1217 //---------------------------------------------------------
1218 CSG_Histogram::CSG_Histogram(const CSG_Histogram &Histogram)
1219 {
1220 _On_Construction();
1221
1222 Create(Histogram);
1223 }
1224
1225 //---------------------------------------------------------
1226 CSG_Histogram::CSG_Histogram(size_t nClasses, double Minimum, double Maximum)
1227 {
1228 _On_Construction();
1229
1230 Create(nClasses, Minimum, Maximum);
1231 }
1232
1233 //---------------------------------------------------------
1234 CSG_Histogram::CSG_Histogram(size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples)
1235 {
1236 _On_Construction();
1237
1238 Create(nClasses, Minimum, Maximum, Values, maxSamples);
1239 }
1240
1241 //---------------------------------------------------------
1242 CSG_Histogram::CSG_Histogram(size_t nClasses, double Minimum, double Maximum, CSG_Table *pTable, int Field, size_t maxSamples)
1243 {
1244 _On_Construction();
1245
1246 Create(nClasses, Minimum, Maximum, pTable, Field, maxSamples);
1247 }
1248
1249 //---------------------------------------------------------
1250 CSG_Histogram::CSG_Histogram(size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid, size_t maxSamples)
1251 {
1252 _On_Construction();
1253
1254 Create(nClasses, Minimum, Maximum, pGrid, maxSamples);
1255 }
1256
1257 //---------------------------------------------------------
1258 CSG_Histogram::CSG_Histogram(size_t nClasses, double Minimum, double Maximum, CSG_Grids *pGrids, size_t maxSamples)
1259 {
1260 _On_Construction();
1261
1262 Create(nClasses, Minimum, Maximum, pGrids, maxSamples);
1263 }
1264
1265 //---------------------------------------------------------
1266 CSG_Histogram::~CSG_Histogram(void)
1267 {
1268 Destroy();
1269 }
1270
1271 //---------------------------------------------------------
1272 bool CSG_Histogram::Destroy(void)
1273 {
1274 m_Statistics.Create();
1275
1276 SG_FREE_SAFE(m_Elements );
1277 SG_FREE_SAFE(m_Cumulative);
1278
1279 _On_Construction();
1280
1281 return( true );
1282 }
1283
1284
1286 // //
1288
1289 //---------------------------------------------------------
1290 void CSG_Histogram::_On_Construction(void)
1291 {
1292 m_nClasses = 0;
1293 m_Elements = NULL;
1294 m_Cumulative = NULL;
1295 m_Minimum = 0.;
1296 m_Maximum = 0.;
1297 m_ClassWidth = 1.;
1298 }
1299
1300 //---------------------------------------------------------
1301 bool CSG_Histogram::_Create(size_t nClasses, double Minimum, double Maximum)
1302 {
1303 if( nClasses > 0 && Minimum < Maximum )
1304 {
1305 Destroy();
1306
1307 m_Elements = (size_t *)SG_Calloc(nClasses, sizeof(size_t));
1308 m_Cumulative = (size_t *)SG_Calloc(nClasses, sizeof(size_t));
1309
1310 if( m_Elements && m_Cumulative )
1311 {
1312 m_nClasses = nClasses;
1313 m_Minimum = Minimum;
1314 m_Maximum = Maximum;
1315 m_ClassWidth = (Maximum - Minimum) / (double)m_nClasses;
1316
1317 return( true );
1318 }
1319 }
1320
1321 Destroy();
1322
1323 return( false );
1324 }
1325
1326 //---------------------------------------------------------
1327 void CSG_Histogram::Add_Value(double Value)
1328 {
1329 m_Statistics += Value;
1330
1331 if( m_nClasses > 0 && m_Minimum <= Value && Value <= m_Maximum )
1332 {
1333 size_t Class = (size_t)((Value - m_Minimum) / m_ClassWidth);
1334
1335 if( Class >= m_nClasses )
1336 {
1337 Class = m_nClasses - 1;
1338 }
1339
1340 m_Elements[Class]++;
1341 }
1342 }
1343
1344 //---------------------------------------------------------
1345 bool CSG_Histogram::Scale_Element_Count(double Scale)
1346 {
1347 if( m_nClasses > 0 && Scale > 0. )
1348 {
1349 m_Statistics.Set_Count((sLong)(Scale * Get_Element_Count()));
1350
1351 for(size_t i=0; i<m_nClasses; i++)
1352 {
1353 m_Elements[i] = (size_t)(Scale * m_Elements[i]);
1354 }
1355
1356 return( Update() );
1357 }
1358
1359 return( false );
1360 }
1361
1362 //---------------------------------------------------------
1363 bool CSG_Histogram::Update(void)
1364 {
1365 if( m_nClasses > 0 )
1366 {
1367 m_Statistics.Get_Mean(); // _Evaluate()
1368
1369 m_nMaximum = m_Cumulative[0] = m_Elements[0];
1370
1371 for(size_t i=1; i<m_nClasses; i++)
1372 {
1373 m_Cumulative[i] = m_Cumulative[i - 1] + m_Elements[i];
1374
1375 if( m_nMaximum < m_Elements[i] )
1376 {
1377 m_nMaximum = m_Elements[i];
1378 }
1379 }
1380
1381 return( Get_Element_Count() > 0 );
1382 }
1383
1384 return( false );
1385 }
1386
1387 //---------------------------------------------------------
1388 bool CSG_Histogram::_Update(sLong nElements)
1389 {
1390 if( nElements > 0 && m_Statistics.Get_Count() > 0 )
1391 {
1392 double Scale = (double)nElements / (double)m_Statistics.Get_Count();
1393
1394 m_Statistics.Create(m_Statistics.Get_Mean(), m_Statistics.Get_StdDev(), nElements);
1395
1396 for(size_t i=1; i<m_nClasses; i++)
1397 {
1398 m_Elements[i] = (size_t)(0.5 + Scale * m_Elements[i]);
1399 }
1400 }
1401
1402 return( Update() );
1403 }
1404
1405 //---------------------------------------------------------
1409 double CSG_Histogram::Get_Quantile(double Quantile) const
1410 {
1411 if( m_nClasses < 2 ) { return( 0. ); }
1412
1413 if( Quantile <= 0. ) { return( m_Minimum ); }
1414 if( Quantile >= 1. ) { return( m_Maximum ); }
1415
1416 size_t n = (size_t)(Quantile * Get_Element_Count()); // number of elements
1417
1418 for(size_t i=0, n0=0; i<m_nClasses; n0=m_Cumulative[i++])
1419 {
1420 if( n < m_Cumulative[i] )
1421 {
1422 if( m_Cumulative[i] >= n0 )
1423 {
1424 return( Get_Center(i) );
1425 }
1426
1427 double d = (n - n0) / (double)(m_Cumulative[i] - n0);
1428
1429 return( Get_Break(i) + d * m_ClassWidth );
1430 }
1431 else if( n == m_Cumulative[i] )
1432 {
1433 return( Get_Break(i + 1) );
1434 }
1435 }
1436
1437 return( m_Maximum );
1438 }
1439
1440 //---------------------------------------------------------
1444 double CSG_Histogram::Get_Percentile(double Percentile) const
1445 {
1446 return( Get_Quantile(Percentile / 100.) );
1447 }
1448
1449 //---------------------------------------------------------
1453 double CSG_Histogram::Get_Quantile_Value(double Value) const
1454 {
1455 if( m_nClasses < 2 ) { return( 0. ); }
1456
1457 if( Value <= m_Minimum ) { return( 0. ); }
1458 if( Value >= m_Maximum ) { return( 1. ); }
1459
1460 size_t Class = (size_t)(m_nClasses * (Value - m_Minimum) / (m_Maximum - m_Minimum));
1461
1462 if( Class >= m_nClasses )
1463 {
1464 return( 1. );
1465 }
1466
1467 if( Class < 1 )
1468 {
1469 double dq = m_Cumulative[Class] / (double)Get_Element_Count();
1470
1471 return( dq * (Value - m_Minimum) / m_ClassWidth );
1472 }
1473
1474 double q0 = m_Cumulative[Class - 1] / (double)Get_Element_Count();
1475 double dq = (m_Cumulative[Class ] / (double)Get_Element_Count()) - q0;
1476
1477 return( q0 + dq * (Value - Get_Break(Class)) / m_ClassWidth );
1478 }
1479
1480 //---------------------------------------------------------
1484 double CSG_Histogram::Get_Percentile_Value(double Value) const
1485 {
1486 return( Get_Quantile_Value(Value) * 100. );
1487 }
1488
1489
1491 // //
1493
1494 //---------------------------------------------------------
1495 bool CSG_Histogram::Create(const CSG_Histogram &Histogram)
1496 {
1497 if( !_Create(Histogram.m_nClasses, Histogram.m_Minimum, Histogram.m_Maximum) )
1498 {
1499 return( false );
1500 }
1501
1502 m_Statistics = Histogram.m_Statistics;
1503 m_ClassWidth = Histogram.m_ClassWidth;
1504 m_nMaximum = Histogram.m_nMaximum ;
1505
1506 for(size_t i=0; i<m_nClasses; i++)
1507 {
1508 m_Cumulative[i] = Histogram.m_Cumulative[i];
1509 m_Elements [i] = Histogram.m_Elements [i];
1510 }
1511
1512 return( true );
1513 }
1514
1515 //---------------------------------------------------------
1516 bool CSG_Histogram::Create(size_t nClasses, double Minimum, double Maximum)
1517 {
1518 return( _Create(nClasses, Minimum, Maximum) );
1519 }
1520
1521 //---------------------------------------------------------
1522 bool CSG_Histogram::Create(size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values, size_t maxSamples)
1523 {
1524 if( Minimum >= Maximum )
1525 {
1526 CSG_Simple_Statistics s(Values);
1527
1528 Minimum = s.Get_Minimum();
1529 Maximum = s.Get_Maximum();
1530 }
1531
1532 if( !_Create(nClasses, Minimum, Maximum) )
1533 {
1534 return( false );
1535 }
1536
1537 //-----------------------------------------------------
1538 if( maxSamples > 0 && maxSamples < (size_t)Values.Get_N() )
1539 {
1540 double d = (double)Values.Get_N() / (double)maxSamples;
1541
1542 for(double i=0; i<(double)Values.Get_N(); i+=d)
1543 {
1544 Add_Value(Values[(sLong)i]);
1545 }
1546
1547 d = (double)m_Statistics.Get_Count() / (double)maxSamples;
1548
1549 return( _Update(d < 1. ? (int)(d * (double)Values.Get_N()) : Values.Get_N()) );
1550 }
1551
1552 //-----------------------------------------------------
1553 for(int i=0; i<Values.Get_N(); i++)
1554 {
1555 Add_Value(Values[i]);
1556 }
1557
1558 return( Update() );
1559 }
1560
1561 //---------------------------------------------------------
1562 bool CSG_Histogram::Create(size_t nClasses, double Minimum, double Maximum, CSG_Table *pTable, int Field, size_t maxSamples)
1563 {
1564 if( !pTable || Field < 0 || Field >= pTable->Get_Field_Count() || !_Create(nClasses,
1565 Minimum < Maximum ? Minimum : pTable->Get_Minimum(Field),
1566 Minimum < Maximum ? Maximum : pTable->Get_Maximum(Field)) )
1567 {
1568 return( false );
1569 }
1570
1571 //-----------------------------------------------------
1572 if( maxSamples > 0 && maxSamples < (size_t)pTable->Get_Count() )
1573 {
1574 double d = (double)pTable->Get_Count() / (double)maxSamples;
1575
1576 for(double i=0; i<(double)pTable->Get_Count(); i+=d)
1577 {
1578 double Value = pTable->Get_Record((int)i)->asDouble(Field);
1579
1580 if( !pTable->is_NoData_Value(Value) )
1581 {
1582 Add_Value(Value);
1583 }
1584 }
1585
1586 d = (double)m_Statistics.Get_Count() / (double)maxSamples;
1587
1588 return( _Update(d < 1. ? (int)(d * pTable->Get_Count()) : pTable->Get_Count()) );
1589 }
1590
1591 //-----------------------------------------------------
1592 for(sLong i=0; i<pTable->Get_Count(); i++)
1593 {
1594 double Value = pTable->Get_Record(i)->asDouble(Field);
1595
1596 if( !pTable->is_NoData_Value(Value) )
1597 {
1598 Add_Value(Value);
1599 }
1600 }
1601
1602 return( Update() );
1603 }
1604
1605 //---------------------------------------------------------
1606 bool CSG_Histogram::Create(size_t nClasses, double Minimum, double Maximum, CSG_Grid *pGrid, size_t maxSamples)
1607 {
1608 if( !pGrid || !_Create(nClasses,
1609 Minimum < Maximum ? Minimum : pGrid->Get_Min(),
1610 Minimum < Maximum ? Maximum : pGrid->Get_Max()) )
1611 {
1612 return( false );
1613 }
1614
1615 //-----------------------------------------------------
1616 if( maxSamples > 0 && (sLong)maxSamples < pGrid->Get_NCells() )
1617 {
1618 double d = (double)pGrid->Get_NCells() / (double)maxSamples;
1619
1620 for(double i=0; i<(double)pGrid->Get_NCells(); i+=d)
1621 {
1622 double Value = pGrid->asDouble((sLong)i);
1623
1624 if( !pGrid->is_NoData_Value(Value) )
1625 {
1626 Add_Value(Value);
1627 }
1628 }
1629
1630 d = (double)m_Statistics.Get_Count() / (double)maxSamples;
1631
1632 return( _Update(d < 1. ? (sLong)(d * (double)pGrid->Get_NCells()) : pGrid->Get_NCells()) );
1633 }
1634
1635 //-----------------------------------------------------
1636 for(sLong i=0; i<pGrid->Get_NCells(); i++)
1637 {
1638 if( !pGrid->is_NoData(i) )
1639 {
1640 Add_Value(pGrid->asDouble(i));
1641 }
1642 }
1643
1644 return( Update() );
1645 }
1646
1647 //---------------------------------------------------------
1648 bool CSG_Histogram::Create(size_t nClasses, double Minimum, double Maximum, CSG_Grids *pGrids, size_t maxSamples)
1649 {
1650 if( !pGrids || !_Create(nClasses,
1651 Minimum < Maximum ? Minimum : pGrids->Get_Min(),
1652 Minimum < Maximum ? Maximum : pGrids->Get_Max()) )
1653 {
1654 return( false );
1655 }
1656
1657 //-----------------------------------------------------
1658 if( maxSamples > 0 && (sLong)maxSamples < pGrids->Get_NCells() )
1659 {
1660 double d = (double)pGrids->Get_NCells() / (double)maxSamples;
1661
1662 for(double i=0; i<(double)pGrids->Get_NCells(); i+=d)
1663 {
1664 double Value = pGrids->asDouble((sLong)i);
1665
1666 if( !pGrids->is_NoData_Value(Value) )
1667 {
1668 Add_Value(Value);
1669 }
1670 }
1671
1672 d = (double)m_Statistics.Get_Count() / (double)maxSamples;
1673
1674 return( _Update(d < 1. ? (sLong)(d * (double)pGrids->Get_NCells()) : pGrids->Get_NCells()) );
1675 }
1676
1677 //-----------------------------------------------------
1678 for(sLong i=0; i<pGrids->Get_NCells(); i++)
1679 {
1680 if( !pGrids->is_NoData(i) )
1681 {
1682 Add_Value(pGrids->asDouble(i));
1683 }
1684 }
1685
1686 return( Update() );
1687 }
1688
1689
1691 // //
1693
1694 //---------------------------------------------------------
1695 CSG_Histogram & CSG_Histogram::operator = (const CSG_Histogram &Histogram)
1696 {
1697 Create(Histogram);
1698
1699 return( *this );
1700 }
1701
1702
1704 // //
1705 // //
1706 // //
1708
1709 //---------------------------------------------------------
1710 CSG_Natural_Breaks::CSG_Natural_Breaks(void)
1711 {}
1712
1713 //---------------------------------------------------------
1714 CSG_Natural_Breaks::~CSG_Natural_Breaks(void)
1715 {}
1716
1717 //---------------------------------------------------------
1718 CSG_Natural_Breaks::CSG_Natural_Breaks(CSG_Table *pTable, int Field, int nClasses, int Histogram)
1719 {
1720 Create(pTable, Field, nClasses, Histogram);
1721 }
1722
1723 //---------------------------------------------------------
1724 CSG_Natural_Breaks::CSG_Natural_Breaks(CSG_Grid *pGrid, int nClasses, int Histogram)
1725 {
1726 Create(pGrid, nClasses, Histogram);
1727 }
1728
1729 //---------------------------------------------------------
1730 CSG_Natural_Breaks::CSG_Natural_Breaks(CSG_Grids *pGrids, int nClasses, int Histogram)
1731 {
1732 Create(pGrids, nClasses, Histogram);
1733 }
1734
1735 //---------------------------------------------------------
1736 CSG_Natural_Breaks::CSG_Natural_Breaks(const CSG_Vector &Values, int nClasses, int Histogram)
1737 {
1738 Create(Values, nClasses, Histogram);
1739 }
1740
1741
1743 // //
1745
1746 //---------------------------------------------------------
1747 bool CSG_Natural_Breaks::Create(CSG_Table *pTable, int Field, int nClasses, int Histogram)
1748 {
1749 bool bResult = false;
1750
1751 if( Histogram > 0 )
1752 {
1753 bResult = m_Histogram.Create(Histogram, 0, 0, pTable, Field) && _Histogram(nClasses);
1754 }
1755 else if( Field >= 0 && Field < pTable->Get_Field_Count() )
1756 {
1757 for(sLong i=0; i<pTable->Get_Count(); i++)
1758 {
1759 CSG_Table_Record *pRecord = pTable->Get_Record(i);
1760
1761 if( !pRecord->is_NoData(Field) )
1762 {
1763 m_Values.Add_Row(pRecord->asDouble(Field));
1764 }
1765 }
1766
1767 bResult = m_Values.Sort() && _Calculate(nClasses);
1768
1769 m_Values.Destroy();
1770 }
1771
1772 return( bResult );
1773 }
1774
1775 //---------------------------------------------------------
1776 bool CSG_Natural_Breaks::Create(CSG_Grid *pGrid, int nClasses, int Histogram)
1777 {
1778 bool bResult = false;
1779
1780 if( Histogram > 0 )
1781 {
1782 bResult = m_Histogram.Create(Histogram, 0, 0, pGrid) && _Histogram(nClasses);
1783 }
1784 else
1785 {
1786 for(sLong i=0; i<pGrid->Get_NCells(); i++)
1787 {
1788 if( !pGrid->is_NoData(i) )
1789 {
1790 m_Values.Add_Row(pGrid->asDouble(i));
1791 }
1792 }
1793
1794 bResult = m_Values.Sort() && _Calculate(nClasses);
1795
1796 m_Values.Destroy();
1797 }
1798
1799 return( bResult );
1800 }
1801
1802 //---------------------------------------------------------
1803 bool CSG_Natural_Breaks::Create(CSG_Grids *pGrids, int nClasses, int Histogram)
1804 {
1805 bool bResult = false;
1806
1807 if( Histogram > 0 )
1808 {
1809 bResult = m_Histogram.Create(Histogram, 0, 0, pGrids) && _Histogram(nClasses);
1810 }
1811 else
1812 {
1813 for(sLong i=0; i<pGrids->Get_NCells(); i++)
1814 {
1815 if( !pGrids->is_NoData(i) )
1816 {
1817 m_Values.Add_Row(pGrids->asDouble(i));
1818 }
1819 }
1820
1821 bResult = m_Values.Sort() && _Calculate(nClasses);
1822
1823 m_Values.Destroy();
1824 }
1825
1826 return( bResult );
1827 }
1828
1829 //---------------------------------------------------------
1830 bool CSG_Natural_Breaks::Create(const CSG_Vector &Values, int nClasses, int Histogram)
1831 {
1832 bool bResult = false;
1833
1834 if( Histogram > 0 )
1835 {
1836 bResult = m_Histogram.Create(Histogram, 0, 0, Values) && _Histogram(nClasses);
1837 }
1838 else
1839 {
1840 bResult = m_Values.Create(Values) && m_Values.Sort() && _Calculate(nClasses);
1841
1842 m_Values.Destroy();
1843 }
1844
1845 return( bResult );
1846 }
1847
1848
1850 // //
1852
1853 //---------------------------------------------------------
1854 bool CSG_Natural_Breaks::_Histogram(int nClasses)
1855 {
1856 if( _Calculate(nClasses) )
1857 {
1858 double d = (double)m_Histogram.Get_Class_Count() / m_Histogram.Get_Cumulative((int)(m_Histogram.Get_Class_Count() - 1));
1859
1860 m_Breaks[0] = m_Histogram.Get_Break(0);
1861
1862 for(int i=1; i<Get_Count(); i++)
1863 {
1864 m_Breaks[i] = m_Histogram.Get_Value(m_Breaks[i] * d);
1865 }
1866
1867 m_Breaks[nClasses] = m_Histogram.Get_Break((int)m_Histogram.Get_Class_Count());
1868
1869 m_Histogram.Destroy();
1870
1871 return( true );
1872 }
1873
1874 m_Histogram.Destroy();
1875
1876 return( false );
1877 }
1878
1879 //---------------------------------------------------------
1880 inline double CSG_Natural_Breaks::_Get_Value(int i)
1881 {
1882 if( m_Histogram.Get_Class_Count() > 0 )
1883 {
1884 return( (double)m_Histogram.Get_Cumulative(i) );
1885 }
1886
1887 return( m_Values[i] );
1888 }
1889
1890 //---------------------------------------------------------
1891 bool CSG_Natural_Breaks::_Calculate(int nClasses)
1892 {
1893 if( m_Histogram.Get_Class_Count() == 0 && m_Values.Get_Size() == 0 )
1894 {
1895 return( false );
1896 }
1897
1898 int nValues = m_Histogram.Get_Class_Count() > 0 ? (int)m_Histogram.Get_Class_Count() : m_Values.Get_N();
1899
1900 CSG_Matrix mv(nClasses, nValues); mv.Assign(FLT_MAX);
1901
1902 int i, **mc = (int **)SG_Malloc(nValues * sizeof(int *));
1903
1904 mc[0] = (int *)SG_Calloc(nClasses * nValues, sizeof(int));
1905
1906 for(i=0; i<nValues; i++)
1907 {
1908 mc[i] = mc[0] + i * nClasses;
1909 }
1910
1911 //-----------------------------------------------------
1912 for(i=1; i<nValues; i++)
1913 {
1914 double v = 0., s1 = 0., s2 = 0., w = 0.;
1915
1916 for(int m=0, n=i+1; m<=i; m++, n--)
1917 {
1918 v = _Get_Value(n);
1919 s2 += v*v;
1920 s1 += v;
1921 w ++;
1922 v = s2 - (s1 * s1) / w;
1923
1924 if( n > 0 )
1925 {
1926 for(int j=1; j<nClasses; j++)
1927 {
1928 if( mv[i][j] >= (v + mv[n - 1][j - 1]) )
1929 {
1930 mc[i][j] = n;
1931 mv[i][j] = v + mv[n - 1][j - 1];
1932 }
1933 }
1934 }
1935 }
1936
1937 mc[i][0] = 0;
1938 mv[i][0] = v;
1939 }
1940
1941 //-----------------------------------------------------
1942 CSG_Array_Int Class(nClasses);
1943
1944 for(i=0; i<nClasses; i++)
1945 {
1946 Class[i] = i;
1947 }
1948
1949 int j = Class[nClasses - 1] = nValues - 1;
1950
1951 for(i=nClasses-1; i>0; i--)
1952 {
1953 Class[i - 1] = j = mc[j - 1][i];
1954 }
1955
1956 //-----------------------------------------------------
1957 m_Breaks.Create(nClasses + 1);
1958
1959 m_Breaks[0] = _Get_Value(0);
1960
1961 for(i=1; i<nClasses; i++)
1962 {
1963 m_Breaks[i] = _Get_Value(Class[i - 1]);
1964 }
1965
1966 m_Breaks[nClasses] = _Get_Value(nValues - 1);
1967
1968 SG_Free(mc[0]); SG_Free(mc);
1969
1970 return( true );
1971 }
1972
1973
1975 // //
1976 // //
1977 // //
1979
1980 //---------------------------------------------------------
1981 CSG_Cluster_Analysis::CSG_Cluster_Analysis(void)
1982 {
1983 m_nFeatures = 0;
1984 m_Iteration = 0;
1985 }
1986
1987 //---------------------------------------------------------
1988 CSG_Cluster_Analysis::~CSG_Cluster_Analysis(void)
1989 {
1990 Destroy();
1991 }
1992
1993 //---------------------------------------------------------
1994 bool CSG_Cluster_Analysis::Destroy(void)
1995 {
1996 m_Centroid.Destroy();
1997 m_Variance.Destroy();
1998 m_nMembers.Destroy();
1999 m_Clusters.Destroy();
2000 m_Features.Destroy();
2001 m_nFeatures = 0;
2002 m_Iteration = 0;
2003
2004 return( true );
2005 }
2006
2007 //---------------------------------------------------------
2008 bool CSG_Cluster_Analysis::Create(int nFeatures)
2009 {
2010 Destroy();
2011
2012 if( nFeatures > 0 )
2013 {
2014 m_nFeatures = nFeatures;
2015
2016 m_Features.Create(m_nFeatures * sizeof(double), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_3);
2017
2018 return( true );
2019 }
2020
2021 return( false );
2022 }
2023
2024 //---------------------------------------------------------
2025 bool CSG_Cluster_Analysis::Add_Element(void)
2026 {
2027 return( m_nFeatures > 0 && m_Features.Inc_Array() );
2028 }
2029
2030 //---------------------------------------------------------
2031 bool CSG_Cluster_Analysis::Set_Feature(sLong iElement, int iFeature, double Value)
2032 {
2033 if( iElement >= 0 && iElement < Get_nElements() && iFeature >= 0 && iFeature < m_nFeatures )
2034 {
2035 ((double *)m_Features.Get_Entry(iElement))[iFeature] = Value;
2036
2037 return( true );
2038 }
2039
2040 return( false );
2041 }
2042
2043 //---------------------------------------------------------
2053 //---------------------------------------------------------
2054 bool CSG_Cluster_Analysis::Execute(int Method, int nClusters, int nMaxIterations, int Initialization)
2055 {
2056 if( Get_nElements() < 2 || nClusters < 2 )
2057 {
2058 return( false );
2059 }
2060
2061 //-----------------------------------------------------
2062 m_nMembers.Create(nClusters);
2063 m_Variance.Create(nClusters);
2064 m_Centroid.Create(m_nFeatures, nClusters);
2065
2066 //-----------------------------------------------------
2067 m_Clusters.Create(Get_nElements());
2068
2069 for(int iElement=0; iElement<Get_nElements(); iElement++)
2070 {
2071 switch( Initialization )
2072 {
2073 default: // random
2074 if( (m_Clusters[iElement] = (int)CSG_Random::Get_Uniform(0, nClusters)) >= nClusters )
2075 {
2076 m_Clusters[iElement] = nClusters - 1;
2077 }
2078 break;
2079
2080 case 1: // periodic
2081 {
2082 m_Clusters[iElement] = iElement % nClusters;
2083 }
2084 break;
2085
2086 case 2: // keep as is, but check for valid cluster ids
2087 if( 0 > m_Clusters[iElement] || m_Clusters[iElement] >= nClusters )
2088 {
2089 m_Clusters[iElement] = iElement % nClusters;
2090 }
2091 break;
2092 }
2093 }
2094
2095 //-----------------------------------------------------
2096 bool bResult;
2097
2098 m_Iteration = 0;
2099
2100 switch( Method )
2101 {
2102 default: bResult = _Minimum_Distance(true , nMaxIterations); break;
2103 case 1: bResult = _Hill_Climbing (true , nMaxIterations); break;
2104 case 2: bResult = _Minimum_Distance(true , nMaxIterations)
2105 && _Hill_Climbing (false, nMaxIterations); break;
2106 }
2107
2108 //-----------------------------------------------------
2109 if( bResult )
2110 {
2111 for(int iCluster=0; iCluster<nClusters; iCluster++)
2112 {
2113 m_Variance[iCluster] = m_nMembers[iCluster] <= 0 ? 0. : m_Variance[iCluster] / m_nMembers[iCluster];
2114 }
2115 }
2116
2117 return( bResult );
2118 }
2119
2120 //---------------------------------------------------------
2121 bool CSG_Cluster_Analysis::_Minimum_Distance(bool bInitialize, int nMaxIterations)
2122 {
2123 int iElement, iCluster, nClusters = m_Variance.Get_N();
2124
2125 double SP_Last = -1.;
2126
2127 //-----------------------------------------------------
2128 for(m_Iteration=1; SG_UI_Process_Get_Okay(); m_Iteration++)
2129 {
2130 m_Variance = 0.;
2131 m_Centroid = 0.;
2132 m_nMembers = 0;
2133
2134 //-------------------------------------------------
2135 for(iElement=0; iElement<Get_nElements(); iElement++)
2136 {
2137 m_nMembers[iCluster = m_Clusters[iElement]]++;
2138
2139 double *Feature = (double *)m_Features.Get_Entry(iElement);
2140
2141 for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
2142 {
2143 m_Centroid[iCluster][iFeature] += Feature[iFeature];
2144 }
2145 }
2146
2147 //-------------------------------------------------
2148 for(iCluster=0; iCluster<nClusters; iCluster++)
2149 {
2150 double d = m_nMembers[iCluster] > 0 ? 1. / m_nMembers[iCluster] : 0.;
2151
2152 for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
2153 {
2154 m_Centroid[iCluster][iFeature] *= d;
2155 }
2156 }
2157
2158 //-------------------------------------------------
2159 int nShifts = 0;
2160
2161 m_SP = 0.;
2162
2163 for(iElement=0; iElement<Get_nElements(); iElement++)
2164 {
2165 double *Feature = (double *)m_Features.Get_Entry(iElement);
2166
2167 double minVariance = -1.;
2168 int minCluster = -1;
2169
2170 for(iCluster=0; iCluster<nClusters; iCluster++)
2171 {
2172 double Variance = 0.;
2173
2174 for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
2175 {
2176 Variance += SG_Get_Square(m_Centroid[iCluster][iFeature] - Feature[iFeature]);
2177 }
2178
2179 if( minVariance < 0. || Variance < minVariance )
2180 {
2181 minVariance = Variance;
2182 minCluster = iCluster;
2183 }
2184 }
2185
2186 if( m_Clusters[iElement] != minCluster )
2187 {
2188 m_Clusters[iElement] = minCluster;
2189
2190 nShifts++;
2191 }
2192
2193 m_SP += minVariance;
2194 m_Variance[minCluster] += minVariance;
2195 }
2196
2197 //-------------------------------------------------
2198 m_SP /= Get_nElements();
2199
2200 SG_UI_Process_Set_Text(CSG_String::Format("%s: %d >> %s %f",
2201 _TL("pass" ), m_Iteration,
2202 _TL("change"), m_Iteration < 2 ? m_SP : SP_Last - m_SP
2203 ));
2204
2205 SP_Last = m_SP;
2206
2207 if( nShifts == 0 || (nMaxIterations > 0 && nMaxIterations <= m_Iteration) )
2208 {
2209 return( true );
2210 }
2211 }
2212
2213 return( true );
2214 }
2215
2216 //---------------------------------------------------------
2217 bool CSG_Cluster_Analysis::_Hill_Climbing(bool bInitialize, int nMaxIterations)
2218 {
2219 int iElement, iCluster, nClusters = m_Variance.Get_N();
2220
2221 //-----------------------------------------------------
2222 m_Variance = 0.;
2223 m_Centroid = 0.;
2224 m_nMembers = 0;
2225
2226 for(iElement=0; iElement<Get_nElements(); iElement++)
2227 {
2228 m_nMembers[iCluster = m_Clusters[iElement]]++;
2229
2230 double *Feature = (double *)m_Features.Get_Entry(iElement);
2231
2232 for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
2233 {
2234 double d = Feature[iFeature];
2235
2236 m_Centroid[iCluster][iFeature] += d;
2237 m_Variance[iCluster] += d*d;
2238 }
2239 }
2240
2241 //-----------------------------------------------------
2242 for(iCluster=0; iCluster<nClusters; iCluster++)
2243 {
2244 double v = 0., d = m_nMembers[iCluster] <= 0 ? 0. : 1. / (double)m_nMembers[iCluster];
2245
2246 for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
2247 {
2248 m_Centroid[iCluster][iFeature] *= d;
2249 v += SG_Get_Square(m_Centroid[iCluster][iFeature]);
2250 }
2251
2252 m_Variance[iCluster] -= v * m_nMembers[iCluster];
2253 }
2254
2255 //-----------------------------------------------------
2256 double SP_Last = -1.; int noShift = 0;
2257
2258 for(m_Iteration=1; SG_UI_Process_Get_Okay(false); m_Iteration++)
2259 {
2260 for(iElement=0; iElement<Get_nElements(); iElement++)
2261 {
2262 iCluster = m_Clusters[iElement];
2263
2264 if( noShift++ < Get_nElements() && m_nMembers[iCluster] > 1 )
2265 {
2266 int iFeature; double *Feature = (double *)m_Features.Get_Entry(iElement);
2267
2268 double V1, V2, Variance = 0.;
2269
2270 for(iFeature=0; iFeature<m_nFeatures; iFeature++)
2271 {
2272 Variance += SG_Get_Square(m_Centroid[iCluster][iFeature] - Feature[iFeature]);
2273 }
2274
2275 V1 = Variance * m_nMembers[iCluster] / (m_nMembers[iCluster] - 1.);
2276
2277 //-----------------------------------------
2278 int kCluster = 0;
2279 double VMin = -1.;
2280
2281 for(int jCluster=0; jCluster<nClusters; jCluster++)
2282 {
2283 if( jCluster != iCluster )
2284 {
2285 Variance = 0.;
2286
2287 for(iFeature=0; iFeature<m_nFeatures; iFeature++)
2288 {
2289 Variance += SG_Get_Square(m_Centroid[jCluster][iFeature] - Feature[iFeature]);
2290 }
2291
2292 V2 = Variance * m_nMembers[jCluster] / (m_nMembers[jCluster] + 1.);
2293
2294 if( VMin < 0. || V2 < VMin )
2295 {
2296 VMin = V2;
2297 kCluster = jCluster;
2298 }
2299 }
2300 }
2301
2302 //-----------------------------------------
2303 if( VMin >= 0 && VMin < V1 )
2304 {
2305 noShift = 0;
2306 m_Variance[iCluster] -= V1;
2307 m_Variance[kCluster] += VMin;
2308 V1 = 1. / (m_nMembers[iCluster] - 1.);
2309 V2 = 1. / (m_nMembers[kCluster] + 1.);
2310
2311 for(iFeature=0; iFeature<m_nFeatures; iFeature++)
2312 {
2313 double d = Feature[iFeature];
2314
2315 m_Centroid[iCluster][iFeature] = (m_nMembers[iCluster] * m_Centroid[iCluster][iFeature] - d) * V1;
2316 m_Centroid[kCluster][iFeature] = (m_nMembers[kCluster] * m_Centroid[kCluster][iFeature] + d) * V2;
2317 }
2318
2319 m_Clusters[iElement] = kCluster;
2320
2321 m_nMembers[iCluster]--;
2322 m_nMembers[kCluster]++;
2323 }
2324 }
2325 }
2326
2327 //-------------------------------------------------
2328 for(iCluster=0, m_SP=0.; iCluster<nClusters; iCluster++)
2329 {
2330 m_SP += m_Variance[iCluster];
2331 }
2332
2333 m_SP /= Get_nElements();
2334
2335 SG_UI_Process_Set_Text(CSG_String::Format("%s: %d >> %s %f",
2336 _TL("pass" ), m_Iteration,
2337 _TL("change"), m_Iteration <= 1 ? m_SP : SP_Last - m_SP
2338 ));
2339
2340 SP_Last = m_SP;
2341
2342 if( noShift >= Get_nElements() || (nMaxIterations > 0 && nMaxIterations <= m_Iteration) )
2343 {
2344 return( true );
2345 }
2346 }
2347
2348 return( true );
2349 }
2350
2351
2353 // //
2354 // //
2355 // //
2357
2358 //---------------------------------------------------------
2359 CSG_Classifier_Supervised::CSG_Classifier_Supervised(void)
2360 {
2361 m_nFeatures = 0;
2362
2363 m_nClasses = 0;
2364 m_pClasses = NULL;
2365
2366 m_Threshold_Distance = 0.;
2367 m_Threshold_Angle = 0.;
2368 m_Threshold_Probability = 0.;
2369 m_Probability_Relative = false;
2370
2371 for(int i=0; i<SG_CLASSIFY_SUPERVISED_WTA; i++)
2372 {
2373 m_bWTA[i] = i == SG_CLASSIFY_SUPERVISED_MinimumDistance
2374 // || i == SG_CLASSIFY_SUPERVISED_Mahalonobis
2375 || i == SG_CLASSIFY_SUPERVISED_MaximumLikelihood
2376 || i == SG_CLASSIFY_SUPERVISED_SAM;
2377 }
2378 }
2379
2380 //---------------------------------------------------------
2381 CSG_Classifier_Supervised::~CSG_Classifier_Supervised(void)
2382 {
2383 Destroy();
2384 }
2385
2386 //---------------------------------------------------------
2387 void CSG_Classifier_Supervised::Create(int nFeatures)
2388 {
2389 Destroy();
2390
2391 if( nFeatures > 0 )
2392 {
2393 m_nFeatures = nFeatures;
2394 }
2395 }
2396
2397 //---------------------------------------------------------
2398 void CSG_Classifier_Supervised::Destroy(void)
2399 {
2400 if( m_nClasses > 0 )
2401 {
2402 for(int i=0; i<m_nClasses; i++)
2403 {
2404 delete(m_pClasses[i]);
2405 }
2406
2407 SG_FREE_SAFE(m_pClasses);
2408 }
2409
2410 m_nFeatures = 0;
2411
2412 m_Info.Clear();
2413 }
2414
2415
2417 // //
2419
2420 //---------------------------------------------------------
2421 void CSG_Classifier_Supervised::Set_Threshold_Distance (double Value) { m_Threshold_Distance = Value; }
2422 double CSG_Classifier_Supervised::Get_Threshold_Distance (void) { return( m_Threshold_Distance ); }
2423
2424 //---------------------------------------------------------
2425 void CSG_Classifier_Supervised::Set_Threshold_Angle (double Value) { m_Threshold_Angle = Value; }
2426 double CSG_Classifier_Supervised::Get_Threshold_Angle (void) { return( m_Threshold_Angle ); }
2427
2428 //---------------------------------------------------------
2429 void CSG_Classifier_Supervised::Set_Threshold_Probability(double Value) { m_Threshold_Probability = Value; }
2430 double CSG_Classifier_Supervised::Get_Threshold_Probability(void) { return( m_Threshold_Probability ); }
2431
2432 //---------------------------------------------------------
2433 void CSG_Classifier_Supervised::Set_Probability_Relative (bool Value) { m_Probability_Relative = Value; }
2434 bool CSG_Classifier_Supervised::Get_Probability_Relative (void) { return( m_Probability_Relative ); }
2435
2436 //---------------------------------------------------------
2437 void CSG_Classifier_Supervised::Set_WTA(int Method, bool bOn)
2438 {
2439 if( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA )
2440 {
2441 m_bWTA[Method] = bOn;
2442 }
2443 }
2444
2445 bool CSG_Classifier_Supervised::Get_WTA(int Method)
2446 {
2447 return( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA ? m_bWTA[Method] : false );
2448 }
2449
2450
2452 // //
2454
2455 //---------------------------------------------------------
2456 #include "saga_api.h"
2457
2458 //---------------------------------------------------------
2459 bool CSG_Classifier_Supervised::Load(const CSG_String &File)
2460 {
2461 int nFeatures = m_nFeatures; Destroy(); m_nFeatures = nFeatures;
2462
2463 //-----------------------------------------------------
2464 CSG_MetaData Data;
2465
2466 if( !Data.Load(File) || !Data.Cmp_Name("supervised_classifier") || SG_Compare_Version(Data.Get_Property("saga-version"), "2.1.4") < 0 )
2467 {
2468 return( false );
2469 }
2470
2471 if( !Data("classes") || !Data("features") || !Data["features"]("count") || Data["features"]["count"].Get_Content().asInt() != m_nFeatures || m_nFeatures == 0 )
2472 {
2473 return( false );
2474 }
2475
2476 if( Data["features"]("info") )
2477 {
2478 m_Info = Data["features"]["info"].Get_Content();
2479 }
2480
2481 //-----------------------------------------------------
2482 CSG_MetaData &Classes = *Data.Get_Child("CLASSES");
2483
2484 for(int i=0; i<Classes.Get_Children_Count(); i++)
2485 {
2486 if( Classes[i].Cmp_Name("class") && Classes[i].Get_Child("id") )
2487 {
2488 bool bAdd = true;
2489
2490 CClass *pClass = new CClass(Classes[i]["id"].Get_Content());
2491
2492 if( !pClass->m_Cov .from_String(Classes[i]["cov" ].Get_Content()) || pClass->m_Cov .Get_NX() != m_nFeatures || !pClass->m_Cov.is_Square() ) { bAdd = false; }
2493 if( !pClass->m_Mean.from_String(Classes[i]["mean"].Get_Content()) || pClass->m_Mean.Get_N () != m_nFeatures ) { bAdd = false; }
2494 if( !pClass->m_Min .from_String(Classes[i]["min" ].Get_Content()) || pClass->m_Min .Get_N () != m_nFeatures ) { bAdd = false; }
2495 if( !pClass->m_Max .from_String(Classes[i]["max" ].Get_Content()) || pClass->m_Max .Get_N () != m_nFeatures ) { bAdd = false; }
2496
2497 //---------------------------------------------
2498 if( !bAdd )
2499 {
2500 delete(pClass);
2501 }
2502 else
2503 {
2504 m_pClasses = (CClass **)SG_Realloc(m_pClasses, (m_nClasses + 1) * sizeof(CClass *));
2505 m_pClasses[m_nClasses++] = pClass;
2506
2507 pClass->m_Cov_Det = pClass->m_Cov.Get_Determinant();
2508 pClass->m_Cov_Inv = pClass->m_Cov.Get_Inverse();
2509
2510 pClass->m_Mean_Spectral = CSG_Simple_Statistics(pClass->m_Mean).Get_Mean();
2511 }
2512 }
2513 }
2514
2515 return( m_nClasses > 0 );
2516 }
2517
2518 //---------------------------------------------------------
2519 bool CSG_Classifier_Supervised::Save(const CSG_String &File, const SG_Char *Feature_Info)
2520 {
2521 if( m_nFeatures < 1 || m_nClasses < 1 || File.is_Empty() )
2522 {
2523 return( false );
2524 }
2525
2526 CSG_MetaData Data;
2527
2528 Data.Set_Name ("supervised_classifier");
2529 Data.Add_Property("saga-version", SAGA_VERSION);
2530
2531 CSG_MetaData &Features = *Data.Add_Child("features");
2532
2533 Features.Add_Child("count", m_nFeatures);
2534
2535 if( Feature_Info && *Feature_Info )
2536 {
2537 Features.Add_Child("info", Feature_Info);
2538 }
2539
2540 CSG_MetaData &Classes = *Data.Add_Child("classes");
2541
2542 Classes.Add_Property("count", m_nClasses);
2543
2544 for(int i=0; i<m_nClasses; i++)
2545 {
2546 CSG_MetaData &Class = *Classes.Add_Child("class");
2547
2548 CClass *pClass = m_pClasses[i];
2549
2550 Class.Add_Child("id" , pClass->m_ID );
2551 Class.Add_Child("mean", pClass->m_Mean.to_String());
2552 Class.Add_Child("min" , pClass->m_Min .to_String());
2553 Class.Add_Child("max" , pClass->m_Max .to_String());
2554 Class.Add_Child("cov" , pClass->m_Cov .to_String());
2555 }
2556
2557 return( Data.Save(File) );
2558 }
2559
2560
2562 // //
2564
2565 //---------------------------------------------------------
2566 CSG_String CSG_Classifier_Supervised::Print(void)
2567 {
2568 CSG_String s;
2569
2570 if( m_nFeatures > 0 && m_nClasses > 0 )
2571 {
2572 s += "\n";
2573
2574 for(int iClass=0; iClass<m_nClasses; iClass++)
2575 {
2576 CClass *pClass = m_pClasses[iClass];
2577
2578 s += "\n____\n" + pClass->m_ID + "\nFeature\tMean\tMin\tMax\tStdDev";
2579
2580 for(int i=0; i<m_nFeatures; i++)
2581 {
2582 s += CSG_String::Format("\n%3d.", i + 1);
2583 s += "\t" + SG_Get_String(pClass->m_Mean[i]);
2584 s += "\t" + SG_Get_String(pClass->m_Min [i]);
2585 s += "\t" + SG_Get_String(pClass->m_Max [i]);
2586 s += "\t" + SG_Get_String(sqrt(pClass->m_Cov[i][i]));
2587 }
2588
2589 s += "\n";
2590 }
2591 }
2592
2593 return( s );
2594 }
2595
2596
2598 // //
2600
2601 //---------------------------------------------------------
2602 bool CSG_Classifier_Supervised::Add_Class(const CSG_String &Class_ID, const CSG_Vector &Mean, const CSG_Vector &Min, const CSG_Vector &Max, const CSG_Matrix &Cov)
2603 {
2604 if( m_nFeatures < 1 || Mean.Get_N() != m_nFeatures || Min.Get_N() != m_nFeatures || Max.Get_N() != m_nFeatures || Cov.Get_NCols() != m_nFeatures || Cov.Get_NRows() != m_nFeatures )
2605 {
2606 return( false );
2607 }
2608
2609 CClass *pClass, **pClasses = (CClass **)SG_Realloc(m_pClasses, (m_nClasses + 1) * sizeof(CClass *));
2610
2611 if( pClasses )
2612 {
2613 m_pClasses = pClasses;
2614
2615 m_pClasses[m_nClasses++] = pClass = new CClass(Class_ID);
2616
2617 pClass->m_ID = Class_ID;
2618
2619 pClass->m_Mean = Mean;
2620 pClass->m_Min = Min;
2621 pClass->m_Max = Max;
2622 pClass->m_Cov = Cov;
2623
2624 pClass->m_Cov_Inv = Cov.Get_Inverse();
2625 pClass->m_Cov_Det = Cov.Get_Determinant();
2626
2627 pClass->m_Mean_Spectral = CSG_Simple_Statistics(Mean).Get_Mean();
2628
2629 return( true );
2630 }
2631
2632 return( false );
2633 }
2634
2635
2637 // //
2639
2640 //---------------------------------------------------------
2641 bool CSG_Classifier_Supervised::Train_Clr_Samples(void)
2642 {
2643 for(int i=0; i<m_nClasses; i++)
2644 {
2645 m_pClasses[i]->m_Samples.Destroy();
2646 }
2647
2648 return( true );
2649 }
2650
2651 //---------------------------------------------------------
2652 bool CSG_Classifier_Supervised::Train_Add_Sample(const CSG_String &Class_ID, const CSG_Vector &Features)
2653 {
2654 if( m_nFeatures > 0 && m_nFeatures == Features.Get_N() )
2655 {
2656 int iClass = Get_Class(Class_ID);
2657
2658 if( iClass < 0 )
2659 {
2660 CClass **pClasses = (CClass **)SG_Realloc(m_pClasses, (m_nClasses + 1) * sizeof(CClass *));
2661
2662 if( pClasses )
2663 {
2664 m_pClasses = pClasses;
2665
2666 m_pClasses[iClass = m_nClasses++] = new CClass(Class_ID);
2667 }
2668 }
2669
2670 if( iClass >= 0 )
2671 {
2672 return( m_pClasses[iClass]->m_Samples.Add_Row(Features) );
2673 }
2674 }
2675
2676 return( false );
2677 }
2678
2679 //---------------------------------------------------------
2680 bool CSG_Classifier_Supervised::Train(bool bClear_Samples)
2681 {
2682 if( m_nFeatures < 1 || m_nClasses < 1 )
2683 {
2684 return( false );
2685 }
2686
2687 for(int iClass=0; iClass<m_nClasses; iClass++)
2688 {
2689 if( !m_pClasses[iClass]->Train() )
2690 {
2691 return( false );
2692 }
2693 }
2694
2695 if( bClear_Samples )
2696 {
2697 Train_Clr_Samples();
2698 }
2699
2700 return( true );
2701 }
2702
2703
2705 // //
2707
2708 //---------------------------------------------------------
2709 bool CSG_Classifier_Supervised::CClass::Train(void)
2710 {
2711 if( m_Samples.Get_NCols() < 1 || m_Samples.Get_NRows() < 1 )
2712 {
2713 return( false );
2714 }
2715
2716 int iFeature;
2717
2718 //-----------------------------------------------------
2719 m_Mean.Create(m_Samples.Get_NCols());
2720 m_Min .Create(m_Samples.Get_NCols());
2721 m_Max .Create(m_Samples.Get_NCols());
2722
2723 for(iFeature=0; iFeature<m_Samples.Get_NCols(); iFeature++)
2724 {
2725 CSG_Simple_Statistics s;
2726
2727 for(int iSample=0; iSample<m_Samples.Get_NRows(); iSample++)
2728 {
2729 s += m_Samples[iSample][iFeature];
2730 }
2731
2732 m_Mean[iFeature] = s.Get_Mean ();
2733 m_Min [iFeature] = s.Get_Minimum();
2734 m_Max [iFeature] = s.Get_Maximum();
2735 }
2736
2737 //-----------------------------------------------------
2738 m_Cov.Create(m_Samples.Get_NCols(), m_Samples.Get_NCols());
2739
2740 for(iFeature=0; iFeature<m_Samples.Get_NCols(); iFeature++)
2741 {
2742 for(int jFeature=iFeature; jFeature<m_Samples.Get_NCols(); jFeature++)
2743 {
2744 double cov = 0.;
2745
2746 for(int iSample=0; iSample<m_Samples.Get_NRows(); iSample++)
2747 {
2748 cov += (m_Samples[iSample][iFeature] - m_Mean[iFeature]) * (m_Samples[iSample][jFeature] - m_Mean[jFeature]);
2749 }
2750
2751 if( m_Samples.Get_NRows() > 1 )
2752 {
2753 cov /= m_Samples.Get_NRows() - 1;
2754 }
2755
2756 m_Cov[iFeature][jFeature] = m_Cov[jFeature][iFeature] = cov;
2757 }
2758 }
2759
2760 m_Cov_Inv = m_Cov.Get_Inverse ();
2761 m_Cov_Det = m_Cov.Get_Determinant();
2762
2763 m_Mean_Spectral = CSG_Simple_Statistics(m_Mean).Get_Mean();
2764
2765 //-----------------------------------------------------
2766 return( true );
2767 }
2768
2769
2771 // //
2773
2774 //---------------------------------------------------------
2775 int CSG_Classifier_Supervised::Get_Class(const CSG_String &Class_ID)
2776 {
2777 if( m_nFeatures > 0 )
2778 {
2779 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2780 {
2781 if( !Get_Class_ID(iClass).Cmp(Class_ID) )
2782 {
2783 return( iClass );
2784 }
2785 }
2786 }
2787
2788 return( -1 );
2789 }
2790
2791 //---------------------------------------------------------
2792 bool CSG_Classifier_Supervised::Get_Class(const CSG_Vector &Features, int &Class, double &Quality, int Method)
2793 {
2794 Class = -1;
2795 Quality = 0.;
2796
2797 if( Get_Feature_Count() == Features.Get_N() )
2798 {
2799 switch( Method )
2800 {
2801 case SG_CLASSIFY_SUPERVISED_BinaryEncoding : _Get_Binary_Encoding (Features, Class, Quality); break;
2802 case SG_CLASSIFY_SUPERVISED_ParallelEpiped : _Get_Parallel_Epiped (Features, Class, Quality); break;
2803 case SG_CLASSIFY_SUPERVISED_MinimumDistance : _Get_Minimum_Distance (Features, Class, Quality); break;
2804 case SG_CLASSIFY_SUPERVISED_Mahalonobis : _Get_Mahalanobis_Distance (Features, Class, Quality); break;
2805 case SG_CLASSIFY_SUPERVISED_MaximumLikelihood: _Get_Maximum_Likelihood (Features, Class, Quality); break;
2806 case SG_CLASSIFY_SUPERVISED_SAM : _Get_Spectral_Angle_Mapping(Features, Class, Quality); break;
2807 case SG_CLASSIFY_SUPERVISED_SID : _Get_Spectral_Divergence (Features, Class, Quality); break;
2808 case SG_CLASSIFY_SUPERVISED_WTA : _Get_Winner_Takes_All (Features, Class, Quality); break;
2809 }
2810
2811 return( Class >= 0 );
2812 }
2813
2814 return( false );
2815 }
2816
2817
2819 // //
2821
2822 //---------------------------------------------------------
2823 CSG_String CSG_Classifier_Supervised::Get_Name_of_Method(int Method)
2824 {
2825 switch( Method )
2826 {
2827 case SG_CLASSIFY_SUPERVISED_BinaryEncoding : return( _TL("Binary Encoding") );
2828 case SG_CLASSIFY_SUPERVISED_ParallelEpiped : return( _TL("Parallelepiped") );
2829 case SG_CLASSIFY_SUPERVISED_MinimumDistance : return( _TL("Minimum Distance") );
2830 case SG_CLASSIFY_SUPERVISED_Mahalonobis : return( _TL("Mahalanobis Distance") );
2831 case SG_CLASSIFY_SUPERVISED_MaximumLikelihood: return( _TL("Maximum Likelihood") );
2832 case SG_CLASSIFY_SUPERVISED_SAM : return( _TL("Spectral Angle Mapping") );
2833 case SG_CLASSIFY_SUPERVISED_SID : return( _TL("Spectral Information Divergence") );
2834 case SG_CLASSIFY_SUPERVISED_SVM : return( _TL("Support Vector Machine") );
2835 case SG_CLASSIFY_SUPERVISED_WTA : return( _TL("Winner Takes All") );
2836 }
2837
2838 return( SG_T("") );
2839 }
2840
2841 //---------------------------------------------------------
2842 CSG_String CSG_Classifier_Supervised::Get_Name_of_Quality(int Method)
2843 {
2844 switch( Method )
2845 {
2846 case SG_CLASSIFY_SUPERVISED_BinaryEncoding : return( _TL("Difference") );
2847 case SG_CLASSIFY_SUPERVISED_ParallelEpiped : return( _TL("Memberships") );
2848 case SG_CLASSIFY_SUPERVISED_MinimumDistance : return( _TL("Distance") );
2849 case SG_CLASSIFY_SUPERVISED_Mahalonobis : return( _TL("Distance") );
2850 case SG_CLASSIFY_SUPERVISED_MaximumLikelihood: return( _TL("Proximity") );
2851 case SG_CLASSIFY_SUPERVISED_SAM : return( _TL("Angle") );
2852 case SG_CLASSIFY_SUPERVISED_SID : return( _TL("Divergence") );
2853 case SG_CLASSIFY_SUPERVISED_SVM : return( _TL("") );
2854 case SG_CLASSIFY_SUPERVISED_WTA : return( _TL("Votes") );
2855 }
2856
2857 return( SG_T("") );
2858 }
2859
2860
2862 // //
2864
2865 //---------------------------------------------------------
2866 // Mazer, A. S., Martin, M., Lee, M., and Solomon, J. E. (1988):
2867 // Image Processing Software for Imaging Spectrometry Analysis.
2868 // Remote Sensing of Environment, v. 24, no. 1, p. 201-210.
2869 //
2870 void CSG_Classifier_Supervised::_Get_Binary_Encoding(const CSG_Vector &Features, int &Class, double &Quality)
2871 {
2872 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2873 {
2874 CClass *pClass = m_pClasses[iClass];
2875
2876 double Mean_Spectral = CSG_Simple_Statistics(Features).Get_Mean();
2877
2878 int d = 0;
2879
2880 for(int iFeature=0; iFeature<Get_Feature_Count(); iFeature++)
2881 {
2882 d += (Features(iFeature) < Mean_Spectral) == (pClass->m_Mean[iFeature] < pClass->m_Mean_Spectral) ? 0 : 1;
2883
2884 if( iFeature == 0 ) // spectral slopes
2885 {
2886 d += (Features[iFeature ] < Features[iFeature + 1]) == (pClass->m_Mean[iFeature ] < pClass->m_Mean[iFeature + 1]) ? 0 : 1;
2887 }
2888 else if( iFeature == Get_Feature_Count() - 1 )
2889 {
2890 d += (Features[iFeature - 1] < Features[iFeature ]) == (pClass->m_Mean[iFeature - 1] < pClass->m_Mean[iFeature ]) ? 0 : 1;
2891 }
2892 else
2893 {
2894 d += (Features[iFeature - 1] < Features[iFeature + 1]) == (pClass->m_Mean[iFeature - 1] < pClass->m_Mean[iFeature + 1]) ? 0 : 1;
2895 }
2896 }
2897
2898 if( Class < 0 || Quality > d ) // find the minimum 'Hamming' distance
2899 {
2900 Quality = d;
2901 Class = iClass;
2902 }
2903 }
2904 }
2905
2906 //---------------------------------------------------------
2907 void CSG_Classifier_Supervised::_Get_Parallel_Epiped(const CSG_Vector &Features, int &Class, double &Quality)
2908 {
2909 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2910 {
2911 CClass *pClass = m_pClasses[iClass];
2912
2913 bool bMember = true;
2914
2915 for(int iFeature=0; bMember && iFeature<Get_Feature_Count(); iFeature++)
2916 {
2917 bMember = pClass->m_Min[iFeature] <= Features[iFeature] && Features[iFeature] <= pClass->m_Max[iFeature];
2918 }
2919
2920 if( bMember )
2921 {
2922 Quality ++;
2923 Class = iClass;
2924 }
2925 }
2926 }
2927
2928 //---------------------------------------------------------
2929 void CSG_Classifier_Supervised::_Get_Minimum_Distance(const CSG_Vector &Features, int &Class, double &Quality)
2930 {
2931 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2932 {
2933 CClass *pClass = m_pClasses[iClass];
2934
2935 double Distance = (Features - pClass->m_Mean).Get_Length();
2936
2937 if( Class < 0 || Quality > Distance )
2938 {
2939 Quality = Distance;
2940 Class = iClass;
2941 }
2942 }
2943
2944 if( m_Threshold_Distance > 0. && Quality > m_Threshold_Distance )
2945 {
2946 Class = -1;
2947 }
2948 }
2949
2950 //---------------------------------------------------------
2951 void CSG_Classifier_Supervised::_Get_Mahalanobis_Distance(const CSG_Vector &Features, int &Class, double &Quality)
2952 {
2953 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2954 {
2955 CClass *pClass = m_pClasses[iClass];
2956
2957 CSG_Vector D = Features - pClass->m_Mean;
2958
2959 double Distance = D * (pClass->m_Cov_Inv * D);
2960
2961 if( Class < 0 || Quality > Distance )
2962 {
2963 Quality = Distance;
2964 Class = iClass;
2965 }
2966 }
2967
2968 if( m_Threshold_Distance > 0. && Quality > m_Threshold_Distance )
2969 {
2970 Class = -1;
2971 }
2972 }
2973
2974 //---------------------------------------------------------
2975 void CSG_Classifier_Supervised::_Get_Maximum_Likelihood(const CSG_Vector &Features, int &Class, double &Quality)
2976 {
2977 double dSum = 0.;
2978
2979 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
2980 {
2981 CClass *pClass = m_pClasses[iClass];
2982
2983 CSG_Vector D = Features - pClass->m_Mean;
2984
2985 double Distance = D * (pClass->m_Cov_Inv * D);
2986
2987 double Probability = pow(2. * M_PI, -0.5 * m_nFeatures) * pow(pClass->m_Cov_Det, -0.5) * exp(-0.5 * Distance);
2988 // double Probability = -log(pClass->m_Cov_Det) - Distance;
2989
2990 dSum += Probability;
2991
2992 if( Class < 0 || Quality < Probability )
2993 {
2994 Quality = Probability;
2995 Class = iClass;
2996 }
2997 }
2998
2999 if( Class >= 0 )
3000 {
3001 if( m_Probability_Relative )
3002 {
3003 Quality = 100. * Quality / dSum;
3004 }
3005
3006 if( m_Threshold_Probability > 0. && Quality < m_Threshold_Probability )
3007 {
3008 Class = -1;
3009 }
3010 }
3011 }
3012
3013 //---------------------------------------------------------
3014 void CSG_Classifier_Supervised::_Get_Spectral_Angle_Mapping(const CSG_Vector &Features, int &Class, double &Quality)
3015 {
3016 for(int iClass=0; iClass<Get_Class_Count(); iClass++)
3017 {
3018 CClass *pClass = m_pClasses[iClass];
3019
3020 double Angle = Features.Get_Angle(pClass->m_Mean);
3021
3022 if( Class < 0 || Quality > Angle )
3023 {
3024 Quality = Angle;
3025 Class = iClass;
3026 }
3027 }
3028
3029 Quality *= M_RAD_TO_DEG;
3030
3031 if( m_Threshold_Angle > 0. && Quality > m_Threshold_Angle )
3032 {
3033 Class = -1;
3034 }
3035 }
3036
3037 //---------------------------------------------------------
3038 void CSG_Classifier_Supervised::_Get_Spectral_Divergence(const CSG_Vector &Features, int &Class, double &Quality)
3039 {
3040 }
3041
3042 //---------------------------------------------------------
3043 void CSG_Classifier_Supervised::_Get_Winner_Takes_All(const CSG_Vector &Features, int &Class, double &Quality)
3044 {
3045 int *Votes = (int *)SG_Calloc(Get_Class_Count(), sizeof(int));
3046
3047 for(int iMethod=0; iMethod<SG_CLASSIFY_SUPERVISED_WTA; iMethod++)
3048 {
3049 int iClass;
3050 double iQuality;
3051
3052 if( m_bWTA[iMethod] && Get_Class(Features, iClass, iQuality, iMethod) && ++Votes[iClass] > Quality )
3053 {
3054 Quality = Votes[iClass];
3055 Class = iClass;
3056 }
3057 }
3058
3059 SG_Free(Votes);
3060 }
3061
3062
3064 // //
3065 // //
3066 // //
3068
3069 //---------------------------------------------------------
3070 // source: http://psydok.sulb.uni-saarland.de/volltexte/2004/268/html/
3071
3072 //---------------------------------------------------------
3073 double CSG_Test_Distribution::Get_T_Tail(double T, int df, TSG_Test_Distribution_Type Type)
3074 { // Hill's approx. to cumulative t-dist, Commun.A.C.M. 13,617-619.
3075 // See: J.H.Maindonald, Computational Statistics, p.295.
3076 // Calculates p given t and tail type.
3077
3078 if( !T || !df || df < 1. )
3079 {
3080 return( -1. );
3081 }
3082
3083 return( _Change_Tail_Type(Get_T_P(T, df), TESTDIST_TYPE_TwoTail, Type, T < 0.) );
3084 }
3085
3086 //---------------------------------------------------------
3087 double CSG_Test_Distribution::Get_T_Inverse(double p, int df, TSG_Test_Distribution_Type Type)
3088 { // Keith Dear & Robert Brennan.
3089 // Returns an accurate t to tol sig. fig.'s given p & df.
3090
3091 if( p <= 0. || p >= 1. || df < 1 )
3092 {
3093 return( -1. );
3094 }
3095
3096 bool bNegative = (Type == TESTDIST_TYPE_Left && p < 0.5) || (Type == TESTDIST_TYPE_Right && p > 0.5);
3097 double t, p0, p1, diff;
3098
3099 p0 = p1 = _Change_Tail_Type(p, Type, TESTDIST_TYPE_TwoTail, bNegative);
3100 diff = 1.;
3101
3102 while( fabs(diff) > 0.0001 )
3103 {
3104 t = Get_T_Inv(p1, df); // initial rough value
3105 diff = Get_T_P(t, df) - p0; // compare result with forward fn
3106 p1 = p1 - diff; // small adjustment to p1
3107 }
3108
3109 return( bNegative ? -t : t );
3110 }
3111
3112 //---------------------------------------------------------
3113 double CSG_Test_Distribution::_Change_Tail_Type(double p, TSG_Test_Distribution_Type from, TSG_Test_Distribution_Type to, bool bNegative)
3114 {
3115 if( from != to )
3116 {
3117 switch( from ) // convert any tail type to 'left'
3118 {
3119 case TESTDIST_TYPE_Left : break;
3120 case TESTDIST_TYPE_Right : p = 1. - p; break;
3121 case TESTDIST_TYPE_Middle : p = p / 2. + 0.5; if( bNegative ) p = 1. - p; break;
3122 case TESTDIST_TYPE_TwoTail: p = 1. - p / 2. ; if( bNegative ) p = 1. - p; break;
3123 // case TESTDIST_TYPE_Half : p = p + 0.5 ; if( bNegative ) p = 1. - p; break;
3124 }
3125
3126 switch( to ) // convert p from tail type 'left' to any other
3127 {
3128 case TESTDIST_TYPE_Left : break;
3129 case TESTDIST_TYPE_Right : p = 1. - p; break;
3130 case TESTDIST_TYPE_Middle : if( bNegative ) p = 1. - p; p = 2. * (1. - p); break;
3131 case TESTDIST_TYPE_TwoTail: if( bNegative ) p = 1. - p; p = 2. * p - 1. ; break;
3132 // case TESTDIST_TYPE_Half : if( bNegative ) p = 1. - p; p = p - 0.5 ; break;
3133 }
3134 }
3135
3136 return( p );
3137 }
3138
3139 //---------------------------------------------------------
3140 double CSG_Test_Distribution::Get_Norm_P(double z)
3141 { // Returns the two-tailed standard normal probability of z
3142 const double a1 = 0.0000053830, a2 = 0.0000488906, a3 = 0.0000380036,
3143 a4 = 0.0032776263, a5 = 0.0211410061, a6 = 0.0498673470;
3144
3145 double p;
3146
3147 z = fabs(z);
3148
3149 p = (((((a1 * z + a2) * z + a3) * z + a4) * z + a5) * z + a6) * z + 1.;
3150
3151 return( pow(p, -16) );
3152 }
3153
3154 //---------------------------------------------------------
3155 double CSG_Test_Distribution::Get_Norm_Z(double p)
3156 { // Returns z given a half-middle tail type p.
3157 const double a0 = 2.5066282, a1 = -18.6150006, a2 = 41.3911977, a3 = -25.4410605,
3158 b1 = -8.4735109, b2 = 23.0833674, b3 = -21.0622410, b4 = 3.1308291,
3159 c0 = -2.7871893, c1 = -2.2979648, c2 = 4.8501413, c3 = 2.3212128,
3160 d1 = 3.5438892, d2 = 1.6370678;
3161
3162 double r, z;
3163
3164 if( p > 0.42 )
3165 {
3166 r = sqrt(-log(0.5 - p));
3167 z = (((c3 * r + c2) * r + c1) * r + c0) / ((d2 * r + d1) * r + 1.);
3168 }
3169 else
3170 {
3171 r = p * p;
3172 z = p * (((a3 * r + a2) * r + a1) * r + a0) / ((((b4 * r + b3) * r + b2) * r + b1) * r + 1.);
3173 }
3174
3175 return( z );
3176 }
3177
3178 //---------------------------------------------------------
3179 double CSG_Test_Distribution::Get_T_P(double T, int df)
3180 { // Returns two-tail probability level given t and df.
3181 return( df == 1 ? 1. - 2. * atan(fabs(T)) / M_PI
3182 : df == 2 ? 1. - fabs(T) / sqrt(T*T + 2.)
3183 : df == 3 ? 1. - 2. * (atan(fabs(T) / sqrt(3.)) + fabs(T) * sqrt(3.) / (T*T + 3.)) / M_PI
3184 : df == 4 ? 1. - fabs(T) * (1. + 2. / (T*T + 4.)) / sqrt(T*T + 4.)
3185 : Get_Norm_P(Get_T_Z(fabs(T), df))
3186 );
3187 }
3188
3189 //---------------------------------------------------------
3190 double CSG_Test_Distribution::Get_T_Z(double T, int df)
3191 { // Converts a t value to an approximate z value w.r.t the given df
3192 // s.t. std.norm.(z) = t(z, df) at the two-tail probability level.
3193
3194 double A9, B9, T9, Z8, P7, B7, z;
3195
3196 A9 = df - 0.5;
3197 B9 = 48. * A9*A9,
3198 T9 = T*T / df;
3199 Z8 = T9 >= 0.04
3200 ? A9 * log(1. + T9)
3201 : A9 * (((1. - T9 * 0.75) * T9 / 3. - 0.5) * T9 + 1.) * T9;
3202 P7 = ((0.4 * Z8 + 3.3) * Z8 + 24.) * Z8 + 85.5;
3203 B7 = 0.8 * pow(Z8, 2.) + 100. + B9;
3204 z = (1. + (-P7 / B7 + Z8 + 3.) / B9) * sqrt(Z8);
3205
3206 return( z );
3207 }
3208
3209 //---------------------------------------------------------
3210 double CSG_Test_Distribution::Get_T_Inv(double p, int df)
3211 { // Hill's approx. inverse t-dist.: Comm. of A.C.M Vol.13 No.10 1970 pg 620.
3212 // Calculates t given df and two-tail probability.
3213
3214 if( df == 1 )
3215 {
3216 return( cos(p * M_PI / 2.) / sin(p * M_PI / 2.) );
3217 }
3218
3219 if( df == 2 )
3220 {
3221 return( sqrt(2. / (p * (2. - p)) - 2.) );
3222 }
3223
3224 double a, b, c, d, x, y;
3225
3226 a = 1. / (df - 0.5);
3227 b = 48. / (a*a);
3228 c = ((20700. * a / b - 98.) * a - 16.) * a + 96.36;
3229 d = ((94.5 / (b + c) - 3.) / b + 1.) * sqrt(a * M_PI / 2.) * df;
3230 x = d * p;
3231 y = pow(x, 2. / df);
3232
3233 if( y > 0.05 + a )
3234 {
3235 x = Get_Norm_Z(0.5 * (1. - p));
3236 y = x*x;
3237
3238 if( df < 5 )
3239 {
3240 c = c + 0.3 * (df - 4.5) * (x + 0.6);
3241 }
3242
3243 c = (((0.05 * d * x - 5) * x - 7.) * x - 2.) * x + b + c;
3244 y = (((((0.4 * y + 6.3) * y + 36.) * y + 94.5) / c - y - 3.) / b + 1.) * x;
3245 y = a * y*y;
3246
3247 if( y > 0.002 )
3248 {
3249 y = exp(y) - 1.;
3250 }
3251 else
3252 {
3253 y = 0.5 * y*y + y;
3254 }
3255 }
3256 else
3257 {
3258 y = ((1. / (((df + 6.) / (df * y) - 0.089 * d - 0.822) * (df + 2.) * 3.)
3259 + 0.5 / (df + 4.)) * y - 1.) * (df + 1.) / (df + 2.) + 1. / y;
3260 }
3261
3262 return( sqrt(df * y) );
3263 }
3264
3265
3267 // //
3269
3270 //---------------------------------------------------------
3271 double CSG_Test_Distribution::Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type)
3272 {
3273 double F = (nSamples - nPredictors - 1) * (R2 / nPredictors) / (1. - R2);
3274
3275 return( CSG_Test_Distribution::Get_F_Tail(F, nPredictors, nSamples - nPredictors - 1, Type) );
3276 }
3277
3278 //---------------------------------------------------------
3279 double CSG_Test_Distribution::Get_F_Tail(double F, int dfn, int dfd, TSG_Test_Distribution_Type Type)
3280 {
3281 // calculates for F, dfn(ominator) and dfd(enominator) the "tail" of the F-distribution
3282
3283 double p = 1.;
3284
3285 if( F >= 0.00001 && dfn > 0 && dfd > 0 )
3286 {
3287 if( F * dfn >= dfd || F > 1. + 20. / dfn + 10. / sqrt((double)dfn) )
3288 {
3289 p = Get_Gamma(F, dfn, dfd);
3290 }
3291 else
3292 {
3293 p = 1. - Get_Gamma(1. / F, dfd, dfn);
3294 }
3295 }
3296
3297 if( p <= 0. || p >= 1. )
3298 {
3299 p = F > 1. ? 0. : F < 1. ? 1. : 0.5;
3300 }
3301
3302 return( Type == TESTDIST_TYPE_Right ? p : 1. - p );
3303 }
3304
3305 //---------------------------------------------------------
3306 double CSG_Test_Distribution::Get_F_Inverse(double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type)
3307 {
3308 if( alpha < 0. || alpha > 1. || dfd < 0 || dfn < 0 )
3309 {
3310 return( -1 );
3311 }
3312
3313 if( Type != TESTDIST_TYPE_Right )
3314 {
3315 alpha = 1. - alpha;
3316 }
3317
3318 const int ITERMAX = 100;
3319 const double EPSILON = 0.0001;
3320
3321 int i;
3322 double lo, hi, mid, p;
3323
3324 if( alpha <= 0.5 )
3325 {
3326 lo = 0.5;
3327 hi = lo;
3328
3329 for(i=0; i<ITERMAX; i++)
3330 {
3331 hi *= 2.;
3332 p = Get_F_Tail(hi, dfn, dfd);
3333
3334 if( p > alpha )
3335 {
3336 lo = hi;
3337 }
3338 else
3339 {
3340 break;
3341 }
3342 }
3343
3344 if( p > alpha )
3345 {
3346 return( hi );
3347 }
3348 }
3349 else
3350 {
3351 hi = 2;
3352 lo = hi;
3353
3354 for(i=0; i<ITERMAX; i++)
3355 {
3356 lo /= 2.;
3357 p = Get_F_Tail(lo, dfn, dfd);
3358
3359 if( p < alpha )
3360 {
3361 hi = lo;
3362 }
3363 else
3364 {
3365 break;
3366 }
3367 }
3368
3369 if( p < alpha )
3370 {
3371 return( lo );
3372 }
3373 }
3374
3375 mid = (hi + lo) / 2.;
3376
3377 for(i=0; i<ITERMAX && (hi-lo)>EPSILON*mid; i++)
3378 {
3379 mid = (hi + lo) / 2.;
3380 p = Get_F_Tail(mid, dfn, dfd);
3381
3382 if( p < alpha )
3383 hi = mid;
3384 else if( p > alpha )
3385 lo = mid;
3386 else
3387 break;
3388 }
3389
3390 return( mid );
3391 }
3392
3393 //---------------------------------------------------------
3394 double CSG_Test_Distribution::Get_Gamma(double F, double dfn, double dfd)
3395 {
3396 // calculates for F, dfn(ominator) and dfd(enominator) the incomplete Gamma-function
3397
3398 const double EXPMIN = -30.;
3399 const double SMALL = 0.00000000001;
3400
3401 double x, c, er, s, n, t1, t;
3402
3403 dfn /= 2.;
3404 dfd /= 2.;
3405
3406 x = dfd / (dfd + dfn * F);
3407 c = Get_Log_Gamma(dfn + dfd) - Get_Log_Gamma(dfn) - Get_Log_Gamma(dfd + 1.) + dfd * log(x) + dfn * log(1. - x);
3408
3409 if( c < EXPMIN )
3410 {
3411 return( -1. );
3412 }
3413
3414 dfn += dfd;
3415 dfd += 1.;
3416 c = exp(c);
3417 er = SMALL / c;
3418 t = dfn * x / dfd;
3419 t1 = 0.;
3420 s = t + 1.;
3421 n = 0;
3422
3423 while( t > er || t > t1 )
3424 {
3425 n += 1;
3426 t1 = t;
3427 t *= ((dfn + n) * x / (dfd + n));
3428 s += t;
3429 }
3430
3431 return( s * c );
3432 }
3433
3434 //---------------------------------------------------------
3435 double CSG_Test_Distribution::Get_Log_Gamma(double a)
3436 {
3437 // calculates the logarithm of the Gamma-function
3438
3439 const int ARGMIN = 6;
3440
3441 const double HL2PI = 0.91893853320467275; // = log(2. * M_PI) / 2.
3442
3443 int n = (int)floor(ARGMIN - a + 0.0001);
3444
3445 if( n > 0 )
3446 {
3447 a += n;
3448 }
3449
3450 double g;
3451
3452 g = 1. / (a*a);
3453 g = (1. - g * (1. / 30. - g * (1. / 105. - g * (1. / 140. - g / 99.)))) / (12. * a);
3454 g = g + ((a - 0.5) * log(a) - a + HL2PI);
3455
3456 for(int i=0; i<n; i++)
3457 {
3458 a = a - 1.;
3459 g = g - log(a);
3460 }
3461
3462 return( g );
3463 }
3464
3465
3467 // //
3468 // //
3469 // //
3471
3472 //---------------------------------------------------------
3473 CSG_Matrix SG_Get_Correlation_Matrix (const CSG_Matrix &Values, bool bCovariances)
3474 {
3475 int nVariables = Values.Get_NX();
3476 int nSamples = Values.Get_NY();
3477
3478 //-----------------------------------------------------
3479 int i, j, k;
3480 CSG_Simple_Statistics *S;
3481 CSG_Matrix C;
3482
3483 C.Create(nVariables, nVariables);
3484
3485 //-----------------------------------------------------
3486 S = new CSG_Simple_Statistics[nVariables];
3487
3488 for(j=0; j<nVariables; j++)
3489 {
3490 for(i=0; i<nSamples; i++)
3491 {
3492 S[j] += Values[i][j];
3493 }
3494 }
3495
3496 //-----------------------------------------------------
3497 for(k=0; k<nVariables; k++)
3498 {
3499 for(j=k; j<nVariables; j++)
3500 {
3501 double cov = 0.;
3502
3503 for(i=0; i<nSamples; i++)
3504 {
3505 cov += (Values[i][j] - S[j].Get_Mean()) * (Values[i][k] - S[k].Get_Mean());
3506 }
3507
3508 cov /= nSamples;
3509
3510 if( !bCovariances )
3511 {
3512 cov /= (S[j].Get_StdDev() * S[k].Get_StdDev());
3513 }
3514
3515 C[j][k] = C[k][j] = cov;
3516 }
3517 }
3518
3519 //-----------------------------------------------------
3520 delete[](S);
3521
3522 return( C );
3523 }
3524
3525
3527 // //
3528 // //
3529 // //
3531
3532 //---------------------------------------------------------
CSG_Classifier_Supervised::Destroy
void Destroy(void)
Definition: mat_tools.cpp:2398
SG_Get_Correlation_Matrix
CSG_Matrix SG_Get_Correlation_Matrix(const CSG_Matrix &Values, bool bCovariances)
Definition: mat_tools.cpp:3473
CSG_Table::Find_Record
virtual bool Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
Definition: table.cpp:950
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Test_Distribution::Get_F_Tail
static double Get_F_Tail(double F, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3279
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
SG_Compare_Int
int SG_Compare_Int(const void *a, const void *b)
Definition: mat_tools.cpp:187
CSG_Histogram::Get_Cumulative
size_t Get_Cumulative(int i) const
Definition: mat_tools.h:1026
CSG_Matrix::Get_Inverse
CSG_Matrix Get_Inverse(bool bSilent=true, int nSubSquare=0) const
Definition: mat_matrix.cpp:1845
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Cluster_Analysis::Set_Feature
bool Set_Feature(sLong iElement, int iFeature, double Value)
Definition: mat_tools.cpp:2031
SG_Get_Double_asString
CSG_String SG_Get_Double_asString(double Number, int Width, int Precision, bool bScientific)
Definition: mat_tools.cpp:159
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Simple_Statistics::Get_SkewnessPearson
double Get_SkewnessPearson(void)
Definition: mat_tools.cpp:606
CSG_Histogram::Update
bool Update(void)
Definition: mat_tools.cpp:1363
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Cluster_Analysis::Execute
bool Execute(int Method, int nClusters, int nMaxIterations=0, int Initialization=0)
Definition: mat_tools.cpp:2054
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Category_Statistics::Destroy
void Destroy(void)
Definition: mat_tools.cpp:1001
CSG_Unique_Value_Statistics::m_Count
CSG_Array_Int m_Count
Definition: mat_tools.h:814
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
CSG_Cluster_Analysis::Create
bool Create(int nFeatures)
Definition: mat_tools.cpp:2008
CSG_Classifier_Supervised::Print
CSG_String Print(void)
Definition: mat_tools.cpp:2566
CSG_Simple_Statistics::m_Minimum
double m_Minimum
Definition: mat_tools.h:777
SG_CLASSIFY_SUPERVISED_Mahalonobis
@ SG_CLASSIFY_SUPERVISED_Mahalonobis
Definition: mat_tools.h:1197
CSG_Simple_Statistics::Get_Median
double Get_Median(void)
Definition: mat_tools.cpp:669
TESTDIST_TYPE_Right
@ TESTDIST_TYPE_Right
Definition: mat_tools.h:1496
SG_Compare_Char_Ptr
int SG_Compare_Char_Ptr(const void *a, const void *b)
Definition: mat_tools.cpp:211
M_RAD_TO_DEG
#define M_RAD_TO_DEG
Definition: mat_tools.h:110
CSG_Simple_Statistics::CSG_Simple_Statistics
CSG_Simple_Statistics(void)
Definition: mat_tools.cpp:324
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_Classifier_Supervised::Get_Threshold_Angle
double Get_Threshold_Angle(void)
Definition: mat_tools.cpp:2426
CSG_Histogram::Get_Percentile
double Get_Percentile(double Percentile) const
Definition: mat_tools.cpp:1444
SG_Get_Rounded
double SG_Get_Rounded(double Value, int Decimals)
Definition: mat_tools.cpp:83
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Table_Record
Definition: table.h:130
CSG_Array_Int::Add
bool Add(int Value)
Definition: api_memory.cpp:567
CSG_Classifier_Supervised::Get_Probability_Relative
bool Get_Probability_Relative(void)
Definition: mat_tools.cpp:2434
CSG_Histogram::Get_Break
double Get_Break(int i) const
Definition: mat_tools.h:1031
CSG_Classifier_Supervised::Train_Add_Sample
bool Train_Add_Sample(const CSG_String &Class_ID, const CSG_Vector &Features)
Definition: mat_tools.cpp:2652
TESTDIST_TYPE_Middle
@ TESTDIST_TYPE_Middle
Definition: mat_tools.h:1497
SG_Decimal_To_Degree
void SG_Decimal_To_Degree(double Value, double &Deg, double &Min, double &Sec)
Definition: mat_tools.cpp:233
CSG_Category_Statistics::~CSG_Category_Statistics
virtual ~CSG_Category_Statistics(void)
Definition: mat_tools.cpp:986
CSG_Classifier_Supervised::Set_Threshold_Angle
void Set_Threshold_Angle(double Value)
Definition: mat_tools.cpp:2425
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CSG_Unique_Value_Statistics::Get_Minority
virtual int Get_Minority(bool bWeighted=false) const
Definition: mat_tools.cpp:833
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_Histogram
Definition: mat_tools.h:986
CSG_Classifier_Supervised::Add_Class
bool Add_Class(const CSG_String &Class_ID, const CSG_Vector &Mean, const CSG_Vector &Min, const CSG_Vector &Max, const CSG_Matrix &Cov)
Definition: mat_tools.cpp:2602
CSG_Random::Get_Uniform
static double Get_Uniform(void)
Definition: mat_tools.cpp:274
C
#define C
SG_Get_Rounded_To_SignificantFigures
double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
Definition: mat_tools.cpp:107
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
CSG_Simple_Statistics::m_Variance
double m_Variance
Definition: mat_tools.h:777
CSG_Simple_Statistics::Get_nValues_Above
sLong Get_nValues_Above(double Threshold, bool bEquals=false)
Definition: mat_tools.cpp:758
CSG_Random::Get_Gaussian
static double Get_Gaussian(double mean, double stddev)
Definition: mat_tools.cpp:298
CSG_Simple_Statistics::m_StdDev
double m_StdDev
Definition: mat_tools.h:777
CSG_Array_Int::Create
int * Create(const CSG_Array_Int &Array)
Definition: api_memory.cpp:551
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
CSG_Category_Statistics::Get_Count
int Get_Count(void) const
Definition: mat_tools.cpp:1117
CSG_Classifier_Supervised::Get_Feature_Count
int Get_Feature_Count(void)
Definition: mat_tools.h:1227
saga_api.h
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
grid.h
CSG_Category_Statistics::Get_Minority
int Get_Minority(void)
Definition: mat_tools.cpp:1183
CSG_Simple_Statistics::Get_Sum
double Get_Sum(void)
Definition: mat_tools.h:734
CSG_Histogram::Create
bool Create(const CSG_Histogram &Histogram)
Definition: mat_tools.cpp:1495
CSG_Classifier_Supervised::CSG_Classifier_Supervised
CSG_Classifier_Supervised(void)
Definition: mat_tools.cpp:2359
CSG_Grids::Get_NCells
sLong Get_NCells(void) const
Definition: grids.h:188
CSG_Unique_String_Statistics::Get_Class_Index
int Get_Class_Index(const CSG_String &Value) const
Definition: mat_tools.cpp:957
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Category_Statistics::Sort
bool Sort(void)
Definition: mat_tools.cpp:1105
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Simple_Statistics::m_Gini
double m_Gini
Definition: mat_tools.h:777
CSG_Cluster_Analysis::Add_Element
bool Add_Element(void)
Definition: mat_tools.cpp:2025
CSG_Simple_Statistics::Evaluate
bool Evaluate(void)
Definition: mat_tools.cpp:473
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Simple_Statistics::m_Skewness
double m_Skewness
Definition: mat_tools.h:777
CSG_Cluster_Analysis::~CSG_Cluster_Analysis
virtual ~CSG_Cluster_Analysis(void)
Definition: mat_tools.cpp:1988
CSG_Classifier_Supervised::Get_Class
int Get_Class(const CSG_String &Class_ID)
Definition: mat_tools.cpp:2775
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_Test_Distribution::Get_F_Inverse
static double Get_F_Inverse(double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3306
CSG_Classifier_Supervised::Set_Threshold_Distance
void Set_Threshold_Distance(double Value)
Definition: mat_tools.cpp:2421
CSG_Histogram::~CSG_Histogram
virtual ~CSG_Histogram(void)
Definition: mat_tools.cpp:1266
SG_Compare_Double
int SG_Compare_Double(const void *a, const void *b)
Definition: mat_tools.cpp:199
CSG_Unique_Number_Statistics::Add_Value
void Add_Value(double Value, double Weight=1.)
Definition: mat_tools.cpp:875
CSG_Random::CSG_Random
CSG_Random(void)
Definition: mat_tools.cpp:254
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Histogram::Get_Element_Count
size_t Get_Element_Count(void) const
Definition: mat_tools.h:1020
CSG_Natural_Breaks::Create
bool Create(class CSG_Table *pTable, int Field, int nClasses, int Histogram=0)
Definition: mat_tools.cpp:1747
CSG_Histogram::Get_Center
double Get_Center(int i) const
Definition: mat_tools.h:1034
CSG_Matrix::Get_NCols
sLong Get_NCols(void) const
Definition: mat_tools.h:507
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
SG_CLASSIFY_SUPERVISED_SVM
@ SG_CLASSIFY_SUPERVISED_SVM
Definition: mat_tools.h:1202
mat_tools.h
CSG_Category_Statistics::Get_Majority
int Get_Majority(void)
Definition: mat_tools.cpp:1161
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
SG_CLASSIFY_SUPERVISED_SID
@ SG_CLASSIFY_SUPERVISED_SID
Definition: mat_tools.h:1201
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Random::Initialize
static void Initialize(void)
Definition: mat_tools.cpp:260
CSG_Classifier_Supervised::Get_Name_of_Quality
static CSG_String Get_Name_of_Quality(int Method)
Definition: mat_tools.cpp:2842
CSG_Category_Statistics::Get_Category_Type
TSG_Data_Type Get_Category_Type(void) const
Definition: mat_tools.cpp:1007
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:437
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Simple_Statistics::Get_nValues_Below
sLong Get_nValues_Below(double Threshold, bool bEquals=false)
Definition: mat_tools.cpp:780
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Natural_Breaks::~CSG_Natural_Breaks
virtual ~CSG_Natural_Breaks(void)
Definition: mat_tools.cpp:1714
SG_CLASSIFY_SUPERVISED_WTA
@ SG_CLASSIFY_SUPERVISED_WTA
Definition: mat_tools.h:1200
CSG_Vector
Definition: mat_tools.h:345
TSG_Test_Distribution_Type
TSG_Test_Distribution_Type
Definition: mat_tools.h:1494
CSG_Test_Distribution::Get_Norm_P
static double Get_Norm_P(double Z)
Definition: mat_tools.cpp:3140
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Natural_Breaks::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1097
CSG_Cluster_Analysis::Get_nElements
sLong Get_nElements(void) const
Definition: mat_tools.h:1150
CSG_Unique_String_Statistics::Add_Value
void Add_Value(const CSG_String &Value, double Weight=1.)
Definition: mat_tools.cpp:930
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1022
CSG_Cluster_Analysis::Destroy
bool Destroy(void)
Definition: mat_tools.cpp:1994
CSG_Classifier_Supervised::Get_WTA
bool Get_WTA(int Method)
Definition: mat_tools.cpp:2445
CSG_Classifier_Supervised::Get_Class_ID
const CSG_String & Get_Class_ID(int iClass)
Definition: mat_tools.h:1231
CSG_Vector::Create
bool Create(const CSG_Vector &Vector)
Definition: mat_matrix.cpp:87
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
CSG_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:291
CSG_Histogram::Get_Quantile_Value
double Get_Quantile_Value(double Value) const
Definition: mat_tools.cpp:1453
CSG_Simple_Statistics::_Evaluate
void _Evaluate(int Level=1)
Definition: mat_tools.cpp:562
CSG_Simple_Statistics::m_Mean
double m_Mean
Definition: mat_tools.h:777
CSG_Classifier_Supervised::Load
bool Load(const CSG_String &File)
Definition: mat_tools.cpp:2459
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
CSG_Classifier_Supervised::Save
bool Save(const CSG_String &File, const SG_Char *Feature_Info=NULL)
Definition: mat_tools.cpp:2519
CSG_Grids::is_NoData
virtual bool is_NoData(int x, int y, int z) const
Definition: grids.h:358
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Category_Statistics::asString
CSG_String asString(int iCategory) const
Definition: mat_tools.cpp:1148
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Simple_Statistics::m_bEvaluated
int m_bEvaluated
Definition: mat_tools.h:773
CSG_Simple_Statistics::Get_StdDev
double Get_StdDev(void)
Definition: mat_tools.h:738
CSG_Classifier_Supervised::Get_Class_Count
int Get_Class_Count(void)
Definition: mat_tools.h:1229
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_Get_Square
double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
CSG_Test_Distribution::Get_Norm_Z
static double Get_Norm_Z(double P)
Definition: mat_tools.cpp:3155
CSG_Category_Statistics::Add_Value
int Add_Value(int Value)
Definition: mat_tools.cpp:1047
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
SG_CLASSIFY_SUPERVISED_SAM
@ SG_CLASSIFY_SUPERVISED_SAM
Definition: mat_tools.h:1199
CSG_Vector::Get_Angle
double Get_Angle(const CSG_Vector &Vector) const
Definition: mat_matrix.cpp:703
CSG_Array_Int
Definition: api_core.h:421
CSG_Simple_Statistics::is_Evaluated
int is_Evaluated(void) const
Definition: mat_tools.h:724
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
CSG_Unique_Number_Statistics::Get_Class_Index
int Get_Class_Index(double Value) const
Definition: mat_tools.cpp:902
CSG_Unique_Value_Statistics::m_Weight
CSG_Vector m_Weight
Definition: mat_tools.h:816
CSG_Classifier_Supervised::Set_WTA
void Set_WTA(int Method, bool bOn)
Definition: mat_tools.cpp:2437
CSG_Classifier_Supervised::Get_Name_of_Method
static CSG_String Get_Name_of_Method(int Method)
Definition: mat_tools.cpp:2823
SG_CLASSIFY_SUPERVISED_ParallelEpiped
@ SG_CLASSIFY_SUPERVISED_ParallelEpiped
Definition: mat_tools.h:1195
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Simple_Statistics::Get_Percentile
double Get_Percentile(double Percentile)
Definition: mat_tools.cpp:658
CSG_Category_Statistics::Get_Category
int Get_Category(int Value) const
Definition: mat_tools.cpp:1018
CSG_Histogram::Scale_Element_Count
bool Scale_Element_Count(double Scale)
Definition: mat_tools.cpp:1345
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
CSG_Unique_Value_Statistics::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:802
CSG_Category_Statistics::asDouble
double asDouble(int iCategory) const
Definition: mat_tools.cpp:1140
CSG_Table_Record::Add_Value
bool Add_Value(int Field, double Value)
Definition: table_record.cpp:329
SG_CLASSIFY_SUPERVISED_MaximumLikelihood
@ SG_CLASSIFY_SUPERVISED_MaximumLikelihood
Definition: mat_tools.h:1198
CSG_Histogram::Get_Class_Count
size_t Get_Class_Count(void) const
Definition: mat_tools.h:1018
CSG_Simple_Statistics::Set_Count
bool Set_Count(sLong Count)
Definition: mat_tools.cpp:424
CSG_Simple_Statistics::Add
void Add(const CSG_Simple_Statistics &Statistics)
Definition: mat_tools.cpp:481
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Category_Statistics::CSG_Category_Statistics
CSG_Category_Statistics(TSG_Data_Type Type=SG_DATATYPE_String)
Definition: mat_tools.cpp:978
CSG_Classifier_Supervised::Get_Threshold_Probability
double Get_Threshold_Probability(void)
Definition: mat_tools.cpp:2430
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Histogram::Add_Value
void Add_Value(double Value)
Definition: mat_tools.cpp:1327
CSG_Table
Definition: table.h:283
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
CSG_Classifier_Supervised::~CSG_Classifier_Supervised
virtual ~CSG_Classifier_Supervised(void)
Definition: mat_tools.cpp:2381
CSG_Histogram::Get_Percentile_Value
double Get_Percentile_Value(double Value) const
Definition: mat_tools.cpp:1484
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Simple_Statistics::m_Maximum
double m_Maximum
Definition: mat_tools.h:777
CSG_Simple_Statistics::m_Sum
double m_Sum
Definition: mat_tools.h:777
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
CSG_Simple_Statistics::m_nValues
sLong m_nValues
Definition: mat_tools.h:775
TESTDIST_TYPE_TwoTail
@ TESTDIST_TYPE_TwoTail
Definition: mat_tools.h:1498
CSG_Grids::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grids.h:387
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
M_PI
#define M_PI
Definition: mat_tools.h:98
CSG_Unique_Value_Statistics::m_bWeights
bool m_bWeights
Definition: mat_tools.h:812
CSG_String
Definition: api_core.h:557
CSG_Simple_Statistics::m_Sum2
double m_Sum2
Definition: mat_tools.h:777
CSG_Histogram::Destroy
bool Destroy(void)
Definition: mat_tools.cpp:1272
SG_Get_Digit_Count
int SG_Get_Digit_Count(int Number)
Definition: mat_tools.cpp:144
CSG_Simple_Statistics::Get_Values
double * Get_Values(void) const
Definition: mat_tools.h:759
CSG_Simple_Statistics::Add_Value
void Add_Value(double Value, double Weight=1.)
Definition: mat_tools.cpp:527
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Simple_Statistics::Get_Value
double Get_Value(sLong i) const
Definition: mat_tools.h:760
CSG_Unique_String_Statistics::Create
virtual void Create(bool bWeights=false)
Definition: mat_tools.cpp:921
CSG_MetaData
Definition: metadata.h:88
CSG_Histogram::operator=
CSG_Histogram & operator=(const CSG_Histogram &Histogram)
Definition: mat_tools.cpp:1695
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_Unique_Value_Statistics::Get_Majority
virtual int Get_Majority(bool bWeighted=false) const
Definition: mat_tools.cpp:805
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_CLASSIFY_SUPERVISED_BinaryEncoding
@ SG_CLASSIFY_SUPERVISED_BinaryEncoding
Definition: mat_tools.h:1194
CSG_Simple_Statistics::Get_Gini
double Get_Gini(void)
Definition: mat_tools.cpp:681
CSG_Matrix::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:923
CSG_Unique_Number_Statistics::Create
virtual void Create(bool bWeights=false)
Definition: mat_tools.cpp:866
CSG_Simple_Statistics::Create
bool Create(bool bHoldValues=false)
Definition: mat_tools.cpp:350
CSG_Histogram::CSG_Histogram
CSG_Histogram(void)
Definition: mat_tools.cpp:1212
CSG_Category_Statistics::asInt
int asInt(int iCategory) const
Definition: mat_tools.cpp:1132
CSG_Matrix::Get_Determinant
double Get_Determinant(void) const
Definition: mat_matrix.cpp:1806
CSG_Grid
Definition: grid.h:473
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Simple_Statistics::Get_IndexOfMinimum
sLong Get_IndexOfMinimum(void)
Definition: mat_tools.cpp:710
SG_Compare_Version
int SG_Compare_Version(const CSG_String &Version, int Major, int Minor, int Release)
Definition: saga_api.cpp:82
CSG_Classifier_Supervised::Train
bool Train(bool bClr_Samples=false)
Definition: mat_tools.cpp:2680
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_Simple_Statistics::m_Kurtosis
double m_Kurtosis
Definition: mat_tools.h:777
CSG_Histogram::Get_Quantile
double Get_Quantile(double Quantile) const
Definition: mat_tools.cpp:1409
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
SG_CLASSIFY_SUPERVISED_MinimumDistance
@ SG_CLASSIFY_SUPERVISED_MinimumDistance
Definition: mat_tools.h:1196
CSG_Test_Distribution::Get_F_Tail_from_R2
static double Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3271
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
TESTDIST_TYPE_Left
@ TESTDIST_TYPE_Left
Definition: mat_tools.h:1495
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Simple_Statistics::Get_Quantile
double Get_Quantile(double Quantile)
Definition: mat_tools.cpp:618
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Classifier_Supervised::Set_Threshold_Probability
void Set_Threshold_Probability(double Value)
Definition: mat_tools.cpp:2429
CSG_Classifier_Supervised::Set_Probability_Relative
void Set_Probability_Relative(bool Value)
Definition: mat_tools.cpp:2433
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Classifier_Supervised::Train_Clr_Samples
bool Train_Clr_Samples(void)
Definition: mat_tools.cpp:2641
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:699
EPSILON
#define EPSILON
Definition: mat_formula.cpp:92
CSG_Category_Statistics::Create
void Create(TSG_Data_Type Type=SG_DATATYPE_String)
Definition: mat_tools.cpp:992
CSG_Matrix
Definition: mat_tools.h:463
CSG_Grids
Definition: grids.h:119
CSG_Test_Distribution::Get_T_Tail
static double Get_T_Tail(double T, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3073
CSG_Test_Distribution::Get_T_Inverse
static double Get_T_Inverse(double alpha, int df, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
Definition: mat_tools.cpp:3087
CSG_Simple_Statistics::Get_IndexOfMaximum
sLong Get_IndexOfMaximum(void)
Definition: mat_tools.cpp:734
CSG_Array_Int::Destroy
void Destroy(void)
Definition: api_core.h:429
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Simple_Statistics::m_Values
CSG_Array m_Values
Definition: mat_tools.h:779
CSG_Simple_Statistics::m_Range
double m_Range
Definition: mat_tools.h:777
CSG_Natural_Breaks::CSG_Natural_Breaks
CSG_Natural_Breaks(void)
Definition: mat_tools.cpp:1710
table.h
CSG_Histogram::Get_Value
double Get_Value(double i) const
Definition: mat_tools.h:1029
CSG_Vector::Sort
bool Sort(bool bAscending=true)
Definition: mat_matrix.cpp:642
CSG_Classifier_Supervised::Get_Threshold_Distance
double Get_Threshold_Distance(void)
Definition: mat_tools.cpp:2422
CSG_Matrix::Get_NY
int Get_NY(void) const
Definition: mat_tools.h:506
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Classifier_Supervised::Create
void Create(int nFeatures)
Definition: mat_tools.cpp:2387
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
SG_Degree_To_Decimal
double SG_Degree_To_Decimal(double Deg, double Min, double Sec)
Definition: mat_tools.cpp:224
CSG_Cluster_Analysis::CSG_Cluster_Analysis
CSG_Cluster_Analysis(void)
Definition: mat_tools.cpp:1981
CSG_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:537
CSG_Simple_Statistics::m_Weights
double m_Weights
Definition: mat_tools.h:777
CSG_Matrix::Get_NX
int Get_NX(void) const
Definition: mat_tools.h:505
CSG_Simple_Statistics::m_bSorted
bool m_bSorted
Definition: mat_tools.h:771
grids.h
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: mat_tools.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Typedefs | Enumerations | Functions
mat_tools.h File Reference
#include "geo_tools.h"

Go to the source code of this file.

Classes

class | CSG_Index
class | CSG_Index::CSG_Index_Compare
class | CSG_PriorityQueue
class | CSG_PriorityQueue::CSG_PriorityQueueItem
class | CSG_Vector
class | CSG_Matrix
class | CSG_Grid_Radius
class | CSG_Random
class | CSG_Simple_Statistics
class | CSG_Unique_Value_Statistics
class | CSG_Unique_Number_Statistics
class | CSG_Unique_String_Statistics
class | CSG_Category_Statistics
class | CSG_Histogram
class | CSG_Natural_Breaks
class | CSG_Cluster_Analysis
class | CSG_Classifier_Supervised
class | CSG_Spline
class | CSG_Thin_Plate_Spline
class | CSG_Test_Distribution
class | CSG_Regression
class | CSG_Regression_Multiple
class | CSG_Regression_Weighted
class | CSG_Formula
struct | CSG_Formula::SSG_Function
class | CSG_Trend
class | CSG_Trend_Polynom

Macros

#define | M_PI 3.141592653589793
#define | M_PI_045 (M_PI / 4.)
#define | M_PI_090 (M_PI / 2.)
#define | M_PI_135 (M_PI * 3. / 4.)
#define | M_PI_180 (M_PI)
#define | M_PI_225 (M_PI * 5. / 4.)
#define | M_PI_270 (M_PI * 3. / 2.)
#define | M_PI_315 (M_PI * 7. / 4.)
#define | M_PI_360 (M_PI * 2.)
#define | M_RAD_TO_DEG (180. / M_PI)
#define | M_DEG_TO_RAD (M_PI / 180.)
#define | M_EULER 2.718281828459045
#define | N_MEGABYTE_BYTES 0x100000
#define | M_ALMOST_ZERO 0.001l
#define | M_TINY (1.0e-20)
#define | M_SQR(x) ((x) * (x))
#define | M_SQRT(x) sqrt((double)(x))
#define | M_GET_LENGTH(x, y) sqrt((double)((x)*(x) + (y)*(y)))
#define | M_GET_MIN(a, b) (((a) < (b)) ? (a) : (b))
#define | M_GET_MAX(a, b) (((a) > (b)) ? (a) : (b))
#define | M_SET_MINMAX(min, max, x) if( min > x ) { min = x; } else if( max < x ) { max = x; }
#define | M_SET_SIGN(x, sign) ((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x))
#define | SG_ROUND_TO_BYTE(x) ((BYTE )(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_CHAR(x) ((char )(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_WORD(x) ((WORD )(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_SHORT(x) ((short)(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_DWORD(x) ((DWORD)(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_INT(x) ((int )(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_LONG(x) ((long )(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_ULONG(x) ((uLong)(x < 0. ? x - 0.5 : x + 0.5))
#define | SG_ROUND_TO_SLONG(x) ((sLong)(x < 0. ? x - 0.5 : x + 0.5))

Typedefs

typedef int(* | TSG_PFNC_Compare) (const sLong a, const sLong b)
typedef double(* | TSG_Formula_Function_0) (void)
typedef double(* | TSG_Formula_Function_1) (double)
typedef double(* | TSG_Formula_Function_2) (double, double)
typedef double(* | TSG_Formula_Function_3) (double, double, double)

Enumerations

enum | ESG_Cluster_Analysis_Method { SG_CLUSTERANALYSIS_Minimum_Distance = 0, SG_CLUSTERANALYSIS_Hill_Climbing, SG_CLUSTERANALYSIS_Combined }
enum ESG_Classify_Supervised {
SG_CLASSIFY_SUPERVISED_BinaryEncoding = 0, SG_CLASSIFY_SUPERVISED_ParallelEpiped, SG_CLASSIFY_SUPERVISED_MinimumDistance, SG_CLASSIFY_SUPERVISED_Mahalonobis,
SG_CLASSIFY_SUPERVISED_MaximumLikelihood, SG_CLASSIFY_SUPERVISED_SAM, SG_CLASSIFY_SUPERVISED_WTA, SG_CLASSIFY_SUPERVISED_SID,
SG_CLASSIFY_SUPERVISED_SVM
}
enum | TSG_Test_Distribution_Type { TESTDIST_TYPE_Left = 0, TESTDIST_TYPE_Right, TESTDIST_TYPE_Middle, TESTDIST_TYPE_TwoTail }
enum TSG_Regression_Correction {
REGRESSION_CORR_None = 0, REGRESSION_CORR_Smith, REGRESSION_CORR_Wherry_1, REGRESSION_CORR_Wherry_2,
REGRESSION_CORR_Olkin_Pratt, REGRESSION_CORR_Pratt, REGRESSION_CORR_Claudy_3
}
enum TSG_Regression_Type {
REGRESSION_Linear = 0, REGRESSION_Rez_X, REGRESSION_Rez_Y, REGRESSION_Pow,
REGRESSION_Exp, REGRESSION_Log
}
enum ESG_Multiple_Regression_Info_Vars {
MLR_VAR_ID = 0, MLR_VAR_NAME, MLR_VAR_RCOEFF, MLR_VAR_R,
MLR_VAR_R2, MLR_VAR_R2_ADJ, MLR_VAR_SE, MLR_VAR_T,
MLR_VAR_SIG, MLR_VAR_P
}
enum ESG_Trend_String {
SG_TREND_STRING_Formula = 0, SG_TREND_STRING_Function, SG_TREND_STRING_Formula_Parameters, SG_TREND_STRING_Complete,
SG_TREND_STRING_Compact
}

Functions

SAGA_API_DLL_EXPORT double | SG_Get_Square (double Value)
SAGA_API_DLL_EXPORT double | SG_Get_Rounded (double Value, int Decimals=0)
SAGA_API_DLL_EXPORT double | SG_Get_Rounded_To_SignificantFigures (double Value, int Decimals)
SAGA_API_DLL_EXPORT int | SG_Get_Digit_Count (int Number)
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Double_asString (double Number, int Width=-1, int Precision=-1, bool bScientific=false)
SAGA_API_DLL_EXPORT int | SG_Compare_Int (const void *a, const void *b)
SAGA_API_DLL_EXPORT int | SG_Compare_Double (const void *a, const void *b)
SAGA_API_DLL_EXPORT int | SG_Compare_Char_Ptr (const void *a, const void *b)
SAGA_API_DLL_EXPORT double | SG_Degree_To_Decimal (double Deg, double Min, double Sec)
SAGA_API_DLL_EXPORT void | SG_Decimal_To_Degree (double Value, double &Deg, double &Min, double &Sec)
SAGA_API_DLL_EXPORT CSG_Vector | operator* (double Scalar, const CSG_Vector &Vector)
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (double &x, double &y, double Angle)
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (double Vector[2], double Angle)
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (CSG_Vector &Vector, double Angle)
SAGA_API_DLL_EXPORT bool | SG_VectorR3_Rotate (double Vector[3], size_t Axis, double Angle)
SAGA_API_DLL_EXPORT bool | SG_VectorR3_Rotate (CSG_Vector &Vector, size_t Axis, double Angle)
SAGA_API_DLL_EXPORT CSG_Matrix | operator* (double Scalar, const CSG_Matrix &Matrix)
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Matrix_Get_Rotation (double R, bool bDegree=false)
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Matrix_Get_Rotation (double Rx, double Ry, double Rz, bool bDegree=false)
SAGA_API_DLL_EXPORT bool | SG_Matrix_LU_Decomposition (int n, int *Permutation, double **Matrix, bool bSilent=true, int *nRowChanges=NULL)
SAGA_API_DLL_EXPORT bool | SG_Matrix_LU_Solve (int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent=true)
SAGA_API_DLL_EXPORT bool | SG_Matrix_Solve (CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent=true)
SAGA_API_DLL_EXPORT bool | SG_Matrix_Eigen_Reduction (const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent=true)
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Get_Correlation_Matrix (const CSG_Matrix &Values, bool bCovariances=false)
SAGA_API_DLL_EXPORT double | SG_Regression_Get_Adjusted_R2 (double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction=REGRESSION_CORR_Wherry_1)

Detailed Description

A set of basic mathematical, numerical, statistical tools.

See also
CSG_Vector
CSG_Matrix
CSG_Formula
CSG_Random
CSG_Index
CSG_Histogram
CSG_Simple_Statistics
CSG_Unique_Value_Statistics
CSG_Regression
CSG_Trend
CSG_Spline

Definition in file mat_tools.h.

Macro Definition Documentation

◆ M_ALMOST_ZERO

#define M_ALMOST_ZERO 0.001l

Definition at line 120 of file mat_tools.h.

◆ M_DEG_TO_RAD

#define M_DEG_TO_RAD (M_PI / 180.)

Definition at line 111 of file mat_tools.h.

◆ M_EULER

#define M_EULER 2.718281828459045

Definition at line 114 of file mat_tools.h.

◆ M_GET_LENGTH

#define M_GET_LENGTH | ( | x,
 |  | y
 | ) | sqrt((double)((x)*(x) + (y)*(y)))

Definition at line 126 of file mat_tools.h.

◆ M_GET_MAX

#define M_GET_MAX | ( | a,
 |  | b
 | ) | (((a) > (b)) ? (a) : (b))

Definition at line 129 of file mat_tools.h.

◆ M_GET_MIN

#define M_GET_MIN | ( | a,
 |  | b
 | ) | (((a) < (b)) ? (a) : (b))

Definition at line 128 of file mat_tools.h.

◆ M_PI

#define M_PI 3.141592653589793

Definition at line 98 of file mat_tools.h.

◆ M_PI_045

#define M_PI_045 (M_PI / 4.)

Definition at line 101 of file mat_tools.h.

◆ M_PI_090

#define M_PI_090 (M_PI / 2.)

Definition at line 102 of file mat_tools.h.

◆ M_PI_135

#define M_PI_135 (M_PI * 3. / 4.)

Definition at line 103 of file mat_tools.h.

◆ M_PI_180

#define M_PI_180 (M_PI)

Definition at line 104 of file mat_tools.h.

◆ M_PI_225

#define M_PI_225 (M_PI * 5. / 4.)

Definition at line 105 of file mat_tools.h.

◆ M_PI_270

#define M_PI_270 (M_PI * 3. / 2.)

Definition at line 106 of file mat_tools.h.

◆ M_PI_315

#define M_PI_315 (M_PI * 7. / 4.)

Definition at line 107 of file mat_tools.h.

◆ M_PI_360

#define M_PI_360 (M_PI * 2.)

Definition at line 108 of file mat_tools.h.

◆ M_RAD_TO_DEG

#define M_RAD_TO_DEG (180. / M_PI)

Definition at line 110 of file mat_tools.h.

◆ M_SET_MINMAX

#define M_SET_MINMAX | ( | min,
 |  | max,
 |  | x
 | ) | if( min > x ) { min = x; } else if( max < x ) { max = x; }

Definition at line 130 of file mat_tools.h.

◆ M_SET_SIGN

#define M_SET_SIGN | ( | x,
 |  | sign
 | ) | ((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x))

Definition at line 132 of file mat_tools.h.

◆ M_SQR

#define M_SQR ( x ) ((x) * (x))

Definition at line 124 of file mat_tools.h.

◆ M_SQRT

#define M_SQRT ( x ) sqrt((double)(x))

Definition at line 125 of file mat_tools.h.

◆ M_TINY

#define M_TINY (1.0e-20)

Definition at line 121 of file mat_tools.h.

◆ N_MEGABYTE_BYTES

#define N_MEGABYTE_BYTES 0x100000

Definition at line 117 of file mat_tools.h.

◆ SG_ROUND_TO_BYTE

#define SG_ROUND_TO_BYTE ( x ) ((BYTE )(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 135 of file mat_tools.h.

◆ SG_ROUND_TO_CHAR

#define SG_ROUND_TO_CHAR ( x ) ((char )(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 136 of file mat_tools.h.

◆ SG_ROUND_TO_DWORD

#define SG_ROUND_TO_DWORD ( x ) ((DWORD)(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 139 of file mat_tools.h.

◆ SG_ROUND_TO_INT

#define SG_ROUND_TO_INT ( x ) ((int )(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 140 of file mat_tools.h.

◆ SG_ROUND_TO_LONG

#define SG_ROUND_TO_LONG ( x ) ((long )(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 141 of file mat_tools.h.

◆ SG_ROUND_TO_SHORT

#define SG_ROUND_TO_SHORT ( x ) ((short)(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 138 of file mat_tools.h.

◆ SG_ROUND_TO_SLONG

#define SG_ROUND_TO_SLONG ( x ) ((sLong)(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 143 of file mat_tools.h.

◆ SG_ROUND_TO_ULONG

#define SG_ROUND_TO_ULONG ( x ) ((uLong)(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 142 of file mat_tools.h.

◆ SG_ROUND_TO_WORD

#define SG_ROUND_TO_WORD ( x ) ((WORD )(x < 0. ? x - 0.5 : x + 0.5))

Definition at line 137 of file mat_tools.h.

Typedef Documentation

◆ TSG_Formula_Function_0

typedef double(* TSG_Formula_Function_0) (void)

Definition at line 1843 of file mat_tools.h.

◆ TSG_Formula_Function_1

typedef double(* TSG_Formula_Function_1) (double)

Definition at line 1844 of file mat_tools.h.

◆ TSG_Formula_Function_2

typedef double(* TSG_Formula_Function_2) (double, double)

Definition at line 1845 of file mat_tools.h.

◆ TSG_Formula_Function_3

typedef double(* TSG_Formula_Function_3) (double, double, double)

Definition at line 1846 of file mat_tools.h.

◆ TSG_PFNC_Compare

typedef int(* TSG_PFNC_Compare) (const sLong a, const sLong b)

Definition at line 181 of file mat_tools.h.

Enumeration Type Documentation

◆ ESG_Classify_Supervised

enum ESG_Classify_Supervised
Enumerator
SG_CLASSIFY_SUPERVISED_BinaryEncoding
SG_CLASSIFY_SUPERVISED_ParallelEpiped
SG_CLASSIFY_SUPERVISED_MinimumDistance
SG_CLASSIFY_SUPERVISED_Mahalonobis
SG_CLASSIFY_SUPERVISED_MaximumLikelihood
SG_CLASSIFY_SUPERVISED_SAM
SG_CLASSIFY_SUPERVISED_WTA
SG_CLASSIFY_SUPERVISED_SID
SG_CLASSIFY_SUPERVISED_SVM

Definition at line 1192 of file mat_tools.h.

◆ ESG_Cluster_Analysis_Method

enum ESG_Cluster_Analysis_Method
Enumerator
SG_CLUSTERANALYSIS_Minimum_Distance
SG_CLUSTERANALYSIS_Hill_Climbing
SG_CLUSTERANALYSIS_Combined

Definition at line 1126 of file mat_tools.h.

◆ ESG_Multiple_Regression_Info_Vars

enum ESG_Multiple_Regression_Info_Vars
Enumerator
MLR_VAR_ID
MLR_VAR_NAME
MLR_VAR_RCOEFF
MLR_VAR_R
MLR_VAR_R2
MLR_VAR_R2_ADJ
MLR_VAR_SE
MLR_VAR_T
MLR_VAR_SIG
MLR_VAR_P

Definition at line 1662 of file mat_tools.h.

◆ ESG_Trend_String

enum ESG_Trend_String
Enumerator
SG_TREND_STRING_Formula
SG_TREND_STRING_Function
SG_TREND_STRING_Formula_Parameters
SG_TREND_STRING_Complete
SG_TREND_STRING_Compact

Definition at line 1950 of file mat_tools.h.

◆ TSG_Regression_Correction

enum TSG_Regression_Correction
Enumerator
REGRESSION_CORR_None
REGRESSION_CORR_Smith
REGRESSION_CORR_Wherry_1
REGRESSION_CORR_Wherry_2
REGRESSION_CORR_Olkin_Pratt
REGRESSION_CORR_Pratt
REGRESSION_CORR_Claudy_3

Definition at line 1551 of file mat_tools.h.

◆ TSG_Regression_Type

enum TSG_Regression_Type
Enumerator
REGRESSION_Linear
REGRESSION_Rez_X
REGRESSION_Rez_Y
REGRESSION_Pow
REGRESSION_Exp
REGRESSION_Log

Definition at line 1572 of file mat_tools.h.

◆ TSG_Test_Distribution_Type

enum TSG_Test_Distribution_Type
Enumerator
TESTDIST_TYPE_Left
TESTDIST_TYPE_Right
TESTDIST_TYPE_Middle
TESTDIST_TYPE_TwoTail

Definition at line 1493 of file mat_tools.h.

Function Documentation

◆ operator*() [1/2]

SAGA_API_DLL_EXPORT CSG_Matrix operator* | ( | double | Scalar,
 |  | const CSG_Matrix & | Matrix
 | ) |  |

Definition at line 1699 of file mat_matrix.cpp.

◆ operator*() [2/2]

SAGA_API_DLL_EXPORT CSG_Vector operator* | ( | double | Scalar,
 |  | const CSG_Vector & | Vector
 | ) |  |

Definition at line 579 of file mat_matrix.cpp.

◆ SG_Compare_Char_Ptr()

SAGA_API_DLL_EXPORT int SG_Compare_Char_Ptr | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 211 of file mat_tools.cpp.

◆ SG_Compare_Double()

SAGA_API_DLL_EXPORT int SG_Compare_Double | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 199 of file mat_tools.cpp.

Referenced by CSG_Simple_Statistics::Get_Gini(), CSG_Simple_Statistics::Get_Quantile(), and CSG_Vector::Sort().

◆ SG_Compare_Int()

SAGA_API_DLL_EXPORT int SG_Compare_Int | ( | const void * | a,
 |  | const void * | b
 | ) |  |

Definition at line 187 of file mat_tools.cpp.

◆ SG_Decimal_To_Degree()

SAGA_API_DLL_EXPORT void SG_Decimal_To_Degree | ( | double | Value,
 |  | double & | Deg,
 |  | double & | Min,
 |  | double & | Sec
 | ) |  |

Definition at line 233 of file mat_tools.cpp.

◆ SG_Degree_To_Decimal()

SAGA_API_DLL_EXPORT double SG_Degree_To_Decimal | ( | double | Deg,
 |  | double | Min,
 |  | double | Sec
 | ) |  |

Definition at line 224 of file mat_tools.cpp.

◆ SG_Get_Correlation_Matrix()

SAGA_API_DLL_EXPORT CSG_Matrix SG_Get_Correlation_Matrix | ( | const CSG_Matrix & | Values,
 |  | bool | bCovariances = false
 | ) |  |

Definition at line 3473 of file mat_tools.cpp.

References C, CSG_Simple_Statistics::Get_Mean(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), and CSG_Simple_Statistics::Get_StdDev().

Referenced by CSG_Regression_Multiple::_Get_Regression().

◆ SG_Get_Digit_Count()

SAGA_API_DLL_EXPORT int SG_Get_Digit_Count ( int Number )

Definition at line 144 of file mat_tools.cpp.

Referenced by CSG_Matrix::to_String().

◆ SG_Get_Double_asString()

SAGA_API_DLL_EXPORT CSG_String SG_Get_Double_asString | ( | double | Number,
 |  | int | Width = -1,
 |  | int | Precision = -1,
 |  | bool | bScientific = false
 | ) |  |

Definition at line 159 of file mat_tools.cpp.

References CSG_String::Format().

Referenced by CSG_Vector::to_String(), and CSG_Matrix::to_String().

◆ SG_Get_Rounded()

SAGA_API_DLL_EXPORT double SG_Get_Rounded | ( | double | Value,
 |  | int | Decimals = 0
 | ) |  |

Definition at line 83 of file mat_tools.cpp.

Referenced by CSG_Grid_System::Create().

◆ SG_Get_Rounded_To_SignificantFigures()

SAGA_API_DLL_EXPORT double SG_Get_Rounded_To_SignificantFigures | ( | double | Value,
 |  | int | Decimals
 | ) |  |

Definition at line 107 of file mat_tools.cpp.

Referenced by CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().

◆ SG_Get_Square()

SAGA_API_DLL_EXPORT double SG_Get_Square ( double Value )

Definition at line 70 of file mat_tools.cpp.

Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Weighted::Calculate(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Trend::Get_Trend(), CSG_Trend_Polynom::Get_Trend(), and SG_Get_Distance_Polar().

◆ SG_Matrix_Eigen_Reduction()

SAGA_API_DLL_EXPORT bool SG_Matrix_Eigen_Reduction | ( | const CSG_Matrix & | Matrix,
 |  | CSG_Matrix & | Eigen_Vectors,
 |  | CSG_Vector & | Eigen_Values,
 |  | bool | bSilent = true
 | ) |  |

Definition at line 1933 of file mat_matrix.cpp.

References SG_Matrix_Triangular_Decomposition(), and SG_Matrix_Tridiagonal_QL().

◆ SG_Matrix_Get_Rotation() [1/2]

SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation | ( | double | R,
 |  | bool | bDegree
 | ) |  |

Returns a rotation matrix applicable to 2d vectors for given rotation angle (R).

Definition at line 1866 of file mat_matrix.cpp.

References M_DEG_TO_RAD.

◆ SG_Matrix_Get_Rotation() [2/2]

SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation | ( | double | Rx,
 |  | double | Ry,
 |  | double | Rz,
 |  | bool | bDegree
 | ) |  |

Returns a rotation matrix applicable to 3d vectors for rotations about the x-, y-, and z-axis (Rx, Ry, Rz).

Definition at line 1885 of file mat_matrix.cpp.

References M_DEG_TO_RAD.

◆ SG_Matrix_LU_Decomposition()

SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Decomposition | ( | int | n,
 |  | int * | Permutation,
 |  | double ** | Matrix,
 |  | bool | bSilent = true,
 |  | int * | nRowChanges = NULL
 | ) |  |

Definition at line 1948 of file mat_matrix.cpp.

References M_TINY, SG_UI_Process_Get_Okay(), and SG_UI_Process_Set_Progress().

Referenced by CSG_Matrix::Get_Determinant(), CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().

◆ SG_Matrix_LU_Solve()

SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Solve | ( | int | n,
 |  | const int * | Permutation,
 |  | const double ** | Matrix,
 |  | double * | Vector,
 |  | bool | bSilent = true
 | ) |  |

Definition at line 2053 of file mat_matrix.cpp.

References SG_UI_Process_Set_Progress().

Referenced by CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().

◆ SG_Matrix_Solve()

SAGA_API_DLL_EXPORT bool SG_Matrix_Solve | ( | CSG_Matrix & | Matrix,
 |  | CSG_Vector & | Vector,
 |  | bool | bSilent = true
 | ) |  |

Definition at line 1910 of file mat_matrix.cpp.

References CSG_Array::Get_Array(), CSG_Vector::Get_Data(), CSG_Matrix::Get_Data(), CSG_Vector::Get_N(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), SG_Matrix_LU_Decomposition(), and SG_Matrix_LU_Solve().

Referenced by CSG_Thin_Plate_Spline::Create().

◆ SG_Regression_Get_Adjusted_R2()

SAGA_API_DLL_EXPORT double SG_Regression_Get_Adjusted_R2 | ( | double | R2,
 |  | int | nSamples,
 |  | int | nPredictors,
 |  | TSG_Regression_Correction | Correction = REGRESSION_CORR_Wherry_1
 | ) |  |

Definition at line 63 of file mat_regression.cpp.

References REGRESSION_CORR_Claudy_3, REGRESSION_CORR_None, REGRESSION_CORR_Olkin_Pratt, REGRESSION_CORR_Pratt, REGRESSION_CORR_Smith, REGRESSION_CORR_Wherry_1, and REGRESSION_CORR_Wherry_2.

Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Regression::Calculate().

◆ SG_VectorR2_Rotate() [1/3]

SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | CSG_Vector & | Vector,
 |  | double | Angle
 | ) |  |

Definition at line 770 of file mat_matrix.cpp.

References CSG_Vector::Get_Size(), and SG_VectorR2_Rotate().

◆ SG_VectorR2_Rotate() [2/3]

SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | double & | x,
 |  | double & | y,
 |  | double | Angle
 | ) |  |

Definition at line 750 of file mat_matrix.cpp.

Referenced by SG_VectorR2_Rotate().

◆ SG_VectorR2_Rotate() [3/3]

SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | double | Vector[2],
 |  | double | Angle
 | ) |  |

Definition at line 764 of file mat_matrix.cpp.

References SG_VectorR2_Rotate().

◆ SG_VectorR3_Rotate() [1/2]

SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate | ( | CSG_Vector & | Vector,
 |  | size_t | Axis,
 |  | double | Angle
 | ) |  |

Definition at line 810 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and SG_VectorR3_Rotate().

◆ SG_VectorR3_Rotate() [2/2]

SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate | ( | double | Vector[3],
 |  | size_t | Axis,
 |  | double | Angle
 | ) |  |

Definition at line 776 of file mat_matrix.cpp.

Referenced by SG_VectorR3_Rotate().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_tools.h Source File

  • saga_core
  • saga_api
mat_tools.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_tools.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
54 #define HEADER_INCLUDED__SAGA_API__mat_tools_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
80 // //
82 // //
83 // //
85
86 //---------------------------------------------------------
87 #include "geo_tools.h"
88
89
91 // //
92 // //
93 // //
95
96 //---------------------------------------------------------
97 #ifndef M_PI
98 #define M_PI 3.141592653589793
99 #endif
100
101 #define M_PI_045 (M_PI / 4.)
102 #define M_PI_090 (M_PI / 2.)
103 #define M_PI_135 (M_PI * 3. / 4.)
104 #define M_PI_180 (M_PI)
105 #define M_PI_225 (M_PI * 5. / 4.)
106 #define M_PI_270 (M_PI * 3. / 2.)
107 #define M_PI_315 (M_PI * 7. / 4.)
108 #define M_PI_360 (M_PI * 2.)
109
110 #define M_RAD_TO_DEG (180. / M_PI)
111 #define M_DEG_TO_RAD (M_PI / 180.)
112
113 //---------------------------------------------------------
114 #define M_EULER 2.718281828459045
115
116 //---------------------------------------------------------
117 #define N_MEGABYTE_BYTES 0x100000
118
119 //---------------------------------------------------------
120 #define M_ALMOST_ZERO 0.001l
121 #define M_TINY (1.0e-20)
122
123 //---------------------------------------------------------
124 #define M_SQR(x) ((x) * (x))
125 #define M_SQRT(x) sqrt((double)(x))
126 #define M_GET_LENGTH(x, y) sqrt((double)((x)*(x) + (y)*(y)))
127
128 #define M_GET_MIN(a, b) (((a) < (b)) ? (a) : (b))
129 #define M_GET_MAX(a, b) (((a) > (b)) ? (a) : (b))
130 #define M_SET_MINMAX(min, max, x) if( min > x ) { min = x; } else if( max < x ) { max = x; }
131
132 #define M_SET_SIGN(x, sign) ((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x))
133
134 //---------------------------------------------------------
135 #define SG_ROUND_TO_BYTE(x) ((BYTE )(x < 0. ? x - 0.5 : x + 0.5))
136 #define SG_ROUND_TO_CHAR(x) ((char )(x < 0. ? x - 0.5 : x + 0.5))
137 #define SG_ROUND_TO_WORD(x) ((WORD )(x < 0. ? x - 0.5 : x + 0.5))
138 #define SG_ROUND_TO_SHORT(x) ((short)(x < 0. ? x - 0.5 : x + 0.5))
139 #define SG_ROUND_TO_DWORD(x) ((DWORD)(x < 0. ? x - 0.5 : x + 0.5))
140 #define SG_ROUND_TO_INT(x) ((int )(x < 0. ? x - 0.5 : x + 0.5))
141 #define SG_ROUND_TO_LONG(x) ((long )(x < 0. ? x - 0.5 : x + 0.5))
142 #define SG_ROUND_TO_ULONG(x) ((uLong)(x < 0. ? x - 0.5 : x + 0.5))
143 #define SG_ROUND_TO_SLONG(x) ((sLong)(x < 0. ? x - 0.5 : x + 0.5))
144
145
147 // //
148 // //
149 // //
151
152 //---------------------------------------------------------
153 SAGA_API_DLL_EXPORT double SG_Get_Square (double Value);
154
155 SAGA_API_DLL_EXPORT double SG_Get_Rounded (double Value, int Decimals = 0);
156 SAGA_API_DLL_EXPORT double SG_Get_Rounded_To_SignificantFigures (double Value, int Decimals);
157
158 //---------------------------------------------------------
159 SAGA_API_DLL_EXPORT int SG_Get_Digit_Count (int Number);
160
161 //---------------------------------------------------------
162 SAGA_API_DLL_EXPORT CSG_String SG_Get_Double_asString (double Number, int Width = -1, int Precision = -1, bool bScientific = false);
163
164 //---------------------------------------------------------
165 SAGA_API_DLL_EXPORT int SG_Compare_Int (const void *a, const void *b);
166 SAGA_API_DLL_EXPORT int SG_Compare_Double (const void *a, const void *b);
167 SAGA_API_DLL_EXPORT int SG_Compare_Char_Ptr (const void *a, const void *b);
168
169 //---------------------------------------------------------
170 SAGA_API_DLL_EXPORT double SG_Degree_To_Decimal ( double Deg, double Min, double Sec);
171 SAGA_API_DLL_EXPORT void SG_Decimal_To_Degree (double Value, double &Deg, double &Min, double &Sec);
172
173
175 // //
176 // //
177 // //
179
180 //---------------------------------------------------------
181 typedef int (* TSG_PFNC_Compare) (const sLong a, const sLong b);
182
183 //---------------------------------------------------------
184 class SAGA_API_DLL_EXPORT CSG_Index
185 {
186 public:
187 class CSG_Index_Compare
188 {
189 public:
190 CSG_Index_Compare(void) {}
191 virtual ~CSG_Index_Compare(void) {}
192
193 virtual int Compare (const sLong a, const sLong b) = 0;
194 };
195
196
197 public:
198 CSG_Index(void);
199 virtual ~CSG_Index(void);
200
201 CSG_Index (sLong nValues, CSG_Index_Compare &Compare);
202 bool Create (sLong nValues, CSG_Index_Compare &Compare);
203
204 CSG_Index (sLong nValues, CSG_Index_Compare *pCompare);
205 bool Create (sLong nValues, CSG_Index_Compare *pCompare);
206
207 CSG_Index (sLong nValues, int *Values, bool bAscending = true);
208 bool Create (sLong nValues, int *Values, bool bAscending = true);
209
210 CSG_Index (sLong nValues, double *Values, bool bAscending = true);
211 bool Create (sLong nValues, double *Values, bool bAscending = true);
212
213 CSG_Index (sLong nValues, TSG_PFNC_Compare fCompare);
214 bool Create (sLong nValues, TSG_PFNC_Compare fCompare);
215
216 bool Destroy (void);
217
218 void Show_Progress (bool bProgress = true);
219
220 bool Add_Entry (sLong Position = -1);
221 bool Del_Entry (sLong Position = -1);
222
223 bool is_Okay (void) const { return( m_nValues > 0 ); }
224 sLong Get_Count (void) const { return( m_nValues ); }
225
226 sLong Get_Index (sLong Position, bool Ascending = true) const
227 {
228 return( Position < 0 || Position >= m_nValues ? -1 : m_Index[Ascending ? Position : m_nValues - 1 - Position] );
229 }
230
231 sLong operator [] (sLong Position) const
232 {
233 return( Position < 0 || Position >= m_nValues ? -1 : m_Index[Position] );
234 }
235
236
237 private:
238
239 bool m_bProgress;
240
241 sLong m_nValues, *m_Index;
242
243
244 void _On_Construction (void);
245
246 bool _Set_Array (sLong nValues);
247 bool _Set_Index (CSG_Index_Compare *pCompare);
248
249 };
250
251
253 // //
254 // //
255 // //
257
258 //---------------------------------------------------------
259 class SAGA_API_DLL_EXPORT CSG_PriorityQueue
260 {
261 public:
262
263 //-----------------------------------------------------
264 class CSG_PriorityQueueItem
265 {
266 public:
267 CSG_PriorityQueueItem(void) {}
268
269 virtual int Compare (CSG_PriorityQueueItem *pItem) = 0;
270
271 };
272
273 //-----------------------------------------------------
274 CSG_PriorityQueue(size_t maxSize = 256);
275
276 virtual ~CSG_PriorityQueue(void);
277
278 void Create (size_t maxSize = 256);
279 void Destroy (void);
280
281 //-----------------------------------------------------
282 bool is_Empty (void) const { return( m_nItems == 0 ); }
283 size_t Get_Size (void) const { return( m_nItems ); }
284 CSG_PriorityQueueItem * Get_Item (size_t i) const { return( m_Items[i] ); }
285
286 void Add (CSG_PriorityQueueItem *pItem);
287
288 CSG_PriorityQueueItem * Peek (void) const { return( Minimum() ); }
289 CSG_PriorityQueueItem * Poll (void);
290
291 //-----------------------------------------------------
292 CSG_PriorityQueueItem * Minimum (void) const
293 {
294 if( m_nItems )
295 {
296 if( m_pLeaf[0] )
297 {
298 return( m_pLeaf[0]->Minimum() );
299 }
300
301 return( m_Items[0] );
302 }
303
304 return( NULL );
305 }
306
307 CSG_PriorityQueueItem * Maximum (void) const
308 {
309 if( m_nItems )
310 {
311 if( m_pLeaf[1] )
312 {
313 return( m_pLeaf[1]->Maximum() );
314 }
315
316 return( m_Items[m_nItems - 1] );
317 }
318
319 return( NULL );
320 }
321
322
323 private:
324
325 size_t m_nItems, m_maxSize;
326
327 CSG_PriorityQueue *m_pLeaf[2];
328
329 CSG_PriorityQueueItem **m_Items;
330
331
332 size_t _Insert_Position (CSG_PriorityQueueItem *pItem);
333
334 };
335
336
338 // //
339 // //
340 // //
342
343 //---------------------------------------------------------
344 class SAGA_API_DLL_EXPORT CSG_Vector
345 {
346 public:
347 CSG_Vector(void);
348 virtual ~CSG_Vector(void);
349
350 CSG_Vector (const CSG_Vector &Vector);
351 bool Create (const CSG_Vector &Vector);
352
353 CSG_Vector (sLong n, const double *Data = NULL);
354 bool Create (sLong n, const double *Data = NULL);
355
356 bool Destroy (void);
357
358 bool Set_Rows (sLong nRows);
359 bool Add_Rows (sLong nRows);
360 bool Del_Rows (sLong nRows);
361 bool Add_Row (double Value = 0.);
362 bool Del_Row (sLong Row = -1);
363
364 sLong Get_Row_Count (void) const { return( m_Array.Get_Size () ); }
365 sLong Get_Size (void) const { return( m_Array.Get_Size () ); }
366 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
367 int Get_N (void) const { return( (int)m_Array.Get_Size() ); }
368
369 double * Get_Data (void) const { return( (double *)m_Array.Get_Array() ); }
370 double Get_Data (sLong x) const { return( Get_Data()[x] ); }
371 double operator () (sLong x) const { return( Get_Data()[x] ); }
372 double & operator [] (sLong x) { return( Get_Data()[x] ); }
373 double & operator [] (size_t x) { return( Get_Data()[x] ); }
374 double & operator [] (int x) { return( Get_Data()[x] ); }
375 const double & operator [] (sLong x) const { return( Get_Data()[x] ); }
376 const double & operator [] (size_t x) const { return( Get_Data()[x] ); }
377 const double & operator [] (int x) const { return( Get_Data()[x] ); }
378 operator const double * (void) const { return( Get_Data() ); }
379
380 CSG_String to_String (int Width = -1, int Precision = -1, bool bScientific = false, const SG_Char *Separator = NULL) const;
381 bool from_String (const CSG_String &String);
382
383 bool is_Null (void) const;
384 bool is_Equal (const CSG_Vector &Vector) const;
385 bool is_Collinear (const CSG_Vector &Vector) const;
386
387 bool Assign (double Scalar);
388 bool Assign (const CSG_Vector &Vector);
389 bool Add (double Scalar);
390 bool Add (const CSG_Vector &Vector);
391 bool Subtract (const CSG_Vector &Vector);
392 bool Multiply (double Scalar);
393 bool Multiply (const CSG_Vector &Vector);
394 bool Multiply_Cross (const CSG_Vector &Vector);
395 double Multiply_Scalar (const CSG_Vector &Vector) const;
396 bool Multiply (const class CSG_Matrix &Matrix);
397
398 bool operator == (const CSG_Vector &Vector) const { return( is_Equal(Vector) ); }
399 bool operator != (const CSG_Vector &Vector) const { return( !is_Equal(Vector) ); }
400 CSG_Vector & operator = (double Scalar);
401 CSG_Vector & operator = (const CSG_Vector &Vector);
402 CSG_Vector & operator += (double Scalar);
403 CSG_Vector & operator += (const CSG_Vector &Vector);
404 CSG_Vector & operator -= (double Scalar);
405 CSG_Vector & operator -= (const CSG_Vector &Vector);
406 CSG_Vector & operator *= (double Scalar);
407 CSG_Vector & operator *= (const CSG_Vector &Vector);
408 CSG_Vector & operator *= (const class CSG_Matrix &Matrix);
409 CSG_Vector operator + (double Scalar) const;
410 CSG_Vector operator + (const CSG_Vector &Vector) const;
411 CSG_Vector operator - (double Scalar) const;
412 CSG_Vector operator - (const CSG_Vector &Vector) const;
413 CSG_Vector operator * (double Scalar) const;
414 double operator * (const CSG_Vector &Vector) const;
415
416 bool Set_Zero (void);
417 bool Set_Unity (void);
418
419 bool Flip_Values (void);
420
421 bool Sort (bool bAscending = true);
422
423 double Get_Length (void) const;
424 CSG_Vector Get_Scalar_Product (const CSG_Vector &Vector) const;
425 CSG_Vector Get_Cross_Product (const CSG_Vector &Vector) const;
426 double Get_Angle (const CSG_Vector &Vector) const;
427 CSG_Vector Get_Unity (void) const;
428
429 typedef double const * const_iterator;
430
431 const_iterator begin (void) const { return( Get_Data() ); }
432 const_iterator end (void) const { return( Get_Data() + Get_Size() ); }
433 const_iterator cbegin (void) const { return( Get_Data() ); }
434 const_iterator cend (void) const { return( Get_Data() + Get_Size() ); }
435
436
437 private:
438
439 CSG_Array m_Array;
440
441 };
442
443 //---------------------------------------------------------
444 SAGA_API_DLL_EXPORT CSG_Vector operator * (double Scalar, const CSG_Vector &Vector);
445
446 //---------------------------------------------------------
447 SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate (double &x, double &y, double Angle);
448 SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate (double Vector[2], double Angle);
449 SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate (CSG_Vector &Vector , double Angle);
450
451 SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate (double Vector[3], size_t Axis, double Angle);
452 SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate (CSG_Vector &Vector , size_t Axis, double Angle);
453
454
456 // //
457 // //
458 // //
460
461 //---------------------------------------------------------
462 class SAGA_API_DLL_EXPORT CSG_Matrix
463 {
464 public:
465 CSG_Matrix(void);
466 virtual ~CSG_Matrix(void);
467
468 CSG_Matrix (const CSG_Matrix &Matrix);
469 bool Create (const CSG_Matrix &Matrix);
470
471 CSG_Matrix (sLong nCols, sLong nRows, const double *Data = NULL);
472 bool Create (sLong nCols, sLong nRows, const double *Data = NULL);
473
474 CSG_Matrix (sLong nCols, sLong nRows, const double **Data);
475 bool Create (sLong nCols, sLong nRows, const double **Data);
476
477 bool Destroy (void);
478
479 bool Set_Size (sLong nRows, sLong nCols);
480 bool Set_Cols (sLong nCols);
481 bool Set_Rows (sLong nRows);
482 bool Add_Cols (sLong nCols);
483 bool Add_Rows (sLong nRows);
484 bool Del_Cols (sLong nCols);
485 bool Del_Rows (sLong nRows);
486 bool Add_Col ( const double *Data = NULL);
487 bool Add_Col ( const CSG_Vector &Data);
488 bool Add_Row ( const double *Data = NULL);
489 bool Add_Row ( const CSG_Vector &Data);
490 bool Ins_Col (sLong Col, const double *Data = NULL);
491 bool Ins_Col (sLong Col, const CSG_Vector &Data);
492 bool Ins_Row (sLong Row, const double *Data = NULL);
493 bool Ins_Row (sLong Row, const CSG_Vector &Data);
494 bool Set_Col (sLong Col, const double *Data);
495 bool Set_Col (sLong Col, const CSG_Vector &Data);
496 bool Set_Col ( const CSG_Vector &Data);
497 bool Set_Row (sLong Row, const double *Data);
498 bool Set_Row (sLong Row, const CSG_Vector &Data);
499 bool Set_Row ( const CSG_Vector &Data);
500 bool Del_Col (sLong Col);
501 bool Del_Row (sLong Row);
502 CSG_Vector Get_Col (sLong Col) const;
503 CSG_Vector Get_Row (sLong Row) const;
504
505 int Get_NX (void) const { return( (int)m_nx ); }
506 int Get_NY (void) const { return( (int)m_ny ); }
507 sLong Get_NCols (void) const { return( m_nx ); }
508 sLong Get_NRows (void) const { return( m_ny ); }
509
510 operator const double ** (void) const { return( (const double **)m_z ); }
511 double ** Get_Data (void) const { return( m_z ); }
512
513 double operator () (sLong Row, sLong Col) const { return( m_z[Row][Col] ); }
514 double * operator [] (sLong Row) const { return( m_z[Row] ); }
515 double * operator [] (size_t Row) const { return( m_z[Row] ); }
516 double * operator [] (int Row) const { return( m_z[Row] ); }
517
518 CSG_String to_String (int Width = -1, int Precision = -1, bool bScientific = false, const SG_Char *Separator = NULL) const;
519 bool from_String (const CSG_String &String);
520
521 bool is_Square (void) const { return( m_nx > 0 && m_nx == m_ny ); }
522 bool is_Equal (const CSG_Matrix &Matrix) const;
523
524 bool Assign (double Scalar);
525 bool Assign (const CSG_Matrix &Matrix);
526 bool Add (double Scalar);
527 bool Add (const CSG_Matrix &Matrix);
528 bool Subtract (const CSG_Matrix &Matrix);
529 bool Multiply (double Scalar);
530 CSG_Vector Multiply (const CSG_Vector &Vector) const;
531 CSG_Matrix Multiply (const CSG_Matrix &Matrix) const;
532
533 bool operator == (const CSG_Matrix &Matrix) const;
534 CSG_Matrix & operator = (double Scalar);
535 CSG_Matrix & operator = (const CSG_Matrix &Matrix);
536 CSG_Matrix & operator += (double Scalar);
537 CSG_Matrix & operator += (const CSG_Matrix &Matrix);
538 CSG_Matrix & operator -= (double Scalar);
539 CSG_Matrix & operator -= (const CSG_Matrix &Matrix);
540 CSG_Matrix & operator *= (double Scalar);
541 CSG_Matrix & operator *= (const CSG_Matrix &Matrix);
542 CSG_Matrix operator + (double Scalar) const;
543 CSG_Matrix operator + (const CSG_Matrix &Matrix) const;
544 CSG_Matrix operator - (double Scalar) const;
545 CSG_Matrix operator - (const CSG_Matrix &Matrix) const;
546 CSG_Matrix operator * (double Scalar) const;
547 CSG_Vector operator * (const CSG_Vector &Vector) const;
548 CSG_Matrix operator * (const CSG_Matrix &Matrix) const;
549
550 bool Set_Zero (void);
551 bool Set_Identity (void);
552 bool Set_Transpose (void);
553 bool Set_Inverse (bool bSilent = true, int nSubSquare = 0);
554
555 double Get_Determinant (void) const;
556 CSG_Matrix Get_Transpose (void) const;
557 CSG_Matrix Get_Inverse (bool bSilent = true, int nSubSquare = 0) const;
558
559
560 private:
561
562 sLong m_nx, m_ny;
563
564 double **m_z;
565
566
567 void _On_Construction (void);
568
569 };
570
571 //---------------------------------------------------------
572 SAGA_API_DLL_EXPORT CSG_Matrix operator * (double Scalar, const CSG_Matrix &Matrix);
573
574 //---------------------------------------------------------
575 SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation (double R , bool bDegree = false);
576 SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation (double Rx, double Ry, double Rz, bool bDegree = false);
577
578 //---------------------------------------------------------
579 SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Decomposition (int n, int *Permutation, double **Matrix , bool bSilent = true, int *nRowChanges = NULL);
580 SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Solve (int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent = true);
581
582 SAGA_API_DLL_EXPORT bool SG_Matrix_Solve (CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent = true);
583 SAGA_API_DLL_EXPORT bool SG_Matrix_Eigen_Reduction (const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent = true);
584
585
587 // //
588 // //
589 // //
591
592 //---------------------------------------------------------
593 class SAGA_API_DLL_EXPORT CSG_Grid_Radius
594 {
595 public:
596 CSG_Grid_Radius(int maxRadius = 0);
597 ~CSG_Grid_Radius(void);
598
599 bool Create (int maxRadius);
600 void Destroy (void);
601
602 int Get_Maximum (void) { return( m_maxRadius ); }
603
604 int Get_nPoints (void) { return( m_nPoints ); }
605 int Get_nPoints (int iRadius) { return( iRadius >= 0 && iRadius < m_maxRadius ? m_nPoints_R[iRadius] : 0 ); }
606
607 double Get_Point (int iPoint, int &x, int &y)
608 {
609 if( iPoint >= 0 && iPoint < m_nPoints )
610 {
611 x = m_Points[iPoint].x;
612 y = m_Points[iPoint].y;
613
614 return( m_Points[iPoint].d ); // Distance...
615 }
616
617 return( -1. );
618 }
619
620 double Get_Point (int iPoint, int xOffset, int yOffset, int &x, int &y)
621 {
622 double d;
623
624 if( (d = Get_Point(iPoint, x, y)) >= 0. )
625 {
626 x += xOffset;
627 y += yOffset;
628 }
629
630 return( d );
631 }
632
633 double Get_Point (int iRadius, int iPoint, int &x, int &y)
634 {
635 if( iRadius >= 0 && iRadius <= m_maxRadius && iPoint >= 0 && iPoint < m_nPoints_R[iRadius] )
636 {
637 x = m_Points_R[iRadius][iPoint].x;
638 y = m_Points_R[iRadius][iPoint].y;
639
640 return( m_Points_R[iRadius][iPoint].d ); // Distance...
641 }
642
643 return( -1. );
644 }
645
646 double Get_Point (int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y)
647 {
648 double d;
649
650 if( (d = Get_Point(iRadius, iPoint, x, y)) >= 0. )
651 {
652 x += xOffset;
653 y += yOffset;
654 }
655
656 return( d );
657 }
658
659
660 private:
661
662 int m_maxRadius, m_nPoints, *m_nPoints_R;
663
664 typedef struct SSG_Grid_Radius
665 {
666 int x, y;
667
668 double d;
669 }
670 TSG_Grid_Radius;
671
672 TSG_Grid_Radius *m_Points, **m_Points_R;
673
674 };
675
676
678 // //
679 // //
680 // //
682
683 //---------------------------------------------------------
684 class SAGA_API_DLL_EXPORT CSG_Random
685 {
686 public:
687 CSG_Random(void);
688
689 static void Initialize (void);
690 static void Initialize (unsigned int Value);
691
692 static double Get_Uniform (void);
693 static double Get_Uniform (double min, double max);
694
695 static double Get_Gaussian (double mean, double stddev);
696
697 };
698
699
701 // //
702 // //
703 // //
705
706 //---------------------------------------------------------
707 class SAGA_API_DLL_EXPORT CSG_Simple_Statistics
708 {
709 public:
710 CSG_Simple_Statistics(void);
711 CSG_Simple_Statistics(bool bHoldValues);
712 CSG_Simple_Statistics(const CSG_Simple_Statistics &Statistics);
713 CSG_Simple_Statistics(double Mean, double StdDev, sLong Count = 1000);
714 CSG_Simple_Statistics(const CSG_Vector &Values, bool bHoldValues = false);
715
716 bool Create (bool bHoldValues = false);
717 bool Create (const CSG_Simple_Statistics &Statistics);
718 bool Create (double Mean, double StdDev, sLong Count = 1000);
719 bool Create (const CSG_Vector &Values, bool bHoldValues = false);
720
721 void Invalidate (void);
722 bool Evaluate (void);
723
724 int is_Evaluated (void) const { return( m_bEvaluated ); }
725
726 bool Set_Count (sLong Count);
727
728 sLong Get_Count (void) const { return( m_nValues ); }
729 double Get_Weights (void) const { return( m_Weights ); }
730
731 double Get_Minimum (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Minimum ); }
732 double Get_Maximum (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Maximum ); }
733 double Get_Range (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Range ); }
734 double Get_Sum (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Sum ); }
735 double Get_Sum_Of_Squares (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Sum2 ); }
736 double Get_Mean (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Mean ); }
737 double Get_Variance (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_Variance ); }
738 double Get_StdDev (void) { if( m_bEvaluated < 1 ) _Evaluate(1); return( m_StdDev ); }
739
740 double Get_Kurtosis (void) { if( m_bEvaluated < 2 ) _Evaluate(2); return( m_Kurtosis ); }
741 double Get_Skewness (void) { if( m_bEvaluated < 2 ) _Evaluate(2); return( m_Skewness ); }
742 double Get_SkewnessPearson (void);
743
744 double Get_Quantile (double Quantile);
745 double Get_Percentile (double Percentile);
746 double Get_Median (void);
747 double Get_Gini (void);
748
749 sLong Get_IndexOfMinimum (void);
750 sLong Get_IndexOfMaximum (void);
751
752 sLong Get_nValues_Above (double Threshold, bool bEquals = false);
753 sLong Get_nValues_Below (double Threshold, bool bEquals = false);
754
755 void Add (const CSG_Simple_Statistics &Statistics);
756
757 void Add_Value (double Value, double Weight = 1.);
758
759 double * Get_Values (void) const { return( (double *)m_Values.Get_Array() ); }
760 double Get_Value (sLong i) const { return( i >= 0 && i < (sLong)m_Values.Get_Size() ? Get_Values()[i] : m_Mean ); }
761 double operator [] (sLong i) const { return( i >= 0 && i < (sLong)m_Values.Get_Size() ? Get_Values()[i] : m_Mean ); }
762
763
764 CSG_Simple_Statistics & operator = (const CSG_Simple_Statistics &Statistics) { Create(Statistics); return( *this ); }
765 CSG_Simple_Statistics & operator += (const CSG_Simple_Statistics &Statistics) { Add(Statistics); return( *this ); }
766 CSG_Simple_Statistics & operator += (double Value) { Add_Value(Value); return( *this ); }
767
768
769 protected:
770
771 bool m_bSorted;
772
773 int m_bEvaluated;
774
775 sLong m_nValues;
776
777 double m_Weights, m_Sum, m_Sum2, m_Minimum, m_Maximum, m_Range, m_Mean, m_Variance, m_StdDev, m_Kurtosis, m_Skewness, m_Gini;
778
779 CSG_Array m_Values;
780
781
782 void _Evaluate (int Level = 1);
783
784 };
785
786
788 // //
789 // //
790 // //
792
793 //---------------------------------------------------------
794 class SAGA_API_DLL_EXPORT CSG_Unique_Value_Statistics
795 {
796 public:
797 CSG_Unique_Value_Statistics (void) {}
798 virtual ~CSG_Unique_Value_Statistics (void) {}
799
800 virtual void Create (bool bWeights = false) { m_bWeights = bWeights; }
801
802 int Get_Count (void) const { return( (int)m_Count.Get_Size() ); }
803 int Get_Count (int i) const { return( m_Count[i] ); }
804 double Get_Weight (int i) const { return( m_bWeights ? m_Weight[i] : m_Count[i] ); }
805
806 virtual int Get_Majority (bool bWeighted = false) const;
807 virtual int Get_Minority (bool bWeighted = false) const;
808
809
810 protected:
811
812 bool m_bWeights{false};
813
814 CSG_Array_Int m_Count;
815
816 CSG_Vector m_Weight;
817
818 };
819
820 //---------------------------------------------------------
821 class SAGA_API_DLL_EXPORT CSG_Unique_Number_Statistics : public CSG_Unique_Value_Statistics
822 {
823 public:
824 CSG_Unique_Number_Statistics (bool bWeights = false) { Create(bWeights); }
825 virtual ~CSG_Unique_Number_Statistics (void) {}
826
827 virtual void Create (bool bWeights = false);
828
829 void operator += (double Value) { Add_Value(Value); }
830 void Add_Value (double Value, double Weight = 1.);
831 double Get_Value (int Index) const { return( m_Value[Index] ); }
832 int Get_Class_Index (double Value) const;
833 bool Get_Class (int Index, double &Value, int &Count) const
834 {
835 if( Index < 0 || Index >= Get_Count() ) return( false );
836
837 Count = m_Count[Index];
838 Value = m_Value[Index];
839
840 return( true );
841 }
842
843 bool Get_Majority (double &Value ) const { int Count; return( Get_Class(CSG_Unique_Value_Statistics::Get_Majority(), Value, Count) ); }
844 bool Get_Majority (double &Value, int &Count) const { return( Get_Class(CSG_Unique_Value_Statistics::Get_Majority(), Value, Count) && Count > 0 ); }
845 bool Get_Minority (double &Value ) const { int Count; return( Get_Class(CSG_Unique_Value_Statistics::Get_Minority(), Value, Count) ); }
846 bool Get_Minority (double &Value, int &Count) const { return( Get_Class(CSG_Unique_Value_Statistics::Get_Minority(), Value, Count) && Count > 0 ); }
847
848
849 private:
850
851 CSG_Vector m_Value;
852
853 };
854
855 //---------------------------------------------------------
856 class SAGA_API_DLL_EXPORT CSG_Unique_String_Statistics : public CSG_Unique_Value_Statistics
857 {
858 public:
859 CSG_Unique_String_Statistics (bool bWeights = false) { Create(bWeights); }
860 virtual ~CSG_Unique_String_Statistics (void) {}
861
862 virtual void Create (bool bWeights = false);
863
864 void operator += (const CSG_String &Value) { Add_Value(Value); }
865 void Add_Value (const CSG_String &Value, double Weight = 1.);
866 const SG_Char * Get_Value (int Index) const { return( m_Value[Index] ); }
867 int Get_Class_Index (const CSG_String &Value) const;
868 bool Get_Class (int Index, CSG_String &Value, int &Count) const
869 {
870 if( Index < 0 || Index >= Get_Count() ) return( false );
871
872 Count = m_Count[Index];
873 Value = m_Value[Index];
874
875 return( true );
876 }
877
878 bool Get_Majority (CSG_String &Value ) const { int Count; return( Get_Class(CSG_Unique_Value_Statistics::Get_Majority(), Value, Count) ); }
879 bool Get_Majority (CSG_String &Value, int &Count) const { return( Get_Class(CSG_Unique_Value_Statistics::Get_Majority(), Value, Count) && Count > 0 ); }
880 bool Get_Minority (CSG_String &Value ) const { int Count; return( Get_Class(CSG_Unique_Value_Statistics::Get_Minority(), Value, Count) ); }
881 bool Get_Minority (CSG_String &Value, int &Count) const { return( Get_Class(CSG_Unique_Value_Statistics::Get_Minority(), Value, Count) && Count > 0 ); }
882
883
884 private:
885
886 CSG_Strings m_Value;
887
888 };
889
890
892 // //
893 // //
894 // //
896
897 //---------------------------------------------------------
898 class SAGA_API_DLL_EXPORT CSG_Category_Statistics
899 {
900 public:
901 CSG_Category_Statistics (TSG_Data_Type Type = SG_DATATYPE_String);
902 virtual ~CSG_Category_Statistics (void);
903
904 void Create (TSG_Data_Type Type = SG_DATATYPE_String);
905 void Destroy (void);
906
907 TSG_Data_Type Get_Category_Type (void) const;
908
909 int Add_Value (int Value);
910 int Add_Value (double Value);
911 int Add_Value (const CSG_String &Value);
912
913 void operator += (int Value) { Add_Value(Value); }
914 void operator += (double Value) { Add_Value(Value); }
915 void operator += (const CSG_String &Value) { Add_Value(Value); }
916
917 bool Sort (void);
918
919 int Get_Count (void ) const;
920 int Get_Count (int iCategory) const;
921
922 int asInt (int iCategory) const;
923 double asDouble (int iCategory) const;
924 CSG_String asString (int iCategory) const;
925
926 int Get_Category (int Value) const;
927 int Get_Category (double Value) const;
928 int Get_Category (const CSG_String &Value) const;
929
930 bool Get_Category (int iCategory, int &Value, int &Count) const
931 {
932 Count = Get_Count(iCategory);
933 Value = asInt (iCategory);
934
935 return( iCategory >= 0 && iCategory < Get_Count() );
936 }
937
938 bool Get_Category (int iCategory, double &Value, int &Count) const
939 {
940 Count = Get_Count(iCategory);
941 Value = asDouble (iCategory);
942
943 return( iCategory >= 0 && iCategory < Get_Count() );
944 }
945
946 bool Get_Category (int iCategory, CSG_String &Value, int &Count) const
947 {
948 Count = Get_Count(iCategory);
949 Value = asString (iCategory);
950
951 return( iCategory >= 0 && iCategory < Get_Count() );
952 }
953
954 int Get_Majority (void);
955 bool Get_Majority (int &Value ) { int Count; return( Get_Category(Get_Majority(), Value, Count) ); }
956 bool Get_Majority (double &Value ) { int Count; return( Get_Category(Get_Majority(), Value, Count) ); }
957 bool Get_Majority (CSG_String &Value ) { int Count; return( Get_Category(Get_Majority(), Value, Count) ); }
958 bool Get_Majority (int &Value, int &Count) { return( Get_Category(Get_Majority(), Value, Count) && Count > 0 ); }
959 bool Get_Majority (double &Value, int &Count) { return( Get_Category(Get_Majority(), Value, Count) && Count > 0 ); }
960 bool Get_Majority (CSG_String &Value, int &Count) { return( Get_Category(Get_Majority(), Value, Count) && Count > 0 ); }
961
962 int Get_Minority (void);
963 bool Get_Minority (int &Value ) { int Count; return( Get_Category(Get_Minority(), Value, Count) ); }
964 bool Get_Minority (double &Value ) { int Count; return( Get_Category(Get_Minority(), Value, Count) ); }
965 bool Get_Minority (CSG_String &Value ) { int Count; return( Get_Category(Get_Minority(), Value, Count) ); }
966 bool Get_Minority (int &Value, int &Count) { return( Get_Category(Get_Minority(), Value, Count) && Count > 0 ); }
967 bool Get_Minority (double &Value, int &Count) { return( Get_Category(Get_Minority(), Value, Count) && Count > 0 ); }
968 bool Get_Minority (CSG_String &Value, int &Count) { return( Get_Category(Get_Minority(), Value, Count) && Count > 0 ); }
969
970
971 private:
972
973 class CSG_Table *m_pTable;
974
975 };
976
977
979 // //
980 // //
981 // //
983
984 //---------------------------------------------------------
985 class SAGA_API_DLL_EXPORT CSG_Histogram
986 {
987 public:
988 CSG_Histogram(void);
989 virtual ~CSG_Histogram(void);
990
991 bool Destroy (void);
992
993 CSG_Histogram (const CSG_Histogram &Histogram);
994 bool Create (const CSG_Histogram &Histogram);
995
996 CSG_Histogram (size_t nClasses, double Minimum, double Maximum);
997 bool Create (size_t nClasses, double Minimum, double Maximum);
998
999 CSG_Histogram (size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values , size_t maxSamples = 0);
1000 bool Create (size_t nClasses, double Minimum, double Maximum, const CSG_Vector &Values , size_t maxSamples = 0);
1001
1002 CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples = 0);
1003 bool Create (size_t nClasses, double Minimum, double Maximum, class CSG_Table *pTable, int Field, size_t maxSamples = 0);
1004
1005 CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid , size_t maxSamples = 0);
1006 bool Create (size_t nClasses, double Minimum, double Maximum, class CSG_Grid *pGrid , size_t maxSamples = 0);
1007
1008 CSG_Histogram (size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids , size_t maxSamples = 0);
1009 bool Create (size_t nClasses, double Minimum, double Maximum, class CSG_Grids *pGrids , size_t maxSamples = 0);
1010
1011 //-----------------------------------------------------
1012 void Add_Value (double Value);
1013
1014 bool Scale_Element_Count (double Scale);
1015
1016 bool Update (void);
1017
1018 size_t Get_Class_Count (void) const { return( m_nClasses ); }
1019
1020 size_t Get_Element_Count (void) const { return( m_nClasses > 0 ? m_Cumulative[m_nClasses - 1] : 0 ); }
1021 size_t Get_Element_Maximum (void) const { return( m_nMaximum ); }
1022
1023 size_t Get_Elements (int i) const { return( Get_Elements((size_t)i) ); }
1024 size_t Get_Elements (size_t i) const { return( i < m_nClasses ? m_Elements[i] : 0 ); }
1025
1026 size_t Get_Cumulative (int i) const { return( Get_Cumulative((size_t)i) ); }
1027 size_t Get_Cumulative (size_t i) const { return( i < m_nClasses ? m_Cumulative[i] : 0 ); }
1028
1029 double Get_Value (double i) const { return( m_nClasses < 1 ? m_Minimum : m_Minimum + i * m_ClassWidth ); }
1030
1031 double Get_Break (int i) const { return( Get_Value((double)(i)) ); }
1032 double Get_Break (size_t i) const { return( Get_Value((double)(i)) ); }
1033
1034 double Get_Center (int i) const { return( Get_Value((double)(i + 0.5)) ); }
1035 double Get_Center (size_t i) const { return( Get_Value((double)(i + 0.5)) ); }
1036
1037 //-----------------------------------------------------
1038 CSG_Histogram & operator = (const CSG_Histogram &Histogram);
1039
1040 void operator += (double Value) { Add_Value(Value); }
1041
1042 size_t operator [] (int i) const { return( Get_Elements(i) ); }
1043 size_t operator [] (size_t i) const { return( Get_Elements(i) ); }
1044
1045 double Get_Quantile (double Quantile) const;
1046 double Get_Quantile_Value (double Value) const;
1047
1048 double Get_Percentile (double Percentile) const;
1049 double Get_Percentile_Value(double Value) const;
1050
1051 const CSG_Simple_Statistics & Get_Statistics (void) const { return( m_Statistics ); }
1052
1053
1054 private:
1055
1056 size_t m_nClasses, m_nMaximum, *m_Elements, *m_Cumulative;
1057
1058 double m_Minimum, m_Maximum, m_ClassWidth;
1059
1060 CSG_Simple_Statistics m_Statistics;
1061
1062
1063 void _On_Construction (void);
1064
1065 bool _Create (size_t nClasses, double Minimum, double Maximum);
1066
1067 bool _Update (sLong nElements);
1068
1069 };
1070
1071
1073 // //
1074 // //
1075 // //
1077
1078 //---------------------------------------------------------
1079 class SAGA_API_DLL_EXPORT CSG_Natural_Breaks
1080 {
1081 public:
1082 CSG_Natural_Breaks(void);
1083 virtual ~CSG_Natural_Breaks(void);
1084
1085 CSG_Natural_Breaks (class CSG_Table *pTable, int Field, int nClasses, int Histogram = 0);
1086 bool Create (class CSG_Table *pTable, int Field, int nClasses, int Histogram = 0);
1087
1088 CSG_Natural_Breaks (class CSG_Grid *pGrid , int nClasses, int Histogram = 0);
1089 bool Create (class CSG_Grid *pGrid , int nClasses, int Histogram = 0);
1090
1091 CSG_Natural_Breaks (class CSG_Grids *pGrids , int nClasses, int Histogram = 0);
1092 bool Create (class CSG_Grids *pGrids , int nClasses, int Histogram = 0);
1093
1094 CSG_Natural_Breaks (const CSG_Vector &Values , int nClasses, int Histogram = 0);
1095 bool Create (const CSG_Vector &Values , int nClasses, int Histogram = 0);
1096
1097 int Get_Count (void) const { return( m_Breaks.Get_N() ); }
1098 double Get_Break (int i) const { return( m_Breaks[i] ); }
1099
1100 double operator [] (int i) const { return( m_Breaks[i] ); }
1101
1102
1103 private:
1104
1105 CSG_Histogram m_Histogram;
1106
1107 CSG_Vector m_Breaks, m_Values;
1108
1109
1110 bool _Histogram (int nClasses);
1111
1112 double _Get_Value (int i);
1113
1114 bool _Calculate (int nClasses);
1115
1116 };
1117
1118
1120 // //
1121 // //
1122 // //
1124
1125 //---------------------------------------------------------
1126 enum ESG_Cluster_Analysis_Method
1127 {
1128 SG_CLUSTERANALYSIS_Minimum_Distance = 0,
1129 SG_CLUSTERANALYSIS_Hill_Climbing,
1130 SG_CLUSTERANALYSIS_Combined
1131 };
1132
1133 //---------------------------------------------------------
1134 class SAGA_API_DLL_EXPORT CSG_Cluster_Analysis
1135 {
1136 public:
1137 CSG_Cluster_Analysis(void);
1138 virtual ~CSG_Cluster_Analysis(void);
1139
1140 bool Create (int nFeatures);
1141 bool Destroy (void);
1142
1143 bool Add_Element (void);
1144 bool Set_Feature (sLong iElement, int iFeature, double Value);
1145
1146 sLong Get_Cluster (sLong iElement) const { return( iElement >= 0 && iElement < Get_nElements() ? m_Clusters[iElement] : -1 ); }
1147
1148 bool Execute (int Method, int nClusters, int nMaxIterations = 0, int Initialization = 0);
1149
1150 sLong Get_nElements (void) const { return( m_Features.Get_Size() ); }
1151 int Get_nFeatures (void) const { return( m_nFeatures ); }
1152 int Get_nClusters (void) const { return( (int)m_nMembers.Get_Size() ); }
1153
1154 int Get_Iteration (void) const { return( m_Iteration ); }
1155
1156 double Get_SP (void) const { return( m_SP ); }
1157
1158 int Get_nMembers (int iCluster) const { return( m_nMembers[iCluster] ); }
1159 double Get_Variance (int iCluster) const { return( m_Variance[iCluster] ); }
1160 double Get_Centroid (int iCluster, int iFeature) const { return( m_Centroid[iCluster][iFeature] ); }
1161
1162
1163 private:
1164
1165 int m_Iteration, m_nFeatures;
1166
1167 double m_SP;
1168
1169 CSG_Array_Int m_Clusters, m_nMembers;
1170
1171 CSG_Array m_Features;
1172
1173 CSG_Vector m_Variance;
1174
1175 CSG_Matrix m_Centroid;
1176
1177
1178 bool _Minimum_Distance (bool bInitialize, int nMaxIterations);
1179
1180 bool _Hill_Climbing (bool bInitialize, int nMaxIterations);
1181
1182 };
1183
1184
1186 // //
1187 // //
1188 // //
1190
1191 //---------------------------------------------------------
1192 enum ESG_Classify_Supervised
1193 {
1194 SG_CLASSIFY_SUPERVISED_BinaryEncoding = 0,
1195 SG_CLASSIFY_SUPERVISED_ParallelEpiped,
1196 SG_CLASSIFY_SUPERVISED_MinimumDistance,
1197 SG_CLASSIFY_SUPERVISED_Mahalonobis,
1198 SG_CLASSIFY_SUPERVISED_MaximumLikelihood,
1199 SG_CLASSIFY_SUPERVISED_SAM,
1200 SG_CLASSIFY_SUPERVISED_WTA,
1201 SG_CLASSIFY_SUPERVISED_SID,
1202 SG_CLASSIFY_SUPERVISED_SVM
1203 };
1204
1205 //---------------------------------------------------------
1206 class SAGA_API_DLL_EXPORT CSG_Classifier_Supervised
1207 {
1208 public:
1209 CSG_Classifier_Supervised(void);
1210 virtual ~CSG_Classifier_Supervised(void);
1211
1212 void Create (int nFeatures);
1213 void Destroy (void);
1214
1215 bool Load (const CSG_String &File);
1216 bool Save (const CSG_String &File, const SG_Char *Feature_Info = NULL);
1217
1218 bool Train_Clr_Samples (void);
1219 bool Train_Add_Sample (const CSG_String &Class_ID, const CSG_Vector &Features);
1220 bool Train (bool bClr_Samples = false);
1221
1222 bool Add_Class (const CSG_String &Class_ID, const CSG_Vector &Mean, const CSG_Vector &Min, const CSG_Vector &Max, const CSG_Matrix &Cov);
1223
1224 CSG_String Print (void);
1225
1226 //-----------------------------------------------------
1227 int Get_Feature_Count (void) { return( m_nFeatures ); }
1228
1229 int Get_Class_Count (void) { return( m_nClasses ); }
1230
1231 const CSG_String & Get_Class_ID (int iClass) { return( m_pClasses[iClass]->m_ID ); }
1232 double Get_Class_Mean (int iClass, int iFeature) { return( m_pClasses[iClass]->m_Mean[iFeature] ); }
1233 double Get_Class_Minimum (int iClass, int iFeature) { return( m_pClasses[iClass]->m_Min [iFeature] ); }
1234 double Get_Class_Maximum (int iClass, int iFeature) { return( m_pClasses[iClass]->m_Max [iFeature] ); }
1235
1236 int Get_Class (const CSG_String &Class_ID);
1237 bool Get_Class (const CSG_Vector &Features, int &Class, double &Quality, int Method);
1238
1239 //-----------------------------------------------------
1240 void Set_Threshold_Distance (double Value);
1241 double Get_Threshold_Distance (void);
1242
1243 void Set_Threshold_Angle (double Value);
1244 double Get_Threshold_Angle (void);
1245
1246 void Set_Threshold_Probability (double Value);
1247 double Get_Threshold_Probability (void);
1248
1249 void Set_Probability_Relative (bool Value);
1250 bool Get_Probability_Relative (void);
1251
1252 void Set_WTA (int Method, bool bOn);
1253 bool Get_WTA (int Method);
1254
1255 static CSG_String Get_Name_of_Method (int Method);
1256 static CSG_String Get_Name_of_Quality (int Method);
1257
1258
1259 private:
1260
1261 //-----------------------------------------------------
1262 class CClass
1263 {
1264 public:
1265 CClass(const CSG_String &ID) : m_ID(ID) {}
1266
1267 CSG_String m_ID;
1268
1269 double m_Cov_Det, m_Mean_Spectral;
1270
1271 CSG_Vector m_Mean, m_Min, m_Max;
1272
1273 CSG_Matrix m_Cov, m_Cov_Inv, m_Samples;
1274
1275
1276 bool Train (void);
1277
1278 };
1279
1280 //-----------------------------------------------------
1281 bool m_Probability_Relative, m_bWTA[SG_CLASSIFY_SUPERVISED_WTA];
1282
1283 int m_nFeatures, m_nClasses;
1284
1285 double m_Threshold_Distance, m_Threshold_Probability, m_Threshold_Angle;
1286
1287 CSG_String m_Info;
1288
1289 CClass **m_pClasses;
1290
1291
1292 void _Get_Binary_Encoding (const CSG_Vector &Features, int &Class, double &Quality);
1293 void _Get_Parallel_Epiped (const CSG_Vector &Features, int &Class, double &Quality);
1294 void _Get_Minimum_Distance (const CSG_Vector &Features, int &Class, double &Quality);
1295 void _Get_Mahalanobis_Distance (const CSG_Vector &Features, int &Class, double &Quality);
1296 void _Get_Maximum_Likelihood (const CSG_Vector &Features, int &Class, double &Quality);
1297 void _Get_Spectral_Angle_Mapping (const CSG_Vector &Features, int &Class, double &Quality);
1298 void _Get_Spectral_Divergence (const CSG_Vector &Features, int &Class, double &Quality);
1299 void _Get_Winner_Takes_All (const CSG_Vector &Features, int &Class, double &Quality);
1300
1301 };
1302
1303
1305 // //
1306 // //
1307 // //
1309
1310 //---------------------------------------------------------
1311 #ifdef WITH_MRMR
1312
1313 //---------------------------------------------------------
1314 enum ESG_mRMR_Method
1315 {
1316 SG_mRMR_Method_MID = 0, // Mutual Information Difference (MID)
1317 SG_mRMR_Method_MIQ // Mutual Information Quotient (MIQ)
1318 };
1319
1320 //---------------------------------------------------------
1321 class SAGA_API_DLL_EXPORT CSG_mRMR
1322 {
1323 public:
1324
1325 CSG_mRMR(void);
1326 virtual ~CSG_mRMR(void);
1327
1328 void Destroy (void);
1329
1330 static CSG_String Get_Description (void);
1331
1332 static bool Parameters_Add (class CSG_Parameters *pParameters, class CSG_Parameter *pNode = NULL);
1333 static int Parameters_Enable (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter);
1334
1335 void Set_Verbose (bool bOn = true) { m_bVerbose = bOn; }
1336
1337 bool Set_Data (CSG_Table &Data, int ClassField, class CSG_Parameters *pParameters);
1338 bool Set_Data (CSG_Matrix &Data, int ClassField, class CSG_Parameters *pParameters);
1339 bool Set_Data (CSG_Table &Data, int ClassField = 0, double Threshold = -1.);
1340 bool Set_Data (CSG_Matrix &Data, int ClassField = 0, double Threshold = -1.);
1341
1342 bool Get_Selection (class CSG_Parameters *pParameters);
1343 bool Get_Selection (int nFeatures, int Method);
1344
1345 int Get_Count (void) const;
1346 int Get_Index (int i) const;
1347 CSG_String Get_Name (int i) const;
1348 double Get_Score (int i) const;
1349
1350
1351 private:
1352
1353 bool m_bDiscretized, m_bVerbose;
1354
1355 long m_nSamples, m_nVars;
1356
1357 double **m_Samples;
1358
1359 CSG_Strings m_VarNames;
1360
1361 class CSG_Table *m_pSelection;
1362
1363
1364 bool Get_Memory (int nVars, int nSamples);
1365
1366 bool Discretize (double Threshold);
1367
1368 double Get_MutualInfo (long v1, long v2);
1369 double Get_MutualInfo (double *pab, long pabhei, long pabwid);
1370
1371 template <class T> double * Get_JointProb (T *img1, T *img2, long len, long maxstatenum, int &nstate1, int &nstate2);
1372 template <class T> void Copy_Vector (T *srcdata, long len, int *desdata, int &nstate);
1373
1374
1375 typedef struct SPool
1376 {
1377 char Mask;
1378 long Index;
1379 double mival;
1380 }
1381 TPool;
1382
1383 static int Pool_Compare (const void *a, const void *b);
1384
1385 };
1386
1387 //---------------------------------------------------------
1388 #endif // WITH_MRMR
1389
1390
1392 // //
1393 // //
1394 // //
1396
1397 //---------------------------------------------------------
1398 class SAGA_API_DLL_EXPORT CSG_Spline
1399 {
1400 public:
1401 CSG_Spline(void);
1402 virtual ~CSG_Spline(void);
1403
1404 void Destroy (void);
1405
1406 bool Create (double *xValues, double *yValues, int nValues, double yA = 1.0e30, double yB = 1.0e30);
1407 bool Create (double yA = 1.0e30, double yB = 1.0e30);
1408
1409 void Add (double x, double y);
1410
1411 int Get_Count (void) const { return( m_x.Get_N() ); }
1412 double Get_xMin (void) const { return( m_x.Get_N() > 0 ? m_x(0 ) : 0. ); }
1413 double Get_xMax (void) const { return( m_x.Get_N() > 0 ? m_x(m_x.Get_Size() - 1) : 0. ); }
1414 double Get_x (int i) const { return( i >= 0 && i < m_x.Get_N() ? m_x(i) : 0. ); }
1415 double Get_y (int i) const { return( i >= 0 && i < m_y.Get_N() ? m_y(i) : 0. ); }
1416
1417 bool Get_Value (double x, double &y);
1418 double Get_Value (double x);
1419
1420
1421 protected:
1422
1423 bool m_bCreated;
1424
1425 CSG_Vector m_x, m_y, m_z;
1426
1427
1428 bool _Create (double yA, double yB);
1429
1430 };
1431
1432 //---------------------------------------------------------
1433 class SAGA_API_DLL_EXPORT CSG_Thin_Plate_Spline
1434 {
1435 public:
1436 CSG_Thin_Plate_Spline(void);
1437 virtual ~CSG_Thin_Plate_Spline(void);
1438
1439 bool Destroy (void);
1440
1441 bool Set_Point_Count (int Count) { return( m_Points.Set_Count(Count) ); }
1442 int Get_Point_Count (void) { return( (int)m_Points.Get_Count() ); }
1443
1444 CSG_Points_3D & Get_Points (void) { return( m_Points ); }
1445
1446 bool Add_Point (double x, double y, double z) { return( m_Points.Add( x, y, z) ); }
1447 bool Add_Point (const TSG_Point &p, double z) { return( m_Points.Add(p.x, p.y, z) ); }
1448
1449 bool Set_Point (int Index, double x, double y, double z)
1450 {
1451 if( Index >= 0 && Index < m_Points.Get_Count() )
1452 {
1453 m_Points[Index].x = x;
1454 m_Points[Index].y = y;
1455 m_Points[Index].z = z;
1456
1457 return( true );
1458 }
1459
1460 return( false );
1461 }
1462
1463 bool Set_Point (int Index, const TSG_Point &p, double z) { return( Set_Point(Index, p.x, p.y, z) ); }
1464
1465 bool Create (double Regularization = 0., bool bSilent = true);
1466
1467 bool is_Okay (void) { return( m_V.Get_N() > 0 ); }
1468
1469 double Get_Value (double x, double y);
1470
1471
1472 private:
1473
1474 CSG_Points_3D m_Points;
1475
1476 CSG_Vector m_V;
1477
1478
1479 double _Get_hDistance (TSG_Point_3D A, TSG_Point_3D B);
1480 double _Get_Base_Funtion (double x);
1481 double _Get_Base_Funtion (TSG_Point_3D A, double x, double y);
1482
1483 };
1484
1485
1487 // //
1488 // //
1489 // //
1491
1492 //---------------------------------------------------------
1493 typedef enum
1494 {
1495 TESTDIST_TYPE_Left = 0,
1496 TESTDIST_TYPE_Right,
1497 TESTDIST_TYPE_Middle,
1498 TESTDIST_TYPE_TwoTail
1499 }
1500 TSG_Test_Distribution_Type;
1501
1502 //---------------------------------------------------------
1503 class SAGA_API_DLL_EXPORT CSG_Test_Distribution
1504 {
1505 public:
1506
1507 static double Get_F_Tail_from_R2 (double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
1508
1509 static double Get_F_Tail (double F , int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
1510 static double Get_F_Inverse (double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
1511
1512 static double Get_T_Tail (double T , int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
1513 static double Get_T_Inverse (double alpha, int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
1514
1515 static double Get_Norm_P (double Z);
1516 static double Get_Norm_Z (double P);
1517
1518
1519 private:
1520
1521 static double Get_Gamma (double F, double dfn, double dfd);
1522 static double Get_Log_Gamma (double a);
1523
1524 static double Get_T_P (double T, int df);
1525 static double Get_T_Z (double T, int df);
1526 static double Get_T_Inv (double p, int df);
1527
1528 static double _Change_Tail_Type (double p, TSG_Test_Distribution_Type from, TSG_Test_Distribution_Type to, bool bNegative);
1529
1530 };
1531
1532
1534 // //
1535 // //
1536 // //
1538
1539 //---------------------------------------------------------
1540 // Values: (matrix) array with number of variables = number of rows (x), number of samples = number of columns (y)
1541 SAGA_API_DLL_EXPORT CSG_Matrix SG_Get_Correlation_Matrix (const CSG_Matrix &Values, bool bCovariances = false);
1542
1543
1545 // //
1546 // //
1547 // //
1549
1550 //---------------------------------------------------------
1551 typedef enum
1552 {
1553 REGRESSION_CORR_None = 0,
1554 REGRESSION_CORR_Smith,
1555 REGRESSION_CORR_Wherry_1,
1556 REGRESSION_CORR_Wherry_2,
1557 REGRESSION_CORR_Olkin_Pratt,
1558 REGRESSION_CORR_Pratt,
1559 REGRESSION_CORR_Claudy_3
1560 }
1561 TSG_Regression_Correction;
1562
1563 //---------------------------------------------------------
1564 SAGA_API_DLL_EXPORT double SG_Regression_Get_Adjusted_R2 (double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction = REGRESSION_CORR_Wherry_1);
1565
1566
1568 // //
1570
1571 //---------------------------------------------------------
1572 typedef enum
1573 {
1574 REGRESSION_Linear = 0, // Y = a + b * X
1575 REGRESSION_Rez_X, // Y = a + b / X
1576 REGRESSION_Rez_Y, // Y = a / (b - X)
1577 REGRESSION_Pow, // Y = a * X^b
1578 REGRESSION_Exp, // Y = a * e^(b * X)
1579 REGRESSION_Log // Y = a + b * ln(X)
1580 }
1581 TSG_Regression_Type;
1582
1583 //---------------------------------------------------------
1584 class SAGA_API_DLL_EXPORT CSG_Regression
1585 {
1586 public:
1587 CSG_Regression(void);
1588 virtual ~CSG_Regression(void);
1589
1590 void Destroy (void);
1591
1592 bool Set_Values (int nValues, double *x, double *y);
1593 bool Add_Values (double x, double y);
1594
1595 int Get_Count (void) const { return( (int)m_x.Get_Size() ); }
1596
1597 double Get_xValue (int i) const { return( i >= 0 && i < Get_Count() ? m_x[i] : 0. ); }
1598 double Get_yValue (int i) const { return( i >= 0 && i < Get_Count() ? m_y[i] : 0. ); }
1599 bool Get_Values (int i, double &x, double &y) const
1600 {
1601 if( i >= 0 && i < Get_Count() )
1602 {
1603 x = m_x[i];
1604 y = m_y[i];
1605
1606 return( true );
1607 }
1608
1609 return( false );
1610 }
1611
1612 double Get_xMin (void) const { return( m_xMin ); }
1613 double Get_xMax (void) const { return( m_xMax ); }
1614 double Get_xMean (void) const { return( m_xMean ); }
1615 double Get_xVariance (void) const { return( m_xVar ); }
1616 double Get_x (double y) const; // returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
1617
1618 double Get_yMin (void) const { return( m_yMin ); }
1619 double Get_yMax (void) const { return( m_yMax ); }
1620 double Get_yMean (void) const { return( m_yMean ); }
1621 double Get_yVariance (void) const { return( m_yVar ); }
1622 double Get_y (double x) const; // returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
1623
1624 double Get_Constant (void) const { return( m_RConst ); }
1625 double Get_Coefficient (void) const { return( m_RCoeff ); }
1626 double Get_R (void) const { return( m_R ); }
1627 double Get_R2 (void) const { return( m_R2 ); }
1628 double Get_R2_Adj (void) const { return( m_R2_Adj ); }
1629 double Get_P (void) const { return( m_P ); }
1630 double Get_StdError (void) const { return( m_SE ); }
1631
1632 const SG_Char * asString (void);
1633
1634 TSG_Regression_Type Get_Type (void) const { return( m_Type ); }
1635
1636 bool Calculate ( TSG_Regression_Type Type = REGRESSION_Linear, bool bStdError = false);
1637 bool Calculate (int nValues, double *x, double *y, TSG_Regression_Type Type = REGRESSION_Linear, bool bStdError = false);
1638
1639
1640 protected:
1641
1642 double m_RConst, m_RCoeff, m_R, m_R2, m_R2_Adj, m_P, m_SE,
1643 m_xMin, m_xMax, m_xMean, m_xVar,
1644 m_yMin, m_yMax, m_yMean, m_yVar;
1645
1646 CSG_Vector m_x, m_y;
1647
1648 TSG_Regression_Type m_Type;
1649
1650
1651 double _Y_Transform (double x);
1652 double _X_Transform (double y);
1653
1654 };
1655
1656
1658 // //
1660
1661 //---------------------------------------------------------
1662 enum ESG_Multiple_Regression_Info_Vars
1663 {
1664 MLR_VAR_ID = 0,
1665 MLR_VAR_NAME,
1666 MLR_VAR_RCOEFF,
1667 MLR_VAR_R,
1668 MLR_VAR_R2,
1669 MLR_VAR_R2_ADJ,
1670 MLR_VAR_SE,
1671 MLR_VAR_T,
1672 MLR_VAR_SIG,
1673 MLR_VAR_P
1674 };
1675
1676 //---------------------------------------------------------
1677 class SAGA_API_DLL_EXPORT CSG_Regression_Multiple
1678 {
1679 public:
1680 CSG_Regression_Multiple(bool bIntercept = true);
1681 virtual ~CSG_Regression_Multiple(void);
1682
1683 void Destroy (void);
1684
1685 bool Set_Data (const CSG_Matrix &Samples, CSG_Strings *pNames = NULL);
1686
1687 void Set_With_Intercept (bool bOn = true) { m_bIntercept = bOn; }
1688 bool Get_With_Intercept (void) const { return( m_bIntercept ); }
1689
1690 bool Get_Model (const CSG_Matrix &Samples , CSG_Strings *pNames = NULL);
1691 bool Get_Model_Forward (const CSG_Matrix &Samples, double P_in , CSG_Strings *pNames = NULL);
1692 bool Get_Model_Backward (const CSG_Matrix &Samples, double P_out , CSG_Strings *pNames = NULL);
1693 bool Get_Model_Stepwise (const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames = NULL);
1694
1695 bool Get_Model (void);
1696 bool Get_Model_Forward (double P_in);
1697 bool Get_Model_Backward (double P_out);
1698 bool Get_Model_Stepwise (double P_in, double P_out);
1699
1700 bool Get_CrossValidation (int nSubSamples = 0);
1701
1702 CSG_String Get_Info (void) const;
1703 class CSG_Table * Get_Info_Regression (void) const { return( m_pRegression ); }
1704 class CSG_Table * Get_Info_Model (void) const { return( m_pModel ); }
1705 class CSG_Table * Get_Info_Steps (void) const { return( m_pSteps ); }
1706
1707 double Get_R2 (void) const;
1708 double Get_R2_Adj (void) const;
1709 double Get_StdError (void) const;
1710 double Get_F (void) const;
1711 double Get_P (void) const;
1712 double Get_CV_RMSE (void) const;
1713 double Get_CV_NRMSE (void) const;
1714 double Get_CV_R2 (void) const;
1715 int Get_CV_nSamples (void) const;
1716 int Get_DegFreedom (void) const;
1717 int Get_nSamples (void) const;
1718 int Get_nPredictors (void) const;
1719 int Get_Predictor (int i) const { return( i >= 0 && i < Get_nPredictors() ? m_Predictor[i] : -1 ); }
1720
1721 double Get_RConst (void) const;
1722 const SG_Char * Get_Name (int iVariable) const;
1723 double Get_ID (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_ID ) ); }
1724 double Get_RCoeff (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_RCOEFF) ); }
1725 double Get_R2_Partial (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_R2 ) ); }
1726 double Get_R2_Partial_Adj (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_R2_ADJ) ); }
1727 double Get_StdError (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_SE ) ); }
1728 double Get_T (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_T ) ); }
1729 double Get_P (int iVariable) const { return( Get_Parameter(iVariable, MLR_VAR_SIG ) ); }
1730
1731 double Get_Parameter (int iVariable, int Parameter) const;
1732
1733 double Get_Value (const CSG_Vector &Predictors) const;
1734 bool Get_Value (const CSG_Vector &Predictors, double &Value) const;
1735
1736 double Get_Residual (int iSample) const;
1737 bool Get_Residual (int iSample, double &Residual) const;
1738
1739 bool Get_Residuals (CSG_Vector &Residuals) const;
1740
1741
1742 protected:
1743
1744 bool m_bIntercept;
1745
1746 int *m_bIncluded, *m_Predictor, m_nPredictors;
1747
1748 CSG_Strings m_Names;
1749
1750 CSG_Matrix m_Samples, m_Samples_Model;
1751
1752 class CSG_Table *m_pRegression, *m_pModel, *m_pSteps;
1753
1754
1755 bool _Initialize (bool bInclude);
1756
1757 double _Get_F (int nPredictors, int nSamples, double r2_full, double r2_reduced);
1758 double _Get_P (int nPredictors, int nSamples, double r2_full, double r2_reduced);
1759
1760 bool _Get_Regression (const class CSG_Matrix &Samples);
1761
1762 int _Get_Step_In (CSG_Matrix &X, double P_in , double &R2, const CSG_Matrix &Samples);
1763 int _Get_Step_Out (CSG_Matrix &X, double P_out, double &R2);
1764
1765 bool _Set_Step_Info (const CSG_Matrix &X);
1766 bool _Set_Step_Info (const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn);
1767
1768 };
1769
1770
1772 // //
1774
1775 //---------------------------------------------------------
1776 class SAGA_API_DLL_EXPORT CSG_Regression_Weighted
1777 {
1778 public:
1779 CSG_Regression_Weighted(void);
1780 virtual ~CSG_Regression_Weighted(void);
1781
1782 bool Destroy (void);
1783
1784 bool Add_Sample (double Weight, double Dependent, const CSG_Vector &Predictors);
1785 int Get_Sample_Count (void) const { return( m_X.Get_NY() ); }
1786 int Get_Predictor_Count (void) const { return( m_X.Get_NX() - 1 ); }
1787
1788 bool Calculate (const CSG_Vector &Weights, const CSG_Vector &Dependents, const CSG_Matrix &Predictors, bool bLogistic = false);
1789 bool Calculate (bool bLogistic = false);
1790
1791 double Get_R2 (void) const { return( m_r2 ); }
1792 const CSG_Vector & Get_RCoeff (void) const { return( m_b ); }
1793 double Get_RCoeff (int i) const { return( m_b[i] ); }
1794 double operator [] (int i) const { return( m_b[i] ); }
1795
1796 //-----------------------------------------------------
1797 int Get_Log_maxIter (void) const { return( m_Log_maxIter ); }
1798 double Get_Log_Epsilon (void) const { return( m_Log_Epsilon ); }
1799 double Get_Log_Difference (void) const { return( m_Log_Difference ); }
1800
1801 bool Set_Log_maxIter (int maxIter );
1802 bool Set_Log_Epsilon (double Epsilon );
1803 bool Set_Log_Difference (double Difference);
1804
1805 //-----------------------------------------------------
1806 bool Get_CrossValidation (int nSubSamples = 0);
1807
1808 int Get_CV_nSamples (void) const { return( m_CV_nSamples ); }
1809 double Get_CV_RMSE (void) const { return( m_CV_RMSE ); }
1810 double Get_CV_NRMSE (void) const { return( m_CV_NRMSE ); }
1811 double Get_CV_R2 (void) const { return( m_CV_R2 ); }
1812
1813
1814 private:
1815
1816 int m_Log_maxIter, m_CV_nSamples;
1817
1818 double m_r2, m_Log_Epsilon, m_Log_Difference, m_CV_RMSE, m_CV_NRMSE, m_CV_R2;
1819
1820 CSG_Vector m_y, m_w, m_b;
1821
1822 CSG_Matrix m_X;
1823
1824
1825 CSG_Vector _Log_Get_Beta (const CSG_Matrix &X, const CSG_Vector &y, const CSG_Vector &w);
1826 CSG_Vector _Log_Get_Beta (const CSG_Vector &b, const CSG_Matrix &X, const CSG_Vector &y, const CSG_Vector &w, const CSG_Vector &p);
1827 CSG_Matrix _Log_Get_Xwp (const CSG_Vector &p, const CSG_Matrix &X, const CSG_Vector &w);
1828 CSG_Vector _Log_Get_Ywp (const CSG_Vector &p, const CSG_Vector &y, const CSG_Vector &w);
1829 CSG_Vector _Log_Get_Props (const CSG_Matrix &X, const CSG_Vector &b);
1830 bool _Log_NoChange (const CSG_Vector &b_old, const CSG_Vector &b_new);
1831 bool _Log_OutOfControl (const CSG_Vector &b_old, const CSG_Vector &b_new);
1832
1833 };
1834
1835
1837 // //
1838 // Formula Parser (A. Ringeler) //
1839 // //
1841
1842 //---------------------------------------------------------
1843 typedef double (*TSG_Formula_Function_0)(void);
1844 typedef double (*TSG_Formula_Function_1)(double);
1845 typedef double (*TSG_Formula_Function_2)(double, double);
1846 typedef double (*TSG_Formula_Function_3)(double, double, double);
1847
1848 //---------------------------------------------------------
1849 class SAGA_API_DLL_EXPORT CSG_Formula
1850 {
1851 public:
1852 CSG_Formula(void);
1853 virtual ~CSG_Formula(void);
1854
1855 bool Destroy (void);
1856
1857 static CSG_String Get_Help_Operators (bool bHTML = true, const CSG_String Additional[][2] = NULL);
1858
1859 bool Get_Error (CSG_String &Message);
1860
1861 bool Add_Function (const char *Name, TSG_Formula_Function_1 Function, int nParameters, bool bVarying = false);
1862
1863 bool Set_Formula (const CSG_String &Formula);
1864 CSG_String Get_Formula (void) const { return( m_sFormula ); }
1865
1866 void Set_Variable (char Variable, double Value);
1867
1868 double Get_Value (void ) const;
1869 double Get_Value (double x ) const;
1870 double Get_Value (const CSG_Vector &Values ) const;
1871 double Get_Value (double *Values, int nValues) const;
1872 double Get_Value (const char *Arguments, ... ) const;
1873
1874 const char * Get_Used_Variables (void);
1875
1876
1877 //-----------------------------------------------------
1878 typedef struct SSG_Function
1879 {
1880 const char *Name;
1881
1882 TSG_Formula_Function_1 Function;
1883
1884 int nParameters;
1885
1886 bool bVarying;
1887 }
1888 TSG_Function;
1889
1890
1891 private:
1892
1893 //-----------------------------------------------------
1894 typedef struct SSG_Formula
1895 {
1896 char *code;
1897
1898 double *ctable;
1899 }
1900 TSG_Formula;
1901
1902
1903 //-----------------------------------------------------
1904 bool m_bError, m_Vars_Used[256];
1905
1906 int m_Error_Position, m_Length;
1907
1908 TSG_Formula m_Formula;
1909
1910 TSG_Function *m_Functions;
1911
1912
1913 CSG_String m_sFormula, m_sError;
1914
1915 const char *m_error;
1916
1917 int m_pctable;
1918
1919 double m_Parameters[32], *m_ctable;
1920
1921
1922 void _Set_Error (const CSG_String &Error = "");
1923
1924 double _Get_Value (const double *Parameters, TSG_Formula Function) const;
1925
1926 int _is_Operand (char c);
1927 int _is_Operand_Code (char c);
1928 int _is_Number (char c);
1929
1930 int _Get_Function (int i, char *Name, int *nParameters, int *bVarying);
1931 int _Get_Function (const char *Name);
1932
1933 TSG_Formula _Translate (const char *source, const char *args, int *length, int *error);
1934
1935 char * _i_trans (char *function, char *begin, char *end);
1936 char * _comp_time (char *function, char *fend, int npars);
1937 int _max_size (const char *source);
1938 char * _my_strtok (char *s);
1939
1940 };
1941
1942
1944 // //
1945 // //
1946 // //
1948
1949 //---------------------------------------------------------
1950 enum ESG_Trend_String
1951 {
1952 SG_TREND_STRING_Formula = 0,
1953 SG_TREND_STRING_Function,
1954 SG_TREND_STRING_Formula_Parameters,
1955 SG_TREND_STRING_Complete,
1956 SG_TREND_STRING_Compact
1957 };
1958
1959 //---------------------------------------------------------
1960 class SAGA_API_DLL_EXPORT CSG_Trend
1961 {
1962 public:
1963 CSG_Trend(void);
1964
1965 bool Set_Formula (const CSG_String &Formula);
1966 CSG_String Get_Formula (int Type = SG_TREND_STRING_Complete);
1967
1968 int Get_Parameter_Count (void) const { return( m_Params .Get_Count() ); }
1969 double * Get_Parameters (void) const { return( m_Params.m_A.Get_Data() ); }
1970 bool Init_Parameter (const SG_Char &Variable, double Value);
1971
1972 void Clr_Data (void);
1973 bool Add_Data (double x, double y);
1974 void Set_Data (double *x, double *y, int n, bool bAdd = false);
1975 void Set_Data (const CSG_Points &Data , bool bAdd = false);
1976 int Get_Data_Count (void) const { return( (int)m_Data[0].Get_Count() ); }
1977 double Get_Data_X (int i) const { return( m_Data[0][i] ); }
1978 double Get_Data_XMin (void) { return( m_Data[0].Get_Minimum() ); }
1979 double Get_Data_XMax (void) { return( m_Data[0].Get_Maximum() ); }
1980 CSG_Simple_Statistics & Get_Data_XStats (void) { return( m_Data[0] ); }
1981 double Get_Data_Y (int i) const { return( m_Data[1][i] ); }
1982 double Get_Data_YMin (void) { return( m_Data[1].Get_Minimum() ); }
1983 double Get_Data_YMax (void) { return( m_Data[1].Get_Maximum() ); }
1984 CSG_Simple_Statistics & Get_Data_YStats (void) { return( m_Data[1] ); }
1985
1986 bool Set_Max_Iterations (int Iterations);
1987 int Get_Max_Iterations (void) const { return( m_Iter_Max); }
1988 bool Set_Max_Lambda (double Lambda);
1989 double Get_Max_Lambda (void) const { return( m_Lambda_Max); }
1990
1991 bool Get_Trend (double *x, double *y, int n, const CSG_String &Formula);
1992 bool Get_Trend (const CSG_Points &Data , const CSG_String &Formula);
1993 bool Get_Trend (const CSG_String &Formula);
1994 bool Get_Trend (void);
1995
1996 bool is_Okay (void) const { return( m_bOkay ); }
1997
1998 CSG_String Get_Error (void);
1999
2000 double Get_ChiSquare (void) const { return( m_bOkay ? m_ChiSqr : 0. ); }
2001 double Get_R2 (void) const { return( m_bOkay ? m_ChiSqr_o : 0. ); }
2002
2003 double Get_Value (double x) const { return( m_bOkay ? m_Formula.Get_Value(x) : 0. ); }
2004
2005
2006 private:
2007
2008 //-----------------------------------------------------
2009 class SAGA_API_DLL_EXPORT CParams
2010 {
2011 public:
2012 CParams(void) {}
2013
2014 bool Create (const CSG_String &Variables);
2015 bool Destroy (void);
2016
2017 int Get_Count (void) const { return( (int)m_Variables.Length() ); }
2018
2019
2020 CSG_String m_Variables;
2021
2022 CSG_Vector m_A, m_Atry, m_dA, m_dA2, m_Beta;
2023
2024 CSG_Matrix m_Alpha, m_Covar;
2025
2026 };
2027
2028
2029 //-----------------------------------------------------
2030 bool m_bOkay;
2031
2032 int m_Iter_Max;
2033
2034 double m_ChiSqr, m_ChiSqr_o, m_Lambda, m_Lambda_Max;
2035
2036 CParams m_Params;
2037
2038 CSG_Simple_Statistics m_Data[2];
2039
2040 CSG_Formula m_Formula;
2041
2042
2043 bool _Fit_Function (void);
2044 bool _Get_Gaussj (void);
2045 bool _Get_mrqcof (CSG_Vector &Parameters, CSG_Matrix &Alpha, CSG_Vector &Beta);
2046
2047 void _Get_Function (double &y, double *dy_da, double x, const double *Parameters);
2048
2049 };
2050
2051
2053 // //
2054 // //
2055 // //
2057
2058 //---------------------------------------------------------
2059 class SAGA_API_DLL_EXPORT CSG_Trend_Polynom
2060 {
2061 public:
2062 CSG_Trend_Polynom(void);
2063
2064 bool Destroy (void);
2065
2066 bool Set_Order (int Order = 1);
2067
2068 bool Clr_Data (void);
2069 bool Set_Data (double *x, double *y, int n, bool bAdd = false);
2070 bool Add_Data (double x, double y);
2071 int Get_Data_Count (void) const { return( m_x.Get_N() ); }
2072 double Get_Data_X (int i) const { return( m_x(i) ); }
2073 double Get_Data_Y (int i) const { return( m_y(i) ); }
2074
2075 bool Get_Trend (void);
2076
2077 int Get_Order (void) const { return( m_Order ); }
2078 int Get_nCoefficients (void) const { return( m_Order + 1 ); }
2079 double Get_Coefficient (int i) const { return( m_a(i) ); }
2080 double Get_R2 (void) const { return( m_r2 ); }
2081
2082 double Get_Value (double x) const;
2083
2084
2085 private:
2086
2087 double m_r2;
2088
2089 int m_Order;
2090
2091 CSG_Vector m_x, m_y, m_a;
2092
2093 };
2094
2095
2097 // //
2098 // //
2099 // //
2101
2102 //---------------------------------------------------------
2103 #endif // #ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
CSG_Index
Definition: mat_tools.h:185
SG_Get_Square
SAGA_API_DLL_EXPORT double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
CSG_Regression_Multiple::Get_StdError
double Get_StdError(int iVariable) const
Definition: mat_tools.h:1727
CSG_Category_Statistics::Get_Majority
bool Get_Majority(CSG_String &Value, int &Count)
Definition: mat_tools.h:960
CSG_Trend::Get_Max_Lambda
double Get_Max_Lambda(void) const
Definition: mat_tools.h:1989
CSG_Regression_Multiple::Get_RCoeff
double Get_RCoeff(int iVariable) const
Definition: mat_tools.h:1724
MLR_VAR_R2_ADJ
@ MLR_VAR_R2_ADJ
Definition: mat_tools.h:1669
CSG_Category_Statistics
Definition: mat_tools.h:899
REGRESSION_CORR_Pratt
@ REGRESSION_CORR_Pratt
Definition: mat_tools.h:1558
CSG_Index::is_Okay
bool is_Okay(void) const
Definition: mat_tools.h:223
CSG_Histogram::Get_Cumulative
size_t Get_Cumulative(int i) const
Definition: mat_tools.h:1026
CSG_Regression::Get_Type
TSG_Regression_Type Get_Type(void) const
Definition: mat_tools.h:1634
CSG_Cluster_Analysis::Get_Cluster
sLong Get_Cluster(sLong iElement) const
Definition: mat_tools.h:1146
SG_Compare_Char_Ptr
SAGA_API_DLL_EXPORT int SG_Compare_Char_Ptr(const void *a, const void *b)
Definition: mat_tools.cpp:211
CSG_Histogram::Get_Cumulative
size_t Get_Cumulative(size_t i) const
Definition: mat_tools.h:1027
CSG_Trend::Get_Parameter_Count
int Get_Parameter_Count(void) const
Definition: mat_tools.h:1968
CSG_Points_3D
Definition: geo_tools.h:320
CSG_Trend_Polynom::Get_Data_Y
double Get_Data_Y(int i) const
Definition: mat_tools.h:2073
SG_Matrix_LU_Solve
SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Solve(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent=true)
Definition: mat_matrix.cpp:2053
CSG_Formula::SSG_Function::Function
TSG_Formula_Function_1 Function
Definition: mat_tools.h:1882
CSG_Category_Statistics::Get_Minority
bool Get_Minority(int &Value)
Definition: mat_tools.h:963
CSG_Classifier_Supervised::Get_Class_Minimum
double Get_Class_Minimum(int iClass, int iFeature)
Definition: mat_tools.h:1233
ESG_Classify_Supervised
ESG_Classify_Supervised
Definition: mat_tools.h:1193
SG_Matrix_Get_Rotation
SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation(double R, bool bDegree=false)
Definition: mat_matrix.cpp:1866
CSG_Trend::Get_Data_YStats
CSG_Simple_Statistics & Get_Data_YStats(void)
Definition: mat_tools.h:1984
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
CSG_Unique_Number_Statistics::Get_Class
bool Get_Class(int Index, double &Value, int &Count) const
Definition: mat_tools.h:833
CSG_Regression_Weighted::Get_Predictor_Count
int Get_Predictor_Count(void) const
Definition: mat_tools.h:1786
CSG_Category_Statistics::Get_Category
bool Get_Category(int iCategory, CSG_String &Value, int &Count) const
Definition: mat_tools.h:946
CSG_Unique_Value_Statistics::~CSG_Unique_Value_Statistics
virtual ~CSG_Unique_Value_Statistics(void)
Definition: mat_tools.h:798
CSG_Regression_Multiple::m_Samples_Model
CSG_Matrix m_Samples_Model
Definition: mat_tools.h:1750
CSG_Vector::cend
const_iterator cend(void) const
Definition: mat_tools.h:434
SG_CLUSTERANALYSIS_Hill_Climbing
@ SG_CLUSTERANALYSIS_Hill_Climbing
Definition: mat_tools.h:1129
CSG_Unique_Value_Statistics::m_Count
CSG_Array_Int m_Count
Definition: mat_tools.h:814
CSG_Cluster_Analysis::Get_nMembers
int Get_nMembers(int iCluster) const
Definition: mat_tools.h:1158
SG_TREND_STRING_Formula_Parameters
@ SG_TREND_STRING_Formula_Parameters
Definition: mat_tools.h:1954
CSG_Vector::Get_Data
double * Get_Data(void) const
Definition: mat_tools.h:369
CSG_PriorityQueue::CSG_PriorityQueueItem::Compare
virtual int Compare(CSG_PriorityQueueItem *pItem)=0
SG_CLASSIFY_SUPERVISED_Mahalonobis
@ SG_CLASSIFY_SUPERVISED_Mahalonobis
Definition: mat_tools.h:1197
SG_Get_Rounded
SAGA_API_DLL_EXPORT double SG_Get_Rounded(double Value, int Decimals=0)
Definition: mat_tools.cpp:83
CSG_Grid_Radius::Get_Point
double Get_Point(int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y)
Definition: mat_tools.h:646
TESTDIST_TYPE_Right
@ TESTDIST_TYPE_Right
Definition: mat_tools.h:1496
CSG_Thin_Plate_Spline::Add_Point
bool Add_Point(const TSG_Point &p, double z)
Definition: mat_tools.h:1447
CSG_Regression_Multiple::Get_R2_Partial
double Get_R2_Partial(int iVariable) const
Definition: mat_tools.h:1725
REGRESSION_CORR_Olkin_Pratt
@ REGRESSION_CORR_Olkin_Pratt
Definition: mat_tools.h:1557
CSG_Grid_Radius
Definition: mat_tools.h:594
SG_Get_Digit_Count
SAGA_API_DLL_EXPORT int SG_Get_Digit_Count(int Number)
Definition: mat_tools.cpp:144
CSG_Simple_Statistics::Get_Sum_Of_Squares
double Get_Sum_Of_Squares(void)
Definition: mat_tools.h:735
CSG_Thin_Plate_Spline::Set_Point_Count
bool Set_Point_Count(int Count)
Definition: mat_tools.h:1441
CSG_Regression_Multiple::Get_Predictor
int Get_Predictor(int i) const
Definition: mat_tools.h:1719
CSG_Trend::Get_Data_X
double Get_Data_X(int i) const
Definition: mat_tools.h:1977
A
#define A
CSG_Matrix::Get_NRows
sLong Get_NRows(void) const
Definition: mat_tools.h:508
CSG_Spline::Get_y
double Get_y(int i) const
Definition: mat_tools.h:1415
CSG_Simple_Statistics::Get_Variance
double Get_Variance(void)
Definition: mat_tools.h:737
CSG_Histogram::Get_Break
double Get_Break(int i) const
Definition: mat_tools.h:1031
CSG_Regression_Weighted::Get_RCoeff
const CSG_Vector & Get_RCoeff(void) const
Definition: mat_tools.h:1792
CSG_Unique_Value_Statistics::Get_Count
int Get_Count(int i) const
Definition: mat_tools.h:803
CSG_Regression::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1595
CSG_Trend::Get_Data_Y
double Get_Data_Y(int i) const
Definition: mat_tools.h:1981
operator*
SAGA_API_DLL_EXPORT CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
CSG_Test_Distribution
Definition: mat_tools.h:1504
TESTDIST_TYPE_Middle
@ TESTDIST_TYPE_Middle
Definition: mat_tools.h:1497
CSG_Table::Get_Value
virtual bool Get_Value(sLong Index, int iField, CSG_String &Value) const
Definition: table.cpp:1161
CSG_Index::Get_Index
sLong Get_Index(sLong Position, bool Ascending=true) const
Definition: mat_tools.h:226
CSG_Unique_Number_Statistics
Definition: mat_tools.h:822
CSG_Index::CSG_Index_Compare
Definition: mat_tools.h:188
MLR_VAR_RCOEFF
@ MLR_VAR_RCOEFF
Definition: mat_tools.h:1666
CSG_PriorityQueue::Get_Item
CSG_PriorityQueueItem * Get_Item(size_t i) const
Definition: mat_tools.h:284
CSG_Regression::Get_xVariance
double Get_xVariance(void) const
Definition: mat_tools.h:1615
CSG_Unique_Value_Statistics::Get_Minority
virtual int Get_Minority(bool bWeighted=false) const
Definition: mat_tools.cpp:833
CSG_Regression::m_yVar
double m_yVar
Definition: mat_tools.h:1644
CSG_Histogram
Definition: mat_tools.h:986
CSG_Trend
Definition: mat_tools.h:1961
CSG_Vector::Get_uSize
size_t Get_uSize(void) const
Definition: mat_tools.h:366
CSG_Histogram::Get_Elements
size_t Get_Elements(size_t i) const
Definition: mat_tools.h:1024
SG_Matrix_Solve
SAGA_API_DLL_EXPORT bool SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent=true)
Definition: mat_matrix.cpp:1910
CSG_Regression_Weighted::Get_R2
double Get_R2(void) const
Definition: mat_tools.h:1791
CSG_Unique_Number_Statistics::Get_Minority
bool Get_Minority(double &Value, int &Count) const
Definition: mat_tools.h:846
CSG_Regression::m_xVar
double m_xVar
Definition: mat_tools.h:1643
CSG_Formula::SSG_Function
Definition: mat_tools.h:1879
CSG_Unique_String_Statistics::Get_Minority
bool Get_Minority(CSG_String &Value, int &Count) const
Definition: mat_tools.h:881
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Regression_Weighted::Get_Log_maxIter
int Get_Log_maxIter(void) const
Definition: mat_tools.h:1797
CSG_Classifier_Supervised::Get_Feature_Count
int Get_Feature_Count(void)
Definition: mat_tools.h:1227
MLR_VAR_R2
@ MLR_VAR_R2
Definition: mat_tools.h:1668
SG_Matrix_Eigen_Reduction
SAGA_API_DLL_EXPORT bool SG_Matrix_Eigen_Reduction(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent=true)
Definition: mat_matrix.cpp:1933
CSG_Index::CSG_Index_Compare::Compare
virtual int Compare(const sLong a, const sLong b)=0
CSG_Trend_Polynom
Definition: mat_tools.h:2060
CSG_Regression_Multiple::Get_R2_Partial_Adj
double Get_R2_Partial_Adj(int iVariable) const
Definition: mat_tools.h:1726
CSG_Simple_Statistics::Get_Sum
double Get_Sum(void)
Definition: mat_tools.h:734
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Cluster_Analysis::Get_Iteration
int Get_Iteration(void) const
Definition: mat_tools.h:1154
CSG_Spline::Get_xMax
double Get_xMax(void) const
Definition: mat_tools.h:1413
REGRESSION_CORR_Wherry_1
@ REGRESSION_CORR_Wherry_1
Definition: mat_tools.h:1555
REGRESSION_Log
@ REGRESSION_Log
Definition: mat_tools.h:1579
CSG_Cluster_Analysis
Definition: mat_tools.h:1135
CSG_Regression::Get_R2
double Get_R2(void) const
Definition: mat_tools.h:1627
CSG_Regression::Get_yMin
double Get_yMin(void) const
Definition: mat_tools.h:1618
CSG_Regression::m_SE
double m_SE
Definition: mat_tools.h:1642
CSG_Natural_Breaks
Definition: mat_tools.h:1080
CSG_Formula::Get_Formula
CSG_String Get_Formula(void) const
Definition: mat_tools.h:1864
CSG_Category_Statistics::Get_Minority
bool Get_Minority(double &Value, int &Count)
Definition: mat_tools.h:967
CSG_Natural_Breaks::Get_Break
double Get_Break(int i) const
Definition: mat_tools.h:1098
CSG_Regression_Multiple::Get_P
double Get_P(int iVariable) const
Definition: mat_tools.h:1729
CSG_Regression::Get_xMean
double Get_xMean(void) const
Definition: mat_tools.h:1614
SSG_Point
Definition: geo_tools.h:128
CSG_Regression::Get_yVariance
double Get_yVariance(void) const
Definition: mat_tools.h:1621
CSG_Category_Statistics::Get_Minority
bool Get_Minority(int &Value, int &Count)
Definition: mat_tools.h:966
CSG_Simple_Statistics::Get_Kurtosis
double Get_Kurtosis(void)
Definition: mat_tools.h:740
CSG_Regression::Get_R2_Adj
double Get_R2_Adj(void) const
Definition: mat_tools.h:1628
SG_TREND_STRING_Compact
@ SG_TREND_STRING_Compact
Definition: mat_tools.h:1956
SG_TREND_STRING_Complete
@ SG_TREND_STRING_Complete
Definition: mat_tools.h:1955
CSG_Thin_Plate_Spline::Get_Point_Count
int Get_Point_Count(void)
Definition: mat_tools.h:1442
CSG_Category_Statistics::Get_Minority
bool Get_Minority(CSG_String &Value)
Definition: mat_tools.h:965
CSG_Unique_Number_Statistics::Get_Majority
bool Get_Majority(double &Value, int &Count) const
Definition: mat_tools.h:844
CSG_Trend::Get_R2
double Get_R2(void) const
Definition: mat_tools.h:2001
CSG_Matrix::Get_Data
double ** Get_Data(void) const
Definition: mat_tools.h:511
CSG_Histogram::Get_Element_Count
size_t Get_Element_Count(void) const
Definition: mat_tools.h:1020
CSG_Regression_Multiple::Get_ID
double Get_ID(int iVariable) const
Definition: mat_tools.h:1723
CSG_Histogram::Get_Center
double Get_Center(int i) const
Definition: mat_tools.h:1034
CSG_Trend::Get_Data_YMax
double Get_Data_YMax(void)
Definition: mat_tools.h:1983
CSG_Category_Statistics::Get_Minority
bool Get_Minority(CSG_String &Value, int &Count)
Definition: mat_tools.h:968
MLR_VAR_T
@ MLR_VAR_T
Definition: mat_tools.h:1671
CSG_Trend_Polynom::Get_R2
double Get_R2(void) const
Definition: mat_tools.h:2080
CSG_Trend_Polynom::Get_Coefficient
double Get_Coefficient(int i) const
Definition: mat_tools.h:2079
CSG_Matrix::Get_NCols
sLong Get_NCols(void) const
Definition: mat_tools.h:507
SG_Regression_Get_Adjusted_R2
SAGA_API_DLL_EXPORT double SG_Regression_Get_Adjusted_R2(double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction=REGRESSION_CORR_Wherry_1)
Definition: mat_regression.cpp:63
SG_Get_Rounded_To_SignificantFigures
SAGA_API_DLL_EXPORT double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
Definition: mat_tools.cpp:107
CSG_Grid_Radius::Get_Maximum
int Get_Maximum(void)
Definition: mat_tools.h:602
CSG_Category_Statistics::Get_Majority
bool Get_Majority(int &Value)
Definition: mat_tools.h:955
SG_CLASSIFY_SUPERVISED_SVM
@ SG_CLASSIFY_SUPERVISED_SVM
Definition: mat_tools.h:1202
CSG_Formula
Definition: mat_tools.h:1850
CSG_Spline::m_bCreated
bool m_bCreated
Definition: mat_tools.h:1423
REGRESSION_Linear
@ REGRESSION_Linear
Definition: mat_tools.h:1574
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
SG_CLASSIFY_SUPERVISED_SID
@ SG_CLASSIFY_SUPERVISED_SID
Definition: mat_tools.h:1201
CSG_Unique_String_Statistics
Definition: mat_tools.h:857
SG_Get_Correlation_Matrix
SAGA_API_DLL_EXPORT CSG_Matrix SG_Get_Correlation_Matrix(const CSG_Matrix &Values, bool bCovariances=false)
Definition: mat_tools.cpp:3473
CSG_Spline::Get_x
double Get_x(int i) const
Definition: mat_tools.h:1414
REGRESSION_CORR_Claudy_3
@ REGRESSION_CORR_Claudy_3
Definition: mat_tools.h:1559
CSG_Regression_Multiple::Get_Info_Steps
class CSG_Table * Get_Info_Steps(void) const
Definition: mat_tools.h:1705
CSG_Histogram::Get_Center
double Get_Center(size_t i) const
Definition: mat_tools.h:1035
CSG_Unique_String_Statistics::~CSG_Unique_String_Statistics
virtual ~CSG_Unique_String_Statistics(void)
Definition: mat_tools.h:860
SG_CLASSIFY_SUPERVISED_WTA
@ SG_CLASSIFY_SUPERVISED_WTA
Definition: mat_tools.h:1200
CSG_Vector
Definition: mat_tools.h:345
REGRESSION_CORR_Wherry_2
@ REGRESSION_CORR_Wherry_2
Definition: mat_tools.h:1556
CSG_Parameter
Definition: parameters.h:207
TSG_Test_Distribution_Type
TSG_Test_Distribution_Type
Definition: mat_tools.h:1494
CSG_Trend::Get_Data_XMax
double Get_Data_XMax(void)
Definition: mat_tools.h:1979
CSG_Category_Statistics::Get_Majority
bool Get_Majority(int &Value, int &Count)
Definition: mat_tools.h:958
MLR_VAR_R
@ MLR_VAR_R
Definition: mat_tools.h:1667
SG_Get_Double_asString
SAGA_API_DLL_EXPORT CSG_String SG_Get_Double_asString(double Number, int Width=-1, int Precision=-1, bool bScientific=false)
Definition: mat_tools.cpp:159
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Natural_Breaks::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1097
CSG_Cluster_Analysis::Get_nElements
sLong Get_nElements(void) const
Definition: mat_tools.h:1150
CSG_Trend_Polynom::Get_Data_X
double Get_Data_X(int i) const
Definition: mat_tools.h:2072
SG_Matrix_LU_Decomposition
SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Decomposition(int n, int *Permutation, double **Matrix, bool bSilent=true, int *nRowChanges=NULL)
Definition: mat_matrix.cpp:1948
CSG_Classifier_Supervised::Get_Class_ID
const CSG_String & Get_Class_ID(int iClass)
Definition: mat_tools.h:1231
MLR_VAR_NAME
@ MLR_VAR_NAME
Definition: mat_tools.h:1665
CSG_Regression_Multiple::Get_T
double Get_T(int iVariable) const
Definition: mat_tools.h:1728
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
TSG_PFNC_Compare
int(* TSG_PFNC_Compare)(const sLong a, const sLong b)
Definition: mat_tools.h:181
CSG_Regression_Weighted::Get_RCoeff
double Get_RCoeff(int i) const
Definition: mat_tools.h:1793
CSG_Trend::Get_Parameters
double * Get_Parameters(void) const
Definition: mat_tools.h:1969
CSG_Regression_Multiple::m_Predictor
int * m_Predictor
Definition: mat_tools.h:1746
CSG_Simple_Statistics::Get_Weights
double Get_Weights(void) const
Definition: mat_tools.h:729
CSG_Regression_Weighted::Get_Log_Difference
double Get_Log_Difference(void) const
Definition: mat_tools.h:1799
CSG_Unique_Value_Statistics
Definition: mat_tools.h:795
CSG_Unique_Number_Statistics::CSG_Unique_Number_Statistics
CSG_Unique_Number_Statistics(bool bWeights=false)
Definition: mat_tools.h:824
CSG_Regression_Weighted::Get_CV_RMSE
double Get_CV_RMSE(void) const
Definition: mat_tools.h:1809
CSG_Regression::Get_xMax
double Get_xMax(void) const
Definition: mat_tools.h:1613
SG_Degree_To_Decimal
SAGA_API_DLL_EXPORT double SG_Degree_To_Decimal(double Deg, double Min, double Sec)
Definition: mat_tools.cpp:224
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Category_Statistics::Get_Majority
bool Get_Majority(double &Value)
Definition: mat_tools.h:956
CSG_Regression_Multiple::m_bIntercept
bool m_bIntercept
Definition: mat_tools.h:1744
CSG_Regression_Weighted::Get_CV_R2
double Get_CV_R2(void) const
Definition: mat_tools.h:1811
CSG_Simple_Statistics::m_bEvaluated
int m_bEvaluated
Definition: mat_tools.h:773
CSG_Unique_Number_Statistics::Get_Majority
bool Get_Majority(double &Value) const
Definition: mat_tools.h:843
CSG_Trend::is_Okay
bool is_Okay(void) const
Definition: mat_tools.h:1996
CSG_Simple_Statistics::Get_StdDev
double Get_StdDev(void)
Definition: mat_tools.h:738
ESG_Multiple_Regression_Info_Vars
ESG_Multiple_Regression_Info_Vars
Definition: mat_tools.h:1663
CSG_Histogram::Get_Break
double Get_Break(size_t i) const
Definition: mat_tools.h:1032
CSG_Regression::Get_Values
bool Get_Values(int i, double &x, double &y) const
Definition: mat_tools.h:1599
CSG_Classifier_Supervised::Get_Class_Count
int Get_Class_Count(void)
Definition: mat_tools.h:1229
CSG_PriorityQueue::Peek
CSG_PriorityQueueItem * Peek(void) const
Definition: mat_tools.h:288
TSG_Formula_Function_0
double(* TSG_Formula_Function_0)(void)
Definition: mat_tools.h:1843
CSG_Cluster_Analysis::Get_Variance
double Get_Variance(int iCluster) const
Definition: mat_tools.h:1159
CSG_Regression::Get_yValue
double Get_yValue(int i) const
Definition: mat_tools.h:1598
SG_CLASSIFY_SUPERVISED_SAM
@ SG_CLASSIFY_SUPERVISED_SAM
Definition: mat_tools.h:1199
CSG_Regression::m_Type
TSG_Regression_Type m_Type
Definition: mat_tools.h:1648
CSG_Trend_Polynom::Get_nCoefficients
int Get_nCoefficients(void) const
Definition: mat_tools.h:2078
CSG_Array_Int
Definition: api_core.h:421
CSG_Trend::Get_Data_XMin
double Get_Data_XMin(void)
Definition: mat_tools.h:1978
CSG_Simple_Statistics::is_Evaluated
int is_Evaluated(void) const
Definition: mat_tools.h:724
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
REGRESSION_Rez_X
@ REGRESSION_Rez_X
Definition: mat_tools.h:1575
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Vector::cbegin
const_iterator cbegin(void) const
Definition: mat_tools.h:433
REGRESSION_Rez_Y
@ REGRESSION_Rez_Y
Definition: mat_tools.h:1576
CSG_Classifier_Supervised::Get_Class_Maximum
double Get_Class_Maximum(int iClass, int iFeature)
Definition: mat_tools.h:1234
CSG_Formula::SSG_Function::nParameters
int nParameters
Definition: mat_tools.h:1884
CSG_Unique_Value_Statistics::m_Weight
CSG_Vector m_Weight
Definition: mat_tools.h:816
SG_CLASSIFY_SUPERVISED_ParallelEpiped
@ SG_CLASSIFY_SUPERVISED_ParallelEpiped
Definition: mat_tools.h:1195
CSG_Regression::Get_Constant
double Get_Constant(void) const
Definition: mat_tools.h:1624
CSG_Vector::end
const_iterator end(void) const
Definition: mat_tools.h:432
CSG_Unique_Number_Statistics::~CSG_Unique_Number_Statistics
virtual ~CSG_Unique_Number_Statistics(void)
Definition: mat_tools.h:825
CSG_Grid_Radius::Get_nPoints
int Get_nPoints(int iRadius)
Definition: mat_tools.h:605
CSG_Simple_Statistics::Get_Mean
double Get_Mean(void)
Definition: mat_tools.h:736
CSG_Strings
Definition: api_core.h:693
CSG_Simple_Statistics::Get_Skewness
double Get_Skewness(void)
Definition: mat_tools.h:741
CSG_Regression_Weighted::Get_CV_NRMSE
double Get_CV_NRMSE(void) const
Definition: mat_tools.h:1810
REGRESSION_Pow
@ REGRESSION_Pow
Definition: mat_tools.h:1577
CSG_Unique_Value_Statistics::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:802
CSG_Points
Definition: geo_tools.h:184
CSG_Category_Statistics::Get_Minority
bool Get_Minority(double &Value)
Definition: mat_tools.h:964
SG_CLASSIFY_SUPERVISED_MaximumLikelihood
@ SG_CLASSIFY_SUPERVISED_MaximumLikelihood
Definition: mat_tools.h:1198
CSG_Histogram::Get_Class_Count
size_t Get_Class_Count(void) const
Definition: mat_tools.h:1018
SG_Compare_Int
SAGA_API_DLL_EXPORT int SG_Compare_Int(const void *a, const void *b)
Definition: mat_tools.cpp:187
SG_CLUSTERANALYSIS_Combined
@ SG_CLUSTERANALYSIS_Combined
Definition: mat_tools.h:1130
CSG_Regression_Multiple::Get_With_Intercept
bool Get_With_Intercept(void) const
Definition: mat_tools.h:1688
CSG_Unique_Number_Statistics::Get_Value
double Get_Value(int Index) const
Definition: mat_tools.h:831
CSG_Vector::Get_Data
double Get_Data(sLong x) const
Definition: mat_tools.h:370
CSG_Regression_Multiple::Set_With_Intercept
void Set_With_Intercept(bool bOn=true)
Definition: mat_tools.h:1687
CSG_Cluster_Analysis::Get_SP
double Get_SP(void) const
Definition: mat_tools.h:1156
CSG_Table
Definition: table.h:283
CSG_Matrix::is_Square
bool is_Square(void) const
Definition: mat_tools.h:521
CSG_Cluster_Analysis::Get_nFeatures
int Get_nFeatures(void) const
Definition: mat_tools.h:1151
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
ESG_Trend_String
ESG_Trend_String
Definition: mat_tools.h:1951
TSG_Regression_Type
TSG_Regression_Type
Definition: mat_tools.h:1573
CSG_Spline::Get_xMin
double Get_xMin(void) const
Definition: mat_tools.h:1412
TSG_Regression_Correction
TSG_Regression_Correction
Definition: mat_tools.h:1552
CSG_Regression_Weighted::Get_CV_nSamples
int Get_CV_nSamples(void) const
Definition: mat_tools.h:1808
SG_TREND_STRING_Formula
@ SG_TREND_STRING_Formula
Definition: mat_tools.h:1952
CSG_PriorityQueue::Get_Size
size_t Get_Size(void) const
Definition: mat_tools.h:283
TSG_Formula_Function_2
double(* TSG_Formula_Function_2)(double, double)
Definition: mat_tools.h:1845
CSG_Unique_Number_Statistics::Get_Minority
bool Get_Minority(double &Value) const
Definition: mat_tools.h:845
CSG_Regression_Weighted
Definition: mat_tools.h:1777
CSG_Simple_Statistics::m_nValues
sLong m_nValues
Definition: mat_tools.h:775
TESTDIST_TYPE_TwoTail
@ TESTDIST_TYPE_TwoTail
Definition: mat_tools.h:1498
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Unique_String_Statistics::Get_Majority
bool Get_Majority(CSG_String &Value, int &Count) const
Definition: mat_tools.h:879
CSG_Spline
Definition: mat_tools.h:1399
CSG_Thin_Plate_Spline::Get_Points
CSG_Points_3D & Get_Points(void)
Definition: mat_tools.h:1444
CSG_Regression::Get_xMin
double Get_xMin(void) const
Definition: mat_tools.h:1612
CSG_Array
Definition: api_core.h:308
CSG_Classifier_Supervised::Get_Class_Mean
double Get_Class_Mean(int iClass, int iFeature)
Definition: mat_tools.h:1232
B
#define B
CSG_PriorityQueue::Minimum
CSG_PriorityQueueItem * Minimum(void) const
Definition: mat_tools.h:292
CSG_String
Definition: api_core.h:557
CSG_Formula::SSG_Function::Name
const char * Name
Definition: mat_tools.h:1880
CSG_Unique_Value_Statistics::Get_Weight
double Get_Weight(int i) const
Definition: mat_tools.h:804
CSG_Simple_Statistics::Get_Values
double * Get_Values(void) const
Definition: mat_tools.h:759
CSG_Simple_Statistics::Get_Value
double Get_Value(sLong i) const
Definition: mat_tools.h:760
CSG_Regression_Multiple::m_pSteps
class CSG_Table * m_pSteps
Definition: mat_tools.h:1752
CSG_Regression::m_y
CSG_Vector m_y
Definition: mat_tools.h:1646
CSG_Regression::Get_Coefficient
double Get_Coefficient(void) const
Definition: mat_tools.h:1625
CSG_PriorityQueue::is_Empty
bool is_Empty(void) const
Definition: mat_tools.h:282
CSG_Regression::Get_R
double Get_R(void) const
Definition: mat_tools.h:1626
TSG_Formula_Function_1
double(* TSG_Formula_Function_1)(double)
Definition: mat_tools.h:1844
CSG_Category_Statistics::Get_Majority
bool Get_Majority(double &Value, int &Count)
Definition: mat_tools.h:959
CSG_Simple_Statistics::Get_Range
double Get_Range(void)
Definition: mat_tools.h:733
MLR_VAR_P
@ MLR_VAR_P
Definition: mat_tools.h:1673
CSG_Regression_Multiple::Get_Info_Model
class CSG_Table * Get_Info_Model(void) const
Definition: mat_tools.h:1704
CSG_Unique_Value_Statistics::Get_Majority
virtual int Get_Majority(bool bWeighted=false) const
Definition: mat_tools.cpp:805
CSG_Regression_Multiple::m_Names
CSG_Strings m_Names
Definition: mat_tools.h:1748
SG_CLASSIFY_SUPERVISED_BinaryEncoding
@ SG_CLASSIFY_SUPERVISED_BinaryEncoding
Definition: mat_tools.h:1194
SSG_Point::x
double x
Definition: geo_tools.h:129
SG_VectorR2_Rotate
SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate(double &x, double &y, double Angle)
Definition: mat_matrix.cpp:750
CSG_Cluster_Analysis::Get_nClusters
int Get_nClusters(void) const
Definition: mat_tools.h:1152
CSG_Category_Statistics::Get_Category
bool Get_Category(int iCategory, double &Value, int &Count) const
Definition: mat_tools.h:938
SG_TREND_STRING_Function
@ SG_TREND_STRING_Function
Definition: mat_tools.h:1953
CSG_Random
Definition: mat_tools.h:685
CSG_Cluster_Analysis::Get_Centroid
double Get_Centroid(int iCluster, int iFeature) const
Definition: mat_tools.h:1160
CSG_Unique_String_Statistics::Get_Majority
bool Get_Majority(CSG_String &Value) const
Definition: mat_tools.h:878
CSG_PriorityQueue
Definition: mat_tools.h:260
CSG_Formula::TSG_Function
struct CSG_Formula::SSG_Function TSG_Function
CSG_Formula::SSG_Function::bVarying
bool bVarying
Definition: mat_tools.h:1886
CSG_Unique_Value_Statistics::Create
virtual void Create(bool bWeights=false)
Definition: mat_tools.h:800
CSG_Grid_Radius::Get_Point
double Get_Point(int iPoint, int &x, int &y)
Definition: mat_tools.h:607
CSG_Trend_Polynom::Get_Data_Count
int Get_Data_Count(void) const
Definition: mat_tools.h:2071
CSG_Regression::Get_StdError
double Get_StdError(void) const
Definition: mat_tools.h:1630
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
TSG_Formula_Function_3
double(* TSG_Formula_Function_3)(double, double, double)
Definition: mat_tools.h:1846
MLR_VAR_ID
@ MLR_VAR_ID
Definition: mat_tools.h:1664
CSG_Trend::Get_Value
double Get_Value(double x) const
Definition: mat_tools.h:2003
MLR_VAR_SE
@ MLR_VAR_SE
Definition: mat_tools.h:1670
CSG_Trend::Get_Data_Count
int Get_Data_Count(void) const
Definition: mat_tools.h:1976
SG_CLASSIFY_SUPERVISED_MinimumDistance
@ SG_CLASSIFY_SUPERVISED_MinimumDistance
Definition: mat_tools.h:1196
SG_Compare_Double
SAGA_API_DLL_EXPORT int SG_Compare_Double(const void *a, const void *b)
Definition: mat_tools.cpp:199
CSG_PriorityQueue::CSG_PriorityQueueItem::CSG_PriorityQueueItem
CSG_PriorityQueueItem(void)
Definition: mat_tools.h:267
CSG_Unique_String_Statistics::Get_Minority
bool Get_Minority(CSG_String &Value) const
Definition: mat_tools.h:880
CSG_Trend::Get_Data_YMin
double Get_Data_YMin(void)
Definition: mat_tools.h:1982
CSG_Unique_String_Statistics::Get_Value
const SG_Char * Get_Value(int Index) const
Definition: mat_tools.h:866
CSG_Unique_Value_Statistics::CSG_Unique_Value_Statistics
CSG_Unique_Value_Statistics(void)
Definition: mat_tools.h:797
CSG_Grid_Radius::Get_Point
double Get_Point(int iPoint, int xOffset, int yOffset, int &x, int &y)
Definition: mat_tools.h:620
CSG_Thin_Plate_Spline
Definition: mat_tools.h:1434
CSG_Vector::begin
const_iterator begin(void) const
Definition: mat_tools.h:431
CSG_Parameters
Definition: parameters.h:1650
CSG_Grid_Radius::Get_nPoints
int Get_nPoints(void)
Definition: mat_tools.h:604
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
TESTDIST_TYPE_Left
@ TESTDIST_TYPE_Left
Definition: mat_tools.h:1495
CSG_Unique_String_Statistics::Get_Class
bool Get_Class(int Index, CSG_String &Value, int &Count) const
Definition: mat_tools.h:868
SG_CLUSTERANALYSIS_Minimum_Distance
@ SG_CLUSTERANALYSIS_Minimum_Distance
Definition: mat_tools.h:1128
CSG_Thin_Plate_Spline::Set_Point
bool Set_Point(int Index, double x, double y, double z)
Definition: mat_tools.h:1449
CSG_Category_Statistics::Get_Majority
bool Get_Majority(CSG_String &Value)
Definition: mat_tools.h:957
CSG_Grid_Radius::Get_Point
double Get_Point(int iRadius, int iPoint, int &x, int &y)
Definition: mat_tools.h:633
CSG_Regression::Get_P
double Get_P(void) const
Definition: mat_tools.h:1629
MLR_VAR_SIG
@ MLR_VAR_SIG
Definition: mat_tools.h:1672
CSG_PriorityQueue::CSG_PriorityQueueItem
Definition: mat_tools.h:265
CSG_PriorityQueue::Maximum
CSG_PriorityQueueItem * Maximum(void) const
Definition: mat_tools.h:307
CSG_Regression_Weighted::Get_Log_Epsilon
double Get_Log_Epsilon(void) const
Definition: mat_tools.h:1798
CSG_Regression
Definition: mat_tools.h:1585
CSG_Spline::Get_Count
int Get_Count(void) const
Definition: mat_tools.h:1411
CSG_Index::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:224
SG_Decimal_To_Degree
SAGA_API_DLL_EXPORT void SG_Decimal_To_Degree(double Value, double &Deg, double &Min, double &Sec)
Definition: mat_tools.cpp:233
CSG_Trend::Get_Data_XStats
CSG_Simple_Statistics & Get_Data_XStats(void)
Definition: mat_tools.h:1980
CSG_Histogram::Get_Element_Maximum
size_t Get_Element_Maximum(void) const
Definition: mat_tools.h:1021
CSG_Matrix
Definition: mat_tools.h:463
CSG_Grids
Definition: grids.h:119
CSG_Thin_Plate_Spline::Set_Point
bool Set_Point(int Index, const TSG_Point &p, double z)
Definition: mat_tools.h:1463
CSG_Category_Statistics::Get_Category
bool Get_Category(int iCategory, int &Value, int &Count) const
Definition: mat_tools.h:930
CSG_Index::CSG_Index_Compare::~CSG_Index_Compare
virtual ~CSG_Index_Compare(void)
Definition: mat_tools.h:191
REGRESSION_Exp
@ REGRESSION_Exp
Definition: mat_tools.h:1578
CSG_Trend::Get_Max_Iterations
int Get_Max_Iterations(void) const
Definition: mat_tools.h:1987
REGRESSION_CORR_Smith
@ REGRESSION_CORR_Smith
Definition: mat_tools.h:1554
SG_VectorR3_Rotate
SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate(double Vector[3], size_t Axis, double Angle)
Definition: mat_matrix.cpp:776
CSG_Histogram::Get_Elements
size_t Get_Elements(int i) const
Definition: mat_tools.h:1023
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Simple_Statistics::m_Values
CSG_Array m_Values
Definition: mat_tools.h:779
CSG_Index::CSG_Index_Compare::CSG_Index_Compare
CSG_Index_Compare(void)
Definition: mat_tools.h:190
CSG_Trend::Get_ChiSquare
double Get_ChiSquare(void) const
Definition: mat_tools.h:2000
REGRESSION_CORR_None
@ REGRESSION_CORR_None
Definition: mat_tools.h:1553
CSG_Classifier_Supervised
Definition: mat_tools.h:1207
CSG_Histogram::Get_Value
double Get_Value(double i) const
Definition: mat_tools.h:1029
ESG_Cluster_Analysis_Method
ESG_Cluster_Analysis_Method
Definition: mat_tools.h:1127
CSG_Matrix::Get_NY
int Get_NY(void) const
Definition: mat_tools.h:506
CSG_Unique_String_Statistics::CSG_Unique_String_Statistics
CSG_Unique_String_Statistics(bool bWeights=false)
Definition: mat_tools.h:859
CSG_Regression_Multiple::Get_Info_Regression
class CSG_Table * Get_Info_Regression(void) const
Definition: mat_tools.h:1703
geo_tools.h
CSG_Regression::Get_yMax
double Get_yMax(void) const
Definition: mat_tools.h:1619
CSG_Vector::Get_Row_Count
sLong Get_Row_Count(void) const
Definition: mat_tools.h:364
CSG_Histogram::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(void) const
Definition: mat_tools.h:1051
CSG_Spline::m_z
CSG_Vector m_z
Definition: mat_tools.h:1425
CSG_Regression::Get_yMean
double Get_yMean(void) const
Definition: mat_tools.h:1620
CSG_Simple_Statistics::m_Weights
double m_Weights
Definition: mat_tools.h:777
CSG_Thin_Plate_Spline::Add_Point
bool Add_Point(double x, double y, double z)
Definition: mat_tools.h:1446
CSG_Matrix::Get_NX
int Get_NX(void) const
Definition: mat_tools.h:505
CSG_Thin_Plate_Spline::is_Okay
bool is_Okay(void)
Definition: mat_tools.h:1467
CSG_Simple_Statistics::m_bSorted
bool m_bSorted
Definition: mat_tools.h:771
CSG_Regression_Multiple
Definition: mat_tools.h:1678
CSG_Regression_Weighted::Get_Sample_Count
int Get_Sample_Count(void) const
Definition: mat_tools.h:1785
CSG_Vector::const_iterator
double const * const_iterator
Definition: mat_tools.h:429
CSG_Trend_Polynom::Get_Order
int Get_Order(void) const
Definition: mat_tools.h:2077
CSG_Regression::Get_xValue
double Get_xValue(int i) const
Definition: mat_tools.h:1597
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: mat_trend.cpp File Reference

  • saga_core
  • saga_api
Macros
mat_trend.cpp File Reference
#include "mat_tools.h"

Go to the source code of this file.

Macros

#define | SWAP(a, b) { double temp = (a); (a) = (b); (b) = temp; }
#define | EPSILON 0.001

Macro Definition Documentation

◆ EPSILON

#define EPSILON 0.001

Definition at line 72 of file mat_trend.cpp.

◆ SWAP

#define SWAP | ( | a,
 |  | b
 | ) | { double temp = (a); (a) = (b); (b) = temp; }

Definition at line 69 of file mat_trend.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: mat_trend.cpp Source File

  • saga_core
  • saga_api
mat_trend.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // mat_trend.cpp //
15 // //
16 // Copyright (C) 2006 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // contact: Olaf Conrad //
43 // Institute of Geography //
44 // University of Goettingen //
45 // Goldschmidtstr. 5 //
46 // 37077 Goettingen //
47 // Germany //
48 // //
49 // e-mail: oconrad@saga-gis.org //
50 // //
51 //-------------------------------------------------------//
52 // //
53 // Based on the LMFit.h/cpp, Fit.h/cpp source codes of //
54 // A. Ringeler (see 'table_calculus' sub project). //
55 // //
57
58 //---------------------------------------------------------
59 #include "mat_tools.h"
60
61
63 // //
64 // //
65 // //
67
68 //---------------------------------------------------------
69 #define SWAP(a, b) { double temp = (a); (a) = (b); (b) = temp; }
70
71 //---------------------------------------------------------
72 #define EPSILON 0.001
73
74
76 // //
77 // //
78 // //
80
81 //---------------------------------------------------------
82 bool CSG_Trend::CParams::Create(const CSG_String &Variables)
83 {
84 if( m_Variables.Length() != Variables.Length() )
85 {
86 m_Variables = Variables;
87
88 m_A .Create(Get_Count());
89 m_Atry .Create(Get_Count());
90 m_Beta .Create(Get_Count());
91 m_dA .Create(Get_Count());
92 m_dA2 .Create(Get_Count());
93
94 m_Alpha.Create(Get_Count(), Get_Count());
95 m_Covar.Create(Get_Count(), Get_Count());
96 }
97
98 m_A.Assign(1.);
99
100 return( true );
101 }
102
103 //---------------------------------------------------------
104 bool CSG_Trend::CParams::Destroy(void)
105 {
106 m_Variables.Clear();
107
108 m_A .Destroy();
109 m_Atry .Destroy();
110 m_Beta .Destroy();
111 m_dA .Destroy();
112 m_dA2 .Destroy();
113 m_Alpha.Destroy();
114 m_Covar.Destroy();
115
116 m_Alpha.Destroy();
117 m_Covar.Destroy();
118
119 return( true );
120 }
121
122
124 // //
126
127 //---------------------------------------------------------
128 CSG_Trend::CSG_Trend(void)
129 {
130 m_Lambda_Max = 10000;
131 m_Iter_Max = 1000;
132 m_bOkay = false;
133
134 // Set_Formula("a + b * x");
135 }
136
137
139 // //
141
142 //---------------------------------------------------------
143 bool CSG_Trend::Set_Formula(const CSG_String &Formula)
144 {
145 m_bOkay = false;
146
147 m_Params.Destroy();
148
149 if( m_Formula.Set_Formula(Formula) )
150 {
151 CSG_String Params, Used(m_Formula.Get_Used_Variables());
152
153 for(size_t i=0; i<Used.Length(); i++)
154 {
155 if( Used[i] >= 'a' && Used[i] <= 'z' && Used[i] != 'x' )
156 {
157 Params += Used[i];
158 }
159 }
160
161 return( m_Params.Create(Params) );
162 }
163
164 return( false );
165 }
166
167 //---------------------------------------------------------
168 bool CSG_Trend::Init_Parameter(const SG_Char &Variable, double Value)
169 {
170 for(size_t i=0; i<m_Params.m_Variables.Length(); i++)
171 {
172 if( Variable == m_Params.m_Variables[i] )
173 {
174 m_Params.m_A[(int)i] = Value;
175
176 return( true );
177 }
178 }
179
180 return( false );
181 }
182
183
185 // //
187
188 //---------------------------------------------------------
189 void CSG_Trend::Clr_Data(void)
190 {
191 m_Data[0].Create(true);
192 m_Data[1].Create(true);
193
194 m_bOkay = false;
195 }
196
197 //---------------------------------------------------------
198 void CSG_Trend::Set_Data(double *x, double *y, int n, bool bAdd)
199 {
200 if( !bAdd )
201 {
202 Clr_Data();
203 }
204
205 for(int i=0; i<n; i++)
206 {
207 Add_Data(x[i], y[i]);
208 }
209 }
210
211 //---------------------------------------------------------
212 void CSG_Trend::Set_Data(const CSG_Points &Data, bool bAdd)
213 {
214 if( !bAdd )
215 {
216 Clr_Data();
217 }
218
219 for(sLong i=0; i<Data.Get_Count(); i++)
220 {
221 Add_Data(Data[i].x, Data[i].y);
222 }
223 }
224
225 //---------------------------------------------------------
226 bool CSG_Trend::Add_Data(double x, double y)
227 {
228 m_Data[0] += x;
229 m_Data[1] += y;
230
231 m_bOkay = false;
232
233 return( true );
234 }
235
236
238 // //
240
241 //---------------------------------------------------------
242 bool CSG_Trend::Set_Max_Iterations(int Iterations)
243 {
244 if( Iterations > 0 )
245 {
246 m_Iter_Max = Iterations;
247
248 return( true );
249 }
250
251 return( false );
252 }
253
254 //---------------------------------------------------------
255 bool CSG_Trend::Set_Max_Lambda(double Lambda)
256 {
257 if( Lambda > 0. )
258 {
259 m_Lambda_Max = Lambda;
260
261 return( true );
262 }
263
264 return( false );
265 }
266
267
269 // //
271
272 //---------------------------------------------------------
273 bool CSG_Trend::Get_Trend(double *x, double *y, int n, const CSG_String &Formula)
274 {
275 Set_Data(x, y, n, false);
276
277 return( !Formula.is_Empty() && !Set_Formula(Formula) ? false : Get_Trend() );
278 }
279
280 //---------------------------------------------------------
281 bool CSG_Trend::Get_Trend(const CSG_Points &Data, const CSG_String &Formula)
282 {
283 Set_Data(Data, false);
284
285 return( !Formula.is_Empty() && !Set_Formula(Formula) ? false : Get_Trend() );
286 }
287
288 //---------------------------------------------------------
289 bool CSG_Trend::Get_Trend(const CSG_String &Formula)
290 {
291 return( !Formula.is_Empty() && !Set_Formula(Formula) ? false : Get_Trend() );
292 }
293
294 //---------------------------------------------------------
295 bool CSG_Trend::Get_Trend(void)
296 {
297 CSG_String sError;
298
299 if( m_Formula.Get_Error(sError) )
300 {
301 return( false );
302 }
303
304 if( Get_Data_Count() <= 1 )
305 {
306 return( false );
307 }
308
309 //-----------------------------------------------------
310 m_bOkay = true;
311
312 int i;
313
314 if( m_Params.Get_Count() > 0 )
315 {
316 m_Lambda = 0.001;
317
318 _Get_mrqcof(m_Params.m_A, m_Params.m_Alpha, m_Params.m_Beta);
319
320 m_ChiSqr_o = m_ChiSqr;
321
322 for(i=0; i<m_Params.Get_Count(); i++)
323 {
324 m_Params.m_Atry[i] = m_Params.m_A[i];
325 }
326
327 //-------------------------------------------------
328 for(i=0; i<m_Iter_Max && m_Lambda<m_Lambda_Max && m_bOkay && SG_UI_Process_Get_Okay(false); i++)
329 {
330 m_bOkay = _Fit_Function();
331 }
332
333 //-------------------------------------------------
334 for(i=0; i<m_Params.Get_Count(); i++)
335 {
336 m_Formula.Set_Variable((char)m_Params.m_Variables[i], m_Params.m_A[i]);
337 }
338 }
339
340 //-----------------------------------------------------
341 double y_m, y_o, y_t;
342
343 for(i=0, y_m=0.; i<Get_Data_Count(); i++)
344 {
345 y_m += Get_Data_Y(i);
346 }
347
348 y_m /= Get_Data_Count();
349
350 for(i=0, y_o=0., y_t=0.; i<Get_Data_Count(); i++)
351 {
352 y_o += SG_Get_Square(y_m - Get_Data_Y(i) );
353 y_t += SG_Get_Square(y_m - m_Formula.Get_Value(Get_Data_X(i)));
354 }
355
356 m_ChiSqr_o = y_o > 0. ? y_t / y_o : 0.;
357
358 return( m_bOkay );
359 }
360
361
363 // //
365
366 //---------------------------------------------------------
367 CSG_String CSG_Trend::Get_Error(void)
368 {
369 CSG_String Message;
370
371 if( !m_bOkay )
372 {
373 if( !m_Formula.Get_Error(Message) )
374 {
375 Message.Printf(_TL("Error in Trend Calculation"));
376 }
377 }
378
379 return( Message );
380 }
381
382 //---------------------------------------------------------
383 CSG_String CSG_Trend::Get_Formula(int Type)
384 {
385 CSG_String s;
386
387 switch( Type )
388 {
389 case SG_TREND_STRING_Formula: default:
390 s += m_Formula.Get_Formula();
391 break;
392
393 case SG_TREND_STRING_Function:
394 s += m_Formula.Get_Formula();
395 s += "\n";
396
397 if( m_Params.Get_Count() > 0 )
398 {
399 s += "\n";
400
401 for(int i=0; i<m_Params.Get_Count() && m_bOkay; i++)
402 {
403 s += CSG_String::Format("%c = %g\n", m_Params.m_Variables[i], m_Params.m_A[i]);
404 }
405 }
406 break;
407
408 case SG_TREND_STRING_Formula_Parameters:
409 s += m_Formula.Get_Formula();
410 s += "\n";
411
412 if( m_Params.Get_Count() > 0 && m_bOkay )
413 {
414 s += "\n";
415
416 for(int i=0; i<m_Params.Get_Count(); i++)
417 {
418 s += CSG_String::Format("%c = %g\n", m_Params.m_Variables[i], m_Params.m_A[i]);
419 }
420 }
421 break;
422
423 case SG_TREND_STRING_Complete:
424 s += m_Formula.Get_Formula();
425 s += "\n";
426
427 if( m_Params.Get_Count() > 0 && m_bOkay )
428 {
429 s += "\n";
430
431 for(int i=0; i<m_Params.Get_Count(); i++)
432 {
433 s += CSG_String::Format("%c = %g\n", m_Params.m_Variables[i], m_Params.m_A[i]);
434 }
435 }
436
437 s += "\n";
438 s += CSG_String::Format("N = %d\n" , Get_Data_Count());
439 s += CSG_String::Format("R2 = %g\n", Get_R2() * 100.);
440 break;
441
442 case SG_TREND_STRING_Compact:
443 s += m_Formula.Get_Formula();
444
445 if( m_Params.Get_Count() > 0 && m_bOkay )
446 {
447 for(int i=0; i<m_Params.Get_Count(); i++)
448 {
449 s += CSG_String::Format("%s%c=%g", !i ? SG_T("; (") : SG_T(", "), m_Params.m_Variables[i], m_Params.m_A[i]);
450 }
451
452 s += ")";
453 }
454
455 s += CSG_String::Format("; N=%d" , Get_Data_Count());
456 s += CSG_String::Format("; R2=%.2f%%", Get_R2() * 100.);
457 break;
458 }
459
460 return( s );
461 }
462
463
465 // //
467
468 //---------------------------------------------------------
469 bool CSG_Trend::_Fit_Function(void)
470 {
471 int i, j;
472
473 //-----------------------------------------------------
474 for(i=0; i<m_Params.Get_Count(); i++)
475 {
476 for(j=0; j<m_Params.Get_Count(); j++)
477 {
478 m_Params.m_Covar[i][j] = m_Params.m_Alpha[i][j];
479 }
480
481 m_Params.m_Covar[i][i] = m_Params.m_Alpha[i][i] * (1. + m_Lambda);
482 m_Params.m_dA2 [i] = m_Params.m_Beta [i];
483 }
484
485 //-----------------------------------------------------
486 if( _Get_Gaussj() == false )
487 {
488 return( false );
489 }
490
491 //-----------------------------------------------------
492 for(i=0; i<m_Params.Get_Count(); i++)
493 {
494 m_Params.m_dA[i] = m_Params.m_dA2[i];
495 }
496
497 //-----------------------------------------------------
498 if( m_Lambda == 0. )
499 {
500 for(i=m_Params.Get_Count()-1; i>0; i--)
501 {
502 for(j=0; j<m_Params.Get_Count(); j++)
503 {
504 SWAP(m_Params.m_Covar[j][i], m_Params.m_Covar[j][i-1]);
505 }
506
507 for(j=0; j<m_Params.Get_Count(); j++)
508 {
509 SWAP(m_Params.m_Covar[i][j], m_Params.m_Covar[i-1][j]);
510 }
511 }
512 }
513 else
514 {
515 for(i=0; i<m_Params.Get_Count(); i++)
516 {
517 m_Params.m_Atry[i] = m_Params.m_A[i] + m_Params.m_dA[i];
518 }
519
520 _Get_mrqcof(m_Params.m_Atry, m_Params.m_Covar, m_Params.m_dA);
521
522 if( m_ChiSqr < m_ChiSqr_o )
523 {
524 m_Lambda *= 0.1;
525 m_ChiSqr_o = m_ChiSqr;
526
527 for(i=0; i<m_Params.Get_Count(); i++)
528 {
529 for(j=0; j<m_Params.Get_Count(); j++)
530 {
531 m_Params.m_Alpha[i][j] = m_Params.m_Covar[i][j];
532 }
533
534 m_Params.m_Beta[i] = m_Params.m_dA[i];
535 }
536
537 for(i=0; i<m_Params.Get_Count(); i++) // Achtung!! in aelteren Versionen war hier ein Fehler
538 {
539 m_Params.m_A[i] = m_Params.m_Atry[i];
540 }
541 }
542 else
543 {
544 m_Lambda *= 10.;
545 m_ChiSqr = m_ChiSqr_o;
546 }
547 }
548
549 //-----------------------------------------------------
550 return( true );
551 }
552
553 //---------------------------------------------------------
554 bool CSG_Trend::_Get_Gaussj(void)
555 {
556 int i, j, k, iCol, iRow;
557
558 //-----------------------------------------------------
559 CSG_Array_Int indxc(m_Params.Get_Count());
560 CSG_Array_Int indxr(m_Params.Get_Count());
561 CSG_Array_Int ipiv (m_Params.Get_Count());
562
563 for(i=0; i<m_Params.Get_Count(); i++)
564 {
565 ipiv[i] = 0;
566 }
567
568 //-----------------------------------------------------
569 for(i=0, iCol=-1, iRow=-1; i<m_Params.Get_Count(); i++)
570 {
571 double big = 0.;
572
573 for(j=0; j<m_Params.Get_Count(); j++)
574 {
575 if( ipiv[j] != 1 )
576 {
577 for(k=0; k<m_Params.Get_Count(); k++)
578 {
579 if( ipiv[k] == 0 )
580 {
581 if( fabs(m_Params.m_Covar[j][k]) >= big )
582 {
583 big = fabs(m_Params.m_Covar[j][k]);
584 iRow = j;
585 iCol = k;
586 }
587 }
588 else if( ipiv[k] > 1 )
589 {
590 return( false ); // singular matrix...
591 }
592 }
593 }
594 }
595
596 if( iCol < 0 || iRow < 0 )
597 {
598 return( false ); // singular matrix...
599 }
600
601 //-------------------------------------------------
602 ipiv[iCol]++;
603
604 if( iRow != iCol )
605 {
606 for(j=0; j<m_Params.Get_Count(); j++)
607 {
608 SWAP(m_Params.m_Covar[iRow][j], m_Params.m_Covar[iCol][j]);
609 }
610
611 SWAP(m_Params.m_dA2[iRow], m_Params.m_dA2[iCol]);
612 }
613
614 indxr[i] = iRow;
615 indxc[i] = iCol;
616
617 if( fabs(m_Params.m_Covar[iCol][iCol]) < 1E-300 )
618 {
619 return( false ); // singular matrix...
620 }
621
622 //-------------------------------------------------
623 double pivinv = 1. / m_Params.m_Covar[iCol][iCol];
624
625 m_Params.m_Covar[iCol][iCol] = 1.;
626
627 for(j=0; j<m_Params.Get_Count(); j++)
628 {
629 m_Params.m_Covar[iCol][j] *= pivinv;
630 }
631
632 m_Params.m_dA2[iCol] *= pivinv;
633
634 //-------------------------------------------------
635 for(j=0; j<m_Params.Get_Count(); j++)
636 {
637 if( j != iCol )
638 {
639 double temp = m_Params.m_Covar[j][iCol];
640
641 m_Params.m_Covar[j][iCol] = 0.;
642
643 for(k=0; k<m_Params.Get_Count(); k++)
644 {
645 m_Params.m_Covar[j][k] -= m_Params.m_Covar[iCol][k] * temp;
646 }
647
648 m_Params.m_dA2[j] -= m_Params.m_dA2[iCol] * temp;
649 }
650 }
651 }
652
653 //-----------------------------------------------------
654 for(i=m_Params.Get_Count()-1; i>=0; i--)
655 {
656 if( indxr[i] != indxc[i] )
657 {
658 for(j=0; j<m_Params.Get_Count(); j++)
659 {
660 SWAP(m_Params.m_Covar[j][indxr[i]], m_Params.m_Covar[j][indxc[i]]);
661 }
662 }
663 }
664
665 //-----------------------------------------------------
666 return( true );
667 }
668
669 //---------------------------------------------------------
670 bool CSG_Trend::_Get_mrqcof(CSG_Vector &Parameters, CSG_Matrix &Alpha, CSG_Vector &Beta)
671 {
672 CSG_Vector dy_da(m_Params.Get_Count());
673
674 Alpha.Assign(0.);
675 Beta .Assign(0.);
676
677 m_ChiSqr = 0.;
678
679 for(int k=0; k<Get_Data_Count(); k++)
680 {
681 double y;
682
683 _Get_Function(y, dy_da.Get_Data(), Get_Data_X(k), Parameters);
684
685 double dy = Get_Data_Y(k) - y;
686
687 for(int i=0; i<m_Params.Get_Count(); i++)
688 {
689 for(int j=0; j<=i; j++)
690 {
691 Alpha[i][j] += dy_da[i] * dy_da[j];
692 }
693
694 Beta[i] += dy * dy_da[i];
695 }
696
697 m_ChiSqr += dy * dy;
698 }
699
700 //-----------------------------------------------------
701 for(int i=1; i<m_Params.Get_Count(); i++)
702 {
703 for(int j=0; j<i; j++)
704 {
705 Alpha[j][i] = Alpha[i][j];
706 }
707 }
708
709 return( true );
710 }
711
712
714 // //
716
717 //---------------------------------------------------------
718 void CSG_Trend::_Get_Function(double &y, double *dy_da, double x, const double *Parameters)
719 {
720 for(int i=0; i<m_Params.Get_Count(); i++)
721 {
722 m_Formula.Set_Variable((char)m_Params.m_Variables[i], Parameters[i]);
723 }
724
725 y = m_Formula.Get_Value(x);
726
727 //-----------------------------------------------------
728 for(int i=0; i<m_Params.Get_Count(); i++)
729 {
730 m_Formula.Set_Variable((char)m_Params.m_Variables[i], Parameters[i] + EPSILON);
731
732 dy_da[i] = m_Formula.Get_Value(x);
733 dy_da[i] -= y;
734 dy_da[i] /= EPSILON;
735
736 m_Formula.Set_Variable((char)m_Params.m_Variables[i], Parameters[i] - EPSILON);
737 }
738 }
739
740
742 // //
743 // //
744 // //
746
747 //---------------------------------------------------------
748 CSG_Trend_Polynom::CSG_Trend_Polynom(void)
749 {
750 Destroy();
751 }
752
753 //---------------------------------------------------------
754 bool CSG_Trend_Polynom::Destroy(void)
755 {
756 m_Order = 0;
757
758 Clr_Data();
759
760 return( true );
761 }
762
763 //---------------------------------------------------------
764 bool CSG_Trend_Polynom::Set_Order(int Order)
765 {
766 m_a.Destroy();
767
768 if( Order > 0 )
769 {
770 m_Order = Order;
771
772 return( true );
773 }
774
775 return( false );
776 }
777
778 //---------------------------------------------------------
779 bool CSG_Trend_Polynom::Clr_Data(void)
780 {
781 m_a.Destroy();
782 m_y.Destroy();
783 m_x.Destroy();
784
785 return( true );
786 }
787
788 //---------------------------------------------------------
789 bool CSG_Trend_Polynom::Set_Data(double *x, double *y, int n, bool bAdd)
790 {
791 if( !bAdd )
792 {
793 Clr_Data();
794 }
795
796 m_x.Add_Rows(n);
797 m_y.Add_Rows(n);
798
799 for(int i=0, j=m_x.Get_N()-1; i<n; i++)
800 {
801 m_x[j] = x[i];
802 m_y[j] = y[i];
803 }
804
805 return( true );
806 }
807
808 //---------------------------------------------------------
809 bool CSG_Trend_Polynom::Add_Data(double x, double y)
810 {
811 return( m_x.Add_Row(x) && m_y.Add_Row(y) );
812 }
813
814 //---------------------------------------------------------
815 bool CSG_Trend_Polynom::Get_Trend(void)
816 {
817 if( m_Order < 1 || m_x.Get_N() <= m_Order )
818 {
819 return( false );
820 }
821
822 //-----------------------------------------------------
823 int i;
824 double d, Ym, SSE, SSR;
825 CSG_Matrix X, Xt, C;
826
827 //-----------------------------------------------------
828 X .Create((sLong)m_Order + 1, m_y.Get_Size());
829 Xt.Create(m_y.Get_Size(), (uLong)m_Order + 1);
830
831 for(i=0, Ym=0.; i<m_y.Get_N(); i++)
832 {
833 X[i][0] = Xt[0][i] = d = 1.;
834
835 for(int j=1; j<=m_Order; j++)
836 {
837 X[i][j] = Xt[j][i] = (d = d * m_x[i]);
838 }
839
840 Ym += m_y[i];
841 }
842
843 Ym /= m_y.Get_N();
844
845 m_a = (Xt * X).Get_Inverse() * (Xt * m_y);
846
847 //-----------------------------------------------------
848 CSG_Vector Yr = X * m_a;
849
850 for(i=0, SSE=0., SSR=0.; i<m_y.Get_N(); i++)
851 {
852 SSE += SG_Get_Square(Yr[i] - m_y[i]);
853 SSR += SG_Get_Square(Yr[i] - Ym );
854 }
855
856 m_r2 = SSR / (SSR + SSE);
857
858 return( true );
859 }
860
861 //---------------------------------------------------------
862 double CSG_Trend_Polynom::Get_Value(double x) const
863 {
864 if( m_a.Get_N() > 0 )
865 {
866 double y = m_a(0);
867 double d = 1.;
868
869 for(int i=1; i<m_a.Get_N(); i++)
870 {
871 d *= x;
872 y += d * m_a(i);
873 }
874
875 return( y );
876 }
877
878 return( 0. );
879 }
880
881
883 // //
884 // //
885 // //
887
888 //---------------------------------------------------------
CSG_Formula::Get_Error
bool Get_Error(CSG_String &Message)
Definition: mat_formula.cpp:385
CSG_Trend::Get_Formula
CSG_String Get_Formula(int Type=SG_TREND_STRING_Complete)
Definition: mat_trend.cpp:383
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Trend::Clr_Data
void Clr_Data(void)
Definition: mat_trend.cpp:189
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_TREND_STRING_Formula_Parameters
@ SG_TREND_STRING_Formula_Parameters
Definition: mat_tools.h:1954
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Trend::Get_Trend
bool Get_Trend(void)
Definition: mat_trend.cpp:295
CSG_Trend::Get_Error
CSG_String Get_Error(void)
Definition: mat_trend.cpp:367
CSG_Trend::Get_Data_X
double Get_Data_X(int i) const
Definition: mat_tools.h:1977
CSG_Trend_Polynom::Set_Data
bool Set_Data(double *x, double *y, int n, bool bAdd=false)
Definition: mat_trend.cpp:789
CSG_Trend::Get_Data_Y
double Get_Data_Y(int i) const
Definition: mat_tools.h:1981
C
#define C
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
CSG_Trend_Polynom::Get_Value
double Get_Value(double x) const
Definition: mat_trend.cpp:862
CSG_Trend_Polynom::Add_Data
bool Add_Data(double x, double y)
Definition: mat_trend.cpp:809
CSG_Trend::Set_Max_Lambda
bool Set_Max_Lambda(double Lambda)
Definition: mat_trend.cpp:255
CSG_Formula::Set_Formula
bool Set_Formula(const CSG_String &Formula)
Definition: mat_formula.cpp:439
CSG_Vector::Add_Row
bool Add_Row(double Value=0.)
Definition: mat_matrix.cpp:188
CSG_Formula::Get_Formula
CSG_String Get_Formula(void) const
Definition: mat_tools.h:1864
SG_TREND_STRING_Compact
@ SG_TREND_STRING_Compact
Definition: mat_tools.h:1956
SG_TREND_STRING_Complete
@ SG_TREND_STRING_Complete
Definition: mat_tools.h:1955
CSG_String::Create
bool Create(const class wxString *pString)
Definition: api_string.cpp:109
CSG_Trend::Get_R2
double Get_R2(void) const
Definition: mat_tools.h:2001
CSG_Trend::Add_Data
bool Add_Data(double x, double y)
Definition: mat_trend.cpp:226
mat_tools.h
CSG_Trend_Polynom::Set_Order
bool Set_Order(int Order=1)
Definition: mat_trend.cpp:764
CSG_Matrix::Create
bool Create(const CSG_Matrix &Matrix)
Definition: mat_matrix.cpp:836
CSG_Trend_Polynom::Get_Trend
bool Get_Trend(void)
Definition: mat_trend.cpp:815
CSG_Vector
Definition: mat_tools.h:345
CSG_Formula::Set_Variable
void Set_Variable(char Variable, double Value)
Definition: mat_formula.cpp:433
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
CSG_Vector::Assign
bool Assign(double Scalar)
Definition: mat_matrix.cpp:317
CSG_Formula::Get_Used_Variables
const char * Get_Used_Variables(void)
Definition: mat_formula.cpp:663
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Matrix::Assign
bool Assign(double Scalar)
Definition: mat_matrix.cpp:1423
SG_Get_Square
double SG_Get_Square(double Value)
Definition: mat_tools.cpp:70
CSG_Array_Int
Definition: api_core.h:421
CSG_Trend::Set_Formula
bool Set_Formula(const CSG_String &Formula)
Definition: mat_trend.cpp:143
CSG_Vector::Get_N
int Get_N(void) const
Definition: mat_tools.h:367
SWAP
#define SWAP(a, b)
Definition: mat_trend.cpp:69
CSG_Trend_Polynom::CSG_Trend_Polynom
CSG_Trend_Polynom(void)
Definition: mat_trend.cpp:748
CSG_Trend_Polynom::Clr_Data
bool Clr_Data(void)
Definition: mat_trend.cpp:779
CSG_Points
Definition: geo_tools.h:184
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Trend::Set_Max_Iterations
bool Set_Max_Iterations(int Iterations)
Definition: mat_trend.cpp:242
CSG_Vector::Get_Size
sLong Get_Size(void) const
Definition: mat_tools.h:365
CSG_Formula::Get_Value
double Get_Value(void) const
Definition: mat_formula.cpp:465
SG_TREND_STRING_Formula
@ SG_TREND_STRING_Formula
Definition: mat_tools.h:1952
CSG_Vector::Destroy
bool Destroy(void)
Definition: mat_matrix.cpp:130
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
EPSILON
#define EPSILON
Definition: mat_trend.cpp:72
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Trend::Init_Parameter
bool Init_Parameter(const SG_Char &Variable, double Value)
Definition: mat_trend.cpp:168
CSG_Simple_Statistics::Create
bool Create(bool bHoldValues=false)
Definition: mat_tools.cpp:350
SG_TREND_STRING_Function
@ SG_TREND_STRING_Function
Definition: mat_tools.h:1953
CSG_Trend::CSG_Trend
CSG_Trend(void)
Definition: mat_trend.cpp:128
CSG_Trend::Get_Data_Count
int Get_Data_Count(void) const
Definition: mat_tools.h:1976
CSG_Trend_Polynom::Destroy
bool Destroy(void)
Definition: mat_trend.cpp:754
CSG_Matrix
Definition: mat_tools.h:463
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Trend::Set_Data
void Set_Data(double *x, double *y, int n, bool bAdd=false)
Definition: mat_trend.cpp:198
CSG_Vector::Add_Rows
bool Add_Rows(sLong nRows)
Definition: mat_matrix.cpp:156
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: metadata.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
metadata.cpp File Reference
#include <wx/xml/xml.h>
#include <wx/wfstream.h>
#include <wx/sstream.h>
#include <wx/mstream.h>
#include <wx/protocol/http.h>
#include "metadata.h"
#include "table.h"
#include <wx/protocol/ftp.h>

Go to the source code of this file.

Macros

#define SERVER_TRIM(s, p) { wxString sp(p); sp += "://"; if( s.Find(p) == 0 ) { s = s.Right(s.Length() - sp.Length()); } }

Functions

bool SG_FTP_Download (const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username, const SG_Char *Password, unsigned short Port, bool bBinary, bool bVerbose)

Macro Definition Documentation

◆ SERVER_TRIM

#define SERVER_TRIM | ( | s,
 |  | p
 | ) | { wxString sp(p); sp += "://"; if( s.Find(p) == 0 ) { s = s.Right(s.Length() - sp.Length()); } }

Function Documentation

◆ SG_FTP_Download()

bool SG_FTP_Download | ( | const CSG_String & | Target_Directory,
 |  | const CSG_String & | Source,
 |  | const SG_Char * | Username,
 |  | const SG_Char * | Password,
 |  | unsigned short | Port,
 |  | bool | bBinary,
 |  | bool | bVerbose
 | ) |  |

Definition at line 1424 of file metadata.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::BeforeFirst(), CSG_String::BeforeLast(), CSG_String::c_str(), CSG_String::Find(), CSG_String::Format(), CSG_String::is_Empty(), CSG_String::Length(), CSG_String::Right(), SG_File_Make_Path(), SG_UI_Msg_Add_Error(), and CSG_String::Trim().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: metadata.cpp Source File

  • saga_core
  • saga_api
metadata.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // metadata.cpp //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51
53 // //
54 // //
55 // //
57
58 //---------------------------------------------------------
59 #include <wx/xml/xml.h>
60 #include <wx/wfstream.h>
61 #include <wx/sstream.h>
62 #include <wx/mstream.h>
63 #include <wx/protocol/http.h>
64
65 #include "metadata.h"
66 #include "table.h"
67
68
70 // //
71 // //
72 // //
74
75 //---------------------------------------------------------
76 CSG_MetaData::CSG_MetaData(void)
77 {
78 _On_Construction();
79 }
80
81 bool CSG_MetaData::Create(void)
82 {
83 return( true );
84 }
85
86 //---------------------------------------------------------
87 CSG_MetaData::CSG_MetaData(const CSG_MetaData &MetaData)
88 {
89 _On_Construction();
90
91 Create(MetaData);
92 }
93
94 bool CSG_MetaData::Create(const CSG_MetaData &MetaData)
95 {
96 return( Assign(MetaData) );
97 }
98
99 //---------------------------------------------------------
100 CSG_MetaData::CSG_MetaData(const CSG_String &File, const SG_Char *Extension)
101 {
102 _On_Construction();
103
104 Create(File, Extension);
105 }
106
107 bool CSG_MetaData::Create(const CSG_String &File, const SG_Char *Extension)
108 {
109 return( Load(File, Extension) );
110 }
111
112 //---------------------------------------------------------
113 CSG_MetaData::CSG_MetaData(CSG_File &Stream)
114 {
115 _On_Construction();
116
117 Create(Stream);
118 }
119
120 bool CSG_MetaData::Create(CSG_File &Stream)
121 {
122 return( Load(Stream) );
123 }
124
125 //---------------------------------------------------------
126 CSG_MetaData::CSG_MetaData(CSG_MetaData *pParent)
127 {
128 _On_Construction();
129
130 m_pParent = pParent;
131 }
132
133 //---------------------------------------------------------
134 void CSG_MetaData::_On_Construction(void)
135 {
136 m_pParent = NULL;
137
138 m_Children.Create(sizeof(CSG_MetaData **), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
139 }
140
141 //---------------------------------------------------------
142 CSG_MetaData::~CSG_MetaData(void)
143 {
144 Destroy();
145 }
146
147 //---------------------------------------------------------
148 void CSG_MetaData::Destroy(void)
149 {
150 CSG_MetaData **m_pChildren = (CSG_MetaData **)m_Children.Get_Array();
151
152 for(int i=0; i<Get_Children_Count(); i++)
153 {
154 delete(m_pChildren[i]);
155 }
156
157 m_Children.Destroy();
158
159 // m_pParent = NULL;
160
161 // m_Name .Clear();
162 // m_Content .Clear();
163
164 m_Prop_Names .Clear();
165 m_Prop_Values .Clear();
166 }
167
168
170 // //
172
173 //---------------------------------------------------------
174 CSG_MetaData * CSG_MetaData::Add_Child(void)
175 {
176 return( Ins_Child(-1) );
177 }
178
179 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_String &Name)
180 {
181 return( Ins_Child(Name, -1) );
182 }
183
184 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_String &Name, const CSG_String &Content)
185 {
186 return( Ins_Child(Name, Content, -1) );
187 }
188
189 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_String &Name, double Content)
190 {
191 return( Ins_Child(Name, SG_Get_String(Content, -16), -1) );
192 }
193
194 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_String &Name, int Content)
195 {
196 return( Ins_Child(Name, CSG_String::Format(SG_T("%d"), Content), -1) );
197 }
198
199 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_String &Name, sLong Content)
200 {
201 return( Ins_Child(Name, CSG_String::Format(SG_T("%lld"), Content), -1) );
202 }
203
204 CSG_MetaData * CSG_MetaData::Add_Child(const CSG_MetaData &MetaData, bool bAddChildren)
205 {
206 return( Ins_Child(MetaData, -1, bAddChildren) );
207 }
208
209
211 // //
213
214 //---------------------------------------------------------
215 CSG_MetaData * CSG_MetaData::Ins_Child(int Position)
216 {
217 if( !m_Children.Inc_Array() )
218 {
219 return( NULL );
220 }
221
222 CSG_MetaData **pChildren = (CSG_MetaData **)m_Children.Get_Array();
223
224 if( Position < 0 || Position >= Get_Children_Count() )
225 {
226 Position = Get_Children_Count() - 1;
227 }
228
229 for(int i=Get_Children_Count()-1; i>Position; i--)
230 {
231 pChildren[i] = pChildren[i - 1];
232 }
233
234 return( pChildren[Position] = new CSG_MetaData(this) );
235 }
236
237 //---------------------------------------------------------
238 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_String &Name, const CSG_String &Content, int Position)
239 {
240 CSG_MetaData *pChild = Ins_Child(Position);
241
242 if( pChild )
243 {
244 pChild->m_Name = Name;
245 pChild->m_Content = Content;
246 }
247
248 return( pChild );
249 }
250
251 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_String &Name, int Position)
252 {
253 return( Ins_Child(Name, CSG_String(""), Position) );
254 }
255
256 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_String &Name, double Content, int Position)
257 {
258 return( Ins_Child(Name, SG_Get_String(Content, -16), Position) );
259 }
260
261 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_String &Name, int Content, int Position)
262 {
263 return( Ins_Child(Name, CSG_String::Format(SG_T("%d"), Content), Position) );
264 }
265
266 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_String &Name, sLong Content, int Position)
267 {
268 return( Ins_Child(Name, CSG_String::Format(SG_T("%lld"), Content), Position) );
269 }
270
271 CSG_MetaData * CSG_MetaData::Ins_Child(const CSG_MetaData &MetaData, int Position, bool bAddChildren)
272 {
273 CSG_MetaData *pChild = Ins_Child(Position);
274
275 if( pChild )
276 {
277 pChild->Assign(MetaData, bAddChildren);
278 }
279
280 return( pChild );
281 }
282
283
285 // //
287
288 //---------------------------------------------------------
289 bool CSG_MetaData::Mov_Child(int from_Index, int to_Index)
290 {
291 if( from_Index < 0 || from_Index >= Get_Children_Count()
292 || to_Index < 0 || to_Index >= Get_Children_Count() )
293 {
294 return( false );
295 }
296
297 if( from_Index != to_Index )
298 {
299 CSG_MetaData **pChildren = (CSG_MetaData **)m_Children.Get_Array();
300 CSG_MetaData *pChild = pChildren[from_Index];
301
302 if( from_Index < to_Index )
303 {
304 for(int i=from_Index; i<to_Index; i++)
305 {
306 pChildren[i] = pChildren[i + 1];
307 }
308 }
309 else // if( from_Index > to_Index )
310 {
311 for(int i=from_Index; i>to_Index; i--)
312 {
313 pChildren[i] = pChildren[i - 1];
314 }
315 }
316
317 pChildren[to_Index] = pChild;
318 }
319
320 return( true );
321 }
322
323
325 // //
327
328 //---------------------------------------------------------
329 bool CSG_MetaData::Del_Child(int Index)
330 {
331 if( Index >= 0 && Index < Get_Children_Count() )
332 {
333 CSG_MetaData **pChildren = (CSG_MetaData **)m_Children.Get_Array();
334
335 delete(pChildren[Index]);
336
337 for(int i=Index, j=Index+1; j<Get_Children_Count(); i++, j++)
338 {
339 pChildren[i] = pChildren[j];
340 }
341
342 m_Children.Dec_Array();
343
344 return( true );
345 }
346
347 return( false );
348 }
349
350 //---------------------------------------------------------
351 bool CSG_MetaData::Add_Children(const CSG_MetaData &MetaData)
352 {
353 if( &MetaData != this )
354 {
355 for(int i=0; i<MetaData.Get_Children_Count(); i++)
356 {
357 Add_Child(MetaData[i], true);
358 }
359 }
360
361 return( true );
362 }
363
364 //---------------------------------------------------------
372 //---------------------------------------------------------
373 bool CSG_MetaData::Del_Children(int Depth, const SG_Char *Name)
374 {
375 if( Depth < 0 )
376 {
377 // nop
378 }
379 else if( Name && *Name )
380 {
381 for(int i=Get_Children_Count()-1; i>=0; i--)
382 {
383 if( Get_Child(i)->Get_Name().CmpNoCase(Name) )
384 {
385 Get_Child(i)->Del_Children(Depth, Name);
386 }
387 else if( Depth > 0 )
388 {
389 Get_Child(i)->Del_Children(Depth - 1, Name);
390 }
391 else
392 {
393 Del_Child(i);
394 }
395 }
396 }
397 else if( Depth > 0 )
398 {
399 for(int i=0; i<Get_Children_Count(); i++)
400 {
401 Get_Child(i)->Del_Children(Depth - 1, Name);
402 }
403 }
404 else
405 {
406 for(int i=0; i<Get_Children_Count(); i++)
407 {
408 delete(Get_Child(i));
409 }
410
411 m_Children.Destroy();
412 }
413
414 return( true );
415 }
416
417 //---------------------------------------------------------
418 int CSG_MetaData::_Get_Child(const CSG_String &Name) const
419 {
420 for(int i=0; i<Get_Children_Count(); i++)
421 {
422 if( Name.CmpNoCase(Get_Child(i)->Get_Name()) == 0 )
423 {
424 return( i );
425 }
426 }
427
428 return( -1 );
429 }
430
431
433 // //
435
436 //---------------------------------------------------------
437 bool CSG_MetaData::Cmp_Name(const CSG_String &String, bool bNoCase) const
438 {
439 return( bNoCase ? !m_Name.CmpNoCase(String) : !m_Name.Cmp(String) );
440 }
441
442
444 // //
446
447 //---------------------------------------------------------
448 bool CSG_MetaData::Get_Content(const CSG_String &Name, CSG_String &Value) const
449 {
450 const SG_Char *cString = Name.is_Empty() ? Get_Content().c_str() : Get_Content(Name);
451
452 if( cString )
453 {
454 Value = cString;
455
456 return( true );
457 }
458
459 return( false );
460 }
461
462 //---------------------------------------------------------
463 bool CSG_MetaData::Get_Content(const CSG_String &Name, double &Value) const
464 {
465 CSG_String s;
466
467 return( Get_Content(Name, s) && s.asDouble(Value) );
468 }
469
470 //---------------------------------------------------------
471 bool CSG_MetaData::Get_Content(const CSG_String &Name, int &Value) const
472 {
473 CSG_String s;
474
475 return( Get_Content(Name, s) && s.asInt(Value) );
476 }
477
478 //---------------------------------------------------------
479 bool CSG_MetaData::Get_Content(const CSG_String &Name, sLong &Value) const
480 {
481 CSG_String s;
482
483 return( Get_Content(Name, s) && s.asLongLong(Value) );
484 }
485
487 // //
489
490 //---------------------------------------------------------
491 void CSG_MetaData::Fmt_Content(const char *Format, ...)
492 {
493 wxString s;
494
495 va_list argptr;
496
497 #ifdef _SAGA_LINUX
498 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
499 va_start(argptr, _Format);
500 s.PrintfV(_Format, argptr);
501 #else
502 va_start(argptr, Format);
503 s.PrintfV(Format, argptr);
504 #endif
505
506 m_Content = CSG_String(&s);
507
508 va_end(argptr);
509 }
510
511 //---------------------------------------------------------
512 void CSG_MetaData::Fmt_Content(const wchar_t *Format, ...)
513 {
514 wxString s;
515
516 va_list argptr;
517
518 #ifdef _SAGA_LINUX
519 wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
520 va_start(argptr, _Format);
521 s.PrintfV(_Format, argptr);
522 #else
523 va_start(argptr, Format);
524 s.PrintfV(Format, argptr);
525 #endif
526
527 m_Content = CSG_String(&s);
528
529 va_end(argptr);
530 }
531
532 //---------------------------------------------------------
533 bool CSG_MetaData::Cmp_Content(const CSG_String &String, bool bNoCase) const
534 {
535 return( bNoCase ? !m_Content.CmpNoCase(String) : !m_Content.Cmp(String) );
536 }
537
538
540 // //
542
543 //---------------------------------------------------------
544 bool CSG_MetaData::Add_Property(const CSG_String &Name, const CSG_String &Value)
545 {
546 if( !Value.is_Empty() &&_Get_Property(Name) < 0 )
547 {
548 m_Prop_Names .Add(Name );
549 m_Prop_Values.Add(Value);
550
551 return( true );
552 }
553
554 return( false );
555 }
556
557 bool CSG_MetaData::Add_Property(const CSG_String &Name, double Value)
558 {
559 return( Add_Property(Name, CSG_String::Format(SG_T("%f"), Value)) );
560 }
561
562 bool CSG_MetaData::Add_Property(const CSG_String &Name, int Value)
563 {
564 return( Add_Property(Name, CSG_String::Format(SG_T("%d"), Value)) );
565 }
566
567 bool CSG_MetaData::Add_Property(const CSG_String &Name, sLong Value)
568 {
569 return( Add_Property(Name, CSG_String::Format(SG_T("%lld"), Value)) );
570 }
571
572 //---------------------------------------------------------
573 bool CSG_MetaData::Del_Property(const CSG_String &Name)
574 {
575 for(int i=0; i<Get_Property_Count(); i++)
576 {
577 if( !Get_Property_Name(i).CmpNoCase(Name) )
578 {
579 return( Del_Property(i) );
580 }
581 }
582
583 return( false );
584 }
585
586 bool CSG_MetaData::Del_Property(int i)
587 {
588 if( i >= 0 && i < Get_Property_Count() )
589 {
590 m_Prop_Names .Del(i);
591 m_Prop_Values.Del(i);
592
593 return( true );
594 }
595
596 return( false );
597 }
598
599 //---------------------------------------------------------
600 bool CSG_MetaData::Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists)
601 {
602 int Index;
603
604 if( (Index = _Get_Property(Name)) >= 0 )
605 {
606 m_Prop_Values[Index] = Value;
607
608 return( true );
609 }
610 else if( bAddIfNotExists )
611 {
612 m_Prop_Names .Add(Name);
613 m_Prop_Values .Add(Value);
614
615 return( true );
616 }
617
618 return( false );
619 }
620
621 bool CSG_MetaData::Set_Property(const CSG_String &Name, double Value, bool bAddIfNotExists)
622 {
623 return( Set_Property(Name, CSG_String::Format(SG_T("%f"), Value, bAddIfNotExists)) );
624 }
625
626 bool CSG_MetaData::Set_Property(const CSG_String &Name, int Value, bool bAddIfNotExists)
627 {
628 return( Set_Property(Name, CSG_String::Format(SG_T("%d"), Value, bAddIfNotExists)) );
629 }
630
631 bool CSG_MetaData::Set_Property(const CSG_String &Name, sLong Value, bool bAddIfNotExists)
632 {
633 return( Set_Property(Name, CSG_String::Format(SG_T("%lld"), Value, bAddIfNotExists)) );
634 }
635
636 //---------------------------------------------------------
637 bool CSG_MetaData::Get_Property(const CSG_String &Name, CSG_String &Value) const
638 {
639 const SG_Char *cString = Get_Property(Name);
640
641 if( cString )
642 {
643 Value = cString;
644
645 return( true );
646 }
647
648 return( false );
649 }
650
651 bool CSG_MetaData::Get_Property(const CSG_String &Name, double &Value) const
652 {
653 CSG_String s;
654
655 return( Get_Property(Name, s) && s.asDouble(Value) );
656 }
657
658 bool CSG_MetaData::Get_Property(const CSG_String &Name, int &Value) const
659 {
660 CSG_String s;
661
662 return( Get_Property(Name, s) && s.asInt(Value) );
663 }
664
665 bool CSG_MetaData::Get_Property(const CSG_String &Name, sLong &Value) const
666 {
667 CSG_String s;
668
669 return( Get_Property(Name, s) && s.asLongLong(Value) );
670 }
671
672 //---------------------------------------------------------
673 bool CSG_MetaData::Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase) const
674 {
675 CSG_String s;
676
677 return( Get_Property(Name, s) && (bNoCase ? !s.CmpNoCase(String) : !s.Cmp(String)) );
678 }
679
680 //---------------------------------------------------------
681 int CSG_MetaData::_Get_Property(const CSG_String &Name) const
682 {
683 for(int i=0; i<m_Prop_Names.Get_Count(); i++)
684 {
685 if( Name.CmpNoCase(m_Prop_Names[i]) == 0 )
686 {
687 return( i );
688 }
689 }
690
691 return( -1 );
692 }
693
694
696 // //
698
699 //---------------------------------------------------------
700 CSG_String CSG_MetaData::asText(int Flags) const
701 {
702 CSG_String s;
703
704 if( Flags == 0 )
705 {
706 for(int i=0; i<Get_Children_Count(); i++)
707 {
708 s += Get_Child(i)->Get_Name() + ":\t" + Get_Child(i)->Get_Content() + "\n";
709 }
710 }
711 else
712 {
713 wxXmlDocument XML;
714
715 wxXmlNode *pRoot = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, Get_Name().c_str());
716
717 XML.SetRoot(pRoot);
718
719 _Save(pRoot);
720
721 wxStringOutputStream Stream;
722
723 XML.Save(Stream);
724
725 s = &Stream.GetString();
726
727 if( Flags == 2 ) // remove <xml>
728 {
729 s = s.AfterFirst('\n');
730 }
731 }
732
733 return( s );
734 }
735
736 //---------------------------------------------------------
737 CSG_Table CSG_MetaData::Get_Table(int Flags) const
738 {
739 CSG_Table t;
740
741 t.Add_Field("NAME" , SG_DATATYPE_String);
742 t.Add_Field("VALUE", SG_DATATYPE_String);
743
744 for(int i=0; i<Get_Children_Count(); i++)
745 {
746 CSG_Table_Record *r = t.Add_Record();
747
748 r->Set_Value(0, Get_Child(i)->Get_Name());
749 r->Set_Value(1, Get_Child(i)->Get_Content());
750 }
751
752 return( t );
753 }
754
755
757 // //
759
760 //---------------------------------------------------------
761 bool CSG_MetaData::Assign(const CSG_MetaData &MetaData, bool bAddChildren)
762 {
763 if( &MetaData != this )
764 {
765 Destroy();
766
767 Set_Name (MetaData.Get_Name ());
768 Set_Content (MetaData.Get_Content());
769
770 for(int i=0; i<MetaData.Get_Property_Count(); i++)
771 {
772 Add_Property(MetaData.Get_Property_Name(i), MetaData.Get_Property(i));
773 }
774
775 if( bAddChildren )
776 {
777 Add_Children(MetaData);
778 }
779 }
780
781 return( true );
782 }
783
784
786 // //
788
789 //---------------------------------------------------------
790 bool CSG_MetaData::Load(const CSG_String &File, const SG_Char *Extension)
791 {
792 Destroy();
793
794 //-----------------------------------------------------
795 if( File.Find("http://") == 0 )
796 {
797 CSG_String s(File.Right(File.Length() - CSG_String("http://").Length()));
798
799 return( Load_HTTP(s.BeforeFirst('/'), s.AfterFirst('/')) );
800 }
801
802 //-----------------------------------------------------
803 CSG_String _File(SG_File_Make_Path("", File, Extension));
804
805 if( !SG_File_Exists(_File) )
806 {
807 return( false );
808 }
809
810 //-----------------------------------------------------
811 if( SG_File_Cmp_Extension(_File, "json") )
812 {
813 return( Load_JSON(_File) );
814 }
815
816 //-----------------------------------------------------
817 wxXmlDocument XML;
818
819 if( XML.Load(_File.c_str()) )
820 {
821 _Load(XML.GetRoot());
822
823 return( true );
824 }
825
826 //-----------------------------------------------------
827 return( false );
828 }
829
830 //---------------------------------------------------------
831 bool CSG_MetaData::Load(CSG_File &File)
832 {
833 Destroy();
834
835 wxXmlDocument XML;
836
837 if( File.is_Reading() && XML.Load(*((wxInputStream *)File.Get_Stream())) )
838 {
839 _Load(XML.GetRoot());
840
841 return( true );
842 }
843
844 return( false );
845 }
846
847 //---------------------------------------------------------
848 void CSG_MetaData::_Load(wxXmlNode *pNode)
849 {
850 m_Name = pNode->GetName ().wc_str();
851 m_Content = pNode->GetNodeContent().wc_str();
852
853 //-----------------------------------------------------
854 wxXmlAttribute *pProperty = pNode->GetAttributes();
855
856 while( pProperty )
857 {
858 Add_Property(&pProperty->GetName(), &pProperty->GetValue());
859
860 pProperty = pProperty->GetNext();
861 }
862
863 //-----------------------------------------------------
864 wxXmlNode *pChild = pNode->GetChildren();
865
866 while( pChild )
867 {
868 if( pChild->GetType() != wxXML_TEXT_NODE )
869 {
870 Add_Child()->_Load(pChild);
871 }
872
873 pChild = pChild->GetNext();
874 }
875 }
876
877
879 // //
881
882 //---------------------------------------------------------
883 bool CSG_MetaData::Save(const CSG_String &File, const SG_Char *Extension) const
884 {
885 wxXmlDocument XML;
886
887 wxXmlNode *pRoot = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, Get_Name().c_str());
888
889 XML.SetRoot(pRoot);
890
891 _Save(pRoot);
892
893 if( XML.Save(SG_File_Make_Path("", File, Extension).c_str()) )
894 {
895 return( true );
896 }
897
898 return( false );
899 }
900
901 //---------------------------------------------------------
902 bool CSG_MetaData::Save(CSG_File &File) const
903 {
904 wxXmlDocument XML;
905
906 wxXmlNode *pRoot = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, Get_Name().c_str());
907
908 XML.SetRoot(pRoot);
909
910 _Save(pRoot);
911
912 if( File.is_Writing() && XML.Save(*((wxOutputStream *)File.Get_Stream())) )
913 {
914 return( true );
915 }
916
917 return( false );
918 }
919
920 //---------------------------------------------------------
921 void CSG_MetaData::_Save(wxXmlNode *pNode) const
922 {
923 int i;
924
925 //-----------------------------------------------------
926 pNode->SetName (CSG_String(Get_Name().Length() ? Get_Name() : CSG_String("NODE")).c_str());
927 pNode->SetContent(Get_Content().c_str());
928
929 if( Get_Content().Length() > 0 || (Get_Property_Count() == 0 && Get_Children_Count() == 0) )
930 {
931 wxXmlNode *pChild = new wxXmlNode(pNode, wxXML_TEXT_NODE, SG_T("TEXT"));
932
933 pChild->SetContent(Get_Content().c_str());
934 }
935
936 //-----------------------------------------------------
937 for(i=0; i<Get_Property_Count(); i++)
938 {
939 pNode->AddAttribute(Get_Property_Name(i).c_str(), Get_Property(i));
940 }
941
942 //-----------------------------------------------------
943 for(i=Get_Children_Count()-1; i>=0; i--)
944 {
945 Get_Child(i)->_Save(new wxXmlNode(pNode, wxXML_ELEMENT_NODE, Get_Child(i)->Get_Name().c_str()));
946 }
947 }
948
949
951 // //
953
954 //---------------------------------------------------------
955 bool CSG_MetaData::from_XML(const CSG_String &_XML)
956 {
957 Destroy();
958
959 wxXmlDocument XML;
960
961 wxMemoryInputStream Stream((const void *)_XML.b_str(), (size_t)_XML.Length());
962
963 if( XML.Load(Stream) )
964 {
965 _Load(XML.GetRoot());
966
967 return( true );
968 }
969
970 return( false );
971 }
972
973 //---------------------------------------------------------
974 bool CSG_MetaData::to_XML(CSG_String &_XML) const
975 {
976 wxXmlDocument XML;
977
978 wxXmlNode *pRoot = new wxXmlNode(NULL, wxXML_ELEMENT_NODE, Get_Name().c_str());
979
980 XML.SetRoot(pRoot);
981
982 _Save(pRoot);
983
984 wxMemoryOutputStream Stream;
985
986 if( XML.Save(Stream) )
987 {
988 CSG_Array s(sizeof(char), Stream.GetSize());
989
990 Stream.CopyTo(s.Get_Array(), s.Get_Size());
991
992 _XML = (const char *)s.Get_Array();
993
994 return( true );
995 }
996
997 return( false );
998 }
999
1000
1002 // //
1004
1005 //---------------------------------------------------------
1006 bool CSG_MetaData::Load_HTTP(const CSG_String &Server, const CSG_String &Path, const SG_Char *Username, const SG_Char *Password)
1007 {
1008 Destroy();
1009
1010 //-----------------------------------------------------
1011 wxHTTP HTTP;
1012
1013 if( Username && *Username ) { HTTP.SetUser (Username); }
1014 if( Password && *Password ) { HTTP.SetPassword(Password); }
1015
1016 wxString s = Server.c_str();
1017
1018 if( s.Find("http://") == 0 )
1019 {
1020 s = s.Right(s.Length() - wxString("http://").Length());
1021 }
1022
1023 if( !HTTP.Connect(s) )
1024 {
1025 return( false );
1026 }
1027
1028 //-----------------------------------------------------
1029 s = Path.c_str();
1030
1031 if( s[0] != '/' )
1032 {
1033 s.Prepend("/");
1034 }
1035
1036 wxInputStream *pStream = HTTP.GetInputStream(s);
1037
1038 if( !pStream )
1039 {
1040 return( false );
1041 }
1042
1043 wxXmlDocument XML;
1044
1045 if( XML.Load(*pStream) )
1046 {
1047 _Load(XML.GetRoot());
1048
1049 delete(pStream);
1050
1051 return( true );
1052 }
1053
1054 delete(pStream);
1055
1056 return( false );
1057 }
1058
1059
1061 // //
1063
1064 //---------------------------------------------------------
1065 bool CSG_MetaData::from_WKT(const CSG_String &WKT)
1066 {
1067 return( false );
1068 }
1069
1070 //---------------------------------------------------------
1071 bool CSG_MetaData::to_WKT(CSG_String &WKT) const
1072 {
1073 return( false );
1074 }
1075
1076
1078 // //
1080
1081 //---------------------------------------------------------
1082 bool CSG_MetaData::Load_JSON(const CSG_String &File)
1083 {
1084 CSG_File Stream; CSG_String JSON;
1085
1086 if( Stream.Open(File, SG_FILE_R, false) && Stream.Read(JSON, (size_t)Stream.Length()) > 0 )
1087 {
1088 return( from_JSON(JSON) );
1089 }
1090
1091 return( false );
1092 }
1093
1094 //---------------------------------------------------------
1095 bool CSG_MetaData::Save_JSON(const CSG_String &File) const
1096 {
1097 return( false );
1098 }
1099
1100 //---------------------------------------------------------
1101 bool CSG_MetaData::from_JSON(const CSG_String &JSON)
1102 {
1103 Destroy();
1104
1105 Set_Name("root");
1106
1107 CSG_MetaData *pNode = this;
1108
1109 const SG_Char *pc = JSON.c_str();
1110
1111 while( *pc )
1112 {
1113 CSG_String Element;
1114
1115 for(bool bQuota=false;;)
1116 {
1117 SG_Char c = *pc++;
1118
1119 if( !c || c == '\n' ) { break; } else
1120 {
1121 if( c == '\"' )
1122 {
1123 Element += c; bQuota = !bQuota;
1124 }
1125 else if( bQuota || (c != ' ' && c != '\t' && c != ',') )
1126 {
1127 Element += c;
1128 }
1129 }
1130 }
1131
1132 //-------------------------------------------------
1133 if( Element.is_Empty() )
1134 {
1135 // nop
1136 }
1137 else if( Element.Find('[') >= 0 ) // array begins
1138 {
1139 pNode = pNode->Add_Child(Element.AfterFirst('\"').BeforeFirst('\"'));
1140
1141 pNode->Add_Property("array", 1);
1142 }
1143 else if( Element.Find(']') >= 0 ) // array ends
1144 {
1145 if( pNode != this )
1146 {
1147 pNode = pNode->Get_Parent();
1148 }
1149 }
1150 else if( Element.Find('{') >= 0 ) // object begins
1151 {
1152 Element = Element.AfterFirst('\"').BeforeFirst('\"');
1153
1154 if( !Element.is_Empty() )
1155 {
1156 pNode = pNode->Add_Child(Element);
1157 }
1158 else if( pNode->Get_Property("array") )
1159 {
1160 pNode = pNode->Add_Child(CSG_String::Format("%d", pNode->Get_Children_Count()));
1161 }
1162 }
1163 else if( Element.Find('}') >= 0 ) // object ends
1164 {
1165 if( pNode != this )
1166 {
1167 pNode = pNode->Get_Parent();
1168 }
1169 }
1170 else
1171 {
1172 CSG_String Key (Element.AfterFirst('\"').BeforeFirst('\"'));
1173 CSG_String Value(Element.AfterFirst(':'));
1174
1175 if( Value.Find('\"') > -1 )
1176 {
1177 Value = Value.AfterFirst('\"').BeforeFirst('\"');
1178 }
1179
1180 pNode->Add_Child(Key, Value);
1181 }
1182 }
1183
1184 return( true );
1185 }
1186
1187 //---------------------------------------------------------
1188 bool CSG_MetaData::to_JSON(CSG_String &JSON) const
1189 {
1190 return( false );
1191 }
1192
1193
1195 // //
1196 // //
1197 // //
1199
1200 //---------------------------------------------------------
1201 CSG_HTTP::CSG_HTTP(void)
1202 {
1203 m_pHTTP = NULL;
1204 }
1205
1206 //---------------------------------------------------------
1207 bool CSG_HTTP::Create(void)
1208 {
1209 return( Destroy() );
1210 }
1211
1212 //---------------------------------------------------------
1213 CSG_HTTP::CSG_HTTP(const CSG_String &Server, const SG_Char *Username, const SG_Char *Password)
1214 {
1215 m_pHTTP = NULL;
1216
1217 Create(Server, Username, Password);
1218 }
1219
1220 //---------------------------------------------------------
1221 bool CSG_HTTP::Create(const CSG_String &Server, const SG_Char *Username, const SG_Char *Password)
1222 {
1223 Destroy();
1224
1225 m_pHTTP = new wxHTTP;
1226
1227 if( Username && *Username ) { m_pHTTP->SetUser (Username); }
1228 if( Password && *Password ) { m_pHTTP->SetPassword(Password); }
1229
1230 wxString Host = Server.c_str();
1231
1232 unsigned short Port = 80;
1233
1234 #define SERVER_TRIM(s, p) { wxString sp(p); sp += "://"; if( s.Find(p) == 0 ) { s = s.Right(s.Length() - sp.Length()); } }
1235
1236 SERVER_TRIM(Host, "https");
1237 SERVER_TRIM(Host, "http");
1238
1239 if( Host.Find(":") >= 0 )
1240 {
1241 long _Port;
1242
1243 if( Host.AfterLast(':').ToLong(&_Port) )
1244 {
1245 Port = (unsigned short)_Port;
1246 }
1247
1248 Host = Host.BeforeLast(':');
1249 }
1250
1251 if( !m_pHTTP->Connect(Host, Port) )
1252 {
1253 Destroy();
1254
1255 return( false );
1256 }
1257
1258 return( true );
1259 }
1260
1261 //---------------------------------------------------------
1262 CSG_HTTP::~CSG_HTTP(void)
1263 {
1264 Destroy();
1265 }
1266
1267 //---------------------------------------------------------
1268 bool CSG_HTTP::Destroy(void)
1269 {
1270 if( m_pHTTP )
1271 {
1272 delete(m_pHTTP);
1273
1274 m_pHTTP = NULL;
1275 }
1276
1277 return( true );
1278 }
1279
1280 //---------------------------------------------------------
1281 bool CSG_HTTP::is_Connected(void) const
1282 {
1283 return( m_pHTTP != NULL );
1284 }
1285
1286 //---------------------------------------------------------
1287 wxInputStream * CSG_HTTP::_Request(const CSG_String &Request)
1288 {
1289 if( !is_Connected() )
1290 {
1291 return( NULL );
1292 }
1293
1294 wxString s(Request.c_str());
1295
1296 if( s[0] != '/' )
1297 {
1298 s.Prepend("/");
1299 }
1300
1301 wxInputStream *pStream = m_pHTTP->GetInputStream(s);
1302
1303 if( pStream && !pStream->CanRead() )
1304 {
1305 delete(pStream);
1306
1307 return( NULL );
1308 }
1309
1310 return( pStream );
1311 }
1312
1313 //---------------------------------------------------------
1314 bool CSG_HTTP::Request(const CSG_String &Request, CSG_MetaData &Answer)
1315 {
1316 wxInputStream *pStream = _Request(Request); if( !pStream ) { return( false ); }
1317
1318 wxXmlDocument XML;
1319
1320 if( !XML.Load(*pStream) )
1321 {
1322 delete(pStream);
1323
1324 return( false );
1325 }
1326
1327 Answer.Destroy(); Answer._Load(XML.GetRoot());
1328
1329 delete(pStream);
1330
1331 return( true );
1332 }
1333
1334 //---------------------------------------------------------
1335 bool CSG_HTTP::Request(const CSG_String &Request, CSG_Bytes &Answer)
1336 {
1337 wxInputStream *pStream = _Request(Request); if( !pStream ) { return( false ); }
1338
1339 // if( pStream->GetSize() == ((size_t)-1) )
1340 // {
1341 // delete(pStream);
1342 //
1343 // return( false );
1344 // }
1345
1346 Answer.Clear();
1347
1348 while( pStream->CanRead() )
1349 {
1350 char Byte;
1351
1352 pStream->Read(&Byte, sizeof(Byte));
1353
1354 Answer += Byte;
1355 }
1356
1357 delete(pStream);
1358
1359 return( true );
1360 }
1361
1362 //---------------------------------------------------------
1363 bool CSG_HTTP::Request(const CSG_String &Request, CSG_String &Answer)
1364 {
1365 wxInputStream *pStream = _Request(Request); if( !pStream ) { return( false ); }
1366
1367 //if( pStream->GetSize() == ((size_t)-1) )
1368 //{
1369 // delete(pStream);
1370
1371 // return( false );
1372 //}
1373
1374 Answer.Clear();
1375
1376 while( pStream->CanRead() )
1377 {
1378 char Byte;
1379
1380 pStream->Read(&Byte, sizeof(Byte));
1381
1382 Answer += Byte;
1383 }
1384
1385 delete(pStream);
1386
1387 return( true );
1388 }
1389
1390 //---------------------------------------------------------
1391 bool CSG_HTTP::Request(const CSG_String &Request, const SG_Char *File)
1392 {
1393 wxInputStream *pStream = _Request(Request); if( !pStream ) { return( false ); }
1394
1395 wxFileOutputStream *pFile = new wxFileOutputStream(File);
1396
1397 if( !pFile )
1398 {
1399 delete(pStream);
1400
1401 return( false );
1402 }
1403
1404 pFile->Write(*pStream);
1405
1406 delete(pFile);
1407
1408 delete(pStream);
1409
1410 return( true );
1411 }
1412
1413
1415 // //
1416 // //
1417 // //
1419
1420 //---------------------------------------------------------
1421 #include <wx/protocol/ftp.h>
1422
1423 //---------------------------------------------------------
1424 bool SG_FTP_Download(const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username, const SG_Char *Password, unsigned short Port, bool bBinary, bool bVerbose)
1425 {
1426 CSG_String _Source(Source); _Source.Trim();
1427
1428 if( _Source.Find("ftp://") == 0 )
1429 {
1430 _Source = _Source.Right(_Source.Length() - CSG_String("ftp://").Length());
1431 }
1432
1433 CSG_String ftpHost = _Source.BeforeFirst('/');
1434 CSG_String ftpDir = _Source.AfterFirst ('/').BeforeLast('/'); // ftpDir.Prepend("/");
1435 CSG_String ftpFile = _Source.AfterLast ('/');
1436
1437 //-----------------------------------------------------
1438 wxFTP ftp;
1439
1440 if( Username && *Username ) { ftp.SetUser (Username); }
1441 if( Password && *Password ) { ftp.SetPassword(Password); }
1442
1443 if( !ftp.Connect(ftpHost.c_str(), Port) )
1444 {
1445 if( bVerbose )
1446 {
1447 SG_UI_Msg_Add_Error(_TL("Couldn't connect"));
1448 }
1449
1450 return( false );
1451 }
1452
1453 //-----------------------------------------------------
1454 if( !ftpDir.is_Empty() && !ftp.ChDir(ftpDir.c_str()) )
1455 {
1456 if( bVerbose )
1457 {
1458 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("Couldn't change to directory"), ftpDir.c_str()));
1459 }
1460
1461 return( false );
1462 }
1463
1464 if( ftp.GetFileSize(ftpFile.c_str()) == -1 )
1465 {
1466 if( bVerbose )
1467 {
1468 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("Couldn't get the file size"), ftpFile.c_str()));
1469 }
1470 }
1471
1472 //-----------------------------------------------------
1473 wxInputStream *pStream = ftp.GetInputStream(ftpFile.c_str());
1474
1475 if( !pStream )
1476 {
1477 if( bVerbose )
1478 {
1479 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("Couldn't get the file"), ftpFile.c_str()));
1480 }
1481
1482 return( false );
1483 }
1484
1485 //-----------------------------------------------------
1486 wxFileOutputStream *pFile = new wxFileOutputStream(SG_File_Make_Path(Target_Directory, ftpFile).c_str());
1487
1488 if( !pFile )
1489 {
1490 if( bVerbose )
1491 {
1492 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("Couldn't create target file"), SG_File_Make_Path(Target_Directory, ftpFile).c_str()));
1493 }
1494
1495 delete(pStream);
1496
1497 return( false );
1498 }
1499
1500 //-----------------------------------------------------
1501 pFile->Write(*pStream);
1502
1503 delete(pFile);
1504 delete(pStream);
1505
1506 return( true );
1507 }
1508
1509
1511 // //
1512 // //
1513 // //
1515
1516 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_MetaData::Del_Child
bool Del_Child(int Index)
Definition: metadata.cpp:329
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_HTTP::CSG_HTTP
CSG_HTTP(void)
Definition: metadata.cpp:1201
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_File::Get_Stream
class wxStreamBase * Get_Stream(void) const
Definition: api_core.h:1130
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
CSG_Strings::Del
bool Del(int Index)
Definition: api_core.h:713
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_MetaData::Load_HTTP
bool Load_HTTP(const CSG_String &Server, const CSG_String &Path, const SG_Char *Username=NULL, const SG_Char *Password=NULL)
Definition: metadata.cpp:1006
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_Table_Record
Definition: table.h:130
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
CSG_MetaData::~CSG_MetaData
virtual ~CSG_MetaData(void)
Definition: metadata.cpp:142
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_MetaData::Del_Property
bool Del_Property(const CSG_String &Name)
Definition: metadata.cpp:573
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:600
CSG_MetaData::from_JSON
bool from_JSON(const CSG_String &JSON)
Definition: metadata.cpp:1101
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_HTTP::~CSG_HTTP
virtual ~CSG_HTTP(void)
Definition: metadata.cpp:1262
CSG_MetaData::Get_Property_Count
int Get_Property_Count(void) const
Definition: metadata.h:179
CSG_MetaData::Get_Name
const CSG_String & Get_Name(void) const
Definition: metadata.h:132
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
CSG_String::BeforeLast
CSG_String BeforeLast(char Character) const
Definition: api_string.cpp:677
CSG_Bytes::Clear
bool Clear(void)
Definition: api_memory.cpp:844
CSG_HTTP::Destroy
bool Destroy(void)
Definition: metadata.cpp:1268
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:437
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_MetaData::Ins_Child
CSG_MetaData * Ins_Child(int Position)
Definition: metadata.cpp:215
CSG_MetaData::from_XML
bool from_XML(const CSG_String &XML)
Definition: metadata.cpp:955
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:590
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1022
CSG_MetaData::CSG_MetaData
CSG_MetaData(void)
Definition: metadata.cpp:76
CSG_HTTP::m_pHTTP
class wxHTTP * m_pHTTP
Definition: metadata.h:260
CSG_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:291
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
CSG_HTTP::Create
bool Create(void)
Definition: metadata.cpp:1207
sLong
signed long long sLong
Definition: api_core.h:158
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Bytes
Definition: api_core.h:804
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_MetaData::Assign
bool Assign(const CSG_MetaData &MetaData, bool bAddChildren=true)
Definition: metadata.cpp:761
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_MetaData::Save_JSON
bool Save_JSON(const CSG_String &File) const
Definition: metadata.cpp:1095
CSG_Table
Definition: table.h:283
CSG_MetaData::Mov_Child
bool Mov_Child(int from_Index, int to_Index)
Definition: metadata.cpp:289
CSG_MetaData::Cmp_Property
bool Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:673
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
CSG_HTTP::is_Connected
bool is_Connected(void) const
Definition: metadata.cpp:1281
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_MetaData::to_XML
bool to_XML(CSG_String &XML) const
Definition: metadata.cpp:974
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_MetaData::Get_Parent
CSG_MetaData * Get_Parent(void) const
Definition: metadata.h:147
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
CSG_Array
Definition: api_core.h:308
CSG_MetaData::Get_Table
class CSG_Table Get_Table(int Flags=0) const
Definition: metadata.cpp:737
CSG_String
Definition: api_core.h:557
CSG_Array::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_memory.cpp:425
CSG_MetaData
Definition: metadata.h:88
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
metadata.h
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_String::asLongLong
sLong asLongLong(void) const
Definition: api_string.cpp:744
CSG_MetaData::to_WKT
bool to_WKT(CSG_String &WKT) const
Definition: metadata.cpp:1071
CSG_MetaData::Get_Property_Name
const CSG_String & Get_Property_Name(int i) const
Definition: metadata.h:180
CSG_HTTP::Request
bool Request(const CSG_String &Request, CSG_Bytes &Answer)
Definition: metadata.cpp:1335
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_MetaData::Create
bool Create(void)
Definition: metadata.cpp:81
CSG_String::AfterLast
CSG_String AfterLast(char Character) const
Definition: api_string.cpp:655
CSG_MetaData::Fmt_Content
void Fmt_Content(const char *Format,...)
Definition: metadata.cpp:491
CSG_MetaData::from_WKT
bool from_WKT(const CSG_String &WKT)
Definition: metadata.cpp:1065
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_MetaData::Cmp_Content
bool Cmp_Content(const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:533
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
SG_FTP_Download
bool SG_FTP_Download(const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username, const SG_Char *Password, unsigned short Port, bool bBinary, bool bVerbose)
Definition: metadata.cpp:1424
CSG_MetaData::asText
CSG_String asText(int Flags=0) const
Definition: metadata.cpp:700
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
table.h
SERVER_TRIM
#define SERVER_TRIM(s, p)
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_MetaData::Load_JSON
bool Load_JSON(const CSG_String &File)
Definition: metadata.cpp:1082
CSG_MetaData::to_JSON
bool to_JSON(CSG_String &JSON) const
Definition: metadata.cpp:1188
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: metadata.h File Reference

  • saga_core
  • saga_api
Classes | Functions
metadata.h File Reference
#include "api_core.h"

Go to the source code of this file.

Classes

class | CSG_MetaData
class | CSG_HTTP

Functions

SAGA_API_DLL_EXPORT bool SG_FTP_Download (const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username=NULL, const SG_Char *Password=NULL, unsigned short Port=21, bool bBinary=true, bool bVerbose=false)

Detailed Description

A flexible class for the storage and management of meta data. Standard storage format is the extended markup language (XML).

See also
CSG_MetaData
CSG_HTTP

Definition in file metadata.h.

Function Documentation

◆ SG_FTP_Download()

SAGA_API_DLL_EXPORT bool SG_FTP_Download | ( | const CSG_String & | Target_Directory,
 |  | const CSG_String & | Source,
 |  | const SG_Char * | Username = NULL,
 |  | const SG_Char * | Password = NULL,
 |  | unsigned short | Port = 21,
 |  | bool | bBinary = true,
 |  | bool | bVerbose = false
 | ) |  |

Definition at line 1424 of file metadata.cpp.

References _TL, CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::BeforeFirst(), CSG_String::BeforeLast(), CSG_String::c_str(), CSG_String::Find(), CSG_String::Format(), CSG_String::is_Empty(), CSG_String::Length(), CSG_String::Right(), SG_File_Make_Path(), SG_UI_Msg_Add_Error(), and CSG_String::Trim().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: metadata.h Source File

  • saga_core
  • saga_api
metadata.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // metadata.h //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__metadata_H
52 #define HEADER_INCLUDED__SAGA_API__metadata_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
70 // //
72 // //
73 // //
75
76 //---------------------------------------------------------
77 #include "api_core.h"
78
79
81 // //
82 // //
83 // //
85
86 //---------------------------------------------------------
87 class SAGA_API_DLL_EXPORT CSG_MetaData
88 {
89 friend class CSG_HTTP;
90
91 public:
92 CSG_MetaData (void);
93 bool Create (void);
94
95 CSG_MetaData (const CSG_MetaData &MetaData);
96 bool Create (const CSG_MetaData &MetaData);
97
98 CSG_MetaData (const CSG_String &File, const SG_Char *Extension = NULL);
99 bool Create (const CSG_String &File, const SG_Char *Extension = NULL);
100
101 CSG_MetaData (CSG_File &File);
102 bool Create (CSG_File &File);
103
104 virtual ~CSG_MetaData (void);
105 void Destroy (void);
106
107 bool Load (const CSG_String &File, const SG_Char *Extension = NULL);
108 bool Save (const CSG_String &File, const SG_Char *Extension = NULL) const;
109
110 bool Load (CSG_File &Stream);
111 bool Save (CSG_File &Stream) const;
112
113 bool Load_HTTP (const CSG_String &Server, const CSG_String &Path, const SG_Char *Username = NULL, const SG_Char *Password = NULL);
114
115 bool from_XML (const CSG_String &XML);
116 bool to_XML ( CSG_String &XML) const;
117
118 bool from_WKT (const CSG_String &WKT);
119 bool to_WKT ( CSG_String &WKT) const;
120
121 bool Load_JSON (const CSG_String &File);
122 bool Save_JSON (const CSG_String &File) const;
123
124 bool from_JSON (const CSG_String &JSON);
125 bool to_JSON ( CSG_String &JSON) const;
126
127 bool Assign (const CSG_MetaData &MetaData, bool bAddChildren = true);
128
129 CSG_MetaData & operator = (const CSG_MetaData &MetaData) { Assign (MetaData, true); return( *this ); }
130 CSG_MetaData & operator += (const CSG_MetaData &MetaData) { Add_Child(MetaData, true); return( *this ); }
131
132 const CSG_String & Get_Name (void) const { return( m_Name ); }
133 void Set_Name (const CSG_String &Name) { m_Name = Name; }
134 bool Cmp_Name (const CSG_String &String, bool bNoCase = true) const;
135 const CSG_String & Get_Content (void) const { return( m_Content ); }
136 const SG_Char * Get_Content (int Index) const { return( Get_Child(Index) ? Get_Child(Index)->Get_Content().c_str() : NULL ); }
137 const SG_Char * Get_Content (const CSG_String &Name) const { return( Get_Content(_Get_Child(Name)) ); }
138 bool Get_Content (const CSG_String &Name, CSG_String &Value) const;
139 bool Get_Content (const CSG_String &Name, double &Value) const;
140 bool Get_Content (const CSG_String &Name, int &Value) const;
141 bool Get_Content (const CSG_String &Name, sLong &Value) const;
142 void Set_Content (const CSG_String &Content) { m_Content = Content; }
143 void Fmt_Content (const char *Format, ...);
144 void Fmt_Content (const wchar_t *Format, ...);
145 bool Cmp_Content (const CSG_String &String, bool bNoCase = false) const;
146
147 CSG_MetaData * Get_Parent (void) const { return( m_pParent ); }
148
149 int Get_Children_Count (void) const { return( (int)m_Children.Get_Size() ); }
150 CSG_MetaData * Get_Child (int Index) const { return( Index >= 0 ? *((CSG_MetaData **)m_Children.Get_Entry((size_t)Index)) : NULL ); }
151 CSG_MetaData * Get_Child (const CSG_String &Name) const { return( Get_Child(_Get_Child(Name)) ); }
152 CSG_MetaData * Add_Child (void);
153 CSG_MetaData * Add_Child (const CSG_String &Name);
154 CSG_MetaData * Add_Child (const CSG_String &Name, const CSG_String &Content);
155 CSG_MetaData * Add_Child (const CSG_String &Name, double Content);
156 CSG_MetaData * Add_Child (const CSG_String &Name, int Content);
157 CSG_MetaData * Add_Child (const CSG_String &Name, sLong Content);
158 CSG_MetaData * Add_Child (const CSG_MetaData &MetaData, bool bAddChildren = true);
159 CSG_MetaData * Ins_Child ( int Position);
160 CSG_MetaData * Ins_Child (const CSG_String &Name , int Position);
161 CSG_MetaData * Ins_Child (const CSG_String &Name, const CSG_String &Content, int Position);
162 CSG_MetaData * Ins_Child (const CSG_String &Name, double Content, int Position);
163 CSG_MetaData * Ins_Child (const CSG_String &Name, int Content, int Position);
164 CSG_MetaData * Ins_Child (const CSG_String &Name, sLong Content, int Position);
165 CSG_MetaData * Ins_Child (const CSG_MetaData &MetaData , int Position, bool bAddChildren = true);
166 bool Mov_Child (int from_Index, int to_Index);
167 bool Del_Child (int Index);
168 bool Del_Child (const CSG_String &Name) { return( Del_Child(_Get_Child(Name)) ); }
169
170 bool Add_Children (const CSG_MetaData &MetaData);
171 bool Del_Children (int Depth = 0, const SG_Char *Name = NULL);
172
173 CSG_MetaData * operator () (int Index) const { return( Get_Child(Index ) ); }
174 CSG_MetaData * operator () (const CSG_String &Name) const { return( Get_Child(_Get_Child(Name)) ); }
175
176 const CSG_MetaData & operator [] (int Index) const { return( *Get_Child(Index ) ); }
177 const CSG_MetaData & operator [] (const CSG_String &Name) const { return( *Get_Child(_Get_Child(Name)) ); }
178
179 int Get_Property_Count (void) const { return( m_Prop_Names.Get_Count() ); }
180 const CSG_String & Get_Property_Name (int i) const { return( m_Prop_Names [i] ); }
181 const SG_Char * Get_Property (int i) const { return( i >= 0 && i < m_Prop_Values.Get_Count() ? m_Prop_Values[i].c_str() : NULL ); }
182 const SG_Char * Get_Property (const CSG_String &Name) const { return( Get_Property(_Get_Property(Name)) ); }
183 bool Get_Property (const CSG_String &Name, CSG_String &Value) const;
184 bool Get_Property (const CSG_String &Name, double &Value) const;
185 bool Get_Property (const CSG_String &Name, int &Value) const;
186 bool Get_Property (const CSG_String &Name, sLong &Value) const;
187 bool Add_Property (const CSG_String &Name, const CSG_String &Value);
188 bool Add_Property (const CSG_String &Name, double Value);
189 bool Add_Property (const CSG_String &Name, int Value);
190 bool Add_Property (const CSG_String &Name, sLong Value);
191 bool Set_Property (const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists = true);
192 bool Set_Property (const CSG_String &Name, double Value, bool bAddIfNotExists = true);
193 bool Set_Property (const CSG_String &Name, int Value, bool bAddIfNotExists = true);
194 bool Set_Property (const CSG_String &Name, sLong Value, bool bAddIfNotExists = true);
195 bool Cmp_Property (const CSG_String &Name, const CSG_String &String, bool bNoCase = false) const;
196 bool Del_Property (const CSG_String &Name);
197 bool Del_Property (int i);
198
199 CSG_String asText (int Flags = 0) const;
200 class CSG_Table Get_Table (int Flags = 0) const;
201
202
203 private:
204
205 CSG_MetaData(CSG_MetaData *pParent);
206
207
208 CSG_Array m_Children;
209
210 CSG_MetaData *m_pParent, *m_pDummy;
211
212 CSG_String m_Name, m_Content;
213
214 CSG_Strings m_Prop_Names, m_Prop_Values;
215
216
217 void _On_Construction (void);
218
219 int _Get_Child (const CSG_String &Name) const;
220 int _Get_Property (const CSG_String &Name) const;
221
222 void _Load (class wxXmlNode *pNode);
223 void _Save (class wxXmlNode *pNode) const;
224
225 bool _Load_WKT (const CSG_String &WKT);
226 bool _Save_WKT ( CSG_String &WKT) const;
227
228 };
229
230
232 // //
233 // //
234 // //
236
237 //---------------------------------------------------------
238 class SAGA_API_DLL_EXPORT CSG_HTTP
239 {
240 public:
241 CSG_HTTP (void);
242 bool Create (void);
243
244 CSG_HTTP (const CSG_String &Server, const SG_Char *Username = NULL, const SG_Char *Password = NULL);
245 bool Create (const CSG_String &Server, const SG_Char *Username = NULL, const SG_Char *Password = NULL);
246
247 virtual ~CSG_HTTP (void);
248 bool Destroy (void);
249
250 bool is_Connected (void) const;
251
252 bool Request (const CSG_String &Request, CSG_Bytes &Answer);
253 bool Request (const CSG_String &Request, CSG_MetaData &Answer);
254 bool Request (const CSG_String &Request, CSG_String &Answer);
255 bool Request (const CSG_String &Request, const SG_Char *File);
256
257
258 protected:
259
260 class wxHTTP *m_pHTTP;
261
262
263 private:
264
265 class wxInputStream * _Request (const CSG_String &Request);
266
267 };
268
269 //---------------------------------------------------------
270 SAGA_API_DLL_EXPORT bool SG_FTP_Download (const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username = NULL, const SG_Char *Password = NULL, unsigned short Port = 21, bool bBinary = true, bool bVerbose = false);
271
272
274 // //
275 // //
276 // //
278
279 //---------------------------------------------------------
280 #endif // #ifndef HEADER_INCLUDED__SAGA_API__metadata_H
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(const CSG_String &Name) const
Definition: metadata.h:151
CSG_HTTP
Definition: metadata.h:239
api_core.h
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_MetaData::Get_Property_Count
int Get_Property_Count(void) const
Definition: metadata.h:179
CSG_MetaData::Get_Name
const CSG_String & Get_Name(void) const
Definition: metadata.h:132
CSG_File
Definition: api_core.h:1116
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
CSG_HTTP::Destroy
bool Destroy(void)
Definition: metadata.cpp:1268
CSG_HTTP::m_pHTTP
class wxHTTP * m_pHTTP
Definition: metadata.h:260
CSG_MetaData::Get_Property
const SG_Char * Get_Property(const CSG_String &Name) const
Definition: metadata.h:182
CSG_HTTP::Create
bool Create(void)
Definition: metadata.cpp:1207
sLong
signed long long sLong
Definition: api_core.h:158
CSG_MetaData::Get_Content
const SG_Char * Get_Content(const CSG_String &Name) const
Definition: metadata.h:137
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Strings
Definition: api_core.h:693
CSG_Bytes
Definition: api_core.h:804
CSG_MetaData::Get_Content
const SG_Char * Get_Content(int Index) const
Definition: metadata.h:136
CSG_Table
Definition: table.h:283
CSG_MetaData::Get_Parent
CSG_MetaData * Get_Parent(void) const
Definition: metadata.h:147
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
CSG_MetaData
Definition: metadata.h:88
CSG_MetaData::Get_Property_Name
const CSG_String & Get_Property_Name(int i) const
Definition: metadata.h:180
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_MetaData::Del_Child
bool Del_Child(const CSG_String &Name)
Definition: metadata.h:168
SG_FTP_Download
SAGA_API_DLL_EXPORT bool SG_FTP_Download(const CSG_String &Target_Directory, const CSG_String &Source, const SG_Char *Username=NULL, const SG_Char *Password=NULL, unsigned short Port=21, bool bBinary=true, bool bVerbose=false)
Definition: metadata.cpp:1424
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: parameter.cpp File Reference

  • saga_core
  • saga_api
Macros
parameter.cpp File Reference
#include "parameters.h"
#include "data_manager.h"
#include "tool.h"

Go to the source code of this file.

Macros

#define SEPARATE if( !s.is_Empty() ) { s.Append(Separator); }

Macro Definition Documentation

◆ SEPARATE

#define SEPARATE if( !s.is_Empty() ) { s.Append(Separator); }
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: parameter.cpp Source File

  • saga_core
  • saga_api
parameter.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // parameter.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "parameters.h"
52 #include "data_manager.h"
53 #include "tool.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Parameter::CSG_Parameter(CSG_Parameters *pParameters, CSG_Parameter *pParent, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description, int Constraint)
64 {
65 m_pParameters = pParameters;
66 m_pParent = pParent;
67 m_Identifier = Identifier;
68 m_Name = Name;
69 m_Description = Description;
70 m_Constraint = Constraint;
71
72 m_bEnabled = true;
73
74 //-----------------------------------------------------
75 m_nChildren = 0;
76 m_Children = NULL;
77
78 if( m_pParent )
79 {
80 m_pParent->_Add_Child(this);
81 }
82 }
83
84 //---------------------------------------------------------
85 CSG_Parameter::~CSG_Parameter(void)
86 {
87 if( m_Children )
88 {
89 SG_Free(m_Children);
90 }
91 }
92
93
95 // //
97
98 //---------------------------------------------------------
99 CSG_Parameters * CSG_Parameter::Get_Parameters(void) const
100 {
101 return( m_pParameters );
102 }
103
104 //---------------------------------------------------------
105 CSG_Parameter * CSG_Parameter::Get_Parent(void) const
106 {
107 return( m_pParent );
108 }
109
110 //---------------------------------------------------------
111 CSG_Data_Manager * CSG_Parameter::Get_Manager(void) const
112 {
113 return( m_pParameters ? m_pParameters->Get_Manager() : NULL );
114 }
115
116
118 // //
120
121 //---------------------------------------------------------
122 CSG_String CSG_Parameter::Get_Type_Identifier(void) const
123 {
124 return( SG_Parameter_Type_Get_Identifier(Get_Type()) );
125 }
126
127 //---------------------------------------------------------
128 CSG_String CSG_Parameter::Get_Type_Name(void) const
129 {
130 return( SG_Parameter_Type_Get_Name(Get_Type()) );
131 }
132
133
135 // //
137
138 //---------------------------------------------------------
139 void CSG_Parameter::Set_UseInGUI(bool bDoUse)
140 {
141 if( bDoUse )
142 {
143 m_Constraint &= ~PARAMETER_NOT_FOR_GUI;
144 }
145 else
146 {
147 m_Constraint |= PARAMETER_NOT_FOR_GUI;
148 }
149 }
150
151 //---------------------------------------------------------
152 void CSG_Parameter::Set_UseInCMD(bool bDoUse)
153 {
154 if( bDoUse )
155 {
156 m_Constraint &= ~PARAMETER_NOT_FOR_CMD;
157 }
158 else
159 {
160 m_Constraint |= PARAMETER_NOT_FOR_CMD;
161 }
162 }
163
164 //---------------------------------------------------------
165 bool CSG_Parameter::do_UseInGUI(void) const
166 {
167 return( !(m_Constraint & PARAMETER_NOT_FOR_GUI) && (Get_Parent() == NULL || Get_Parent()->do_UseInGUI()) );
168 }
169
170 //---------------------------------------------------------
171 bool CSG_Parameter::do_UseInCMD(void) const
172 {
173 return( !(m_Constraint & PARAMETER_NOT_FOR_CMD) && (Get_Parent() == NULL || Get_Parent()->do_UseInCMD()) );
174 }
175
176 //---------------------------------------------------------
177 void CSG_Parameter::ignore_Projection(bool bIgnore)
178 {
179 if( bIgnore )
180 {
181 m_Constraint &= ~PARAMETER_IGNORE_PROJECTION;
182 }
183 else
184 {
185 m_Constraint |= PARAMETER_IGNORE_PROJECTION;
186 }
187 }
188
189
191 // //
193
194 //---------------------------------------------------------
195 bool CSG_Parameter::Set_Enabled(bool bEnabled)
196 {
197 if( m_bEnabled != bEnabled )
198 {
199 m_bEnabled = bEnabled;
200
201 return( !bEnabled );
202 }
203
204 return( bEnabled );
205 }
206
207 //---------------------------------------------------------
208 bool CSG_Parameter::is_Enabled(bool bCheckEnv) const
209 {
210 if( bCheckEnv )
211 {
212 if( !do_UseInGUI() && m_pParameters->has_GUI() )
213 {
214 return( false );
215 }
216
217 if( !do_UseInCMD() && !m_pParameters->has_GUI() )
218 {
219 return( false );
220 }
221 }
222
223 return( m_bEnabled && (m_pParent == NULL || m_pParent->is_Enabled()) );
224 }
225
226 //---------------------------------------------------------
227 bool CSG_Parameter::Set_Children_Enabled(bool bEnabled)
228 {
229 for(int i=0; i<Get_Children_Count(); i++)
230 {
231 Get_Child(i)->Set_Enabled(bEnabled);
232 }
233
234 return( true );
235 }
236
237 //---------------------------------------------------------
238 bool CSG_Parameter::is_Option(void) const
239 {
240 if( !is_Information() )
241 {
242 switch( Get_Type() )
243 {
244 case PARAMETER_TYPE_Bool :
245 case PARAMETER_TYPE_Int :
246 case PARAMETER_TYPE_Double :
247 case PARAMETER_TYPE_Degree :
248 case PARAMETER_TYPE_Date :
249 case PARAMETER_TYPE_Range :
250 case PARAMETER_TYPE_Data_Type :
251 case PARAMETER_TYPE_Choice :
252 case PARAMETER_TYPE_Choices :
253 case PARAMETER_TYPE_String :
254 case PARAMETER_TYPE_Text :
255 case PARAMETER_TYPE_FilePath :
256 case PARAMETER_TYPE_Font :
257 case PARAMETER_TYPE_Color :
258 case PARAMETER_TYPE_Colors :
259 case PARAMETER_TYPE_FixedTable :
260 case PARAMETER_TYPE_Grid_System :
261 case PARAMETER_TYPE_Table_Field :
262 case PARAMETER_TYPE_Table_Fields:
263 case PARAMETER_TYPE_Parameters :
264 return( true );
265
266 default:
267 return( false );
268 }
269 }
270
271 return( false );
272 }
273
274 //---------------------------------------------------------
275 bool CSG_Parameter::is_DataObject(void) const
276 {
277 switch( Get_Type() )
278 {
279 case PARAMETER_TYPE_DataObject_Output:
280 case PARAMETER_TYPE_Grid :
281 case PARAMETER_TYPE_Grids :
282 case PARAMETER_TYPE_Table :
283 case PARAMETER_TYPE_Shapes :
284 case PARAMETER_TYPE_TIN :
285 case PARAMETER_TYPE_PointCloud :
286 return( true );
287
288 default:
289 return( false );
290 }
291 }
292
293 //---------------------------------------------------------
294 bool CSG_Parameter::is_DataObject_List(void) const
295 {
296 switch( Get_Type() )
297 {
298 case PARAMETER_TYPE_Grid_List :
299 case PARAMETER_TYPE_Grids_List :
300 case PARAMETER_TYPE_Table_List :
301 case PARAMETER_TYPE_Shapes_List :
302 case PARAMETER_TYPE_TIN_List :
303 case PARAMETER_TYPE_PointCloud_List:
304 return( true );
305
306 default:
307 return( false );
308 }
309 }
310
311 //---------------------------------------------------------
312 bool CSG_Parameter::is_Parameters(void) const
313 {
314 return( Get_Type() == PARAMETER_TYPE_Parameters );
315 }
316
317 //---------------------------------------------------------
318 bool CSG_Parameter::is_Serializable(void) const
319 {
320 switch( Get_Type() )
321 {
322 case PARAMETER_TYPE_Undefined :
323 case PARAMETER_TYPE_Node :
324 case PARAMETER_TYPE_DataObject_Output:
325 return( false );
326
327 case PARAMETER_TYPE_String :
328 return( ((CSG_Parameter_String *)this)->is_Password() == false );
329
330 default:
331 return( !is_Information() );
332 }
333 }
334
335 //---------------------------------------------------------
336 bool CSG_Parameter::is_Compatible(CSG_Parameter *pParameter) const
337 {
338 if( pParameter && pParameter->Get_Type() == Get_Type() )
339 {
340 switch( Get_Type() )
341 {
342 //-------------------------------------------------
343 case PARAMETER_TYPE_Data_Type :
344 case PARAMETER_TYPE_Choice :
345 {
346 bool bResult = pParameter->asChoice()->Get_Count() == asChoice()->Get_Count();
347
348 for(int i=0; bResult && i<asChoice()->Get_Count(); i++)
349 {
350 bResult = SG_STR_CMP(pParameter->asChoice()->Get_Item(i), asChoice()->Get_Item(i)) == 0;
351 }
352
353 return( bResult );
354 }
355
356 //-------------------------------------------------
357 case PARAMETER_TYPE_Choices :
358 {
359 bool bResult = pParameter->asChoices()->Get_Item_Count() == asChoices()->Get_Item_Count();
360
361 for(int i=0; bResult && i<asChoices()->Get_Item_Count(); i++)
362 {
363 bResult = SG_STR_CMP(pParameter->asChoices()->Get_Item(i), asChoices()->Get_Item(i)) == 0;
364 }
365
366 return( bResult );
367 }
368
369 //-------------------------------------------------
370 case PARAMETER_TYPE_FixedTable : return( pParameter->asTable()->is_Compatible(asTable()) );
371
372 //-------------------------------------------------
373 case PARAMETER_TYPE_Parameters :
374 {
375 bool bResult = pParameter->asParameters()->Get_Count() == asParameters()->Get_Count();
376
377 for(int i=0; bResult && i<asParameters()->Get_Count(); i++)
378 {
379 bResult = pParameter->asParameters()->Get_Parameter(i)->is_Compatible(asParameters()->Get_Parameter(i));
380 }
381
382 return( bResult );
383 }
384
385 //-------------------------------------------------
386 default:
387 return( true );
388 }
389 }
390
391 return( false );
392 }
393
394 //---------------------------------------------------------
395 bool CSG_Parameter::is_Value_Equal(CSG_Parameter *pParameter) const
396 {
397 if( pParameter && pParameter->Get_Type() == Get_Type() )
398 {
399 switch( Get_Type() )
400 {
401 case PARAMETER_TYPE_Node : return( true );
402
403 //-------------------------------------------------
404 case PARAMETER_TYPE_Bool : return( pParameter->asBool () == asBool () );
405 case PARAMETER_TYPE_Table_Field :
406 case PARAMETER_TYPE_Data_Type :
407 case PARAMETER_TYPE_Choice :
408 case PARAMETER_TYPE_Color :
409 case PARAMETER_TYPE_Int : return( pParameter->asInt () == asInt () );
410 case PARAMETER_TYPE_Date :
411 case PARAMETER_TYPE_Degree :
412 case PARAMETER_TYPE_Double : return( pParameter->asDouble() == asDouble() );
413
414 case PARAMETER_TYPE_Table_Fields :
415 case PARAMETER_TYPE_Font :
416 case PARAMETER_TYPE_Text :
417 case PARAMETER_TYPE_FilePath :
418 case PARAMETER_TYPE_String : return( SG_STR_CMP(pParameter->asString(), asString()) == 0 );
419
420 case PARAMETER_TYPE_Range : return( pParameter->asRange()->Get_Min() == asRange()->Get_Min()
421 && pParameter->asRange()->Get_Max() == asRange()->Get_Max() );
422
423 case PARAMETER_TYPE_Grid_System : return( pParameter->asGrid_System()->is_Equal(*asGrid_System()) );
424
425 //-------------------------------------------------
426 case PARAMETER_TYPE_Choices :
427 {
428 bool bResult = pParameter->asChoices()->Get_Selection_Count() == asChoices()->Get_Selection_Count();
429
430 for(int i=0; bResult && i<asChoices()->Get_Selection_Count(); i++)
431 {
432 bResult = pParameter->asChoices()->Get_Selection_Index(i) == asChoices()->Get_Selection_Index(i);
433 }
434
435 return( bResult );
436 }
437
438 //-------------------------------------------------
439 case PARAMETER_TYPE_Colors :
440 {
441 bool bResult = pParameter->asColors()->Get_Count() == asColors()->Get_Count();
442
443 for(int i=0; bResult && i<asColors()->Get_Count(); i++)
444 {
445 bResult = pParameter->asColors()->Get_Color(i) == asColors()->Get_Color(i);
446 }
447
448 return( bResult );
449 }
450
451 //-------------------------------------------------
452 case PARAMETER_TYPE_FixedTable :
453 {
454 bool bResult = pParameter->asTable()->is_Compatible(asTable()) && pParameter->asTable()->Get_Count() == asTable()->Get_Count();
455
456 for(int i=0; bResult && i<asTable()->Get_Count(); i++)
457 {
458 CSG_Table_Record *pA = pParameter->asTable()->Get_Record(i), *pB = asTable()->Get_Record(i);
459
460 for(int j=0; bResult && j<asTable()->Get_Field_Count(); j++)
461 {
462 bResult = SG_STR_CMP(pA->asString(j), pB->asString(j)) == 0;
463 }
464 }
465
466 return( bResult );
467 }
468
469 //-------------------------------------------------
470 case PARAMETER_TYPE_DataObject_Output:
471 case PARAMETER_TYPE_Grid :
472 case PARAMETER_TYPE_Grids :
473 case PARAMETER_TYPE_Table :
474 case PARAMETER_TYPE_Shapes :
475 case PARAMETER_TYPE_TIN :
476 case PARAMETER_TYPE_PointCloud : return( pParameter->asDataObject() == asDataObject() );
477
478 //-------------------------------------------------
479 case PARAMETER_TYPE_Grid_List :
480 case PARAMETER_TYPE_Grids_List :
481 case PARAMETER_TYPE_Table_List :
482 case PARAMETER_TYPE_Shapes_List :
483 case PARAMETER_TYPE_TIN_List :
484 case PARAMETER_TYPE_PointCloud_List :
485 {
486 bool bResult = pParameter->asList()->Get_Item_Count() == asList()->Get_Item_Count();
487
488 for(int i=0; bResult && i<asList()->Get_Item_Count(); i++)
489 {
490 bResult = pParameter->asList()->Get_Item(i) == asList()->Get_Item(i);
491 }
492
493 return( bResult );
494 }
495
496 //-------------------------------------------------
497 case PARAMETER_TYPE_Parameters :
498 {
499 bool bResult = pParameter->asParameters()->Get_Count() == asParameters()->Get_Count();
500
501 for(int i=0; bResult && i<asParameters()->Get_Count(); i++)
502 {
503 bResult = pParameter->asParameters()->Get_Parameter(i)->is_Value_Equal(asParameters()->Get_Parameter(i));
504 }
505
506 return( bResult );
507 }
508
509 //-------------------------------------------------
510 default: break;
511 }
512 }
513
514 return( false );
515 }
516
517 //---------------------------------------------------------
518 TSG_Data_Object_Type CSG_Parameter::Get_DataObject_Type(void) const
519 {
520 switch( Get_Type() )
521 {
522 default : return( SG_DATAOBJECT_TYPE_Undefined );
523 case PARAMETER_TYPE_Grid :
524 case PARAMETER_TYPE_Grid_List : return( SG_DATAOBJECT_TYPE_Grid );
525 case PARAMETER_TYPE_Grids :
526 case PARAMETER_TYPE_Grids_List : return( SG_DATAOBJECT_TYPE_Grids );
527 case PARAMETER_TYPE_Table :
528 case PARAMETER_TYPE_Table_List : return( SG_DATAOBJECT_TYPE_Table );
529 case PARAMETER_TYPE_Shapes :
530 case PARAMETER_TYPE_Shapes_List : return( SG_DATAOBJECT_TYPE_Shapes );
531 case PARAMETER_TYPE_TIN :
532 case PARAMETER_TYPE_TIN_List : return( SG_DATAOBJECT_TYPE_TIN );
533 case PARAMETER_TYPE_PointCloud :
534 case PARAMETER_TYPE_PointCloud_List : return( SG_DATAOBJECT_TYPE_PointCloud );
535 case PARAMETER_TYPE_DataObject_Output:
536 return( ((CSG_Parameter_Data_Object_Output *)this)->Get_DataObject_Type() );
537 }
538 }
539
540
542 // //
544
545 //---------------------------------------------------------
546 const SG_Char * CSG_Parameter::Get_Identifier(void) const
547 {
548 return( m_Identifier );
549 }
550
551 //---------------------------------------------------------
552 bool CSG_Parameter::Cmp_Identifier(const CSG_String &Identifier) const
553 {
554 return( !m_Identifier.Cmp(Identifier) || !m_Identifier.Cmp(Identifier + ".Default") );
555 }
556
557 //---------------------------------------------------------
558 bool CSG_Parameter::Set_Name(const CSG_String &Name)
559 {
560 m_Name = Name;
561
562 return( true );
563 }
564
565 const SG_Char * CSG_Parameter::Get_Name(void) const
566 {
567 return( m_Name );
568 }
569
570 //---------------------------------------------------------
571 bool CSG_Parameter::Set_Description(const CSG_String &Description)
572 {
573 m_Description = Description;
574
575 return( true );
576 }
577
578 const SG_Char * CSG_Parameter::Get_Description(void) const
579 {
580 return( m_Description );
581 }
582
583 //---------------------------------------------------------
584 CSG_String CSG_Parameter::Get_Description(int Flags) const
585 {
586 return( Get_Description(Flags, SG_T("\n")) );
587 }
588
589 //---------------------------------------------------------
590 CSG_String CSG_Parameter::Get_Description(int Flags, const SG_Char *Separator) const
591 {
592 #define SEPARATE if( !s.is_Empty() ) { s.Append(Separator); }
593
594 if( !Separator || !Separator[0] )
595 {
596 return( Get_Description(Flags) );
597 }
598
599 CSG_String s;
600
601 //-----------------------------------------------------
602 if( (Flags & PARAMETER_DESCRIPTION_NAME) != 0 )
603 {
604 SEPARATE; s += CSG_String::Format("%s", Get_Name());
605 }
606
607 //-----------------------------------------------------
608 if( (Flags & PARAMETER_DESCRIPTION_TYPE) != 0 )
609 {
610 SEPARATE;
611
612 if( is_DataObject() && Get_Type() == PARAMETER_TYPE_DataObject_Output )
613 {
614 s += CSG_String::Format("%s %s", Get_Type_Name().c_str(), SG_Get_DataObject_Name(Get_DataObject_Type()).c_str());
615 }
616 else
617 {
618 s += CSG_String::Format("%s", Get_Type_Name().c_str());
619 }
620
621 if( is_DataObject() || is_DataObject_List() )
622 {
623 s += CSG_String::Format(", %s", is_Input() ? _TL("input") : _TL("output"));
624
625 if( is_Optional() )
626 {
627 s += CSG_String::Format(", %s", _TL("optional"));
628 }
629 }
630
631 if( do_UseInGUI() != do_UseInCMD() )
632 {
633 s += CSG_String::Format(", %s", do_UseInGUI() ? SG_T("GUI") : SG_T("CMD"));
634 }
635 }
636
637 //-----------------------------------------------------
638 if( (Flags & PARAMETER_DESCRIPTION_OPTIONAL) != 0 && is_Optional() )
639 {
640 SEPARATE; s += CSG_String::Format("%s", _TL("optional"));
641 }
642
643 //-----------------------------------------------------
644 if( (Flags & PARAMETER_DESCRIPTION_PROPERTIES) != 0 )
645 {
646 switch( Get_Type() )
647 {
648 default:
649 break;
650
651 case PARAMETER_TYPE_Data_Type:
652 case PARAMETER_TYPE_Choice:
653 SEPARATE; s += CSG_String::Format("%s:", _TL("Available Choices"));
654
655 for(int i=0; i<asChoice()->Get_Count(); i++)
656 {
657 s += CSG_String::Format("%s[%d] %s", Separator, i, asChoice()->Get_Item(i));
658 }
659 break;
660
661 case PARAMETER_TYPE_Choices:
662 SEPARATE; s += CSG_String::Format("%s:", _TL("Available Choices"));
663
664 for(int i=0; i<asChoices()->Get_Item_Count(); i++)
665 {
666 s += CSG_String::Format("%s[%d] %s", Separator, i, asChoices()->Get_Item(i).c_str());
667 }
668 break;
669
670 case PARAMETER_TYPE_Int:
671 if( asValue()->has_Minimum() )
672 {
673 SEPARATE; s += CSG_String::Format("%s: %d", _TL("Minimum"), (int)asValue()->Get_Minimum());
674 }
675
676 if( asValue()->has_Maximum() )
677 {
678 SEPARATE; s += CSG_String::Format("%s: %d", _TL("Maximum"), (int)asValue()->Get_Maximum());
679 }
680 break;
681
682 case PARAMETER_TYPE_Double:
683 case PARAMETER_TYPE_Degree:
684 // case PARAMETER_TYPE_Range:
685 if( asValue()->has_Minimum() )
686 {
687 SEPARATE; s += CSG_String::Format("%s: %f", _TL("Minimum"), asValue()->Get_Minimum());
688 }
689
690 if( asValue()->has_Maximum() )
691 {
692 SEPARATE; s += CSG_String::Format("%s: %f", _TL("Maximum"), asValue()->Get_Maximum());
693 }
694 break;
695
696 case PARAMETER_TYPE_FixedTable:
697 SEPARATE; s += CSG_String::Format("%d %s:%s", asTable()->Get_Field_Count(), _TL("Fields"), Separator);
698
699 for(int i=0; i<asTable()->Get_Field_Count(); i++)
700 {
701 s += CSG_String::Format("- %d. [%s] %s%s", i + 1, SG_Data_Type_Get_Name(asTable()->Get_Field_Type(i)).c_str(), asTable()->Get_Field_Name(i), Separator);
702 }
703 break;
704
705 case PARAMETER_TYPE_Parameters:
706 SEPARATE; s += CSG_String::Format("%d %s:%s", asParameters()->Get_Count(), _TL("Parameters"), Separator);
707
708 for(int i=0; i<asParameters()->Get_Count(); i++)
709 {
710 s += CSG_String::Format("- %d. %s%s", i + 1, asParameters()->Get_Parameter(i)->Get_Description(Flags, Separator).c_str(), Separator);
711 }
712 break;
713 }
714
715 if( !m_Default.is_Empty() )
716 {
717 SEPARATE; s += CSG_String::Format("%s: %s", _TL("Default"), m_Default.c_str());
718 }
719 }
720
721 //-----------------------------------------------------
722 if( (Flags & PARAMETER_DESCRIPTION_TEXT) != 0 && m_Description.Length() > 0 )
723 {
724 SEPARATE; s += m_Description;
725 }
726
727 //-----------------------------------------------------
728 #undef SEPARATE
729
730 return( s );
731 }
732
733
735 // //
737
738 //---------------------------------------------------------
739 int CSG_Parameter::_Set_Value(int Value) { return( SG_PARAMETER_DATA_SET_FALSE ); }
740 int CSG_Parameter::_Set_Value(double Value) { return( SG_PARAMETER_DATA_SET_FALSE ); }
741 int CSG_Parameter::_Set_Value(const CSG_String &Value) { return( SG_PARAMETER_DATA_SET_FALSE ); }
742 int CSG_Parameter::_Set_Value(void *Value) { return( SG_PARAMETER_DATA_SET_FALSE ); }
743
744 //---------------------------------------------------------
745 bool CSG_Parameter::Set_Value(int Value)
746 {
747 switch( _Set_Value(Value) )
748 {
749 case SG_PARAMETER_DATA_SET_FALSE:
750 return( false );
751
752 case SG_PARAMETER_DATA_SET_CHANGED:
753 has_Changed();
754 }
755
756 return( true );
757 }
758
759 //---------------------------------------------------------
760 bool CSG_Parameter::Set_Value(double Value)
761 {
762 switch( _Set_Value(Value) )
763 {
764 case SG_PARAMETER_DATA_SET_FALSE:
765 return( false );
766
767 case SG_PARAMETER_DATA_SET_CHANGED:
768 has_Changed();
769 }
770
771 return( true );
772 }
773
774 //---------------------------------------------------------
775 bool CSG_Parameter::Set_Value(const char *Value) { return( Set_Value(CSG_String(Value)) ); }
776 bool CSG_Parameter::Set_Value(const wchar_t *Value) { return( Set_Value(CSG_String(Value)) ); }
777 bool CSG_Parameter::Set_Value(const CSG_String &Value)
778 {
779 switch( _Set_Value(Value) )
780 {
781 case SG_PARAMETER_DATA_SET_FALSE:
782 return( false );
783
784 case SG_PARAMETER_DATA_SET_CHANGED:
785 has_Changed();
786 }
787
788 return( true );
789 }
790
791 //---------------------------------------------------------
792 bool CSG_Parameter::Set_Value(void *Value)
793 {
794 switch( _Set_Value(Value) )
795 {
796 case SG_PARAMETER_DATA_SET_FALSE:
797 return( false );
798
799 case SG_PARAMETER_DATA_SET_CHANGED:
800 has_Changed();
801 }
802
803 return( true );
804 }
805
806 //---------------------------------------------------------
807 bool CSG_Parameter::Set_Value(CSG_Parameter *Value)
808 {
809 if( Value )
810 {
811 switch( Value->Get_Type() )
812 {
813 default:
814 break;
815
816 case PARAMETER_TYPE_Data_Type:
817 case PARAMETER_TYPE_Choice:
818 return( Set_Value(Value->asInt()) );
819 }
820 }
821
822 return( Assign(Value) );
823 }
824
825 //---------------------------------------------------------
826 bool CSG_Parameter::Toggle_Value(void)
827 {
828 return( false );
829 }
830
831 //---------------------------------------------------------
832 bool CSG_Parameter::has_Changed(int Check_Flags)
833 {
834 _Set_String();
835
836 return( m_pParameters && m_pParameters->_On_Parameter_Changed(this, Check_Flags) );
837 }
838
839 //---------------------------------------------------------
840 void CSG_Parameter::_Set_String(void)
841 {
842 // nop
843 }
844
845
847 // //
849
850 //---------------------------------------------------------
851 bool CSG_Parameter::Set_Default(int Value)
852 {
853 m_Default.Printf("%d", Value);
854
855 return( true );
856 }
857
858 //---------------------------------------------------------
859 bool CSG_Parameter::Set_Default(double Value)
860 {
861 m_Default.Printf("%f", Value);
862
863 return( true );
864 }
865
866 //---------------------------------------------------------
867 bool CSG_Parameter::Set_Default(const CSG_String &Value)
868 {
869 m_Default = Value;
870
871 return( true );
872 }
873
874 //---------------------------------------------------------
875 const CSG_String & CSG_Parameter::Get_Default(void) const
876 {
877 return( m_Default );
878 }
879
880 //---------------------------------------------------------
881 bool CSG_Parameter::is_Default(void) const
882 {
883 return( m_Default.Cmp(asString()) == 0 );
884 }
885
886 //---------------------------------------------------------
887 bool CSG_Parameter::Restore_Default(void)
888 {
889 return( Set_Value(m_Default) );
890 }
891
892
894 // //
896
897 //---------------------------------------------------------
898 bool CSG_Parameter::Check(bool bSilent)
899 {
900 if( Get_Type() == PARAMETER_TYPE_Parameters )
901 {
902 return( asParameters()->DataObjects_Check(bSilent) );
903 }
904
905 //-----------------------------------------------------
906 if( Get_Type() == PARAMETER_TYPE_Grid_System )
907 {
908 if( m_pParameters->Get_Manager() && !m_pParameters->Get_Manager()->Exists(*asGrid_System()) )
909 {
910 Set_Value((void *)NULL);
911 }
912
913 return( true ); // ( false );
914 }
915
916 //-----------------------------------------------------
917 if( is_DataObject() )
918 {
919 if( is_Input() || (is_Output() && asDataObject() != DATAOBJECT_CREATE) )
920 {
921 if( m_pParameters->Get_Manager() && !m_pParameters->Get_Manager()->Exists(asDataObject()) )
922 {
923 Set_Value(DATAOBJECT_NOTSET);
924 }
925 }
926
927 return( is_Optional() || !is_Enabled() || asDataObject() );
928 }
929
930 //-----------------------------------------------------
931 else if( is_DataObject_List() )
932 {
933 for(int j=asList()->Get_Item_Count()-1; j>=0; j--)
934 {
935 CSG_Data_Object *pDataObject = asList()->Get_Item(j);
936
937 if( !pDataObject || (m_pParameters->Get_Manager() && !m_pParameters->Get_Manager()->Exists(pDataObject)) )
938 {
939 asList()->Del_Item(j, false);
940 }
941 }
942
943 _Set_String();
944
945 asList()->Update_Data();
946
947 return( is_Optional() || !is_Enabled() || is_Output() || asList()->Get_Item_Count() > 0 );
948 }
949
950 //-----------------------------------------------------
951 return( true );
952 }
953
954
956 // //
958
959 //---------------------------------------------------------
960 int CSG_Parameter::_asInt (void) const { return( 0 ); }
961 double CSG_Parameter::_asDouble (void) const { return( 0. ); }
962 void * CSG_Parameter::_asPointer (void) const { return( NULL ); }
963 const SG_Char * CSG_Parameter::_asString (void) const { return( m_String ); }
964
965 //---------------------------------------------------------
966 CSG_Colors * CSG_Parameter::asColors (void) const { return( Get_Type() != PARAMETER_TYPE_Colors ? NULL : (CSG_Colors *)asPointer() ); }
967 const SG_Char * CSG_Parameter::asFont (void) const { return( Get_Type() != PARAMETER_TYPE_Font ? NULL : (const SG_Char *)asPointer() ); }
968 CSG_Grid_System * CSG_Parameter::asGrid_System (void) const { return( Get_Type() != PARAMETER_TYPE_Grid_System ? NULL : (CSG_Grid_System *)asPointer() ); }
969 CSG_Parameters * CSG_Parameter::asParameters (void) const { return( Get_Type() != PARAMETER_TYPE_Parameters ? NULL : (CSG_Parameters *)asPointer() ); }
970
971 //---------------------------------------------------------
972 CSG_Data_Object * CSG_Parameter::asDataObject (void) const { return( !is_DataObject() ? NULL : (CSG_Data_Object *)asPointer() ); }
973 CSG_Grid * CSG_Parameter::asGrid (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grid ? NULL : (CSG_Grid *)pObject ); }
974 CSG_Grids * CSG_Parameter::asGrids (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grids ? NULL : (CSG_Grids *)pObject ); }
975 CSG_TIN * CSG_Parameter::asTIN (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_TIN ? NULL : (CSG_TIN *)pObject ); }
976 CSG_PointCloud * CSG_Parameter::asPointCloud (void) const { CSG_Data_Object *pObject = asDataObject(); return( !pObject || pObject == DATAOBJECT_CREATE || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_PointCloud ? NULL : (CSG_PointCloud *)pObject ); }
977
978 //---------------------------------------------------------
979 CSG_Shapes * CSG_Parameter::asShapes (void) const
980 {
981 CSG_Data_Object *pObject = asDataObject();
982
983 if( pObject && pObject != DATAOBJECT_CREATE
984 && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
985 || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud) )
986 {
987 return( (CSG_Shapes *)pObject );
988 }
989
990 return( NULL );
991 }
992
993 //---------------------------------------------------------
994 CSG_Table * CSG_Parameter::asTable (void) const
995 {
996 switch( Get_Type() )
997 {
998 default: {
999 CSG_Data_Object *pObject = asDataObject();
1000
1001 if( pObject && pObject != DATAOBJECT_CREATE
1002 && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Table
1003 || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes
1004 || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_TIN
1005 || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud) )
1006 {
1007 return( (CSG_Table *)pObject );
1008 }
1009 } break;
1010
1011 case PARAMETER_TYPE_Grids :
1012 return( asGrids() ? asGrids()->Get_Attributes_Ptr() : NULL );
1013
1014 case PARAMETER_TYPE_FixedTable:
1015 return( (CSG_Table *)asPointer() );
1016 }
1017
1018 return( NULL );
1019 }
1020
1021 //---------------------------------------------------------
1022 CSG_Parameter_Value * CSG_Parameter::asValue (void) const
1023 {
1024 if( Get_Type() == PARAMETER_TYPE_Double
1025 || Get_Type() == PARAMETER_TYPE_Degree
1026 || Get_Type() == PARAMETER_TYPE_Int
1027 || Get_Type() == PARAMETER_TYPE_Color
1028 || Get_Type() == PARAMETER_TYPE_Table_Field )
1029 {
1030 return( (CSG_Parameter_Value *)this );
1031 }
1032
1033 return( NULL );
1034 }
1035
1036 CSG_Parameter_Date * CSG_Parameter::asDate (void) const { return( Get_Type() != PARAMETER_TYPE_Date ? NULL : (CSG_Parameter_Date *)this ); }
1037 CSG_Parameter_Data_Type * CSG_Parameter::asDataType (void) const { return( Get_Type() != PARAMETER_TYPE_Data_Type ? NULL : (CSG_Parameter_Data_Type *)this ); }
1038 CSG_Parameter_Choice * CSG_Parameter::asChoice (void) const { return( Get_Type() != PARAMETER_TYPE_Choice
1039 && Get_Type() != PARAMETER_TYPE_Data_Type ? NULL : (CSG_Parameter_Choice *)this ); }
1040 CSG_Parameter_Choices * CSG_Parameter::asChoices (void) const { return( Get_Type() != PARAMETER_TYPE_Choices ? NULL : (CSG_Parameter_Choices *)this ); }
1041 CSG_Parameter_Range * CSG_Parameter::asRange (void) const { return( Get_Type() != PARAMETER_TYPE_Range ? NULL : (CSG_Parameter_Range *)this ); }
1042 CSG_Parameter_File_Name * CSG_Parameter::asFilePath (void) const { return( Get_Type() != PARAMETER_TYPE_FilePath ? NULL : (CSG_Parameter_File_Name *)this ); }
1043 CSG_Parameter_Table_Fields * CSG_Parameter::asTableFields (void) const { return( Get_Type() != PARAMETER_TYPE_Table_Fields ? NULL : (CSG_Parameter_Table_Fields *)this ); }
1044
1045 //---------------------------------------------------------
1046 CSG_Parameter_List * CSG_Parameter::asList (void) const { return( !is_DataObject_List() ? NULL : (CSG_Parameter_List *)this ); }
1047 CSG_Parameter_Grid_List * CSG_Parameter::asGridList (void) const { return( Get_Type() != PARAMETER_TYPE_Grid_List ? NULL : (CSG_Parameter_Grid_List *)this ); }
1048 CSG_Parameter_Grids_List * CSG_Parameter::asGridsList (void) const { return( Get_Type() != PARAMETER_TYPE_Grids_List ? NULL : (CSG_Parameter_Grids_List *)this ); }
1049 CSG_Parameter_Table_List * CSG_Parameter::asTableList (void) const { return( Get_Type() != PARAMETER_TYPE_Table_List ? NULL : (CSG_Parameter_Table_List *)this ); }
1050 CSG_Parameter_Shapes_List * CSG_Parameter::asShapesList (void) const { return( Get_Type() != PARAMETER_TYPE_Shapes_List ? NULL : (CSG_Parameter_Shapes_List *)this ); }
1051 CSG_Parameter_TIN_List * CSG_Parameter::asTINList (void) const { return( Get_Type() != PARAMETER_TYPE_TIN_List ? NULL : (CSG_Parameter_TIN_List *)this ); }
1052 CSG_Parameter_PointCloud_List * CSG_Parameter::asPointCloudList(void) const { return( Get_Type() != PARAMETER_TYPE_PointCloud_List ? NULL : (CSG_Parameter_PointCloud_List *)this ); }
1053
1054
1056 // //
1058
1059 //---------------------------------------------------------
1060 void CSG_Parameter::_Add_Child(CSG_Parameter *pChild)
1061 {
1062 m_Children = (CSG_Parameter **)SG_Realloc(m_Children, (m_nChildren + 1) * sizeof(CSG_Parameter *));
1063 m_Children[m_nChildren++] = pChild;
1064 }
1065
1066
1068 // //
1070
1071 //---------------------------------------------------------
1072 bool CSG_Parameter::Assign(CSG_Parameter *pSource)
1073 {
1074 if( pSource && Get_Type() == pSource->Get_Type() )
1075 {
1076 m_bEnabled = pSource->m_bEnabled;
1077 m_Default = pSource->m_Default;
1078
1079 if( _Assign(pSource) )
1080 {
1081 _Set_String();
1082
1083 return( true );
1084 }
1085 }
1086
1087 return( false );
1088 }
1089
1090 bool CSG_Parameter::_Assign(CSG_Parameter *pSource)
1091 {
1092 return( true );
1093 }
1094
1095 //---------------------------------------------------------
1096 bool CSG_Parameter::Serialize(CSG_MetaData &MetaData, bool bSave)
1097 {
1098 if( bSave )
1099 {
1100 if( is_Information() || Get_Type() == PARAMETER_TYPE_Node || Get_Type() == PARAMETER_TYPE_Undefined )
1101 {
1102 return( true );
1103 }
1104
1105 CSG_MetaData &Child = *MetaData.Add_Child(
1106 is_Option () ? "OPTION" :
1107 is_DataObject () ? "DATA" :
1108 is_DataObject_List() ? "DATA_LIST" : "PARAMETER"
1109 );
1110
1111 Child.Add_Property("type" , Get_Type_Identifier ());
1112 Child.Add_Property("id" , Get_Identifier ());
1113 Child.Add_Property("name" , Get_Name ());
1114 Child.Add_Property("parms", Get_Parameters()->Get_Identifier());
1115
1116 _Serialize(Child, bSave);
1117
1118 return( true );
1119 }
1120 else if( MetaData.Cmp_Property("type", Get_Type_Identifier())
1121 && MetaData.Cmp_Property("id" , Get_Identifier ())
1122 && _Serialize(MetaData, bSave) )
1123 {
1124 _Set_String();
1125
1126 return( true );
1127 }
1128
1129 return( false );
1130 }
1131
1132 bool CSG_Parameter::_Serialize(CSG_MetaData &Entry, bool bSave)
1133 {
1134 Entry.Set_Content("-");
1135
1136 return( true );
1137 }
1138
1139
1141 // //
1143
1144 //---------------------------------------------------------
1145 CSG_Parameters_Grid_Target::CSG_Parameters_Grid_Target(void)
1146 {
1147 m_pParameters = NULL;
1148 }
1149
1150 //---------------------------------------------------------
1151 bool CSG_Parameters_Grid_Target::Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix)
1152 {
1153 return( Create(pParameters, bAddDefaultGrid, pParent ? pParent->Get_Identifier() : SG_T(""), Prefix) );
1154 }
1155
1156 bool CSG_Parameters_Grid_Target::Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, const CSG_String &ParentID, const CSG_String &Prefix)
1157 {
1158 if( pParameters == NULL )
1159 {
1160 return( false );
1161 }
1162
1163 m_pParameters = pParameters;
1164 m_Prefix = Prefix;
1165
1166 //-----------------------------------------------------
1167 CSG_String TargetID(m_Prefix + "DEFINITION");
1168
1169 m_pParameters->Add_Choice(
1170 ParentID, TargetID, _TL("Target Grid System"),
1171 _TL(""),
1172 CSG_String::Format("%s|%s",
1173 _TL("user defined"),
1174 _TL("grid or grid system")
1175 ), 0
1176 );
1177
1178 //-----------------------------------------------------
1179 m_pParameters->Add_Double(TargetID, m_Prefix + "USER_SIZE", _TL("Cellsize"), _TL(""), 1., 0., true);
1180 m_pParameters->Add_Double(TargetID, m_Prefix + "USER_XMIN", _TL("West" ), _TL(""), 0.);
1181 m_pParameters->Add_Double(TargetID, m_Prefix + "USER_XMAX", _TL("East" ), _TL(""), 100.);
1182 m_pParameters->Add_Double(TargetID, m_Prefix + "USER_YMIN", _TL("South" ), _TL(""), 0.);
1183 m_pParameters->Add_Double(TargetID, m_Prefix + "USER_YMAX", _TL("North" ), _TL(""), 100.);
1184 m_pParameters->Add_Int (TargetID, m_Prefix + "USER_COLS", _TL("Columns" ), _TL("Number of cells in East-West direction." ), 101, 1, true);
1185 m_pParameters->Add_Int (TargetID, m_Prefix + "USER_ROWS", _TL("Rows" ), _TL("Number of cells in North-South direction."), 101, 1, true);
1186 m_pParameters->Add_Choice(TargetID, m_Prefix + "USER_FITS", _TL("Fit" ), _TL(""),
1187 CSG_String::Format("%s|%s",
1188 _TL("nodes"),
1189 _TL("cells")
1190 ), 0
1191 );
1192
1193 //-----------------------------------------------------
1194 m_pParameters->Add_Grid_System(TargetID, m_Prefix + "SYSTEM", _TL("Grid System"), _TL(""));
1195
1196 m_pParameters->Add_Grid(m_Prefix + "SYSTEM", m_Prefix + "TEMPLATE", _TL("Target System"),
1197 _TL("use this grid's system for output grids"), PARAMETER_INPUT_OPTIONAL, false
1198 )->Set_UseInGUI(false);
1199
1200 //-----------------------------------------------------
1201 if( bAddDefaultGrid )
1202 {
1203 Add_Grid(m_Prefix + "OUT_GRID", _TL("Target Grid"), false);
1204 }
1205
1206 return( true );
1207 }
1208
1209
1211 // //
1213
1214 //---------------------------------------------------------
1215 bool CSG_Parameters_Grid_Target::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
1216 {
1217 return( pParameter && pParameters && m_pParameters && m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) == 0
1218 && On_Parameter_Changed(pParameters, pParameter, m_Prefix)
1219 );
1220 }
1221
1222 //---------------------------------------------------------
1223 bool CSG_Parameters_Grid_Target::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix)
1224 {
1225 if( !pParameter || !pParameters )
1226 {
1227 return( false );
1228 }
1229
1230 CSG_Parameter *pSize = (*pParameters)(Prefix + "USER_SIZE");
1231 CSG_Parameter *pXMin = (*pParameters)(Prefix + "USER_XMIN");
1232 CSG_Parameter *pXMax = (*pParameters)(Prefix + "USER_XMAX");
1233 CSG_Parameter *pYMin = (*pParameters)(Prefix + "USER_YMIN");
1234 CSG_Parameter *pYMax = (*pParameters)(Prefix + "USER_YMAX");
1235 CSG_Parameter *pRows = (*pParameters)(Prefix + "USER_ROWS");
1236 CSG_Parameter *pCols = (*pParameters)(Prefix + "USER_COLS");
1237 CSG_Parameter *pFits = (*pParameters)(Prefix + "USER_FITS");
1238
1239 double Size = pSize->asDouble();
1240
1241 double xMin = pXMin->asDouble(), xMax = pXMax->asDouble();
1242 double yMin = pYMin->asDouble(), yMax = pYMax->asDouble();
1243
1244 //-----------------------------------------------------
1245 bool bChanged = true;
1246
1247 if( pParameter->Cmp_Identifier(pFits->Get_Identifier()) )
1248 {
1249 if( pFits->asInt() == 0 ) // fit cells >> fit nodes
1250 {
1251 xMin += 0.5 * Size; xMax -= 0.5 * Size;
1252 yMin += 0.5 * Size; yMax -= 0.5 * Size;
1253 }
1254 }
1255 else
1256 {
1257 if( pFits->asInt() == 1 ) // fit cells >> fit nodes
1258 {
1259 xMin += 0.5 * Size; xMax -= 0.5 * Size;
1260 yMin += 0.5 * Size; yMax -= 0.5 * Size;
1261 }
1262
1263 if( pParameter->Cmp_Identifier(pSize->Get_Identifier()) && Size > 0. )
1264 {
1265 xMax = xMin + Size * (int)(0.5 + (xMax - xMin) / Size);
1266 yMax = yMin + Size * (int)(0.5 + (yMax - yMin) / Size);
1267 }
1268 else if( pParameter->Cmp_Identifier(pCols->Get_Identifier()) && pCols->asInt() > 0 )
1269 {
1270 xMax = xMin + Size * (pCols->asInt() - 1);
1271 }
1272 else if( pParameter->Cmp_Identifier(pXMin->Get_Identifier()) )
1273 {
1274 xMax = xMin + Size * (xMin > xMax ? (pCols->asInt() - 1) : (int)(0.5 + (xMax - xMin) / Size));
1275 }
1276 else if( pParameter->Cmp_Identifier(pXMax->Get_Identifier()) )
1277 {
1278 xMin = xMax - Size * (xMin > xMax ? (pCols->asInt() - 1) : (int)(0.5 + (xMax - xMin) / Size));
1279 }
1280 else if( pParameter->Cmp_Identifier(pRows->Get_Identifier()) && pRows->asInt() > 0 )
1281 {
1282 yMax = yMin + Size * (pRows->asInt() - 1);
1283 }
1284 else if( pParameter->Cmp_Identifier(pYMin->Get_Identifier()) )
1285 {
1286 yMax = yMin + Size * (yMin > yMax ? (pRows->asInt() - 1) : (int)(0.5 + (yMax - yMin) / Size));
1287 }
1288 else if( pParameter->Cmp_Identifier(pYMax->Get_Identifier()) )
1289 {
1290 yMin = yMax - Size * (yMin > yMax ? (pRows->asInt() - 1) : (int)(0.5 + (yMax - yMin) / Size));
1291 }
1292 else
1293 {
1294 bChanged = false; // none of the relevant parameters did change so far
1295 }
1296 }
1297
1298 //-----------------------------------------------------
1299 if( bChanged )
1300 {
1301 pCols->Set_Value(1 + (int)((xMax - xMin) / Size));
1302 pRows->Set_Value(1 + (int)((yMax - yMin) / Size));
1303
1304 if( pFits->asInt() == 1 )
1305 {
1306 xMin -= 0.5 * Size; xMax += 0.5 * Size;
1307 yMin -= 0.5 * Size; yMax += 0.5 * Size;
1308 }
1309
1310 pXMin->Set_Value(xMin);
1311 pXMax->Set_Value(xMax);
1312 pYMin->Set_Value(yMin);
1313 pYMax->Set_Value(yMax);
1314
1315 return( true );
1316 }
1317
1318 //-----------------------------------------------------
1319 CSG_Parameter *pZSize = (*pParameters)(Prefix + "USER_ZSIZE");
1320 CSG_Parameter *pZMin = (*pParameters)(Prefix + "USER_ZMIN" );
1321 CSG_Parameter *pZMax = (*pParameters)(Prefix + "USER_ZMAX" );
1322 CSG_Parameter *pZNum = (*pParameters)(Prefix + "USER_ZNUM" );
1323
1324 if( pZSize && pZMin && pZMax && pZNum )
1325 {
1326 double zSize = pZSize->asDouble(), zMin = pZMin ->asDouble(), zMax = pZMax ->asDouble();
1327
1328 bChanged = true;
1329
1330 if( pParameter->Cmp_Identifier(pZSize->Get_Identifier()) && zSize > 0. )
1331 {
1332 zMax = zMin + zSize * (int)(0.5 + (zMax - zMin) / zSize);
1333 }
1334 else if( pParameter->Cmp_Identifier(pZNum->Get_Identifier()) && pZNum->asInt() > 0 )
1335 {
1336 zMax = zMin + zSize * pZNum->asInt();
1337 }
1338 else if( pParameter->Cmp_Identifier(pZMin->Get_Identifier()) )
1339 {
1340 zMax = zMin + zSize * (zMin > zMax ? pZNum->asInt() : (int)(0.5 + (zMax - zMin) / zSize));
1341 }
1342 else if( pParameter->Cmp_Identifier(pZMax->Get_Identifier()) )
1343 {
1344 zMin = zMax - zSize * (zMin > zMax ? pZNum->asInt() : (int)(0.5 + (zMax - zMin) / zSize));
1345 }
1346 else
1347 {
1348 bChanged = false;
1349 }
1350
1351 if( bChanged )
1352 {
1353 pZNum->Set_Value(1 + (int)((zMax - zMin) / zSize));
1354
1355 pZMin->Set_Value(zMin);
1356 pZMax->Set_Value(zMax);
1357 }
1358 }
1359
1360 return( true );
1361 }
1362
1363 //---------------------------------------------------------
1364 bool CSG_Parameters_Grid_Target::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
1365 {
1366 return( pParameter && pParameters && m_pParameters && m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) == 0
1367 && On_Parameters_Enable(pParameters, pParameter, m_Prefix)
1368 );
1369 }
1370
1371 //---------------------------------------------------------
1372 bool CSG_Parameters_Grid_Target::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix)
1373 {
1374 if( !pParameter || !pParameters || !(pParameter = (*pParameters)(Prefix + "DEFINITION")) )
1375 {
1376 return( false );
1377 }
1378
1379 pParameters->Set_Enabled(Prefix + "SYSTEM" , pParameter->asInt() == 1);
1380 pParameters->Set_Enabled(Prefix + "TEMPLATE" , pParameter->asInt() == 1);
1381
1382 pParameters->Set_Enabled(Prefix + "USER_SIZE", pParameter->asInt() == 0);
1383 pParameters->Set_Enabled(Prefix + "USER_XMIN", pParameter->asInt() == 0);
1384 pParameters->Set_Enabled(Prefix + "USER_XMAX", pParameter->asInt() == 0);
1385 pParameters->Set_Enabled(Prefix + "USER_YMIN", pParameter->asInt() == 0);
1386 pParameters->Set_Enabled(Prefix + "USER_YMAX", pParameter->asInt() == 0);
1387 pParameters->Set_Enabled(Prefix + "USER_ROWS", pParameter->asInt() == 0);
1388 pParameters->Set_Enabled(Prefix + "USER_COLS", pParameter->asInt() == 0);
1389 pParameters->Set_Enabled(Prefix + "USER_FITS", pParameter->asInt() == 0);
1390 pParameters->Set_Enabled(Prefix + "USER_OPTS", pParameter->asInt() == 0);
1391 pParameters->Set_Enabled(Prefix + "USER_Z" , pParameter->asInt() == 0);
1392
1393 return( true );
1394 }
1395
1396
1398 // //
1400
1401 //---------------------------------------------------------
1410 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows, int Rounding)
1411 {
1412 if( !m_pParameters->Get_Tool() || !m_pParameters->Get_Tool()->has_GUI() ) // no cancel button, so set parameters directly
1413 {
1414 pParameters = m_pParameters;
1415 }
1416
1417 if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) )
1418 {
1419 return( false );
1420 }
1421
1422 if( Rows < 1 && (Rows = (*m_pParameters)(m_Prefix + "USER_ROWS")->asInt()) < 1 )
1423 {
1424 Rows = 100;
1425 }
1426
1427 //-----------------------------------------------------
1428 CSG_Rect r(Extent);
1429
1430 if( r.Get_XRange() == 0. && r.Get_YRange() == 0. )
1431 {
1432 r.Inflate(0.5 * Rows, false); // assume cellsize = 1.
1433 }
1434 else if( r.Get_XRange() == 0. )
1435 {
1436 double d = 0.5 * r.Get_YRange() / Rows; r.xMin -= d; r.xMax += d; // inflate by half cellsize
1437 }
1438 else if( r.Get_YRange() == 0. )
1439 {
1440 double d = 0.5 * r.Get_XRange() / Rows; r.yMin -= d; r.yMax += d; // inflate by half cellsize
1441 }
1442
1443 //-----------------------------------------------------
1444 double Size = r.Get_YRange() / (Rows - 1);
1445
1446 int Cols = 1 + (int)(0.5 + r.Get_XRange() / Size);
1447
1448 if( Rounding > 0 )
1449 {
1450 Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1451
1452 r.xMin = r.Get_XCenter() - Size * Cols / 2.;
1453 r.yMin = r.Get_YCenter() - Size * Rows / 2.;
1454 r.yMax = r.Get_YMin () + Size * (Rows - 1);
1455 }
1456
1457 r.xMax = r.Get_XMin() + Size * (Cols - 1);
1458
1459 //-----------------------------------------------------
1460 if( (*pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 ) // fit to cells
1461 {
1462 r.Inflate(0.5 * Size, false);
1463 }
1464
1465 bool bCallback = pParameters->Set_Callback(false);
1466
1467 pParameters->Set_Parameter(m_Prefix + "USER_SIZE", Size );
1468 pParameters->Set_Parameter(m_Prefix + "USER_XMIN", r.Get_XMin());
1469 pParameters->Set_Parameter(m_Prefix + "USER_XMAX", r.Get_XMax());
1470 pParameters->Set_Parameter(m_Prefix + "USER_YMIN", r.Get_YMin());
1471 pParameters->Set_Parameter(m_Prefix + "USER_YMAX", r.Get_YMax());
1472 pParameters->Set_Parameter(m_Prefix + "USER_COLS", Cols );
1473 pParameters->Set_Parameter(m_Prefix + "USER_ROWS", Rows );
1474
1475 pParameters->Set_Callback(bCallback);
1476
1477 return( true );
1478 }
1479
1480 //---------------------------------------------------------
1485 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, CSG_Shapes *pPoints, int Scale, int Rounding)
1486 {
1487 if( !pPoints || pPoints->Get_Count() <= 0 || pPoints->Get_Extent().Get_Area() <= 0. )
1488 {
1489 return( false );
1490 }
1491
1492 CSG_Rect r = pPoints->Get_Extent();
1493
1494 double Size = sqrt(r.Get_Area() / pPoints->Get_Count()) / (Scale > 1 ? Scale : 1); // edge length of a square given as average area per point (cell size)
1495
1496 if( Rounding > 0 )
1497 {
1498 Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1499
1500 r.xMin = Size * floor(r.xMin / Size);
1501 r.xMax = Size * ceil (r.xMax / Size);
1502 r.yMin = Size * floor(r.yMin / Size);
1503 r.yMax = Size * ceil (r.yMax / Size);
1504 }
1505
1506 int Rows = 1 + (int)(0.5 + r.Get_YRange() / Size);
1507
1508 return( Set_User_Defined(pParameters, r, Rows, 0) );
1509 }
1510
1511 //---------------------------------------------------------
1515 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, const CSG_Grid_System &System)
1516 {
1517 return( System.is_Valid() && Set_User_Defined(pParameters, System.Get_Extent(), System.Get_NY(), 0) );
1518 }
1519
1520 //---------------------------------------------------------
1524 bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, double xMin, double yMin, double Cellsize, int nx, int ny)
1525 {
1526 return( Set_User_Defined(pParameters, CSG_Grid_System(Cellsize, xMin, yMin, nx, ny)) );
1527 }
1528
1529 //---------------------------------------------------------
1533 bool CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels(CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding)
1534 {
1535 if( !m_pParameters->Get_Tool()->has_GUI() ) // no cancel button, so set parameters directly
1536 {
1537 pParameters = m_pParameters;
1538 }
1539
1540 if( !m_pParameters || !pParameters || m_pParameters->Get_Identifier().Cmp(pParameters->Get_Identifier()) )
1541 {
1542 return( false );
1543 }
1544
1545 if( nLevels < 1 )
1546 {
1547 nLevels = 100;
1548 }
1549
1550 //-----------------------------------------------------
1551 if( zMin > zMax )
1552 {
1553 double z = zMin; zMin = zMax; zMax = z;
1554 }
1555
1556 if( zMax - zMin <= 0. )
1557 {
1558 zMin -= 0.5 * nLevels;
1559 zMax += 0.5 * nLevels; // assume cellsize = 1.
1560 }
1561
1562 //-----------------------------------------------------
1563 double Size = (zMax - zMin) / (nLevels - 1.);
1564
1565 if( Rounding > 0 )
1566 {
1567 Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
1568
1569 zMin = Size * floor(zMin / Size);
1570 zMax = Size * ceil (zMax / Size);
1571 }
1572
1573 //-----------------------------------------------------
1574 if( (*pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 )
1575 {
1576 zMin -= 0.5 * Size;
1577 zMax += 0.5 * Size;
1578 }
1579
1580 bool bCallback = pParameters->Set_Callback(false);
1581
1582 pParameters->Set_Parameter(m_Prefix + "USER_ZSIZE", Size );
1583 pParameters->Set_Parameter(m_Prefix + "USER_ZMIN" , zMin );
1584 pParameters->Set_Parameter(m_Prefix + "USER_ZMAX" , zMax );
1585 pParameters->Set_Parameter(m_Prefix + "USER_ZNUM" , nLevels);
1586
1587 pParameters->Set_Callback(bCallback);
1588
1589 return( true );
1590 }
1591
1592
1594 // //
1596
1597 //---------------------------------------------------------
1598 bool CSG_Parameters_Grid_Target::Add_Grid(const CSG_String &Identifier, const CSG_String &Name, bool bOptional)
1599 {
1600 if( !m_pParameters || Identifier.Length() == 0 || (*m_pParameters)(Identifier) != NULL )
1601 {
1602 return( false );
1603 }
1604
1605 CSG_Parameter *pTarget = (*m_pParameters)(m_Prefix + "DEFINITION");
1606 CSG_Parameter *pSystem = NULL;
1607
1608 for(int i=0; i<pTarget->Get_Children_Count() && !pSystem; i++)
1609 {
1610 if( pTarget->Get_Child(i)->Get_Type() == PARAMETER_TYPE_Grid_System )
1611 {
1612 pSystem = pTarget->Get_Child(i);
1613 }
1614 }
1615
1616 m_pParameters->Add_Grid (pSystem ? pSystem->Get_Identifier() : SG_T(""), Identifier, Name, _TL(""), bOptional ? PARAMETER_OUTPUT_OPTIONAL : PARAMETER_OUTPUT, false);
1617
1618 if( bOptional && m_pParameters->Get_Tool()->has_GUI() )
1619 {
1620 CSG_Parameter *pNode = (*m_pParameters)(m_Prefix + "USER_OPTS");
1621
1622 if( !pNode )
1623 {
1624 pNode = m_pParameters->Add_Node(pTarget->Get_Identifier(), m_Prefix + "USER_OPTS", _TL("Optional Target Grids"), _TL(""));
1625 }
1626
1627 m_pParameters->Add_Bool(pNode->Get_Identifier(), Identifier + "_CREATE", Name, _TL(""), false);
1628 }
1629
1630 return( true );
1631 }
1632
1633 //---------------------------------------------------------
1634 bool CSG_Parameters_Grid_Target::Add_Grids(const CSG_String &Identifier, const CSG_String &Name, bool bOptional, bool bZLevels)
1635 {
1636 if( !m_pParameters || Identifier.Length() == 0 || (*m_pParameters)(Identifier) != NULL )
1637 {
1638 return( false );
1639 }
1640
1641 CSG_Parameter *pTarget = (*m_pParameters)(m_Prefix + "DEFINITION");
1642 CSG_Parameter *pSystem = NULL;
1643
1644 for(int i=0; i<pTarget->Get_Children_Count() && !pSystem; i++)
1645 {
1646 if( pTarget->Get_Child(i)->Get_Type() == PARAMETER_TYPE_Grid_System )
1647 {
1648 pSystem = pTarget->Get_Child(i);
1649 }
1650 }
1651
1652 m_pParameters->Add_Grids(pSystem ? pSystem->Get_Identifier() : SG_T(""), Identifier, Name, _TL(""), bOptional ? PARAMETER_OUTPUT_OPTIONAL : PARAMETER_OUTPUT, false);
1653
1654 if( bOptional && m_pParameters->Get_Tool()->has_GUI() )
1655 {
1656 CSG_Parameter *pNode = (*m_pParameters)(m_Prefix + "USER_OPTS");
1657
1658 if( !pNode )
1659 {
1660 pNode = m_pParameters->Add_Node(pTarget->Get_Identifier(), m_Prefix + "USER_OPTS", _TL("Optional Target Grids"), _TL(""));
1661 }
1662
1663 m_pParameters->Add_Bool(pNode->Get_Identifier(), Identifier + "_CREATE", Name, _TL(""), false);
1664 }
1665
1666 if( bZLevels )
1667 {
1668 pTarget = m_pParameters->Add_Node(pTarget, "USER_Z", _TL("Z Levels"), _TL(""));
1669
1670 m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZSIZE", _TL("Cellsize"), _TL(""), 1., 0., true);
1671 m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZMIN" , _TL("Bottom" ), _TL(""), 0.);
1672 m_pParameters->Add_Double(pTarget, m_Prefix + "USER_ZMAX" , _TL("Top" ), _TL(""), 100.);
1673 m_pParameters->Add_Int (pTarget, m_Prefix + "USER_ZNUM" , _TL("Levels" ), _TL(""), 101, 1, true);
1674 }
1675
1676 return( true );
1677 }
1678
1679
1681 // //
1683
1684 //---------------------------------------------------------
1685 CSG_Grid_System CSG_Parameters_Grid_Target::Get_System(void)
1686 {
1687 CSG_Grid_System System;
1688
1689 if( m_pParameters )
1690 {
1691 if( (*m_pParameters)(m_Prefix + "DEFINITION")->asInt() == 0 ) // user defined
1692 {
1693 double Size = (*m_pParameters)(m_Prefix + "USER_SIZE")->asDouble();
1694
1695 CSG_Rect r(
1696 (*m_pParameters)(m_Prefix + "USER_XMIN")->asDouble(),
1697 (*m_pParameters)(m_Prefix + "USER_YMIN")->asDouble(),
1698 (*m_pParameters)(m_Prefix + "USER_XMAX")->asDouble(),
1699 (*m_pParameters)(m_Prefix + "USER_YMAX")->asDouble()
1700 );
1701
1702 if( (*m_pParameters)(m_Prefix + "USER_FITS")->asInt() == 1 )
1703 {
1704 r.Deflate(0.5 * Size, false);
1705 }
1706
1707 System.Assign(Size, r);
1708 }
1709 else
1710 {
1711 CSG_Parameter *pParameter = (*m_pParameters)(m_Prefix + "SYSTEM");
1712
1713 if( pParameter->asGrid_System() )
1714 {
1715 System.Assign(*pParameter->asGrid_System());
1716 }
1717 }
1718 }
1719
1720 return( System );
1721 }
1722
1723 //---------------------------------------------------------
1724 CSG_Grid * CSG_Parameters_Grid_Target::Get_Grid(const CSG_String &Identifier, TSG_Data_Type Type)
1725 {
1726 if( !m_pParameters )
1727 {
1728 return( NULL );
1729 }
1730
1731 CSG_Parameter *pParameter = (*m_pParameters)(Identifier);
1732
1733 if( !pParameter || pParameter->Get_Type() != PARAMETER_TYPE_Grid )
1734 {
1735 return( NULL );
1736 }
1737
1738 CSG_Grid_System System(Get_System());
1739
1740 if( !System.is_Valid() )
1741 {
1742 return( NULL );
1743 }
1744
1745 CSG_Parameter *pSystem = (*m_pParameters)(m_Prefix + "SYSTEM");
1746
1747 if( pSystem->asGrid_System() && !pSystem->asGrid_System()->is_Equal(System) )
1748 {
1749 pSystem->asGrid_System()->Assign(System);
1750 }
1751
1752 CSG_Grid *pGrid = NULL;
1753
1754 if( (*m_pParameters)(m_Prefix + "DEFINITION")->asInt() == 0 && m_pParameters->Get_Tool()->has_GUI() )
1755 {
1756 if( (*m_pParameters)(Identifier + "_CREATE") == NULL
1757 || (*m_pParameters)(Identifier + "_CREATE")->asBool() )
1758 {
1759 pGrid = SG_Create_Grid(System, Type);
1760 }
1761 }
1762 else
1763 {
1764 pGrid = pParameter->asGrid();
1765
1766 if( pParameter->asPointer() == DATAOBJECT_CREATE || (!pGrid && !pParameter->is_Optional()) )
1767 {
1768 pGrid = SG_Create_Grid(System, Type);
1769 }
1770 else if( pGrid && pGrid->Get_Type() != Type )
1771 {
1772 pGrid->Create(pGrid->Get_System(), Type);
1773 }
1774 }
1775
1776 if( pGrid && pGrid != pParameter->asGrid() )
1777 {
1778 pParameter->Set_Value(pGrid);
1779 }
1780
1781 return( pGrid );
1782 }
1783
1784
1786 // //
1788
1789 //---------------------------------------------------------
1790 CSG_Grid * CSG_Parameters_Grid_Target::Get_Grid(TSG_Data_Type Type)
1791 {
1792 return( Get_Grid(m_Prefix + "OUT_GRID", Type) );
1793 }
1794
1795 //---------------------------------------------------------
1796 CSG_Grids * CSG_Parameters_Grid_Target::Get_Grids(const CSG_String &Identifier, TSG_Data_Type Type)
1797 {
1798 if( !m_pParameters )
1799 {
1800 return( NULL );
1801 }
1802
1803 CSG_Parameter *pParameter = (*m_pParameters)(Identifier);
1804
1805 if( !pParameter || pParameter->Get_Type() != PARAMETER_TYPE_Grids )
1806 {
1807 return( NULL );
1808 }
1809
1810 CSG_Grid_System System(Get_System());
1811
1812 if( !System.is_Valid() )
1813 {
1814 return( NULL );
1815 }
1816
1817 CSG_Grids *pGrids = NULL;
1818
1819 if( (*m_pParameters)(m_Prefix + "DEFINITION")->asInt() == 0
1820 && (*m_pParameters)(Identifier + "_CREATE") )
1821 {
1822 if( (*m_pParameters)(Identifier + "_CREATE")->asBool() )
1823 {
1824 pGrids = SG_Create_Grids(System, 0, 0., Type);
1825 }
1826 }
1827 else
1828 {
1829 pGrids = pParameter->asGrids();
1830
1831 if( pParameter->asPointer() == DATAOBJECT_CREATE || (!pGrids && !pParameter->is_Optional()) )
1832 {
1833 pGrids = SG_Create_Grids(System, 0, 0., Type);
1834 }
1835 }
1836
1837 if( pGrids && pGrids != pParameter->asGrids() )
1838 {
1839 pParameter->Set_Value(pGrids);
1840 }
1841
1842 if( pGrids
1843 && (*m_pParameters)(m_Prefix + "USER_ZSIZE")
1844 && (*m_pParameters)(m_Prefix + "USER_ZMIN" )
1845 && (*m_pParameters)(m_Prefix + "USER_ZNUM" ) )
1846 {
1847 int nz = (*m_pParameters)(m_Prefix + "USER_ZNUM" )->asInt ();
1848 double z = (*m_pParameters)(m_Prefix + "USER_ZMIN" )->asDouble();
1849 double dz = (*m_pParameters)(m_Prefix + "USER_ZSIZE")->asDouble();
1850
1851 pGrids->Del_Grids();
1852
1853 for(int iz=0; iz<nz; iz++, z+=dz)
1854 {
1855 pGrids->Add_Grid(z);
1856 }
1857 }
1858
1859 return( pGrids );
1860 }
1861
1862 //---------------------------------------------------------
1863 CSG_Grids * CSG_Parameters_Grid_Target::Get_Grids(TSG_Data_Type Type)
1864 {
1865 return( Get_Grids(m_Prefix + "OUT_GRIDS", Type) );
1866 }
1867
1868
1870 // //
1871 // //
1872 // //
1874
1875 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:966
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_Parameter::asGridsList
class CSG_Parameter_Grids_List * asGridsList(void) const
Definition: parameter.cpp:1048
CSG_Rect
Definition: geo_tools.h:471
CSG_Parameter_Date
Definition: parameters.h:571
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:745
CSG_Parameter::asPointer
void * asPointer(void) const
Definition: parameters.h:285
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameter_Choices::Get_Selection_Count
int Get_Selection_Count(void) const
Definition: parameters.h:762
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Parameters_Grid_Target::Add_Grid
bool Add_Grid(const CSG_String &ID, const CSG_String &Name, bool bOptional)
Definition: parameter.cpp:1598
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.cpp:567
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Parameter::asShapesList
class CSG_Parameter_Shapes_List * asShapesList(void) const
Definition: parameter.cpp:1050
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Parameter::m_String
CSG_String m_String
Definition: parameters.h:330
CSG_Parameter_Range::Get_Max
double Get_Max(void) const
Definition: parameter_data.cpp:832
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
CSG_Parameters::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameters.h:1674
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
CSG_Parameter::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: parameter.cpp:128
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:994
CSG_Table_Record
Definition: table.h:130
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
data_manager.h
CSG_Parameter_Table_List
Definition: parameters.h:1463
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
CSG_Parameter::asTINList
class CSG_Parameter_TIN_List * asTINList(void) const
Definition: parameter.cpp:1051
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Parameter::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1090
CSG_Grid_System
Definition: grid.h:200
CSG_Parameter::asDate
class CSG_Parameter_Date * asDate(void) const
Definition: parameter.cpp:1036
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
SG_Get_Rounded_To_SignificantFigures
double SG_Get_Rounded_To_SignificantFigures(double Value, int Decimals)
Definition: mat_tools.cpp:107
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:371
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
CSG_Parameter_Choices
Definition: parameters.h:747
CSG_Parameter::is_Compatible
bool is_Compatible(CSG_Parameter *pParameter) const
Definition: parameter.cpp:336
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1165
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:578
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
CSG_Parameters_Grid_Target::Set_User_Defined
bool Set_User_Defined(CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows=0, int Rounding=2)
Definition: parameter.cpp:1410
CSG_Parameter::asTIN
CSG_TIN * asTIN(void) const
Definition: parameter.cpp:975
CSG_Parameter_Choices::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:758
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Parameters_Grid_Target::Get_System
CSG_Grid_System Get_System(void)
Definition: parameter.cpp:1685
CSG_Parameter::do_UseInCMD
bool do_UseInCMD(void) const
Definition: parameter.cpp:171
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Parameters_Grid_Target::Create
bool Create(CSG_Parameters *pParameters, bool bAddDefaultGrid, CSG_Parameter *pParent, const CSG_String &Prefix="")
Definition: parameter.cpp:1151
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:389
CSG_Parameter::_asString
virtual const SG_Char * _asString(void) const
Definition: parameter.cpp:963
CSG_Parameter::_asDouble
virtual double _asDouble(void) const
Definition: parameter.cpp:961
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Get_ObjectType
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.
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1072
CSG_Parameter_Value
Definition: parameters.h:434
SG_STR_CMP
#define SG_STR_CMP(s1, s2)
Definition: api_core.h:538
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:508
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_Parameter::CSG_Parameter
CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter.cpp:63
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_Parameter::Set_Description
bool Set_Description(const CSG_String &Description)
Definition: parameter.cpp:571
CSG_Parameter::Get_Parameters
CSG_Parameters * Get_Parameters(void) const
Definition: parameter.cpp:99
CSG_Parameter::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter.cpp:739
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:102
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SG_Parameter_Type_Get_Name
CSG_String SG_Parameter_Type_Get_Name(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:64
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
SSG_Rect
Definition: geo_tools.h:464
CSG_Parameter::asGridList
class CSG_Parameter_Grid_List * asGridList(void) const
Definition: parameter.cpp:1047
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_Parameters::has_GUI
bool has_GUI(void) const
Definition: parameters.cpp:242
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1096
CSG_Table::is_Compatible
bool is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const
Definition: table.cpp:436
CSG_Parameter::asGrid
CSG_Grid * asGrid(void) const
Definition: parameter.cpp:973
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:294
CSG_Parameter::Set_UseInCMD
void Set_UseInCMD(bool bDoUse=false)
Definition: parameter.cpp:152
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
CSG_Parameter::ignore_Projection
bool ignore_Projection(void) const
Definition: parameters.h:250
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_TIN
Definition: tin.h:222
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
CSG_Parameters_Grid_Target::On_Parameter_Changed
bool On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1215
CSG_Rect::Deflate
void Deflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:826
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Colors::Get_Count
int Get_Count(void) const
Definition: api_core.h:1345
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
CSG_Parameter::_asInt
virtual int _asInt(void) const
Definition: parameter.cpp:960
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Colors::Get_Color
long Get_Color(int Index) const
Definition: api_core.h:1357
CSG_Parameter_List::Update_Data
virtual bool Update_Data(void)
Definition: parameters.h:1370
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
SG_PARAMETER_DATA_SET_CHANGED
#define SG_PARAMETER_DATA_SET_CHANGED
Definition: parameters.h:196
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Parameter::asPointCloud
CSG_PointCloud * asPointCloud(void) const
Definition: parameter.cpp:976
CSG_Grid_System::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: grid_system.cpp:302
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Parameter::asShapes
CSG_Shapes * asShapes(void) const
Definition: parameter.cpp:979
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:208
PARAMETER_DESCRIPTION_OPTIONAL
#define PARAMETER_DESCRIPTION_OPTIONAL
Definition: parameters.h:108
CSG_Parameter::Set_Default
bool Set_Default(int Value)
Definition: parameter.cpp:851
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3025
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter::_Serialize
virtual bool _Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1132
CSG_Parameter_File_Name
Definition: parameters.h:853
CSG_Parameters_Grid_Target::Get_Grid
CSG_Grid * Get_Grid(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
Definition: parameter.cpp:1724
SG_Parameter_Type_Get_Identifier
CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:114
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels
bool Set_User_Defined_ZLevels(CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding=2)
Definition: parameter.cpp:1533
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1672
CSG_Parameter::Set_Name
bool Set_Name(const CSG_String &Name)
Definition: parameter.cpp:558
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Parameter_Grids_List
Definition: parameters.h:1437
CSG_Parameter_Choice::Get_Count
int Get_Count(void) const
Definition: parameters.h:682
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Parameter::asDataType
class CSG_Parameter_Data_Type * asDataType(void) const
Definition: parameter.cpp:1037
CSG_Parameter::_asPointer
virtual void * _asPointer(void) const
Definition: parameter.cpp:962
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:255
PARAMETER_DESCRIPTION_TYPE
#define PARAMETER_DESCRIPTION_TYPE
Definition: parameters.h:107
CSG_Parameter_Grid_List
Definition: parameters.h:1402
CSG_Parameter::~CSG_Parameter
virtual ~CSG_Parameter(void)
Definition: parameter.cpp:85
CSG_Parameter::is_Serializable
bool is_Serializable(void) const
Definition: parameter.cpp:318
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Parameters_Grid_Target::Add_Grids
bool Add_Grids(const CSG_String &ID, const CSG_String &Name, bool bOptional, bool bZLevels=false)
Definition: parameter.cpp:1634
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
CSG_Parameters_Grid_Target::Get_Grids
CSG_Grids * Get_Grids(const CSG_String &ID, TSG_Data_Type Type=SG_DATATYPE_Float)
Definition: parameter.cpp:1796
SG_PARAMETER_DATA_SET_FALSE
#define SG_PARAMETER_DATA_SET_FALSE
Definition: parameters.h:194
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Parameters_Grid_Target::CSG_Parameters_Grid_Target
CSG_Parameters_Grid_Target(void)
Definition: parameter.cpp:1145
CSG_Parameter::asPointCloudList
class CSG_Parameter_PointCloud_List * asPointCloudList(void) const
Definition: parameter.cpp:1052
CSG_Parameter_Range
Definition: parameters.h:610
PARAMETER_IGNORE_PROJECTION
#define PARAMETER_IGNORE_PROJECTION
Definition: parameters.h:98
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Parameter::Toggle_Value
virtual bool Toggle_Value(void)
Definition: parameter.cpp:826
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
SG_Data_Type_Get_Name
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
Definition: api_core.cpp:122
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:840
CSG_Parameters::Add_Grids
CSG_Parameter * Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:658
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Parameters::Add_Grid
CSG_Parameter * Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:582
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Parameter::is_Value_Equal
bool is_Value_Equal(CSG_Parameter *pParameter) const
Definition: parameter.cpp:395
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1042
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
parameters.h
SG_Create_Grids
CSG_Grids * SG_Create_Grids(void)
Definition: grids.cpp:65
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
CSG_Parameter_Shapes_List
Definition: parameters.h:1486
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1685
CSG_Tool::has_GUI
bool has_GUI(void) const
Definition: tool.cpp:233
CSG_Table
Definition: table.h:283
CSG_MetaData::Cmp_Property
bool Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:673
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
PARAMETER_NOT_FOR_GUI
#define PARAMETER_NOT_FOR_GUI
Definition: parameters.h:99
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
CSG_Parameter::Get_Default
const CSG_String & Get_Default(void) const
Definition: parameter.cpp:875
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
CSG_Parameter_Choice::Get_Item
const SG_Char * Get_Item(int Index) const
Definition: parameter_data.cpp:992
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:105
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:275
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:238
PARAMETER_NOT_FOR_CMD
#define PARAMETER_NOT_FOR_CMD
Definition: parameters.h:100
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_String
Definition: api_core.h:557
CSG_Parameter::asTableFields
class CSG_Parameter_Table_Fields * asTableFields(void) const
Definition: parameter.cpp:1043
CSG_Parameter::Set_Children_Enabled
bool Set_Children_Enabled(bool bEnabled=true)
Definition: parameter.cpp:227
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Parameter_Table_Fields
Definition: parameters.h:1094
CSG_Parameter::Check
bool Check(bool bSilent=true)
Definition: parameter.cpp:898
CSG_Parameter_String
Definition: parameters.h:799
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
PARAMETER_DESCRIPTION_TEXT
#define PARAMETER_DESCRIPTION_TEXT
Definition: parameters.h:110
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:832
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
CSG_Parameter_Choices::Get_Selection_Index
int Get_Selection_Index(int i) const
Definition: parameters.h:765
CSG_Parameter::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameter.cpp:111
CSG_Grid
Definition: grid.h:473
CSG_Parameter::asTableList
class CSG_Parameter_Table_List * asTableList(void) const
Definition: parameter.cpp:1049
CSG_Parameter::do_UseInGUI
bool do_UseInGUI(void) const
Definition: parameter.cpp:165
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1348
CSG_Parameter_Choice
Definition: parameters.h:659
CSG_Parameter_Choices::Get_Item
const CSG_String & Get_Item(int i) const
Definition: parameters.h:759
PARAMETER_DESCRIPTION_PROPERTIES
#define PARAMETER_DESCRIPTION_PROPERTIES
Definition: parameters.h:109
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:195
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Grids::Add_Grid
bool Add_Grid(double Z)
Definition: grids.cpp:638
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Parameter::Set_UseInGUI
void Set_UseInGUI(bool bDoUse=false)
Definition: parameter.cpp:139
CSG_Parameter_PointCloud_List
Definition: parameters.h:1540
CSG_Parameter_TIN_List
Definition: parameters.h:1517
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Parameters
Definition: parameters.h:1650
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:518
CSG_Parameter_Range::Get_Min
double Get_Min(void) const
Definition: parameter_data.cpp:814
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Parameter::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameter.cpp:552
CSG_Parameter::is_Parameters
bool is_Parameters(void) const
Definition: parameter.cpp:312
CSG_Parameter::asGrids
CSG_Grids * asGrids(void) const
Definition: parameter.cpp:974
CSG_Parameter_List
Definition: parameters.h:1359
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:968
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:565
CSG_Parameter::asFont
const SG_Char * asFont(void) const
Definition: parameter.cpp:967
CSG_Parameter::is_Default
virtual bool is_Default(void) const
Definition: parameter.cpp:881
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:238
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
CSG_Grids
Definition: grids.h:119
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
SEPARATE
#define SEPARATE
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:887
CSG_Parameters_Grid_Target::On_Parameters_Enable
bool On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: parameter.cpp:1364
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1306
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
PARAMETER_DESCRIPTION_NAME
#define PARAMETER_DESCRIPTION_NAME
Definition: parameters.h:106
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:122
CSG_Parameter_Data_Type
Definition: parameters.h:717
CSG_Colors
Definition: api_core.h:1329
CSG_Grids::Del_Grids
bool Del_Grids(bool bDetach=false)
Definition: grids.cpp:803
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:103
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: parameter_data.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
parameter_data.cpp File Reference
#include "parameters.h"
#include "data_manager.h"

Go to the source code of this file.

Macros

#define ADD_TYPE(type) if( (Data_Types & SG_Data_Type_Get_Flag(type)) != 0 ) { if( Default == type ) { _Default = Get_Count(); } Add_Item(SG_Data_Type_Get_Name(type), SG_Data_Type_Get_Identifier(type)); }

Functions

CSG_String | SG_Parameter_Type_Get_Name (TSG_Parameter_Type Type)
CSG_String | SG_Parameter_Type_Get_Identifier (TSG_Parameter_Type Type)
TSG_Parameter_Type | SG_Parameter_Type_Get_Type (const CSG_String &Identifier)

Macro Definition Documentation

◆ ADD_TYPE

#define ADD_TYPE ( type ) if( (Data_Types & SG_Data_Type_Get_Flag(type)) != 0 ) { if( Default == type ) { _Default = Get_Count(); } Add_Item(SG_Data_Type_Get_Name(type), SG_Data_Type_Get_Identifier(type)); }

Function Documentation

◆ SG_Parameter_Type_Get_Identifier()

CSG_String SG_Parameter_Type_Get_Identifier ( TSG_Parameter_Type Type )

Definition at line 114 of file parameter_data.cpp.

References PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, and PARAMETER_TYPE_TIN_List.

Referenced by CSG_Parameter::Get_Type_Identifier().

◆ SG_Parameter_Type_Get_Name()

CSG_String SG_Parameter_Type_Get_Name ( TSG_Parameter_Type Type )

Definition at line 64 of file parameter_data.cpp.

References _TL, PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, and PARAMETER_TYPE_TIN_List.

Referenced by CSG_Parameter::Get_Type_Name().

◆ SG_Parameter_Type_Get_Type()

TSG_Parameter_Type SG_Parameter_Type_Get_Type ( const CSG_String & Identifier )

Definition at line 164 of file parameter_data.cpp.

References CSG_String::Cmp(), PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, PARAMETER_TYPE_TIN_List, and PARAMETER_TYPE_Undefined.

Referenced by CSG_Tool_Chain::Create().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: parameter_data.cpp Source File

  • saga_core
  • saga_api
parameter_data.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // parameter_data.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "parameters.h"
54 #include "data_manager.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 CSG_String SG_Parameter_Type_Get_Name(TSG_Parameter_Type Type)
65 {
66 switch( Type )
67 {
68 default : return( _TL("parameter" ) );
69
70 case PARAMETER_TYPE_Node : return( _TL("node" ) );
71
72 case PARAMETER_TYPE_Bool : return( _TL("boolean" ) );
73 case PARAMETER_TYPE_Int : return( _TL("integer number" ) );
74 case PARAMETER_TYPE_Double : return( _TL("floating point number") );
75 case PARAMETER_TYPE_Degree : return( _TL("degree" ) );
76 case PARAMETER_TYPE_Date : return( _TL("date" ) );
77 case PARAMETER_TYPE_Range : return( _TL("value range" ) );
78 case PARAMETER_TYPE_Data_Type : return( _TL("data type" ) );
79 case PARAMETER_TYPE_Choice : return( _TL("choice" ) );
80 case PARAMETER_TYPE_Choices : return( _TL("choices" ) );
81
82 case PARAMETER_TYPE_String : return( _TL("text" ) );
83 case PARAMETER_TYPE_Text : return( _TL("long text" ) );
84 case PARAMETER_TYPE_FilePath : return( _TL("file path" ) );
85
86 case PARAMETER_TYPE_Font : return( _TL("font" ) );
87 case PARAMETER_TYPE_Color : return( _TL("color" ) );
88 case PARAMETER_TYPE_Colors : return( _TL("colors" ) );
89 case PARAMETER_TYPE_FixedTable : return( _TL("static table" ) );
90 case PARAMETER_TYPE_Grid_System : return( _TL("grid system" ) );
91 case PARAMETER_TYPE_Table_Field : return( _TL("table field" ) );
92 case PARAMETER_TYPE_Table_Fields : return( _TL("table fields" ) );
93
94 case PARAMETER_TYPE_DataObject_Output: return( _TL("data object" ) );
95 case PARAMETER_TYPE_Grid : return( _TL("grid" ) );
96 case PARAMETER_TYPE_Grids : return( _TL("grid collection" ) );
97 case PARAMETER_TYPE_Table : return( _TL("table" ) );
98 case PARAMETER_TYPE_Shapes : return( _TL("shapes" ) );
99 case PARAMETER_TYPE_TIN : return( _TL("TIN" ) );
100 case PARAMETER_TYPE_PointCloud : return( _TL("point cloud" ) );
101
102 case PARAMETER_TYPE_Grid_List : return( _TL("grid list" ) );
103 case PARAMETER_TYPE_Grids_List : return( _TL("grid collection list" ) );
104 case PARAMETER_TYPE_Table_List : return( _TL("table list" ) );
105 case PARAMETER_TYPE_Shapes_List : return( _TL("shapes list" ) );
106 case PARAMETER_TYPE_TIN_List : return( _TL("TIN list" ) );
107 case PARAMETER_TYPE_PointCloud_List : return( _TL("point cloud list" ) );
108
109 case PARAMETER_TYPE_Parameters : return( _TL("parameters" ) );
110 }
111 }
112
113 //---------------------------------------------------------
114 CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
115 {
116 switch( Type )
117 {
118 default : return( "parameter" );
119
120 case PARAMETER_TYPE_Node : return( "node" );
121
122 case PARAMETER_TYPE_Bool : return( "boolean" );
123 case PARAMETER_TYPE_Int : return( "integer" );
124 case PARAMETER_TYPE_Double : return( "double" );
125 case PARAMETER_TYPE_Degree : return( "degree" );
126 case PARAMETER_TYPE_Date : return( "date" );
127 case PARAMETER_TYPE_Range : return( "range" );
128 case PARAMETER_TYPE_Data_Type : return( "datatype" );
129 case PARAMETER_TYPE_Choice : return( "choice" );
130 case PARAMETER_TYPE_Choices : return( "choices" );
131
132 case PARAMETER_TYPE_String : return( "text" );
133 case PARAMETER_TYPE_Text : return( "long_text" );
134 case PARAMETER_TYPE_FilePath : return( "file" );
135
136 case PARAMETER_TYPE_Font : return( "font" );
137 case PARAMETER_TYPE_Color : return( "color" );
138 case PARAMETER_TYPE_Colors : return( "colors" );
139 case PARAMETER_TYPE_FixedTable : return( "static_table" );
140 case PARAMETER_TYPE_Grid_System : return( "grid_system" );
141 case PARAMETER_TYPE_Table_Field : return( "table_field" );
142 case PARAMETER_TYPE_Table_Fields : return( "table_fields" );
143
144 case PARAMETER_TYPE_DataObject_Output: return( "data_object" );
145 case PARAMETER_TYPE_Grid : return( "grid" );
146 case PARAMETER_TYPE_Grids : return( "grids" );
147 case PARAMETER_TYPE_Table : return( "table" );
148 case PARAMETER_TYPE_Shapes : return( "shapes" );
149 case PARAMETER_TYPE_TIN : return( "tin" );
150 case PARAMETER_TYPE_PointCloud : return( "points" );
151
152 case PARAMETER_TYPE_Grid_List : return( "grid_list" );
153 case PARAMETER_TYPE_Grids_List : return( "grids_list" );
154 case PARAMETER_TYPE_Table_List : return( "table_list" );
155 case PARAMETER_TYPE_Shapes_List : return( "shapes_list" );
156 case PARAMETER_TYPE_TIN_List : return( "tin_list" );
157 case PARAMETER_TYPE_PointCloud_List : return( "points_list" );
158
159 case PARAMETER_TYPE_Parameters : return( "parameters" );
160 }
161 }
162
163 //---------------------------------------------------------
164 TSG_Parameter_Type SG_Parameter_Type_Get_Type(const CSG_String &Identifier)
165 {
166 if( !Identifier.Cmp("node" ) ) { return( PARAMETER_TYPE_Node ); }
167 if( !Identifier.Cmp("boolean" ) ) { return( PARAMETER_TYPE_Bool ); }
168 if( !Identifier.Cmp("integer" ) ) { return( PARAMETER_TYPE_Int ); }
169 if( !Identifier.Cmp("double" ) ) { return( PARAMETER_TYPE_Double ); }
170 if( !Identifier.Cmp("degree" ) ) { return( PARAMETER_TYPE_Degree ); }
171 if( !Identifier.Cmp("date" ) ) { return( PARAMETER_TYPE_Date ); }
172 if( !Identifier.Cmp("range" ) ) { return( PARAMETER_TYPE_Range ); }
173 if( !Identifier.Cmp("datatype" ) ) { return( PARAMETER_TYPE_Data_Type ); }
174 if( !Identifier.Cmp("choice" ) ) { return( PARAMETER_TYPE_Choice ); }
175 if( !Identifier.Cmp("choices" ) ) { return( PARAMETER_TYPE_Choices ); }
176
177 if( !Identifier.Cmp("text" ) ) { return( PARAMETER_TYPE_String ); }
178 if( !Identifier.Cmp("long_text" ) ) { return( PARAMETER_TYPE_Text ); }
179 if( !Identifier.Cmp("file" ) ) { return( PARAMETER_TYPE_FilePath ); }
180
181 if( !Identifier.Cmp("font" ) ) { return( PARAMETER_TYPE_Font ); }
182 if( !Identifier.Cmp("color" ) ) { return( PARAMETER_TYPE_Color ); }
183 if( !Identifier.Cmp("colors" ) ) { return( PARAMETER_TYPE_Colors ); }
184 if( !Identifier.Cmp("static_table") ) { return( PARAMETER_TYPE_FixedTable ); }
185 if( !Identifier.Cmp("grid_system" ) ) { return( PARAMETER_TYPE_Grid_System ); }
186 if( !Identifier.Cmp("table_field" ) ) { return( PARAMETER_TYPE_Table_Field ); }
187 if( !Identifier.Cmp("table_fields") ) { return( PARAMETER_TYPE_Table_Fields ); }
188
189 if( !Identifier.Cmp("data_object" ) ) { return( PARAMETER_TYPE_DataObject_Output); }
190 if( !Identifier.Cmp("grid" ) ) { return( PARAMETER_TYPE_Grid ); }
191 if( !Identifier.Cmp("grids" ) ) { return( PARAMETER_TYPE_Grids ); }
192 if( !Identifier.Cmp("table" ) ) { return( PARAMETER_TYPE_Table ); }
193 if( !Identifier.Cmp("shapes" ) ) { return( PARAMETER_TYPE_Shapes ); }
194 if( !Identifier.Cmp("tin" ) ) { return( PARAMETER_TYPE_TIN ); }
195 if( !Identifier.Cmp("points" ) ) { return( PARAMETER_TYPE_PointCloud ); }
196
197 if( !Identifier.Cmp("grid_list" ) ) { return( PARAMETER_TYPE_Grid_List ); }
198 if( !Identifier.Cmp("grids_list" ) ) { return( PARAMETER_TYPE_Grids_List ); }
199 if( !Identifier.Cmp("table_list" ) ) { return( PARAMETER_TYPE_Table_List ); }
200 if( !Identifier.Cmp("shapes_list" ) ) { return( PARAMETER_TYPE_Shapes_List ); }
201 if( !Identifier.Cmp("tin_list" ) ) { return( PARAMETER_TYPE_TIN_List ); }
202 if( !Identifier.Cmp("points_list" ) ) { return( PARAMETER_TYPE_PointCloud_List ); }
203
204 if( !Identifier.Cmp("parameters" ) ) { return( PARAMETER_TYPE_Parameters ); }
205
206 return( PARAMETER_TYPE_Undefined );
207 }
208
209
211 // //
212 // Node //
213 // //
215
216 //---------------------------------------------------------
217 CSG_Parameter_Node::CSG_Parameter_Node(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
218 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
219 {
220 // nop
221 }
222
223
225 // //
226 // Bool //
227 // //
229
230 //---------------------------------------------------------
231 CSG_Parameter_Bool::CSG_Parameter_Bool(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
232 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
233 {
234 m_Value = false;
235 }
236
237 //---------------------------------------------------------
238 bool CSG_Parameter_Bool::is_Default(void) const
239 {
240 return( m_Value == (Get_Default().asInt() != 0) );
241 }
242
243 //---------------------------------------------------------
244 bool CSG_Parameter_Bool::Toggle_Value(void)
245 {
246 return( Set_Value(asBool() ? 0 : 1) );
247 }
248
249 //---------------------------------------------------------
250 int CSG_Parameter_Bool::_Set_Value(int Value)
251 {
252 bool bValue = Value != 0;
253
254 if( m_Value != bValue )
255 {
256 m_Value = bValue;
257
258 return( SG_PARAMETER_DATA_SET_CHANGED );
259 }
260
261 return( SG_PARAMETER_DATA_SET_TRUE );
262 }
263
264 int CSG_Parameter_Bool::_Set_Value(double Value)
265 {
266 return( _Set_Value((int)Value) );
267 }
268
269 int CSG_Parameter_Bool::_Set_Value(const CSG_String &Value)
270 {
271 if( !Value.CmpNoCase(_TL("true" )) || !Value.CmpNoCase(_TL("yes")) )
272 {
273 return( _Set_Value(1) );
274 }
275
276 if( !Value.CmpNoCase(_TL("false")) || !Value.CmpNoCase(_TL("no" )) )
277 {
278 return( _Set_Value(0) );
279 }
280
281 int i;
282
283 if( Value.asInt(i) )
284 {
285 return( _Set_Value(i) );
286 }
287
288 return( SG_PARAMETER_DATA_SET_FALSE );
289 }
290
291 //---------------------------------------------------------
292 void CSG_Parameter_Bool::_Set_String(void)
293 {
294 m_String = m_Value ? _TL("true") : _TL("false");
295 }
296
297 //---------------------------------------------------------
298 bool CSG_Parameter_Bool::_Assign(CSG_Parameter *pSource)
299 {
300 m_Value = pSource->asBool();
301
302 return( true );
303 }
304
305 //---------------------------------------------------------
306 bool CSG_Parameter_Bool::_Serialize(CSG_MetaData &Entry, bool bSave)
307 {
308 if( bSave )
309 {
310 Entry.Set_Content(m_Value ? "true" : "false");
311 }
312 else
313 {
314 m_Value = Entry.Cmp_Content("true", true);
315 }
316
317 return( true );
318 }
319
320
322 // //
323 // Value //
324 // //
326
327 //---------------------------------------------------------
328 CSG_Parameter_Value::CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
329 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
330 {
331 m_Minimum = 0.;
332 m_bMinimum = false;
333
334 m_Maximum = 0.;
335 m_bMaximum = false;
336 }
337
338 //---------------------------------------------------------
339 bool CSG_Parameter_Value::Set_Valid_Range(double Minimum, double Maximum)
340 {
341 if( m_bMinimum && m_bMaximum && Minimum > Maximum )
342 {
343 m_Minimum = Maximum;
344 m_Maximum = Minimum;
345 }
346 else
347 {
348 m_Minimum = Minimum;
349 m_Maximum = Maximum;
350 }
351
352 int Result;
353
354 switch( Get_Type() )
355 {
356 case PARAMETER_TYPE_Double:
357 case PARAMETER_TYPE_Degree: Result = _Set_Value(asDouble()); break;
358 case PARAMETER_TYPE_Int : Result = _Set_Value(asInt ()); break;
359 default : return( false );
360 }
361
362 if( Result == SG_PARAMETER_DATA_SET_CHANGED )
363 {
364 has_Changed();
365 }
366
367 return( Result != SG_PARAMETER_DATA_SET_FALSE );
368 }
369
370 //---------------------------------------------------------
371 void CSG_Parameter_Value::Set_Minimum(double Minimum, bool bOn)
372 {
373 if( bOn == false )
374 {
375 m_bMinimum = false;
376 }
377 else
378 {
379 m_bMinimum = true;
380
381 if( m_bMaximum && m_Maximum < Minimum )
382 {
383 m_Maximum = Minimum;
384 }
385
386 Set_Valid_Range(Minimum, m_Maximum);
387 }
388 }
389
390 //---------------------------------------------------------
391 void CSG_Parameter_Value::Set_Maximum(double Maximum, bool bOn)
392 {
393 if( bOn == false )
394 {
395 m_bMaximum = false;
396 }
397 else
398 {
399 m_bMaximum = true;
400
401 if( m_bMinimum && m_Minimum > Maximum )
402 {
403 m_Minimum = Maximum;
404 }
405
406 Set_Valid_Range(m_Minimum, Maximum);
407 }
408 }
409
410 //---------------------------------------------------------
411 bool CSG_Parameter_Value::_Assign(CSG_Parameter *pSource)
412 {
413 m_Minimum = pSource->asValue()->m_Minimum;
414 m_bMinimum = pSource->asValue()->m_bMinimum;
415
416 m_Maximum = pSource->asValue()->m_Maximum;
417 m_bMaximum = pSource->asValue()->m_bMaximum;
418
419 return( true );
420 }
421
422
424 // //
425 // Int //
426 // //
428
429 //---------------------------------------------------------
430 CSG_Parameter_Int::CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
431 : CSG_Parameter_Value(pOwner, pParent, ID, Name, Description, Constraint)
432 {
433 m_Value = 0;
434 }
435
436 //---------------------------------------------------------
437 bool CSG_Parameter_Int::is_Default(void) const
438 {
439 return( m_Value == Get_Default().asInt() );
440 }
441
442 //---------------------------------------------------------
443 int CSG_Parameter_Int::_Set_Value(int Value)
444 {
445 if( m_bMinimum && Value < (int)m_Minimum )
446 {
447 return( _Set_Value((int)m_Minimum) );
448 }
449
450 if( m_bMaximum && Value > (int)m_Maximum )
451 {
452 return( _Set_Value((int)m_Maximum) );
453 }
454
455 if( m_Value != Value )
456 {
457 m_Value = Value;
458
459 return( SG_PARAMETER_DATA_SET_CHANGED );
460 }
461
462 return( SG_PARAMETER_DATA_SET_TRUE );
463 }
464
465 int CSG_Parameter_Int::_Set_Value(double Value)
466 {
467 return( _Set_Value((int)Value) );
468 }
469
470 int CSG_Parameter_Int::_Set_Value(const CSG_String &Value)
471 {
472 int i;
473
474 if( Value.asInt(i) )
475 {
476 return( _Set_Value(i) );
477 }
478
479 return( SG_PARAMETER_DATA_SET_FALSE );
480 }
481
482 //---------------------------------------------------------
483 void CSG_Parameter_Int::_Set_String(void)
484 {
485 m_String.Printf("%d", m_Value);
486 }
487
488 //---------------------------------------------------------
489 bool CSG_Parameter_Int::_Assign(CSG_Parameter *pSource)
490 {
491 CSG_Parameter_Value::_Assign(pSource);
492
493 return( _Set_Value(((CSG_Parameter_Value *)pSource)->asInt()) != 0 );
494 }
495
496 //---------------------------------------------------------
497 bool CSG_Parameter_Int::_Serialize(CSG_MetaData &Entry, bool bSave)
498 {
499 if( bSave )
500 {
501 Entry.Set_Content(asString());
502 }
503 else
504 {
505 return( Entry.Get_Content().asInt(m_Value) );
506 }
507
508 return( true );
509 }
510
511
513 // //
514 // Double //
515 // //
517
518 //---------------------------------------------------------
519 CSG_Parameter_Double::CSG_Parameter_Double(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
520 : CSG_Parameter_Value(pOwner, pParent, ID, Name, Description, Constraint)
521 {
522 m_Value = 0.;
523 }
524
525 //---------------------------------------------------------
526 bool CSG_Parameter_Double::is_Default(void) const
527 {
528 return( m_Value == Get_Default().asDouble() );
529 }
530
531 //---------------------------------------------------------
532 int CSG_Parameter_Double::_Set_Value(int Value)
533 {
534 return( _Set_Value((double)Value) );
535 }
536
537 int CSG_Parameter_Double::_Set_Value(double Value)
538 {
539 if( m_bMinimum && Value < m_Minimum )
540 {
541 return( _Set_Value(m_Minimum) );
542 }
543
544 if( m_bMaximum && Value > m_Maximum )
545 {
546 return( _Set_Value(m_Maximum) );
547 }
548
549 if( m_Value != Value )
550 {
551 m_Value = Value;
552
553 return( SG_PARAMETER_DATA_SET_CHANGED );
554 }
555
556 return( SG_PARAMETER_DATA_SET_TRUE );
557 }
558
559 int CSG_Parameter_Double::_Set_Value(const CSG_String &Value)
560 {
561 double d;
562
563 if( Value.asDouble(d) )
564 {
565 return( _Set_Value(d) );
566 }
567
568 return( SG_PARAMETER_DATA_SET_FALSE );
569 }
570
571 //---------------------------------------------------------
572 void CSG_Parameter_Double::_Set_String(void)
573 {
574 m_String.Printf("%.*f", SG_Get_Significant_Decimals(m_Value, 16), m_Value);
575 }
576
577 //---------------------------------------------------------
578 bool CSG_Parameter_Double::_Assign(CSG_Parameter *pSource)
579 {
580 CSG_Parameter_Value::_Assign(pSource);
581
582 return( _Set_Value(pSource->asDouble()) != 0 );
583 }
584
585 //---------------------------------------------------------
586 bool CSG_Parameter_Double::_Serialize(CSG_MetaData &Entry, bool bSave)
587 {
588 if( bSave )
589 {
590 Entry.Fmt_Content("%.*f", SG_Get_Significant_Decimals(m_Value, 16), m_Value);
591 }
592 else
593 {
594 return( Entry.Get_Content().asDouble(m_Value) );
595 }
596
597 return( true );
598 }
599
600
602 // //
603 // Degree //
604 // //
606
607 //---------------------------------------------------------
608 CSG_Parameter_Degree::CSG_Parameter_Degree(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
609 : CSG_Parameter_Double(pOwner, pParent, ID, Name, Description, Constraint)
610 {
611 // nop
612 }
613
614 //---------------------------------------------------------
615 int CSG_Parameter_Degree::_Set_Value(const CSG_String &Value)
616 {
617 return( CSG_Parameter_Double::_Set_Value(SG_Degree_To_Double(Value)) );
618 }
619
620 //---------------------------------------------------------
621 void CSG_Parameter_Degree::_Set_String(void)
622 {
623 m_String = SG_Double_To_Degree(asDouble());
624 }
625
626
628 // //
629 // Date //
630 // //
632
633 //---------------------------------------------------------
634 CSG_Parameter_Date::CSG_Parameter_Date(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
635 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
636 {
637 _Set_Value(CSG_DateTime::Now().Get_JDN());
638 }
639
640 //---------------------------------------------------------
641 int CSG_Parameter_Date::_Set_Value(int Value)
642 {
643 return( _Set_Value((double)Value) );
644 }
645
646 int CSG_Parameter_Date::_Set_Value(double Value)
647 {
648 Value = 0.5 + floor(Value); // always adjust to high noon, prevents rounding problems (we're not intested in time, just date!)
649
650 if( Value != asDouble() )
651 {
652 m_Date.Set(Value);
653
654 return( SG_PARAMETER_DATA_SET_CHANGED );
655 }
656
657 return( SG_PARAMETER_DATA_SET_TRUE );
658 }
659
660 int CSG_Parameter_Date::_Set_Value(const CSG_String &Value)
661 {
662 CSG_DateTime Date;
663
664 if( Date.Parse_ISODate(Value) )
665 {
666 if( !m_Date.is_EqualTo(Date) )
667 {
668 m_Date.Set(Date);
669
670 return( SG_PARAMETER_DATA_SET_CHANGED );
671 }
672
673 return( SG_PARAMETER_DATA_SET_TRUE );
674 }
675
676 if( Date.Parse_Date(Value) )
677 {
678 if( !m_Date.is_EqualTo(Date) )
679 {
680 m_Date.Set(Date);
681
682 return( SG_PARAMETER_DATA_SET_CHANGED );
683 }
684
685 return( SG_PARAMETER_DATA_SET_TRUE );
686 }
687
688 return( SG_PARAMETER_DATA_SET_FALSE );
689 }
690
691 //---------------------------------------------------------
692 void CSG_Parameter_Date::_Set_String(void)
693 {
694 m_String = m_Date.Format_ISODate();
695 }
696
697 //---------------------------------------------------------
698 int CSG_Parameter_Date::_asInt(void) const
699 {
700 return( (int)asDouble() );
701 }
702
703 //---------------------------------------------------------
704 double CSG_Parameter_Date::_asDouble(void) const
705 {
706 return( m_Date.Get_JDN() );
707 }
708
709 //---------------------------------------------------------
710 void CSG_Parameter_Date::Set_Date(const CSG_DateTime &Date)
711 {
712 m_Date = Date;
713 }
714
715 //---------------------------------------------------------
716 bool CSG_Parameter_Date::_Assign(CSG_Parameter *pSource)
717 {
718 m_Date = ((CSG_Parameter_Date *)pSource)->m_Date;
719
720 return( true );
721 }
722
723 //---------------------------------------------------------
724 bool CSG_Parameter_Date::_Serialize(CSG_MetaData &Entry, bool bSave)
725 {
726 if( bSave )
727 {
728 Entry.Set_Content(asString());
729 }
730 else
731 {
732 _Set_Value(Entry.Get_Content());
733 }
734
735 return( true );
736 }
737
738
740 // //
741 // Range //
742 // //
744
745 //---------------------------------------------------------
746 CSG_Parameter_Range::CSG_Parameter_Range(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
747 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
748 {
749 m_pRange = new CSG_Parameters;
750
751 if( is_Information() )
752 {
753 m_pMin = (CSG_Parameter_Double *)m_pRange->Add_Info_Value(ID, "MIN", "Minimum", Description, PARAMETER_TYPE_Double);
754 m_pMax = (CSG_Parameter_Double *)m_pRange->Add_Info_Value(ID, "MAX", "Maximum", Description, PARAMETER_TYPE_Double);
755 }
756 else
757 {
758 m_pMin = (CSG_Parameter_Double *)m_pRange->Add_Double (ID, "MIN", "Minimum", Description);
759 m_pMax = (CSG_Parameter_Double *)m_pRange->Add_Double (ID, "MAX", "Maximum", Description);
760 }
761 }
762
763 CSG_Parameter_Range::~CSG_Parameter_Range(void)
764 {
765 delete(m_pRange);
766 }
767
768 //---------------------------------------------------------
769 void CSG_Parameter_Range::_Set_String(void)
770 {
771 m_String.Printf("%.*f; %.*f",
772 SG_Get_Significant_Decimals(Get_Min(), 16), Get_Min(),
773 SG_Get_Significant_Decimals(Get_Min(), 16), Get_Max()
774 );
775 }
776
777 //---------------------------------------------------------
778 int CSG_Parameter_Range::_Set_Value(const CSG_String &Value)
779 {
780 return( Set_Range(Value.BeforeFirst(';').asDouble(), Value.AfterFirst(';').asDouble()) ? SG_PARAMETER_DATA_SET_CHANGED : SG_PARAMETER_DATA_SET_FALSE );
781 }
782
783 bool CSG_Parameter_Range::Set_Range(double Min, double Max)
784 {
785 bool bResult;
786
787 if( Min > Max )
788 {
789 bResult = m_pMin->Set_Value(Max);
790 bResult |= m_pMax->Set_Value(Min);
791 }
792 else
793 {
794 bResult = m_pMin->Set_Value(Min);
795 bResult |= m_pMax->Set_Value(Max);
796 }
797
798 return( bResult );
799 }
800
801 //---------------------------------------------------------
802 bool CSG_Parameter_Range::Set_Min(double Value)
803 {
804 if( m_pMin->Set_Value(Value) )
805 {
806 has_Changed();
807
808 return( true );
809 }
810
811 return( false );
812 }
813
814 double CSG_Parameter_Range::Get_Min(void) const
815 {
816 return( m_pMin->asDouble() );
817 }
818
819 //---------------------------------------------------------
820 bool CSG_Parameter_Range::Set_Max(double Value)
821 {
822 if( m_pMax->Set_Value(Value) )
823 {
824 has_Changed();
825
826 return( true );
827 }
828
829 return( false );
830 }
831
832 double CSG_Parameter_Range::Get_Max(void) const
833 {
834 return( m_pMax->asDouble() );
835 }
836
837 //---------------------------------------------------------
838 bool CSG_Parameter_Range::is_Default(void) const
839 {
840 return( m_pMin->is_Default() && m_pMax->is_Default() );
841 }
842
843 //---------------------------------------------------------
844 bool CSG_Parameter_Range::Restore_Default(void)
845 {
846 return( m_pMin->Restore_Default() && m_pMax->Restore_Default() );
847 }
848
849 //---------------------------------------------------------
850 bool CSG_Parameter_Range::_Assign(CSG_Parameter *pSource)
851 {
852 m_pMin->Assign(pSource->asRange()->m_pMin);
853 m_pMax->Assign(pSource->asRange()->m_pMax);
854
855 return( true );
856 }
857
858 //---------------------------------------------------------
859 bool CSG_Parameter_Range::_Serialize(CSG_MetaData &Entry, bool bSave)
860 {
861 if( bSave )
862 {
863 Entry.Fmt_Content("%.*f; %.*f",
864 SG_Get_Significant_Decimals(Get_Min(), 16), Get_Min(),
865 SG_Get_Significant_Decimals(Get_Min(), 16), Get_Max()
866 );
867
868 return( true );
869 }
870 else
871 {
872 CSG_String s(Entry.Get_Content()); double Min, Max;
873
874 if( s.BeforeFirst(';').asDouble(Min) && s.AfterFirst(';').asDouble(Max) )
875 {
876 return( Set_Range(Min, Max) );
877 }
878 }
879
880 return( false );
881 }
882
883
885 // //
886 // Choice //
887 // //
889
890 //---------------------------------------------------------
891 CSG_Parameter_Choice::CSG_Parameter_Choice(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
892 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
893 {
894 m_Value = -1;
895 }
896
897 //---------------------------------------------------------
898 bool CSG_Parameter_Choice::is_Default(void) const
899 {
900 return( m_Value == Get_Default().asInt() );
901 }
902
903 //---------------------------------------------------------
904 bool CSG_Parameter_Choice::Toggle_Value(void)
905 {
906 return( Get_Count() > 1 && Set_Value((asInt() + 1) % Get_Count()) );
907 }
908
909 //---------------------------------------------------------
910 bool CSG_Parameter_Choice::Del_Items(void)
911 {
912 m_Items.Clear(); m_Data.Clear();
913
914 return( true );
915 }
916
917 //---------------------------------------------------------
918 bool CSG_Parameter_Choice::Add_Item(const CSG_String &Item, const CSG_String &Data)
919 {
920 if( !Item.is_Empty() )
921 {
922 m_Items.Add(Item);
923 m_Data .Add(Data);
924
925 _Set_String(); // items have changed
926
927 return( true );
928 }
929
930 return( false );
931 }
932
933 //---------------------------------------------------------
934 bool CSG_Parameter_Choice::Set_Items(const SG_Char *String)
935 {
936 m_Items.Clear(); m_Data.Clear();
937
938 if( String && *String != '\0' )
939 {
940 CSG_Strings Items(SG_String_Tokenize(String, "|"));
941
942 for(int i=0; i<Items.Get_Count(); i++)
943 {
944 if( Items[i].Find('{') == 0 && Items[i].Find('}') > 0 ) // data entry within leading curly brackets: '{data} item text'
945 {
946 CSG_String Data(Items[i].AfterFirst('{').BeforeFirst('}'));
947 CSG_String Item(Items[i].AfterFirst('}')); Item.Trim();
948
949 Add_Item(Item, Data);
950 }
951 else
952 {
953 Add_Item(Items[i]);
954 }
955 }
956 }
957
958 if( m_Value < 0 && m_Items.Get_Count() > 0 )
959 {
960 m_Value = 0;
961 }
962
963 if( m_Value >= m_Items.Get_Count() )
964 {
965 m_Value = m_Items.Get_Count() - 1;
966 }
967
968 _Set_String(); // items have changed
969
970 return( Get_Count() > 0 );
971 }
972
973 //---------------------------------------------------------
974 CSG_String CSG_Parameter_Choice::Get_Items(void) const
975 {
976 CSG_String Items;
977
978 for(int i=0; i<Get_Count(); i++)
979 {
980 if( i > 0 )
981 {
982 Items += "|";
983 }
984
985 Items += m_Items[i];
986 }
987
988 return( Items );
989 }
990
991 //---------------------------------------------------------
992 const SG_Char * CSG_Parameter_Choice::Get_Item(int Index) const
993 {
994 if( Index >= 0 && Index < Get_Count() )
995 {
996 return( m_Items[Index] );
997 }
998
999 return( NULL );
1000 }
1001
1002 //---------------------------------------------------------
1003 CSG_String CSG_Parameter_Choice::Get_Item_Data(int Index) const
1004 {
1005 if( Index >= 0 && Index < Get_Count() )
1006 {
1007 return( m_Data[Index] );
1008 }
1009
1010 return( "" );
1011 }
1012
1013 CSG_String CSG_Parameter_Choice::Get_Data(void) const
1014 {
1015 return( Get_Item_Data(m_Value) );
1016 }
1017
1018 bool CSG_Parameter_Choice::Get_Data(CSG_String &Value) const
1019 {
1020 Value = Get_Item_Data(m_Value);
1021
1022 return( !Value.is_Empty() );
1023 }
1024
1025 bool CSG_Parameter_Choice::Get_Data(int &Value) const
1026 {
1027 CSG_String String;
1028
1029 return( Get_Data(String) && String.asInt(Value) );
1030 }
1031
1032 bool CSG_Parameter_Choice::Get_Data(double &Value) const
1033 {
1034 CSG_String String;
1035
1036 return( Get_Data(String) && String.asDouble(Value) );
1037 }
1038
1039 //---------------------------------------------------------
1040 int CSG_Parameter_Choice::_Set_Value(int Value)
1041 {
1042 if( Value >= 0 && Value < m_Items.Get_Count() )
1043 {
1044 if( m_Value != Value )
1045 {
1046 m_Value = Value;
1047
1048 return( SG_PARAMETER_DATA_SET_CHANGED );
1049 }
1050
1051 return( SG_PARAMETER_DATA_SET_TRUE );
1052 }
1053
1054 return( SG_PARAMETER_DATA_SET_FALSE );
1055 }
1056
1057 //---------------------------------------------------------
1058 int CSG_Parameter_Choice::_Set_Value(double Value)
1059 {
1060 return( _Set_Value((int)Value) );
1061 }
1062
1063 //---------------------------------------------------------
1064 int CSG_Parameter_Choice::_Set_Value(const CSG_String &Value)
1065 {
1066 if( !Value.is_Empty() )
1067 {
1068 for(int i=0; i<m_Items.Get_Count(); i++)
1069 {
1070 if( !Value.Cmp(Get_Item_Data(i)) || !Value.Cmp(Get_Item(i)) )
1071 {
1072 return( _Set_Value(i) );
1073 }
1074 }
1075
1076 int Index; // choice not found? then test, if value string is an integer specifying the index position
1077
1078 if( Value.asInt(Index) && Index >= 0 && Index < m_Items.Get_Count() )
1079 {
1080 return( _Set_Value(Index) );
1081 }
1082
1083 }
1084
1085 return( SG_PARAMETER_DATA_SET_FALSE );
1086 }
1087
1088 //---------------------------------------------------------
1089 void CSG_Parameter_Choice::_Set_String(void)
1090 {
1091 m_String = m_Value >= 0 && m_Value < Get_Count() ? Get_Item(m_Value) : _TL("<no choice available>");
1092 }
1093
1094 //---------------------------------------------------------
1095 bool CSG_Parameter_Choice::_Assign(CSG_Parameter *pSource)
1096 {
1097 m_Items = pSource->asChoice()->m_Items;
1098 m_Data = pSource->asChoice()->m_Data ;
1099 m_Value = pSource->asChoice()->m_Value;
1100
1101 _Set_String(); // items have changed
1102
1103 return( true );
1104 }
1105
1106 //---------------------------------------------------------
1107 bool CSG_Parameter_Choice::_Serialize(CSG_MetaData &Entry, bool bSave)
1108 {
1109 if( bSave )
1110 {
1111 Entry.Add_Property("index", m_Value);
1112
1113 Entry.Set_Content(asString());
1114
1115 return( true );
1116 }
1117 else
1118 {
1119 int Index;
1120
1121 return( (Entry.Get_Property("index", Index) || Entry.Get_Content().asInt(Index)) && _Set_Value(Index) );
1122 }
1123 }
1124
1125
1127 // //
1128 // Data Type //
1129 // //
1131
1132 //---------------------------------------------------------
1133 CSG_Parameter_Data_Type::CSG_Parameter_Data_Type(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1134 : CSG_Parameter_Choice(pOwner, pParent, ID, Name, Description, Constraint)
1135 {
1136 // nop
1137 }
1138
1139 //---------------------------------------------------------
1148 //---------------------------------------------------------
1149 bool CSG_Parameter_Data_Type::Set_Data_Types(int Data_Types, TSG_Data_Type Default, const CSG_String &User)
1150 {
1151 if( Data_Types <= SG_DATATYPES_Undefined )
1152 {
1153 Data_Types = SG_DATATYPES_Standard;
1154 }
1155
1156 if( Default == SG_DATATYPE_Undefined && User.is_Empty() )
1157 {
1158 switch( Data_Types )
1159 {
1160 case (SG_DATATYPES_Integer ): Default = SG_DATATYPE_Int ; break;
1161 case (SG_DATATYPES_Integer|SG_DATATYPES_Bit): Default = SG_DATATYPE_Int ; break;
1162 case (SG_DATATYPES_Numeric ): Default = SG_DATATYPE_Float ; break;
1163 case (SG_DATATYPES_Numeric|SG_DATATYPES_Bit): Default = SG_DATATYPE_Float ; break;
1164 case (SG_DATATYPES_Table ): Default = SG_DATATYPE_String; break;
1165 case (SG_DATATYPES_Standard ): Default = SG_DATATYPE_String; break;
1166 }
1167 }
1168
1169 #define ADD_TYPE(type) if( (Data_Types & SG_Data_Type_Get_Flag(type)) != 0 ) { if( Default == type ) { _Default = Get_Count(); } Add_Item(SG_Data_Type_Get_Name(type), SG_Data_Type_Get_Identifier(type)); }
1170
1171 int _Default = -1;
1172
1173 ADD_TYPE(SG_DATATYPE_String); // data types are added in this order to the choice item list
1174 ADD_TYPE(SG_DATATYPE_Date );
1175 ADD_TYPE(SG_DATATYPE_Color );
1176 ADD_TYPE(SG_DATATYPE_Bit );
1177 ADD_TYPE(SG_DATATYPE_Byte );
1178 ADD_TYPE(SG_DATATYPE_Char );
1179 ADD_TYPE(SG_DATATYPE_Word );
1180 ADD_TYPE(SG_DATATYPE_Short );
1181 ADD_TYPE(SG_DATATYPE_DWord );
1182 ADD_TYPE(SG_DATATYPE_Int );
1183 ADD_TYPE(SG_DATATYPE_ULong );
1184 ADD_TYPE(SG_DATATYPE_Long );
1185 ADD_TYPE(SG_DATATYPE_Float );
1186 ADD_TYPE(SG_DATATYPE_Double);
1187 ADD_TYPE(SG_DATATYPE_Binary);
1188
1189 if( !User.is_Empty() )
1190 {
1191 if( _Default < 0 )
1192 {
1193 _Default = Get_Count();
1194 }
1195
1196 Add_Item(User, SG_Data_Type_Get_Identifier(SG_DATATYPE_Undefined));
1197 }
1198 else if( _Default < 0 )
1199 {
1200 _Default = 0;
1201 }
1202
1203 Set_Default(_Default); Set_Value(_Default);
1204
1205 return( true );
1206 }
1207
1208 //---------------------------------------------------------
1215 //---------------------------------------------------------
1216 bool CSG_Parameter_Data_Type::Set_Data_Type(TSG_Data_Type Value)
1217 {
1218 for(int i=0; i<Get_Count(); i++)
1219 {
1220 if( Value == SG_Data_Type_Get_Type(Get_Item_Data(i)) )
1221 {
1222 return( Set_Value(i) );
1223 }
1224 }
1225
1226 return( false );
1227 }
1228
1229 //---------------------------------------------------------
1237 //---------------------------------------------------------
1238 TSG_Data_Type CSG_Parameter_Data_Type::Get_Data_Type(TSG_Data_Type Default) const
1239 {
1240 TSG_Data_Type Type = SG_Data_Type_Get_Type(Get_Data());
1241
1242 return( Type == SG_DATATYPE_Undefined ? Default : Type );
1243 }
1244
1245 //---------------------------------------------------------
1246 bool CSG_Parameter_Data_Type::_Assign(CSG_Parameter *pSource)
1247 {
1248 return( CSG_Parameter_Choice::_Assign(pSource) );
1249 }
1250
1251 //---------------------------------------------------------
1252 bool CSG_Parameter_Data_Type::_Serialize(CSG_MetaData &Entry, bool bSave)
1253 {
1254 return( CSG_Parameter_Choice::_Serialize(Entry, bSave) );
1255 }
1256
1257
1259 // //
1260 // Choices //
1261 // //
1263
1264 //---------------------------------------------------------
1265 CSG_Parameter_Choices::CSG_Parameter_Choices(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1266 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1267 {
1268 // nop
1269 }
1270
1271 //---------------------------------------------------------
1272 int CSG_Parameter_Choices::_Set_Value(const CSG_String &Value)
1273 {
1274 CSG_String_Tokenizer Tokens(Value, ";");
1275
1276 m_Selection.Destroy();
1277
1278 while( Tokens.Has_More_Tokens() )
1279 {
1280 int Index;
1281
1282 if( Tokens.Get_Next_Token().asInt(Index) )
1283 {
1284 Select(Index);
1285 }
1286 }
1287
1288 return( SG_PARAMETER_DATA_SET_CHANGED );
1289 }
1290
1291 //---------------------------------------------------------
1292 void CSG_Parameter_Choices::_Set_String(void)
1293 {
1294 m_String.Clear();
1295
1296 for(size_t i=0; i<m_Selection.Get_uSize(); i++)
1297 {
1298 m_String += CSG_String::Format("%d;", m_Selection[i]);
1299 }
1300 }
1301
1302 //---------------------------------------------------------
1303 void CSG_Parameter_Choices::Set_Items(const CSG_String &Items)
1304 {
1305 Del_Items();
1306
1307 CSG_String_Tokenizer Tokens(Items, "|");
1308
1309 while( Tokens.Has_More_Tokens() )
1310 {
1311 Add_Item(Tokens.Get_Next_Token());
1312 }
1313 }
1314
1315 //---------------------------------------------------------
1316 void CSG_Parameter_Choices::Set_Items(const CSG_Strings &Items)
1317 {
1318 Del_Items();
1319
1320 for(int i=0; i<Items.Get_Count(); i++)
1321 {
1322 Add_Item(Items[i]);
1323 }
1324 }
1325
1326 //---------------------------------------------------------
1327 CSG_String CSG_Parameter_Choices::Get_Items(void) const
1328 {
1329 CSG_String Items;
1330
1331 for(int i=0; i<m_Items[0].Get_Count(); i++)
1332 {
1333 if( i > 0 )
1334 {
1335 Items += "|";
1336 }
1337
1338 Items += m_Items[0][i];
1339 }
1340
1341 return( Items );
1342 }
1343
1344 //---------------------------------------------------------
1345 void CSG_Parameter_Choices::Del_Items(void)
1346 {
1347 m_Items[0].Clear();
1348 m_Items[1].Clear();
1349
1350 m_Selection.Destroy();
1351 }
1352
1353 //---------------------------------------------------------
1354 void CSG_Parameter_Choices::Add_Item(const CSG_String &Item, const CSG_String &Data)
1355 {
1356 m_Items[0] += Item;
1357 m_Items[1] += Data;
1358 }
1359
1360 //---------------------------------------------------------
1361 bool CSG_Parameter_Choices::is_Selected(int Index)
1362 {
1363 for(size_t i=0; i<m_Selection.Get_uSize(); i++)
1364 {
1365 if( Index == m_Selection[i] )
1366 {
1367 return( true );
1368 }
1369 }
1370
1371 return( false );
1372 }
1373
1374 //---------------------------------------------------------
1375 bool CSG_Parameter_Choices::Select(int Index, bool bSelect)
1376 {
1377 if( Index >= 0 && Index < Get_Item_Count() )
1378 {
1379 if( bSelect && !is_Selected(Index) )
1380 {
1381 m_Selection += Index;
1382 }
1383 else if( !bSelect )
1384 {
1385 for(size_t i=0; i<m_Selection.Get_uSize(); i++)
1386 {
1387 if( Index == m_Selection[i] )
1388 {
1389 for(size_t j=i+1; j<m_Selection.Get_uSize(); i++, j++)
1390 {
1391 m_Selection[i] = m_Selection[j];
1392 }
1393
1394 m_Selection.Dec_Array();
1395 }
1396 }
1397 }
1398
1399 return( true );
1400 }
1401
1402 return( false );
1403 }
1404
1405 //---------------------------------------------------------
1406 bool CSG_Parameter_Choices::Clr_Selection(void)
1407 {
1408 m_Selection.Destroy();
1409
1410 return( true );
1411 }
1412
1413 //---------------------------------------------------------
1414 bool CSG_Parameter_Choices::_Assign(CSG_Parameter *pSource)
1415 {
1416 m_Items[0] = pSource->asChoices()->m_Items[0];
1417 m_Items[1] = pSource->asChoices()->m_Items[1];
1418
1419 m_Selection = pSource->asChoices()->m_Selection;
1420
1421 return( true );
1422 }
1423
1424 //---------------------------------------------------------
1425 bool CSG_Parameter_Choices::_Serialize(CSG_MetaData &Entry, bool bSave)
1426 {
1427 if( bSave )
1428 {
1429 Entry.Set_Content(asString());
1430
1431 return( true );
1432 }
1433 else
1434 {
1435 return( _Set_Value(Entry.Get_Content()) != 0 );
1436 }
1437 }
1438
1439
1441 // //
1442 // String //
1443 // //
1445
1446 //---------------------------------------------------------
1447 CSG_Parameter_String::CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1448 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1449 {
1450 m_bPassword = false;
1451 }
1452
1453 //---------------------------------------------------------
1454 bool CSG_Parameter_String::is_Valid(void) const
1455 {
1456 return( !m_String.is_Empty() );
1457 }
1458
1459 //---------------------------------------------------------
1460 void CSG_Parameter_String::Set_Password(bool bOn)
1461 {
1462 m_bPassword = bOn;
1463 }
1464
1465 //---------------------------------------------------------
1466 bool CSG_Parameter_String::is_Password(void) const
1467 {
1468 return( m_bPassword );
1469 }
1470
1471 //---------------------------------------------------------
1472 int CSG_Parameter_String::_Set_Value(const CSG_String &Value)
1473 {
1474 if( m_String.Cmp(Value) )
1475 {
1476 m_String = Value;
1477
1478 return( SG_PARAMETER_DATA_SET_CHANGED );
1479 }
1480
1481 return( SG_PARAMETER_DATA_SET_TRUE );
1482 }
1483
1484 //---------------------------------------------------------
1485 bool CSG_Parameter_String::_Assign(CSG_Parameter *pSource)
1486 {
1487 m_String = ((CSG_Parameter_String *)pSource)->m_String;
1488 m_bPassword = ((CSG_Parameter_String *)pSource)->m_bPassword;
1489
1490 return( true );
1491 }
1492
1493 //---------------------------------------------------------
1494 bool CSG_Parameter_String::_Serialize(CSG_MetaData &Entry, bool bSave)
1495 {
1496 if( bSave )
1497 {
1498 Entry.Set_Content(m_String);
1499 }
1500 else
1501 {
1502 m_String = Entry.Get_Content();
1503 }
1504
1505 return( true );
1506 }
1507
1508
1510 // //
1511 // Text //
1512 // //
1514
1515 //---------------------------------------------------------
1516 CSG_Parameter_Text::CSG_Parameter_Text(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1517 : CSG_Parameter_String(pOwner, pParent, ID, Name, Description, Constraint)
1518 {
1519 // nop
1520 }
1521
1522
1524 // //
1525 // FilePath //
1526 // //
1528
1529 //---------------------------------------------------------
1530 CSG_Parameter_File_Name::CSG_Parameter_File_Name(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1531 : CSG_Parameter_String(pOwner, pParent, ID, Name, Description, Constraint)
1532 {
1533 m_Filter.Printf("%s|*.*", _TL("All Files"));
1534
1535 m_bSave = false;
1536 m_bMultiple = false;
1537 m_bDirectory = false;
1538 }
1539
1540 //---------------------------------------------------------
1541 void CSG_Parameter_File_Name::Set_Filter(const SG_Char *Filter)
1542 {
1543 if( Filter )
1544 {
1545 m_Filter = Filter;
1546 }
1547 else
1548 {
1549 m_Filter.Printf("%s|*.*", _TL("All Files"));
1550 }
1551 }
1552
1553 const SG_Char * CSG_Parameter_File_Name::Get_Filter(void) const
1554 {
1555 return( m_Filter.c_str() );
1556 }
1557
1558 //---------------------------------------------------------
1559 void CSG_Parameter_File_Name::Set_Flag_Save(bool bFlag)
1560 {
1561 m_bSave = bFlag;
1562 }
1563
1564 void CSG_Parameter_File_Name::Set_Flag_Multiple(bool bFlag)
1565 {
1566 m_bMultiple = bFlag;
1567 }
1568
1569 void CSG_Parameter_File_Name::Set_Flag_Directory(bool bFlag)
1570 {
1571 m_bDirectory = bFlag;
1572 }
1573
1574 //---------------------------------------------------------
1575 bool CSG_Parameter_File_Name::Get_FilePaths(CSG_Strings &FilePaths) const
1576 {
1577 FilePaths.Clear();
1578
1579 if( m_String.Length() > 0 )
1580 {
1581 if( !m_bMultiple )
1582 {
1583 FilePaths.Add(m_String);
1584 }
1585 else if( m_String[0] != '\"' )
1586 {
1587 FilePaths.Add(m_String);
1588 }
1589 else
1590 {
1591 CSG_String s(m_String);
1592
1593 while( s.Length() > 2 )
1594 {
1595 s = s.AfterFirst('\"');
1596 FilePaths.Add(s.BeforeFirst('\"'));
1597 s = s.AfterFirst('\"');
1598 }
1599 }
1600 }
1601
1602 return( FilePaths.Get_Count() > 0 );
1603 }
1604
1605 //---------------------------------------------------------
1606 bool CSG_Parameter_File_Name::_Assign(CSG_Parameter *pSource)
1607 {
1608 CSG_Parameter_String::_Assign(pSource);
1609
1610 Set_Filter(((CSG_Parameter_File_Name *)pSource)->m_Filter.c_str());
1611
1612 m_bSave = pSource->asFilePath()->m_bSave;
1613 m_bMultiple = pSource->asFilePath()->m_bMultiple;
1614 m_bDirectory = pSource->asFilePath()->m_bDirectory;
1615
1616 return( true );
1617 }
1618
1619
1621 // //
1622 // Font //
1623 // //
1625
1626 //---------------------------------------------------------
1627 CSG_Parameter_Font::CSG_Parameter_Font(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1628 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1629 {
1630 Restore_Default();
1631 }
1632
1633 //---------------------------------------------------------
1634 bool CSG_Parameter_Font::Restore_Default(void)
1635 {
1636 m_Color = SG_GET_RGB(0, 0, 0);
1637 #ifdef __WXMAC__
1638 m_String = ".applesystemuifont 11 utf-8";
1639 #else
1640 m_String = "0;-12;0;0;0;400;0;0;0;0;3;2;1;34;Arial";
1641 #endif
1642
1643 return( true );
1644 }
1645
1646 //---------------------------------------------------------
1647 int CSG_Parameter_Font::_Set_Value(int Value)
1648 {
1649 if( m_Color != Value )
1650 {
1651 m_Color = Value;
1652
1653 return( SG_PARAMETER_DATA_SET_CHANGED );
1654 }
1655
1656 return( SG_PARAMETER_DATA_SET_TRUE );
1657 }
1658
1659 //---------------------------------------------------------
1660 int CSG_Parameter_Font::_Set_Value(const CSG_String &Value)
1661 {
1662 if( Value.is_Empty() )
1663 {
1664 Restore_Default();
1665
1666 return( SG_PARAMETER_DATA_SET_CHANGED );
1667 }
1668
1669 m_String = Value;
1670
1671 return( SG_PARAMETER_DATA_SET_CHANGED );
1672 }
1673
1674 //---------------------------------------------------------
1675 int CSG_Parameter_Font::_asInt(void) const
1676 {
1677 return( m_Color );
1678 }
1679
1680 //---------------------------------------------------------
1681 void * CSG_Parameter_Font::_asPointer(void) const
1682 {
1683 return( (void *)m_String.c_str() );
1684 }
1685
1686 //---------------------------------------------------------
1687 bool CSG_Parameter_Font::_Assign(CSG_Parameter *pSource)
1688 {
1689 m_Color = ((CSG_Parameter_Font *)pSource)->m_Color;
1690 m_String = ((CSG_Parameter_Font *)pSource)->m_String;
1691
1692 return( true );
1693 }
1694
1695 //---------------------------------------------------------
1696 bool CSG_Parameter_Font::_Serialize(CSG_MetaData &Entry, bool bSave)
1697 {
1698 if( bSave )
1699 {
1700 Entry.Add_Child("COLOR", CSG_String::Format("R%03d G%03d B%03d",
1701 SG_GET_R(m_Color), SG_GET_G(m_Color), SG_GET_B(m_Color)
1702 ));
1703
1704 Entry.Add_Child("FONT", m_String);
1705 }
1706 else
1707 {
1708 if( Entry("COLOR") != NULL )
1709 {
1710 _Set_Value((int)SG_GET_RGB(
1711 Entry("COLOR")->Get_Content().AfterFirst('R').asInt(),
1712 Entry("COLOR")->Get_Content().AfterFirst('G').asInt(),
1713 Entry("COLOR")->Get_Content().AfterFirst('B').asInt()
1714 ));
1715 }
1716
1717 if( Entry("FONT") != NULL )
1718 {
1719 _Set_Value(Entry("FONT")->Get_Content());
1720 }
1721 }
1722
1723 return( true );
1724 }
1725
1726
1728 // //
1729 // Color //
1730 // //
1732
1733 //---------------------------------------------------------
1734 CSG_Parameter_Color::CSG_Parameter_Color(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1735 : CSG_Parameter_Int(pOwner, pParent, ID, Name, Description, Constraint)
1736 {
1737 // nop
1738 }
1739
1740 //---------------------------------------------------------
1741 int CSG_Parameter_Color::_Set_Value(const CSG_String &Value)
1742 {
1743 long l;
1744
1745 if( SG_Color_From_Text(Value, l) )
1746 {
1747 return( CSG_Parameter_Int::_Set_Value((int)l) );
1748 }
1749
1750 int i;
1751
1752 if( Value.asInt(i) )
1753 {
1754 return( CSG_Parameter_Int::_Set_Value(i) );
1755 }
1756
1757 return( SG_PARAMETER_DATA_SET_FALSE );
1758 }
1759
1760 //---------------------------------------------------------
1761 bool CSG_Parameter_Color::_Serialize(CSG_MetaData &Entry, bool bSave)
1762 {
1763 if( bSave )
1764 {
1765 Entry.Fmt_Content("R%03d G%03d B%03d", SG_GET_R(m_Value), SG_GET_G(m_Value), SG_GET_B(m_Value));
1766 }
1767 else
1768 {
1769 m_Value = SG_GET_RGB(
1770 Entry.Get_Content().AfterFirst('R').asInt(),
1771 Entry.Get_Content().AfterFirst('G').asInt(),
1772 Entry.Get_Content().AfterFirst('B').asInt()
1773 );
1774 }
1775
1776 return( true );
1777 }
1778
1779
1781 // //
1782 // Colors //
1783 // //
1785
1786 //---------------------------------------------------------
1787 CSG_Parameter_Colors::CSG_Parameter_Colors(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1788 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1789 {
1790 // nop
1791 }
1792
1793 //---------------------------------------------------------
1794 int CSG_Parameter_Colors::_Set_Value(int Value)
1795 {
1796 if( Value >= 0 && Value < CSG_Colors::Get_Predefined_Count() )
1797 {
1798 if( m_Colors.Create(m_Colors.Get_Count(), Value) )
1799 {
1800 return( SG_PARAMETER_DATA_SET_CHANGED );
1801 }
1802 }
1803
1804 return( SG_PARAMETER_DATA_SET_FALSE );
1805 }
1806
1807 //---------------------------------------------------------
1808 void CSG_Parameter_Colors::_Set_String(void)
1809 {
1810 m_String.Printf("%d %s", m_Colors.Get_Count(), _TL("colors"));
1811 }
1812
1813 //---------------------------------------------------------
1814 int CSG_Parameter_Colors::_asInt(void) const
1815 {
1816 return( m_Colors.Get_Count() );
1817 }
1818
1819 //---------------------------------------------------------
1820 void * CSG_Parameter_Colors::_asPointer(void) const
1821 {
1822 return( (void *)&m_Colors );
1823 }
1824
1825 //---------------------------------------------------------
1826 bool CSG_Parameter_Colors::_Assign(CSG_Parameter *pSource)
1827 {
1828 return( m_Colors.Assign(pSource->asColors()) );
1829 }
1830
1831 //---------------------------------------------------------
1832 bool CSG_Parameter_Colors::_Serialize(CSG_MetaData &Entry, bool bSave)
1833 {
1834 if( bSave )
1835 {
1836 for(int i=0; i<m_Colors.Get_Count(); i++)
1837 {
1838 Entry.Add_Child("COLOR", CSG_String::Format("R%03d G%03d B%03d",
1839 m_Colors.Get_Red (i),
1840 m_Colors.Get_Green(i),
1841 m_Colors.Get_Blue (i))
1842 );
1843 }
1844 }
1845 else
1846 {
1847 if( Entry.Get_Children_Count() <= 1 )
1848 {
1849 return( false );
1850 }
1851
1852 m_Colors.Set_Count(Entry.Get_Children_Count());
1853
1854 for(int i=0; i<m_Colors.Get_Count(); i++)
1855 {
1856 CSG_String s(Entry(i)->Get_Content());
1857
1858 m_Colors.Set_Red (i, s.AfterFirst('R').asInt());
1859 m_Colors.Set_Green(i, s.AfterFirst('G').asInt());
1860 m_Colors.Set_Blue (i, s.AfterFirst('B').asInt());
1861 }
1862 }
1863
1864 return( true );
1865 }
1866
1867
1869 // //
1870 // FixedTable //
1871 // //
1873
1874 //---------------------------------------------------------
1875 CSG_Parameter_Fixed_Table::CSG_Parameter_Fixed_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1876 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1877 {
1878 m_Table.Set_Name(_TL("Table"));
1879 }
1880
1881 //---------------------------------------------------------
1882 void CSG_Parameter_Fixed_Table::_Set_String(void)
1883 {
1884 m_String.Printf("%s (%s: %d, %s: %lld)", m_Table.Get_Name(), _TL("columns"), m_Table.Get_Field_Count(), _TL("rows"), m_Table.Get_Count());
1885 }
1886
1887 //---------------------------------------------------------
1888 void * CSG_Parameter_Fixed_Table::_asPointer(void) const
1889 {
1890 return( (void *)&m_Table );
1891 }
1892
1893 //---------------------------------------------------------
1894 bool CSG_Parameter_Fixed_Table::_Assign(CSG_Parameter *pSource)
1895 {
1896 return( m_Table.Create(*pSource->asTable()) );
1897 }
1898
1899 //---------------------------------------------------------
1900 bool CSG_Parameter_Fixed_Table::_Serialize(CSG_MetaData &Entry, bool bSave)
1901 {
1902 int iField;
1903
1904 if( bSave )
1905 {
1906 CSG_MetaData *pNode = Entry.Add_Child("FIELDS");
1907
1908 for(iField=0; iField<m_Table.Get_Field_Count(); iField++)
1909 {
1910 CSG_MetaData *pEntry = pNode->Add_Child("FIELD", m_Table.Get_Field_Name(iField));
1911
1912 pEntry->Set_Property("type", gSG_Data_Type_Identifier[m_Table.Get_Field_Type(iField)]);
1913 }
1914
1915 pNode = Entry.Add_Child("RECORDS");
1916
1917 for(sLong iRecord=0; iRecord<m_Table.Get_Count(); iRecord++)
1918 {
1919 CSG_MetaData *pEntry = pNode->Add_Child("RECORD");
1920
1921 CSG_Table_Record *pRecord = m_Table.Get_Record(iRecord);
1922
1923 for(iField=0; iField<m_Table.Get_Field_Count(); iField++)
1924 {
1925 pEntry->Add_Child("FIELD", pRecord->asString(iField));
1926 }
1927 }
1928 }
1929 else
1930 {
1931 CSG_MetaData *pNode;
1932
1933 if( (pNode = Entry("FIELDS")) == NULL )
1934 {
1935 return( false );
1936 }
1937
1938 CSG_Table Table;
1939
1940 for(iField=0; iField<pNode->Get_Children_Count(); iField++)
1941 {
1942 TSG_Data_Type type = SG_DATATYPE_String;
1943
1944 CSG_String s;
1945
1946 if( pNode->Get_Child(iField)->Get_Property("type", s) )
1947 {
1948 type = SG_Data_Type_Get_Type(s);
1949 }
1950
1951 Table.Add_Field(pNode->Get_Child(iField)->Get_Content(), type == SG_DATATYPE_Undefined ? SG_DATATYPE_String : type);
1952 }
1953
1954 if( (pNode = Entry("RECORDS")) == NULL )
1955 {
1956 return( false );
1957 }
1958
1959 for(int iRecord=0; iRecord<pNode->Get_Children_Count(); iRecord++)
1960 {
1961 CSG_MetaData *pEntry = pNode->Get_Child(iRecord);
1962
1963 CSG_Table_Record *pRecord = Table.Add_Record();
1964
1965 for(iField=0; iField<pEntry->Get_Children_Count(); iField++)
1966 {
1967 pRecord->Set_Value(iField, pEntry->Get_Child(iField)->Get_Content());
1968 }
1969 }
1970
1971 return( m_Table.Assign_Values(&Table) );
1972 }
1973
1974 return( true );
1975 }
1976
1977
1979 // //
1980 // Grid_System //
1981 // //
1983
1984 //---------------------------------------------------------
1985 CSG_Parameter_Grid_System::CSG_Parameter_Grid_System(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1986 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
1987 {
1988 // nop
1989 }
1990
1991 //---------------------------------------------------------
1992 int CSG_Parameter_Grid_System::_Set_Value(void *Value)
1993 {
1994 CSG_Grid_System System;
1995
1996 if( Value != NULL )
1997 {
1998 System.Create(*((CSG_Grid_System *)Value));
1999 }
2000
2001 if( m_System == System )
2002 {
2003 return( SG_PARAMETER_DATA_SET_TRUE );
2004 }
2005
2006 m_System = System;
2007
2008 //-----------------------------------------------------
2009 bool bCallback = Get_Parameters()->Set_Callback(false); // only update grid parameter objects in 1st loop...
2010
2011 CSG_Data_Manager *pManager = Get_Manager();
2012
2013 for(int i=0; i<Get_Children_Count(); i++)
2014 {
2015 CSG_Parameter *pParameter = Get_Child(i);
2016
2017 if( pParameter->is_DataObject() )
2018 {
2019 CSG_Data_Object *pObject = pParameter->asDataObject();
2020
2021 bool bInvalid = !m_System.is_Valid() || !(pManager && pManager->Exists(pObject));
2022
2023 if( !bInvalid && pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
2024 {
2025 switch( pObject->Get_ObjectType() )
2026 {
2027 case SG_DATAOBJECT_TYPE_Grid : bInvalid = !m_System.is_Equal(((CSG_Grid *)pObject)->Get_System()); break;
2028 case SG_DATAOBJECT_TYPE_Grids: bInvalid = !m_System.is_Equal(((CSG_Grids *)pObject)->Get_System()); break;
2029 default: break;
2030 }
2031 }
2032
2033 if( bInvalid && pObject != DATAOBJECT_CREATE )
2034 {
2035 pParameter->Set_Value(DATAOBJECT_NOTSET);
2036 }
2037 }
2038
2039 //-------------------------------------------------
2040 else if( pParameter->is_DataObject_List() )
2041 {
2042 CSG_Parameter_List *pList = pParameter->asList();
2043
2044 if( !m_System.is_Valid() )
2045 {
2046 pList->Del_Items();
2047 }
2048 else for(int j=pList->Get_Item_Count()-1; j>=0; j--)
2049 {
2050 CSG_Data_Object *pObject = pList->Get_Item(j);
2051
2052 bool bInvalid = !(pManager && pManager->Exists(pObject));
2053
2054 if( !bInvalid && pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE )
2055 {
2056 switch( pObject->Get_ObjectType() )
2057 {
2058 case SG_DATAOBJECT_TYPE_Grid : bInvalid = !m_System.is_Equal(((CSG_Grid *)pObject)->Get_System()); break;
2059 case SG_DATAOBJECT_TYPE_Grids: bInvalid = !m_System.is_Equal(((CSG_Grids *)pObject)->Get_System()); break;
2060 default: break;
2061 }
2062 }
2063
2064 if( bInvalid )
2065 {
2066 pList->Del_Item(j);
2067 }
2068 }
2069 }
2070 }
2071
2072 Get_Parameters()->Set_Callback(bCallback);
2073
2074 if( bCallback ) // ...process On_Parameter_Changed()/On_Parameters_Enable() in a 2nd loop!
2075 {
2076 for(int i=0; i<Get_Children_Count(); i++)
2077 {
2078 CSG_Parameter *pParameter = Get_Child(i);
2079
2080 if( pParameter->is_DataObject() || pParameter->is_DataObject_List() )
2081 {
2082 pParameter->has_Changed();
2083 }
2084 }
2085 }
2086
2087 //-----------------------------------------------------
2088 return( SG_PARAMETER_DATA_SET_CHANGED );
2089 }
2090
2091 //---------------------------------------------------------
2092 void CSG_Parameter_Grid_System::_Set_String(void)
2093 {
2094 m_String = m_System.Get_Name();
2095 }
2096
2097 //---------------------------------------------------------
2098 void * CSG_Parameter_Grid_System::_asPointer(void) const
2099 {
2100 return( (void *)&m_System );
2101 }
2102
2103 //---------------------------------------------------------
2104 bool CSG_Parameter_Grid_System::_Assign(CSG_Parameter *pSource)
2105 {
2106 m_System = ((CSG_Parameter_Grid_System *)pSource)->m_System;
2107
2108 return( true );
2109 }
2110
2111 //---------------------------------------------------------
2112 bool CSG_Parameter_Grid_System::_Serialize(CSG_MetaData &Entry, bool bSave)
2113 {
2114 if( bSave )
2115 {
2116 Entry.Add_Child("CELLSIZE", m_System.Get_Cellsize());
2117 Entry.Add_Child("XMIN" , m_System.Get_Extent().Get_XMin());
2118 Entry.Add_Child("XMAX" , m_System.Get_Extent().Get_XMax());
2119 Entry.Add_Child("YMIN" , m_System.Get_Extent().Get_YMin());
2120 Entry.Add_Child("YMAX" , m_System.Get_Extent().Get_YMax());
2121 }
2122 else
2123 {
2124 double Cellsize;
2125 TSG_Rect Extent;
2126
2127 Cellsize = Entry("CELLSIZE")->Get_Content().asDouble();
2128 Extent.xMin = Entry("XMIN" )->Get_Content().asDouble();
2129 Extent.xMax = Entry("XMAX" )->Get_Content().asDouble();
2130 Extent.yMin = Entry("YMIN" )->Get_Content().asDouble();
2131 Extent.yMax = Entry("YMAX" )->Get_Content().asDouble();
2132
2133 m_System.Assign(Cellsize, CSG_Rect(Extent));
2134 }
2135
2136 return( true );
2137 }
2138
2139
2141 // //
2142 // Table Field //
2143 // //
2145
2146 //---------------------------------------------------------
2147 CSG_Parameter_Table_Field::CSG_Parameter_Table_Field(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2148 : CSG_Parameter_Int(pOwner, pParent, ID, Name, Description, Constraint)
2149 {
2150 m_Default = -1;
2151 m_Value = -1;
2152 }
2153
2154 //---------------------------------------------------------
2155 bool CSG_Parameter_Table_Field::Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
2156 {
2157 if( m_Default < 0 && is_Optional() )
2158 {
2159 m_Default = Get_Children_Count();
2160
2161 Get_Parameters()->Add_Double(Get_Identifier(), CSG_String::Format("%s_DEFAULT", Get_Identifier()),
2162 _TL("Default"), _TL("default value if no attribute has been selected"),
2163 Value, Minimum, bMinimum, Maximum, bMaximum
2164 );
2165 }
2166
2167 return( m_Default >= 0 );
2168 }
2169
2170 //---------------------------------------------------------
2171 CSG_Table * CSG_Parameter_Table_Field::Get_Table(void) const
2172 {
2173 CSG_Table *pTable = Get_Parent() ? Get_Parent()->asTable() : NULL;
2174
2175 return( pTable && pTable != DATAOBJECT_CREATE && pTable->Get_Field_Count() > 0 ? pTable : NULL );
2176 }
2177
2178 //---------------------------------------------------------
2179 int CSG_Parameter_Table_Field::_Set_Value(int Value)
2180 {
2181 CSG_Table *pTable = Get_Table();
2182
2183 if( pTable != NULL && pTable->Get_Field_Count() > 0 && Value >= 0 )
2184 {
2185 if( Value >= pTable->Get_Field_Count() )
2186 {
2187 Value = !is_Optional() ? pTable->Get_Field_Count() - 1 : -1;
2188 }
2189 }
2190 else
2191 {
2192 Value = -1;
2193 }
2194
2195 if( Get_Child(m_Default) )
2196 {
2197 Get_Child(m_Default)->Set_Enabled(Value < 0);
2198 }
2199
2200 if( m_Value != Value )
2201 {
2202 m_Value = Value;
2203
2204 return( SG_PARAMETER_DATA_SET_CHANGED );
2205 }
2206
2207 return( SG_PARAMETER_DATA_SET_TRUE );
2208 }
2209
2210 //---------------------------------------------------------
2211 int CSG_Parameter_Table_Field::_Set_Value(const CSG_String &Value)
2212 {
2213 CSG_Table *pTable = Get_Table();
2214
2215 if( pTable != NULL )
2216 {
2217 int Index;
2218
2219 for(Index=0; Index<pTable->Get_Field_Count(); Index++)
2220 {
2221 if( !Value.CmpNoCase(pTable->Get_Field_Name(Index)) )
2222 {
2223 return( _Set_Value(Index) );
2224 }
2225 }
2226
2227 if( Value.asInt(Index) )
2228 {
2229 return( _Set_Value(Index) );
2230 }
2231 }
2232
2233 return( _Set_Value(-1) );
2234 }
2235
2236 //---------------------------------------------------------
2237 void CSG_Parameter_Table_Field::_Set_String(void)
2238 {
2239 CSG_Table *pTable = Get_Table();
2240
2241 if( !pTable || pTable->Get_Field_Count() < 1 )
2242 {
2243 m_String = _TL("<no attributes>");
2244 }
2245 else if( m_Value < 0 || m_Value >= pTable->Get_Field_Count() )
2246 {
2247 m_String = _TL("<not set>");
2248 }
2249 else
2250 {
2251 m_String = pTable->Get_Field_Name(m_Value);
2252 }
2253 }
2254
2255 //---------------------------------------------------------
2256 double CSG_Parameter_Table_Field::_asDouble(void) const
2257 {
2258 return( Get_Child(m_Default) ? Get_Child(m_Default)->asDouble() : 0. );
2259 }
2260
2261 //---------------------------------------------------------
2262 bool CSG_Parameter_Table_Field::_Assign(CSG_Parameter *pSource)
2263 {
2264 m_Value = ((CSG_Parameter_Table_Field *)pSource)->m_Value;
2265 m_Default = ((CSG_Parameter_Table_Field *)pSource)->m_Default;
2266
2267 _Set_String();
2268
2269 return( true );
2270 }
2271
2272 //---------------------------------------------------------
2273 bool CSG_Parameter_Table_Field::_Serialize(CSG_MetaData &Entry, bool bSave)
2274 {
2275 if( bSave )
2276 {
2277 Entry.Set_Property("index", asInt());
2278 Entry.Set_Content(asString());
2279
2280 return( true );
2281 }
2282 else
2283 {
2284 int Index;
2285
2286 if( Entry.Get_Property("index", Index) ) // we require this check for backward compatibility, "index" was first introduced with SAGA 2.2.3 (r2671)
2287 {
2288 return( _Set_Value(Index) != 0 );
2289 }
2290
2291 return( _Set_Value(Entry.Get_Content()) != 0 );
2292 }
2293 }
2294
2295 //---------------------------------------------------------
2296 CSG_String CSG_Parameter_Table_Field::Get_Choices(const CSG_Table &Table, bool bAllowNone)
2297 {
2298 CSG_String Choices;
2299
2300 for(int i=0; i<Table.Get_Field_Count(); i++)
2301 {
2302 if( i > 0 ) { Choices += "|"; }
2303
2304 Choices += Table.Get_Field_Name(i);
2305 }
2306
2307 if( bAllowNone )
2308 {
2309 if( Table.Get_Field_Count() ) { Choices += "|"; }
2310
2311 Choices += _TL("<not set>");
2312 }
2313
2314 return( Choices );
2315 }
2316
2317
2319 // //
2320 // Table Fields //
2321 // //
2323
2324 //---------------------------------------------------------
2325 CSG_Parameter_Table_Fields::CSG_Parameter_Table_Fields(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2326 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
2327 {
2328 m_nFields = 0;
2329 m_Fields = NULL;
2330 }
2331
2332 //---------------------------------------------------------
2333 CSG_Parameter_Table_Fields::~CSG_Parameter_Table_Fields(void)
2334 {
2335 SG_FREE_SAFE(m_Fields);
2336 }
2337
2338 //---------------------------------------------------------
2339 int CSG_Parameter_Table_Fields::_Set_Value(const CSG_String &Value)
2340 {
2341 CSG_Table *pTable = Get_Table();
2342
2343 if( !pTable || pTable->Get_Field_Count() <= 0 )
2344 {
2345 SG_FREE_SAFE(m_Fields);
2346 m_nFields = 0;
2347 m_String = _TL("<no attributes>");
2348
2349 return( SG_PARAMETER_DATA_SET_CHANGED );
2350 }
2351
2352 m_Fields = (int *)SG_Realloc(m_Fields, pTable->Get_Field_Count() * sizeof(int));
2353
2354 memset(m_Fields, 0, pTable->Get_Field_Count() * sizeof(int));
2355
2356 //-----------------------------------------------------
2357 int iField;
2358
2359 CSG_String List(Value); List.Replace(";", ",");
2360
2361 while( List.Length() > 0 )
2362 {
2363 CSG_String sValue = List.BeforeFirst(',');
2364
2365 if( sValue.asInt(iField) && iField >= 0 && iField < pTable->Get_Field_Count() )
2366 {
2367 m_Fields[iField] = 1;
2368 }
2369 else if( sValue.Length() > 0 )
2370 {
2371 sValue.Trim();
2372
2373 if( sValue[0] == '[' )
2374 {
2375 sValue = sValue.AfterFirst('[').BeforeLast(']');
2376 }
2377
2378 for(iField=0; iField<pTable->Get_Field_Count(); iField++)
2379 {
2380 if( sValue.CmpNoCase(pTable->Get_Field_Name(iField)) == 0 )
2381 {
2382 m_Fields[iField] = 1;
2383
2384 break;
2385 }
2386 }
2387 }
2388
2389 List = List.AfterFirst(',');
2390 }
2391
2392 //-----------------------------------------------------
2393 m_String.Clear();
2394
2395 for(iField=0, m_nFields=0; iField<pTable->Get_Field_Count(); iField++)
2396 {
2397 if( m_Fields[iField] != 0 )
2398 {
2399 m_Fields[m_nFields++] = iField;
2400
2401 m_String += CSG_String::Format(m_String.is_Empty() ? "%d" : ",%d", iField);
2402 }
2403 }
2404
2405 if( m_nFields <= 0 )
2406 {
2407 m_String = _TL("<no attributes>");
2408 }
2409
2410 return( SG_PARAMETER_DATA_SET_CHANGED );
2411 }
2412
2413 //---------------------------------------------------------
2414 int CSG_Parameter_Table_Fields::_asInt(void) const
2415 {
2416 return( m_nFields );
2417 }
2418
2419 //---------------------------------------------------------
2420 void * CSG_Parameter_Table_Fields::_asPointer(void) const
2421 {
2422 return( m_Fields );
2423 }
2424
2425 //---------------------------------------------------------
2426 CSG_Table * CSG_Parameter_Table_Fields::Get_Table(void) const
2427 {
2428 CSG_Table *pTable = Get_Parent() ? Get_Parent()->asTable() : NULL;
2429
2430 return( pTable && pTable != DATAOBJECT_CREATE && pTable->Get_Field_Count() > 0 ? pTable : NULL );
2431 }
2432
2433 //---------------------------------------------------------
2434 bool CSG_Parameter_Table_Fields::_Assign(CSG_Parameter *pSource)
2435 {
2436 return( _Set_Value(pSource->asString()) != 0 );
2437 }
2438
2439 //---------------------------------------------------------
2440 bool CSG_Parameter_Table_Fields::_Serialize(CSG_MetaData &Entry, bool bSave)
2441 {
2442 if( bSave )
2443 {
2444 Entry.Set_Content(m_String);
2445 }
2446 else
2447 {
2448 m_String = Entry.Get_Content();
2449 }
2450
2451 return( true );
2452 }
2453
2454
2456 // //
2457 // DataObject //
2458 // //
2460
2461 //---------------------------------------------------------
2462 CSG_Parameter_Data_Object::CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2463 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
2464 {
2465 m_pDataObject = NULL;
2466 }
2467
2468 //---------------------------------------------------------
2469 bool CSG_Parameter_Data_Object::is_Valid(void) const
2470 {
2471 return( is_Optional() || (m_pDataObject && m_pDataObject->is_Valid()) );
2472 }
2473
2474 //---------------------------------------------------------
2475 int CSG_Parameter_Data_Object::_Set_Value(void *Value)
2476 {
2477 if( m_pDataObject != Value )
2478 {
2479 m_pDataObject = (CSG_Data_Object *)Value;
2480
2481 return( SG_PARAMETER_DATA_SET_CHANGED );
2482 }
2483
2484 return( SG_PARAMETER_DATA_SET_TRUE );
2485 }
2486
2487 //---------------------------------------------------------
2488 void CSG_Parameter_Data_Object::_Set_String(void)
2489 {
2490 if( m_pDataObject == DATAOBJECT_NOTSET )
2491 {
2492 m_String = is_Output() && !is_Optional() ? _TL("<create>") : _TL("<not set>");
2493 }
2494 else if( m_pDataObject == DATAOBJECT_CREATE )
2495 {
2496 m_String = _TL("<create>");
2497 }
2498 else
2499 {
2500 m_String = m_pDataObject->Get_Name();
2501 }
2502 }
2503
2504 //---------------------------------------------------------
2505 void * CSG_Parameter_Data_Object::_asPointer(void) const
2506 {
2507 return( m_pDataObject );
2508 }
2509
2510 //---------------------------------------------------------
2511 bool CSG_Parameter_Data_Object::_Assign(CSG_Parameter *pSource)
2512 {
2513 m_pDataObject = ((CSG_Parameter_Data_Object *)pSource)->m_pDataObject;
2514
2515 return( true );
2516 }
2517
2518 //---------------------------------------------------------
2519 bool CSG_Parameter_Data_Object::_Serialize(CSG_MetaData &Entry, bool bSave)
2520 {
2521 if( bSave )
2522 {
2523 if( m_pDataObject == DATAOBJECT_CREATE )
2524 {
2525 Entry.Set_Content("CREATE");
2526
2527 return( true );
2528 }
2529
2530 if( m_pDataObject == DATAOBJECT_NOTSET )//|| !SG_File_Exists(m_pDataObject->Get_File_Name(false)) )
2531 {
2532 Entry.Set_Content("NOT SET");
2533
2534 return( true );
2535 }
2536
2537 if( !m_pDataObject->Get_Owner() )
2538 {
2539 Entry.Set_Content(m_pDataObject->Get_File_Name(false));
2540
2541 return( true );
2542 }
2543
2544 if( m_pDataObject->Get_Owner()->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
2545 {
2546 CSG_Grids *pGrids = m_pDataObject->Get_Owner()->asGrids();
2547
2548 for(int i=0; i<pGrids->Get_NZ(); i++)
2549 {
2550 if( pGrids->Get_Grid_Ptr(i) == m_pDataObject )
2551 {
2552 Entry.Set_Content(m_pDataObject->Get_Owner()->Get_File_Name(false));
2553
2554 Entry.Add_Property("index", i);
2555
2556 return( true );
2557 }
2558 }
2559 }
2560 }
2561 else
2562 {
2563 CSG_Data_Object *pDataObject = NULL; int Index = -1;
2564
2565 if( Entry.Cmp_Content("CREATE") )
2566 {
2567 _Set_Value(DATAOBJECT_CREATE);
2568
2569 return( true );
2570 }
2571
2572 if( Entry.Cmp_Content("NOT SET") || !Get_Manager() || !(pDataObject = Get_Manager()->Find(Entry.Get_Content(), false)) )
2573 {
2574 _Set_Value(DATAOBJECT_NOTSET);
2575
2576 return( true );
2577 }
2578
2579 if( !Entry.Get_Property("index", Index) )
2580 {
2581 _Set_Value(pDataObject);
2582
2583 return( true );
2584 }
2585
2586 if( pDataObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grids )
2587 {
2588 _Set_Value(pDataObject->asGrids()->Get_Grid_Ptr(Index));
2589
2590 return( true );
2591 }
2592 }
2593
2594 return( false );
2595 }
2596
2597
2599 // //
2600 // DataObject_Output //
2601 // //
2603
2604 //---------------------------------------------------------
2605 CSG_Parameter_Data_Object_Output::CSG_Parameter_Data_Object_Output(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2606 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2607 {
2608 m_Type = SG_DATAOBJECT_TYPE_Undefined;
2609 }
2610
2611 //---------------------------------------------------------
2612 int CSG_Parameter_Data_Object_Output::_Set_Value(void *Value)
2613 {
2614 CSG_Data_Object *pDataObject = (CSG_Data_Object *)Value;
2615
2616 if( pDataObject == DATAOBJECT_CREATE )
2617 {
2618 pDataObject = NULL;
2619 }
2620
2621 if( m_pDataObject != pDataObject && (pDataObject == NULL || pDataObject->Get_ObjectType() == m_Type) )
2622 {
2623 m_pDataObject = pDataObject;
2624
2625 if( Get_Manager() )
2626 {
2627 Get_Manager()->Add(m_pDataObject);
2628
2629 if( Get_Manager() == &SG_Get_Data_Manager() ) // prevent that local data manager send their data objects to gui
2630 {
2631 SG_UI_DataObject_Add(m_pDataObject, false);
2632 }
2633 }
2634 }
2635
2636 return( SG_PARAMETER_DATA_SET_CHANGED );
2637 }
2638
2639 //---------------------------------------------------------
2640 bool CSG_Parameter_Data_Object_Output::Set_DataObject_Type(TSG_Data_Object_Type Type)
2641 {
2642 if( m_Type == SG_DATAOBJECT_TYPE_Undefined ) // m_Type should not be changed after set once!!!...
2643 {
2644 switch( Type )
2645 {
2646 case SG_DATAOBJECT_TYPE_Grid :
2647 case SG_DATAOBJECT_TYPE_Grids :
2648 case SG_DATAOBJECT_TYPE_Table :
2649 case SG_DATAOBJECT_TYPE_Shapes :
2650 case SG_DATAOBJECT_TYPE_TIN :
2651 case SG_DATAOBJECT_TYPE_PointCloud:
2652 m_Type = Type;
2653
2654 return( true );
2655
2656 default:
2657 return( false );
2658 }
2659 }
2660
2661 return( false );
2662 }
2663
2664
2666 // //
2667 // Grid //
2668 // //
2670
2671 //---------------------------------------------------------
2672 CSG_Parameter_Grid::CSG_Parameter_Grid(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2673 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2674 {
2675 m_Type = SG_DATATYPE_Undefined; m_Default = -1;
2676 }
2677
2678 //---------------------------------------------------------
2679 void CSG_Parameter_Grid::Set_Preferred_Type(TSG_Data_Type Type)
2680 {
2681 m_Type = Type;
2682 }
2683
2684 //---------------------------------------------------------
2685 CSG_Grid_System * CSG_Parameter_Grid::Get_System(void) const
2686 {
2687 if( Get_Parent() && Get_Parent()->Get_Type() == PARAMETER_TYPE_Grid_System )
2688 {
2689 return( Get_Parent()->asGrid_System() );
2690 }
2691
2692 return( NULL );
2693 }
2694
2695 //---------------------------------------------------------
2696 bool CSG_Parameter_Grid::Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
2697 {
2698 if( m_Default < 0 && is_Input() && is_Optional() )
2699 {
2700 m_Default = Get_Children_Count();
2701
2702 Get_Parameters()->Add_Double(Get_Identifier(), CSG_String::Format("%s_DEFAULT", Get_Identifier()),
2703 _TL("Default"), _TL("default value if no grid has been selected"),
2704 Value, Minimum, bMinimum, Maximum, bMaximum
2705 );
2706 }
2707
2708 return( m_Default >= 0 );
2709 }
2710
2711 //---------------------------------------------------------
2712 int CSG_Parameter_Grid::_Set_Value(void *Value)
2713 {
2714 if( Value == m_pDataObject ) // nothing to do
2715 {
2716 return( SG_PARAMETER_DATA_SET_TRUE );
2717 }
2718
2719 //-----------------------------------------------------
2720 if( Value != DATAOBJECT_NOTSET && Value != DATAOBJECT_CREATE && Get_System() ) // check grid system compatibility
2721 {
2722 CSG_Grid_System System = Get_Type() == PARAMETER_TYPE_Grid
2723 ? ((CSG_Grid *)Value)->Get_System()
2724 : ((CSG_Grids *)Value)->Get_System();
2725
2726 if( System.is_Valid() == false && is_Input() )
2727 {
2728 return( SG_PARAMETER_DATA_SET_FALSE );
2729 }
2730
2731 if( System.is_Valid() && !Get_System()->is_Equal(System) )
2732 {
2733 for(int i=0; i<Get_Parent()->Get_Children_Count(); i++)
2734 {
2735 CSG_Parameter *pChild = Get_Parent()->Get_Child(i);
2736
2737 if( pChild->Get_Type() == PARAMETER_TYPE_Grid
2738 || pChild->Get_Type() == PARAMETER_TYPE_Grids )
2739 {
2740 if( pChild->asDataObject() != DATAOBJECT_NOTSET
2741 && pChild->asDataObject() != DATAOBJECT_CREATE
2742 && pChild->asDataObject() != m_pDataObject )
2743 {
2744 return( SG_PARAMETER_DATA_SET_FALSE );
2745 }
2746 }
2747
2748 if( pChild->is_DataObject_List() && pChild->asList()->Get_Item_Count() > 0 )
2749 {
2750 if( (pChild->Get_Type() == PARAMETER_TYPE_Grid_List && pChild->asGridList ()->Get_System())
2751 || (pChild->Get_Type() == PARAMETER_TYPE_Grids_List && pChild->asGridsList()->Get_System()) )
2752 {
2753 return( SG_PARAMETER_DATA_SET_FALSE );
2754 }
2755 }
2756 }
2757
2758 Get_Parent()->Set_Value((void *)&System);
2759 }
2760 }
2761
2762 //-----------------------------------------------------
2763 m_pDataObject = (CSG_Data_Object *)Value;
2764
2765 if( Get_Child(m_Default) )
2766 {
2767 Get_Child(m_Default)->Set_Enabled(m_pDataObject == DATAOBJECT_NOTSET);
2768 }
2769
2770 return( SG_PARAMETER_DATA_SET_CHANGED );
2771 }
2772
2773 //---------------------------------------------------------
2774 int CSG_Parameter_Grid::_asInt(void) const
2775 {
2776 return( Get_Child(m_Default) ? Get_Child(m_Default)->asInt() : CSG_Parameter_Data_Object::asInt() );
2777 }
2778
2779 //---------------------------------------------------------
2780 double CSG_Parameter_Grid::_asDouble(void) const
2781 {
2782 return( Get_Child(m_Default) ? Get_Child(m_Default)->asDouble() : CSG_Parameter_Data_Object::asDouble() );
2783 }
2784
2785 //---------------------------------------------------------
2786 bool CSG_Parameter_Grid::_Assign(CSG_Parameter *pSource)
2787 {
2788 m_Type = ((CSG_Parameter_Grid *)pSource)->m_Type;
2789 m_Default = ((CSG_Parameter_Grid *)pSource)->m_Default;
2790
2791 return( _Set_Value(pSource->asPointer()) != 0 );
2792 }
2793
2794
2796 // //
2797 // Grids //
2798 // //
2800
2801 //---------------------------------------------------------
2802 CSG_Parameter_Grids::CSG_Parameter_Grids(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2803 : CSG_Parameter_Grid(pOwner, pParent, ID, Name, Description, Constraint)
2804 {
2805 // nop
2806 }
2807
2808
2810 // //
2811 // Table //
2812 // //
2814
2815 //---------------------------------------------------------
2816 CSG_Parameter_Table::CSG_Parameter_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2817 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2818 {
2819 // nop
2820 }
2821
2822 //---------------------------------------------------------
2823 int CSG_Parameter_Table::_Set_Value(void *Value)
2824 {
2825 if( m_pDataObject == Value )
2826 {
2827 return( SG_PARAMETER_DATA_SET_TRUE );
2828 }
2829
2830 m_pDataObject = (CSG_Data_Object *)Value;
2831
2832 for(int i=0; i<Get_Children_Count(); i++)
2833 {
2834 CSG_Parameter *pChild = Get_Child(i);
2835
2836 if( pChild->Get_Type() == PARAMETER_TYPE_Table_Field )
2837 {
2838 pChild->Set_Value(m_pDataObject && pChild->is_Optional() ? ((CSG_Table *)m_pDataObject)->Get_Field_Count() : 0);
2839 }
2840 else if( pChild->Get_Type() == PARAMETER_TYPE_Table_Fields )
2841 {
2842 pChild->Set_Value(CSG_String(""));
2843 }
2844 }
2845
2846 return( SG_PARAMETER_DATA_SET_CHANGED );
2847 }
2848
2849
2851 // //
2852 // Shapes //
2853 // //
2855
2856 //---------------------------------------------------------
2857 CSG_Parameter_Shapes::CSG_Parameter_Shapes(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2858 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2859 {
2860 m_Type = SHAPE_TYPE_Undefined;
2861 }
2862
2863 //---------------------------------------------------------
2864 int CSG_Parameter_Shapes::_Set_Value(void *Value)
2865 {
2866 if( (is_Input() || Get_Parameters()->has_GUI()) && Value != DATAOBJECT_NOTSET && Value != DATAOBJECT_CREATE
2867 && m_Type != SHAPE_TYPE_Undefined && m_Type != ((CSG_Shapes *)Value)->Get_Type() )
2868 {
2869 return( SG_PARAMETER_DATA_SET_FALSE );
2870 }
2871
2872 if( m_pDataObject == Value )
2873 {
2874 return( SG_PARAMETER_DATA_SET_TRUE );
2875 }
2876
2877 m_pDataObject = (CSG_Data_Object *)Value;
2878
2879 for(int i=0; i<Get_Children_Count(); i++)
2880 {
2881 CSG_Parameter *pChild = Get_Child(i);
2882
2883 if( pChild->Get_Type() == PARAMETER_TYPE_Table_Field )
2884 {
2885 pChild->Set_Value(m_pDataObject && m_pDataObject != DATAOBJECT_CREATE && pChild->is_Optional() ? ((CSG_Table *)m_pDataObject)->Get_Field_Count() : 0);
2886 }
2887 else if( pChild->Get_Type() == PARAMETER_TYPE_Table_Fields )
2888 {
2889 pChild->Set_Value("");
2890 }
2891 }
2892
2893 return( SG_PARAMETER_DATA_SET_CHANGED );
2894 }
2895
2896 //---------------------------------------------------------
2897 void CSG_Parameter_Shapes::Set_Shape_Type(TSG_Shape_Type Type)
2898 {
2899 m_Type = Type;
2900 }
2901
2902 //---------------------------------------------------------
2903 bool CSG_Parameter_Shapes::_Assign(CSG_Parameter *pSource)
2904 {
2905 m_Type = ((CSG_Parameter_Shapes *)pSource)->m_Type;
2906
2907 return( CSG_Parameter_Data_Object::_Assign(pSource) );
2908 }
2909
2910
2912 // //
2913 // TIN //
2914 // //
2916
2917 //---------------------------------------------------------
2918 CSG_Parameter_TIN::CSG_Parameter_TIN(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2919 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2920 {
2921 // nop
2922 }
2923
2924 //---------------------------------------------------------
2925 int CSG_Parameter_TIN::_Set_Value(void *Value)
2926 {
2927 if( m_pDataObject == Value )
2928 {
2929 return( SG_PARAMETER_DATA_SET_TRUE );
2930 }
2931
2932 m_pDataObject = (CSG_Data_Object *)Value;
2933
2934 for(int i=0; i<Get_Children_Count(); i++)
2935 {
2936 CSG_Parameter *pChild = Get_Child(i);
2937
2938 if( pChild->Get_Type() == PARAMETER_TYPE_Table_Field )
2939 {
2940 pChild->Set_Value(m_pDataObject && pChild->is_Optional() ? ((CSG_Table *)m_pDataObject)->Get_Field_Count() : 0);
2941 }
2942 else if( pChild->Get_Type() == PARAMETER_TYPE_Table_Fields )
2943 {
2944 pChild->Set_Value("");
2945 }
2946 }
2947
2948 return( SG_PARAMETER_DATA_SET_CHANGED );
2949 }
2950
2951
2953 // //
2954 // PointCloud //
2955 // //
2957
2958 //---------------------------------------------------------
2959 CSG_Parameter_PointCloud::CSG_Parameter_PointCloud(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
2960 : CSG_Parameter_Data_Object(pOwner, pParent, ID, Name, Description, Constraint)
2961 {
2962 // nop
2963 }
2964
2965 //---------------------------------------------------------
2966 int CSG_Parameter_PointCloud::_Set_Value(void *Value)
2967 {
2968 if( m_pDataObject == Value )
2969 {
2970 return( SG_PARAMETER_DATA_SET_TRUE );
2971 }
2972
2973 m_pDataObject = (CSG_Data_Object *)Value;
2974
2975 for(int i=0; i<Get_Children_Count(); i++)
2976 {
2977 CSG_Parameter *pChild = Get_Child(i);
2978
2979 if( pChild->Get_Type() == PARAMETER_TYPE_Table_Field )
2980 {
2981 pChild->Set_Value(m_pDataObject && pChild->is_Optional() ? ((CSG_Table *)m_pDataObject)->Get_Field_Count() : 0);
2982 }
2983 else if( pChild->Get_Type() == PARAMETER_TYPE_Table_Fields )
2984 {
2985 pChild->Set_Value("");
2986 }
2987 }
2988
2989 return( SG_PARAMETER_DATA_SET_CHANGED );
2990 }
2991
2992 //---------------------------------------------------------
2993 bool CSG_Parameter_PointCloud::_Assign(CSG_Parameter *pSource)
2994 {
2995 return( CSG_Parameter_Data_Object::_Assign(pSource) );
2996 }
2997
2998
3000 // //
3001 // List //
3002 // //
3004
3005 //---------------------------------------------------------
3006 CSG_Parameter_List::CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3007 : CSG_Parameter(pOwner, pParent, ID, Name, Description, Constraint)
3008 {
3009 // nop
3010 }
3011
3012 //---------------------------------------------------------
3013 bool CSG_Parameter_List::Add_Item(CSG_Data_Object *pObject)
3014 {
3015 if( pObject != DATAOBJECT_NOTSET && pObject != DATAOBJECT_CREATE && m_Objects.Add(pObject) )
3016 {
3017 _Set_String();
3018
3019 return( true );
3020 }
3021
3022 return( false );
3023 }
3024
3025 bool CSG_Parameter_List::Del_Item(CSG_Data_Object *pObject, bool bUpdateData)
3026 {
3027 if( m_Objects.Del(pObject) > 0 )
3028 {
3029 if( bUpdateData )
3030 {
3031 _Set_String();
3032 }
3033
3034 return( true );
3035 }
3036
3037 return( false );
3038 }
3039
3040 bool CSG_Parameter_List::Del_Item(int Index, bool bUpdateData)
3041 {
3042 if( m_Objects.Del(Index) )
3043 {
3044 if( bUpdateData )
3045 {
3046 _Set_String();
3047 }
3048
3049 return( true );
3050 }
3051
3052 return( false );
3053 }
3054
3055 bool CSG_Parameter_List::Del_Items(void)
3056 {
3057 if( m_Objects.Set_Array(0) )
3058 {
3059 _Set_String();
3060
3061 return( true );
3062 }
3063
3064 return( false );
3065 }
3066
3067 //---------------------------------------------------------
3068 void CSG_Parameter_List::_Set_String(void)
3069 {
3070 if( Get_Item_Count() > 0 )
3071 {
3072 m_String.Printf("%d %s (", Get_Item_Count(), Get_Item_Count() == 1 ? _TL("object") : _TL("objects"));
3073
3074 for(int i=0; i<Get_Item_Count(); i++)
3075 {
3076 if( i > 0 )
3077 {
3078 m_String += ", ";
3079 }
3080
3081 m_String += Get_Item(i)->Get_Name();
3082 }
3083
3084 m_String += ")";
3085 }
3086 else
3087 {
3088 m_String = _TL("No objects");
3089 }
3090 }
3091
3092 //---------------------------------------------------------
3093 int CSG_Parameter_List::_asInt(void) const
3094 {
3095 return( Get_Item_Count() );
3096 }
3097
3098 //---------------------------------------------------------
3099 void * CSG_Parameter_List::_asPointer(void) const
3100 {
3101 return( m_Objects.Get_Array() );
3102 }
3103
3104 //---------------------------------------------------------
3105 bool CSG_Parameter_List::_Assign(CSG_Parameter *pSource)
3106 {
3107 Del_Items();
3108
3109 for(int i=0; i<((CSG_Parameter_List *)pSource)->Get_Item_Count(); i++)
3110 {
3111 if( Get_Manager() != &SG_Get_Data_Manager() || SG_Get_Data_Manager().Exists(((CSG_Parameter_List *)pSource)->Get_Item(i)) )
3112 {
3113 Add_Item(((CSG_Parameter_List *)pSource)->Get_Item(i));
3114 }
3115 }
3116
3117 return( true );
3118 }
3119
3120 //---------------------------------------------------------
3121 bool CSG_Parameter_List::_Serialize(CSG_MetaData &Entry, bool bSave)
3122 {
3123 if( bSave )
3124 {
3125 for(int i=0; i<Get_Item_Count(); i++)
3126 {
3127 CSG_String File = Get_Item(i)->Get_File_Name(false);
3128
3129 if( File.BeforeFirst(':').Cmp("PGSQL") || SG_File_Exists(File) )
3130 {
3131 Entry.Add_Child("DATA", File);
3132 }
3133 }
3134 }
3135 else
3136 {
3137 Del_Items();
3138
3139 for(int i=0; i<Entry.Get_Children_Count(); i++)
3140 {
3141 CSG_Data_Object *pObject = Get_Manager() ? Get_Manager()->Find(Entry.Get_Content(i), false) : NULL;
3142
3143 if( pObject )
3144 {
3145 Add_Item(pObject);
3146 }
3147 }
3148 }
3149
3150 return( true );
3151 }
3152
3153
3155 // //
3156 // Grid_List //
3157 // //
3159
3160 //---------------------------------------------------------
3161 CSG_Parameter_Grid_List::CSG_Parameter_Grid_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3162 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3163 {
3164 // nop
3165 }
3166
3167 //---------------------------------------------------------
3168 CSG_Grid_System * CSG_Parameter_Grid_List::Get_System(void) const
3169 {
3170 if( Get_Parent() && Get_Parent()->Get_Type() == PARAMETER_TYPE_Grid_System )
3171 {
3172 return( Get_Parent()->asGrid_System() );
3173 }
3174
3175 return( NULL );
3176 }
3177
3178 //---------------------------------------------------------
3179 bool CSG_Parameter_Grid_List::Add_Item(CSG_Data_Object *pObject)
3180 {
3181 if( pObject == DATAOBJECT_NOTSET || pObject == DATAOBJECT_CREATE
3182 || (pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grid
3183 && pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grids) )
3184 {
3185 return( false );
3186 }
3187
3188 //-----------------------------------------------------
3189 if( Get_System() ) // check grid system compatibility
3190 {
3191 CSG_Grid_System System = pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Grid
3192 ? ((CSG_Grid *)pObject)->Get_System()
3193 : ((CSG_Grids *)pObject)->Get_System();
3194
3195 if( System.is_Valid() == false && is_Input() )
3196 {
3197 return( false );
3198 }
3199
3200 if( !Get_System()->is_Valid() )
3201 {
3202 Get_Parent()->Set_Value((void *)&System);
3203 }
3204 else if( !Get_System()->is_Equal(System) )
3205 {
3206 for(int i=0; i<Get_Parent()->Get_Children_Count(); i++)
3207 {
3208 CSG_Parameter *pChild = Get_Parent()->Get_Child(i);
3209
3210 if( pChild->Get_Type() == PARAMETER_TYPE_Grid
3211 || pChild->Get_Type() == PARAMETER_TYPE_Grids )
3212 {
3213 if( pChild->asDataObject() != DATAOBJECT_NOTSET
3214 && pChild->asDataObject() != DATAOBJECT_CREATE )
3215 {
3216 return( false );
3217 }
3218 }
3219
3220 if( pChild->is_DataObject_List() && pChild->asList()->Get_Item_Count() > 0 )
3221 {
3222 if( (pChild->Get_Type() == PARAMETER_TYPE_Grid_List && pChild->asGridList ()->Get_System())
3223 || (pChild->Get_Type() == PARAMETER_TYPE_Grids_List && pChild->asGridsList()->Get_System()) )
3224 {
3225 return( false );
3226 }
3227 }
3228 }
3229
3230 Get_Parent()->Set_Value((void *)&System);
3231 }
3232 }
3233
3234 return( CSG_Parameter_List::Add_Item(pObject) && Update_Data() );
3235 }
3236
3237 //---------------------------------------------------------
3238 bool CSG_Parameter_Grid_List::Del_Item(CSG_Data_Object *pItem, bool bUpdateData)
3239 {
3240 return( CSG_Parameter_List::Del_Item(pItem, bUpdateData) );
3241 }
3242
3243 //---------------------------------------------------------
3244 bool CSG_Parameter_Grid_List::Del_Item(int Index, bool bUpdateData)
3245 {
3246 return( CSG_Parameter_List::Del_Item(Index, bUpdateData) );
3247 }
3248
3249 //---------------------------------------------------------
3250 bool CSG_Parameter_Grid_List::Del_Items(void)
3251 {
3252 return( CSG_Parameter_List::Del_Items() && Update_Data() );
3253 }
3254
3255 //---------------------------------------------------------
3256 bool CSG_Parameter_Grid_List::Update_Data(void)
3257 {
3258 m_Grids.Set_Array(0);
3259
3260 for(int i=0; i<Get_Item_Count(); i++)
3261 {
3262 switch( Get_Item(i)->Get_ObjectType() )
3263 {
3264 case SG_DATAOBJECT_TYPE_Grid: {
3265 m_Grids.Add(Get_Item(i));
3266 break; }
3267
3268 case SG_DATAOBJECT_TYPE_Grids: {
3269 CSG_Grids *pGrids = (CSG_Grids *)Get_Item(i);
3270
3271 for(int j=0; j<pGrids->Get_Grid_Count(); j++)
3272 {
3273 m_Grids.Add(pGrids->Get_Grid_Ptr(j));
3274 }
3275 break; }
3276
3277 default: {
3278 break; }
3279 }
3280 }
3281
3282 if( !m_Grids.Get_Size() && !Get_Parameters()->has_GUI() )
3283 {
3284 if( Get_Parent() && Get_Parent()->Get_Type() == PARAMETER_TYPE_Grid_System && Get_Parent()->Get_Children_Count() == 1 )
3285 {
3286 Get_Parent()->asGrid_System()->Destroy();
3287 }
3288 }
3289
3290 return( true );
3291 }
3292
3293
3295 // //
3296 // Grids_List //
3297 // //
3299
3300 //---------------------------------------------------------
3301 CSG_Parameter_Grids_List::CSG_Parameter_Grids_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3302 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3303 {
3304 // nop
3305 }
3306
3307 //---------------------------------------------------------
3308 CSG_Grid_System * CSG_Parameter_Grids_List::Get_System(void) const
3309 {
3310 if( Get_Parent() && Get_Parent()->Get_Type() == PARAMETER_TYPE_Grid_System )
3311 {
3312 return( Get_Parent()->asGrid_System() );
3313 }
3314
3315 return( NULL );
3316 }
3317
3318 //---------------------------------------------------------
3319 bool CSG_Parameter_Grids_List::Add_Item(CSG_Data_Object *pObject)
3320 {
3321 if( pObject == NULL || pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Grids )
3322 {
3323 return( false );
3324 }
3325
3326 //-----------------------------------------------------
3327 CSG_Grid_System *pSystem = Get_System();
3328
3329 if( pSystem ) // check grid system compatibility
3330 {
3331 CSG_Grid_System System = Get_Type() == PARAMETER_TYPE_Grid_List
3332 ? ((CSG_Grid *)pObject)->Get_System()
3333 : ((CSG_Grids *)pObject)->Get_System();
3334
3335 if( !pSystem->is_Valid() )
3336 {
3337 Get_Parent()->Set_Value((void *)&System);
3338 }
3339 else if( !pSystem->is_Equal(System) )
3340 {
3341 for(int i=0; i<Get_Parent()->Get_Children_Count(); i++)
3342 {
3343 CSG_Parameter *pChild = Get_Parent()->Get_Child(i);
3344
3345 if( pChild->Get_Type() == PARAMETER_TYPE_Grids )
3346 {
3347 if( pChild->asDataObject() != DATAOBJECT_NOTSET
3348 && pChild->asDataObject() != DATAOBJECT_CREATE )
3349 {
3350 return( false );
3351 }
3352 }
3353
3354 if( pChild->is_DataObject_List() && pChild->asList()->Get_Item_Count() > 0 )
3355 {
3356 if( (pChild->Get_Type() == PARAMETER_TYPE_Grids_List && pChild->asGridsList()->Get_System()) )
3357 {
3358 return( false );
3359 }
3360 }
3361 }
3362
3363 Get_Parent()->Set_Value((void *)&System);
3364 }
3365 }
3366
3367 return( CSG_Parameter_List::Add_Item(pObject) );
3368 }
3369
3370
3372 // //
3373 // Table_List //
3374 // //
3376
3377
3378 //---------------------------------------------------------
3379 CSG_Parameter_Table_List::CSG_Parameter_Table_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3380 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3381 {
3382 // nop
3383 }
3384
3385
3387 // //
3388 // Shapes_List //
3389 // //
3391
3392
3393 //---------------------------------------------------------
3394 CSG_Parameter_Shapes_List::CSG_Parameter_Shapes_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3395 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3396 {
3397 m_Type = SHAPE_TYPE_Undefined;
3398 }
3399
3400 //---------------------------------------------------------
3401 void CSG_Parameter_Shapes_List::Set_Shape_Type(TSG_Shape_Type Type)
3402 {
3403 m_Type = Type;
3404 }
3405
3406 //---------------------------------------------------------
3407 bool CSG_Parameter_Shapes_List::_Assign(CSG_Parameter *pSource)
3408 {
3409 m_Type = ((CSG_Parameter_Shapes_List *)pSource)->m_Type;
3410
3411 return( CSG_Parameter_List::_Assign(pSource) );
3412 }
3413
3414
3416 // //
3417 // TIN_List //
3418 // //
3420
3421
3422 //---------------------------------------------------------
3423 CSG_Parameter_TIN_List::CSG_Parameter_TIN_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3424 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3425 {
3426 // nop
3427 }
3428
3429
3431 // //
3432 // PointCloud_List //
3433 // //
3435
3436
3437 //---------------------------------------------------------
3438 CSG_Parameter_PointCloud_List::CSG_Parameter_PointCloud_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3439 : CSG_Parameter_List(pOwner, pParent, ID, Name, Description, Constraint)
3440 {
3441 // nop
3442 }
3443
3444
3446 // //
3447 // Parameters //
3448 // //
3450
3451 //---------------------------------------------------------
3452 CSG_Parameter_Parameters::CSG_Parameter_Parameters(CSG_Parameters *pParameters, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
3453 : CSG_Parameter(pParameters, pParent, ID, Name, Description, Constraint)
3454 {
3455 m_pParameters = new CSG_Parameters(pParameters->Get_Owner(), Name, Description, ID);
3456 }
3457
3458 CSG_Parameter_Parameters::~CSG_Parameter_Parameters(void)
3459 {
3460 delete(m_pParameters);
3461 }
3462
3463 //---------------------------------------------------------
3464 bool CSG_Parameter_Parameters::Restore_Default(void)
3465 {
3466 return( m_pParameters->Restore_Defaults() );
3467 }
3468
3469 //---------------------------------------------------------
3470 void CSG_Parameter_Parameters::_Set_String(void)
3471 {
3472 m_String.Printf("%d %s", m_pParameters->Get_Count(), _TL("parameters"));
3473 }
3474
3475 //---------------------------------------------------------
3476 void * CSG_Parameter_Parameters::_asPointer(void) const
3477 {
3478 return( m_pParameters );
3479 }
3480
3481 //---------------------------------------------------------
3482 bool CSG_Parameter_Parameters::_Assign(CSG_Parameter *pSource)
3483 {
3484 m_pParameters->Assign(pSource->asParameters());
3485
3486 return( true );
3487 }
3488
3489 //---------------------------------------------------------
3490 bool CSG_Parameter_Parameters::_Serialize(CSG_MetaData &Entry, bool bSave)
3491 {
3492 if( m_pParameters->Serialize(Entry, bSave) )
3493 {
3494 if( bSave )
3495 {
3496 Entry.Set_Property("id" , Get_Identifier ());
3497 Entry.Set_Property("type", Get_Type_Identifier());
3498 }
3499
3500 return( true );
3501 }
3502
3503 return( false );
3504 }
3505
3506
3508 // //
3509 // //
3510 // //
3512
3513 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:966
CSG_Parameter_Grid_System::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:2098
CSG_Parameter::asGridsList
class CSG_Parameter_Grids_List * asGridsList(void) const
Definition: parameter.cpp:1048
CSG_Parameter_Grids_List::Get_System
CSG_Grid_System * Get_System(void) const
Definition: parameter_data.cpp:3308
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Parameter_Data_Object
Definition: parameters.h:1132
CSG_DateTime::Parse_Date
bool Parse_Date(const CSG_String &date)
Definition: datetime.cpp:476
CSG_Parameters::Assign
bool Assign(CSG_Parameters *pSource)
Definition: parameters.cpp:1453
CSG_Rect
Definition: geo_tools.h:471
CSG_Parameter_Date
Definition: parameters.h:571
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:745
CSG_Parameter_Range::Set_Min
bool Set_Min(double Min)
Definition: parameter_data.cpp:802
CSG_Parameter_List::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:3099
CSG_Parameter_Grid::m_Type
TSG_Data_Type m_Type
Definition: parameters.h:1213
CSG_Parameter::asPointer
void * asPointer(void) const
Definition: parameters.h:285
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameter_File_Name::Get_Filter
const SG_Char * Get_Filter(void) const
Definition: parameter_data.cpp:1553
CSG_Parameter_Fixed_Table::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:1888
CSG_Parameter_Bool::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:298
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Parameter_String::is_Valid
virtual bool is_Valid(void) const
Definition: parameter_data.cpp:1454
SG_GET_RGB
#define SG_GET_RGB(r, g, b)
Definition: api_core.h:1253
CSG_Parameter_Degree::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:621
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
CSG_Parameter_Grid_System::m_System
CSG_Grid_System m_System
Definition: parameters.h:1031
CSG_Parameter_Choice::Set_Items
bool Set_Items(const SG_Char *String)
Definition: parameter_data.cpp:934
CSG_Parameter_File_Name::Get_FilePaths
bool Get_FilePaths(CSG_Strings &FilePaths) const
Definition: parameter_data.cpp:1575
CSG_Parameter_Grid
Definition: parameters.h:1194
CSG_Parameter_Value::Set_Minimum
void Set_Minimum(double Minimum, bool bOn=true)
Definition: parameter_data.cpp:371
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_String_Tokenizer::Has_More_Tokens
bool Has_More_Tokens(void) const
Definition: api_string.cpp:1464
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_Parameter_Grid_System::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:2092
SG_DATATYPE_Binary
@ SG_DATATYPE_Binary
Definition: api_core.h:1000
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3013
SG_GET_B
#define SG_GET_B(rgb)
Definition: api_core.h:1258
CSG_Parameter_Table_Fields::Get_Table
CSG_Table * Get_Table(void) const
Definition: parameter_data.cpp:2426
CSG_Parameter_Choice::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1095
CSG_Parameter_Data_Object_Output::Set_DataObject_Type
bool Set_DataObject_Type(TSG_Data_Object_Type Type)
Definition: parameter_data.cpp:2640
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Parameter::m_String
CSG_String m_String
Definition: parameters.h:330
CSG_Parameter_Parameters::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:3490
CSG_Parameter_Range::m_pMax
CSG_Parameter_Double * m_pMax
Definition: parameters.h:638
CSG_Parameter_Data_Object::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2475
SG_DATATYPES_Undefined
#define SG_DATATYPES_Undefined
Definition: api_core.h:1006
CSG_Parameter_Int::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:483
CSG_Parameter_PointCloud::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2993
CSG_Parameter_Grid_System::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:1992
SG_Color_From_Text
bool SG_Color_From_Text(const CSG_String &Text, long &Color)
Definition: api_colors.cpp:79
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_Parameter_Colors::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:1814
CSG_Parameter_Table_Fields::m_nFields
int m_nFields
Definition: parameters.h:1110
CSG_Parameter_Range::Get_Max
double Get_Max(void) const
Definition: parameter_data.cpp:832
CSG_Parameter_Data_Object_Output::m_Type
TSG_Data_Object_Type m_Type
Definition: parameters.h:1178
CSG_Parameter_Grids_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1439
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
CSG_Parameter_Int::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:443
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
SG_Degree_To_Double
SAGA_API_DLL_EXPORT double SG_Degree_To_Double(const CSG_String &String)
Definition: api_string.cpp:1240
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:994
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_Parameters::Get_Owner
void * Get_Owner(void) const
Definition: parameters.h:1670
CSG_Table_Record
Definition: table.h:130
CSG_Parameter_String::CSG_Parameter_String
CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1447
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
CSG_Parameter_Choice::Add_Item
bool Add_Item(const CSG_String &Item, const CSG_String &Data="")
Definition: parameter_data.cpp:918
CSG_Parameter_Choices::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:1292
CSG_Parameter_Shapes_List::CSG_Parameter_Shapes_List
CSG_Parameter_Shapes_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3394
CSG_Parameter_String::is_Password
bool is_Password(void) const
Definition: parameter_data.cpp:1466
data_manager.h
CSG_Parameter_Value::Set_Maximum
void Set_Maximum(double Maximum, bool bOn=true)
Definition: parameter_data.cpp:391
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Parameter_Grid_System::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2104
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_Colors::Get_Blue
long Get_Blue(int Index) const
Definition: api_core.h:1360
CSG_DateTime::Parse_ISODate
bool Parse_ISODate(const CSG_String &date)
Definition: datetime.cpp:507
CSG_Parameter_Bool::CSG_Parameter_Bool
CSG_Parameter_Bool(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:231
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Parameter_Choice::CSG_Parameter_Choice
CSG_Parameter_Choice(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:891
CSG_Parameter_Choices::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:1272
CSG_Parameter_Table_Field::m_Default
int m_Default
Definition: parameters.h:1070
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Grid_System
Definition: grid.h:200
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Parameter_Parameters::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:3476
CSG_Parameter_Shapes_List::m_Type
TSG_Shape_Type m_Type
Definition: parameters.h:1501
CSG_Parameter_Grid::_asDouble
virtual double _asDouble(void) const
Definition: parameter_data.cpp:2780
CSG_Parameter_Node::CSG_Parameter_Node
CSG_Parameter_Node(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:217
CSG_Parameter_TIN_List::CSG_Parameter_TIN_List
CSG_Parameter_TIN_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3423
CSG_Parameter_Parameters::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter_data.cpp:3464
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Parameters::Add_Info_Value
CSG_Parameter * Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
Definition: parameters.cpp:390
CSG_Parameter_PointCloud::CSG_Parameter_PointCloud
CSG_Parameter_PointCloud(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2959
CSG_Grids::Get_Grid_Count
int Get_Grid_Count(void) const
Definition: grids.h:237
CSG_Parameter_Choice::Del_Items
bool Del_Items(void)
Definition: parameter_data.cpp:910
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:600
CSG_Parameter_Choice::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:1040
CSG_Parameter_Range::m_pMin
CSG_Parameter_Double * m_pMin
Definition: parameters.h:638
CSG_Parameter_Font::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:1675
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
CSG_Parameter_Int::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:489
CSG_Parameter_Value::CSG_Parameter_Value
CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:328
CSG_Parameter_Font::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:1681
CSG_Parameter_Value::Set_Valid_Range
bool Set_Valid_Range(double Minimum, double Maximum)
Definition: parameter_data.cpp:339
CSG_Parameter_Color::CSG_Parameter_Color
CSG_Parameter_Color(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1734
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Parameter_Fixed_Table::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1894
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Parameter_Colors::m_Colors
CSG_Colors m_Colors
Definition: parameters.h:966
CSG_Parameter_File_Name::CSG_Parameter_File_Name
CSG_Parameter_File_Name(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1530
CSG_Parameter_Choice::Toggle_Value
virtual bool Toggle_Value(void)
Definition: parameter_data.cpp:904
CSG_Parameter_Shapes::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2864
CSG_Parameter_String::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:1472
CSG_Parameter_Table_Field::CSG_Parameter_Table_Field
CSG_Parameter_Table_Field(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2147
CSG_Parameter_Data_Object::m_pDataObject
CSG_Data_Object * m_pDataObject
Definition: parameters.h:1142
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
SG_DATATYPES_Integer
#define SG_DATATYPES_Integer
Definition: api_core.h:1025
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Parameter_Colors::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:1808
CSG_Parameter_Choices::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:758
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Parameter_Parameters::CSG_Parameter_Parameters
CSG_Parameter_Parameters(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3452
CSG_Parameter_Double::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:572
CSG_Parameter_Table_Field::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:2179
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Parameter_Bool::is_Default
virtual bool is_Default(void) const
Definition: parameter_data.cpp:238
CSG_Parameter_Table_Field
Definition: parameters.h:1054
CSG_Parameter_Table::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2823
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:389
CSG_Parameter_File_Name::m_Filter
CSG_String m_Filter
Definition: parameters.h:879
CSG_Data_Object::Get_ObjectType
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.
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_Parameter_Colors::CSG_Parameter_Colors
CSG_Parameter_Colors(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1787
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1072
CSG_Parameter_Value
Definition: parameters.h:434
CSG_Parameter_Grid_List::CSG_Parameter_Grid_List
CSG_Parameter_Grid_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3161
CSG_Parameter_Table_Field::Add_Default
bool Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
Definition: parameter_data.cpp:2155
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_Parameter_Parameters::CSG_Parameters
friend class CSG_Parameters
Definition: parameters.h:1587
CSG_Parameter_String::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1485
CSG_Colors::Set_Blue
bool Set_Blue(int Index, int Value)
Definition: api_colors.cpp:336
CSG_DateTime::is_EqualTo
bool is_EqualTo(const CSG_DateTime &DateTime) const
Definition: datetime.cpp:428
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_Colors::Get_Red
long Get_Red(int Index) const
Definition: api_core.h:1358
CSG_Grid_System::Create
bool Create(const CSG_Grid_System &System)
Definition: grid_system.cpp:129
CSG_Parameter_List::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:3105
CSG_Parameter_Choice::Get_Data
CSG_String Get_Data(void) const
Definition: parameter_data.cpp:1013
CSG_Parameter_Table_Field::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:2237
CSG_Parameter_Data_Type::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1246
CSG_Parameter_Data_Object::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:2519
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_Parameter_Font
Definition: parameters.h:895
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_Parameter_Color::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:1741
CSG_Parameter_Grid_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3250
CSG_Parameter::Get_Parameters
CSG_Parameters * Get_Parameters(void) const
Definition: parameter.cpp:99
CSG_Parameter_Bool::Toggle_Value
virtual bool Toggle_Value(void)
Definition: parameter_data.cpp:244
CSG_Parameter_Choice::m_Items
CSG_Strings m_Items
Definition: parameters.h:691
CSG_Parameter::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter.cpp:739
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Parameter_Choices::Add_Item
void Add_Item(const CSG_String &Item, const CSG_String &Data="")
Definition: parameter_data.cpp:1354
CSG_Parameter_Grid_List::m_Grids
CSG_Array_Pointer m_Grids
Definition: parameters.h:1424
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SG_Parameter_Type_Get_Name
CSG_String SG_Parameter_Type_Get_Name(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:64
CSG_Parameter_Double::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:578
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
SSG_Rect
Definition: geo_tools.h:464
CSG_Data_Object::Get_Owner
CSG_Data_Object * Get_Owner(void) const
Definition: dataobject.h:222
CSG_Parameter::asGridList
class CSG_Parameter_Grid_List * asGridList(void) const
Definition: parameter.cpp:1047
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_Parameter_Font::m_Color
int m_Color
Definition: parameters.h:907
SG_GET_R
#define SG_GET_R(rgb)
Definition: api_core.h:1256
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
CSG_Parameter_Range::m_pRange
CSG_Parameters * m_pRange
Definition: parameters.h:636
CSG_Parameters::has_GUI
bool has_GUI(void) const
Definition: parameters.cpp:242
SG_Data_Type_Get_Identifier
CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
Definition: api_core.cpp:146
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_String::BeforeLast
CSG_String BeforeLast(char Character) const
Definition: api_string.cpp:677
CSG_Parameter_Date::m_Date
CSG_DateTime m_Date
Definition: parameters.h:584
CSG_DateTime::Format_ISODate
CSG_String Format_ISODate(void) const
Definition: datetime.cpp:460
SG_DATATYPES_Table
#define SG_DATATYPES_Table
Definition: api_core.h:1028
CSG_Parameter_Data_Object::is_Valid
virtual bool is_Valid(void) const
Definition: parameter_data.cpp:2469
CSG_Parameter_Data_Type::Set_Data_Type
bool Set_Data_Type(TSG_Data_Type Value)
Definition: parameter_data.cpp:1216
CSG_Parameter_Data_Object_Output::CSG_Parameter_Data_Object_Output
CSG_Parameter_Data_Object_Output(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2605
CSG_Colors::Get_Predefined_Count
static int Get_Predefined_Count(void)
Definition: api_colors.cpp:429
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:294
CSG_Parameter_File_Name::Set_Flag_Multiple
void Set_Flag_Multiple(bool bFlag)
Definition: parameter_data.cpp:1564
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
CSG_Parameter_Degree::CSG_Parameter_Degree
CSG_Parameter_Degree(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:608
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_Parameter_Shapes
Definition: parameters.h:1278
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3055
CSG_Parameter_Colors::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:1820
CSG_Parameter_Font::CSG_Parameter_Font
CSG_Parameter_Font(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1627
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Grid_System::Get_Name
const SG_Char * Get_Name(bool bShort=true)
Definition: grid_system.cpp:249
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Colors::Get_Count
int Get_Count(void) const
Definition: api_core.h:1345
CSG_Parameter_File_Name::Set_Flag_Save
void Set_Flag_Save(bool bFlag)
Definition: parameter_data.cpp:1559
CSG_Parameter_Text::CSG_Parameter_Text
CSG_Parameter_Text(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1516
CSG_Parameter_Table_Field::Get_Choices
static CSG_String Get_Choices(const class CSG_Table &Table, bool bAllowNone=false)
Definition: parameter_data.cpp:2296
CSG_Parameter_Table_Fields::m_Fields
int * m_Fields
Definition: parameters.h:1110
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Parameter_Data_Type::CSG_Parameter_Data_Type
CSG_Parameter_Data_Type(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1133
CSG_Colors::Create
bool Create(void)
Definition: api_colors.cpp:204
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter_Int::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:497
CSG_Parameter
Definition: parameters.h:207
CSG_Parameter_Table_Fields::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:2339
CSG_Parameter_TIN::CSG_Parameter_TIN
CSG_Parameter_TIN(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2918
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
CSG_Parameter_Range::CSG_Parameter_Range
CSG_Parameter_Range(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:746
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Parameter_Grid_System
Definition: parameters.h:1021
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:590
CSG_Parameter_Int::CSG_Parameter_Int
CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:430
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:502
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1022
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Parameter_Font::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1696
CSG_Array_Int::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:442
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
SG_PARAMETER_DATA_SET_CHANGED
#define SG_PARAMETER_DATA_SET_CHANGED
Definition: parameters.h:196
CSG_Parameters::Restore_Defaults
bool Restore_Defaults(bool bClearData=false)
Definition: parameters.cpp:1421
SG_GET_G
#define SG_GET_G(rgb)
Definition: api_core.h:1257
CSG_Parameter_Date::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:692
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Grid_System::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: grid_system.cpp:302
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Colors::Set_Red
bool Set_Red(int Index, int Value)
Definition: api_colors.cpp:324
CSG_Parameter::Set_Default
bool Set_Default(int Value)
Definition: parameter.cpp:851
CSG_Parameter_Data_Type::Set_Data_Types
bool Set_Data_Types(int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
Definition: parameter_data.cpp:1149
CSG_Parameter_Grid_System::CSG_Parameter_Grid_System
CSG_Parameter_Grid_System(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1985
CSG_Parameter_Fixed_Table::m_Table
CSG_Table m_Table
Definition: parameters.h:1000
CSG_Parameter_Grids_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3319
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3025
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter_File_Name
Definition: parameters.h:853
CSG_Parameter_Data_Object::CSG_Parameter_Data_Object
CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2462
CSG_Parameter_Parameters::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:3482
SG_Parameter_Type_Get_Identifier
CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:114
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
CSG_Parameter_Shapes_List::Set_Shape_Type
void Set_Shape_Type(TSG_Shape_Type Type)
Definition: parameter_data.cpp:3401
SG_DATATYPES_Bit
#define SG_DATATYPES_Bit
Definition: api_core.h:1007
CSG_Parameter_Range::~CSG_Parameter_Range
virtual ~CSG_Parameter_Range(void)
Definition: parameter_data.cpp:763
CSG_Parameter_Font::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:1647
CSG_Parameter_Shapes::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2903
CSG_Parameter_Grid::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2712
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Parameter_Choice::Get_Count
int Get_Count(void) const
Definition: parameters.h:682
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:598
CSG_Parameter_File_Name::Set_Filter
void Set_Filter(const SG_Char *Filter)
Definition: parameter_data.cpp:1541
CSG_Parameter_Double::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:586
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Parameter_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: parameters.h:1291
CSG_Parameter_Table_Field::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:2273
CSG_Parameter_Range::is_Default
virtual bool is_Default(void) const
Definition: parameter_data.cpp:838
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:255
CSG_Parameter_File_Name::m_bMultiple
bool m_bMultiple
Definition: parameters.h:877
SG_Parameter_Type_Get_Type
TSG_Parameter_Type SG_Parameter_Type_Get_Type(const CSG_String &Identifier)
Definition: parameter_data.cpp:164
CSG_Parameter_Value::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:411
CSG_Grids::Get_Grid_Ptr
CSG_Grid * Get_Grid_Ptr(int i) const
Definition: grids.h:248
CSG_Colors::Set_Green
bool Set_Green(int Index, int Value)
Definition: api_colors.cpp:330
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Grid_System::Destroy
bool Destroy(void)
Definition: grid_system.cpp:217
CSG_Parameter_Date::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:641
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Parameter_Data_Type::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1252
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
CSG_Colors::Set_Count
bool Set_Count(int nColors)
Definition: api_colors.cpp:258
CSG_DateTime::Get_JDN
double Get_JDN(void) const
Definition: datetime.cpp:411
SG_PARAMETER_DATA_SET_FALSE
#define SG_PARAMETER_DATA_SET_FALSE
Definition: parameters.h:194
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Parameter_Table_Fields::CSG_Parameter_Table_Fields
CSG_Parameter_Table_Fields(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2325
CSG_Parameter_Range::Set_Range
bool Set_Range(double Min, double Max)
Definition: parameter_data.cpp:783
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:401
SG_Get_Significant_Decimals
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
Definition: api_string.cpp:1274
SG_String_Tokenize
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1493
CSG_Parameter_Bool::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:306
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Parameter_Value::m_bMaximum
bool m_bMaximum
Definition: parameters.h:452
CSG_Parameter_Choices::m_Items
CSG_Strings m_Items[2]
Definition: parameters.h:776
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Parameter_Value::m_Maximum
double m_Maximum
Definition: parameters.h:454
CSG_Parameter_Table::CSG_Parameter_Table
CSG_Parameter_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2816
CSG_Parameter_Colors::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1826
CSG_Parameter_Choices::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1414
CSG_Parameter_Fixed_Table::CSG_Parameter_Fixed_Table
CSG_Parameter_Fixed_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1875
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Parameter_Choice::is_Default
virtual bool is_Default(void) const
Definition: parameter_data.cpp:898
SG_DATATYPES_Standard
#define SG_DATATYPES_Standard
Definition: api_core.h:1022
CSG_Parameter_Font::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter_data.cpp:1634
CSG_Strings
Definition: api_core.h:693
CSG_DateTime
Definition: datetime.h:183
CSG_Parameter_Choices::Del_Items
void Del_Items(void)
Definition: parameter_data.cpp:1345
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Parameter_Range::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:778
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1042
SG_PARAMETER_DATA_SET_TRUE
#define SG_PARAMETER_DATA_SET_TRUE
Definition: parameters.h:195
CSG_Parameter_Table_Field::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2262
CSG_Parameter_Grid::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:2774
CSG_Parameter_Grid::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2786
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Parameter_File_Name::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1606
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
CSG_Parameter_Choice::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:1089
parameters.h
CSG_Parameter_Data_Object_Output::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2612
CSG_Parameter_Grid_List::Get_System
CSG_Grid_System * Get_System(void) const
Definition: parameter_data.cpp:3168
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_DATATYPES_Numeric
#define SG_DATATYPES_Numeric
Definition: api_core.h:1027
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
CSG_Parameter_Shapes_List
Definition: parameters.h:1486
CSG_Parameter_Shapes::Set_Shape_Type
void Set_Shape_Type(TSG_Shape_Type Type)
Definition: parameter_data.cpp:2897
CSG_Parameter_Grids::CSG_Parameter_Grids
CSG_Parameter_Grids(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2802
CSG_Parameter_Data_Object::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:2488
CSG_Parameter_Font::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1687
CSG_Parameter_Double::m_Value
double m_Value
Definition: parameters.h:520
CSG_Parameter_Date::Set_Date
void Set_Date(const CSG_DateTime &Date)
Definition: parameter_data.cpp:710
CSG_Parameter_Int
Definition: parameters.h:470
CSG_Parameter_String::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1494
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
CSG_Table
Definition: table.h:283
CSG_Parameter_Choice::m_Data
CSG_Strings m_Data
Definition: parameters.h:691
SG_Double_To_Degree
SAGA_API_DLL_EXPORT CSG_String SG_Double_To_Degree(double Value)
Definition: api_string.cpp:1210
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_Parameter_String::m_bPassword
bool m_bPassword
Definition: parameters.h:814
CSG_Parameter_Shapes::CSG_Parameter_Shapes
CSG_Parameter_Shapes(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2857
CSG_Parameter_Range::Set_Max
bool Set_Max(double Max)
Definition: parameter_data.cpp:820
CSG_Parameter_File_Name::m_bDirectory
bool m_bDirectory
Definition: parameters.h:877
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
SG_DATAOBJECT_TYPE_Undefined
@ SG_DATAOBJECT_TYPE_Undefined
Definition: dataobject.h:124
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Parameter::Get_Default
const CSG_String & Get_Default(void) const
Definition: parameter.cpp:875
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
CSG_Parameter_Choice::Get_Item
const SG_Char * Get_Item(int Index) const
Definition: parameter_data.cpp:992
CSG_Parameter_Grid::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1197
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:105
CSG_Parameter_Range::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter_data.cpp:844
CSG_Parameter_Double::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:532
CSG_Parameter_Choice::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1107
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:275
CSG_Parameter_Double
Definition: parameters.h:508
CSG_Parameter_Range::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:859
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:238
CSG_Parameter_Table_Field::_asDouble
virtual double _asDouble(void) const
Definition: parameter_data.cpp:2256
CSG_Parameter_Data_Type::Get_Data_Type
TSG_Data_Type Get_Data_Type(TSG_Data_Type Default=SG_DATATYPE_Undefined) const
Definition: parameter_data.cpp:1238
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Parameter_Parameters::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:3470
CSG_Parameter_List::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:3121
CSG_Parameter_Grid::Add_Default
bool Add_Default(double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
Definition: parameter_data.cpp:2696
CSG_String
Definition: api_core.h:557
CSG_Parameter_Choices::Clr_Selection
bool Clr_Selection(void)
Definition: parameter_data.cpp:1406
CSG_Parameter_List::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:3093
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Parameter_Parameters::m_pParameters
CSG_Parameters * m_pParameters
Definition: parameters.h:1576
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
CSG_Parameter_Date::_asDouble
virtual double _asDouble(void) const
Definition: parameter_data.cpp:704
CSG_Parameter_Data_Object::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2511
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_Parameter_Table_Field::Get_Table
CSG_Table * Get_Table(void) const
Definition: parameter_data.cpp:2171
CSG_Colors::Get_Green
long Get_Green(int Index) const
Definition: api_core.h:1359
CSG_Parameter_Date::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:724
CSG_MetaData
Definition: metadata.h:88
CSG_Parameter_File_Name::m_bSave
bool m_bSave
Definition: parameters.h:877
CSG_Parameters::Serialize
bool Serialize(CSG_MetaData &Data, bool bSave)
Definition: parameters.h:1828
CSG_Parameter_Colors::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:1794
CSG_Parameter_String
Definition: parameters.h:799
CSG_Parameter_Degree::_Set_Value
virtual int _Set_Value(const CSG_String &Value)
Definition: parameter_data.cpp:615
CSG_Parameter_Color::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1761
CSG_Parameter_Choice::m_Value
int m_Value
Definition: parameters.h:689
CSG_Parameter_Grid_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3179
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1281
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Parameter_Choices::m_Selection
CSG_Array_Int m_Selection
Definition: parameters.h:778
CSG_Parameter_Grid_List::Update_Data
virtual bool Update_Data(void)
Definition: parameter_data.cpp:3256
CSG_Parameter_TIN::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2925
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:832
CSG_Parameter_Date::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:698
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
CSG_Parameter_Choices::Select
bool Select(int Index, bool bSelect=true)
Definition: parameter_data.cpp:1375
CSG_Parameter_Table_Fields::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:2420
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
CSG_Parameter_File_Name::Set_Flag_Directory
void Set_Flag_Directory(bool bFlag)
Definition: parameter_data.cpp:1569
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_DateTime::Set
CSG_DateTime & Set(const CSG_DateTime &DateTime)
Definition: datetime.cpp:131
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Parameter_PointCloud::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2966
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Parameter_Grid::m_Default
int m_Default
Definition: parameters.h:1211
CSG_Parameter_Grid_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1405
CSG_Parameter_Choices::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1425
CSG_Parameter_Fixed_Table::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:1882
CSG_Parameter_Grid::CSG_Parameter_Grid
CSG_Parameter_Grid(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:2672
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Array_Pointer::Add
bool Add(void *Value)
Definition: api_memory.cpp:485
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
CSG_Data_Manager::Find
CSG_Data_Object * Find(const CSG_String &File, bool bNative=true) const
Definition: data_manager.cpp:405
CSG_Parameter::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameter.cpp:111
CSG_Grid
Definition: grid.h:473
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Parameter_Range::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:769
CSG_Parameter_Table_Fields::~CSG_Parameter_Table_Fields
virtual ~CSG_Parameter_Table_Fields(void)
Definition: parameter_data.cpp:2333
CSG_Parameter_Double::CSG_Parameter_Double
CSG_Parameter_Double(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:519
CSG_MetaData::Fmt_Content
void Fmt_Content(const char *Format,...)
Definition: metadata.cpp:491
CSG_Parameter_Colors::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1832
CSG_Parameter_Parameters::~CSG_Parameter_Parameters
virtual ~CSG_Parameter_Parameters(void)
Definition: parameter_data.cpp:3458
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Parameter_Table_Fields::_asInt
virtual int _asInt(void) const
Definition: parameter_data.cpp:2414
CSG_Parameter_Choice
Definition: parameters.h:659
CSG_Parameter_Table_List::CSG_Parameter_Table_List
CSG_Parameter_Table_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3379
CSG_Parameter_Grid_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3238
CSG_Parameter_Bool::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:292
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:195
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
ADD_TYPE
#define ADD_TYPE(type)
CSG_MetaData::Cmp_Content
bool Cmp_Content(const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:533
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_Parameter_Int::m_Value
int m_Value
Definition: parameters.h:482
CSG_Parameter_Choices::is_Selected
bool is_Selected(int Index)
Definition: parameter_data.cpp:1361
CSG_Parameter_Grid::Get_System
CSG_Grid_System * Get_System(void) const
Definition: parameter_data.cpp:2685
CSG_Parameters
Definition: parameters.h:1650
SG_Data_Type_Get_Type
TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
Definition: api_core.cpp:152
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Parameter_Range::Get_Min
double Get_Min(void) const
Definition: parameter_data.cpp:814
CSG_Array_Int::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:435
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Parameter_Value::m_bMinimum
bool m_bMinimum
Definition: parameters.h:452
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Parameter_List
Definition: parameters.h:1359
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:968
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_String_Tokenizer
Definition: api_core.h:754
CSG_Parameter_Table_Fields::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:2440
CSG_Parameter_Shapes_List::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:3407
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter_Double::is_Default
virtual bool is_Default(void) const
Definition: parameter_data.cpp:526
CSG_Parameter_Bool::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:250
CSG_Grids
Definition: grids.h:119
CSG_Parameter_Choices::Get_Items
CSG_String Get_Items(void) const
Definition: parameter_data.cpp:1327
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
CSG_Parameter_Choice::Get_Item_Data
CSG_String Get_Item_Data(int Index) const
Definition: parameter_data.cpp:1003
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
CSG_Array_Int::Destroy
void Destroy(void)
Definition: api_core.h:429
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
CSG_Parameter_Choices::Set_Items
void Set_Items(const CSG_String &Items)
Definition: parameter_data.cpp:1303
CSG_Parameter_Value::m_Minimum
double m_Minimum
Definition: parameters.h:454
CSG_Parameter_Range::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:850
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Parameter_List::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:3068
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter_Bool::m_Value
bool m_Value
Definition: parameters.h:409
CSG_Parameter_String::Set_Password
void Set_Password(bool bOn)
Definition: parameter_data.cpp:1460
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
CSG_Parameter_List::CSG_Parameter_List
CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3006
CSG_String_Tokenizer::Get_Next_Token
CSG_String Get_Next_Token(void)
Definition: api_string.cpp:1442
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
CSG_Colors::Assign
bool Assign(const CSG_Colors &Colors)
Definition: api_colors.cpp:1031
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:887
CSG_Parameter_Choice::Get_Items
CSG_String Get_Items(void) const
Definition: parameter_data.cpp:974
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Parameter_Grids_List::CSG_Parameter_Grids_List
CSG_Parameter_Grids_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3301
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameter_Table_Fields::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2434
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1306
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter_Int::is_Default
virtual bool is_Default(void) const
Definition: parameter_data.cpp:437
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
CSG_Parameter_PointCloud_List::CSG_Parameter_PointCloud_List
CSG_Parameter_PointCloud_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:3438
CSG_Parameter_Fixed_Table::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1900
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:122
CSG_Parameter_Range::CSG_Parameters
friend class CSG_Parameters
Definition: parameters.h:649
CSG_Parameter_Date::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:716
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
CSG_Parameter_Grid_System::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:2112
CSG_Grids::Get_NZ
int Get_NZ(void) const
Definition: grids.h:187
CSG_Parameter_Grid::Set_Preferred_Type
void Set_Preferred_Type(TSG_Data_Type Type)
Definition: parameter_data.cpp:2679
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
CSG_Parameter_Data_Object::_asPointer
virtual void * _asPointer(void) const
Definition: parameter_data.cpp:2505
CSG_Parameter_Choices::CSG_Parameter_Choices
CSG_Parameter_Choices(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:1265
CSG_Parameter_Date::CSG_Parameter_Date
CSG_Parameter_Date(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameter_data.cpp:634
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: parameters.cpp File Reference

  • saga_core
  • saga_api
parameters.cpp File Reference
#include "parameters.h"
#include "data_manager.h"
#include "tool.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: parameters.cpp Source File

  • saga_core
  • saga_api
parameters.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // parameters.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "parameters.h"
54 #include "data_manager.h"
55 #include "tool.h"
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 CSG_Parameters::CSG_Parameters(void)
66 {
67 _On_Construction();
68 }
69
70 //---------------------------------------------------------
71 CSG_Parameters::CSG_Parameters(const CSG_Parameters &Parameters)
72 {
73 _On_Construction();
74
75 Create(Parameters);
76 }
77
78 //---------------------------------------------------------
79 CSG_Parameters::CSG_Parameters(const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
80 {
81 _On_Construction();
82
83 Create(Name, Description, Identifier, bGrid_System);
84 }
85
86 //---------------------------------------------------------
87 CSG_Parameters::CSG_Parameters(void *pOwner, const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
88 {
89 _On_Construction();
90
91 Create(pOwner, Name, Description, Identifier, bGrid_System);
92 }
93
94 //---------------------------------------------------------
95 CSG_Parameters::~CSG_Parameters(void)
96 {
97 Destroy();
98 }
99
100
102 // //
104
105 //---------------------------------------------------------
106 void CSG_Parameters::_On_Construction(void)
107 {
108 m_pOwner = NULL;
109 m_pTool = NULL;
110 m_pManager = &SG_Get_Data_Manager();
111
112 m_Parameters = NULL;
113 m_nParameters = 0;
114
115 m_Callback = NULL;
116 m_bCallback = true;
117
118 m_pGrid_System = NULL;
119 }
120
121 //---------------------------------------------------------
122 bool CSG_Parameters::Create(const CSG_Parameters &Parameters)
123 {
124 Destroy();
125
126 m_pOwner = Parameters.m_pOwner;
127 m_pTool = Parameters.m_pTool;
128 m_pManager = Parameters.m_pManager;
129
130 m_Callback = Parameters.m_Callback;
131 m_bCallback = Parameters.m_bCallback;
132
133 Set_Identifier (Parameters.Get_Identifier ());
134 Set_Name (Parameters.Get_Name ());
135 Set_Description (Parameters.Get_Description());
136
137 //-----------------------------------------------------
138 for(int i=0; i<Parameters.m_nParameters; i++)
139 {
140 _Add(Parameters.m_Parameters[i]);
141 }
142
143 if( Parameters.m_pGrid_System )
144 {
145 m_pGrid_System = Get_Parameter(Parameters.m_pGrid_System->Get_Identifier());
146 }
147
148 return( m_nParameters == Parameters.m_nParameters );
149 }
150
151 //---------------------------------------------------------
152 bool CSG_Parameters::Create(const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
153 {
154 Destroy();
155
156 Set_Identifier (Identifier);
157 Set_Name (Name);
158 Set_Description(Description ? Description : SG_T(""));
159
160 if( bGrid_System )
161 {
162 Use_Grid_System();
163 }
164
165 return( true );
166 }
167
168 //---------------------------------------------------------
169 bool CSG_Parameters::Create(void *pOwner, const SG_Char *Name, const SG_Char *Description, const SG_Char *Identifier, bool bGrid_System)
170 {
171 if( Create(Name, Description, Identifier, bGrid_System) )
172 {
173 m_pOwner = pOwner;
174
175 return( true );
176 }
177
178 return( false );
179 }
180
181 //---------------------------------------------------------
182 void CSG_Parameters::Destroy(void)
183 {
184 m_pOwner = NULL;
185 m_pTool = NULL;
186 m_pGrid_System = NULL;
187
188 Del_Parameters();
189
190 m_References.Clear();
191 }
192
193
195 // //
197
198 //---------------------------------------------------------
205 //---------------------------------------------------------
206 void CSG_Parameters::Set_Manager(CSG_Data_Manager *pManager)
207 {
208 m_pManager = pManager;
209
210 for(int i=0; i<Get_Count(); i++)
211 {
212 if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters )
213 {
214 m_Parameters[i]->asParameters()->Set_Manager(pManager);
215 }
216 }
217 }
218
219 //---------------------------------------------------------
223 //---------------------------------------------------------
224 bool CSG_Parameters::Use_Grid_System(void)
225 {
226 if( !m_pGrid_System )
227 {
228 m_pGrid_System = Add_Grid_System("", "PARAMETERS_GRID_SYSTEM", _TL("Grid System"), _TL(""));
229
230 return( true );
231 }
232
233 return( false );
234 }
235
236 //---------------------------------------------------------
241 //---------------------------------------------------------
242 bool CSG_Parameters::has_GUI(void) const
243 {
244 return( Get_Tool() ? Get_Tool()->has_GUI() : (Get_Owner() && SG_UI_Get_Window_Main()) );
245 }
246
247 //---------------------------------------------------------
251 //---------------------------------------------------------
252 void CSG_Parameters::Set_Identifier(const CSG_String &Identifier)
253 {
254 m_Identifier = Identifier;
255 }
256
257 //---------------------------------------------------------
261 //---------------------------------------------------------
262 bool CSG_Parameters::Cmp_Identifier(const CSG_String &Identifier) const
263 {
264 return( m_Identifier.Cmp(Identifier) == 0 );
265 }
266
267 //---------------------------------------------------------
271 //---------------------------------------------------------
272 void CSG_Parameters::Set_Name(const CSG_String &Name)
273 {
274 m_Name = Name;
275 }
276
277 //---------------------------------------------------------
281 //---------------------------------------------------------
282 void CSG_Parameters::Set_Description(const CSG_String &Description)
283 {
284 m_Description = Description;
285 }
286
287 //---------------------------------------------------------
291 //---------------------------------------------------------
292 void CSG_Parameters::Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link, const SG_Char *Link_Text)
293 {
294 CSG_String Reference("<b>" + Authors + " (" + Year + "):</b> " + Title + ". " + Where);
295
296 if( Link && *Link )
297 {
298 Reference += CSG_String::Format(" <a href=\"%s\">%s</a>.", Link, Link_Text && *Link_Text ? Link_Text : Link);
299 }
300
301 if( !Reference.is_Empty() )
302 {
303 m_References += Reference;
304 }
305
306 m_References.Sort();
307 }
308
309 //---------------------------------------------------------
313 //---------------------------------------------------------
314 void CSG_Parameters::Add_Reference(const CSG_String &Link, const SG_Char *Link_Text)
315 {
316 m_References += CSG_String::Format("<a href=\"%s\">%s</a>", Link.c_str(), Link_Text && *Link_Text ? Link_Text : Link.c_str());
317
318 m_References.Sort();
319 }
320
321 //---------------------------------------------------------
325 //---------------------------------------------------------
326 void CSG_Parameters::Del_References(void)
327 {
328 m_References.Clear();
329 }
330
331 //---------------------------------------------------------
335 //---------------------------------------------------------
336 void CSG_Parameters::Set_Enabled(bool bEnabled)
337 {
338 for(int i=0; i<m_nParameters; i++)
339 {
340 m_Parameters[i]->Set_Enabled(bEnabled);
341 }
342 }
343
344 //---------------------------------------------------------
348 //---------------------------------------------------------
349 void CSG_Parameters::Set_Enabled(const CSG_String &Identifier, bool bEnabled)
350 {
351 CSG_Parameter *pParameter = Get_Parameter(Identifier);
352
353 if( pParameter )
354 {
355 pParameter->Set_Enabled(bEnabled);
356 }
357 }
358
359
361 // //
363
364 //---------------------------------------------------------
365 CSG_Parameter * CSG_Parameters::Add_Parameter(CSG_Parameter *pParameter)
366 {
367 return( _Add(pParameter) );
368 }
369
370 //---------------------------------------------------------
371 CSG_Parameter * CSG_Parameters::Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
372 {
373 return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Node, PARAMETER_INFORMATION) );
374 }
375
376 //---------------------------------------------------------
385 CSG_Parameter * CSG_Parameters::Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
386 {
387 return( _Add_Value(ParentID, ID, Name, Description, false, Type, Value, Minimum, bMinimum, Maximum, bMaximum) );
388 }
389
390 CSG_Parameter * CSG_Parameters::Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value)
391 {
392 return( _Add_Value(ParentID, ID, Name, Description, true, Type, Value, 0.0, false, 0.0, false) );
393 }
394
395 //---------------------------------------------------------
396 CSG_Parameter * CSG_Parameters::Add_Bool (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value)
397 {
398 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Bool , Value ? 1.0 : 0.0) );
399 }
400
401 CSG_Parameter * CSG_Parameters::Add_Int (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value, int Minimum, bool bMinimum, int Maximum, bool bMaximum)
402 {
403 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Int , Value, Minimum, bMinimum, Maximum, bMaximum) );
404 }
405
406 CSG_Parameter * CSG_Parameters::Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
407 {
408 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Double, Value, Minimum, bMinimum, Maximum, bMaximum) );
409 }
410
411 CSG_Parameter * CSG_Parameters::Add_Degree(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
412 {
413 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Degree, Value, Minimum, bMinimum, Maximum, bMaximum) );
414 }
415
416 CSG_Parameter * CSG_Parameters::Add_Date (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value) // Julian Day Number
417 {
418 if( !Value )
419 {
420 Value = CSG_DateTime::Now().Get_JDN();
421 }
422
423 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Date , Value) );
424 }
425
426 CSG_Parameter * CSG_Parameters::Add_Color (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value)
427 {
428 return( Add_Value(ParentID, ID, Name, Description, PARAMETER_TYPE_Color , Value) );
429 }
430
431 //---------------------------------------------------------
432 CSG_Parameter * CSG_Parameters::Add_Range (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min, double Range_Max, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
433 {
434 return( _Add_Range(ParentID, ID, Name, Description, false, Range_Min, Range_Max, Minimum, bMinimum, Maximum, bMaximum) );
435 }
436
437 CSG_Parameter * CSG_Parameters::Add_Info_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min, double Range_Max)
438 {
439 return( _Add_Range(ParentID, ID, Name, Description, true, Range_Min, Range_Max, 0.0, false, 0.0, false) );
440 }
441
442 //---------------------------------------------------------
451 //---------------------------------------------------------
452 CSG_Parameter * CSG_Parameters::Add_Data_Type(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default, const CSG_String &User)
453 {
454 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Data_Type, 0);
455
456 bool bCallback = Set_Callback(false);
457 pParameter->asDataType()->Set_Data_Types(Data_Types, Default, User);
458 Set_Callback(bCallback);
459
460 return( pParameter );
461 }
462
463 //---------------------------------------------------------
464 CSG_Parameter * CSG_Parameters::Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default)
465 {
466 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Choice, 0);
467
468 pParameter->asChoice()->Set_Items(Items);
469
470 bool bCallback = Set_Callback(false);
471 pParameter->Set_Value (Default);
472 pParameter->Set_Default(Default);
473 Set_Callback(bCallback);
474
475 return( pParameter );
476 }
477
478 //---------------------------------------------------------
479 CSG_Parameter * CSG_Parameters::Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
480 {
481 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Choices, 0);
482
483 pParameter->asChoices()->Set_Items(Items);
484
485 return( pParameter );
486 }
487
488 //---------------------------------------------------------
489 CSG_Parameter * CSG_Parameters::Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText, bool bPassword)
490 {
491 return( _Add_String(ParentID, ID, Name, Description, false, String, bLongText, bPassword) );
492 }
493
494 CSG_Parameter * CSG_Parameters::Add_Info_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText)
495 {
496 return( _Add_String(ParentID, ID, Name, Description, true, String, bLongText, false) );
497 }
498
499 //---------------------------------------------------------
500 CSG_Parameter * CSG_Parameters::Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter, const SG_Char *Default, bool bSave, bool bDirectory, bool bMultiple)
501 {
502 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_FilePath, 0);
503
504 pParameter->asFilePath()->Set_Filter (Filter );
505 pParameter->asFilePath()->Set_Flag_Save (bSave );
506 pParameter->asFilePath()->Set_Flag_Multiple (bMultiple );
507 pParameter->asFilePath()->Set_Flag_Directory(bDirectory);
508
509 bool bCallback = Set_Callback(false);
510 pParameter->Set_Value (Default);
511 pParameter->Set_Default(Default);
512 Set_Callback(bCallback);
513
514 return( pParameter );
515 }
516
517 //---------------------------------------------------------
518 CSG_Parameter * CSG_Parameters::Add_Font(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit)
519 {
520 CSG_Parameter *pParameter;
521
522 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Font, 0);
523
524 if( pInit && *pInit )
525 {
526 bool bCallback = Set_Callback(false);
527 pParameter->Set_Value (pInit);
528 pParameter->Set_Default(pInit);
529 Set_Callback(bCallback);
530 }
531
532 return( pParameter );
533 }
534
535 //---------------------------------------------------------
536 CSG_Parameter * CSG_Parameters::Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit)
537 {
538 CSG_Parameter *pParameter;
539
540 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Colors, 0);
541
542 pParameter->asColors()->Assign(pInit);
543
544 return( pParameter );
545 }
546
547 //---------------------------------------------------------
548 CSG_Parameter * CSG_Parameters::Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pTemplate)
549 {
550 CSG_Parameter *pParameter;
551
552 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_FixedTable, 0);
553
554 pParameter->asTable()->Create(pTemplate);
555 pParameter->asTable()->Set_Name(Name);
556 pParameter->asTable()->Assign_Values(pTemplate);
557
558 return( pParameter );
559 }
560
561
563 // //
565
566 //---------------------------------------------------------
567 CSG_Parameter * CSG_Parameters::Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit)
568 {
569 CSG_Parameter *pParameter;
570
571 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Grid_System, 0);
572
573 if( pInit )
574 {
575 pParameter->asGrid_System()->Assign(*pInit);
576 }
577
578 return( pParameter );
579 }
580
581 //---------------------------------------------------------
582 CSG_Parameter * CSG_Parameters::Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent, TSG_Data_Type Preferred_Type)
583 {
584 CSG_Parameter *pParameter, *pParent = Get_Parameter(ParentID);
585
586 CSG_String SystemID;
587
588 if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
589 {
590 SystemID = pParent->Get_Identifier();
591 }
592 else if( bSystem_Dependent && m_pGrid_System )
593 {
594 SystemID = m_pGrid_System->Get_Identifier();
595 }
596 else
597 {
598 pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
599 SystemID = pParent->Get_Identifier();
600 }
601
602 pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid, Constraint);
603
604 ((CSG_Parameter_Grid *)pParameter)->Set_Preferred_Type(Preferred_Type);
605
606 return( pParameter );
607 }
608
609 //---------------------------------------------------------
610 CSG_Parameter * CSG_Parameters::Add_Grid_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum, bool bSystem_Dependent)
611 {
612 CSG_Parameter *pParameter = Add_Grid(ParentID, ID, Name, Description, PARAMETER_INPUT_OPTIONAL, bSystem_Dependent);
613
614 ((CSG_Parameter_Grid *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
615
616 return( pParameter );
617 }
618
619 //---------------------------------------------------------
620 CSG_Parameter * CSG_Parameters::Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
621 {
622 CSG_Parameter *pParameter;
623
624 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
625
626 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grid);
627
628 return( pParameter );
629 }
630
631 //---------------------------------------------------------
632 CSG_Parameter * CSG_Parameters::Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent)
633 {
634 CSG_Parameter *pParameter, *pParent = Get_Parameter(ParentID);
635
636 CSG_String SystemID;
637
638 if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
639 {
640 SystemID = pParent->Get_Identifier();
641 }
642 else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
643 {
644 SystemID = m_pGrid_System->Get_Identifier();
645 }
646
647 pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grid_List, Constraint);
648
649 return( pParameter );
650 }
651
652
654 // //
656
657 //---------------------------------------------------------
658 CSG_Parameter * CSG_Parameters::Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent, TSG_Data_Type Preferred_Type)
659 {
660 CSG_Parameter *pParameter, *pParent = Get_Parameter(ParentID);
661
662 CSG_String SystemID;
663
664 if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
665 {
666 SystemID = pParent->Get_Identifier();
667 }
668 else if( bSystem_Dependent && m_pGrid_System )
669 {
670 SystemID = m_pGrid_System->Get_Identifier();
671 }
672 else
673 {
674 pParent = Add_Grid_System(pParent ? pParent->Get_Identifier() : SG_T(""), ID + "_GRIDSYSTEM", _TL("Grid system"), "");
675 SystemID = pParent->Get_Identifier();
676 }
677
678 pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids, Constraint);
679
680 ((CSG_Parameter_Grids *)pParameter)->Set_Preferred_Type(Preferred_Type);
681
682 return( pParameter );
683 }
684
685 //---------------------------------------------------------
686 CSG_Parameter * CSG_Parameters::Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
687 {
688 CSG_Parameter *pParameter;
689
690 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
691
692 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Grids);
693
694 return( pParameter );
695 }
696
697 //---------------------------------------------------------
698 CSG_Parameter * CSG_Parameters::Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent)
699 {
700 CSG_Parameter *pParameter, *pParent = Get_Parameter(ParentID);
701
702 CSG_String SystemID;
703
704 if( pParent && pParent->Get_Type() == PARAMETER_TYPE_Grid_System )
705 {
706 SystemID = pParent->Get_Identifier();
707 }
708 else if( bSystem_Dependent && m_pGrid_System && !((Constraint & PARAMETER_OUTPUT) && (Constraint & PARAMETER_OPTIONAL)) )
709 {
710 SystemID = m_pGrid_System->Get_Identifier();
711 }
712
713 pParameter = _Add(SystemID, ID, Name, Description, PARAMETER_TYPE_Grids_List, Constraint);
714
715 return( pParameter );
716 }
717
718
720 // //
722
723 //---------------------------------------------------------
724 CSG_Parameter * CSG_Parameters::Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone)
725 {
726 CSG_Parameter *pParent = Get_Parameter(ParentID);
727
728 if( pParent && (
729 pParent->Get_Type() == PARAMETER_TYPE_Table
730 || pParent->Get_Type() == PARAMETER_TYPE_Shapes
731 || pParent->Get_Type() == PARAMETER_TYPE_TIN
732 || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
733 {
734 return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Field, bAllowNone ? PARAMETER_OPTIONAL : 0) );
735 }
736
737 return( NULL );
738 }
739
740 //---------------------------------------------------------
741 CSG_Parameter * CSG_Parameters::Add_Table_Field_or_Const(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
742 {
743 CSG_Parameter *pParameter = Add_Table_Field(ParentID, ID, Name, Description, true);
744
745 if( pParameter )
746 {
747 ((CSG_Parameter_Table_Field *)pParameter)->Add_Default(Value, Minimum, bMinimum, Maximum, bMaximum);
748 }
749
750 return( pParameter );
751 }
752
753 //---------------------------------------------------------
754 CSG_Parameter * CSG_Parameters::Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
755 {
756 CSG_Parameter *pParent = Get_Parameter(ParentID);
757
758 if( pParent && (
759 pParent->Get_Type() == PARAMETER_TYPE_Table
760 || pParent->Get_Type() == PARAMETER_TYPE_Shapes
761 || pParent->Get_Type() == PARAMETER_TYPE_TIN
762 || pParent->Get_Type() == PARAMETER_TYPE_PointCloud) )
763 {
764 return( _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_Fields, 0) );
765 }
766
767 return( NULL );
768 }
769
770 //---------------------------------------------------------
771 CSG_Parameter * CSG_Parameters::Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
772 {
773 CSG_Parameter *pParameter;
774
775 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table, Constraint);
776
777 return( pParameter );
778 }
779
780 //---------------------------------------------------------
781 CSG_Parameter * CSG_Parameters::Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
782 {
783 CSG_Parameter *pParameter;
784
785 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
786
787 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Table);
788
789 return( pParameter );
790 }
791
792 //---------------------------------------------------------
793 CSG_Parameter * CSG_Parameters::Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
794 {
795 CSG_Parameter *pParameter;
796
797 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Table_List, Constraint);
798
799 return( pParameter );
800 }
801
802
804 // //
806
807 //---------------------------------------------------------
808 CSG_Parameter * CSG_Parameters::Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type)
809 {
810 CSG_Parameter *pParameter;
811
812 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes, Constraint);
813
814 ((CSG_Parameter_Shapes *)pParameter)->Set_Shape_Type(Shape_Type);
815
816 return( pParameter );
817 }
818
819 //---------------------------------------------------------
820 CSG_Parameter * CSG_Parameters::Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
821 {
822 CSG_Parameter *pParameter;
823
824 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
825
826 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_Shapes);
827
828 return( pParameter );
829 }
830
831 //---------------------------------------------------------
832 CSG_Parameter * CSG_Parameters::Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Type)
833 {
834 CSG_Parameter *pParameter;
835
836 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Shapes_List, Constraint);
837
838 ((CSG_Parameter_Shapes_List *)pParameter)->Set_Shape_Type(Type);
839
840 return( pParameter );
841 }
842
843
845 // //
847
848 //---------------------------------------------------------
849 CSG_Parameter * CSG_Parameters::Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
850 {
851 CSG_Parameter *pParameter;
852
853 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN, Constraint);
854
855 return( pParameter );
856 }
857
858 //---------------------------------------------------------
859 CSG_Parameter * CSG_Parameters::Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
860 {
861 CSG_Parameter *pParameter;
862
863 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
864
865 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_TIN);
866
867 return( pParameter );
868 }
869
870 //---------------------------------------------------------
871 CSG_Parameter * CSG_Parameters::Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
872 {
873 CSG_Parameter *pParameter;
874
875 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_TIN_List, Constraint);
876
877 return( pParameter );
878 }
879
880
882 // //
884
885 //---------------------------------------------------------
886 CSG_Parameter * CSG_Parameters::Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
887 {
888 CSG_Parameter *pParameter;
889
890 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud, Constraint);
891
892 return( pParameter );
893 }
894
895 //---------------------------------------------------------
896 CSG_Parameter * CSG_Parameters::Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
897 {
898 CSG_Parameter *pParameter;
899
900 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_DataObject_Output, PARAMETER_OUTPUT_OPTIONAL);
901
902 ((CSG_Parameter_Data_Object_Output *)pParameter)->Set_DataObject_Type(SG_DATAOBJECT_TYPE_PointCloud);
903
904 return( pParameter );
905 }
906
907 //---------------------------------------------------------
908 CSG_Parameter * CSG_Parameters::Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
909 {
910 CSG_Parameter *pParameter;
911
912 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_PointCloud_List, Constraint);
913
914 return( pParameter );
915 }
916
917
919 // //
921
922 //---------------------------------------------------------
923 CSG_Parameter * CSG_Parameters::Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
924 {
925 CSG_Parameter *pParameter;
926
927 pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Parameters, 0);
928
929 pParameter->asParameters()->m_Callback = m_Callback;
930 pParameter->asParameters()->m_pTool = m_pTool;
931
932 return( pParameter );
933 }
934
935
937 // //
939
940 //---------------------------------------------------------
941 CSG_Parameter * CSG_Parameters::_Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, TSG_Parameter_Type Type, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
942 {
943 switch( Type ) // Check if Type is valid...
944 {
945 case PARAMETER_TYPE_Bool :
946 case PARAMETER_TYPE_Int :
947 case PARAMETER_TYPE_Double:
948 case PARAMETER_TYPE_Degree:
949 case PARAMETER_TYPE_Date :
950 case PARAMETER_TYPE_Color :
951 break;
952
953 default: // if not valid set Type to [double]...
954 Type = PARAMETER_TYPE_Double;
955 }
956
957 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, Type, bInformation ? PARAMETER_INFORMATION : 0);
958
959 bool bCallback = Set_Callback(false);
960
961 if( !bInformation )
962 {
963 if( Type == PARAMETER_TYPE_Int
964 || Type == PARAMETER_TYPE_Double
965 || Type == PARAMETER_TYPE_Degree )
966 {
967 pParameter->asValue()->Set_Minimum(Minimum, bMinimum);
968 pParameter->asValue()->Set_Maximum(Maximum, bMaximum);
969 }
970 }
971
972 pParameter->Set_Value(Value);
973
974 Set_Callback(bCallback);
975
976 if( !bInformation )
977 {
978 switch( Type )
979 {
980 case PARAMETER_TYPE_Bool :
981 case PARAMETER_TYPE_Int :
982 case PARAMETER_TYPE_Color :
983 pParameter->Set_Default((int)Value);
984 break;
985
986 case PARAMETER_TYPE_Date :
987 pParameter->Set_Default(pParameter->asString());
988 break;
989
990 default:
991 pParameter->Set_Default( Value);
992 }
993 }
994
995 return( pParameter );
996 }
997
998 //---------------------------------------------------------
999 CSG_Parameter * CSG_Parameters::_Add_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, double Default_Min, double Default_Max, double Minimum, bool bMinimum, double Maximum, bool bMaximum)
1000 {
1001 //-----------------------------------------------------
1002 if( Default_Min > Default_Max )
1003 {
1004 double d = Default_Min;
1005 Default_Min = Default_Max;
1006 Default_Max = d;
1007 }
1008
1009 //-----------------------------------------------------
1010 CSG_Parameter *pParameter = _Add(ParentID, ID, Name, Description, PARAMETER_TYPE_Range, bInformation ? PARAMETER_INFORMATION : 0);
1011
1012 pParameter->asRange()->Get_Min_Parameter()->Set_Minimum(Minimum, bMinimum);
1013 pParameter->asRange()->Get_Min_Parameter()->Set_Maximum(Maximum, bMaximum);
1014 pParameter->asRange()->Get_Min_Parameter()->Set_Default(Default_Min);
1015 pParameter->asRange()->Set_Min(Default_Min);
1016
1017 pParameter->asRange()->Get_Max_Parameter()->Set_Minimum(Minimum, bMinimum);
1018 pParameter->asRange()->Get_Max_Parameter()->Set_Maximum(Maximum, bMaximum);
1019 pParameter->asRange()->Get_Max_Parameter()->Set_Default(Default_Max);
1020 pParameter->asRange()->Set_Max(Default_Max);
1021
1022 return( pParameter );
1023 }
1024
1025 //---------------------------------------------------------
1026 CSG_Parameter * CSG_Parameters::_Add_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, const SG_Char *String, bool bLongText, bool bPassword)
1027 {
1028 CSG_Parameter *pParameter;
1029
1030 pParameter = _Add(ParentID, ID, Name, Description, bLongText ? PARAMETER_TYPE_Text : PARAMETER_TYPE_String, bInformation ? PARAMETER_INFORMATION : 0);
1031
1032 bool bCallback = Set_Callback(false);
1033 pParameter->Set_Value (String);
1034 pParameter->Set_Default(String);
1035 Set_Callback(bCallback);
1036
1037 ((CSG_Parameter_String *)pParameter)->Set_Password(bPassword);
1038
1039 return( pParameter );
1040 }
1041
1042
1044 // //
1046
1047 //---------------------------------------------------------
1048 #ifdef _DEBUG
1049 #include <wx/debug.h>
1050 #include <wx/string.h>
1051 #endif
1052
1053 //---------------------------------------------------------
1054 CSG_Parameter * CSG_Parameters::_Add(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, int Constraint)
1055 {
1056 #ifdef _DEBUG
1057 wxASSERT_MSG(!ID.is_Empty() , wxString::Format("CSG_Parameter::_Add(): Parameter ID is empty!"));
1058 wxASSERT_MSG(!Get_Parameter(ID), wxString::Format("CSG_Parameter::_Add(): Parameter ID \"%s\" is already in use!", ID.c_str()));
1059 #endif
1060
1061 CSG_Parameter *pParameter;
1062
1063 switch( Type )
1064 {
1065 default:
1066 return( NULL );
1067
1068 case PARAMETER_TYPE_Node : pParameter = new CSG_Parameter_Node (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1069
1070 case PARAMETER_TYPE_Bool : pParameter = new CSG_Parameter_Bool (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1071 case PARAMETER_TYPE_Int : pParameter = new CSG_Parameter_Int (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1072 case PARAMETER_TYPE_Double : pParameter = new CSG_Parameter_Double (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1073 case PARAMETER_TYPE_Degree : pParameter = new CSG_Parameter_Degree (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1074 case PARAMETER_TYPE_Date : pParameter = new CSG_Parameter_Date (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1075 case PARAMETER_TYPE_Range : pParameter = new CSG_Parameter_Range (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1076 case PARAMETER_TYPE_Data_Type : pParameter = new CSG_Parameter_Data_Type (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1077 case PARAMETER_TYPE_Choice : pParameter = new CSG_Parameter_Choice (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1078 case PARAMETER_TYPE_Choices : pParameter = new CSG_Parameter_Choices (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1079
1080 case PARAMETER_TYPE_String : pParameter = new CSG_Parameter_String (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1081 case PARAMETER_TYPE_Text : pParameter = new CSG_Parameter_Text (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1082 case PARAMETER_TYPE_FilePath : pParameter = new CSG_Parameter_File_Name (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1083
1084 case PARAMETER_TYPE_Font : pParameter = new CSG_Parameter_Font (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1085 case PARAMETER_TYPE_Color : pParameter = new CSG_Parameter_Color (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1086 case PARAMETER_TYPE_Colors : pParameter = new CSG_Parameter_Colors (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1087 case PARAMETER_TYPE_FixedTable : pParameter = new CSG_Parameter_Fixed_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1088 case PARAMETER_TYPE_Grid_System : pParameter = new CSG_Parameter_Grid_System (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1089 case PARAMETER_TYPE_Table_Field : pParameter = new CSG_Parameter_Table_Field (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1090 case PARAMETER_TYPE_Table_Fields : pParameter = new CSG_Parameter_Table_Fields (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1091
1092 case PARAMETER_TYPE_DataObject_Output: pParameter = new CSG_Parameter_Data_Object_Output(this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1093 case PARAMETER_TYPE_Grid : pParameter = new CSG_Parameter_Grid (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1094 case PARAMETER_TYPE_Grids : pParameter = new CSG_Parameter_Grids (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1095 case PARAMETER_TYPE_Table : pParameter = new CSG_Parameter_Table (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1096 case PARAMETER_TYPE_Shapes : pParameter = new CSG_Parameter_Shapes (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1097 case PARAMETER_TYPE_TIN : pParameter = new CSG_Parameter_TIN (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1098 case PARAMETER_TYPE_PointCloud : pParameter = new CSG_Parameter_PointCloud (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1099
1100 case PARAMETER_TYPE_Grid_List : pParameter = new CSG_Parameter_Grid_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1101 case PARAMETER_TYPE_Grids_List : pParameter = new CSG_Parameter_Grids_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1102 case PARAMETER_TYPE_Table_List : pParameter = new CSG_Parameter_Table_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1103 case PARAMETER_TYPE_Shapes_List : pParameter = new CSG_Parameter_Shapes_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1104 case PARAMETER_TYPE_TIN_List : pParameter = new CSG_Parameter_TIN_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1105 case PARAMETER_TYPE_PointCloud_List : pParameter = new CSG_Parameter_PointCloud_List (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1106
1107 case PARAMETER_TYPE_Parameters : pParameter = new CSG_Parameter_Parameters (this, Get_Parameter(ParentID), ID, Name, Description, Constraint); break;
1108 }
1109
1110 m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, (m_nParameters + 1) * sizeof(CSG_Parameter *));
1111 m_Parameters[m_nParameters++] = pParameter;
1112
1113 pParameter->_Set_String();
1114
1115 return( pParameter );
1116 }
1117
1118 //---------------------------------------------------------
1119 CSG_Parameter * CSG_Parameters::_Add(CSG_Parameter *pSource)
1120 {
1121 CSG_Parameter *pParameter = !pSource ? NULL : _Add(
1122 pSource->Get_Parent() ? pSource->Get_Parent()->Get_Identifier() : SG_T(""),
1123 pSource->Get_Identifier (),
1124 pSource->Get_Name (),
1125 pSource->Get_Description(),
1126 pSource->Get_Type (),
1127 pSource->m_Constraint
1128 );
1129
1130 if( pParameter )
1131 {
1132 pParameter->Assign(pSource);
1133 }
1134
1135 return( pParameter );
1136 }
1137
1138
1140 // //
1142
1143 //---------------------------------------------------------
1144 CSG_Parameter * CSG_Parameters::Get_Parameter(const CSG_String &ID) const
1145 {
1146 if( m_Parameters && !ID.is_Empty() )
1147 {
1148 for(int i=0; i<m_nParameters; i++)
1149 {
1150 if( m_Parameters[i]->Cmp_Identifier(ID) )
1151 {
1152 return( m_Parameters[i] );
1153 }
1154 }
1155
1156 //-------------------------------------------------
1157 if( ID.Find('.') > 0 ) // id not found? check for sub-parameter ('id.id')!
1158 {
1159 CSG_Parameter *pParameter = Get_Parameter(ID.BeforeFirst('.'));
1160
1161 if( pParameter )
1162 {
1163 switch( pParameter->Get_Type() )
1164 {
1165 case PARAMETER_TYPE_Parameters:
1166 return( pParameter->asParameters()->Get_Parameter(ID.AfterFirst('.')) );
1167
1168 case PARAMETER_TYPE_Range :
1169 if( !ID.AfterFirst('.').CmpNoCase("min") || !ID.AfterFirst('.').CmpNoCase("minimum") )
1170 {
1171 return( pParameter->asRange()->Get_Min_Parameter() );
1172 }
1173
1174 if( !ID.AfterFirst('.').CmpNoCase("max") || !ID.AfterFirst('.').CmpNoCase("maximum") )
1175 {
1176 return( pParameter->asRange()->Get_Max_Parameter() );
1177 }
1178 break;
1179
1180 default:
1181 break;
1182 }
1183 }
1184 }
1185 }
1186
1187 return( NULL );
1188 }
1189
1190 //---------------------------------------------------------
1191 bool CSG_Parameters::Del_Parameter(int iParameter)
1192 {
1193 if( m_Parameters && iParameter >= 0 && iParameter < m_nParameters )
1194 {
1195 CSG_Parameter *pParameter = m_Parameters[iParameter];
1196
1197 for(m_nParameters--; iParameter<m_nParameters; iParameter++)
1198 {
1199 m_Parameters[iParameter] = m_Parameters[iParameter + 1];
1200 }
1201
1202 m_Parameters = (CSG_Parameter **)SG_Realloc(m_Parameters, m_nParameters * sizeof(CSG_Parameter *));
1203
1204 for(iParameter=pParameter->Get_Children_Count()-1; iParameter>=0; iParameter--)
1205 {
1206 Del_Parameter(pParameter->Get_Child(iParameter)->Get_Identifier());
1207 }
1208
1209 CSG_Parameter *pParent = pParameter->Get_Parent();
1210
1211 if( pParent )
1212 {
1213 for(iParameter=0; iParameter<pParent->m_nChildren; iParameter++)
1214 {
1215 if( pParent->m_Children[iParameter] == pParameter )
1216 {
1217 pParent->m_nChildren--;
1218
1219 for( ; iParameter<pParent->m_nChildren; iParameter++)
1220 {
1221 pParent->m_Children[iParameter] = pParent->m_Children[iParameter + 1];
1222 }
1223 }
1224 }
1225
1226 pParent->m_Children = (CSG_Parameter **)SG_Realloc(pParent->m_Children, pParent->m_nChildren * sizeof(CSG_Parameter *));
1227 }
1228
1229 delete(pParameter);
1230
1231 return( true );
1232 }
1233
1234 return( false );
1235 }
1236
1237 //---------------------------------------------------------
1238 bool CSG_Parameters::Del_Parameter(const CSG_String &Identifier)
1239 {
1240 if( m_Parameters && Identifier.Length() )
1241 {
1242 for(int i=0; i<m_nParameters; i++)
1243 {
1244 if( !m_Parameters[i]->m_Identifier.Cmp(Identifier) )
1245 {
1246 return( Del_Parameter(i) );
1247 }
1248 }
1249 }
1250
1251 return( false );
1252 }
1253
1254 //---------------------------------------------------------
1255 bool CSG_Parameters::Del_Parameters(void)
1256 {
1257 if( m_nParameters > 0 )
1258 {
1259 m_pGrid_System = NULL;
1260
1261 for(int i=0; i<m_nParameters; i++)
1262 {
1263 delete(m_Parameters[i]);
1264 }
1265
1266 SG_Free(m_Parameters);
1267
1268 m_Parameters = NULL;
1269 m_nParameters = 0;
1270 }
1271
1272 return( true );
1273 }
1274
1275
1277 // //
1278 // Callback //
1279 // //
1281
1282 //---------------------------------------------------------
1283 // Callback function used to react on parameter changes.
1284 // Return value is the previously set callback function.
1285 TSG_PFNC_Parameter_Changed CSG_Parameters::Set_Callback_On_Parameter_Changed(TSG_PFNC_Parameter_Changed Callback)
1286 {
1287 TSG_PFNC_Parameter_Changed Previous = m_Callback;
1288
1289 m_Callback = Callback;
1290
1291 for(int i=0; i<m_nParameters; i++)
1292 {
1293 if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1294 {
1295 m_Parameters[i]->asParameters()->Set_Callback_On_Parameter_Changed(Callback);
1296 }
1297 }
1298
1299 return( Previous );
1300 }
1301
1302 //---------------------------------------------------------
1303 // If switched off parameter changes will not invoke a
1304 // consecutive call to the On_Parameter_Changed function.
1305 // Return value is the previous state.
1306 bool CSG_Parameters::Set_Callback(bool bActive)
1307 {
1308 bool bPrevious = m_bCallback;
1309
1310 m_bCallback = bActive;
1311
1312 for(int i=0; i<m_nParameters; i++)
1313 {
1314 if( m_Parameters[i]->Get_Type() == PARAMETER_TYPE_Parameters)
1315 {
1316 m_Parameters[i]->asParameters()->Set_Callback(bActive);
1317 }
1318 }
1319
1320 return( bPrevious );
1321 }
1322
1323 //---------------------------------------------------------
1324 bool CSG_Parameters::_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
1325 {
1326 if( m_Callback && m_bCallback )
1327 {
1328 bool bCallback = Set_Callback(false);
1329
1330 m_Callback(pParameter, Flags);
1331
1332 Set_Callback(bCallback);
1333
1334 return( true );
1335 }
1336
1337 return( false );
1338 }
1339
1340
1342 // //
1344
1345 //---------------------------------------------------------
1346 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1347 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) { return( Set_Parameter(CSG_String(ID), pValue) ); }
1348 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
1349 {
1350 CSG_Parameter *pTarget = Get_Parameter(ID);
1351
1352 return( pTarget && pValue && pTarget->Get_Type() == pValue->Get_Type() && pTarget->Assign(pValue) );
1353 }
1354
1355 //---------------------------------------------------------
1356 bool CSG_Parameters::Set_Parameter(const char *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1357 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, void *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1358 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, void *Value, int Type)
1359 {
1360 CSG_Parameter *pTarget = Get_Parameter(ID);
1361
1362 return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1363 }
1364
1365 //---------------------------------------------------------
1366 bool CSG_Parameters::Set_Parameter(const char *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1367 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, CSG_Data_Object *Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1368 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, CSG_Data_Object *Value, int Type)
1369 {
1370 CSG_Parameter *pTarget = Get_Parameter(ID);
1371
1372 return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1373 }
1374
1375 //---------------------------------------------------------
1376 bool CSG_Parameters::Set_Parameter(const char *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1377 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, int Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1378 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, int Value, int Type)
1379 {
1380 CSG_Parameter *pTarget = Get_Parameter(ID);
1381
1382 return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1383 }
1384
1385 //---------------------------------------------------------
1386 bool CSG_Parameters::Set_Parameter(const char *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1387 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, double Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1388 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, double Value, int Type)
1389 {
1390 CSG_Parameter *pTarget = Get_Parameter(ID);
1391
1392 return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1393 }
1394
1395 //---------------------------------------------------------
1396 bool CSG_Parameters::Set_Parameter(const char *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1397 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type) { return( Set_Parameter(CSG_String(ID), Value, Type) ); }
1398 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type)
1399 {
1400 CSG_Parameter *pTarget = Get_Parameter(ID);
1401
1402 return( pTarget && (Type == PARAMETER_TYPE_Undefined || Type == pTarget->Get_Type()) && pTarget->Set_Value(Value) );
1403 }
1404
1405 //---------------------------------------------------------
1406 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1407 bool CSG_Parameters::Set_Parameter(const char *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1408 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const char *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1409
1410 //---------------------------------------------------------
1411 bool CSG_Parameters::Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1412 bool CSG_Parameters::Set_Parameter(const char *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1413 bool CSG_Parameters::Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type) { return( Set_Parameter(ID, CSG_String(Value)) ); }
1414
1415
1417 // //
1419
1420 //---------------------------------------------------------
1421 bool CSG_Parameters::Restore_Defaults(bool bClearData)
1422 {
1423 Set_Callback(false);
1424
1425 for(int i=0; i<Get_Count(); i++)
1426 {
1427 m_Parameters[i]->Restore_Default();
1428
1429 if( bClearData )
1430 {
1431 if( m_Parameters[i]->is_DataObject() )
1432 {
1433 m_Parameters[i]->Set_Value(DATAOBJECT_NOTSET);
1434 }
1435 else if( m_Parameters[i]->is_DataObject_List() )
1436 {
1437 m_Parameters[i]->asList()->Del_Items();
1438 }
1439 }
1440 }
1441
1442 Set_Callback(true);
1443
1444 return( true );
1445 }
1446
1447
1449 // //
1451
1452 //---------------------------------------------------------
1453 bool CSG_Parameters::Assign(CSG_Parameters *pSource)
1454 {
1455 return( pSource && pSource != this && Create(*pSource) );
1456 }
1457
1458 //---------------------------------------------------------
1459 bool CSG_Parameters::Assign_Values(CSG_Parameters *pSource)
1460 {
1461 if( !pSource || pSource == this )
1462 {
1463 return( false );
1464 }
1465
1466 //-----------------------------------------------------
1467 int n = 0;
1468
1469 for(int i=0; i<pSource->Get_Count(); i++)
1470 {
1471 CSG_Parameter *pParameter = Get_Parameter(pSource->Get_Parameter(i)->Get_Identifier());
1472
1473 if( pParameter && pParameter->Get_Type() == pSource->Get_Parameter(i)->Get_Type() )
1474 {
1475 n++; pParameter->Assign(pSource->Get_Parameter(i));
1476 }
1477 }
1478
1479 return( n > 0 );
1480 }
1481
1482 //---------------------------------------------------------
1483 bool CSG_Parameters::Assign_Parameters(CSG_Parameters *pSource)
1484 {
1485 if( !pSource || pSource == this )
1486 {
1487 return( false );
1488 }
1489
1490 Del_Parameters();
1491
1492 //-----------------------------------------------------
1493 for(int i=0; i<pSource->m_nParameters; i++)
1494 {
1495 _Add(pSource->m_Parameters[i]);
1496 }
1497
1498 if( pSource->m_pGrid_System )
1499 {
1500 m_pGrid_System = Get_Parameter(pSource->m_pGrid_System->Get_Identifier());
1501 }
1502
1503 return( m_nParameters == pSource->m_nParameters );
1504 }
1505
1506
1508 // //
1510
1511 //---------------------------------------------------------
1512 bool CSG_Parameters::DataObjects_Check(bool bSilent)
1513 {
1514 bool bResult = true;
1515
1516 CSG_String sError;
1517
1518 //-----------------------------------------------------
1519 for(int i=0; i<Get_Count(); i++)
1520 {
1521 if( m_Parameters[i]->Check(bSilent) == false )
1522 {
1523 bResult = false;
1524
1525 sError.Append(CSG_String::Format("\n%s: %s", m_Parameters[i]->Get_Type_Name().c_str(), m_Parameters[i]->Get_Name()));
1526 }
1527 }
1528
1529 //-----------------------------------------------------
1530 if( !bResult && !bSilent )
1531 {
1532 SG_UI_Dlg_Message(CSG_String::Format("%s\n%s", _TL("invalid input!"), sError.c_str()), Get_Name() );
1533 }
1534
1535 return( bResult );
1536 }
1537
1538 //---------------------------------------------------------
1539 bool CSG_Parameters::DataObjects_Create(void)
1540 {
1541 bool bResult = true;
1542
1543 for(int i=0; bResult && i<Get_Count(); i++)
1544 {
1545 CSG_Parameter &P = *m_Parameters[i];
1546
1547 //-------------------------------------------------
1548 if( P.Get_Type() == PARAMETER_TYPE_Parameters )
1549 {
1550 if( !P.asParameters()->DataObjects_Create() )
1551 {
1552 bResult = false;
1553 }
1554 }
1555 else if( P.Get_Type() == PARAMETER_TYPE_DataObject_Output )
1556 {
1557 if( m_pManager || P.asDataObject() == DATAOBJECT_CREATE )
1558 {
1559 P.Set_Value(DATAOBJECT_NOTSET);
1560 }
1561 }
1562 else if( P.is_Input() )
1563 {
1564 if( P.is_Enabled() && P.Check(true) == false )
1565 {
1566 bResult = false;
1567
1568 SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Input Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1569 }
1570 }
1571
1572 //-------------------------------------------------
1573 else if( P.is_DataObject_List() )
1574 {
1575 for(int j=P.asList()->Get_Item_Count()-1; j>=0; j--)
1576 {
1577 if( m_pManager && !m_pManager->Exists(P.asList()->Get_Item(j)) )
1578 {
1579 P.asList()->Del_Item(j);
1580 }
1581 }
1582 }
1583
1584 //-------------------------------------------------
1585 else if( P.is_DataObject() && P.is_Enabled() == false )
1586 {
1587 if( P.asDataObject() != DATAOBJECT_CREATE && (!m_pManager || !m_pManager->Exists(P.asDataObject())) )
1588 {
1589 P.Set_Value(DATAOBJECT_NOTSET);
1590 }
1591 }
1592
1593 else if( P.is_DataObject() )
1594 {
1595 CSG_Data_Object *pObject = P.asDataObject();
1596
1597 if( (pObject == DATAOBJECT_CREATE)
1598 || (pObject == DATAOBJECT_NOTSET && !P.is_Optional())
1599 || (pObject != DATAOBJECT_NOTSET && m_pManager && !m_pManager->Exists(pObject)) )
1600 {
1601 switch( P.Get_Type() )
1602 {
1603 case PARAMETER_TYPE_Table : pObject = SG_Create_Table (); break;
1604 case PARAMETER_TYPE_Shapes : pObject = SG_Create_Shapes (); break;
1605 case PARAMETER_TYPE_PointCloud: pObject = SG_Create_PointCloud(); break;
1606 case PARAMETER_TYPE_TIN : pObject = SG_Create_TIN (); break;
1607 case PARAMETER_TYPE_Grid : pObject = SG_Create_Grid (); break;
1608 case PARAMETER_TYPE_Grids : pObject = SG_Create_Grids (); break;
1609 default : pObject = NULL ; break;
1610 }
1611 }
1612
1613 if( pObject )
1614 {
1615 if( P.Get_Type() == PARAMETER_TYPE_Shapes
1616 && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != SHAPE_TYPE_Undefined
1617 && ((CSG_Parameter_Shapes *)&P)->Get_Shape_Type() != pObject->asShapes()->Get_Type() )
1618 {
1619 if( has_GUI() && pObject->asShapes()->Get_Type() != SHAPE_TYPE_Undefined )
1620 {
1621 pObject = SG_Create_Shapes (((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1622 }
1623 else
1624 {
1625 pObject->asShapes()->Create(((CSG_Parameter_Shapes *)&P)->Get_Shape_Type());
1626 }
1627 }
1628
1629 if( (P.Get_Type() == PARAMETER_TYPE_Grid || P.Get_Type() == PARAMETER_TYPE_Grids) )
1630 {
1631 if( P.Get_Parent() && P.Get_Parent()->asGrid_System() && P.Get_Parent()->asGrid_System()->is_Valid() )
1632 {
1633 if( P.Get_Type() == PARAMETER_TYPE_Grid )
1634 {
1635 pObject->asGrid ()->Create(*P.Get_Parent()->asGrid_System() , ((CSG_Parameter_Grid *)&P)->Get_Preferred_Type());
1636 }
1637 else
1638 {
1639 pObject->asGrids()->Create(*P.Get_Parent()->asGrid_System(), 0, 0., ((CSG_Parameter_Grids *)&P)->Get_Preferred_Type());
1640 }
1641 }
1642 }
1643
1644 if( P.Set_Value(pObject) )
1645 {
1646 pObject->Set_Name(P.Get_Name());
1647 pObject->Get_MetaData().Del_Children();
1648
1649 if( m_pManager )
1650 {
1651 m_pManager->Add(pObject);
1652 }
1653 }
1654 else
1655 {
1656 delete(pObject);
1657
1658 bResult = false;
1659
1660 SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1661 }
1662 }
1663 else // if( pObject == NULL )
1664 {
1665 if( !P.is_Optional() )
1666 {
1667 bResult = false;
1668
1669 SG_UI_Dlg_Message(CSG_String::Format("%s\n[%s]\n%s", _TL("Output Error"), P.Get_Identifier(), P.Get_Name()), Get_Name());
1670 }
1671 }
1672 }
1673 }
1674
1675 return( bResult );
1676 }
1677
1678 //---------------------------------------------------------
1679 bool CSG_Parameters::DataObjects_Synchronize(void)
1680 {
1681 for(int i=0; i<Get_Count(); i++)
1682 {
1683 CSG_Parameter *p = m_Parameters[i];
1684
1685 if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1686 {
1687 p->asParameters()->DataObjects_Synchronize();
1688 }
1689
1690 //-------------------------------------------------
1691 else if( p->is_Output() )
1692 {
1693 if( p->is_DataObject() )
1694 {
1695 CSG_Data_Object *pObject = p->asDataObject();
1696
1697 if( pObject == DATAOBJECT_CREATE )
1698 {
1699 p->Set_Value(DATAOBJECT_NOTSET);
1700 }
1701 else if( pObject != DATAOBJECT_NOTSET )
1702 {
1703 if( pObject->asShapes() && pObject->asShapes()->Get_Type() == SHAPE_TYPE_Undefined
1704 && (m_pManager == &SG_Get_Data_Manager() || !SG_Get_Data_Manager().Exists(pObject)) )
1705 {
1706 if( m_pManager && !m_pManager->Delete(pObject) )
1707 {
1708 delete(pObject);
1709 }
1710
1711 p->Set_Value(DATAOBJECT_NOTSET);
1712 }
1713 else
1714 {
1715 if( m_pManager && !m_pManager->Exists(pObject) )
1716 {
1717 m_pManager->Add(pObject);
1718 }
1719
1720 SG_UI_DataObject_Update(pObject, SG_UI_DATAOBJECT_UPDATE, NULL);
1721 }
1722 }
1723 }
1724
1725 //---------------------------------------------
1726 else if( p->is_DataObject_List() )
1727 {
1728 for(int j=0; j<p->asList()->Get_Item_Count(); j++)
1729 {
1730 CSG_Data_Object *pObject = p->asList()->Get_Item(j);
1731
1732 if( m_pManager && !m_pManager->Exists(pObject) )
1733 {
1734 m_pManager->Add(pObject);
1735 }
1736
1737 SG_UI_DataObject_Update(pObject, SG_UI_DATAOBJECT_UPDATE, NULL);
1738 }
1739 }
1740 }
1741 }
1742
1743 return( true );
1744 }
1745
1746 //---------------------------------------------------------
1747 bool CSG_Parameters::DataObjects_Get_Projection(CSG_Projection &Projection) const
1748 {
1749 for(int i=0; i<Get_Count() && !Projection.is_Okay(); i++)
1750 {
1751 CSG_Parameter *p = m_Parameters[i];
1752
1753 if( p->is_Enabled() && !p->ignore_Projection() )
1754 {
1755 if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1756 {
1757 p->asParameters()->DataObjects_Get_Projection(Projection);
1758 }
1759 else if( p->is_Input() )
1760 {
1761 if( p->is_DataObject()
1762 && p->asDataObject() != DATAOBJECT_NOTSET
1763 && p->asDataObject() != DATAOBJECT_CREATE )
1764 {
1765 Projection = p->asDataObject()->Get_Projection();
1766 }
1767 else if( p->is_DataObject_List() )
1768 {
1769 for(int j=0; j<p->asList()->Get_Item_Count() && !Projection.is_Okay(); j++)
1770 {
1771 Projection = p->asList()->Get_Item(j)->Get_Projection();
1772 }
1773 }
1774 }
1775 }
1776 }
1777
1778 return( Projection.is_Okay() );
1779 }
1780
1781 //---------------------------------------------------------
1782 bool CSG_Parameters::DataObjects_Set_Projection(const CSG_Projection &Projection)
1783 {
1784 if( !Projection.is_Okay() )
1785 {
1786 return( false );
1787 }
1788
1789 for(int i=0; i<Get_Count(); i++)
1790 {
1791 CSG_Parameter *p = m_Parameters[i];
1792
1793 if( !p->ignore_Projection() )
1794 {
1795 if( p->Get_Type() == PARAMETER_TYPE_Parameters )
1796 {
1797 p->asParameters()->DataObjects_Set_Projection(Projection);
1798 }
1799 else if( p->is_Output() )
1800 {
1801 if( p->is_DataObject()
1802 && p->asDataObject() != DATAOBJECT_NOTSET
1803 && p->asDataObject() != DATAOBJECT_CREATE )
1804 {
1805 p->asDataObject()->Get_Projection() = Projection;
1806 }
1807 else if( p->is_DataObject_List() )
1808 {
1809 for(int j=0; j<p->asList()->Get_Item_Count(); j++)
1810 {
1811 p->asList()->Get_Item(j)->Get_Projection() = Projection;
1812 }
1813 }
1814 }
1815 }
1816 }
1817
1818 return( true );
1819 }
1820
1821
1823 // //
1825
1826 //---------------------------------------------------------
1827 bool CSG_Parameters::Get_String(CSG_String &String, bool bOptionsOnly)
1828 {
1829 bool bResult = false;
1830
1831 if( Get_Count() > 0 )
1832 {
1833 if( m_pGrid_System )
1834 {
1835 m_pGrid_System->_Set_String();
1836
1837 String += CSG_String::Format("%s: %s\n", m_pGrid_System->Get_Name(), m_pGrid_System->asString());
1838 }
1839
1840 for(int i=0; i<Get_Count(); i++)
1841 {
1842 CSG_Parameter *p = m_Parameters[i];
1843
1844 if( (!bOptionsOnly || p->is_Option()) && !p->asGrid_System() && p->is_Enabled() && !p->is_Information() && !(p->Get_Type() == PARAMETER_TYPE_String && ((CSG_Parameter_String *)p)->is_Password()) )
1845 {
1846 bResult = true;
1847
1848 p->_Set_String(); // forcing update (at scripting level some parameter types can be changed without the Set_Parameter() mechanism)
1849
1850 String += CSG_String::Format("%s: %s\n", p->Get_Name(), p->asString());
1851 }
1852 }
1853 }
1854
1855 return( bResult );
1856 }
1857
1858 //---------------------------------------------------------
1859 bool CSG_Parameters::Msg_String(bool bOptionsOnly)
1860 {
1861 CSG_String Msg;
1862
1863 if( Get_String(Msg, bOptionsOnly) )
1864 {
1865 SG_UI_Msg_Add_Execution(CSG_String::Format("\n__________\n[%s] %s:\n", m_Name.c_str(),
1866 bOptionsOnly ? _TL("Options") : _TL("Parameters")),
1867 false, SG_UI_MSG_STYLE_NORMAL
1868 );
1869
1870 SG_UI_Msg_Add_Execution(Msg, false, SG_UI_MSG_STYLE_01);
1871
1872 return( true );
1873 }
1874
1875 return( false );
1876 }
1877
1878
1880 // //
1882
1883 //---------------------------------------------------------
1884 bool CSG_Parameters::Set_History(CSG_MetaData &MetaData, bool bOptions, bool bDataObjects)
1885 {
1886 CSG_MetaData *pEntry;
1887 CSG_Data_Object *pObject;
1888
1889 //-----------------------------------------------------
1890 if( bOptions )
1891 {
1892 for(int i=0; i<Get_Count(); i++) // get options...
1893 {
1894 CSG_Parameter *p = m_Parameters[i];
1895
1896 if( p->is_Option() && p->is_Enabled() && !p->is_Information()
1897 && !(p->Get_Type() == PARAMETER_TYPE_String && ((CSG_Parameter_String *)p)->is_Password()) )
1898 {
1899 p->Serialize(MetaData, true);
1900 }
1901
1902 //---------------------------------------------
1903 else if( p->is_Parameters() )
1904 {
1905 p->asParameters()->Set_History(MetaData, true, false);
1906 }
1907 }
1908 }
1909
1910 //-----------------------------------------------------
1911 if( bDataObjects )
1912 {
1913 for(int i=0; i<Get_Count(); i++) // get input with history...
1914 {
1915 CSG_Parameter *p = m_Parameters[i];
1916
1917 //---------------------------------------------
1918 if( p->is_Input() )
1919 {
1920 if( p->is_DataObject() && (pObject = p->asDataObject()) != NULL )
1921 {
1922 pEntry = MetaData.Add_Child("INPUT");
1923
1924 pEntry->Add_Property("type" , p->Get_Type_Identifier());
1925 pEntry->Add_Property("id" , p->Get_Identifier ());
1926 pEntry->Add_Property("name" , p->Get_Name ());
1927 pEntry->Add_Property("parms", Get_Identifier ());
1928
1929 if( p->Get_Type() == PARAMETER_TYPE_Grid
1930 || p->Get_Type() == PARAMETER_TYPE_Grids )
1931 {
1932 pEntry->Add_Property("system", p->Get_Parent()->Get_Identifier());
1933 }
1934
1935 if( pObject->Get_History().Get_Children_Count() > 0 )
1936 {
1937 pEntry->Add_Children(pObject->Get_History());
1938 }
1939 else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
1940 {
1941 pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
1942 }
1943 }
1944
1945 else if( p->is_DataObject_List() && p->asList()->Get_Item_Count() > 0 )
1946 {
1947 CSG_MetaData *pList = MetaData.Add_Child("INPUT_LIST");
1948
1949 pList->Add_Property("type" , p->Get_Type_Identifier());
1950 pList->Add_Property("id" , p->Get_Identifier ());
1951 pList->Add_Property("name" , p->Get_Name ());
1952 pList->Add_Property("parms", Get_Identifier ());
1953
1954 if( (p->Get_Type() == PARAMETER_TYPE_Grid_List || p->Get_Type() == PARAMETER_TYPE_Grids_List) && p->Get_Parent() && p->Get_Parent()->Get_Type() == PARAMETER_TYPE_Grid_System )
1955 {
1956 pList->Add_Property("system", p->Get_Parent()->Get_Identifier());
1957 }
1958
1959 for(int j=0; j<p->asList()->Get_Item_Count(); j++)
1960 {
1961 pObject = p->asList()->Get_Item(j);
1962
1963 pEntry = pList->Add_Child(*pList, false);
1964
1965 pEntry->Set_Name("INPUT");
1966
1967 if( !SG_Get_History_Ignore_Lists() && pObject->Get_History().Get_Children_Count() > 0 )
1968 {
1969 pEntry->Add_Children(pObject->Get_History());
1970 }
1971 else if( pObject->Get_File_Name() && *pObject->Get_File_Name() )
1972 {
1973 pEntry = pEntry->Add_Child("FILE", pObject->Get_File_Name());
1974 }
1975 }
1976 }
1977 }
1978
1979 //---------------------------------------------
1980 else if( p->is_Parameters() )
1981 {
1982 p->asParameters()->Set_History(MetaData, false, true);
1983 }
1984 }
1985 }
1986
1987 return( true );
1988 }
1989
1990
1992 // //
1993 // Grid System //
1994 // //
1996
1997 //---------------------------------------------------------
2003 bool CSG_Parameters::Set_Grid_System(const CSG_Grid_System &System)
2004 {
2005 return( m_pGrid_System && m_pGrid_System->asGrid_System() && m_pGrid_System->Set_Value((void *)&System) );
2006 }
2007
2008 //---------------------------------------------------------
2014 bool CSG_Parameters::Reset_Grid_System(void)
2015 {
2016 CSG_Grid_System System;
2017
2018 return( Set_Grid_System(System) );
2019 }
2020
2021
2023 // //
2024 // Serialize //
2025 // //
2027
2028 //---------------------------------------------------------
2029 bool CSG_Parameters::Load(const CSG_MetaData &Data)
2030 {
2031 if( Data.Cmp_Name("parameters") )
2032 {
2033 Data.Get_Property("name", m_Name);
2034
2035 for(int i=0; i<Data.Get_Children_Count(); i++)
2036 {
2037 CSG_Parameter *pParameter = Get_Parameter(Data(i)->Get_Property("id"));
2038
2039 if( pParameter && pParameter->Serialize(*Data(i), false) )
2040 {
2041 pParameter->has_Changed();
2042 }
2043 }
2044
2045 return( true );
2046 }
2047
2048 return( false );
2049 }
2050
2051 //---------------------------------------------------------
2052 bool CSG_Parameters::Save(CSG_MetaData &Data) const
2053 {
2054 Data.Destroy();
2055
2056 Data.Set_Name("parameters");
2057 Data.Set_Property("name", m_Name);
2058
2059 for(int i=0; i<Get_Count(); i++)
2060 {
2061 m_Parameters[i]->Serialize(Data, true);
2062 }
2063
2064 return( true );
2065 }
2066
2067 //---------------------------------------------------------
2068 bool CSG_Parameters::Load(const CSG_String &File)
2069 {
2070 CSG_MetaData Data; return( Data.Load(File) && Load(Data) );
2071 }
2072
2073 //---------------------------------------------------------
2074 bool CSG_Parameters::Save(const CSG_String &File) const
2075 {
2076 CSG_MetaData Data; return( Save(Data) && Data.Save(File) );
2077 }
2078
2079 //---------------------------------------------------------
2080 // SAGA 2.0 compatibility...
2081 bool CSG_Parameters::Serialize_Compatibility(CSG_File &Stream)
2082 {
2083 CSG_Parameter *pParameter = NULL;
2084 CSG_String sLine;
2085
2086 if( !Stream.is_Open() )
2087 {
2088 return( false );
2089 }
2090
2091 //-----------------------------------------------------
2092 while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") );
2093
2094 if( sLine.Cmp("[PARAMETER_ENTRIES_BEGIN]") )
2095 {
2096 return( false );
2097 }
2098
2099 //-----------------------------------------------------
2100 while( Stream.Read_Line(sLine) && sLine.Cmp("[PARAMETER_ENTRIES_END]") )
2101 {
2102 if( !sLine.Cmp("[PARAMETER_ENTRY_BEGIN]")
2103 && Stream.Read_Line(sLine) && (pParameter = Get_Parameter(sLine)) != NULL
2104 && Stream.Read_Line(sLine) )
2105 {
2106 int i;
2107 double d;
2108 TSG_Rect r;
2109 CSG_String s;
2110 CSG_Table t;
2111
2112 switch( sLine.asInt() )
2113 {
2114 case 1: // PARAMETER_TYPE_Bool:
2115 case 2: // PARAMETER_TYPE_Int:
2116 case 6: // PARAMETER_TYPE_Choice:
2117 case 11: // PARAMETER_TYPE_Color:
2118 case 15: // PARAMETER_TYPE_Table_Field:
2119 pParameter->Set_Value(Stream.Scan_Int());
2120 break;
2121
2122 case 3: // PARAMETER_TYPE_Double:
2123 case 4: // PARAMETER_TYPE_Degree:
2124 pParameter->Set_Value(Stream.Scan_Double());
2125 break;
2126
2127 case 5: // PARAMETER_TYPE_Range:
2128 pParameter->asRange()->Set_Range(Stream.Scan_Double(), Stream.Scan_Double());
2129 break;
2130
2131 case 7: // PARAMETER_TYPE_String:
2132 case 9: // PARAMETER_TYPE_FilePath:
2133 Stream.Read_Line(sLine);
2134 pParameter->Set_Value(sLine);
2135 break;
2136
2137 case 8: // PARAMETER_TYPE_Text:
2138 s.Clear();
2139 while( Stream.Read_Line(sLine) && sLine.Cmp("[TEXT_ENTRY_END]") )
2140 {
2141 s += sLine + "\n";
2142 }
2143 pParameter->Set_Value(s);
2144 break;
2145
2146 case 10: // PARAMETER_TYPE_Font:
2147 Stream.Read(&i, sizeof(i));
2148 pParameter->Set_Value(i);
2149 break;
2150
2151 case 12: // PARAMETER_TYPE_Colors:
2152 pParameter->asColors()->Serialize(Stream, false, false);
2153 break;
2154
2155 case 13: // PARAMETER_TYPE_FixedTable:
2156 if( t.Serialize(Stream, false) )
2157 {
2158 pParameter->asTable()->Assign_Values(&t);
2159 }
2160 break;
2161
2162 case 14: // PARAMETER_TYPE_Grid_System:
2163 Stream.Read(&d, sizeof(d));
2164 Stream.Read(&r, sizeof(r));
2165 pParameter->asGrid_System()->Assign(d, r);
2166 break;
2167
2168 case 16: // PARAMETER_TYPE_Grid:
2169 case 17: // PARAMETER_TYPE_Table:
2170 case 18: // PARAMETER_TYPE_Shapes:
2171 case 19: // PARAMETER_TYPE_TIN:
2172 case 24: // PARAMETER_TYPE_DataObject_Output:
2173 if( Stream.Read_Line(sLine) )
2174 {
2175 if( !sLine.Cmp("[ENTRY_DATAOBJECT_CREATE]") )
2176 {
2177 pParameter->Set_Value(DATAOBJECT_CREATE);
2178 }
2179 else
2180 {
2181 pParameter->Set_Value(m_pManager ? m_pManager->Find(sLine) : NULL);
2182 }
2183 }
2184 break;
2185
2186 case 20: // PARAMETER_TYPE_Grid_List:
2187 case 21: // PARAMETER_TYPE_Table_List:
2188 case 22: // PARAMETER_TYPE_Shapes_List:
2189 case 23: // PARAMETER_TYPE_TIN_List:
2190 while( Stream.Read_Line(sLine) && sLine.Cmp("[ENTRY_DATAOBJECTLIST_END]") )
2191 {
2192 CSG_Data_Object *pObject = m_pManager ? m_pManager->Find(sLine) : NULL;
2193
2194 if( pObject )
2195 {
2196 pParameter->asList()->Add_Item(pObject);
2197 }
2198 }
2199 break;
2200
2201 case 25: // PARAMETER_TYPE_Parameters:
2202 pParameter->asParameters()->Serialize_Compatibility(Stream);
2203 break;
2204 }
2205 }
2206 }
2207
2208 return( true );
2209 }
2210
2211
2213 // //
2214 // //
2215 // //
2217
2218 //---------------------------------------------------------
CSG_Parameter::asColors
CSG_Colors * asColors(void) const
Definition: parameter.cpp:966
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Parameters::Assign
bool Assign(CSG_Parameters *pSource)
Definition: parameters.cpp:1453
CSG_Parameter_Date
Definition: parameters.h:571
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:745
CSG_Parameters::Get_Description
const CSG_String & Get_Description(void) const
Definition: parameters.h:1691
CSG_Parameter_Range::Set_Min
bool Set_Min(double Min)
Definition: parameter_data.cpp:802
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Parameter_Choice::Set_Items
bool Set_Items(const SG_Char *String)
Definition: parameter_data.cpp:934
CSG_Parameters::Del_References
void Del_References(void)
Definition: parameters.cpp:326
CSG_Parameter_Grid
Definition: parameters.h:1194
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Parameters::Add_Date
CSG_Parameter * Add_Date(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
Definition: parameters.cpp:416
CSG_Parameter_Value::Set_Minimum
void Set_Minimum(double Minimum, bool bOn=true)
Definition: parameter_data.cpp:371
CSG_Parameters::Add_Parameter
CSG_Parameter * Add_Parameter(CSG_Parameter *pParameter)
Definition: parameters.cpp:365
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.cpp:567
SG_Create_Table
CSG_Table * SG_Create_Table(void)
Definition: table.cpp:65
CSG_Parameters::Add_Degree
CSG_Parameter * Add_Degree(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)
Definition: parameters.cpp:411
CSG_String::Append
CSG_String & Append(const CSG_String &String)
Definition: api_string.cpp:355
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3013
CSG_Parameter_Degree
Definition: parameters.h:546
CSG_Parameter_Parameters
Definition: parameters.h:1563
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_Parameters::Add_Colors
CSG_Parameter * Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL)
Definition: parameters.cpp:536
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_Parameters::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: parameters.cpp:2003
CSG_Parameters::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: parameters.cpp:2014
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
PARAMETER_OPTIONAL
#define PARAMETER_OPTIONAL
Definition: parameters.h:96
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:994
CSG_Parameters::Get_Owner
void * Get_Owner(void) const
Definition: parameters.h:1670
CSG_Parameter_TIN
Definition: parameters.h:1309
data_manager.h
CSG_Parameter_Table_List
Definition: parameters.h:1463
CSG_Parameter_Value::Set_Maximum
void Set_Maximum(double Maximum, bool bOn=true)
Definition: parameter_data.cpp:391
SG_UI_MSG_STYLE_NORMAL
@ SG_UI_MSG_STYLE_NORMAL
Definition: api_core.h:1493
CSG_Parameters::Add_Data_Type
CSG_Parameter * Add_Data_Type(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
Definition: parameters.cpp:452
CSG_Parameters::Del_Parameters
bool Del_Parameters(void)
Definition: parameters.cpp:1255
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
SG_Create_PointCloud
CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
CSG_Parameters::Add_Grid_or_Const
CSG_Parameter * Add_Grid_or_Const(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, bool bSystem_Dependent=true)
Definition: parameters.cpp:610
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Grid_System
Definition: grid.h:200
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
CSG_Parameters::Add_Font
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)
Definition: parameters.cpp:518
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Parameters::Add_Info_Value
CSG_Parameter * Add_Info_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
Definition: parameters.cpp:390
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
SG_UI_Msg_Add_Execution
void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:517
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:371
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:600
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
CSG_Parameters::Serialize_Compatibility
bool Serialize_Compatibility(CSG_File &Stream)
Definition: parameters.cpp:2081
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
CSG_Parameter_Colors
Definition: parameters.h:956
CSG_Parameter_Choices
Definition: parameters.h:747
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Parameters::Add_Grids_List
CSG_Parameter * Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:698
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1165
CSG_Parameters::Add_String
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)
Definition: parameters.cpp:489
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:578
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Parameters::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameters.cpp:262
CSG_Parameters::DataObjects_Check
bool DataObjects_Check(bool bSilent=false)
Definition: parameters.cpp:1512
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Parameters::Add_Value
CSG_Parameter * Add_Value(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:385
CSG_File::Scan_Int
int Scan_Int(void) const
Definition: api_file.cpp:537
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Parameter_Table_Field
Definition: parameters.h:1054
CSG_Data_Manager::Exists
bool Exists(CSG_Data_Object *pObject) const
Definition: data_manager.cpp:389
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_Parameter_Node
Definition: parameters.h:375
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1072
CSG_Parameters::~CSG_Parameters
virtual ~CSG_Parameters(void)
Definition: parameters.cpp:95
SG_Create_TIN
CSG_TIN * SG_Create_TIN(void)
Definition: tin.cpp:63
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_Parameter_Font
Definition: parameters.h:895
CSG_Parameter::ignore_Projection
void ignore_Projection(bool bIgnore)
Definition: parameter.cpp:177
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Parameters::Add_Table_Field_or_Const
CSG_Parameter * Add_Table_Field_or_Const(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)
Definition: parameters.cpp:741
CSG_Parameters::Add_PointCloud
CSG_Parameter * Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:886
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:102
CSG_Parameter_PointCloud
Definition: parameters.h:1333
CSG_Parameters::Get_String
bool Get_String(CSG_String &String, bool bOptionsOnly)
Definition: parameters.cpp:1827
CSG_Parameters::Msg_String
bool Msg_String(bool bOptionsOnly)
Definition: parameters.cpp:1859
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
SSG_Rect
Definition: geo_tools.h:464
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
CSG_Parameters::has_GUI
bool has_GUI(void) const
Definition: parameters.cpp:242
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1096
CSG_Parameters::Add_Range
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)
Definition: parameters.cpp:432
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1509
CSG_Parameters::Add_Info_Range
CSG_Parameter * Add_Info_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)
Definition: parameters.cpp:437
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:450
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:294
CSG_Parameter_Text
Definition: parameters.h:833
CSG_Parameter_File_Name::Set_Flag_Multiple
void Set_Flag_Multiple(bool bFlag)
Definition: parameter_data.cpp:1564
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_Parameter_Shapes
Definition: parameters.h:1278
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3055
CSG_Parameter_Fixed_Table
Definition: parameters.h:990
CSG_Grids::Create
virtual bool Create(const CSG_Grids &Grids)
Definition: grids.cpp:271
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:437
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
CSG_Parameters::Add_TIN_List
CSG_Parameter * Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:871
CSG_Parameter_File_Name::Set_Flag_Save
void Set_Flag_Save(bool bFlag)
Definition: parameter_data.cpp:1559
CSG_Parameters::Set_Name
void Set_Name(const CSG_String &Name)
Definition: parameters.cpp:272
SG_UI_Dlg_Message
void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:362
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
CSG_Parameters::Add_TIN_Output
CSG_Parameter * Add_TIN_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:859
CSG_Parameter_Grid_System
Definition: parameters.h:1021
CSG_Parameters::Assign_Values
bool Assign_Values(CSG_Parameters *pSource)
Definition: parameters.cpp:1459
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
CSG_Parameters::Add_FixedTable
CSG_Parameter * Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
Definition: parameters.cpp:548
CSG_Data_Object::asGrids
class CSG_Grids * asGrids(bool bPolymorph=false) const
Definition: dataobject.cpp:502
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
CSG_Parameters::Restore_Defaults
bool Restore_Defaults(bool bClearData=false)
Definition: parameters.cpp:1421
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Table::Serialize
bool Serialize(CSG_File &Stream, bool bSave)
Definition: table_io.cpp:538
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Parameters::Use_Grid_System
bool Use_Grid_System(void)
Definition: parameters.cpp:224
CSG_Parameters::Add_FilePath
CSG_Parameter * Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
Definition: parameters.cpp:500
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:208
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_Parameter::Set_Default
bool Set_Default(int Value)
Definition: parameter.cpp:851
CSG_Parameter_Data_Type::Set_Data_Types
bool Set_Data_Types(int Data_Types, TSG_Data_Type Default=SG_DATATYPE_Undefined, const CSG_String &User="")
Definition: parameter_data.cpp:1149
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3025
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter_File_Name
Definition: parameters.h:853
CSG_Parameters::Add_Shapes_List
CSG_Parameter * Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:832
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
CSG_Parameters::Add_Grid_List
CSG_Parameter * Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:632
CSG_Parameter_Grids
Definition: parameters.h:1234
CSG_Parameters::Load
bool Load(const CSG_MetaData &Data)
Definition: parameters.cpp:2029
CSG_File::Scan_Double
double Scan_Double(void) const
Definition: api_file.cpp:542
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1672
SG_UI_DataObject_Update
bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
Definition: api_callback.cpp:611
CSG_Parameters::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: parameters.cpp:292
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
CSG_Parameter_Grids_List
Definition: parameters.h:1437
CSG_Parameter_File_Name::Set_Filter
void Set_Filter(const SG_Char *Filter)
Definition: parameter_data.cpp:1541
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Parameters::Add_Color
CSG_Parameter * Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
Definition: parameters.cpp:426
CSG_Parameter::asDataType
class CSG_Parameter_Data_Type * asDataType(void) const
Definition: parameter.cpp:1037
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:255
CSG_Parameter_Grid_List
Definition: parameters.h:1402
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
CSG_DateTime::Get_JDN
double Get_JDN(void) const
Definition: datetime.cpp:411
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Parameters::Add_Table_List
CSG_Parameter * Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:793
CSG_Parameter_Range::Set_Range
bool Set_Range(double Min, double Max)
Definition: parameter_data.cpp:783
CSG_Parameter_Range
Definition: parameters.h:610
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:401
CSG_Parameters::Add_Table
CSG_Parameter * Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:771
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Parameters::Add_Parameters
CSG_Parameter * Add_Parameters(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:923
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:840
CSG_Parameters::Add_Grids
CSG_Parameter * Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:658
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Parameters::Create
bool Create(const CSG_Parameters &Parameters)
Definition: parameters.cpp:122
CSG_Parameters::Add_Table_Fields
CSG_Parameter * Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:754
CSG_Parameters::Add_Grid
CSG_Parameter * Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:582
CSG_File::is_Open
bool is_Open(void) const
Definition: api_core.h:1135
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Parameters::Add_PointCloud_Output
CSG_Parameter * Add_PointCloud_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:896
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1042
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1191
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
parameters.h
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_Parameters::Add_Info_String
CSG_Parameter * Add_Info_String(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false)
Definition: parameters.cpp:494
CSG_Parameters::Add_TIN
CSG_Parameter * Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:849
SG_Create_Grids
CSG_Grids * SG_Create_Grids(void)
Definition: grids.cpp:65
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Parameters::Add_Grids_Output
CSG_Parameter * Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:686
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
CSG_Parameter_Shapes_List
Definition: parameters.h:1486
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Projection
Definition: geo_tools.h:833
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1685
CSG_Parameter_Int
Definition: parameters.h:470
CSG_Parameters::Add_Shapes
CSG_Parameter * Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:808
CSG_Table
Definition: table.h:283
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_Parameter_Range::Set_Max
bool Set_Max(double Max)
Definition: parameter_data.cpp:820
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:105
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:275
CSG_Parameter_Double
Definition: parameters.h:508
CSG_Parameter_Bool
Definition: parameters.h:395
SG_Get_History_Ignore_Lists
int SG_Get_History_Ignore_Lists(void)
Definition: dataobject.cpp:172
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Parameters::Set_Description
void Set_Description(const CSG_String &Description)
Definition: parameters.cpp:282
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
CSG_String
Definition: api_core.h:557
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Data_Object::asGrid
class CSG_Grid * asGrid(bool bPolymorph=false) const
Definition: dataobject.cpp:491
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
PARAMETER_INFORMATION
#define PARAMETER_INFORMATION
Definition: parameters.h:97
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Colors::Serialize
bool Serialize(CSG_File &Stream, bool bSave, bool bBinary)
Definition: api_colors.cpp:1162
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1121
CSG_Parameter_Table_Fields
Definition: parameters.h:1094
CSG_Parameter::Check
bool Check(bool bSilent=true)
Definition: parameter.cpp:898
CSG_Parameter_String
Definition: parameters.h:799
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_Parameters::Add_Shapes_Output
CSG_Parameter * Add_Shapes_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:820
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1281
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:832
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
CSG_Parameter_Color
Definition: parameters.h:930
CSG_Parameters::Add_Grid_Output
CSG_Parameter * Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:620
CSG_Parameters::CSG_Parameters
CSG_Parameters(void)
Definition: parameters.cpp:65
CSG_Parameters::Destroy
void Destroy(void)
Definition: parameters.cpp:182
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Parameter_File_Name::Set_Flag_Directory
void Set_Flag_Directory(bool bFlag)
Definition: parameter_data.cpp:1569
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Parameters::Save
bool Save(CSG_MetaData &Data) const
Definition: parameters.cpp:2052
CSG_Parameters::Add_Table_Output
CSG_Parameter * Add_Table_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:781
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1646
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Parameters::Add_PointCloud_List
CSG_Parameter * Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:908
CSG_Parameters::Assign_Parameters
bool Assign_Parameters(CSG_Parameters *pSource)
Definition: parameters.cpp:1483
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:771
CSG_Parameters::Set_Manager
void Set_Manager(class CSG_Data_Manager *pManager)
Definition: parameters.cpp:206
CSG_Parameters::Set_Identifier
void Set_Identifier(const CSG_String &Identifier)
Definition: parameters.cpp:252
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1348
CSG_Parameter_Choice
Definition: parameters.h:659
SG_UI_MSG_STYLE_01
@ SG_UI_MSG_STYLE_01
Definition: api_core.h:1500
CSG_Parameters::Get_Name
const CSG_String & Get_Name(void) const
Definition: parameters.h:1688
CSG_Parameter::Set_Enabled
bool Set_Enabled(bool bEnabled=true)
Definition: parameter.cpp:195
CSG_Parameter_Range::Get_Min_Parameter
CSG_Parameter_Double * Get_Min_Parameter(void) const
Definition: parameters.h:620
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Parameters::Add_Choices
CSG_Parameter * Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
Definition: parameters.cpp:479
CSG_Parameters::Set_Callback_On_Parameter_Changed
TSG_PFNC_Parameter_Changed Set_Callback_On_Parameter_Changed(TSG_PFNC_Parameter_Changed pCallback)
Definition: parameters.cpp:1285
CSG_Parameter_PointCloud_List
Definition: parameters.h:1540
CSG_Parameter_TIN_List
Definition: parameters.h:1517
SG_Create_Grid
CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Parameters
Definition: parameters.h:1650
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Parameter::is_Parameters
bool is_Parameters(void) const
Definition: parameter.cpp:312
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:968
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:565
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter_Range::Get_Max_Parameter
CSG_Parameter_Double * Get_Max_Parameter(void) const
Definition: parameters.h:624
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:238
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
CSG_Parameter_Choices::Set_Items
void Set_Items(const CSG_String &Items)
Definition: parameter_data.cpp:1303
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
CSG_Colors::Assign
bool Assign(const CSG_Colors &Colors)
Definition: api_colors.cpp:1031
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:887
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Parameters::Set_History
bool Set_History(CSG_MetaData &History, bool bOptions=true, bool bDataObjects=true)
Definition: parameters.cpp:1884
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1306
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
CSG_Parameter_Table
Definition: parameters.h:1255
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:122
CSG_Parameter_Data_Type
Definition: parameters.h:717
CSG_Colors
Definition: api_core.h:1329
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:103
CSG_Parameters::Add_Table_Field
CSG_Parameter * Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
Definition: parameters.cpp:724
DATAOBJECT_NOTSET
#define DATAOBJECT_NOTSET
Definition: dataobject.h:129
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: parameters.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Typedefs | Enumerations | Functions
parameters.h File Reference
#include "grids.h"
#include "table.h"
#include "shapes.h"
#include "tin.h"
#include "pointcloud.h"
#include "datetime.h"

Go to the source code of this file.

Classes

class | CSG_Parameter
class | CSG_Parameter_Node
class | CSG_Parameter_Bool
class | CSG_Parameter_Value
class | CSG_Parameter_Int
class | CSG_Parameter_Double
class | CSG_Parameter_Degree
class | CSG_Parameter_Date
class | CSG_Parameter_Range
class | CSG_Parameter_Choice
class | CSG_Parameter_Data_Type
class | CSG_Parameter_Choices
class | CSG_Parameter_String
class | CSG_Parameter_Text
class | CSG_Parameter_File_Name
class | CSG_Parameter_Font
class | CSG_Parameter_Color
class | CSG_Parameter_Colors
class | CSG_Parameter_Fixed_Table
class | CSG_Parameter_Grid_System
class | CSG_Parameter_Table_Field
class | CSG_Parameter_Table_Fields
class | CSG_Parameter_Data_Object
class | CSG_Parameter_Data_Object_Output
class | CSG_Parameter_Grid
class | CSG_Parameter_Grids
class | CSG_Parameter_Table
class | CSG_Parameter_Shapes
class | CSG_Parameter_TIN
class | CSG_Parameter_PointCloud
class | CSG_Parameter_List
class | CSG_Parameter_Grid_List
class | CSG_Parameter_Grids_List
class | CSG_Parameter_Table_List
class | CSG_Parameter_Shapes_List
class | CSG_Parameter_TIN_List
class | CSG_Parameter_PointCloud_List
class | CSG_Parameter_Parameters
class | CSG_Parameters_Grid_Target
class | CSG_Parameters

Macros

#define | PARAMETER_INPUT 0x01
#define | PARAMETER_OUTPUT 0x02
#define | PARAMETER_OPTIONAL 0x04
#define | PARAMETER_INFORMATION 0x08
#define | PARAMETER_IGNORE_PROJECTION 0x10
#define | PARAMETER_NOT_FOR_GUI 0x20
#define | PARAMETER_NOT_FOR_CMD 0x40
#define | PARAMETER_INPUT_OPTIONAL (PARAMETER_INPUT | PARAMETER_OPTIONAL)
#define | PARAMETER_OUTPUT_OPTIONAL (PARAMETER_OUTPUT | PARAMETER_OPTIONAL)
#define | PARAMETER_DESCRIPTION_NAME 0x01
#define | PARAMETER_DESCRIPTION_TYPE 0x02
#define | PARAMETER_DESCRIPTION_OPTIONAL 0x04
#define | PARAMETER_DESCRIPTION_PROPERTIES 0x08
#define | PARAMETER_DESCRIPTION_TEXT 0x10
#define | PARAMETER_DESCRIPTION_ALL (PARAMETER_DESCRIPTION_NAME | PARAMETER_DESCRIPTION_TYPE | PARAMETER_DESCRIPTION_OPTIONAL | PARAMETER_DESCRIPTION_PROPERTIES | PARAMETER_DESCRIPTION_TEXT)
#define | PARAMETER_CHECK_VALUES 0x01
#define | PARAMETER_CHECK_ENABLE 0x02
#define | PARAMETER_CHECK_ALL (PARAMETER_CHECK_VALUES | PARAMETER_CHECK_ENABLE)
#define | SG_PARAMETER_DATA_SET_FALSE 0
#define | SG_PARAMETER_DATA_SET_TRUE 1
#define | SG_PARAMETER_DATA_SET_CHANGED 2

Typedefs

typedef int(* TSG_PFNC_Parameter_Changed) (CSG_Parameter *pParameter, int Flags)

Enumerations

enum TSG_Parameter_Type {
PARAMETER_TYPE_Node = 0, PARAMETER_TYPE_Bool, PARAMETER_TYPE_Int, PARAMETER_TYPE_Double,
PARAMETER_TYPE_Degree, PARAMETER_TYPE_Date, PARAMETER_TYPE_Range, PARAMETER_TYPE_Data_Type,
PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_String, PARAMETER_TYPE_Text,
PARAMETER_TYPE_FilePath, PARAMETER_TYPE_Font, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors,
PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields,
PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Table,
PARAMETER_TYPE_Shapes, PARAMETER_TYPE_TIN, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grids_List,
PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_TIN_List, PARAMETER_TYPE_PointCloud_List,
PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_Undefined
}

Functions

SAGA_API_DLL_EXPORT CSG_String | SG_Parameter_Type_Get_Name (TSG_Parameter_Type Type)
SAGA_API_DLL_EXPORT CSG_String | SG_Parameter_Type_Get_Identifier (TSG_Parameter_Type Type)
SAGA_API_DLL_EXPORT TSG_Parameter_Type | SG_Parameter_Type_Get_Type (const CSG_String &Identifier)

Detailed Description

The core classes defining the parameters for SAGA tool interfaces.

See also
CSG_Parameters
CSG_Parameter

Definition in file parameters.h.

Macro Definition Documentation

◆ PARAMETER_CHECK_ALL

#define PARAMETER_CHECK_ALL (PARAMETER_CHECK_VALUES | PARAMETER_CHECK_ENABLE)

Definition at line 191 of file parameters.h.

◆ PARAMETER_CHECK_ENABLE

#define PARAMETER_CHECK_ENABLE 0x02

Definition at line 190 of file parameters.h.

◆ PARAMETER_CHECK_VALUES

#define PARAMETER_CHECK_VALUES 0x01

Definition at line 189 of file parameters.h.

◆ PARAMETER_DESCRIPTION_ALL

#define PARAMETER_DESCRIPTION_ALL (PARAMETER_DESCRIPTION_NAME | PARAMETER_DESCRIPTION_TYPE | PARAMETER_DESCRIPTION_OPTIONAL | PARAMETER_DESCRIPTION_PROPERTIES | PARAMETER_DESCRIPTION_TEXT)

Definition at line 111 of file parameters.h.

◆ PARAMETER_DESCRIPTION_NAME

#define PARAMETER_DESCRIPTION_NAME 0x01

Definition at line 106 of file parameters.h.

◆ PARAMETER_DESCRIPTION_OPTIONAL

#define PARAMETER_DESCRIPTION_OPTIONAL 0x04

Definition at line 108 of file parameters.h.

◆ PARAMETER_DESCRIPTION_PROPERTIES

#define PARAMETER_DESCRIPTION_PROPERTIES 0x08

Definition at line 109 of file parameters.h.

◆ PARAMETER_DESCRIPTION_TEXT

#define PARAMETER_DESCRIPTION_TEXT 0x10

Definition at line 110 of file parameters.h.

◆ PARAMETER_DESCRIPTION_TYPE

#define PARAMETER_DESCRIPTION_TYPE 0x02

Definition at line 107 of file parameters.h.

◆ PARAMETER_IGNORE_PROJECTION

#define PARAMETER_IGNORE_PROJECTION 0x10

Definition at line 98 of file parameters.h.

◆ PARAMETER_INFORMATION

#define PARAMETER_INFORMATION 0x08

Definition at line 97 of file parameters.h.

◆ PARAMETER_INPUT

#define PARAMETER_INPUT 0x01

Definition at line 94 of file parameters.h.

◆ PARAMETER_INPUT_OPTIONAL

#define PARAMETER_INPUT_OPTIONAL (PARAMETER_INPUT | PARAMETER_OPTIONAL)

Definition at line 102 of file parameters.h.

◆ PARAMETER_NOT_FOR_CMD

#define PARAMETER_NOT_FOR_CMD 0x40

Definition at line 100 of file parameters.h.

◆ PARAMETER_NOT_FOR_GUI

#define PARAMETER_NOT_FOR_GUI 0x20

Definition at line 99 of file parameters.h.

◆ PARAMETER_OPTIONAL

#define PARAMETER_OPTIONAL 0x04

Definition at line 96 of file parameters.h.

◆ PARAMETER_OUTPUT

#define PARAMETER_OUTPUT 0x02

Definition at line 95 of file parameters.h.

◆ PARAMETER_OUTPUT_OPTIONAL

#define PARAMETER_OUTPUT_OPTIONAL (PARAMETER_OUTPUT | PARAMETER_OPTIONAL)

Definition at line 103 of file parameters.h.

◆ SG_PARAMETER_DATA_SET_CHANGED

#define SG_PARAMETER_DATA_SET_CHANGED 2

Definition at line 196 of file parameters.h.

◆ SG_PARAMETER_DATA_SET_FALSE

#define SG_PARAMETER_DATA_SET_FALSE 0

Definition at line 194 of file parameters.h.

◆ SG_PARAMETER_DATA_SET_TRUE

#define SG_PARAMETER_DATA_SET_TRUE 1

Definition at line 195 of file parameters.h.

Typedef Documentation

◆ TSG_PFNC_Parameter_Changed

typedef int(* TSG_PFNC_Parameter_Changed) (CSG_Parameter *pParameter, int Flags)

Definition at line 1646 of file parameters.h.

Enumeration Type Documentation

◆ TSG_Parameter_Type

enum TSG_Parameter_Type
Enumerator
PARAMETER_TYPE_Node
PARAMETER_TYPE_Bool
PARAMETER_TYPE_Int
PARAMETER_TYPE_Double
PARAMETER_TYPE_Degree
PARAMETER_TYPE_Date
PARAMETER_TYPE_Range
PARAMETER_TYPE_Data_Type
PARAMETER_TYPE_Choice
PARAMETER_TYPE_Choices
PARAMETER_TYPE_String
PARAMETER_TYPE_Text
PARAMETER_TYPE_FilePath
PARAMETER_TYPE_Font
PARAMETER_TYPE_Color
PARAMETER_TYPE_Colors
PARAMETER_TYPE_FixedTable
PARAMETER_TYPE_Grid_System
PARAMETER_TYPE_Table_Field
PARAMETER_TYPE_Table_Fields
PARAMETER_TYPE_PointCloud
PARAMETER_TYPE_Grid
PARAMETER_TYPE_Grids
PARAMETER_TYPE_Table
PARAMETER_TYPE_Shapes
PARAMETER_TYPE_TIN
PARAMETER_TYPE_Grid_List
PARAMETER_TYPE_Grids_List
PARAMETER_TYPE_Table_List
PARAMETER_TYPE_Shapes_List
PARAMETER_TYPE_TIN_List
PARAMETER_TYPE_PointCloud_List
PARAMETER_TYPE_DataObject_Output
PARAMETER_TYPE_Parameters
PARAMETER_TYPE_Undefined

Definition at line 121 of file parameters.h.

Function Documentation

◆ SG_Parameter_Type_Get_Identifier()

SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Identifier ( TSG_Parameter_Type Type )

Definition at line 114 of file parameter_data.cpp.

References PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, and PARAMETER_TYPE_TIN_List.

Referenced by CSG_Parameter::Get_Type_Identifier().

◆ SG_Parameter_Type_Get_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Name ( TSG_Parameter_Type Type )

Definition at line 64 of file parameter_data.cpp.

References _TL, PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, and PARAMETER_TYPE_TIN_List.

Referenced by CSG_Parameter::Get_Type_Name().

◆ SG_Parameter_Type_Get_Type()

SAGA_API_DLL_EXPORT TSG_Parameter_Type SG_Parameter_Type_Get_Type ( const CSG_String & Identifier )

Definition at line 164 of file parameter_data.cpp.

References CSG_String::Cmp(), PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid, PARAMETER_TYPE_Grid_List, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Grids, PARAMETER_TYPE_Grids_List, PARAMETER_TYPE_Int, PARAMETER_TYPE_Node, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_PointCloud, PARAMETER_TYPE_PointCloud_List, PARAMETER_TYPE_Range, PARAMETER_TYPE_Shapes, PARAMETER_TYPE_Shapes_List, PARAMETER_TYPE_String, PARAMETER_TYPE_Table, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Table_List, PARAMETER_TYPE_Text, PARAMETER_TYPE_TIN, PARAMETER_TYPE_TIN_List, and PARAMETER_TYPE_Undefined.

Referenced by CSG_Tool_Chain::Create().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: parameters.h Source File

  • saga_core
  • saga_api
parameters.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // parameters.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__parameters_H
54 #define HEADER_INCLUDED__SAGA_API__parameters_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
72 // //
74 // //
75 // //
77
78 //---------------------------------------------------------
79 #include "grids.h"
80 #include "table.h"
81 #include "shapes.h"
82 #include "tin.h"
83 #include "pointcloud.h"
84 #include "datetime.h"
85
86
88 // //
89 // //
90 // //
92
93 //---------------------------------------------------------
94 #define PARAMETER_INPUT 0x01
95 #define PARAMETER_OUTPUT 0x02
96 #define PARAMETER_OPTIONAL 0x04
97 #define PARAMETER_INFORMATION 0x08
98 #define PARAMETER_IGNORE_PROJECTION 0x10
99 #define PARAMETER_NOT_FOR_GUI 0x20
100 #define PARAMETER_NOT_FOR_CMD 0x40
101
102 #define PARAMETER_INPUT_OPTIONAL (PARAMETER_INPUT | PARAMETER_OPTIONAL)
103 #define PARAMETER_OUTPUT_OPTIONAL (PARAMETER_OUTPUT | PARAMETER_OPTIONAL)
104
105 //---------------------------------------------------------
106 #define PARAMETER_DESCRIPTION_NAME 0x01
107 #define PARAMETER_DESCRIPTION_TYPE 0x02
108 #define PARAMETER_DESCRIPTION_OPTIONAL 0x04
109 #define PARAMETER_DESCRIPTION_PROPERTIES 0x08
110 #define PARAMETER_DESCRIPTION_TEXT 0x10
111 #define PARAMETER_DESCRIPTION_ALL (PARAMETER_DESCRIPTION_NAME | PARAMETER_DESCRIPTION_TYPE | PARAMETER_DESCRIPTION_OPTIONAL | PARAMETER_DESCRIPTION_PROPERTIES | PARAMETER_DESCRIPTION_TEXT)
112
113
115 // //
116 // //
117 // //
119
120 //---------------------------------------------------------
121 typedef enum
122 {
123 PARAMETER_TYPE_Node = 0,
124
125 PARAMETER_TYPE_Bool,
126 PARAMETER_TYPE_Int,
127 PARAMETER_TYPE_Double,
128 PARAMETER_TYPE_Degree,
129 PARAMETER_TYPE_Date,
130 PARAMETER_TYPE_Range,
131 PARAMETER_TYPE_Data_Type,
132 PARAMETER_TYPE_Choice,
133 PARAMETER_TYPE_Choices,
134 PARAMETER_TYPE_String,
135 PARAMETER_TYPE_Text,
136 PARAMETER_TYPE_FilePath,
137
138 PARAMETER_TYPE_Font,
139 PARAMETER_TYPE_Color,
140 PARAMETER_TYPE_Colors,
141 PARAMETER_TYPE_FixedTable,
142
143 PARAMETER_TYPE_Grid_System,
144 PARAMETER_TYPE_Table_Field,
145 PARAMETER_TYPE_Table_Fields,
146
147 PARAMETER_TYPE_PointCloud,
148 PARAMETER_TYPE_Grid,
149 PARAMETER_TYPE_Grids,
150 PARAMETER_TYPE_Table,
151 PARAMETER_TYPE_Shapes,
152 PARAMETER_TYPE_TIN,
153
154 PARAMETER_TYPE_Grid_List,
155 PARAMETER_TYPE_Grids_List,
156 PARAMETER_TYPE_Table_List,
157 PARAMETER_TYPE_Shapes_List,
158 PARAMETER_TYPE_TIN_List,
159 PARAMETER_TYPE_PointCloud_List,
160
161 PARAMETER_TYPE_DataObject_Output,
162
163 PARAMETER_TYPE_Parameters,
164
165 PARAMETER_TYPE_Undefined
166 }
167 TSG_Parameter_Type;
168
169
171 // //
172 // //
173 // //
175
176 //---------------------------------------------------------
177 SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Name (TSG_Parameter_Type Type);
178 SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Identifier (TSG_Parameter_Type Type);
179 SAGA_API_DLL_EXPORT TSG_Parameter_Type SG_Parameter_Type_Get_Type (const CSG_String &Identifier);
180
181
183 // //
184 // //
185 // //
187
188 //---------------------------------------------------------
189 #define PARAMETER_CHECK_VALUES 0x01
190 #define PARAMETER_CHECK_ENABLE 0x02
191 #define PARAMETER_CHECK_ALL (PARAMETER_CHECK_VALUES | PARAMETER_CHECK_ENABLE)
192
193 //---------------------------------------------------------
194 #define SG_PARAMETER_DATA_SET_FALSE 0
195 #define SG_PARAMETER_DATA_SET_TRUE 1
196 #define SG_PARAMETER_DATA_SET_CHANGED 2
197
198
200 // //
201 // CSG_Parameter //
202 // //
204
205 //---------------------------------------------------------
206 class SAGA_API_DLL_EXPORT CSG_Parameter
207 {
208 public:
209
210 CSG_Parameters * Get_Parameters (void) const;
211 CSG_Parameter * Get_Parent (void) const;
212 class CSG_Data_Manager * Get_Manager (void) const;
213
214 virtual TSG_Parameter_Type Get_Type (void) const = 0;
215 CSG_String Get_Type_Identifier (void) const;
216 CSG_String Get_Type_Name (void) const;
217
218 const SG_Char * Get_Identifier (void) const;
219 bool Cmp_Identifier (const CSG_String &Identifier) const;
220 bool Set_Name (const CSG_String &Name);
221 const SG_Char * Get_Name (void) const;
222 const SG_Char * Get_Description (void) const;
223 bool Set_Description (const CSG_String &Description);
224 CSG_String Get_Description (int Flags) const;
225 CSG_String Get_Description (int Flags, const SG_Char *Separator) const;
226
227 bool Set_Enabled (bool bEnabled = true);
228 bool is_Enabled (bool bCheckEnv = true) const;
229
230 virtual bool is_Valid (void) const { return( true ); }
231 bool is_Input (void) const { return( !!(m_Constraint & PARAMETER_INPUT ) ); }
232 bool is_Output (void) const { return( !!(m_Constraint & PARAMETER_OUTPUT ) ); }
233 bool is_Optional (void) const { return( !!(m_Constraint & PARAMETER_OPTIONAL ) ); }
234 bool is_Information (void) const { return( !!(m_Constraint & PARAMETER_INFORMATION) ); }
235 bool is_Option (void) const;
236 bool is_DataObject (void) const;
237 bool is_DataObject_List (void) const;
238 bool is_Parameters (void) const;
239 bool is_Serializable (void) const;
240 bool is_Compatible (CSG_Parameter *pParameter) const;
241 bool is_Value_Equal (CSG_Parameter *pParameter) const;
242
243 void Set_UseInGUI (bool bDoUse = false);
244 void Set_UseInCMD (bool bDoUse = false);
245
246 bool do_UseInGUI (void) const;
247 bool do_UseInCMD (void) const;
248
249 void ignore_Projection (bool bIgnore);
250 bool ignore_Projection (void) const { return( !!(m_Constraint & PARAMETER_IGNORE_PROJECTION) ); }
251
252 TSG_Data_Object_Type Get_DataObject_Type (void) const;
253
254 int Get_Children_Count (void) const { return( m_nChildren ); }
255 CSG_Parameter * Get_Child (int iChild) const { return( iChild >= 0 && iChild < m_nChildren ? m_Children[iChild] : NULL ); }
256 bool Set_Children_Enabled (bool bEnabled = true);
257
258 //-----------------------------------------------------
259 virtual bool Set_Value (int Value);
260 virtual bool Set_Value (double Value);
261 virtual bool Set_Value (const CSG_String &Value);
262 virtual bool Set_Value (const char *Value);
263 virtual bool Set_Value (const wchar_t *Value);
264 virtual bool Set_Value (void *Value);
265 virtual bool Set_Value (CSG_Parameter *Value);
266
267 virtual bool Toggle_Value (void);
268
269 bool Set_Default (int Value);
270 bool Set_Default (double Value);
271 bool Set_Default (const CSG_String &Value);
272 const CSG_String & Get_Default (void) const;
273 virtual bool is_Default (void) const;
274 virtual bool Restore_Default (void);
275
276 bool Check (bool bSilent = true);
277
278 bool has_Changed (int Check_Flags = PARAMETER_CHECK_ALL);
279
280 bool asBool (void) const { return( (bool )!!_asInt () ); }
281 int asInt (void) const { return( (int )_asInt () ); }
282 long asColor (void) const { return( (long )_asInt () ); }
283 double asDouble (void) const { return( (double )_asDouble () ); }
284 const SG_Char * asString (void) const { return( (const SG_Char *)_asString () ); }
285 void * asPointer (void) const { return( (void *)_asPointer() ); }
286
287 CSG_Colors * asColors (void) const;
288 const SG_Char * asFont (void) const;
289 CSG_Grid_System * asGrid_System (void) const;
290
291 CSG_Data_Object * asDataObject (void) const;
292 CSG_Grid * asGrid (void) const;
293 CSG_Grids * asGrids (void) const;
294 CSG_Table * asTable (void) const;
295 CSG_Shapes * asShapes (void) const;
296 CSG_TIN * asTIN (void) const;
297 CSG_PointCloud * asPointCloud (void) const;
298
299 //-----------------------------------------------------
300 class CSG_Parameter_Value * asValue (void) const;
301 class CSG_Parameter_Date * asDate (void) const;
302 class CSG_Parameter_Data_Type * asDataType (void) const;
303 class CSG_Parameter_Choice * asChoice (void) const;
304 class CSG_Parameter_Choices * asChoices (void) const;
305 class CSG_Parameter_Range * asRange (void) const;
306 class CSG_Parameter_File_Name * asFilePath (void) const;
307 class CSG_Parameter_Table_Fields * asTableFields (void) const;
308 class CSG_Parameters * asParameters (void) const;
309
310 class CSG_Parameter_List * asList (void) const;
311 class CSG_Parameter_Grid_List * asGridList (void) const;
312 class CSG_Parameter_Grids_List * asGridsList (void) const;
313 class CSG_Parameter_Table_List * asTableList (void) const;
314 class CSG_Parameter_Shapes_List * asShapesList (void) const;
315 class CSG_Parameter_TIN_List * asTINList (void) const;
316 class CSG_Parameter_PointCloud_List * asPointCloudList(void) const;
317
318 //-----------------------------------------------------
319 bool Assign (CSG_Parameter *pSource);
320 bool Serialize (CSG_MetaData &MetaData, bool bSave);
321
322
323 protected:
324
325 friend class CSG_Parameters;
326
327 CSG_Parameter(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
328 virtual ~CSG_Parameter(void);
329
330 CSG_String m_String;
331
332
333 virtual int _Set_Value (int Value);
334 virtual int _Set_Value (double Value);
335 virtual int _Set_Value (const CSG_String &Value);
336 virtual int _Set_Value (void *Value);
337
338 virtual void _Set_String (void);
339
340 virtual int _asInt (void) const;
341 virtual double _asDouble (void) const;
342 virtual void * _asPointer (void) const;
343 virtual const SG_Char * _asString (void) const;
344
345 virtual bool _Assign (CSG_Parameter *pSource);
346 virtual bool _Serialize (CSG_MetaData &MetaData, bool bSave);
347
348
349 private:
350
351 void _Add_Child (CSG_Parameter *pChild);
352
353
354 bool m_bEnabled;
355
356 int m_Constraint, m_nChildren;
357
358 CSG_Parameter **m_Children;
359
360 CSG_String m_Identifier, m_Name, m_Description, m_Default;
361
362 CSG_Parameter *m_pParent;
363
364 CSG_Parameters *m_pParameters;
365
366 };
367
368
370 // //
372
373 //---------------------------------------------------------
374 class SAGA_API_DLL_EXPORT CSG_Parameter_Node : public CSG_Parameter
375 {
376 public:
377
378 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Node ); }
379
380
381 protected:
382
383 CSG_Parameter_Node(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
384
385 friend class CSG_Parameters;
386 };
387
388
390 // //
392
393 //---------------------------------------------------------
394 class SAGA_API_DLL_EXPORT CSG_Parameter_Bool : public CSG_Parameter
395 {
396 public:
397
398 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Bool ); }
399
400 virtual bool is_Default (void) const;
401
402 virtual bool Toggle_Value (void);
403
404
405 protected:
406
407 CSG_Parameter_Bool(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
408
409 bool m_Value;
410
411
412 virtual int _Set_Value (int Value);
413 virtual int _Set_Value (double Value);
414 virtual int _Set_Value (const CSG_String &Value);
415
416 virtual void _Set_String (void);
417
418 virtual int _asInt (void) const { return( m_Value ); }
419
420 virtual bool _Assign (CSG_Parameter *pSource);
421 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
422
423
424 friend class CSG_Parameters;
425 };
426
427
429 // //
431
432 //---------------------------------------------------------
433 class SAGA_API_DLL_EXPORT CSG_Parameter_Value : public CSG_Parameter
434 {
435 public:
436
437 bool Set_Valid_Range (double Minimum, double Maximum);
438
439 void Set_Minimum (double Minimum, bool bOn = true);
440 double Get_Minimum (void) const { return( m_Minimum ); }
441 bool has_Minimum (void) const { return( m_bMinimum ); }
442
443 void Set_Maximum (double Maximum, bool bOn = true);
444 double Get_Maximum (void) const { return( m_Maximum ); }
445 bool has_Maximum (void) const { return( m_bMaximum ); }
446
447
448 protected:
449
450 CSG_Parameter_Value(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
451
452 bool m_bMinimum, m_bMaximum;
453
454 double m_Minimum, m_Maximum;
455
456
457 virtual bool _Assign (CSG_Parameter *pSource);
458
459
460 friend class CSG_Parameters;
461 };
462
463
465 // //
467
468 //---------------------------------------------------------
469 class SAGA_API_DLL_EXPORT CSG_Parameter_Int : public CSG_Parameter_Value
470 {
471 public:
472
473 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Int ); }
474
475 virtual bool is_Default (void) const;
476
477
478 protected:
479
480 CSG_Parameter_Int(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
481
482 int m_Value;
483
484
485 virtual int _Set_Value (int Value);
486 virtual int _Set_Value (double Value);
487 virtual int _Set_Value (const CSG_String &Value);
488
489 virtual void _Set_String (void);
490
491 virtual int _asInt (void) const { return( m_Value ); }
492 virtual double _asDouble (void) const { return( m_Value ); }
493
494 virtual bool _Assign (CSG_Parameter *pSource);
495 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
496
497
498 friend class CSG_Parameters;
499 };
500
501
503 // //
505
506 //---------------------------------------------------------
507 class SAGA_API_DLL_EXPORT CSG_Parameter_Double : public CSG_Parameter_Value
508 {
509 public:
510
511 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Double ); }
512
513 virtual bool is_Default (void) const;
514
515
516 protected:
517
518 CSG_Parameter_Double(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
519
520 double m_Value;
521
522
523 virtual int _Set_Value (int Value);
524 virtual int _Set_Value (double Value);
525 virtual int _Set_Value (const CSG_String &Value);
526
527 virtual void _Set_String (void);
528
529 virtual int _asInt (void) const { return( (int)m_Value ); }
530 virtual double _asDouble (void) const { return( m_Value ); }
531
532 virtual bool _Assign (CSG_Parameter *pSource);
533 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
534
535
536 friend class CSG_Parameters;
537 };
538
539
541 // //
543
544 //---------------------------------------------------------
545 class SAGA_API_DLL_EXPORT CSG_Parameter_Degree : public CSG_Parameter_Double
546 {
547 public:
548
549 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Degree ); }
550
551
552 protected:
553
554 CSG_Parameter_Degree(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
555
556 virtual int _Set_Value (const CSG_String &Value);
557
558 virtual void _Set_String (void);
559
560
561 friend class CSG_Parameters;
562 };
563
564
566 // //
568
569 //---------------------------------------------------------
570 class SAGA_API_DLL_EXPORT CSG_Parameter_Date : public CSG_Parameter
571 {
572 public:
573
574 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Date ); }
575
576 void Set_Date (const CSG_DateTime &Date);
577 const CSG_DateTime & Get_Date (void) const { return( m_Date ); }
578
579
580 protected:
581
582 CSG_Parameter_Date(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
583
584 CSG_DateTime m_Date;
585
586
587 virtual int _Set_Value (int Value);
588 virtual int _Set_Value (double Value);
589 virtual int _Set_Value (const CSG_String &Value);
590
591 virtual void _Set_String (void);
592
593 virtual int _asInt (void) const;
594 virtual double _asDouble (void) const;
595
596 virtual bool _Assign (CSG_Parameter *pSource);
597 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
598
599
600 friend class CSG_Parameters;
601 };
602
603
605 // //
607
608 //---------------------------------------------------------
609 class SAGA_API_DLL_EXPORT CSG_Parameter_Range : public CSG_Parameter
610 {
611 public:
612
613 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Range ); }
614
615 bool Set_Range (double Min, double Max);
616 double Get_Range (void) const { return( Get_Max() - Get_Min() ); }
617
618 bool Set_Min (double Min);
619 double Get_Min (void) const;
620 CSG_Parameter_Double * Get_Min_Parameter (void) const { return( m_pMin ); }
621
622 bool Set_Max (double Max);
623 double Get_Max (void) const;
624 CSG_Parameter_Double * Get_Max_Parameter (void) const { return( m_pMax ); }
625
626 virtual bool is_Default (void) const;
627
628 virtual bool Restore_Default (void);
629
630
631 protected:
632
633 CSG_Parameter_Range(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
634 virtual ~CSG_Parameter_Range(void);
635
636 CSG_Parameters *m_pRange;
637
638 CSG_Parameter_Double *m_pMin, *m_pMax;
639
640
641 virtual int _Set_Value (const CSG_String &Value);
642
643 virtual void _Set_String (void);
644
645 virtual bool _Assign (CSG_Parameter *pSource);
646 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
647
648
649 friend class CSG_Parameters;
650 };
651
652
654 // //
656
657 //---------------------------------------------------------
658 class SAGA_API_DLL_EXPORT CSG_Parameter_Choice : public CSG_Parameter
659 {
660 public:
661
662 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Choice ); }
663
664 virtual bool is_Default (void) const;
665
666 virtual bool Toggle_Value (void);
667
668 bool Del_Items (void);
669 bool Add_Item (const CSG_String &Item, const CSG_String &Data = "");
670
671 bool Set_Items (const SG_Char *String);
672 CSG_String Get_Items (void) const;
673
674 const SG_Char * Get_Item (int Index) const;
675 CSG_String Get_Item_Data (int Index) const;
676
677 CSG_String Get_Data (void) const;
678 bool Get_Data (CSG_String &Value) const;
679 bool Get_Data (int &Value) const;
680 bool Get_Data (double &Value) const;
681
682 int Get_Count (void) const { return( m_Items.Get_Count() ); }
683
684
685 protected:
686
687 CSG_Parameter_Choice(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
688
689 int m_Value;
690
691 CSG_Strings m_Items, m_Data;
692
693
694 virtual int _Set_Value (int Value);
695 virtual int _Set_Value (double Value);
696 virtual int _Set_Value (const CSG_String &Value);
697
698 virtual void _Set_String (void);
699
700 virtual int _asInt (void) const { return( m_Value ); }
701 virtual double _asDouble (void) const { return( m_Value ); }
702
703 virtual bool _Assign (CSG_Parameter *pSource);
704 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
705
706
707 friend class CSG_Parameters;
708 };
709
710
712 // //
714
715 //---------------------------------------------------------
716 class SAGA_API_DLL_EXPORT CSG_Parameter_Data_Type : public CSG_Parameter_Choice
717 {
718 public:
719
720 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Data_Type ); }
721
722 bool Set_Data_Types (int Data_Types, TSG_Data_Type Default = SG_DATATYPE_Undefined, const CSG_String &User = "");
723
724 bool Set_Data_Type (TSG_Data_Type Value);
725 TSG_Data_Type Get_Data_Type (TSG_Data_Type Default = SG_DATATYPE_Undefined) const;
726
727
728 protected:
729
730 CSG_Parameter_Data_Type(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
731
732
733 virtual bool _Assign (CSG_Parameter *pSource);
734 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
735
736
737 friend class CSG_Parameters;
738 };
739
740
742 // //
744
745 //---------------------------------------------------------
746 class SAGA_API_DLL_EXPORT CSG_Parameter_Choices : public CSG_Parameter
747 {
748 public:
749
750 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Choices ); }
751
752 void Set_Items (const CSG_String &Items);
753 void Set_Items (const CSG_Strings &Items);
754 CSG_String Get_Items (void) const;
755 void Del_Items (void);
756 void Add_Item (const CSG_String &Item, const CSG_String &Data = "");
757
758 int Get_Item_Count (void) const { return( m_Items[0].Get_Count() ); }
759 const CSG_String & Get_Item (int i) const { return( m_Items[0][i] ); }
760 const CSG_String & Get_Item_Data (int i) const { return( m_Items[1][i] ); }
761
762 int Get_Selection_Count (void) const { return( (int)m_Selection.Get_Size() ); }
763 const CSG_String & Get_Selection (int i) const { return( Get_Item (Get_Selection_Index(i)) ); }
764 const CSG_String & Get_Selection_Data (int i) const { return( Get_Item_Data(Get_Selection_Index(i)) ); }
765 int Get_Selection_Index (int i) const { return( i >= 0 && i < Get_Selection_Count() ? m_Selection[i] : -1 ); }
766
767 bool is_Selected (int Index);
768 bool Select (int Index, bool bSelect = true);
769 bool Clr_Selection (void);
770
771
772 protected:
773
774 CSG_Parameter_Choices(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
775
776 CSG_Strings m_Items[2];
777
778 CSG_Array_Int m_Selection;
779
780
781 virtual int _Set_Value (const CSG_String &Value);
782
783 virtual void _Set_String (void);
784
785 virtual bool _Assign (CSG_Parameter *pSource);
786 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
787
788
789 friend class CSG_Parameters;
790 };
791
792
794 // //
796
797 //---------------------------------------------------------
798 class SAGA_API_DLL_EXPORT CSG_Parameter_String : public CSG_Parameter
799 {
800 public:
801
802 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_String ); }
803
804 virtual bool is_Valid (void) const;
805
806 void Set_Password (bool bOn);
807 bool is_Password (void) const;
808
809
810 protected:
811
812 CSG_Parameter_String(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
813
814 bool m_bPassword;
815
816
817 virtual int _Set_Value (const CSG_String &Value);
818
819 virtual bool _Assign (CSG_Parameter *pSource);
820 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
821
822
823 friend class CSG_Parameters;
824 };
825
826
828 // //
830
831 //---------------------------------------------------------
832 class SAGA_API_DLL_EXPORT CSG_Parameter_Text : public CSG_Parameter_String
833 {
834 public:
835 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Text ); }
836
837
838 protected:
839
840 CSG_Parameter_Text(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
841
842
843 friend class CSG_Parameters;
844 };
845
846
848 // //
850
851 //---------------------------------------------------------
852 class SAGA_API_DLL_EXPORT CSG_Parameter_File_Name : public CSG_Parameter_String
853 {
854 public:
855
856 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_FilePath ); }
857
858 void Set_Filter (const SG_Char *Filter);
859 const SG_Char * Get_Filter (void) const;
860
861 void Set_Flag_Save (bool bFlag);
862 bool is_Save (void) const { return( m_bSave ); }
863
864 void Set_Flag_Multiple (bool bFlag);
865 bool is_Multiple (void) const { return( m_bMultiple ); }
866
867 void Set_Flag_Directory (bool bFlag);
868 bool is_Directory (void) const { return( m_bDirectory ); }
869
870 bool Get_FilePaths (CSG_Strings &FilePaths) const;
871
872
873 protected:
874
875 CSG_Parameter_File_Name(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
876
877 bool m_bSave, m_bMultiple, m_bDirectory;
878
879 CSG_String m_Filter;
880
881
882 virtual bool _Assign (CSG_Parameter *pSource);
883
884
885 friend class CSG_Parameters;
886 };
887
888
890 // //
892
893 //---------------------------------------------------------
894 class SAGA_API_DLL_EXPORT CSG_Parameter_Font : public CSG_Parameter
895 {
896 public:
897
898 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Font ); }
899
900 virtual bool Restore_Default (void);
901
902
903 protected:
904
905 CSG_Parameter_Font(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
906
907 int m_Color;
908
909
910 virtual int _Set_Value (int Value);
911 virtual int _Set_Value (const CSG_String &Value);
912
913 virtual int _asInt (void) const;
914 virtual void * _asPointer (void) const;
915
916 virtual bool _Assign (CSG_Parameter *pSource);
917 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
918
919
920 friend class CSG_Parameters;
921 };
922
923
925 // //
927
928 //---------------------------------------------------------
929 class SAGA_API_DLL_EXPORT CSG_Parameter_Color : public CSG_Parameter_Int
930 {
931 public:
932
933 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Color ); }
934
935 virtual int _Set_Value (const CSG_String &Value);
936
937
938 protected:
939
940 CSG_Parameter_Color(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
941
942
943 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
944
945
946 friend class CSG_Parameters;
947 };
948
949
951 // //
953
954 //---------------------------------------------------------
955 class SAGA_API_DLL_EXPORT CSG_Parameter_Colors : public CSG_Parameter
956 {
957 public:
958
959 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Colors ); }
960
961
962 protected:
963
964 CSG_Parameter_Colors(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
965
966 CSG_Colors m_Colors;
967
968
969 virtual int _Set_Value (int Value);
970
971 virtual void _Set_String (void);
972
973 virtual int _asInt (void) const;
974 virtual void * _asPointer (void) const;
975
976 virtual bool _Assign (CSG_Parameter *pSource);
977 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
978
979
980 friend class CSG_Parameters;
981 };
982
983
985 // //
987
988 //---------------------------------------------------------
989 class SAGA_API_DLL_EXPORT CSG_Parameter_Fixed_Table : public CSG_Parameter
990 {
991 public:
992
993 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_FixedTable ); }
994
995
996 protected:
997
998 CSG_Parameter_Fixed_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
999
1000 CSG_Table m_Table;
1001
1002
1003 virtual void _Set_String (void);
1004
1005 virtual void * _asPointer (void) const;
1006
1007 virtual bool _Assign (CSG_Parameter *pSource);
1008 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1009
1010
1011 friend class CSG_Parameters;
1012 };
1013
1014
1016 // //
1018
1019 //---------------------------------------------------------
1020 class SAGA_API_DLL_EXPORT CSG_Parameter_Grid_System : public CSG_Parameter
1021 {
1022 public:
1023
1024 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Grid_System ); }
1025
1026
1027 protected:
1028
1029 CSG_Parameter_Grid_System(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1030
1031 CSG_Grid_System m_System;
1032
1033
1034 virtual int _Set_Value (void *Value);
1035
1036 virtual void _Set_String (void);
1037
1038 virtual void * _asPointer (void) const;
1039
1040 virtual bool _Assign (CSG_Parameter *pSource);
1041 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1042
1043
1044 friend class CSG_Parameters;
1045 };
1046
1047
1049 // //
1051
1052 //---------------------------------------------------------
1053 class SAGA_API_DLL_EXPORT CSG_Parameter_Table_Field : public CSG_Parameter_Int
1054 {
1055 public:
1056
1057 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Table_Field ); }
1058
1059 bool Add_Default (double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum);
1060
1061 CSG_Table * Get_Table (void) const;
1062
1063 static CSG_String Get_Choices (const class CSG_Table &Table, bool bAllowNone = false);
1064
1065
1066 protected:
1067
1068 CSG_Parameter_Table_Field(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1069
1070 int m_Default;
1071
1072
1073 virtual int _Set_Value (int Value);
1074 virtual int _Set_Value (const CSG_String &Value);
1075
1076 virtual void _Set_String (void);
1077
1078 virtual double _asDouble (void) const;
1079
1080 virtual bool _Assign (CSG_Parameter *pSource);
1081 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1082
1083
1084 friend class CSG_Parameters;
1085 };
1086
1087
1089 // //
1091
1092 //---------------------------------------------------------
1093 class SAGA_API_DLL_EXPORT CSG_Parameter_Table_Fields : public CSG_Parameter
1094 {
1095 public:
1096
1097 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Table_Fields ); }
1098
1099 int Get_Count (void) const { return( m_nFields ); }
1100 int Get_Index (int i) const { return( i >= 0 && i < m_nFields ? m_Fields[i] : -1 ); }
1101
1102 CSG_Table * Get_Table (void) const;
1103
1104
1105 protected:
1106
1107 CSG_Parameter_Table_Fields(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1108 virtual ~CSG_Parameter_Table_Fields(void);
1109
1110 int m_nFields, *m_Fields;
1111
1112
1113 virtual int _Set_Value (const CSG_String &Value);
1114
1115 virtual int _asInt (void) const;
1116 virtual void * _asPointer (void) const;
1117
1118 virtual bool _Assign (CSG_Parameter *pSource);
1119 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1120
1121
1122 friend class CSG_Parameters;
1123 };
1124
1125
1127 // //
1129
1130 //---------------------------------------------------------
1131 class SAGA_API_DLL_EXPORT CSG_Parameter_Data_Object : public CSG_Parameter
1132 {
1133 public:
1134
1135 virtual bool is_Valid (void) const;
1136
1137
1138 protected:
1139
1140 CSG_Parameter_Data_Object(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1141
1142 CSG_Data_Object *m_pDataObject;
1143
1144
1145 virtual int _Set_Value (void *Value);
1146
1147 virtual void _Set_String (void);
1148
1149 virtual void * _asPointer (void) const;
1150
1151 virtual bool _Assign (CSG_Parameter *pSource);
1152 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1153
1154
1155 friend class CSG_Parameters;
1156 };
1157
1158
1160 // //
1162
1163 //---------------------------------------------------------
1164 class SAGA_API_DLL_EXPORT CSG_Parameter_Data_Object_Output : public CSG_Parameter_Data_Object
1165 {
1166 public:
1167
1168 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_DataObject_Output ); }
1169
1170 bool Set_DataObject_Type (TSG_Data_Object_Type Type);
1171 TSG_Data_Object_Type Get_DataObject_Type (void) const { return( m_Type ); }
1172
1173
1174 protected:
1175
1176 CSG_Parameter_Data_Object_Output(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1177
1178 TSG_Data_Object_Type m_Type;
1179
1180
1181 virtual int _Set_Value (void *Value);
1182
1183
1184 friend class CSG_Parameters;
1185 };
1186
1187
1189 // //
1191
1192 //---------------------------------------------------------
1193 class SAGA_API_DLL_EXPORT CSG_Parameter_Grid : public CSG_Parameter_Data_Object
1194 {
1195 public:
1196
1197 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Grid ); }
1198
1199 void Set_Preferred_Type (TSG_Data_Type Type);
1200 TSG_Data_Type Get_Preferred_Type (void) const { return( m_Type ); }
1201
1202 CSG_Grid_System * Get_System (void) const;
1203
1204 bool Add_Default (double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum);
1205
1206
1207 protected:
1208
1209 CSG_Parameter_Grid(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1210
1211 int m_Default;
1212
1213 TSG_Data_Type m_Type;
1214
1215
1216 virtual int _Set_Value (void *Value);
1217
1218 virtual int _asInt (void) const;
1219 virtual double _asDouble (void) const;
1220
1221 virtual bool _Assign (CSG_Parameter *pSource);
1222
1223
1224 friend class CSG_Parameters;
1225 };
1226
1227
1229 // //
1231
1232 //---------------------------------------------------------
1233 class SAGA_API_DLL_EXPORT CSG_Parameter_Grids : public CSG_Parameter_Grid
1234 {
1235 public:
1236
1237 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Grids ); }
1238
1239
1240 protected:
1241
1242 CSG_Parameter_Grids(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1243
1244
1245 friend class CSG_Parameters;
1246 };
1247
1248
1250 // //
1252
1253 //---------------------------------------------------------
1254 class SAGA_API_DLL_EXPORT CSG_Parameter_Table : public CSG_Parameter_Data_Object
1255 {
1256 public:
1257
1258 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Table ); }
1259
1260 CSG_Parameter_Table(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1261
1262
1263 protected:
1264
1265 virtual int _Set_Value (void *Value);
1266
1267
1268 friend class CSG_Parameters;
1269 };
1270
1271
1273 // //
1275
1276 //---------------------------------------------------------
1277 class SAGA_API_DLL_EXPORT CSG_Parameter_Shapes : public CSG_Parameter_Data_Object
1278 {
1279 public:
1280
1281 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Shapes ); }
1282
1283 void Set_Shape_Type (TSG_Shape_Type Type);
1284 TSG_Shape_Type Get_Shape_Type (void) const { return( m_Type ); }
1285
1286
1287 protected:
1288
1289 CSG_Parameter_Shapes(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1290
1291 TSG_Shape_Type m_Type;
1292
1293
1294 virtual int _Set_Value (void *Value);
1295
1296 virtual bool _Assign (CSG_Parameter *pSource);
1297
1298
1299 friend class CSG_Parameters;
1300 };
1301
1302
1304 // //
1306
1307 //---------------------------------------------------------
1308 class SAGA_API_DLL_EXPORT CSG_Parameter_TIN : public CSG_Parameter_Data_Object
1309 {
1310 public:
1311
1312 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_TIN ); }
1313
1314
1315 protected:
1316
1317 CSG_Parameter_TIN(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1318
1319
1320 virtual int _Set_Value (void *Value);
1321
1322
1323 friend class CSG_Parameters;
1324 };
1325
1326
1328 // //
1330
1331 //---------------------------------------------------------
1332 class SAGA_API_DLL_EXPORT CSG_Parameter_PointCloud : public CSG_Parameter_Data_Object
1333 {
1334 public:
1335
1336 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_PointCloud ); }
1337
1338
1339 protected:
1340
1341 CSG_Parameter_PointCloud(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1342
1343
1344 virtual int _Set_Value (void *Value);
1345
1346 virtual bool _Assign (CSG_Parameter *pSource);
1347
1348
1349 friend class CSG_Parameters;
1350 };
1351
1352
1354 // //
1356
1357 //---------------------------------------------------------
1358 class SAGA_API_DLL_EXPORT CSG_Parameter_List : public CSG_Parameter
1359 {
1360 public:
1361
1362 virtual bool Add_Item (CSG_Data_Object *pItem);
1363 virtual bool Del_Item (CSG_Data_Object *pItem, bool bUpdateData = true);
1364 virtual bool Del_Item (int Index , bool bUpdateData = true);
1365 virtual bool Del_Items (void);
1366
1367 int Get_Item_Count (void) const { return( (int)m_Objects.Get_Size() ); }
1368 CSG_Data_Object * Get_Item (int Index) const { return( Index >= 0 && Index < Get_Item_Count() ? (CSG_Data_Object *)m_Objects[Index] : NULL ); }
1369
1370 virtual bool Update_Data (void) { return( true ); }
1371
1372
1373 protected:
1374
1375 CSG_Parameter_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1376
1377
1378 virtual void _Set_String (void);
1379
1380 virtual int _asInt (void) const;
1381 virtual void * _asPointer (void) const;
1382
1383 virtual bool _Assign (CSG_Parameter *pSource);
1384 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1385
1386
1387 private:
1388
1389 CSG_Array_Pointer m_Objects;
1390
1391
1392 friend class CSG_Parameters;
1393 };
1394
1395
1397 // //
1399
1400 //---------------------------------------------------------
1401 class SAGA_API_DLL_EXPORT CSG_Parameter_Grid_List : public CSG_Parameter_List
1402 {
1403 public:
1404
1405 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Grid_List ); }
1406
1407 CSG_Grid_System * Get_System (void) const;
1408
1409 virtual bool Add_Item (CSG_Data_Object *pItem);
1410 virtual bool Del_Item (CSG_Data_Object *pItem, bool bUpdateData = true);
1411 virtual bool Del_Item (int Index , bool bUpdateData = true);
1412 virtual bool Del_Items (void);
1413
1414 virtual bool Update_Data (void);
1415
1416 int Get_Grid_Count (void) const { return( (int)m_Grids.Get_Size() ); }
1417 CSG_Grid * Get_Grid (int Index) const { return( Index >= 0 && Index < Get_Grid_Count() ? (CSG_Grid *)m_Grids[Index] : NULL ); }
1418
1419
1420 protected:
1421
1422 CSG_Parameter_Grid_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1423
1424 CSG_Array_Pointer m_Grids;
1425
1426
1427 friend class CSG_Parameters;
1428 };
1429
1430
1432 // //
1434
1435 //---------------------------------------------------------
1436 class SAGA_API_DLL_EXPORT CSG_Parameter_Grids_List : public CSG_Parameter_List
1437 {
1438 public:
1439 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Grids_List ); }
1440
1441 CSG_Grid_System * Get_System (void) const;
1442
1443 virtual bool Add_Item (CSG_Data_Object *pItem);
1444
1445 CSG_Grids * Get_Grids (int Index) const { return( (CSG_Grids *)Get_Item(Index) ); }
1446
1447
1448 protected:
1449
1450 CSG_Parameter_Grids_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1451
1452
1453 friend class CSG_Parameters;
1454 };
1455
1456
1458 // //
1460
1461 //---------------------------------------------------------
1462 class SAGA_API_DLL_EXPORT CSG_Parameter_Table_List : public CSG_Parameter_List
1463 {
1464 public:
1465
1466 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Table_List ); }
1467
1468 CSG_Table * Get_Table (int Index) const { return( (CSG_Table *)Get_Item(Index) ); }
1469
1470
1471 protected:
1472
1473 CSG_Parameter_Table_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1474
1475
1476 friend class CSG_Parameters;
1477 };
1478
1479
1481 // //
1483
1484 //---------------------------------------------------------
1485 class SAGA_API_DLL_EXPORT CSG_Parameter_Shapes_List : public CSG_Parameter_List
1486 {
1487 public:
1488
1489 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Shapes_List ); }
1490
1491 void Set_Shape_Type (TSG_Shape_Type Type);
1492 TSG_Shape_Type Get_Shape_Type (void) const { return( m_Type );}
1493
1494 CSG_Shapes * Get_Shapes (int Index) const { return( (CSG_Shapes *)Get_Item(Index) ); }
1495
1496
1497 protected:
1498
1499 CSG_Parameter_Shapes_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1500
1501 TSG_Shape_Type m_Type;
1502
1503
1504 virtual bool _Assign (CSG_Parameter *pSource);
1505
1506
1507 friend class CSG_Parameters;
1508 };
1509
1510
1512 // //
1514
1515 //---------------------------------------------------------
1516 class SAGA_API_DLL_EXPORT CSG_Parameter_TIN_List : public CSG_Parameter_List
1517 {
1518 public:
1519
1520 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_TIN_List ); }
1521
1522 CSG_TIN * asTIN (int Index) const { return( (CSG_TIN *)Get_Item(Index) ); }
1523
1524
1525 protected:
1526
1527 CSG_Parameter_TIN_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1528
1529
1530 friend class CSG_Parameters;
1531 };
1532
1533
1535 // //
1537
1538 //---------------------------------------------------------
1539 class SAGA_API_DLL_EXPORT CSG_Parameter_PointCloud_List : public CSG_Parameter_List
1540 {
1541 public:
1542
1543 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_PointCloud_List ); }
1544
1545 CSG_PointCloud * Get_PointCloud (int Index) const { return( (CSG_PointCloud *)Get_Item(Index) ); }
1546
1547
1548 protected:
1549
1550 CSG_Parameter_PointCloud_List(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1551
1552
1553 friend class CSG_Parameters;
1554 };
1555
1556
1558 // //
1560
1561 //---------------------------------------------------------
1562 class SAGA_API_DLL_EXPORT CSG_Parameter_Parameters : public CSG_Parameter
1563 {
1564 public:
1565
1566 virtual TSG_Parameter_Type Get_Type (void) const { return( PARAMETER_TYPE_Parameters ); }
1567
1568 virtual bool Restore_Default (void);
1569
1570
1571 protected:
1572
1573 CSG_Parameter_Parameters(CSG_Parameters *pOwner, CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1574 virtual ~CSG_Parameter_Parameters(void);
1575
1576 CSG_Parameters *m_pParameters;
1577
1578
1579 virtual void _Set_String (void);
1580
1581 virtual void * _asPointer (void) const;
1582
1583 virtual bool _Assign (CSG_Parameter *pSource);
1584 virtual bool _Serialize (CSG_MetaData &Entry, bool bSave);
1585
1586
1587 friend class CSG_Parameters;
1588 };
1589
1590
1592 // //
1593 // Grid Target Selector //
1594 // //
1596
1597 //---------------------------------------------------------
1598 class SAGA_API_DLL_EXPORT CSG_Parameters_Grid_Target
1599 {
1600 public:
1601 CSG_Parameters_Grid_Target(void);
1602
1603 bool Create (CSG_Parameters *pParameters, bool bAddDefaultGrid , CSG_Parameter *pParent , const CSG_String &Prefix = "");
1604 bool Create (CSG_Parameters *pParameters, bool bAddDefaultGrid = true, const CSG_String &ParentID = "", const CSG_String &Prefix = "");
1605
1606 bool Add_Grid (const CSG_String &ID, const CSG_String &Name, bool bOptional);
1607 bool Add_Grids (const CSG_String &ID, const CSG_String &Name, bool bOptional, bool bZLevels = false);
1608
1609 bool On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
1610 static bool On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix);
1611 bool On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
1612 static bool On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter, const CSG_String Prefix);
1613
1614 bool Set_User_Defined (CSG_Parameters *pParameters, const TSG_Rect &Extent, int Rows = 0, int Rounding = 2);
1615 bool Set_User_Defined (CSG_Parameters *pParameters, CSG_Shapes *pPoints, int Scale = 4 , int Rounding = 2);
1616 bool Set_User_Defined (CSG_Parameters *pParameters, double xMin, double yMin, double Size, int nx, int ny);
1617 bool Set_User_Defined (CSG_Parameters *pParameters, const CSG_Grid_System &System);
1618
1619 bool Set_User_Defined_ZLevels (CSG_Parameters *pParameters, double zMin, double zMax, int nLevels, int Rounding = 2);
1620
1621 CSG_Grid_System Get_System (void);
1622
1623 CSG_Grid * Get_Grid (const CSG_String &ID, TSG_Data_Type Type = SG_DATATYPE_Float);
1624 CSG_Grid * Get_Grid ( TSG_Data_Type Type = SG_DATATYPE_Float);
1625
1626 CSG_Grids * Get_Grids (const CSG_String &ID, TSG_Data_Type Type = SG_DATATYPE_Float);
1627 CSG_Grids * Get_Grids ( TSG_Data_Type Type = SG_DATATYPE_Float);
1628
1629
1630 private:
1631
1632 CSG_String m_Prefix;
1633
1634 CSG_Parameters *m_pParameters;
1635
1636 };
1637
1638
1640 // //
1641 // CSG_Parameters //
1642 // //
1644
1645 //---------------------------------------------------------
1646 typedef int (* TSG_PFNC_Parameter_Changed) (CSG_Parameter *pParameter, int Flags);
1647
1648 //---------------------------------------------------------
1649 class SAGA_API_DLL_EXPORT CSG_Parameters
1650 {
1651 friend class CSG_Parameter;
1652 friend class CSG_Tool;
1653
1654 public:
1655 CSG_Parameters(void);
1656 virtual ~CSG_Parameters(void);
1657
1658 CSG_Parameters (const CSG_Parameters &Parameters);
1659 bool Create (const CSG_Parameters &Parameters);
1660
1661 CSG_Parameters (const SG_Char *Name, const SG_Char *Description = NULL, const SG_Char *Identifier = NULL, bool bGrid_System = false);
1662 bool Create (const SG_Char *Name, const SG_Char *Description = NULL, const SG_Char *Identifier = NULL, bool bGrid_System = false);
1663
1664 CSG_Parameters (void *pOwner, const SG_Char *Name, const SG_Char *Description = NULL, const SG_Char *Identifier = NULL, bool bGrid_System = false);
1665 bool Create (void *pOwner, const SG_Char *Name, const SG_Char *Description = NULL, const SG_Char *Identifier = NULL, bool bGrid_System = false);
1666
1667 void Destroy (void);
1668
1669 //-----------------------------------------------------
1670 void * Get_Owner (void) const { return( m_pOwner ); }
1671
1672 class CSG_Tool * Get_Tool (void) const { return( m_pTool ); }
1673
1674 class CSG_Data_Manager * Get_Manager (void) const { return( m_pManager ); }
1675 void Set_Manager (class CSG_Data_Manager *pManager);
1676
1677 bool Use_Grid_System (void);
1678
1679 bool has_GUI (void) const;
1680
1681 int Get_Count (void) const { return( m_nParameters ); }
1682
1683 void Set_Identifier (const CSG_String &Identifier);
1684 bool Cmp_Identifier (const CSG_String &Identifier) const;
1685 const CSG_String & Get_Identifier (void) const { return( m_Identifier ); }
1686
1687 void Set_Name (const CSG_String &Name);
1688 const CSG_String & Get_Name (void) const { return( m_Name ); }
1689
1690 void Set_Description (const CSG_String &Description);
1691 const CSG_String & Get_Description (void) const { return( m_Description ); }
1692
1693 void Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link = NULL, const SG_Char *Link_Text = NULL);
1694 void Add_Reference (const CSG_String &Link, const SG_Char *Link_Text = NULL);
1695 void Del_References (void);
1696 const CSG_Strings & Get_References (void) const { return( m_References ); }
1697
1698 void Set_Enabled (bool bEnabled = true);
1699 void Set_Enabled (const CSG_String &Identifier, bool bEnabled = true);
1700
1701 //-----------------------------------------------------
1702 TSG_PFNC_Parameter_Changed Set_Callback_On_Parameter_Changed (TSG_PFNC_Parameter_Changed pCallback);
1703 bool Set_Callback (bool bActive = true);
1704
1705 //-----------------------------------------------------
1706 CSG_Parameters & operator = (const CSG_Parameters &Parameters) { Create(Parameters); return( *this ); }
1707
1708 CSG_Parameter * Get_Parameter (int i ) const { return( i >= 0 && i < m_nParameters ? m_Parameters[i] : NULL ); }
1709 CSG_Parameter * Get_Parameter (const CSG_String &ID) const;
1710
1711 CSG_Parameter * operator() (int i ) const { return( Get_Parameter(i ) ); }
1712 CSG_Parameter * operator() (const CSG_String &ID) const { return( Get_Parameter(ID) ); }
1713 CSG_Parameter * operator() (const char *ID) const { return( Get_Parameter(ID) ); }
1714 CSG_Parameter * operator() (const wchar_t *ID) const { return( Get_Parameter(ID) ); }
1715
1716 CSG_Parameter & operator[] (int i ) const { return( *Get_Parameter(i ) ); }
1717 CSG_Parameter & operator[] (const CSG_String &ID) const { return( *Get_Parameter(ID) ); }
1718 CSG_Parameter & operator[] (const char *ID) const { return( *Get_Parameter(ID) ); }
1719 CSG_Parameter & operator[] (const wchar_t *ID) const { return( *Get_Parameter(ID) ); }
1720
1721 //-----------------------------------------------------
1722 bool Del_Parameter (int i);
1723 bool Del_Parameter (const CSG_String &ID);
1724
1725 bool Del_Parameters (void);
1726
1727 //-----------------------------------------------------
1728 CSG_Parameter * Add_Parameter (CSG_Parameter *pParameter);
1729
1730 CSG_Parameter * Add_Node (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1731
1732 CSG_Parameter * Add_Value (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value = 0.0, double Minimum = 0.0, bool bMinimum = false, double Maximum = 0.0, bool bMaximum = false);
1733 CSG_Parameter * Add_Info_Value (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value = 0.0);
1734
1735 CSG_Parameter * Add_Bool (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value = false);
1736 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);
1737 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);
1738 CSG_Parameter * Add_Degree (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);
1739 CSG_Parameter * Add_Date (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value = 0.0); // Julian Day Number
1740 CSG_Parameter * Add_Color (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value = 0);
1741
1742 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);
1743 CSG_Parameter * Add_Info_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);
1744
1745 CSG_Parameter * Add_Data_Type (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Data_Types, TSG_Data_Type Default = SG_DATATYPE_Undefined, const CSG_String &User = "");
1746
1747 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);
1748 CSG_Parameter * Add_Choices (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items);
1749
1750 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);
1751 CSG_Parameter * Add_Info_String (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText = false);
1752
1753 CSG_Parameter * Add_FilePath (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter = NULL, const SG_Char *Default = NULL, bool bSave = false, bool bDirectory = false, bool bMultiple = false);
1754
1755 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);
1756 CSG_Parameter * Add_Colors (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit = NULL);
1757 CSG_Parameter * Add_FixedTable (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit = NULL);
1758
1759 CSG_Parameter * Add_Grid_System (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit = NULL);
1760 CSG_Parameter * Add_Grid (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true, TSG_Data_Type Preferred_Type = SG_DATATYPE_Undefined);
1761 CSG_Parameter * Add_Grid_or_Const (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, bool bSystem_Dependent = true);
1762 CSG_Parameter * Add_Grid_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1763 CSG_Parameter * Add_Grid_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true);
1764
1765 CSG_Parameter * Add_Grids (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true, TSG_Data_Type Preferred_Type = SG_DATATYPE_Undefined);
1766 CSG_Parameter * Add_Grids_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1767 CSG_Parameter * Add_Grids_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true);
1768
1769 CSG_Parameter * Add_Table_Field (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone = false);
1770 CSG_Parameter * Add_Table_Field_or_Const(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);
1771 CSG_Parameter * Add_Table_Fields (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1772 CSG_Parameter * Add_Table (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1773 CSG_Parameter * Add_Table_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1774 CSG_Parameter * Add_Table_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1775
1776 CSG_Parameter * Add_Shapes (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type = SHAPE_TYPE_Undefined);
1777 CSG_Parameter * Add_Shapes_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1778 CSG_Parameter * Add_Shapes_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type = SHAPE_TYPE_Undefined);
1779
1780 CSG_Parameter * Add_TIN (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1781 CSG_Parameter * Add_TIN_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1782 CSG_Parameter * Add_TIN_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1783
1784 CSG_Parameter * Add_PointCloud (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1785 CSG_Parameter * Add_PointCloud_Output (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1786 CSG_Parameter * Add_PointCloud_List (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint);
1787
1788 CSG_Parameter * Add_Parameters (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description);
1789
1790 //-----------------------------------------------------
1791 bool Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue);
1792 bool Set_Parameter (const char *ID, CSG_Parameter *pValue);
1793 bool Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue);
1794 bool Set_Parameter (const CSG_String &ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
1795 bool Set_Parameter (const char *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
1796 bool Set_Parameter (const wchar_t *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
1797 bool Set_Parameter (const CSG_String &ID, CSG_Data_Object *Value, int Type = PARAMETER_TYPE_Undefined);
1798 bool Set_Parameter (const char *ID, CSG_Data_Object *Value, int Type = PARAMETER_TYPE_Undefined);
1799 bool Set_Parameter (const wchar_t *ID, CSG_Data_Object *Value, int Type = PARAMETER_TYPE_Undefined);
1800 bool Set_Parameter (const CSG_String &ID, int Value, int Type = PARAMETER_TYPE_Undefined);
1801 bool Set_Parameter (const char *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
1802 bool Set_Parameter (const wchar_t *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
1803 bool Set_Parameter (const CSG_String &ID, double Value, int Type = PARAMETER_TYPE_Undefined);
1804 bool Set_Parameter (const char *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
1805 bool Set_Parameter (const wchar_t *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
1806 bool Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
1807 bool Set_Parameter (const char *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
1808 bool Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
1809 bool Set_Parameter (const CSG_String &ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
1810 bool Set_Parameter (const char *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
1811 bool Set_Parameter (const wchar_t *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
1812 bool Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
1813 bool Set_Parameter (const char *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
1814 bool Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
1815
1816 bool Restore_Defaults (bool bClearData = false);
1817
1818 bool Assign (CSG_Parameters *pSource);
1819 bool Assign_Values (CSG_Parameters *pSource);
1820 bool Assign_Parameters (CSG_Parameters *pSource);
1821
1822 bool Load (const CSG_MetaData &Data);
1823 bool Save ( CSG_MetaData &Data) const;
1824
1825 bool Load (const CSG_String &File);
1826 bool Save (const CSG_String &File) const;
1827
1828 bool Serialize ( CSG_MetaData &Data, bool bSave) { return( bSave ? Save(Data) : Load(Data) ); }
1829 bool Serialize ( CSG_MetaData &Data ) const { return( Save(Data) ); }
1830 bool Serialize (const CSG_String &File, bool bSave) { return( bSave ? Save(File) : Load(File) ); }
1831 bool Serialize (const CSG_String &File ) const { return( Save(File) ); }
1832
1833 bool Serialize_Compatibility (CSG_File &Stream);
1834
1835 //-----------------------------------------------------
1836 bool DataObjects_Check (bool bSilent = false);
1837
1838 //-----------------------------------------------------
1839 bool Get_String (CSG_String &String, bool bOptionsOnly);
1840 bool Msg_String (bool bOptionsOnly);
1841
1842 bool Set_History (CSG_MetaData &History, bool bOptions = true, bool bDataObjects = true);
1843
1844 bool is_Managed (void) const { return( m_pManager != NULL ); }
1845
1846 CSG_Parameter * Get_Grid_System_Parameter (void) const { return( m_pGrid_System ); }
1847 CSG_Grid_System * Get_Grid_System (void) const { return( m_pGrid_System ? m_pGrid_System->asGrid_System() : NULL ); }
1848 bool Set_Grid_System (const CSG_Grid_System &System);
1849 bool Reset_Grid_System (void);
1850
1851
1852 private:
1853
1854 void *m_pOwner;
1855
1856 class CSG_Tool *m_pTool;
1857
1858 class CSG_Data_Manager *m_pManager;
1859
1860 bool m_bCallback;
1861
1862 CSG_String m_Identifier, m_Name, m_Description;
1863
1864 CSG_Strings m_References;
1865
1866 int m_nParameters;
1867
1868 CSG_Parameter **m_Parameters, *m_pGrid_System;
1869
1870 TSG_PFNC_Parameter_Changed m_Callback;
1871
1872
1873 void _On_Construction (void);
1874
1875 bool _On_Parameter_Changed (CSG_Parameter *pParameter, int Flags);
1876
1877 CSG_Parameter * _Add_Value (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, TSG_Parameter_Type Type, double Value, double Minimum, bool bMinimum, double Maximum, bool bMaximum);
1878 CSG_Parameter * _Add_Range (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, double Range_Min, double Range_Max, double Minimum, bool bMinimum, double Maximum, bool bMaximum);
1879 CSG_Parameter * _Add_String (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bInformation, const SG_Char *String, bool bLongText, bool bPassword);
1880
1881 CSG_Parameter * _Add (const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, int Constraint);
1882 CSG_Parameter * _Add (CSG_Parameter *pSource);
1883
1884 bool DataObjects_Create (void);
1885 bool DataObjects_Synchronize (void);
1886 bool DataObjects_Get_Projection (CSG_Projection &Projection) const;
1887 bool DataObjects_Set_Projection (const CSG_Projection &Projection);
1888
1889
1890 public: // DEPRECATED BEGIN
1891
1892 // old style calls (parent as csg_parameter pointer instead of identifier)
1893
1894 CSG_Parameter * Add_Node (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1895 { return( Add_Node (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1896 CSG_Parameter * Add_Value (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value = 0.0, double Minimum = 0.0, bool bMinimum = false, double Maximum = 0.0, bool bMaximum = false)
1897 { return( Add_Value (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Type, Value, Minimum, bMinimum, Maximum, bMaximum) ); }
1898 CSG_Parameter * Add_Info_Value (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value = 0.0)
1899 { return( Add_Info_Value (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Type, Value) ); }
1900 CSG_Parameter * Add_Bool (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value = false)
1901 { return( Add_Bool (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value) ); }
1902 CSG_Parameter * Add_Int (CSG_Parameter *pParent, 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)
1903 { return( Add_Int (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value, Minimum, bMinimum, Maximum, bMaximum) ); }
1904 CSG_Parameter * Add_Double (CSG_Parameter *pParent, 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)
1905 { return( Add_Double (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value, Minimum, bMinimum, Maximum, bMaximum) ); }
1906 CSG_Parameter * Add_Degree (CSG_Parameter *pParent, 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)
1907 { return( Add_Degree (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value, Minimum, bMinimum, Maximum, bMaximum) ); }
1908 CSG_Parameter * Add_Date (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value = 0.0)
1909 { return( Add_Date (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value) ); }
1910 CSG_Parameter * Add_Color (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value = 0)
1911 { return( Add_Color (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value) ); }
1912 CSG_Parameter * Add_Range (CSG_Parameter *pParent, 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)
1913 { return( Add_Range (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Range_Min, Range_Max, Minimum, bMinimum, Maximum, bMaximum) ); }
1914 CSG_Parameter * Add_Info_Range (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min = 0.0, double Range_Max = 0.0)
1915 { return( Add_Info_Range (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Range_Min, Range_Max) ); }
1916 CSG_Parameter * Add_Choice (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default = 0)
1917 { return( Add_Choice (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Items, Default) ); }
1918 CSG_Parameter * Add_String (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText = false, bool bPassword = false)
1919 { return( Add_String (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, String, bLongText, bPassword) ); }
1920 CSG_Parameter * Add_Info_String (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText = false)
1921 { return( Add_Info_String (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, String, bLongText) ); }
1922 CSG_Parameter * Add_FilePath (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter = NULL, const SG_Char *Default = NULL, bool bSave = false, bool bDirectory = false, bool bMultiple = false)
1923 { return( Add_FilePath (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Filter, Default, bSave, bDirectory, bMultiple) ); }
1924 CSG_Parameter * Add_Font (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit = NULL)
1925 { return( Add_Font (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, pInit) ); }
1926 CSG_Parameter * Add_Colors (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit = NULL)
1927 { return( Add_Colors (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, pInit) ); }
1928 CSG_Parameter * Add_FixedTable (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit = NULL)
1929 { return( Add_FixedTable (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, pInit) ); }
1930 CSG_Parameter * Add_Grid_System (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit = NULL)
1931 { return( Add_Grid_System (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, pInit) ); }
1932 CSG_Parameter * Add_Grid (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true, TSG_Data_Type Preferred_Type = SG_DATATYPE_Undefined)
1933 { return( Add_Grid (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint, bSystem_Dependent, Preferred_Type) ); }
1934 CSG_Parameter * Add_Grid_or_Const (CSG_Parameter *pParent, 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, bool bSystem_Dependent = true)
1935 { return( Add_Grid_or_Const (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value, Minimum, bMinimum, Maximum, bMaximum, bSystem_Dependent) ); }
1936 CSG_Parameter * Add_Grid_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1937 { return( Add_Grid_Output (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1938 CSG_Parameter * Add_Grid_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent = true)
1939 { return( Add_Grid_List (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint, bSystem_Dependent) ); }
1940 CSG_Parameter * Add_Table_Field (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone = false)
1941 { return( Add_Table_Field (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, bAllowNone) ); }
1942 CSG_Parameter * Add_Table_Field_or_Const(CSG_Parameter *pParent, 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)
1943 { return( Add_Table_Field_or_Const(pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Value, Minimum, bMinimum, Maximum, bMaximum) ); }
1944 CSG_Parameter * Add_Table_Fields (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1945 { return( Add_Table_Fields (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1946 CSG_Parameter * Add_Table (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1947 { return( Add_Table (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1948 CSG_Parameter * Add_Table_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1949 { return( Add_Table_Output (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1950 CSG_Parameter * Add_Table_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1951 { return( Add_Table_List (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1952 CSG_Parameter * Add_Shapes (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type = SHAPE_TYPE_Undefined)
1953 { return( Add_Shapes (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint, Shape_Type) ); }
1954 CSG_Parameter * Add_Shapes_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1955 { return( Add_Shapes_Output (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1956 CSG_Parameter * Add_Shapes_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type = SHAPE_TYPE_Undefined)
1957 { return( Add_Shapes_List (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint, Shape_Type) ); }
1958 CSG_Parameter * Add_TIN (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1959 { return( Add_TIN (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1960 CSG_Parameter * Add_TIN_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1961 { return( Add_TIN_Output (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1962 CSG_Parameter * Add_TIN_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1963 { return( Add_TIN_List (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1964 CSG_Parameter * Add_PointCloud (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1965 { return( Add_PointCloud (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1966 CSG_Parameter * Add_PointCloud_Output (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1967 { return( Add_PointCloud_Output (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1968 CSG_Parameter * Add_PointCloud_List (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
1969 { return( Add_PointCloud_List (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description, Constraint) ); }
1970 CSG_Parameter * Add_Parameters (CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
1971 { return( Add_Parameters (pParent ? pParent->Get_Identifier() : SG_T(""), ID, Name, Description) ); }
1972
1973 // DEPRECATED END
1974
1975 };
1976
1977
1979 // //
1980 // //
1981 // //
1983
1984 //---------------------------------------------------------
1985 #endif // #ifndef HEADER_INCLUDED__SAGA_API__parameters_H
CSG_Parameter::asGridsList
class CSG_Parameter_Grids_List * asGridsList(void) const
Definition: parameter.cpp:1048
CSG_Parameter_Colors::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:959
CSG_Parameter_Data_Object
Definition: parameters.h:1132
CSG_Parameter_Date
Definition: parameters.h:571
CSG_Parameter_Bool::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:398
CSG_Parameter_Shapes_List::Get_Shape_Type
TSG_Shape_Type Get_Shape_Type(void) const
Definition: parameters.h:1492
CSG_Parameters::Get_Description
const CSG_String & Get_Description(void) const
Definition: parameters.h:1691
CSG_Parameter_Grid::m_Type
TSG_Data_Type m_Type
Definition: parameters.h:1213
CSG_Parameter::asPointer
void * asPointer(void) const
Definition: parameters.h:285
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameter_Choices::Get_Selection_Count
int Get_Selection_Count(void) const
Definition: parameters.h:762
CSG_Parameters::Add_Degree
CSG_Parameter * Add_Degree(CSG_Parameter *pParent, 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)
Definition: parameters.h:1906
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Parameters::Get_Grid_System
CSG_Grid_System * Get_Grid_System(void) const
Definition: parameters.h:1847
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Parameter_Grid_System::m_System
CSG_Grid_System m_System
Definition: parameters.h:1031
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
CSG_Parameter_Grid
Definition: parameters.h:1194
CSG_Parameters::Add_Shapes_Output
CSG_Parameter * Add_Shapes_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1954
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Parameters::Add_FixedTable
CSG_Parameter * Add_FixedTable(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
Definition: parameters.h:1928
CSG_Parameter::asShapesList
class CSG_Parameter_Shapes_List * asShapesList(void) const
Definition: parameter.cpp:1050
CSG_Parameters::Add_Table
CSG_Parameter * Add_Table(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1946
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3013
CSG_Parameter_Degree
Definition: parameters.h:546
CSG_Parameter_Choice::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1095
CSG_Parameter_Parameters
Definition: parameters.h:1563
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_Parameter::m_String
CSG_String m_String
Definition: parameters.h:330
CSG_Parameter_Data_Object::_Set_Value
virtual int _Set_Value(void *Value)
Definition: parameter_data.cpp:2475
CSG_Parameter_Int::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:483
CSG_Parameter_Table_Fields::m_nFields
int m_nFields
Definition: parameters.h:1110
CSG_Parameter_Data_Object_Output::m_Type
TSG_Data_Object_Type m_Type
Definition: parameters.h:1178
CSG_Parameter_Int::_asInt
virtual int _asInt(void) const
Definition: parameters.h:491
CSG_Parameter_Grids_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1439
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
CSG_Parameter_Int::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:443
CSG_Parameters::Add_PointCloud
CSG_Parameter * Add_PointCloud(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1964
CSG_Parameters::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameters.h:1674
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
PARAMETER_OPTIONAL
#define PARAMETER_OPTIONAL
Definition: parameters.h:96
CSG_Parameters::Get_Grid_System_Parameter
CSG_Parameter * Get_Grid_System_Parameter(void) const
Definition: parameters.h:1846
CSG_Parameters::Get_Owner
void * Get_Owner(void) const
Definition: parameters.h:1670
CSG_Parameter_TIN
Definition: parameters.h:1309
CSG_Parameter_Table_Fields::Get_Index
int Get_Index(int i) const
Definition: parameters.h:1100
CSG_Parameter_Table_List
Definition: parameters.h:1463
CSG_Parameter_Grid_List::Get_Grid_Count
int Get_Grid_Count(void) const
Definition: parameters.h:1416
CSG_Parameter_Value::Get_Maximum
double Get_Maximum(void) const
Definition: parameters.h:444
CSG_Parameter::is_Valid
virtual bool is_Valid(void) const
Definition: parameters.h:230
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Parameter_Value::has_Minimum
bool has_Minimum(void) const
Definition: parameters.h:441
CSG_Parameter_Table_Field::m_Default
int m_Default
Definition: parameters.h:1070
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
CSG_Parameter::asTINList
class CSG_Parameter_TIN_List * asTINList(void) const
Definition: parameter.cpp:1051
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Parameter::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1090
CSG_Grid_System
Definition: grid.h:200
CSG_Parameters::Add_TIN_List
CSG_Parameter * Add_TIN_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1962
CSG_Parameter::asDate
class CSG_Parameter_Date * asDate(void) const
Definition: parameter.cpp:1036
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Parameter_Shapes_List::m_Type
TSG_Shape_Type m_Type
Definition: parameters.h:1501
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Parameter_PointCloud_List::Get_PointCloud
CSG_PointCloud * Get_PointCloud(int Index) const
Definition: parameters.h:1545
CSG_Parameter::asColor
long asColor(void) const
Definition: parameters.h:282
CSG_Parameter_String::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:802
CSG_Parameters::CSG_Parameter
friend class CSG_Parameter
Definition: parameters.h:1651
CSG_Data_Manager::Add_PointCloud
CSG_PointCloud * Add_PointCloud(void)
Definition: data_manager.cpp:636
CSG_Parameters::Add_Grid_Output
CSG_Parameter * Add_Grid_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1936
CSG_Parameter_Range::m_pMin
CSG_Parameter_Double * m_pMin
Definition: parameters.h:638
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
CSG_Parameter_Choice::_asInt
virtual int _asInt(void) const
Definition: parameters.h:700
CSG_Parameter_Int::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:489
CSG_Parameters::is_Managed
bool is_Managed(void) const
Definition: parameters.h:1844
CSG_Parameters::Add_Info_Range
CSG_Parameter * Add_Info_Range(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0)
Definition: parameters.h:1914
CSG_Parameter_Colors
Definition: parameters.h:956
CSG_Parameter_Choices
Definition: parameters.h:747
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1165
CSG_Tool
Definition: tool.h:149
CSG_Parameter_Colors::m_Colors
CSG_Colors m_Colors
Definition: parameters.h:966
CSG_Parameters::Add_Color
CSG_Parameter * Add_Color(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
Definition: parameters.h:1910
SG_Parameter_Type_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Name(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:64
CSG_Parameter_Data_Object::m_pDataObject
CSG_Data_Object * m_pDataObject
Definition: parameters.h:1142
CSG_Parameter_Choices::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:758
CSG_Parameters::Add_Shapes
CSG_Parameter * Add_Shapes(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.h:1952
CSG_Parameter_Double::_Set_String
virtual void _Set_String(void)
Definition: parameter_data.cpp:572
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Data_Manager::Add_Shapes
CSG_Shapes * Add_Shapes(TSG_Shape_Type Type=SHAPE_TYPE_Undefined)
Definition: data_manager.cpp:649
CSG_Parameter_Table_Field
Definition: parameters.h:1054
CSG_Parameter_Choice::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:662
CSG_Parameters::Add_Shapes_List
CSG_Parameter * Add_Shapes_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.h:1956
CSG_Parameters::Add_PointCloud_Output
CSG_Parameter * Add_PointCloud_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1966
CSG_Parameter_File_Name::m_Filter
CSG_String m_Filter
Definition: parameters.h:879
CSG_Parameter_Grid::Get_Preferred_Type
TSG_Data_Type Get_Preferred_Type(void) const
Definition: parameters.h:1200
CSG_Parameter_TIN_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1520
CSG_Parameter::_asDouble
virtual double _asDouble(void) const
Definition: parameter.cpp:961
CSG_Parameter_Node
Definition: parameters.h:375
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1072
SG_Parameter_Type_Get_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:114
CSG_Parameter_Table_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1466
CSG_Parameter_File_Name::is_Directory
bool is_Directory(void) const
Definition: parameters.h:868
CSG_Parameter_Value
Definition: parameters.h:434
CSG_Parameters::Add_Choice
CSG_Parameter * Add_Choice(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
Definition: parameters.h:1916
tin.h
CSG_Parameter_String::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:1485
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_Parameter_List::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:3105
CSG_Parameters::Add_Int
CSG_Parameter * Add_Int(CSG_Parameter *pParent, 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)
Definition: parameters.h:1902
CSG_Parameter_File_Name::is_Save
bool is_Save(void) const
Definition: parameters.h:862
CSG_Parameter_Choice::_asDouble
virtual double _asDouble(void) const
Definition: parameters.h:701
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_Parameter_Font
Definition: parameters.h:895
CSG_Parameter_Data_Object_Output::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameters.h:1171
SG_Parameter_Type_Get_Type
SAGA_API_DLL_EXPORT TSG_Parameter_Type SG_Parameter_Type_Get_Type(const CSG_String &Identifier)
Definition: parameter_data.cpp:164
CSG_Parameter_Node::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:378
CSG_Parameter_Choice::m_Items
CSG_Strings m_Items
Definition: parameters.h:691
CSG_Parameter::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter.cpp:739
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1894
CSG_File
Definition: api_core.h:1116
CSG_Parameter_File_Name::is_Multiple
bool is_Multiple(void) const
Definition: parameters.h:865
CSG_Parameter_TIN_List::asTIN
CSG_TIN * asTIN(int Index) const
Definition: parameters.h:1522
CSG_Parameter_PointCloud
Definition: parameters.h:1333
CSG_Parameter_Grid_List::m_Grids
CSG_Array_Pointer m_Grids
Definition: parameters.h:1424
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
SSG_Rect
Definition: geo_tools.h:464
CSG_Parameter::asGridList
class CSG_Parameter_Grid_List * asGridList(void) const
Definition: parameter.cpp:1047
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_Parameter_Font::m_Color
int m_Color
Definition: parameters.h:907
CSG_Parameter_Range::m_pRange
CSG_Parameters * m_pRange
Definition: parameters.h:636
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameters::Add_Colors
CSG_Parameter * Add_Colors(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL)
Definition: parameters.h:1926
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1096
CSG_Parameter_Date::m_Date
CSG_DateTime m_Date
Definition: parameters.h:584
CSG_Parameter_Table_List::Get_Table
CSG_Table * Get_Table(int Index) const
Definition: parameters.h:1468
CSG_Parameter_Text
Definition: parameters.h:833
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
CSG_Parameter_Grid_List::Get_Grid
CSG_Grid * Get_Grid(int Index) const
Definition: parameters.h:1417
CSG_Parameter::ignore_Projection
bool ignore_Projection(void) const
Definition: parameters.h:250
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_Parameters::Add_String
CSG_Parameter * Add_String(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false, bool bPassword=false)
Definition: parameters.h:1918
CSG_Parameter_Shapes
Definition: parameters.h:1278
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3055
CSG_TIN
Definition: tin.h:222
CSG_Parameter_Fixed_Table
Definition: parameters.h:990
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
CSG_Parameters::Add_Parameters
CSG_Parameter * Add_Parameters(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1970
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter_Int::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:497
CSG_Parameter
Definition: parameters.h:207
CSG_Parameter_Double::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:511
CSG_Parameter_Choices::Get_Item_Data
const CSG_String & Get_Item_Data(int i) const
Definition: parameters.h:760
CSG_Data_Manager::asTIN
CSG_Data_Collection * asTIN(void) const
Definition: data_manager.h:170
CSG_Parameter_Grid_System
Definition: parameters.h:1021
CSG_Parameters::Add_Info_Value
CSG_Parameter * Add_Info_Value(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0)
Definition: parameters.h:1898
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
CSG_Data_Manager::Add_TIN
CSG_TIN * Add_TIN(void)
Definition: data_manager.cpp:623
CSG_Parameter::_asInt
virtual int _asInt(void) const
Definition: parameter.cpp:960
CSG_Data_Manager::Add_Grid
CSG_Grid * Add_Grid(const CSG_Grid_System &System, TSG_Data_Type Type=SG_DATATYPE_Undefined)
Definition: data_manager.cpp:662
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Parameter_Choices::Get_Selection_Data
const CSG_String & Get_Selection_Data(int i) const
Definition: parameters.h:764
CSG_Parameter_List::Update_Data
virtual bool Update_Data(void)
Definition: parameters.h:1370
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Parameter_Parameters::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1566
CSG_Parameter_Date::Get_Date
const CSG_DateTime & Get_Date(void) const
Definition: parameters.h:577
CSG_Parameters::Add_Table_List
CSG_Parameter * Add_Table_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1950
CSG_Parameter_Fixed_Table::m_Table
CSG_Table m_Table
Definition: parameters.h:1000
CSG_Parameter_List::Del_Item
virtual bool Del_Item(CSG_Data_Object *pItem, bool bUpdateData=true)
Definition: parameter_data.cpp:3025
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter::_Serialize
virtual bool _Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1132
CSG_Parameter_File_Name
Definition: parameters.h:853
CSG_Parameters::Add_Table_Field_or_Const
CSG_Parameter * Add_Table_Field_or_Const(CSG_Parameter *pParent, 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)
Definition: parameters.h:1942
CSG_Parameter_Grids
Definition: parameters.h:1234
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1672
CSG_Parameter_Range::Get_Range
double Get_Range(void) const
Definition: parameters.h:616
CSG_Parameters::Add_Table_Output
CSG_Parameter * Add_Table_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1948
CSG_Parameter_Grids_List
Definition: parameters.h:1437
CSG_Parameter_Choice::Get_Count
int Get_Count(void) const
Definition: parameters.h:682
CSG_Parameter_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: parameters.h:1291
CSG_Tool::Destroy
virtual void Destroy(void)
Definition: tool.cpp:115
CSG_Parameter::asDataType
class CSG_Parameter_Data_Type * asDataType(void) const
Definition: parameter.cpp:1037
CSG_Parameter::_asPointer
virtual void * _asPointer(void) const
Definition: parameter.cpp:962
CSG_Parameter::Get_Child
CSG_Parameter * Get_Child(int iChild) const
Definition: parameters.h:255
CSG_Parameter_Value::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:411
PARAMETER_CHECK_ALL
#define PARAMETER_CHECK_ALL
Definition: parameters.h:191
CSG_Parameters::Add_TIN
CSG_Parameter * Add_TIN(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1958
CSG_Parameters::Serialize
bool Serialize(CSG_MetaData &Data) const
Definition: parameters.h:1829
CSG_Parameter_Grid_List
Definition: parameters.h:1402
CSG_Parameter_Shapes_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1489
CSG_Parameter_Double::_asDouble
virtual double _asDouble(void) const
Definition: parameters.h:530
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Parameters::Add_Grid_List
CSG_Parameter * Add_Grid_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.h:1938
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Parameter::asPointCloudList
class CSG_Parameter_PointCloud_List * asPointCloudList(void) const
Definition: parameter.cpp:1052
CSG_Parameters::Add_FilePath
CSG_Parameter * Add_FilePath(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
Definition: parameters.h:1922
CSG_Parameter_Range
Definition: parameters.h:610
CSG_Data_Manager::Add_Table
CSG_Table * Add_Table(void)
Definition: data_manager.cpp:610
PARAMETER_IGNORE_PROJECTION
#define PARAMETER_IGNORE_PROJECTION
Definition: parameters.h:98
CSG_Array_Int
Definition: api_core.h:421
CSG_Parameter_Int::_asDouble
virtual double _asDouble(void) const
Definition: parameters.h:492
CSG_Parameters::Add_Double
CSG_Parameter * Add_Double(CSG_Parameter *pParent, 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)
Definition: parameters.h:1904
CSG_Data_Manager::Add_Grids
CSG_Grids * Add_Grids(const CSG_String &File)
Definition: data_manager.h:210
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Parameter_Grid_System::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1024
CSG_Parameters::Add_PointCloud_List
CSG_Parameter * Add_PointCloud_List(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.h:1968
CSG_Parameter_Degree::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:549
CSG_Parameter::Toggle_Value
virtual bool Toggle_Value(void)
Definition: parameter.cpp:826
CSG_Parameters::Get_References
const CSG_Strings & Get_References(void) const
Definition: parameters.h:1696
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Parameter_Table::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1258
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Parameter::_Set_String
virtual void _Set_String(void)
Definition: parameter.cpp:840
CSG_Parameters::Add_TIN_Output
CSG_Parameter * Add_TIN_Output(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1960
pointcloud.h
CSG_Parameter_Bool::_asInt
virtual int _asInt(void) const
Definition: parameters.h:418
CSG_Parameters::Add_Date
CSG_Parameter * Add_Date(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
Definition: parameters.h:1908
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
CSG_Parameter_PointCloud_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1543
CSG_Strings
Definition: api_core.h:693
CSG_DateTime
Definition: datetime.h:183
CSG_Parameter_Shapes::Get_Shape_Type
TSG_Shape_Type Get_Shape_Type(void) const
Definition: parameters.h:1284
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1042
CSG_Parameter_Shapes_List::Get_Shapes
CSG_Shapes * Get_Shapes(int Index) const
Definition: parameters.h:1494
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
CSG_Parameters::Add_Table_Fields
CSG_Parameter * Add_Table_Fields(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.h:1944
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.h:1900
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
CSG_Parameter_Shapes_List
Definition: parameters.h:1486
CSG_Parameter_Font::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:898
CSG_Projection
Definition: geo_tools.h:833
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1685
CSG_Parameter_Data_Object_Output::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1168
CSG_Parameter_Double::m_Value
double m_Value
Definition: parameters.h:520
CSG_Parameter_Int
Definition: parameters.h:470
CSG_Table
Definition: table.h:283
CSG_Parameter_Value::has_Maximum
bool has_Maximum(void) const
Definition: parameters.h:445
CSG_Parameter_String::m_bPassword
bool m_bPassword
Definition: parameters.h:814
CSG_Parameters::Add_Grid_or_Const
CSG_Parameter * Add_Grid_or_Const(CSG_Parameter *pParent, 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, bool bSystem_Dependent=true)
Definition: parameters.h:1934
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
CSG_Parameter_Grid::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1197
CSG_Parameter_Double::_Set_Value
virtual int _Set_Value(int Value)
Definition: parameter_data.cpp:532
CSG_Parameter_Choice::_Serialize
virtual bool _Serialize(CSG_MetaData &Entry, bool bSave)
Definition: parameter_data.cpp:1107
CSG_Parameter_Double
Definition: parameters.h:508
CSG_Parameter_Bool
Definition: parameters.h:395
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
shapes.h
CSG_Parameters::Add_Value
CSG_Parameter * Add_Value(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, TSG_Parameter_Type Type, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.h:1896
CSG_Parameter_Table_Field::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1057
CSG_String
Definition: api_core.h:557
CSG_Parameter::asTableFields
class CSG_Parameter_Table_Fields * asTableFields(void) const
Definition: parameter.cpp:1043
CSG_Parameter_Parameters::m_pParameters
CSG_Parameters * m_pParameters
Definition: parameters.h:1576
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
PARAMETER_INFORMATION
#define PARAMETER_INFORMATION
Definition: parameters.h:97
CSG_Parameter_Data_Object::_Assign
virtual bool _Assign(CSG_Parameter *pSource)
Definition: parameter_data.cpp:2511
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Parameter_File_Name::m_bSave
bool m_bSave
Definition: parameters.h:877
CSG_Parameters::Serialize
bool Serialize(CSG_MetaData &Data, bool bSave)
Definition: parameters.h:1828
CSG_Parameter_Table_Fields
Definition: parameters.h:1094
CSG_Parameter_String
Definition: parameters.h:799
CSG_Parameter_Grids::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1237
CSG_Parameter_Choice::m_Value
int m_Value
Definition: parameters.h:689
CSG_Parameter_Date::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:574
CSG_Parameter_Table_Fields::Get_Count
int Get_Count(void) const
Definition: parameters.h:1099
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1281
CSG_Parameter_Choices::m_Selection
CSG_Array_Int m_Selection
Definition: parameters.h:778
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
CSG_Parameter_Color
Definition: parameters.h:930
CSG_Parameter_PointCloud::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1336
CSG_Parameters_Grid_Target
Definition: parameters.h:1599
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Parameter_Text::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:835
CSG_Parameter_Fixed_Table::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:993
CSG_Parameter_Choices::Get_Selection
const CSG_String & Get_Selection(int i) const
Definition: parameters.h:763
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Parameter_Range::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:613
CSG_Parameter_Grid::m_Default
int m_Default
Definition: parameters.h:1211
CSG_Parameter_Grid_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1405
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter_Value::Get_Minimum
double Get_Minimum(void) const
Definition: parameters.h:440
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
CSG_Parameter_Choices::Get_Selection_Index
int Get_Selection_Index(int i) const
Definition: parameters.h:765
CSG_Parameter_Data_Type::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:720
CSG_Grid
Definition: grid.h:473
CSG_Parameter_TIN::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1312
CSG_Parameter::asTableList
class CSG_Parameter_Table_List * asTableList(void) const
Definition: parameter.cpp:1049
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1646
CSG_Parameters::Add_Font
CSG_Parameter * Add_Font(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *pInit=NULL)
Definition: parameters.h:1924
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Parameter_Color::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:933
CSG_Parameter_Choice
Definition: parameters.h:659
CSG_Parameter_Choices::Get_Item
const CSG_String & Get_Item(int i) const
Definition: parameters.h:759
CSG_Parameters::Get_Name
const CSG_String & Get_Name(void) const
Definition: parameters.h:1688
CSG_Parameter_Range::Get_Min_Parameter
CSG_Parameter_Double * Get_Min_Parameter(void) const
Definition: parameters.h:620
CSG_Shapes
Definition: shapes.h:773
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.h:1930
CSG_Parameter_PointCloud_List
Definition: parameters.h:1540
CSG_Parameter_Int::m_Value
int m_Value
Definition: parameters.h:482
CSG_Parameter_TIN_List
Definition: parameters.h:1517
CSG_Parameters
Definition: parameters.h:1650
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Parameter_Double::_asInt
virtual int _asInt(void) const
Definition: parameters.h:529
CSG_Parameter_Value::m_bMinimum
bool m_bMinimum
Definition: parameters.h:452
CSG_Parameters::Serialize
bool Serialize(const CSG_String &File, bool bSave)
Definition: parameters.h:1830
CSG_Parameter_Table_Fields::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1097
CSG_Parameter_List
Definition: parameters.h:1359
CSG_Parameter_Choices::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:750
CSG_Parameters::Add_Range
CSG_Parameter * Add_Range(CSG_Parameter *pParent, 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)
Definition: parameters.h:1912
CSG_Parameters::Serialize
bool Serialize(const CSG_String &File) const
Definition: parameters.h:1831
CSG_Parameter::is_Default
virtual bool is_Default(void) const
Definition: parameter.cpp:881
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter_Range::Get_Max_Parameter
CSG_Parameter_Double * Get_Max_Parameter(void) const
Definition: parameters.h:624
CSG_Parameter_Int::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:473
CSG_Parameter_Grids_List::Get_Grids
CSG_Grids * Get_Grids(int Index) const
Definition: parameters.h:1445
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
CSG_Grids
Definition: grids.h:119
CSG_Parameter_File_Name::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:856
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
CSG_Parameter_Value::m_Minimum
double m_Minimum
Definition: parameters.h:454
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter_Bool::m_Value
bool m_Value
Definition: parameters.h:409
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
table.h
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
CSG_Parameters::Add_Info_String
CSG_Parameter * Add_Info_String(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &String, bool bLongText=false)
Definition: parameters.h:1920
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter::Restore_Default
virtual bool Restore_Default(void)
Definition: parameter.cpp:887
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
CSG_Parameter_Table
Definition: parameters.h:1255
PARAMETER_INPUT
#define PARAMETER_INPUT
Definition: parameters.h:94
CSG_Parameters::Add_Grid
CSG_Parameter * Add_Grid(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.h:1932
CSG_Parameter_Data_Type
Definition: parameters.h:717
CSG_Colors
Definition: api_core.h:1329
CSG_Parameters::Add_Table_Field
CSG_Parameter * Add_Table_Field(CSG_Parameter *pParent, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
Definition: parameters.h:1940
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
datetime.h
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
grids.h
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: pointcloud.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
pointcloud.cpp File Reference
#include "pointcloud.h"

Go to the source code of this file.

Macros

#define | PC_FILE_VERSION "SGPC01"
#define | PC_STR_NBYTES 32
#define | PC_DAT_NBYTES 32
#define | PC_GET_NBYTES(type) (type == SG_DATATYPE_String ? PC_STR_NBYTES : type == SG_DATATYPE_Date ? PC_DAT_NBYTES : (int)SG_Data_Type_Get_Size(type))
#define | m_Field_Size(FIELD) PC_GET_NBYTES(m_Field_Type[FIELD])
#define | m_Field_Size(FIELD) PC_GET_NBYTES(m_Field_Type[FIELD])

Functions

CSG_PointCloud * | SG_Create_PointCloud (void)
CSG_PointCloud * | SG_Create_PointCloud (const CSG_PointCloud &PointCloud)
CSG_PointCloud * | SG_Create_PointCloud (const char *File)
CSG_PointCloud * | SG_Create_PointCloud (const wchar_t *File)
CSG_PointCloud * | SG_Create_PointCloud (const CSG_String &File)
CSG_PointCloud * | SG_Create_PointCloud (CSG_PointCloud *pStructure)

Macro Definition Documentation

◆ m_Field_Size [1/2]

#define m_Field_Size ( FIELD ) PC_GET_NBYTES(m_Field_Type[FIELD])

◆ m_Field_Size [2/2]

#define m_Field_Size ( FIELD ) PC_GET_NBYTES(m_Field_Type[FIELD])

◆ PC_DAT_NBYTES

#define PC_DAT_NBYTES 32

Definition at line 64 of file pointcloud.cpp.

◆ PC_FILE_VERSION

#define PC_FILE_VERSION "SGPC01"

Definition at line 61 of file pointcloud.cpp.

◆ PC_GET_NBYTES

#define PC_GET_NBYTES ( type ) (type == SG_DATATYPE_String ? PC_STR_NBYTES : type == SG_DATATYPE_Date ? PC_DAT_NBYTES : (int)SG_Data_Type_Get_Size(type))

Definition at line 66 of file pointcloud.cpp.

◆ PC_STR_NBYTES

#define PC_STR_NBYTES 32

Definition at line 63 of file pointcloud.cpp.

Function Documentation

◆ SG_Create_PointCloud() [1/6]

CSG_PointCloud* SG_Create_PointCloud ( const char * File )

Safe Point Cloud construction

Definition at line 88 of file pointcloud.cpp.

References SG_Create_PointCloud().

◆ SG_Create_PointCloud() [2/6]

CSG_PointCloud* SG_Create_PointCloud ( const CSG_PointCloud & PointCloud )

Safe Point Cloud construction

Definition at line 82 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [3/6]

CSG_PointCloud* SG_Create_PointCloud ( const CSG_String & File )

Safe Point Cloud construction

Definition at line 90 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [4/6]

CSG_PointCloud* SG_Create_PointCloud ( const wchar_t * File )

Safe Point Cloud construction

Definition at line 89 of file pointcloud.cpp.

References SG_Create_PointCloud().

◆ SG_Create_PointCloud() [5/6]

CSG_PointCloud* SG_Create_PointCloud ( CSG_PointCloud * pStructure )

Safe Point Cloud construction

Definition at line 96 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [6/6]

CSG_PointCloud* SG_Create_PointCloud ( void )

Safe Point Cloud construction

Definition at line 76 of file pointcloud.cpp.

Referenced by SG_Create_PointCloud(), and SG_Create_Shapes().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: pointcloud.cpp Source File

  • saga_core
  • saga_api
pointcloud.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // pointcloud.cpp //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "pointcloud.h"
52
53
55 // //
56 // //
57 // //
59
60 //---------------------------------------------------------
61 #define PC_FILE_VERSION "SGPC01"
62
63 #define PC_STR_NBYTES 32
64 #define PC_DAT_NBYTES 32
65
66 #define PC_GET_NBYTES(type) (type == SG_DATATYPE_String ? PC_STR_NBYTES : type == SG_DATATYPE_Date ? PC_DAT_NBYTES : (int)SG_Data_Type_Get_Size(type))
67
68
70 // //
71 // //
72 // //
74
75 //---------------------------------------------------------
76 CSG_PointCloud * SG_Create_PointCloud(void)
77 {
78 return( new CSG_PointCloud );
79 }
80
81 //---------------------------------------------------------
82 CSG_PointCloud * SG_Create_PointCloud(const CSG_PointCloud &PointCloud)
83 {
84 return( new CSG_PointCloud(PointCloud) );
85 }
86
87 //---------------------------------------------------------
88 CSG_PointCloud * SG_Create_PointCloud(const char *File) { return( SG_Create_PointCloud(CSG_String(File)) ); }
89 CSG_PointCloud * SG_Create_PointCloud(const wchar_t *File) { return( SG_Create_PointCloud(CSG_String(File)) ); }
90 CSG_PointCloud * SG_Create_PointCloud(const CSG_String &File)
91 {
92 return( new CSG_PointCloud(File) );
93 }
94
95 //---------------------------------------------------------
96 CSG_PointCloud * SG_Create_PointCloud(CSG_PointCloud *pStructure)
97 {
98 return( new CSG_PointCloud(pStructure) );
99 }
100
101
103 // //
104 // //
105 // //
107
108 //---------------------------------------------------------
109 CSG_PointCloud::CSG_PointCloud(void)
110 : CSG_Shapes()
111 {
112 _On_Construction();
113
114 Create();
115 }
116
117 bool CSG_PointCloud::Create(void)
118 {
119 Destroy();
120
121 Add_Field("", SG_DATATYPE_Undefined); // add x, y, z fields
122
123 return( true );
124 }
125
126 //---------------------------------------------------------
127 CSG_PointCloud::CSG_PointCloud(const CSG_PointCloud &PointCloud)
128 : CSG_Shapes()
129 {
130 _On_Construction(); Create(PointCloud);
131 }
132
133 bool CSG_PointCloud::Create(const CSG_PointCloud &PointCloud)
134 {
135 return( Assign((CSG_Data_Object *)&PointCloud) );
136 }
137
138 //---------------------------------------------------------
139 CSG_PointCloud::CSG_PointCloud(const char *File) : CSG_PointCloud(CSG_String(File)) {}
140 CSG_PointCloud::CSG_PointCloud(const wchar_t *File) : CSG_PointCloud(CSG_String(File)) {}
141 CSG_PointCloud::CSG_PointCloud(const CSG_String &File)
142 : CSG_Shapes()
143 {
144 _On_Construction(); Create(File);
145 }
146
147 bool CSG_PointCloud::Create(const char *File) { return( Create(CSG_String(File)) ); }
148 bool CSG_PointCloud::Create(const wchar_t *File) { return( Create(CSG_String(File)) ); }
149 bool CSG_PointCloud::Create(const CSG_String &File)
150 {
151 return( _Load(File) );
152 }
153
154 //---------------------------------------------------------
155 CSG_PointCloud::CSG_PointCloud(CSG_PointCloud *pTemplate)
156 : CSG_Shapes()
157 {
158 _On_Construction(); Create(pTemplate);
159 }
160
161 bool CSG_PointCloud::Create(CSG_PointCloud *pTemplate)
162 {
163 Destroy();
164
165 if( pTemplate && pTemplate->m_nFields > 0 )
166 {
167 for(int iField=0; iField<pTemplate->m_nFields; iField++)
168 {
169 _Add_Field(pTemplate->Get_Field_Name(iField), pTemplate->Get_Field_Type(iField));
170 }
171
172 return( true );
173 }
174
175 return( false );
176 }
177
178 //---------------------------------------------------------
179 void CSG_PointCloud::_On_Construction(void)
180 {
181 m_Type = SHAPE_TYPE_Point;
182 m_Vertex_Type = SG_VERTEX_TYPE_XYZ;
183
184 m_nFields = 0;
185 m_Field_Name = NULL;
186 m_Field_Type = NULL;
187 m_Field_Stats = NULL;
188 m_Field_Offset = NULL;
189
190 m_Points = NULL;
191 m_nRecords = 0;
192 m_nPointBytes = 0;
193
194 m_Cursor = NULL;
195 m_bXYZPrecDbl = true;
196
197 Set_NoData_Value(-999999);
198
199 Set_Update_Flag();
200
201 m_Shapes.Create(SHAPE_TYPE_Point, NULL, NULL, SG_VERTEX_TYPE_XYZ);
202 m_Shapes.Set_Count(SG_OMP_Get_Max_Num_Procs());
203 for(sLong i=0; i<m_Shapes.Get_Count(); i++)
204 {
205 m_Shapes[i].m_Index = -1;
206 }
207
208 m_Array_Points.Create(sizeof(char *), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_3);
209 }
210
211 //---------------------------------------------------------
212 CSG_PointCloud::~CSG_PointCloud(void)
213 {
214 Destroy();
215 }
216
217 bool CSG_PointCloud::Destroy(void)
218 {
219 Del_Points();
220
221 if( m_nFields > 0 )
222 {
223 for(int iField=0; iField<m_nFields; iField++)
224 {
225 delete(m_Field_Name [iField]);
226 delete(m_Field_Stats[iField]);
227 }
228
229 SG_Free(m_Field_Name );
230 SG_Free(m_Field_Type );
231 SG_Free(m_Field_Stats );
232 SG_Free(m_Field_Offset);
233
234 _On_Construction();
235 }
236
237 CSG_Data_Object::Destroy();
238
239 return( true );
240 }
241
242
244 // //
245 // File //
246 // //
248
249 //---------------------------------------------------------
250 bool CSG_PointCloud::_Load(const CSG_String &File)
251 {
252 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Loading"), _TL("point cloud"), File.c_str()), true);
253
254 bool bResult = false;
255
256 if( SG_File_Cmp_Extension(File, "sg-pts-z") ) // POINTCLOUD_FILE_FORMAT_Compressed
257 {
258 CSG_File_Zip Stream(File, SG_FILE_R);
259
260 CSG_String _File(SG_File_Get_Name(File, false) + ".");
261
262 if( (bResult = Stream.Get_File(_File + "sg-pts")) == false )
263 {
264 for(size_t i=0; i<Stream.Get_File_Count(); i++)
265 {
266 if( SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sg-pts") )
267 {
268 _File = SG_File_Get_Name(Stream.Get_File_Name(i), false) + ".";
269
270 break;
271 }
272 }
273
274 bResult = Stream.Get_File(_File + "sg-pts");
275 }
276
277 if( bResult && _Load(Stream) )
278 {
279 if( Stream.Get_File(_File + "sg-info") )
280 {
281 Load_MetaData(Stream);
282 }
283
284 if( Stream.Get_File(_File + "sg-prj") )
285 {
286 Get_Projection().Load(Stream, SG_PROJ_FMT_WKT);
287 }
288 }
289 }
290 else // if( SG_File_Cmp_Extension(File, "sg-pts"/"spc") ) // POINTCLOUD_FILE_FORMAT_Normal
291 {
292 CSG_File Stream(File, SG_FILE_R, true);
293
294 if( (bResult = _Load(Stream)) == true )
295 {
296 Load_MetaData(File);
297
298 Get_Projection().Load(SG_File_Make_Path("", File, "sg-prj"), SG_PROJ_FMT_WKT);
299 }
300 }
301
302 //-----------------------------------------------------
303 SG_UI_Process_Set_Ready();
304
305 if( bResult )
306 {
307 Set_Modified(false);
308
309 Set_File_Name(File, true);
310
311 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
312
313 return( true );
314 }
315
316 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
317
318 return( false );
319 }
320
321 //---------------------------------------------------------
322 bool CSG_PointCloud::Save(const CSG_String &_File, int Format)
323 {
324 if( Format == POINTCLOUD_FILE_FORMAT_Undefined )
325 {
326 Format = SG_File_Cmp_Extension(_File, "sg-pts-z")
327 ? POINTCLOUD_FILE_FORMAT_Compressed
328 : POINTCLOUD_FILE_FORMAT_Normal;
329 }
330
331 bool bResult = false;
332
333 CSG_String File(_File);
334
335 switch( Format )
336 {
337 //-----------------------------------------------------
338 case POINTCLOUD_FILE_FORMAT_Compressed: default:
339 {
340 SG_File_Set_Extension(File, "sg-pts-z");
341
342 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("point cloud"), File.c_str()), true);
343
344 CSG_File_Zip Stream(File, SG_FILE_W);
345
346 CSG_String Name(SG_File_Get_Name(File, false) + ".");
347
348 if( Stream.Add_File(Name + "sg-pts") && _Save(Stream) )
349 {
350 if( Stream.Add_File(Name + "sg-pts-hdr") )
351 {
352 CSG_MetaData Header = _Create_Header(); Header.Save(Stream);
353 }
354
355 if( Stream.Add_File(Name + "sg-info") )
356 {
357 Save_MetaData(Stream);
358 }
359
360 if( Get_Projection().is_Okay() && Stream.Add_File(Name + "sg-prj") )
361 {
362 Get_Projection().Save(Stream);
363 }
364
365 bResult = true;
366 }
367 }
368 break;
369
370 //-----------------------------------------------------
371 case POINTCLOUD_FILE_FORMAT_Normal:
372 {
373 SG_File_Set_Extension(File, "sg-pts");
374
375 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("point cloud"), File.c_str()), true);
376
377 CSG_File Stream(File, SG_FILE_W, true);
378
379 if( _Save(Stream) )
380 {
381 CSG_MetaData Header = _Create_Header(); Header.Save(SG_File_Make_Path("", File, "sg-pts-hdr"));
382
383 Save_MetaData(File);
384
385 if( Get_Projection().is_Okay() )
386 {
387 Get_Projection().Save(SG_File_Make_Path("", File, "sg-prj"), SG_PROJ_FMT_WKT);
388 }
389
390 bResult = true;
391 }
392 }
393 break;
394 }
395
396 //-----------------------------------------------------
397 SG_UI_Process_Set_Ready();
398
399 if( bResult )
400 {
401 Set_Modified(false);
402
403 Set_File_Name(File, true);
404
405 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
406
407 return( true );
408 }
409
410 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
411
412 return( false );
413 }
414
415 //---------------------------------------------------------
416 bool CSG_PointCloud::Get_Header_Content(const CSG_String &File, CSG_MetaData &Header)
417 {
418 bool bResult = false;
419
420 if( SG_File_Cmp_Extension(File, "sg-pts-z") ) // POINTCLOUD_FILE_FORMAT_Compressed
421 {
422 CSG_File_Zip Stream(File, SG_FILE_R);
423
424 CSG_String _File(SG_File_Get_Name(File, false) + ".");
425
426 if( Stream.Get_File(_File + "sg-pts-hdr") )
427 {
428 bResult = Header.Load(Stream);
429 }
430 }
431 else // if( SG_File_Cmp_Extension(File, "sg-pts"/"spc") ) // POINTCLOUD_FILE_FORMAT_Normal
432 {
433 bResult = Header.Load(File, SG_T("sg-pts-hdr"));
434 }
435
436 return( bResult );
437 }
438
440 // //
442
443 //---------------------------------------------------------
444 bool CSG_PointCloud::_Load(CSG_File &Stream)
445 {
446 if( !Stream.is_Reading() )
447 {
448 return( false );
449 }
450
451 //-----------------------------------------------------
452 char ID[6];
453
454 if( !Stream.Read(ID, 6) || strncmp(ID, PC_FILE_VERSION, 5) != 0 )
455 {
456 return( false );
457 }
458
459 int nPointBytes;
460
461 if( !Stream.Read(&nPointBytes, sizeof(int)) || nPointBytes < (int)(3 * sizeof(float)) )
462 {
463 return( false );
464 }
465
466 int nFields;
467
468 if( !Stream.Read(&nFields, sizeof(int)) || nFields < 3 )
469 {
470 return( false );
471 }
472
473 //-----------------------------------------------------
474 Destroy();
475
476 for(int iField=0; iField<nFields; iField++)
477 {
478 TSG_Data_Type Type; int iBuffer; char Name[1024];
479
480 if( !Stream.Read(&Type , sizeof(TSG_Data_Type))
481 || !Stream.Read(&iBuffer, sizeof(int)) || !(iBuffer > 0 && iBuffer < 1024)
482 || !Stream.Read(Name , iBuffer) )
483 {
484 return( false );
485 }
486
487 if( ID[5] == '0' ) // Data Type Definition changed!!!
488 {
489 switch( Type )
490 {
491 default: Type = SG_DATATYPE_Undefined; break;
492 case 1: Type = SG_DATATYPE_Char ; break;
493 case 2: Type = SG_DATATYPE_Short ; break;
494 case 3: Type = SG_DATATYPE_Int ; break;
495 case 4: Type = SG_DATATYPE_Long ; break;
496 case 5: Type = SG_DATATYPE_Float ; break;
497 case 6: Type = SG_DATATYPE_Double ; break;
498 }
499 }
500
501 Name[iBuffer] = '\0';
502
503 if( !_Add_Field(CSG_String((const char *)Name), Type) )
504 {
505 return( false );
506 }
507 }
508
509 //-----------------------------------------------------
510 sLong fLength = Stream.Length();
511
512 while( _Inc_Array() && Stream.Read(m_Cursor + 1, nPointBytes) && SG_UI_Process_Set_Progress((double)Stream.Tell(), (double)fLength) )
513 {
514 // nop
515 }
516
517 _Dec_Array();
518
519 return( true );
520 }
521
522 //---------------------------------------------------------
523 bool CSG_PointCloud::_Save(CSG_File &Stream)
524 {
525 if( !Stream.is_Writing() )
526 {
527 return( false );
528 }
529
530 //-----------------------------------------------------
531 int iBuffer, nPointBytes = m_nPointBytes - 1;
532
533 Stream.Write((void *)PC_FILE_VERSION, 6);
534 Stream.Write(&nPointBytes, sizeof(int));
535 Stream.Write(&m_nFields , sizeof(int));
536
537 for(int iField=0; iField<m_nFields; iField++)
538 {
539 Stream.Write(&m_Field_Type[iField], sizeof(TSG_Data_Type));
540
541 iBuffer = (int)m_Field_Name[iField]->Length(); if( iBuffer >= 1024 - 1 ) iBuffer = 1024 - 1;
542 Stream.Write(&iBuffer, sizeof(int));
543 Stream.Write((void *)m_Field_Name[iField]->b_str(), sizeof(char), iBuffer);
544 }
545
546 _Shape_Flush();
547
548 for(sLong i=0; i<m_nRecords && SG_UI_Process_Set_Progress(i, m_nRecords); i++)
549 {
550 Stream.Write(m_Points[i] + 1, nPointBytes);
551 }
552
553 return( true );
554 }
555
556 //---------------------------------------------------------
557 CSG_MetaData CSG_PointCloud::_Create_Header(void) const
558 {
559 CSG_MetaData Header;
560
561 Header.Set_Name("PointCloudHeaderFile");
562 Header.Add_Property("Version", "1.0");
563
564 CSG_MetaData *pPoints = Header.Add_Child("Points" );
565 CSG_MetaData *pBBox = Header.Add_Child("BBox" );
566 CSG_MetaData *pNoData = Header.Add_Child("NoData" );
567 CSG_MetaData *pAttr = Header.Add_Child("Attributes");
568
569 pPoints->Add_Property("Value", Get_Count());
570 pBBox ->Add_Property("XMin" , Get_Minimum(0));
571 pBBox ->Add_Property("YMin" , Get_Minimum(1));
572 pBBox ->Add_Property("ZMin" , Get_Minimum(2));
573 pBBox ->Add_Property("XMax" , Get_Maximum(0));
574 pBBox ->Add_Property("YMax" , Get_Maximum(1));
575 pBBox ->Add_Property("ZMax" , Get_Maximum(2));
576 pNoData->Add_Property("Value", Get_NoData_Value());
577 pAttr ->Add_Property("Count", m_nFields);
578
579 for(int iField=0; iField<m_nFields; iField++)
580 {
581 CSG_MetaData *pField = pAttr->Add_Child(CSG_String::Format("Field_%d", iField + 1));
582
583 pField->Add_Property("Name", Get_Field_Name(iField));
584 pField->Add_Property("Type", gSG_Data_Type_Identifier[Get_Field_Type(iField)]);
585 }
586
587 return( Header );
588 }
589
590
592 // //
593 // Assign //
594 // //
596
597 //---------------------------------------------------------
598 bool CSG_PointCloud::Assign(CSG_Data_Object *pObject)
599 {
600 if( pObject && pObject->is_Valid() && pObject->Get_ObjectType() == Get_ObjectType() )
601 {
602 Destroy();
603
604 CSG_PointCloud *pPoints = (CSG_PointCloud *)pObject;
605
606 Set_Name(pPoints->Get_Name());
607
608 Get_History() = pPoints->Get_History();
609
610 Get_Projection().Create(pPoints->Get_Projection());
611
612 for(int iField=0; iField<pPoints->m_nFields; iField++)
613 {
614 _Add_Field(pPoints->m_Field_Name[iField]->c_str(), pPoints->m_Field_Type[iField]);
615 }
616
617 for(sLong i=0; i<pPoints->m_nRecords; i++)
618 {
619 if( _Inc_Array() )
620 {
621 memcpy(m_Points[i] + 1, pPoints->m_Points[i] + 1, m_nPointBytes - 1l);
622 }
623 }
624
625 return( true );
626 }
627
628 return( false );
629 }
630
631
633 // //
634 // Checks //
635 // //
637
638 //---------------------------------------------------------
639 bool CSG_PointCloud::is_Compatible(CSG_PointCloud *pPointCloud) const
640 {
641 if( m_nFields == pPointCloud->m_nFields )
642 {
643 for(int iField=0; iField<m_nFields; iField++)
644 {
645 if( Get_Field_Type(iField) != pPointCloud->Get_Field_Type(iField) )
646 {
647 return( false );
648 }
649 }
650
651 return( true );
652 }
653
654 return( false );
655 }
656
657
659 // //
660 // Fields //
661 // //
663
664 //---------------------------------------------------------
665 bool CSG_PointCloud::Add_Field(const CSG_String &Name, TSG_Data_Type Type, int iField)
666 {
667 if( m_nFields == 0 ) { _Add_Field(SG_T("X"), m_bXYZPrecDbl ? SG_DATATYPE_Double : SG_DATATYPE_Float); }
668 if( m_nFields == 1 ) { _Add_Field(SG_T("Y"), m_bXYZPrecDbl ? SG_DATATYPE_Double : SG_DATATYPE_Float); }
669 if( m_nFields == 2 ) { _Add_Field(SG_T("Z"), m_bXYZPrecDbl ? SG_DATATYPE_Double : SG_DATATYPE_Float); }
670
671 return( m_nFields >= 3 && _Add_Field(Name, Type, iField) );
672 }
673
674 //---------------------------------------------------------
675 bool CSG_PointCloud::_Add_Field(const SG_Char *Name, TSG_Data_Type Type, int Field)
676 {
677 #define m_Field_Size(FIELD) PC_GET_NBYTES(m_Field_Type[FIELD])
678
679 //-----------------------------------------------------
680 if( !Name || PC_GET_NBYTES(Type) <= 0 )
681 {
682 return( false );
683 }
684
685 if( Field < 0 || Field > m_nFields )
686 {
687 Field = m_nFields;
688 }
689
690 if( Field < 3 && m_nFields >= 3 )
691 {
692 Field = 3; // (x, y, z) always have to stay in the first place
693 }
694
695 //-----------------------------------------------------
696 int nFieldBytes = PC_GET_NBYTES(Type);
697
698 if( m_nFields < 1 )
699 {
700 m_nPointBytes = 1;
701 }
702
703 m_nFields++; m_nPointBytes += nFieldBytes;
704
705 //-----------------------------------------------------
706 m_Field_Name = (CSG_String **)SG_Realloc(m_Field_Name , m_nFields * sizeof(CSG_String *));
707 m_Field_Type = (TSG_Data_Type *)SG_Realloc(m_Field_Type , m_nFields * sizeof(TSG_Data_Type ));
708 m_Field_Stats = (CSG_Simple_Statistics **)SG_Realloc(m_Field_Stats , m_nFields * sizeof(CSG_Simple_Statistics *));
709 m_Field_Offset = (int *)SG_Realloc(m_Field_Offset, m_nFields * sizeof(int ));
710
711 for(int iField=m_nFields-1; iField>Field; iField--)
712 {
713 m_Field_Name [iField] = m_Field_Name [iField - 1];
714 m_Field_Type [iField] = m_Field_Type [iField - 1];
715 m_Field_Stats[iField] = m_Field_Stats[iField - 1];
716 }
717
718 m_Field_Name [Field] = new CSG_String(Name);
719 m_Field_Type [Field] = Type;
720 m_Field_Stats[Field] = new CSG_Simple_Statistics();
721
722 for(int iField=0, Offset=1; iField<m_nFields; iField++)
723 {
724 m_Field_Offset[iField] = Offset; Offset+=m_Field_Size(iField);
725 }
726
727 //-----------------------------------------------------
728 int Offset = m_Field_Offset[Field], nMoveBytes = Field < m_nFields - 1 ? m_nPointBytes - m_Field_Offset[Field + 1] : 0;
729
730 #pragma omp parallel for
731 for(sLong i=0; i<m_nRecords; i++)
732 {
733 m_Points[i] = (char *)SG_Realloc(m_Points[i], m_nPointBytes * sizeof(char));
734
735 if( nMoveBytes > 0 )
736 {
737 memmove(m_Points[i] + Offset + nFieldBytes, m_Points[i] + Offset, nMoveBytes);
738 }
739
740 memset(m_Points[i] + Offset, 0, nFieldBytes);
741 }
742
743 //-----------------------------------------------------
744 m_Shapes.Add_Field(Name, Type, Field);
745
746 Set_Modified();
747
748 return( true );
749 }
750
751 //---------------------------------------------------------
752 bool CSG_PointCloud::Del_Field(int Index)
753 {
754 #define m_Field_Size(FIELD) PC_GET_NBYTES(m_Field_Type[FIELD])
755
756 //-----------------------------------------------------
757 if( Index < 3 || Index >= m_nFields )
758 {
759 return( false );
760 }
761
762 //-----------------------------------------------------
763 int nFieldBytes = PC_GET_NBYTES(m_Field_Type[Index]);
764
765 m_nFields--; m_nPointBytes -= nFieldBytes;
766
767 //-----------------------------------------------------
768 int Offset = m_Field_Offset[Index], nMoveBytes = Index < m_nFields ? (m_nPointBytes + nFieldBytes) - m_Field_Offset[Index + 1] : 0;
769
770 #pragma omp parallel for
771 for(sLong i=0; i<m_nRecords; i++)
772 {
773 if( nMoveBytes > 0 )
774 {
775 memmove(m_Points[i] + Offset, m_Points[i] + Offset + nFieldBytes, nMoveBytes);
776 }
777
778 m_Points[i] = (char *)SG_Realloc(m_Points[i], m_nPointBytes * sizeof(char));
779 }
780
781 //-----------------------------------------------------
782 delete(m_Field_Name [Index]);
783 delete(m_Field_Stats[Index]);
784
785 for(int iField=Index, Offset=m_Field_Offset[Index]; iField<m_nFields; iField++)
786 {
787 m_Field_Name [iField] = m_Field_Name [iField + 1];
788 m_Field_Type [iField] = m_Field_Type [iField + 1];
789 m_Field_Stats [iField] = m_Field_Stats[iField + 1];
790 m_Field_Offset[iField] = Offset; Offset += m_Field_Size(iField);
791 }
792
793 m_Field_Name = (CSG_String **)SG_Realloc(m_Field_Name , m_nFields * sizeof(CSG_String *));
794 m_Field_Type = (TSG_Data_Type *)SG_Realloc(m_Field_Type , m_nFields * sizeof(TSG_Data_Type ));
795 m_Field_Stats = (CSG_Simple_Statistics **)SG_Realloc(m_Field_Stats , m_nFields * sizeof(CSG_Simple_Statistics *));
796 m_Field_Offset = (int *)SG_Realloc(m_Field_Offset, m_nFields * sizeof(int ));
797
798 //-----------------------------------------------------
799 m_Shapes.Del_Field(Index);
800
801 Set_Modified();
802
803 return( true );
804 }
805
806 //---------------------------------------------------------
807 bool CSG_PointCloud::Mov_Field(int Index, int Position)
808 {
809 if( Position < 0 )
810 {
811 Position = 0;
812 }
813 else if( Position >= m_nFields - 1 )
814 {
815 Position = m_nFields - 1;
816 }
817
818 if( Index < 3 || Index >= m_nFields || Index == Position )
819 {
820 return( false );
821 }
822
823 //-----------------------------------------------------
824 if( Position > Index )
825 {
826 Position++;
827 }
828
829 if( !Add_Field(Get_Field_Name(Index), Get_Field_Type(Index), Position) )
830 {
831 return( false );
832 }
833
834 if( Position < Index )
835 {
836 Index++;
837 }
838
839 size_t Size = PC_GET_NBYTES(m_Field_Type[Index]);
840
841 #pragma omp parallel for
842 for(sLong i=0; i<m_nRecords; i++)
843 {
844 memcpy(m_Points[i] + m_Field_Offset[Position], m_Points[i] + m_Field_Offset[Index], Size);
845 }
846
847 if( !Del_Field(Index) )
848 {
849 return( false );
850 }
851
852 //-----------------------------------------------------
853 return( true );
854 }
855
856
858 // //
860
861 //---------------------------------------------------------
862 bool CSG_PointCloud::Set_Field_Type(int iField, TSG_Data_Type Type)
863 {
864 if( iField < 3 || iField >= m_nFields )
865 {
866 return( false );
867 }
868
869 if( Type == m_Field_Type[iField] )
870 {
871 return( true );
872 }
873
874 //-----------------------------------------------------
875 Add_Field(Get_Field_Name(iField), Type, iField);
876
877 #pragma omp parallel for
878 for(sLong i=0; i<m_nRecords; i++)
879 {
880 Set_Value(i, iField, Get_Value(i, iField + 1));
881 }
882
883 Del_Field(iField + 1);
884
885 //-----------------------------------------------------
886 m_Shapes.Set_Field_Type(iField, Type);
887
888 Set_Modified();
889
890 return( true );
891 }
892
893 //---------------------------------------------------------
894 bool CSG_PointCloud::_Set_Field_Value(char *pPoint, int iField, double Value)
895 {
896 if( pPoint && iField >= 0 && iField < m_nFields )
897 {
898 pPoint = ((char *)pPoint) + m_Field_Offset[iField];
899
900 switch( m_Field_Type[iField] )
901 {
902 case SG_DATATYPE_Byte : *((BYTE *)pPoint) = (BYTE )Value ; break;
903 case SG_DATATYPE_Char : *((char *)pPoint) = (char )Value ; break;
904 case SG_DATATYPE_Word : *((WORD *)pPoint) = (WORD )Value ; break;
905 case SG_DATATYPE_Short : *((short *)pPoint) = (short )Value ; break;
906 case SG_DATATYPE_DWord : *((DWORD *)pPoint) = (DWORD )Value ; break;
907 case SG_DATATYPE_Int : *((int *)pPoint) = (int )Value ; break;
908 case SG_DATATYPE_Long : *((sLong *)pPoint) = (sLong )Value ; break;
909 case SG_DATATYPE_ULong : *((uLong *)pPoint) = (uLong )Value ; break;
910 case SG_DATATYPE_Float : *((float *)pPoint) = (float )Value ; break;
911 case SG_DATATYPE_Double: *((double *)pPoint) = (double)Value ; break;
912 case SG_DATATYPE_Color : *((DWORD *)pPoint) = (DWORD )Value ; break;
913 case SG_DATATYPE_String: sprintf( pPoint, "%f" , Value); break;
914 default : break;
915 }
916
917 m_Field_Stats[iField]->Invalidate();
918
919 Set_Modified();
920
921 if( iField < 3 )
922 {
923 Set_Update_Flag(); // extent might have changed
924 }
925
926 return( true );
927 }
928
929 return( false );
930 }
931
932 //---------------------------------------------------------
933 double CSG_PointCloud::_Get_Field_Value(char *pPoint, int iField) const
934 {
935 if( pPoint && iField >= 0 && iField < m_nFields )
936 {
937 pPoint += m_Field_Offset[iField];
938
939 switch( m_Field_Type[iField] )
940 {
941 case SG_DATATYPE_Byte : return( (double)*((BYTE *)pPoint) );
942 case SG_DATATYPE_Char : return( (double)*((char *)pPoint) );
943 case SG_DATATYPE_Word : return( (double)*((WORD *)pPoint) );
944 case SG_DATATYPE_Short : return( (double)*((short *)pPoint) );
945 case SG_DATATYPE_DWord : return( (double)*((DWORD *)pPoint) );
946 case SG_DATATYPE_Int : return( (double)*((int *)pPoint) );
947 case SG_DATATYPE_Long : return( (double)*((sLong *)pPoint) );
948 case SG_DATATYPE_ULong : return( (double)*((uLong *)pPoint) );
949 case SG_DATATYPE_Float : return( (double)*((float *)pPoint) );
950 case SG_DATATYPE_Double: return( (double)*((double *)pPoint) );
951 case SG_DATATYPE_Color : return( (double)*((DWORD *)pPoint) );
952 case SG_DATATYPE_String: return( (double)atof( pPoint) );
953 default : break;
954 }
955 }
956
957 return( 0. );
958 }
959
960 //---------------------------------------------------------
961 bool CSG_PointCloud::_Set_Field_Value(char *pPoint, int iField, const SG_Char *Value)
962 {
963 if( pPoint && iField >= 0 && iField < m_nFields && Value )
964 {
965 CSG_String s(Value);
966
967 switch( m_Field_Type[iField] )
968 {
969 default: { double d; return( s.asDouble(d) && _Set_Field_Value(pPoint, iField, d) ); }
970
971 case SG_DATATYPE_Date :
972 case SG_DATATYPE_String:
973 pPoint += m_Field_Offset[iField];
974 memset(pPoint, 0, PC_STR_NBYTES);
975 memcpy(pPoint, s.b_str(), s.Length() > PC_STR_NBYTES ? PC_STR_NBYTES : s.Length());
976 break;
977 }
978
979 return( true );
980 }
981
982 return( false );
983 }
984
985 //---------------------------------------------------------
986 bool CSG_PointCloud::_Get_Field_Value(char *pPoint, int iField, CSG_String &Value) const
987 {
988 if( pPoint && iField >= 0 && iField < m_nFields )
989 {
990 switch( m_Field_Type[iField] )
991 {
992 default:
993 Value.Printf("%f", _Get_Field_Value(pPoint, iField));
994 break;
995
996 case SG_DATATYPE_Date:
997 case SG_DATATYPE_String:
998 {
999 char s[PC_STR_NBYTES + 1];
1000
1001 memcpy(s, pPoint + m_Field_Offset[iField], PC_STR_NBYTES);
1002
1003 s[PC_STR_NBYTES] = '\0';
1004
1005 Value = s;
1006 }
1007 break;
1008 }
1009
1010 return( true );
1011 }
1012
1013 return( false );
1014 }
1015
1016
1018 // //
1019 // //
1020 // //
1022
1023 //---------------------------------------------------------
1024 TSG_Point_3D CSG_PointCloud::Get_Point(void) const
1025 {
1026 TSG_Point_3D p;
1027
1028 if( m_Cursor )
1029 {
1030 p.x = _Get_Field_Value(m_Cursor, 0);
1031 p.y = _Get_Field_Value(m_Cursor, 1);
1032 p.z = _Get_Field_Value(m_Cursor, 2);
1033 }
1034 else
1035 {
1036 p.x = p.y = p.z = 0.;
1037 }
1038
1039 return( p );
1040 }
1041
1042 //---------------------------------------------------------
1043 TSG_Point_3D CSG_PointCloud::Get_Point(sLong Index) const
1044 {
1045 TSG_Point_3D p;
1046
1047 if( Index >= 0 && Index < m_nRecords )
1048 {
1049 char *pPoint = m_Points[Index];
1050
1051 p.x = _Get_Field_Value(pPoint, 0);
1052 p.y = _Get_Field_Value(pPoint, 1);
1053 p.z = _Get_Field_Value(pPoint, 2);
1054 }
1055 else
1056 {
1057 p.x = p.y = p.z = 0.;
1058 }
1059
1060 return( p );
1061 }
1062
1063 //---------------------------------------------------------
1064 bool CSG_PointCloud::Set_Point(const TSG_Point_3D &Point)
1065 {
1066 return( _Set_Field_Value(m_Cursor, 0, Point.x)
1067 && _Set_Field_Value(m_Cursor, 1, Point.y)
1068 && _Set_Field_Value(m_Cursor, 2, Point.z)
1069 );
1070 }
1071
1072 //---------------------------------------------------------
1073 bool CSG_PointCloud::Set_Point(sLong Index, const TSG_Point_3D &Point)
1074 {
1075 if( Index >= 0 && Index < m_nRecords )
1076 {
1077 return( _Set_Field_Value(m_Points[Index], 0, Point.x)
1078 && _Set_Field_Value(m_Points[Index], 1, Point.y)
1079 && _Set_Field_Value(m_Points[Index], 2, Point.z)
1080 );
1081 }
1082
1083 return( false );
1084 }
1085
1086
1088 // //
1089 // //
1090 // //
1092
1093 //---------------------------------------------------------
1094 bool CSG_PointCloud::Add_Point(double x, double y, double z)
1095 {
1096 if( _Inc_Array() )
1097 {
1098 _Set_Field_Value(m_Cursor, 0, x);
1099 _Set_Field_Value(m_Cursor, 1, y);
1100 _Set_Field_Value(m_Cursor, 2, z);
1101
1102 Set_Modified();
1103 Set_Update_Flag();
1104 _Stats_Invalidate();
1105
1106 return( true );
1107 }
1108
1109 return( false );
1110 }
1111
1112 //---------------------------------------------------------
1113 bool CSG_PointCloud::Del_Point(sLong Index)
1114 {
1115 if( Index >= 0 && Index < m_nRecords )
1116 {
1117 if( is_Selected(Index) )
1118 {
1119 Select(Index, true);
1120 }
1121
1122 m_Cursor = m_Points[Index];
1123
1124 for(sLong i=Index, j=Index+1; j<m_nRecords; i++, j++)
1125 {
1126 m_Points[i] = m_Points[j];
1127 }
1128
1129 m_Points[m_nRecords - 1] = m_Cursor;
1130
1131 m_Cursor = NULL;
1132
1133 _Dec_Array();
1134
1135 Set_Modified();
1136 Set_Update_Flag();
1137 _Stats_Invalidate();
1138
1139 return( true );
1140 }
1141
1142 return( false );
1143 }
1144
1145 //---------------------------------------------------------
1146 bool CSG_PointCloud::Del_Points(void)
1147 {
1148 for(sLong i=0; i<m_nRecords; i++)
1149 {
1150 SG_Free(m_Points[i]);
1151 }
1152
1153 m_Array_Points.Destroy();
1154
1155 m_nRecords = 0;
1156 m_Points = NULL;
1157 m_Cursor = NULL;
1158
1159 m_Selection.Set_Array(0);
1160
1161 Set_Modified();
1162 Set_Update_Flag();
1163 _Stats_Invalidate();
1164
1165 return( true );
1166 }
1167
1168
1170 // //
1171 // //
1172 // //
1174
1175 //---------------------------------------------------------
1176 bool CSG_PointCloud::_Inc_Array(void)
1177 {
1178 if( m_nFields > 0 && m_Array_Points.Set_Array(m_nRecords + 1, (void **)&m_Points) )
1179 {
1180 m_Points[m_nRecords++] = m_Cursor = (char *)SG_Calloc(m_nPointBytes, sizeof(char));
1181
1182 return( true );
1183 }
1184
1185 return( false );
1186 }
1187
1188 //---------------------------------------------------------
1189 bool CSG_PointCloud::_Dec_Array(void)
1190 {
1191 if( m_nRecords > 0 )
1192 {
1193 m_nRecords --;
1194
1195 m_Cursor = NULL;
1196
1197 SG_Free(m_Points[m_nRecords]);
1198
1199 m_Array_Points.Set_Array(m_nRecords, (void **)&m_Points);
1200 }
1201
1202 return( true );
1203 }
1204
1205
1207 // //
1208 // Statistics //
1209 // //
1211
1212 //---------------------------------------------------------
1213 bool CSG_PointCloud::On_Update(void)
1214 {
1215 if( m_nFields >= 2 )
1216 {
1217 _Shape_Flush();
1218
1219 _Stats_Update(0);
1220 _Stats_Update(1);
1221 _Stats_Update(2);
1222
1223 m_Extent.Assign(
1224 m_Field_Stats[0]->Get_Minimum(), m_Field_Stats[1]->Get_Minimum(),
1225 m_Field_Stats[0]->Get_Maximum(), m_Field_Stats[1]->Get_Maximum()
1226 );
1227
1228 m_ZMin = m_Field_Stats[2]->Get_Minimum();
1229 m_ZMax = m_Field_Stats[2]->Get_Maximum();
1230
1231 for(int iField=3; iField<m_nFields; iField++)
1232 {
1233 m_Field_Stats[iField]->Invalidate();
1234 }
1235 }
1236
1237 return( true );
1238 }
1239
1240 //---------------------------------------------------------
1241 bool CSG_PointCloud::_Stats_Update(int Field) const
1242 {
1243 if( Field < 0 || Field >= m_nFields || m_nRecords < 1 )
1244 {
1245 return( false );
1246 }
1247
1248 CSG_Simple_Statistics &Statistics = *m_Field_Stats[Field];
1249
1250 if( Statistics.is_Evaluated() )
1251 {
1252 return( true );
1253 }
1254
1255 if( Field > 2 && Get_Max_Samples() > 0 && Get_Max_Samples() < m_nRecords )
1256 {
1257 double d = (double)m_nRecords / (double)Get_Max_Samples();
1258
1259 for(double i=0; i<(double)m_nRecords; i+=d)
1260 {
1261 double Value = Get_Value((sLong)i, Field);
1262
1263 if( Field < 3 || is_NoData_Value(Value) == false )
1264 {
1265 Statistics += Value;
1266 }
1267 }
1268
1269 Statistics.Set_Count(Statistics.Get_Count() >= Get_Max_Samples() ? m_nRecords // any no-data cells ?
1270 : (sLong)(m_nRecords * (double)Statistics.Get_Count() / (double)Get_Max_Samples())
1271 );
1272 }
1273 else
1274 {
1275 char **pPoint = m_Points;
1276
1277 for(sLong i=0; i<m_nRecords; i++, pPoint++)
1278 {
1279 double Value = _Get_Field_Value(*pPoint, Field);
1280
1281 if( Field < 3 || is_NoData_Value(Value) == false )
1282 {
1283 Statistics += Value;
1284 }
1285 }
1286 }
1287
1288 return( Statistics.Evaluate() ); // evaluate! prevent values to be added more than once!
1289 }
1290
1291
1293 // //
1294 // //
1295 // //
1297
1298 //---------------------------------------------------------
1299 bool CSG_PointCloud::On_Reload(void)
1300 {
1301 return( Create(Get_File_Name(false)) );
1302 }
1303
1304 //---------------------------------------------------------
1305 bool CSG_PointCloud::On_Delete(void)
1306 {
1307 return( SG_File_Delete(Get_File_Name(false)) );
1308 }
1309
1310
1312 // //
1313 // //
1314 // //
1316
1317 //---------------------------------------------------------
1318 CSG_Shape * CSG_PointCloud::_Shape_Get(sLong Index)
1319 {
1320 SG_UI_Progress_Lock(true);
1321
1322 CSG_Shape *pShape = m_Shapes.Get_Shape(SG_OMP_Get_Thread_Num());
1323
1324 if( pShape->is_Modified() && pShape->m_Index >= 0 && pShape->m_Index < m_nRecords )
1325 {
1326 char *Point = m_Points[pShape->m_Index];
1327
1328 for(int iField=0; iField<m_nFields; iField++)
1329 {
1330 switch( Get_Field_Type(iField) )
1331 {
1332 default : _Set_Field_Value(Point, iField, pShape->asDouble(iField)); break;
1333 case SG_DATATYPE_Date :
1334 case SG_DATATYPE_String: _Set_Field_Value(Point, iField, pShape->asString(iField)); break;
1335 }
1336 }
1337
1338 Set_Value(0, pShape->Get_Point().x);
1339 Set_Value(1, pShape->Get_Point().y);
1340 Set_Value(2, pShape->Get_Z () );
1341 }
1342
1343 if( Index >= 0 && Index < m_nRecords )
1344 {
1345 char *Point = m_Points[Index];
1346
1347 for(int iField=0; iField<m_nFields; iField++)
1348 {
1349 switch( Get_Field_Type(iField) )
1350 {
1351 default: pShape->Set_Value(iField, _Get_Field_Value(Point, iField)); break;
1352
1353 case SG_DATATYPE_Date :
1354 case SG_DATATYPE_String: {
1355 CSG_String s; _Get_Field_Value(Point, iField, s); pShape->Set_Value(iField, s);
1356 break; }
1357 }
1358 }
1359
1360 pShape->Set_Point(Get_Point(Index));
1361 pShape->Set_Selected(is_Selected(Index));
1362 pShape->Set_Modified(false);
1363
1364 pShape->m_Index = Index;
1365 }
1366 else
1367 {
1368 pShape->m_Index = -1;
1369 }
1370
1371 SG_UI_Progress_Lock(false);
1372
1373 return( pShape->m_Index >= 0 ? pShape : NULL );
1374 }
1375
1376 //---------------------------------------------------------
1377 void CSG_PointCloud::_Shape_Flush(void)
1378 {
1379 for(sLong i=0; i<m_Shapes.Get_Count(); i++)
1380 {
1381 _Shape_Get(m_Shapes[i].m_Index); m_Shapes[i].m_Index = -1;
1382 }
1383 }
1384
1385 //---------------------------------------------------------
1386 CSG_Table_Record * CSG_PointCloud::Get_Record(sLong Index) const
1387 {
1388 return( ((CSG_PointCloud *)this)->_Shape_Get(Index) );
1389 }
1390
1391
1393 // //
1394 // //
1395 // //
1397
1398 //---------------------------------------------------------
1399 CSG_Shape * CSG_PointCloud::Get_Shape(const CSG_Point &Point, double Epsilon)
1400 {
1401 CSG_Rect r(Point.x - Epsilon, Point.y - Epsilon, Point.x + Epsilon, Point.y + Epsilon);
1402
1403 if( r.Intersects(Get_Extent()) != INTERSECTION_None )
1404 {
1405 sLong Index = -1; double Distance = -1.;
1406
1407 for(sLong i=0; i<m_nRecords; i++)
1408 {
1409 Set_Cursor(i);
1410
1411 if( r.Contains(Get_X(), Get_Y()) )
1412 {
1413 if( Index < 0 || Distance > SG_Get_Distance(Point.x, Point.y, Get_X(), Get_Y()) )
1414 {
1415 Index = i; Distance = SG_Get_Distance(Point.x, Point.y, Get_X(), Get_Y());
1416 }
1417 }
1418 }
1419
1420 if( Index >= 0 )
1421 {
1422 return( CSG_Shapes::Get_Shape(Index) );
1423 }
1424 }
1425
1426 return( NULL );
1427 }
1428
1429 //---------------------------------------------------------
1430 CSG_Table_Record * CSG_PointCloud::Ins_Record(sLong Index, CSG_Table_Record *pCopy)
1431 {
1432 return( NULL );
1433 }
1434
1435 //---------------------------------------------------------
1436 CSG_Table_Record * CSG_PointCloud::Add_Record(CSG_Table_Record *pCopy)
1437 {
1438 return( Add_Shape(pCopy, SHAPE_COPY) );
1439 }
1440
1441 //---------------------------------------------------------
1442 CSG_Shape * CSG_PointCloud::Add_Shape(CSG_Table_Record *pCopy, TSG_ADD_Shape_Copy_Mode mCopy)
1443 {
1444 Add_Point(0., 0., 0.);
1445
1446 if( pCopy && (mCopy == SHAPE_COPY_ATTR || mCopy == SHAPE_COPY) )
1447 {
1448 for(int iField=0; iField<m_nFields && iField<pCopy->Get_Table()->Get_Field_Count(); iField++)
1449 {
1450 if( Get_Field_Type(iField) == pCopy->Get_Table()->Get_Field_Type(iField) )
1451 {
1452 if( SG_Data_Type_is_Numeric(Get_Field_Type(iField)) )
1453 {
1454 Set_Value(iField, pCopy->asDouble(iField));
1455 }
1456 else
1457 {
1458 Set_Value(iField, pCopy->asString(iField));
1459 }
1460 }
1461 }
1462 }
1463
1464 return( _Shape_Get(m_nRecords - 1) );
1465 }
1466
1467
1469 // //
1470 // //
1471 // //
1473
1474 //---------------------------------------------------------
1475 bool CSG_PointCloud::Select(sLong Index, bool bInvert)
1476 {
1477 if( !bInvert && Get_Selection_Count() > 0 )
1478 {
1479 for(sLong i=0; i<Get_Selection_Count(); i++)
1480 {
1481 m_Points[Get_Selection_Index(i)][0] &= ~SG_TABLE_REC_FLAG_Selected;
1482 }
1483
1484 m_Selection.Destroy();
1485 }
1486
1487 if( Set_Cursor(Index) )
1488 {
1489 if( (m_Cursor[0] & SG_TABLE_REC_FLAG_Selected) == 0 ) // select
1490 {
1491 if( _Add_Selection(Index) )
1492 {
1493 m_Cursor[0] |= SG_TABLE_REC_FLAG_Selected;
1494
1495 return( true );
1496 }
1497 }
1498 else // deselect
1499 {
1500 if( _Del_Selection(Index) )
1501 {
1502 m_Cursor[0] &= ~SG_TABLE_REC_FLAG_Selected;
1503
1504 return( true );
1505 }
1506 }
1507 }
1508
1509 return( false );
1510 }
1511
1512 //---------------------------------------------------------
1513 bool CSG_PointCloud::Select(CSG_Table_Record *pShape, bool bInvert)
1514 {
1515 return( CSG_Table::Select(pShape, bInvert) );
1516 }
1517
1518 //---------------------------------------------------------
1519 bool CSG_PointCloud::Select(const TSG_Rect &Extent, bool bInvert)
1520 {
1521 if( !bInvert ) // clear selection
1522 {
1523 Select(-1, false);
1524 }
1525
1526 if( Get_Extent().Intersects(Extent) != INTERSECTION_None )
1527 {
1528 for(sLong i=0; i<m_nRecords; i++)
1529 {
1530 Set_Cursor(i);
1531
1532 if( Extent.xMin <= Get_X() && Get_X() <= Extent.xMax
1533 && Extent.yMin <= Get_Y() && Get_Y() <= Extent.yMax )
1534 {
1535 Select(i, true);
1536 }
1537 }
1538 }
1539
1540 return( Get_Selection_Count() > 0 );
1541 }
1542
1543 //---------------------------------------------------------
1544 bool CSG_PointCloud::Select(const TSG_Point &Point, bool bInvert)
1545 {
1546 return( Select(CSG_Rect(Point.x, Point.y, Point.x, Point.y), bInvert) );
1547 }
1548
1549
1551 // //
1553
1554 //---------------------------------------------------------
1555 bool CSG_PointCloud::is_Selected(sLong Index) const
1556 {
1557 return( Index >= 0 && Index < m_nRecords && (m_Points[Index][0] & SG_TABLE_REC_FLAG_Selected) != 0 );
1558 }
1559
1560
1562 // //
1564
1565 //---------------------------------------------------------
1566 CSG_Shape * CSG_PointCloud::Get_Selection(sLong Index)
1567 {
1568 return( Index < Get_Selection_Count() ? _Shape_Get(Get_Selection_Index(Index)) : NULL );
1569 }
1570
1571 //---------------------------------------------------------
1572 const CSG_Rect & CSG_PointCloud::Get_Selection_Extent(void)
1573 {
1574 if( Get_Selection_Count() > 0 && Set_Cursor((int)Get_Selection_Index(0)) )
1575 {
1576 TSG_Rect r;
1577
1578 r.xMin = r.xMax = Get_X();
1579 r.yMin = r.yMax = Get_Y();
1580
1581 for(sLong i=1; i<Get_Selection_Count(); i++)
1582 {
1583 if( Set_Cursor(Get_Selection_Index(i)) )
1584 {
1585 if( Get_X() < r.xMin ) { r.xMin = Get_X(); } else if( Get_X() > r.xMax ) { r.xMax = Get_X(); }
1586 if( Get_Y() < r.yMin ) { r.yMin = Get_Y(); } else if( Get_Y() > r.yMax ) { r.yMax = Get_Y(); }
1587 }
1588 }
1589
1590 m_Extent_Selected.Assign(r);
1591 }
1592 else
1593 {
1594 m_Extent_Selected.Assign(0., 0., 0., 0.);
1595 }
1596
1597 return( m_Extent_Selected );
1598 }
1599
1600
1602 // //
1604
1605 //---------------------------------------------------------
1606 sLong CSG_PointCloud::Del_Selection(void)
1607 {
1608 sLong n = 0;
1609
1610 if( Get_Selection_Count() > 0 )
1611 {
1612 m_Selection.Set_Array(0);
1613
1614 m_Cursor = NULL;
1615
1616 for(sLong i=0; i<m_nRecords; i++)
1617 {
1618 if( (m_Points[i][0] & SG_TABLE_REC_FLAG_Selected) != 0 )
1619 {
1620 SG_Free(m_Points[i]);
1621 }
1622 else
1623 {
1624 if( n < i )
1625 {
1626 m_Points[n] = m_Points[i];
1627 }
1628
1629 n++;
1630 }
1631 }
1632
1633 m_Array_Points.Set_Array(m_nRecords = n, (void **)&m_Points);
1634
1635 Set_Modified();
1636 Set_Update_Flag();
1637 _Stats_Invalidate();
1638 }
1639
1640 return( n );
1641 }
1642
1643 //---------------------------------------------------------
1644 sLong CSG_PointCloud::Inv_Selection(void)
1645 {
1646 if( m_Selection.Set_Array(m_nRecords - Get_Selection_Count()) )
1647 {
1648 char **pPoint = m_Points;
1649
1650 for(sLong i=0, n=0; i<m_nRecords && n<Get_Selection_Count(); i++, pPoint++)
1651 {
1652 if( ((*pPoint)[0] & SG_TABLE_REC_FLAG_Selected) != 0 )
1653 {
1654 (*pPoint)[0] &= ~SG_TABLE_REC_FLAG_Selected;
1655 }
1656 else
1657 {
1658 (*pPoint)[0] |= SG_TABLE_REC_FLAG_Selected;
1659
1660 _Set_Selection(i, n++);
1661 }
1662 }
1663 }
1664
1665 return( Get_Selection_Count() );
1666 }
1667
1668
1670 // //
1671 // //
1672 // //
1674
1675 //---------------------------------------------------------
CSG_PointCloud::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: pointcloud.cpp:1436
CSG_Rect
Definition: geo_tools.h:471
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
SHAPE_COPY_ATTR
@ SHAPE_COPY_ATTR
Definition: shapes.h:127
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_PointCloud::Get_Y
double Get_Y(void) const
Definition: pointcloud.h:166
CSG_PointCloud::Get_X
double Get_X(void) const
Definition: pointcloud.h:165
CSG_Shapes::m_Extent_Selected
CSG_Rect m_Extent_Selected
Definition: shapes.h:849
CSG_Shapes::m_ZMin
double m_ZMin
Definition: shapes.h:843
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_PointCloud::Destroy
virtual bool Destroy(void)
Definition: pointcloud.cpp:217
CSG_File_Zip::Get_File
bool Get_File(const CSG_String &Name)
Definition: api_file.cpp:690
CSG_Data_Object::Get_Max_Samples
sLong Get_Max_Samples(void) const
Definition: dataobject.h:254
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Table::Set_Count
virtual bool Set_Count(sLong nRecords)
Definition: table.cpp:930
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
PC_STR_NBYTES
#define PC_STR_NBYTES
Definition: pointcloud.cpp:63
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
POINTCLOUD_FILE_FORMAT_Normal
@ POINTCLOUD_FILE_FORMAT_Normal
Definition: pointcloud.h:91
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_PointCloud::Set_Point
virtual bool Set_Point(const TSG_Point_3D &Point)
Definition: pointcloud.cpp:1064
CSG_PointCloud::Set_Field_Type
virtual bool Set_Field_Type(int Field, TSG_Data_Type Type)
Definition: pointcloud.cpp:862
CSG_Table_Record
Definition: table.h:130
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
CSG_Table_Record::Set_Selected
void Set_Selected(bool bOn=true)
Definition: table_record.cpp:204
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
SG_Create_PointCloud
CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_Table::m_Selection
CSG_Array m_Selection
Definition: table.h:452
CSG_Table::Del_Field
virtual bool Del_Field(int iField)
Definition: table.cpp:526
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
m_Field_Size
#define m_Field_Size(FIELD)
SG_TABLE_REC_FLAG_Selected
#define SG_TABLE_REC_FLAG_Selected
Definition: table.h:119
CSG_Table::m_Field_Name
CSG_String ** m_Field_Name
Definition: table.h:448
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_PointCloud::Get_Selection_Extent
virtual const CSG_Rect & Get_Selection_Extent(void)
Definition: pointcloud.cpp:1572
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Shapes::m_ZMax
double m_ZMax
Definition: shapes.h:843
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_PointCloud::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: pointcloud.cpp:1475
CSG_PointCloud::On_Reload
virtual bool On_Reload(void)
Definition: pointcloud.cpp:1299
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
CSG_Simple_Statistics::Evaluate
bool Evaluate(void)
Definition: mat_tools.cpp:473
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Data_Object::Get_ObjectType
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.
SHAPE_COPY
@ SHAPE_COPY
Definition: shapes.h:128
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:454
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
CSG_PointCloud::Assign
virtual bool Assign(CSG_Data_Object *pSource)
Definition: pointcloud.cpp:598
SSG_Point
Definition: geo_tools.h:128
CSG_Table_Record::Get_Table
class CSG_Table * Get_Table(void)
Definition: table.h:135
CSG_PointCloud::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Field=-1)
Definition: pointcloud.cpp:665
CSG_Table_Record::m_Index
sLong m_Index
Definition: table.h:254
PC_GET_NBYTES
#define PC_GET_NBYTES(type)
Definition: pointcloud.cpp:66
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
CSG_File
Definition: api_core.h:1116
CSG_Table::_Stats_Invalidate
bool _Stats_Invalidate(void) const
Definition: table.cpp:1204
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
CSG_Table::m_Field_Type
TSG_Data_Type * m_Field_Type
Definition: table.h:446
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_PointCloud::Set_Value
virtual bool Set_Value(int Field, double Value)
Definition: pointcloud.h:163
CSG_PointCloud::is_Compatible
bool is_Compatible(CSG_PointCloud *pPointCloud) const
Definition: pointcloud.cpp:639
CSG_PointCloud::Del_Selection
virtual sLong Del_Selection(void)
Definition: pointcloud.cpp:1606
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
CSG_PointCloud::~CSG_PointCloud
virtual ~CSG_PointCloud(void)
Definition: pointcloud.cpp:212
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
CSG_Table::m_Field_Stats
CSG_Simple_Statistics ** m_Field_Stats
Definition: table.h:450
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_PointCloud::Del_Points
bool Del_Points(void)
Definition: pointcloud.cpp:1146
CSG_PointCloud::Del_Point
bool Del_Point(sLong Index)
Definition: pointcloud.cpp:1113
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Table::Get_Selection_Count
sLong Get_Selection_Count(void) const
Definition: table.h:413
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
CSG_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:291
CSG_PointCloud::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: pointcloud.cpp:1386
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Table::_Set_Selection
bool _Set_Selection(sLong Index, sLong Selected)
Definition: table_selection.cpp:74
CSG_PointCloud::Get_Value
virtual double Get_Value(int Field) const
Definition: pointcloud.h:164
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
CSG_PointCloud::_Stats_Update
virtual bool _Stats_Update(int Field) const
Definition: pointcloud.cpp:1241
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_PointCloud::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: pointcloud.h:128
sLong
signed long long sLong
Definition: api_core.h:158
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
SG_Data_Type_is_Numeric
bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
Definition: api_core.cpp:197
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_OMP_Get_Max_Num_Procs
int SG_OMP_Get_Max_Num_Procs(void)
Definition: api_core.cpp:110
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
CSG_PointCloud::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: pointcloud.cpp:1399
CSG_PointCloud::Del_Field
virtual bool Del_Field(int Field)
Definition: pointcloud.cpp:752
CSG_Simple_Statistics::is_Evaluated
int is_Evaluated(void) const
Definition: mat_tools.h:724
SG_UI_Progress_Lock
int SG_UI_Progress_Lock(bool bOn)
Definition: api_callback.cpp:176
CSG_Table::Get_Maximum
double Get_Maximum(int iField) const
Definition: table.h:369
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_PointCloud::Get_Header_Content
static bool Get_Header_Content(const CSG_String &FileName, CSG_MetaData &Header)
Definition: pointcloud.cpp:416
CSG_PointCloud::Inv_Selection
virtual sLong Inv_Selection(void)
Definition: pointcloud.cpp:1644
pointcloud.h
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_PointCloud::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: pointcloud.h:197
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Table_Record::Set_Modified
void Set_Modified(bool bOn=true)
Definition: table_record.cpp:220
CSG_Simple_Statistics::Set_Count
bool Set_Count(sLong Count)
Definition: mat_tools.cpp:424
CSG_PointCloud::Set_Cursor
bool Set_Cursor(sLong Index)
Definition: pointcloud.h:162
CSG_PointCloud::is_Selected
virtual bool is_Selected(sLong Index) const
Definition: pointcloud.cpp:1555
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table::_Del_Selection
bool _Del_Selection(sLong Index)
Definition: table_selection.cpp:87
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
CSG_Table::_Add_Selection
bool _Add_Selection(sLong Index)
Definition: table_selection.cpp:63
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_PointCloud::Mov_Field
virtual bool Mov_Field(int Field, int Position)
Definition: pointcloud.cpp:807
CSG_PointCloud::Create
bool Create(void)
Definition: pointcloud.cpp:117
CSG_PointCloud::On_Update
virtual bool On_Update(void)
Definition: pointcloud.cpp:1213
CSG_String
Definition: api_core.h:557
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shape::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)=0
CSG_MetaData
Definition: metadata.h:88
POINTCLOUD_FILE_FORMAT_Compressed
@ POINTCLOUD_FILE_FORMAT_Compressed
Definition: pointcloud.h:92
CSG_Table::Get_Minimum
double Get_Minimum(int iField) const
Definition: table.h:368
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_PointCloud::Get_Point
TSG_Point_3D Get_Point(void) const
Definition: pointcloud.cpp:1024
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
POINTCLOUD_FILE_FORMAT_Undefined
@ POINTCLOUD_FILE_FORMAT_Undefined
Definition: pointcloud.h:90
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
SG_OMP_Get_Thread_Num
int SG_OMP_Get_Thread_Num(void)
Definition: api_core.cpp:111
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Table::Get_Selection_Index
sLong Get_Selection_Index(sLong Index=0) const
Definition: table.h:414
CSG_Table::m_nFields
int m_nFields
Definition: table.h:442
CSG_PointCloud::CSG_PointCloud
CSG_PointCloud(void)
Definition: pointcloud.cpp:109
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_PointCloud::_On_Construction
virtual void _On_Construction(void)
Definition: pointcloud.cpp:179
CSG_PointCloud::Get_Selection
virtual CSG_Shape * Get_Selection(sLong Index=0)
Definition: pointcloud.cpp:1566
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_PointCloud
Definition: pointcloud.h:105
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_File_Zip::Add_File
bool Add_File(const CSG_String &Name, bool bBinary=true)
Definition: api_file.cpp:639
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
CSG_PointCloud::On_Delete
virtual bool On_Delete(void)
Definition: pointcloud.cpp:1305
CSG_PointCloud::Add_Point
bool Add_Point(double x, double y, double z)
Definition: pointcloud.cpp:1094
CSG_Simple_Statistics
Definition: mat_tools.h:708
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Shape
Definition: shapes.h:141
CSG_Table::Set_Field_Type
virtual bool Set_Field_Type(int iField, TSG_Data_Type Type)
Definition: table.cpp:632
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Table_Record::is_Modified
bool is_Modified(void) const
Definition: table.h:243
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_PointCloud::Ins_Record
virtual CSG_Table_Record * Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL)
Definition: pointcloud.cpp:1430
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
CSG_PointCloud::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: pointcloud.cpp:322
CSG_File_Zip
Definition: api_core.h:1188
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_File::Tell
sLong Tell(void) const
Definition: api_file.cpp:255
PC_FILE_VERSION
#define PC_FILE_VERSION
Definition: pointcloud.cpp:61
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_PointCloud::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: pointcloud.cpp:1442
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: pointcloud.h File Reference

  • saga_core
  • saga_api
Classes | Enumerations | Functions
pointcloud.h File Reference
#include "shapes.h"

Go to the source code of this file.

Classes

class CSG_PointCloud

Enumerations

enum TSG_PointCloud_File_Type { POINTCLOUD_FILE_FORMAT_Undefined = 0, POINTCLOUD_FILE_FORMAT_Normal, POINTCLOUD_FILE_FORMAT_Compressed }

Functions

SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (void)
SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (const CSG_PointCloud &PointCloud)
SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (const char *File)
SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (const wchar_t *File)
SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (const CSG_String &File)
SAGA_API_DLL_EXPORT CSG_PointCloud * | SG_Create_PointCloud (CSG_PointCloud *pStructure)

Detailed Description

The point cloud data container, a specialized CSG_Shapes class.

See also
CSG_PointCloud
CSG_Shapes
CSG_Table
CSG_Data_Object

Definition in file pointcloud.h.

Enumeration Type Documentation

◆ TSG_PointCloud_File_Type

enum TSG_PointCloud_File_Type
Enumerator
POINTCLOUD_FILE_FORMAT_Undefined
POINTCLOUD_FILE_FORMAT_Normal
POINTCLOUD_FILE_FORMAT_Compressed

Definition at line 88 of file pointcloud.h.

Function Documentation

◆ SG_Create_PointCloud() [1/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( const char * File )

Safe Point Cloud construction

Definition at line 88 of file pointcloud.cpp.

References SG_Create_PointCloud().

◆ SG_Create_PointCloud() [2/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( const CSG_PointCloud & PointCloud )

Safe Point Cloud construction

Definition at line 82 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [3/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( const CSG_String & File )

Safe Point Cloud construction

Definition at line 90 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [4/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( const wchar_t * File )

Safe Point Cloud construction

Definition at line 89 of file pointcloud.cpp.

References SG_Create_PointCloud().

◆ SG_Create_PointCloud() [5/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( CSG_PointCloud * pStructure )

Safe Point Cloud construction

Definition at line 96 of file pointcloud.cpp.

◆ SG_Create_PointCloud() [6/6]

SAGA_API_DLL_EXPORT CSG_PointCloud* SG_Create_PointCloud ( void )

Safe Point Cloud construction

Definition at line 76 of file pointcloud.cpp.

Referenced by SG_Create_PointCloud(), and SG_Create_Shapes().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: pointcloud.h Source File

  • saga_core
  • saga_api
pointcloud.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // pointcloud.h //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__pointcloud_H
52 #define HEADER_INCLUDED__SAGA_API__pointcloud_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
71 // //
73 // //
74 // //
76
77 //---------------------------------------------------------
78 #include "shapes.h"
79
80
82 // //
83 // //
84 // //
86
87 //---------------------------------------------------------
88 typedef enum
89 {
90 POINTCLOUD_FILE_FORMAT_Undefined = 0,
91 POINTCLOUD_FILE_FORMAT_Normal,
92 POINTCLOUD_FILE_FORMAT_Compressed
93 }
94 TSG_PointCloud_File_Type;
95
96
98 // //
99 // //
100 // //
102
103 //---------------------------------------------------------
104 class SAGA_API_DLL_EXPORT CSG_PointCloud : public CSG_Shapes
105 {
106 public:
107
108 CSG_PointCloud (void);
109 bool Create (void);
110
111 CSG_PointCloud (const CSG_PointCloud &PointCloud);
112 bool Create (const CSG_PointCloud &PointCloud);
113
114 CSG_PointCloud (const CSG_String &File);
115 bool Create (const CSG_String &File);
116 CSG_PointCloud (const char *File);
117 bool Create (const char *File);
118 CSG_PointCloud (const wchar_t *File);
119 bool Create (const wchar_t *File);
120
121 CSG_PointCloud (CSG_PointCloud *pTemplate);
122 bool Create (CSG_PointCloud *pTemplate);
123
124 virtual ~CSG_PointCloud(void);
125
126 virtual bool Destroy (void);
127
128 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_PointCloud ); }
129
130 virtual bool Assign (CSG_Data_Object *pSource);
131
132 virtual bool Save (const CSG_String &File, int Format = 0);
133 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
134 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
135
136 void Set_XYZ_Precision (bool bDouble) { m_bXYZPrecDbl = bDouble; }
137
138 static bool Get_Header_Content (const CSG_String &FileName, CSG_MetaData &Header);
139
140 //-----------------------------------------------------
141 virtual bool is_Valid (void) const { return( m_nFields > 0 ); }
142 bool is_Compatible (CSG_PointCloud *pPointCloud) const;
143
144 //-----------------------------------------------------
145 virtual bool Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Field = -1);
146 virtual bool Del_Field (int Field);
147 virtual bool Mov_Field (int Field, int Position);
148
149 virtual bool Set_Field_Type (int Field, TSG_Data_Type Type);
150
151 //-----------------------------------------------------
152 int Get_Attribute_Count (void) const { return( m_nFields - 3 ); }
153 const SG_Char * Get_Attribute_Name (int Field) const { Field += 3; return( Field >= 3 && Field < m_nFields ? m_Field_Name[Field]->c_str() : NULL ); }
154 TSG_Data_Type Get_Attribute_Type (int Field) const { Field += 3; return( Field >= 3 && Field < m_nFields ? m_Field_Type[Field] : SG_DATATYPE_Undefined ); }
155
156 //-----------------------------------------------------
157 bool Add_Point (double x, double y, double z);
158 bool Del_Point (sLong Index);
159 bool Del_Points (void);
160
161 //-----------------------------------------------------
162 bool Set_Cursor (sLong Index) { return( (m_Cursor = Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL) != NULL ); }
163 virtual bool Set_Value ( int Field, double Value) { return( _Set_Field_Value(m_Cursor, Field, Value) ); }
164 virtual double Get_Value ( int Field) const { return( _Get_Field_Value(m_Cursor, Field) ); }
165 double Get_X (void) const { return( _Get_Field_Value(m_Cursor, 0) ); }
166 double Get_Y (void) const { return( _Get_Field_Value(m_Cursor, 1) ); }
167 double Get_Z (void) const { return( _Get_Field_Value(m_Cursor, 2) ); }
168 bool Set_Attribute ( int Field, double Value) { return( Set_Value(Field + 3, Value) ); }
169 double Get_Attribute ( int Field) const { return( Get_Value(Field + 3) ); }
170 bool Set_NoData ( int Field) { return( Set_Value(Field, Get_NoData_Value()) ); }
171 bool is_NoData ( int Field) const { return( is_NoData_Value(Get_Value(Field)) ); }
172
173 virtual bool Set_Value (sLong Index, int Field, double Value) { return( _Set_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, Field, Value) ); }
174 virtual double Get_Value (sLong Index, int Field) const { return( _Get_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, Field) ); }
175 double Get_X (sLong Index) const { return( _Get_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, 0) ); }
176 double Get_Y (sLong Index) const { return( _Get_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, 1) ); }
177 double Get_Z (sLong Index) const { return( _Get_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, 2) ); }
178 bool Set_Attribute (sLong Index, int Field, double Value) { return( Set_Value(Index, Field + 3, Value) ); }
179 double Get_Attribute (sLong Index, int Field) const { return( Get_Value(Index, Field + 3) ); }
180 bool Set_NoData (sLong Index, int Field) { return( Set_Value(Index, Field, Get_NoData_Value()) );}
181 bool is_NoData (sLong Index, int Field) const { return( is_NoData_Value(Get_Value(Index, Field)) ); }
182
183 virtual bool Set_Value ( int Field, const SG_Char *Value) { return( _Set_Field_Value(m_Cursor, Field, Value) ); }
184 virtual bool Get_Value ( int Field, CSG_String &Value) const { return( _Get_Field_Value(m_Cursor, Field, Value) ); }
185 virtual bool Set_Value (sLong Index, int Field, const SG_Char *Value) { return( _Set_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, Field, Value) ); }
186 virtual bool Get_Value (sLong Index, int Field, CSG_String &Value) const { return( _Get_Field_Value(Index >= 0 && Index < m_nRecords ? m_Points[Index] : NULL, Field, Value) ); }
187 virtual bool Set_Attribute ( int Field, const SG_Char *Value) { return( Set_Value(Field + 3, Value) ); }
188 virtual bool Get_Attribute ( int Field, CSG_String &Value) const { return( Get_Value(Field + 3, Value) ); }
189 virtual bool Set_Attribute (sLong Index, int Field, const SG_Char *Value) { return( Set_Value(Index, Field + 3, Value) ); }
190 virtual bool Get_Attribute (sLong Index, int Field, CSG_String &Value) const { return( Get_Value(Index, Field + 3, Value) ); }
191
192 TSG_Point_3D Get_Point (void) const;
193 TSG_Point_3D Get_Point (sLong Index) const;
194 virtual bool Set_Point ( const TSG_Point_3D &Point);
195 virtual bool Set_Point (sLong Index, const TSG_Point_3D &Point);
196
197 virtual void Set_Modified (bool bModified = true) { CSG_Data_Object::Set_Modified(bModified); }
198
199
200 //-----------------------------------------------------
201 // Overrides: CSG_Table, CSG_Shapes
202
203 virtual CSG_Table_Record * Get_Record (sLong Index) const;
204
205 virtual CSG_Shape * Get_Shape (const CSG_Point &Point, double Epsilon = 0.);
206
207 virtual bool Del_Record (sLong Index) { return( Del_Point(Index) ); }
208 virtual bool Del_Shape (sLong Index) { return( Del_Point(Index) ); }
209 virtual bool Del_Records (void) { return( Del_Points() ); }
210 virtual bool Del_Shapes (void) { return( Del_Points() ); }
211
212 virtual CSG_Table_Record * Ins_Record (sLong Index, CSG_Table_Record *pCopy = NULL);
213 virtual CSG_Table_Record * Add_Record ( CSG_Table_Record *pCopy = NULL);
214 virtual CSG_Shape * Add_Shape ( CSG_Table_Record *pCopy = NULL, TSG_ADD_Shape_Copy_Mode mCopy = SHAPE_COPY);
215 virtual bool Del_Shape (CSG_Shape *pShape) { return( false ); }
216
217 virtual bool Select (sLong Index , bool bInvert = false);
218 virtual bool Select (CSG_Table_Record *pShape = NULL, bool bInvert = false);
219 virtual bool Select (const TSG_Rect &Extent , bool bInvert = false);
220 virtual bool Select (const TSG_Point &Point , bool bInvert = false);
221
222 virtual bool is_Selected (sLong Index) const;
223
224 virtual sLong Del_Selection (void);
225 virtual sLong Inv_Selection (void);
226 virtual CSG_Shape * Get_Selection (sLong Index = 0);
227 virtual const CSG_Rect & Get_Selection_Extent(void);
228
229
230 protected:
231
232 virtual bool On_Update (void);
233 virtual bool On_Reload (void);
234 virtual bool On_Delete (void);
235
236 virtual void _On_Construction (void);
237
238 virtual bool _Stats_Update (int Field) const;
239
240
241 private:
242
243 bool m_bXYZPrecDbl;
244
245 char **m_Points, *m_Cursor;
246
247 int m_nPointBytes, *m_Field_Offset;
248
249 CSG_Array m_Array_Points;
250
251 CSG_Shapes m_Shapes;
252
253
254 bool _Load (const CSG_String &File);
255 bool _Load (CSG_File &Stream);
256 bool _Save (CSG_File &Stream);
257 CSG_MetaData _Create_Header (void) const;
258
259 bool _Add_Field (const SG_Char *Name, TSG_Data_Type Type, int Field = -1);
260 bool _Set_Field_Value (char *pPoint, int Field, double Value);
261 double _Get_Field_Value (char *pPoint, int Field ) const;
262 bool _Set_Field_Value (char *pPoint, int Field, const SG_Char *Value);
263 bool _Get_Field_Value (char *pPoint, int Field, CSG_String &Value) const;
264
265 bool _Inc_Array (void);
266 bool _Dec_Array (void);
267
268 CSG_Shape * _Shape_Get (sLong Index);
269 void _Shape_Flush (void);
270
271 };
272
273
275 // //
276 // //
277 // //
279
280 //---------------------------------------------------------
282 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (void);
283
285 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (const CSG_PointCloud &PointCloud);
286
288 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (const char *File);
290 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (const wchar_t *File);
292 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (const CSG_String &File);
293
295 SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud (CSG_PointCloud *pStructure);
296
298 // //
299 // //
300 // //
302
303 //---------------------------------------------------------
304 #endif // #ifndef HEADER_INCLUDED__SAGA_API__pointcloud_H
CSG_Rect
Definition: geo_tools.h:471
CSG_Shapes::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: shapes.cpp:360
CSG_PointCloud::Get_X
double Get_X(sLong Index) const
Definition: pointcloud.h:175
CSG_PointCloud::Get_Y
double Get_Y(void) const
Definition: pointcloud.h:166
CSG_PointCloud::Get_X
double Get_X(void) const
Definition: pointcloud.h:165
CSG_Shapes::On_Delete
virtual bool On_Delete(void)
Definition: shapes_io.cpp:72
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_PointCloud::Set_Value
virtual bool Set_Value(sLong Index, int Field, double Value)
Definition: pointcloud.h:173
TSG_PointCloud_File_Type
TSG_PointCloud_File_Type
Definition: pointcloud.h:89
CSG_PointCloud::Del_Shapes
virtual bool Del_Shapes(void)
Definition: pointcloud.h:210
CSG_PointCloud::Set_Attribute
bool Set_Attribute(sLong Index, int Field, double Value)
Definition: pointcloud.h:178
POINTCLOUD_FILE_FORMAT_Normal
@ POINTCLOUD_FILE_FORMAT_Normal
Definition: pointcloud.h:91
CSG_PointCloud::Get_Z
double Get_Z(sLong Index) const
Definition: pointcloud.h:177
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Shapes::Get_Selection
virtual CSG_Shape * Get_Selection(sLong Index=0)
Definition: shapes.h:833
CSG_Shapes::On_Reload
virtual bool On_Reload(void)
Definition: shapes_io.cpp:66
CSG_Table_Record
Definition: table.h:130
CSG_Table::_Stats_Update
virtual bool _Stats_Update(int iField) const
Definition: table.cpp:1228
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_PointCloud::Del_Shape
virtual bool Del_Shape(CSG_Shape *pShape)
Definition: pointcloud.h:215
CSG_Table::Inv_Selection
virtual sLong Inv_Selection(void)
Definition: table_selection.cpp:203
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
SG_Create_PointCloud
SAGA_API_DLL_EXPORT CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
CSG_PointCloud::Get_Attribute_Type
TSG_Data_Type Get_Attribute_Type(int Field) const
Definition: pointcloud.h:154
CSG_Table::Get_Value
virtual bool Get_Value(sLong Index, int iField, CSG_String &Value) const
Definition: table.cpp:1161
CSG_PointCloud::Get_Attribute
double Get_Attribute(int Field) const
Definition: pointcloud.h:169
CSG_Table::is_Selected
virtual bool is_Selected(sLong Index) const
Definition: table.h:417
CSG_Table::Del_Field
virtual bool Del_Field(int iField)
Definition: table.cpp:526
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_PointCloud::Get_Value
virtual double Get_Value(sLong Index, int Field) const
Definition: pointcloud.h:174
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
CSG_PointCloud::Set_XYZ_Precision
void Set_XYZ_Precision(bool bDouble)
Definition: pointcloud.h:136
SSG_Point_3D
Definition: geo_tools.h:264
CSG_PointCloud::Set_Value
virtual bool Set_Value(int Field, const SG_Char *Value)
Definition: pointcloud.h:183
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
CSG_PointCloud::Get_Value
virtual bool Get_Value(sLong Index, int Field, CSG_String &Value) const
Definition: pointcloud.h:186
CSG_Shapes::_On_Construction
virtual void _On_Construction(void)
Definition: shapes.cpp:188
SHAPE_COPY
@ SHAPE_COPY
Definition: shapes.h:128
CSG_PointCloud::Get_Value
virtual bool Get_Value(int Field, CSG_String &Value) const
Definition: pointcloud.h:184
SSG_Point
Definition: geo_tools.h:128
CSG_File
Definition: api_core.h:1116
CSG_PointCloud::Get_Attribute_Count
int Get_Attribute_Count(void) const
Definition: pointcloud.h:152
CSG_PointCloud::Set_Attribute
virtual bool Set_Attribute(int Field, const SG_Char *Value)
Definition: pointcloud.h:187
SSG_Rect
Definition: geo_tools.h:464
CSG_PointCloud::Set_Value
virtual bool Set_Value(int Field, double Value)
Definition: pointcloud.h:163
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
CSG_Table::is_Compatible
bool is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const
Definition: table.cpp:436
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Shapes::Get_Selection_Extent
virtual const CSG_Rect & Get_Selection_Extent(void)
Definition: shapes_selection.cpp:118
CSG_PointCloud::Get_Attribute
virtual bool Get_Attribute(int Field, CSG_String &Value) const
Definition: pointcloud.h:188
CSG_Shapes::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: shapes.cpp:432
CSG_PointCloud::Get_Value
virtual double Get_Value(int Field) const
Definition: pointcloud.h:164
CSG_PointCloud::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: pointcloud.h:128
sLong
signed long long sLong
Definition: api_core.h:158
CSG_PointCloud::Get_Z
double Get_Z(void) const
Definition: pointcloud.h:167
CSG_PointCloud::Get_Attribute
double Get_Attribute(sLong Index, int Field) const
Definition: pointcloud.h:179
CSG_PointCloud::Save
virtual bool Save(const char *File, int Format=0)
Definition: pointcloud.h:133
CSG_Table::Mov_Field
virtual bool Mov_Field(int iField, int Position)
Definition: table.cpp:564
CSG_PointCloud::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: pointcloud.h:134
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
CSG_Table::Set_Value
virtual bool Set_Value(sLong Index, int iField, const SG_Char *Value)
Definition: table.cpp:1135
CSG_PointCloud::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: pointcloud.h:197
CSG_PointCloud::Set_Attribute
virtual bool Set_Attribute(sLong Index, int Field, const SG_Char *Value)
Definition: pointcloud.h:189
CSG_PointCloud::is_Valid
virtual bool is_Valid(void) const
Definition: pointcloud.h:141
CSG_PointCloud::Set_NoData
bool Set_NoData(int Field)
Definition: pointcloud.h:170
CSG_PointCloud::Set_Cursor
bool Set_Cursor(sLong Index)
Definition: pointcloud.h:162
CSG_PointCloud::Del_Records
virtual bool Del_Records(void)
Definition: pointcloud.h:209
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_PointCloud::Set_Attribute
bool Set_Attribute(int Field, double Value)
Definition: pointcloud.h:168
CSG_PointCloud::is_NoData
bool is_NoData(int Field) const
Definition: pointcloud.h:171
CSG_PointCloud::is_NoData
bool is_NoData(sLong Index, int Field) const
Definition: pointcloud.h:181
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Array
Definition: api_core.h:308
shapes.h
CSG_String
Definition: api_core.h:557
CSG_MetaData
Definition: metadata.h:88
CSG_PointCloud::Set_Value
virtual bool Set_Value(sLong Index, int Field, const SG_Char *Value)
Definition: pointcloud.h:185
POINTCLOUD_FILE_FORMAT_Compressed
@ POINTCLOUD_FILE_FORMAT_Compressed
Definition: pointcloud.h:92
CSG_Shapes::Destroy
virtual bool Destroy(void)
Definition: shapes.cpp:347
POINTCLOUD_FILE_FORMAT_Undefined
@ POINTCLOUD_FILE_FORMAT_Undefined
Definition: pointcloud.h:90
CSG_PointCloud::Get_Y
double Get_Y(sLong Index) const
Definition: pointcloud.h:176
CSG_Table::Ins_Record
virtual CSG_Table_Record * Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:805
CSG_Shapes
Definition: shapes.h:773
CSG_PointCloud
Definition: pointcloud.h:105
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_PointCloud::Get_Attribute_Name
const SG_Char * Get_Attribute_Name(int Field) const
Definition: pointcloud.h:153
CSG_Shapes::On_Update
virtual bool On_Update(void)
Definition: shapes.cpp:536
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_PointCloud::Set_NoData
bool Set_NoData(sLong Index, int Field)
Definition: pointcloud.h:180
CSG_Table::Del_Selection
virtual sLong Del_Selection(void)
Definition: table_selection.cpp:178
CSG_PointCloud::Del_Shape
virtual bool Del_Shape(sLong Index)
Definition: pointcloud.h:208
CSG_Shape
Definition: shapes.h:141
CSG_Shapes::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: shapes_selection.cpp:63
CSG_Table::Set_Field_Type
virtual bool Set_Field_Type(int iField, TSG_Data_Type Type)
Definition: table.cpp:632
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_PointCloud::Get_Attribute
virtual bool Get_Attribute(sLong Index, int Field, CSG_String &Value) const
Definition: pointcloud.h:190
CSG_PointCloud::Del_Record
virtual bool Del_Record(sLong Index)
Definition: pointcloud.h:207
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: projections.cpp File Reference

  • saga_core
  • saga_api
Macros | Enumerations | Functions | Variables
projections.cpp File Reference
#include "geo_tools.h"
#include "table.h"
#include "shapes.h"
#include "tool_library.h"

Go to the source code of this file.

Macros

#define | WKT_GCS_WGS84
#define | PROJ4_GCS_WGS84 "+proj=longlat +datum=WGS84 +no_defs"
#define | GET_DATUM(d, p)

Enumerations

enum ESG_PROJ_FIELD_ID {
PRJ_FIELD_SRID = 0, PRJ_FIELD_AUTH_NAME, PRJ_FIELD_AUTH_SRID, PRJ_FIELD_SRTEXT,
PRJ_FIELD_PROJ4TEXT
}

Functions

CSG_Projections & | SG_Get_Projections (void)
TSG_Projection_Type | SG_Get_Projection_Type (const CSG_String &Identifier)
CSG_String | SG_Get_Projection_Type_Identifier (TSG_Projection_Type Type)
CSG_String | SG_Get_Projection_Type_Name (TSG_Projection_Type Type)
TSG_Projection_Unit | SG_Get_Projection_Unit (const CSG_String &Identifier)
CSG_String | SG_Get_Projection_Unit_Identifier (TSG_Projection_Unit Unit)
CSG_String | SG_Get_Projection_Unit_Name (TSG_Projection_Unit Unit, bool bSimple)
double | SG_Get_Projection_Unit_To_Meter (TSG_Projection_Unit Unit)
bool | SG_Set_Projection_Unit (const CSG_MetaData &m, TSG_Projection_Unit &Unit, CSG_String &Name, double &To_Meter)
bool | SG_Get_Projected (CSG_Shapes *pSource, CSG_Shapes *pTarget, const CSG_Projection &Target)
bool | SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point)
bool | SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle)
bool | SG_Grid_Get_Geographic_Coordinates (CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)

Variables

CSG_Projections gSG_Projections
const char SG_Projection_Units [SG_PROJ_UNIT_Undefined+1][3][32]

Macro Definition Documentation

◆ GET_DATUM

#define GET_DATUM | ( | d,
 |  | p
 | ) |
Value:
{ CSG_String s; CSG_Projections::_Proj4_Get_Datum(s, p); d.Clear();\
for(int i=0, add=1; i<s.Length(); i++) {\
if( s[i] == '\"' ) { add = add ? 0 : 1; } else if( add ) { d += s[i]; }\
}\
}

◆ PROJ4_GCS_WGS84

#define PROJ4_GCS_WGS84 "+proj=longlat +datum=WGS84 +no_defs"

Definition at line 506 of file projections.cpp.

◆ WKT_GCS_WGS84

#define WKT_GCS_WGS84
Value:
"GEOGCS[\"WGS 84\",AUTHORITY[\"EPSG\",\"4326\"]],"\
"DATUM[\"WGS_1984\",AUTHORITY[\"EPSG\",\"6326\"]],"\
"SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"\
"PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"\
"UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]"

Definition at line 499 of file projections.cpp.

Enumeration Type Documentation

◆ ESG_PROJ_FIELD_ID

enum ESG_PROJ_FIELD_ID
Enumerator
PRJ_FIELD_SRID
PRJ_FIELD_AUTH_NAME
PRJ_FIELD_AUTH_SRID
PRJ_FIELD_SRTEXT
PRJ_FIELD_PROJ4TEXT

Definition at line 693 of file projections.cpp.

Function Documentation

◆ SG_Get_Projected() [1/3]

bool SG_Get_Projected | ( | const CSG_Projection & | Source,
 |  | const CSG_Projection & | Target,
 |  | TSG_Point & | Point
 | ) |  |

Definition at line 2233 of file projections.cpp.

References CSG_Parameter::asDouble(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Delete_Tool(), CSG_Tool::Execute(), CSG_Tool::Get_Parameter(), CSG_Projection::Get_Proj4(), CSG_Projection::is_Okay(), CSG_Tool::Set_Manager(), CSG_Tool::Set_Parameter(), SG_Get_Tool_Library_Manager(), SG_UI_ProgressAndMsg_Lock(), SSG_Point::x, and SSG_Point::y.

◆ SG_Get_Projected() [2/3]

bool SG_Get_Projected | ( | const CSG_Projection & | Source,
 |  | const CSG_Projection & | Target,
 |  | TSG_Rect & | Rectangle
 | ) |  |

Definition at line 2270 of file projections.cpp.

References CSG_Shape::Add_Point(), CSG_Shapes::Add_Shape(), CSG_Projection::Create(), CSG_Shapes::Create(), CSG_Shapes::Get_Extent(), CSG_Data_Object::Get_Projection(), CSG_Projection::is_Okay(), SG_Get_Projected(), SHAPE_TYPE_Point, SSG_Rect::xMax, SSG_Rect::xMin, SSG_Rect::yMax, and SSG_Rect::yMin.

◆ SG_Get_Projected() [3/3]

bool SG_Get_Projected | ( | CSG_Shapes * | pSource,
 |  | CSG_Shapes * | pTarget,
 |  | const CSG_Projection & | Target
 | ) |  |

Definition at line 2191 of file projections.cpp.

References CSG_Shapes::Create(), CSG_Tool_Library_Manager::Create_Tool(), CSG_Tool_Library_Manager::Delete_Tool(), CSG_Tool::Execute(), CSG_Projection::Get_Proj4(), CSG_Data_Object::Get_Projection(), CSG_Projection::is_Okay(), CSG_Shapes::is_Valid(), CSG_Tool::Set_Manager(), CSG_Tool::Set_Parameter(), SG_Get_Tool_Library_Manager(), and SG_UI_ProgressAndMsg_Lock().

Referenced by SG_Get_Projected().

◆ SG_Get_Projection_Type()

TSG_Projection_Type SG_Get_Projection_Type ( const CSG_String & Identifier )

Definition at line 77 of file projections.cpp.

References CSG_String::CmpNoCase(), SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, SG_PROJ_TYPE_CS_Projected, and SG_PROJ_TYPE_CS_Undefined.

Referenced by CSG_Projection::Assign().

◆ SG_Get_Projection_Type_Identifier()

CSG_String SG_Get_Projection_Type_Identifier ( TSG_Projection_Type Type )

Definition at line 87 of file projections.cpp.

References SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, and SG_PROJ_TYPE_CS_Projected.

Referenced by CSG_Projection::Get_Type_Identifier().

◆ SG_Get_Projection_Type_Name()

CSG_String SG_Get_Projection_Type_Name ( TSG_Projection_Type Type )

Definition at line 99 of file projections.cpp.

References _TL, SG_PROJ_TYPE_CS_Geocentric, SG_PROJ_TYPE_CS_Geographic, and SG_PROJ_TYPE_CS_Projected.

Referenced by CSG_Projection::Get_Description(), CSG_Projections::Get_Names_List(), and CSG_Projection::Get_Type_Name().

◆ SG_Get_Projection_Unit()

TSG_Projection_Unit SG_Get_Projection_Unit ( const CSG_String & Identifier )

Definition at line 144 of file projections.cpp.

References CSG_String::CmpNoCase(), SG_PROJ_UNIT_Meter, SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projection_Unit_Identifier()

CSG_String SG_Get_Projection_Unit_Identifier ( TSG_Projection_Unit Unit )

Definition at line 160 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by CSG_Projection::Get_Unit_Identifier().

◆ SG_Get_Projection_Unit_Name()

CSG_String SG_Get_Projection_Unit_Name | ( | TSG_Projection_Unit | Unit,
 |  | bool | bSimple
 | ) |  |

Definition at line 169 of file projections.cpp.

References SG_PROJ_UNIT_Undefined, and SG_Projection_Units.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projection_Unit_To_Meter()

double SG_Get_Projection_Unit_To_Meter ( TSG_Projection_Unit Unit )

Definition at line 178 of file projections.cpp.

References SG_PROJ_UNIT_Centimeter, SG_PROJ_UNIT_Decimeter, SG_PROJ_UNIT_Indian_Chain, SG_PROJ_UNIT_Indian_Foot, SG_PROJ_UNIT_Indian_Yard, SG_PROJ_UNIT_Int_Chain, SG_PROJ_UNIT_Int_Fathom, SG_PROJ_UNIT_Int_Foot, SG_PROJ_UNIT_Int_Inch, SG_PROJ_UNIT_Int_Link, SG_PROJ_UNIT_Int_Nautical_Mile, SG_PROJ_UNIT_Int_Statute_Mile, SG_PROJ_UNIT_Int_Yard, SG_PROJ_UNIT_Kilometer, SG_PROJ_UNIT_Meter, SG_PROJ_UNIT_Millimeter, SG_PROJ_UNIT_US_Chain, SG_PROJ_UNIT_US_Foot, SG_PROJ_UNIT_US_Inch, SG_PROJ_UNIT_US_Statute_Mile, and SG_PROJ_UNIT_US_Yard.

Referenced by SG_Set_Projection_Unit().

◆ SG_Get_Projections()

CSG_Projections& SG_Get_Projections ( void )

Definition at line 66 of file projections.cpp.

References gSG_Projections.

Referenced by SG_Initialize_Environment().

◆ SG_Grid_Get_Geographic_Coordinates()

bool SG_Grid_Get_Geographic_Coordinates | ( | CSG_Grid * | pGrid,
 |  | CSG_Grid * | pLon,
 |  | CSG_Grid * | pLat
 | ) |  |

Definition at line 2307 of file projections.cpp.

References CSG_Grid::Create(), CSG_Data_Object::Get_Projection(), CSG_Grid::Get_System(), CSG_Projection::is_Okay(), CSG_Grid::is_Valid(), SG_RUN_TOOL, and SG_TOOL_PARAMETER_SET.

◆ SG_Set_Projection_Unit()

bool SG_Set_Projection_Unit | ( | const CSG_MetaData & | m,
 |  | TSG_Projection_Unit & | Unit,
 |  | CSG_String & | Name,
 |  | double & | To_Meter
 | ) |  |

Definition at line 208 of file projections.cpp.

References SG_Get_Projection_Unit(), SG_Get_Projection_Unit_Name(), SG_Get_Projection_Unit_To_Meter(), and SG_PROJ_UNIT_Undefined.

Referenced by CSG_Projection::Assign(), and CSG_Projections::Get_Projection().

Variable Documentation

◆ gSG_Projections

CSG_Projections gSG_Projections

Definition at line 63 of file projections.cpp.

Referenced by CSG_Projection::Assign(), and SG_Get_Projections().

◆ SG_Projection_Units

const char SG_Projection_Units[SG_PROJ_UNIT_Undefined+1][3][32]
Initial value:
=
{
{ "km" , "Kilometers" , "Kilometer" },
{ "m" , "Meters" , "Meter" },
{ "dm" , "Decimeters" , "Decimeter" },
{ "cm" , "Centimeters", "Centimeter" },
{ "mm" , "Millimeters", "Millimeter" },
{ "kmi" , "Miles" , "International Nautical Mile" },
{ "in" , "Inches" , "International Inch" },
{ "ft" , "Feet" , "International Foot" },
{ "yd" , "Yards" , "International Yard" },
{ "mi" , "Miles" , "International Statute Mile" },
{ "fath" , "Fathoms" , "International Fathom" },
{ "ch" , "Chains" , "International Chain" },
{ "link" , "Links" , "International Link" },
{ "us-in" , "Inches" , "U.S. Surveyor's Inch" },
{ "us-ft" , "Feet" , "U.S. Surveyor's Foot" },
{ "us-yd" , "Yards" , "U.S. Surveyor's Yard" },
{ "us-ch" , "Chains" , "U.S. Surveyor's Chain" },
{ "us-mi" , "Miles" , "U.S. Surveyor's Statute Mile" },
{ "ind-yd", "Yards" , "Indian Yard" },
{ "ind-ft", "Feet" , "Indian Foot" },
{ "ind-ch", "Chains" , "Indian Chain" },
{ "" , "" , "" }
}

Definition at line 116 of file projections.cpp.

Referenced by SG_Get_Projection_Unit(), SG_Get_Projection_Unit_Identifier(), and SG_Get_Projection_Unit_Name().

CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_String
Definition: api_core.h:557
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: projections.cpp Source File

  • saga_core
  • saga_api
projections.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // projections.cpp //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "geo_tools.h"
52
53 #include "table.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Projections gSG_Projections;
64
65 //---------------------------------------------------------
66 CSG_Projections & SG_Get_Projections(void)
67 {
68 return( gSG_Projections );
69 }
70
71
73 // //
75
76 //---------------------------------------------------------
77 TSG_Projection_Type SG_Get_Projection_Type (const CSG_String &Identifier)
78 {
79 if( !Identifier.CmpNoCase("PROJCS") ) return( SG_PROJ_TYPE_CS_Projected );
80 if( !Identifier.CmpNoCase("GEOGCS") ) return( SG_PROJ_TYPE_CS_Geographic );
81 if( !Identifier.CmpNoCase("GEOCCS") ) return( SG_PROJ_TYPE_CS_Geocentric );
82
83 return( SG_PROJ_TYPE_CS_Undefined );
84 }
85
86 //---------------------------------------------------------
87 CSG_String SG_Get_Projection_Type_Identifier (TSG_Projection_Type Type)
88 {
89 switch( Type )
90 {
91 case SG_PROJ_TYPE_CS_Projected : return( "PROJCS" );
92 case SG_PROJ_TYPE_CS_Geographic: return( "GEOGCS" );
93 case SG_PROJ_TYPE_CS_Geocentric: return( "GEOCCS" );
94 default : return( "UNDEFINED" );
95 }
96 }
97
98 //---------------------------------------------------------
99 CSG_String SG_Get_Projection_Type_Name (TSG_Projection_Type Type)
100 {
101 switch( Type )
102 {
103 case SG_PROJ_TYPE_CS_Projected : return( _TL("Projected Coordinate System" ) );
104 case SG_PROJ_TYPE_CS_Geographic: return( _TL("Geographic Coordinate System") );
105 case SG_PROJ_TYPE_CS_Geocentric: return( _TL("Geocentric Coordinate System") );
106 default : return( _TL("Undefined Coordinate System" ) );
107 }
108 }
109
110
112 // //
114
115 //---------------------------------------------------------
116 const char SG_Projection_Units[SG_PROJ_UNIT_Undefined + 1][3][32] =
117 {
118 { "km" , "Kilometers" , "Kilometer" },
119 { "m" , "Meters" , "Meter" },
120 { "dm" , "Decimeters" , "Decimeter" },
121 { "cm" , "Centimeters", "Centimeter" },
122 { "mm" , "Millimeters", "Millimeter" },
123 { "kmi" , "Miles" , "International Nautical Mile" },
124 { "in" , "Inches" , "International Inch" },
125 { "ft" , "Feet" , "International Foot" },
126 { "yd" , "Yards" , "International Yard" },
127 { "mi" , "Miles" , "International Statute Mile" },
128 { "fath" , "Fathoms" , "International Fathom" },
129 { "ch" , "Chains" , "International Chain" },
130 { "link" , "Links" , "International Link" },
131 { "us-in" , "Inches" , "U.S. Surveyor's Inch" },
132 { "us-ft" , "Feet" , "U.S. Surveyor's Foot" },
133 { "us-yd" , "Yards" , "U.S. Surveyor's Yard" },
134 { "us-ch" , "Chains" , "U.S. Surveyor's Chain" },
135 { "us-mi" , "Miles" , "U.S. Surveyor's Statute Mile" },
136 { "ind-yd", "Yards" , "Indian Yard" },
137 { "ind-ft", "Feet" , "Indian Foot" },
138 { "ind-ch", "Chains" , "Indian Chain" },
139 { "" , "" , "" }
140 };
141
142 //---------------------------------------------------------
143 // same as proj4.
144 TSG_Projection_Unit SG_Get_Projection_Unit (const CSG_String &Identifier)
145 {
146 for(int i=0; i<SG_PROJ_UNIT_Undefined; i++)
147 {
148 if( !Identifier.CmpNoCase(SG_Projection_Units[i][0])
149 || !Identifier.CmpNoCase(SG_Projection_Units[i][2]) )
150 {
151 return( (TSG_Projection_Unit)i );
152 }
153 }
154
155 return( !Identifier.CmpNoCase("metre") ? SG_PROJ_UNIT_Meter : SG_PROJ_UNIT_Undefined );
156 }
157
158 //---------------------------------------------------------
159 // same as proj4.
160 CSG_String SG_Get_Projection_Unit_Identifier (TSG_Projection_Unit Unit)
161 {
162 if( Unit < 0 || Unit > SG_PROJ_UNIT_Undefined )
163 Unit = SG_PROJ_UNIT_Undefined;
164
165 return( SG_Projection_Units[Unit][0] );
166 }
167
168 //---------------------------------------------------------
169 CSG_String SG_Get_Projection_Unit_Name (TSG_Projection_Unit Unit, bool bSimple)
170 {
171 if( Unit < 0 || Unit > SG_PROJ_UNIT_Undefined )
172 Unit = SG_PROJ_UNIT_Undefined;
173
174 return( SG_Projection_Units[Unit][bSimple ? 1 : 2] );
175 }
176
177 //---------------------------------------------------------
178 double SG_Get_Projection_Unit_To_Meter (TSG_Projection_Unit Unit)
179 {
180 switch( Unit )
181 {
182 case SG_PROJ_UNIT_Kilometer : return( 1000. );
183 case SG_PROJ_UNIT_Meter : return( 1. );
184 case SG_PROJ_UNIT_Decimeter : return( 0.1 );
185 case SG_PROJ_UNIT_Centimeter : return( 0.01 );
186 case SG_PROJ_UNIT_Millimeter : return( 0.001 );
187 case SG_PROJ_UNIT_Int_Nautical_Mile: return( 1852. );
188 case SG_PROJ_UNIT_Int_Inch : return( 0.0254 );
189 case SG_PROJ_UNIT_Int_Foot : return( 0.3048 );
190 case SG_PROJ_UNIT_Int_Yard : return( 0.9144 );
191 case SG_PROJ_UNIT_Int_Statute_Mile : return( 1609.344 );
192 case SG_PROJ_UNIT_Int_Fathom : return( 1.8288 );
193 case SG_PROJ_UNIT_Int_Chain : return( 20.1168 );
194 case SG_PROJ_UNIT_Int_Link : return( 0.201168 );
195 case SG_PROJ_UNIT_US_Inch : return( 1. / 39.37 );
196 case SG_PROJ_UNIT_US_Foot : return( 0.304800609601219 );
197 case SG_PROJ_UNIT_US_Yard : return( 0.914401828803658 );
198 case SG_PROJ_UNIT_US_Chain : return( 20.11684023368047 );
199 case SG_PROJ_UNIT_US_Statute_Mile : return( 1609.347218694437 );
200 case SG_PROJ_UNIT_Indian_Yard : return( 0.91439523 );
201 case SG_PROJ_UNIT_Indian_Foot : return( 0.30479841 );
202 case SG_PROJ_UNIT_Indian_Chain : return( 20.11669506 );
203 default : return( 1. );
204 }
205 }
206
207 //---------------------------------------------------------
208 bool SG_Set_Projection_Unit (const CSG_MetaData &m, TSG_Projection_Unit &Unit, CSG_String &Name, double &To_Meter)
209 {
210 if( m("UNIT") )
211 {
212 if( m["UNIT"].Get_Property("name", Name) && (Unit = SG_Get_Projection_Unit(Name)) != SG_PROJ_UNIT_Undefined )
213 {
214 Name = SG_Get_Projection_Unit_Name (Unit);
215 To_Meter = SG_Get_Projection_Unit_To_Meter(Unit);
216 }
217 else if( !m["UNIT"].Get_Content().asDouble(To_Meter) || To_Meter <= 0. )
218 {
219 To_Meter = 1.;
220 }
221
222 return( true );
223 }
224
225 return( false );
226 }
227
228
230 // //
231 // //
232 // //
234
235 //---------------------------------------------------------
236 CSG_Projection::CSG_Projection(void)
237 {
238 Destroy();
239 }
240
241 CSG_Projection::~CSG_Projection(void)
242 {}
243
244 //---------------------------------------------------------
245 CSG_Projection::CSG_Projection(const CSG_Projection &Projection)
246 {
247 Destroy();
248
249 Create(Projection);
250 }
251
252 bool CSG_Projection::Create(const CSG_Projection &Projection)
253 {
254 return( Assign(Projection) );
255 }
256
257 bool CSG_Projection::Assign(const CSG_Projection &Projection)
258 {
259 m_Name = Projection.m_Name;
260 m_Type = Projection.m_Type;
261 m_Unit = Projection.m_Unit;
262 m_Unit_To_Meter = Projection.m_Unit_To_Meter;
263 m_Unit_Name = Projection.m_Unit_Name;
264 m_WKT = Projection.m_WKT;
265 m_Proj4 = Projection.m_Proj4;
266 m_Authority = Projection.m_Authority;
267 m_Authority_ID = Projection.m_Authority_ID;
268
269 return( true );
270 }
271
272 //---------------------------------------------------------
273 CSG_Projection::CSG_Projection(int Authority_ID, const SG_Char *Authority)
274 {
275 Destroy();
276
277 Create(Authority_ID, Authority);
278 }
279
280 bool CSG_Projection::Create(int Authority_ID, const SG_Char *Authority)
281 {
282 return( Assign(Authority_ID, Authority) );
283 }
284
285 bool CSG_Projection::Assign(int Authority_ID, const SG_Char *Authority)
286 {
287 return( Authority && *Authority
288 ? gSG_Projections.Get_Projection(*this, Authority, Authority_ID)
289 : gSG_Projections.Get_Projection(*this, Authority_ID)
290 );
291 }
292
293 //---------------------------------------------------------
294 CSG_Projection::CSG_Projection(const CSG_String &Projection, TSG_Projection_Format Format)
295 {
296 Create(Projection, Format);
297 }
298
299 bool CSG_Projection::Create(const CSG_String &Projection, TSG_Projection_Format Format)
300 {
301 return( Assign(Projection, Format) );
302 }
303
304 bool CSG_Projection::Assign(const CSG_String &Projection, TSG_Projection_Format Format)
305 {
306 Destroy();
307
308 if( Projection.is_Empty() )
309 {
310 return( false );
311 }
312
313 //-----------------------------------------------------
314 int i;
315 CSG_String s;
316 CSG_MetaData m;
317
318 switch( Format )
319 {
320 default:
321 return( false );
322
323 //-----------------------------------------------------
324 case SG_PROJ_FMT_EPSG:
325 return( Projection.asInt(i) && Assign(i, SG_T("EPSG")) );
326
327 //-----------------------------------------------------
328 case SG_PROJ_FMT_Proj4:
329 if( !gSG_Projections.WKT_from_Proj4(s, Projection) )
330 {
331 return( false );
332 }
333
334 m_WKT = s;
335 m_Proj4 = Projection;
336
337 m = gSG_Projections.WKT_to_MetaData(m_WKT);
338
339 break;
340
341 //-----------------------------------------------------
342 case SG_PROJ_FMT_WKT:
343 m = gSG_Projections.WKT_to_MetaData(Projection);
344
345 if( m.Get_Property("authority_name", s) && s.CmpNoCase("EPSG") == 0
346 && m.Get_Property("authority_code", i) && gSG_Projections.Get_Projection(*this, i) )
347 {
348 return( true );
349 }
350
351 if( gSG_Projections.WKT_to_Proj4(s, Projection) )
352 {
353 m_Proj4 = s;
354 }
355
356 m_WKT = Projection;
357
358 break;
359 }
360
361 //-----------------------------------------------------
362 m_Name = m.Get_Property("name");
363 m_Type = SG_Get_Projection_Type(m.Get_Name());
364
365 SG_Set_Projection_Unit(m, m_Unit, m_Unit_Name, m_Unit_To_Meter);
366
367 return( true );
368 }
369
370 //---------------------------------------------------------
371 CSG_Projection::CSG_Projection(const CSG_String &WKT, const CSG_String &Proj4)
372 {
373 Create(WKT, Proj4);
374 }
375
376 bool CSG_Projection::Create(const CSG_String &WKT, const CSG_String &Proj4)
377 {
378 return( Assign(WKT, Proj4) );
379 }
380
381 bool CSG_Projection::Assign(const CSG_String &WKT, const CSG_String &Proj4)
382 {
383 if( Assign(WKT) )
384 {
385 m_Proj4 = Proj4;
386
387 return( true );
388 }
389
390 return( false );
391 }
392
393 //---------------------------------------------------------
394 void CSG_Projection::Destroy(void)
395 {
396 m_Name = _TL("undefined");
397 m_Type = SG_PROJ_TYPE_CS_Undefined;
398 m_Unit = SG_PROJ_UNIT_Undefined;
399 m_Unit_To_Meter = 1.;
400 m_Unit_Name .Clear();
401 m_WKT .Clear();
402 m_Proj4 .Clear();
403 m_Authority .Clear();
404 m_Authority_ID = -1;
405 }
406
407
409 // //
411
412 //---------------------------------------------------------
413 bool CSG_Projection::Load(const CSG_String &FileName, TSG_Projection_Format Format)
414 {
415 CSG_File Stream(FileName, SG_FILE_R, false);
416
417 return( Load(Stream, Format) );
418 }
419
420 //---------------------------------------------------------
421 bool CSG_Projection::Save(const CSG_String &FileName, TSG_Projection_Format Format) const
422 {
423 CSG_File Stream(FileName, SG_FILE_W, false);
424
425 return( is_Okay() && Save(Stream, Format) );
426 }
427
428 //---------------------------------------------------------
429 bool CSG_Projection::Load(CSG_File &Stream, TSG_Projection_Format Format)
430 {
431 if( Stream.is_Reading() )
432 {
433 CSG_String s;
434
435 Stream.Read(s, (size_t)Stream.Length());
436
437 return( Assign(s, Format) );
438 }
439
440 return( false );
441 }
442
443 //---------------------------------------------------------
444 bool CSG_Projection::Save(CSG_File &Stream, TSG_Projection_Format Format) const
445 {
446 if( is_Okay() && Stream.is_Writing() )
447 {
448 switch( Format )
449 {
450 case SG_PROJ_FMT_WKT: default:
451 return( Stream.Write(m_WKT ) == m_WKT .Length() );
452
453 case SG_PROJ_FMT_Proj4:
454 return( Stream.Write(m_Proj4) == m_Proj4.Length() );
455 }
456 }
457
458 return( false );
459 }
460
461 //---------------------------------------------------------
462 bool CSG_Projection::Load(const CSG_MetaData &Projection)
463 {
464 CSG_MetaData *pEntry;
465
466 if( (pEntry = Projection.Get_Child("OGC_WKT")) != NULL )
467 {
468 Assign(pEntry->Get_Content(), SG_PROJ_FMT_WKT);
469
470 if( (pEntry = Projection.Get_Child("PROJ4")) != NULL )
471 {
472 m_Proj4 = pEntry->Get_Content();
473 }
474
475 return( true );
476 }
477
478 return( false );
479 }
480
481 //---------------------------------------------------------
482 bool CSG_Projection::Save(CSG_MetaData &Projection) const
483 {
484 Projection.Del_Children();
485
486 Projection.Add_Child("OGC_WKT", m_WKT );
487 Projection.Add_Child("PROJ4" , m_Proj4 );
488 Projection.Add_Child("EPSG" , Get_EPSG() );
489
490 return( true );
491 }
492
493
495 // //
497
498 //---------------------------------------------------------
499 #define WKT_GCS_WGS84 "GEOGCS[\"WGS 84\",AUTHORITY[\"EPSG\",\"4326\"]],"\
500 "DATUM[\"WGS_1984\",AUTHORITY[\"EPSG\",\"6326\"]],"\
501 "SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"\
502 "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"\
503 "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]"
504
505 //---------------------------------------------------------
506 #define PROJ4_GCS_WGS84 "+proj=longlat +datum=WGS84 +no_defs"
507
508 //---------------------------------------------------------
509 bool CSG_Projection::Set_GCS_WGS84(void)
510 {
511 return( Create(WKT_GCS_WGS84, PROJ4_GCS_WGS84) );
512 }
513
514 //---------------------------------------------------------
515 bool CSG_Projection::Set_UTM_WGS84(int Zone, bool bSouth)
516 {
517 if( Zone < 1 || Zone > 60 )
518 {
519 return( false );
520 }
521
522 //-----------------------------------------------------
523 int EPSG_ID = (bSouth ? 32700 : 32600) + Zone;
524
525 if( Create(EPSG_ID) )
526 {
527 return( true );
528 }
529
530 //-----------------------------------------------------
531 CSG_String WKT, Proj4;
532
533 WKT.Printf("PROJCS[\"WGS 84 / UTM zone %d%c\",%s" // Zone, N/S, Datum
534 "PROJECTION[\"Transverse_Mercator\"],AUTHORITY[\"EPSG\",\"%d\"]]" // EPSG ID
535 "PARAMETER[\"latitude_of_origin\",0],"
536 "PARAMETER[\"central_meridian\",%d]," // Central Meridian
537 "PARAMETER[\"scale_factor\",0.9996],"
538 "PARAMETER[\"false_easting\",500000],"
539 "PARAMETER[\"false_northing\",%d]," // False Northing
540 "AXIS[\"Easting\",EAST],"
541 "AXIS[\"Northing\",NORTH],"
542 "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]",
543 Zone, bSouth ? 'S' : 'N', CSG_String(WKT_GCS_WGS84).c_str(), EPSG_ID, 6 * (Zone - 1) - 177, bSouth ? 10000000 : 0
544 );
545
546 Proj4.Printf("+proj=utm +zone=%d%s +datum=WGS84 +units=m +no_defs", Zone, bSouth ? SG_T(" +south") : SG_T(""));
547
548 return( Create(WKT, Proj4) );
549 }
550
551
553 // //
555
556 //---------------------------------------------------------
557 bool CSG_Projection::is_Equal(const CSG_Projection &Projection) const
558 {
559 if( is_Okay() != Projection.is_Okay() )
560 {
561 return( false );
562 }
563
564 if( !is_Okay() ) // both are not valid
565 {
566 return( true );
567 }
568
569 if( !m_Authority.is_Empty() && !Projection.m_Authority.is_Empty() )
570 {
571 return( m_Authority.CmpNoCase(Projection.m_Authority) == 0 && m_Authority_ID == Projection.m_Authority_ID );
572 }
573
574 if( m_Proj4.CmpNoCase(Projection.m_Proj4) == 0 ) // the simple case, identical strings...
575 {
576 return( true );
577 }
578
579 //-----------------------------------------------------
580 CSG_MetaData Parms[2]; // okay, let's perform a more detailed check...
581
582 for(int j=0; j<2; j++) // collect the key/value pairs
583 {
584 CSG_Strings s = SG_String_Tokenize(j == 0 ? m_Proj4 : Projection.m_Proj4, "+");
585
586 for(int i=0; i<s.Get_Count(); i++)
587 {
588 CSG_String key = s[i].BeforeFirst('='); key.Trim_Both(); key.Make_Lower();
589 CSG_String val = s[i].AfterFirst ('='); val.Trim_Both(); val.Make_Lower();
590
591 if( !key.is_Empty() && key.Cmp("no_defs") && !Parms[j](key) ) // key must not be empty, no_defs might be ignored, no key should appear twice!
592 {
593 Parms[j].Add_Child(key, val);
594 }
595 }
596 }
597
598 for(int j=0, k=1; j<2; j++, k=++k%2) // cross check
599 {
600 for(int i=0; i<Parms[j].Get_Children_Count(); i++)
601 {
602 CSG_String key = Parms[j][i].Get_Name();
603
604 if( Parms[k](key) )
605 {
606 if( !Parms[k][key].Cmp_Content(Parms[j][i].Get_Content()) )
607 {
608 double d[2];
609
610 if( !Parms[j].Get_Content().asDouble(d[0]) // does the numerical value representation match ?
611 || !Parms[j].Get_Content().asDouble(d[1]) || d[0] != d[1] )
612 {
613 return( false );
614 }
615 }
616 }
617 else // key not present in other list, check for blacklist...
618 {
619 if( !key.CmpNoCase("units") && Parms[j].Cmp_Content("m") ) // meter is default(!?)
620 {
621 continue;
622 }
623
624 if( !key.CmpNoCase("datum" ) // ignore everything related to datum, will be checked below...
625 || !key.CmpNoCase("ellps" )
626 || !key.CmpNoCase("a" )
627 || !key.CmpNoCase("b" )
628 || !key.CmpNoCase("rf" )
629 || !key.CmpNoCase("e" )
630 || !key.CmpNoCase("es" )
631 || !key.CmpNoCase("ellps" )
632 || !key.CmpNoCase("towgs84") )
633 {
634 continue;
635 }
636 }
637 }
638 }
639
640 //-----------------------------------------------------
641 CSG_String Datum[2];
642
643 #define GET_DATUM(d, p) { CSG_String s; CSG_Projections::_Proj4_Get_Datum(s, p); d.Clear();\
644 for(int i=0, add=1; i<s.Length(); i++) {\
645 if( s[i] == '\"' ) { add = add ? 0 : 1; } else if( add ) { d += s[i]; }\
646 }\
647 }
648
649 GET_DATUM(Datum[0], m_Proj4);
650 GET_DATUM(Datum[1], Projection.m_Proj4);
651
652 return( Datum[0].is_Same_As(Datum[1]) );
653 }
654
655
657 // //
659
660 //---------------------------------------------------------
661 CSG_String CSG_Projection::Get_Description(void) const
662 {
663 CSG_String s;
664
665 s = SG_Get_Projection_Type_Name(m_Type);
666
667 if( is_Okay() )
668 {
669 if( m_Authority.Length() > 0 && m_Authority_ID > 0 )
670 {
671 s += CSG_String::Format(" [%s %d]", m_Authority.c_str(), m_Authority_ID);
672 }
673
674 s += ":\n" + m_Name;
675
676 if( m_Proj4.Length() > 0 )
677 {
678 s += "\n[" + m_Proj4 + "]";
679 }
680 }
681
682 return( s );
683 }
684
685
687 // //
688 // //
689 // //
691
692 //---------------------------------------------------------
693 enum ESG_PROJ_FIELD_ID
694 {
695 PRJ_FIELD_SRID = 0,
696 PRJ_FIELD_AUTH_NAME,
697 PRJ_FIELD_AUTH_SRID,
698 PRJ_FIELD_SRTEXT,
699 PRJ_FIELD_PROJ4TEXT
700 };
701
702
704 // //
706
707 //---------------------------------------------------------
708 CSG_Projections::CSG_Projections(void)
709 {
710 _On_Construction();
711 }
712
713 //---------------------------------------------------------
714 CSG_Projections::CSG_Projections(bool bLoadDefaults)
715 {
716 _On_Construction();
717
718 Create(bLoadDefaults);
719 }
720
721 bool CSG_Projections::Create(bool bLoadDefaults)
722 {
723 Destroy();
724
725 if( bLoadDefaults ) // load spatial reference system database and dictionary
726 {
727 #if defined(_SAGA_LINUX)
728 CSG_String Path_Shared = SHARE_PATH;
729 #else
730 CSG_String Path_Shared = SG_UI_Get_Application_Path(true);
731 #endif
732
733 SG_UI_Msg_Lock(true);
734
735 Load_Dictionary(SG_File_Make_Path(Path_Shared, "saga_prj", "dic"));
736 Load_DB (SG_File_Make_Path(Path_Shared, "saga_prj", "srs"));
737
738 SG_UI_Msg_Lock(false);
739 }
740
741 return( true );
742 }
743
744 //---------------------------------------------------------
745 CSG_Projections::CSG_Projections(const CSG_String &File_DB)
746 {
747 _On_Construction();
748
749 Create(File_DB);
750 }
751
752 bool CSG_Projections::Create(const CSG_String &File_DB)
753 {
754 SG_UI_Msg_Lock(true);
755
756 bool bResult = Load_DB(File_DB);
757
758 SG_UI_Msg_Lock(false);
759
760 return( bResult );
761 }
762
763 //---------------------------------------------------------
764 void CSG_Projections::_On_Construction(void)
765 {
766 m_pProjections = new CSG_Table;
767
768 m_pProjections->Add_Field("srid" , SG_DATATYPE_Int ); // PRJ_FIELD_SRID
769 m_pProjections->Add_Field("auth_name", SG_DATATYPE_String); // PRJ_FIELD_AUTH_NAME
770 m_pProjections->Add_Field("auth_srid", SG_DATATYPE_Int ); // PRJ_FIELD_AUTH_SRID
771 m_pProjections->Add_Field("srtext" , SG_DATATYPE_String); // PRJ_FIELD_SRTEXT
772 m_pProjections->Add_Field("proj4text", SG_DATATYPE_String); // PRJ_FIELD_PROJ4TEXT
773
774 Reset_Dictionary();
775 }
776
777 //---------------------------------------------------------
778 CSG_Projections::~CSG_Projections(void)
779 {
780 Destroy();
781
782 delete(m_pProjections);
783 }
784
785 //---------------------------------------------------------
786 void CSG_Projections::Destroy(void)
787 {
788 if( m_pProjections )
789 {
790 m_pProjections->Del_Records();
791 }
792
793 Reset_Dictionary();
794 }
795
796
798 // //
800
801 //---------------------------------------------------------
802 bool CSG_Projections::Reset_Dictionary(void)
803 {
804 _Set_Dictionary(m_Proj4_to_WKT, 1);
805 _Set_Dictionary(m_WKT_to_Proj4, -1);
806
807 return( true );
808 }
809
810 //---------------------------------------------------------
811 bool CSG_Projections::Load_Dictionary(const CSG_String &FileName)
812 {
813 CSG_Table Table;
814
815 if( SG_File_Exists(FileName) && Table.Create(FileName) && Table.Get_Field_Count() >= 3 )
816 {
817 CSG_Table Proj4_to_WKT(&Table), WKT_to_Proj4(&Table);
818
819 for(sLong i=0; i<Table.Get_Count(); i++)
820 {
821 switch( Table[i].asString(1)[0] )
822 {
823 case SG_T('<'): // ignore proj4 to wkt translation
824 WKT_to_Proj4.Add_Record(Table.Get_Record(i));
825 break;
826
827 case SG_T('>'): // ignore wkt to proj4 translation
828 Proj4_to_WKT.Add_Record(Table.Get_Record(i));
829 break;
830
831 default:
832 Proj4_to_WKT.Add_Record(Table.Get_Record(i));
833 WKT_to_Proj4.Add_Record(Table.Get_Record(i));
834 }
835 }
836
837 m_Proj4_to_WKT.Create(&Proj4_to_WKT, 0, 2, true);
838 m_WKT_to_Proj4.Create(&WKT_to_Proj4, 2, 0, true);
839
840 return( true );
841 }
842
843 return( false );
844 }
845
846 //---------------------------------------------------------
847 bool CSG_Projections::Save_Dictionary(const CSG_String &File)
848 {
849 CSG_Table Table;
850
851 return( _Set_Dictionary(Table, 0) && Table.Save(File) );
852 }
853
854
856 // //
858
859 //---------------------------------------------------------
860 bool CSG_Projections::Load_DB(const CSG_String &FileName, bool bAppend)
861 {
862 if( m_pProjections && SG_File_Exists(FileName) )
863 {
864 CSG_Table Table;
865
866 if( Table.Create(FileName) )
867 {
868 Table.Set_Index(PRJ_FIELD_SRTEXT, TABLE_INDEX_Ascending);
869
870 if( !bAppend )
871 {
872 m_pProjections->Del_Records();
873 }
874
875 for(sLong i=0; i<Table.Get_Count() && SG_UI_Process_Set_Progress(i, Table.Get_Count()); i++)
876 {
877 m_pProjections->Add_Record(Table.Get_Record_byIndex(i));
878 }
879
880 return( true );
881 }
882 }
883
884 return( false );
885 }
886
887 //---------------------------------------------------------
888 bool CSG_Projections::Save_DB(const CSG_String &File)
889 {
890 return( m_pProjections->Save(File) );
891 }
892
893
895 // //
897
898 //---------------------------------------------------------
899 const CSG_Projection & CSG_Projections::Get_GCS_WGS84(void)
900 {
901 static CSG_Projection Projection(WKT_GCS_WGS84, PROJ4_GCS_WGS84);
902
903 return( Projection );
904 }
905
906 //---------------------------------------------------------
907 CSG_Projection CSG_Projections::Get_UTM_WGS84(int Zone, bool bSouth)
908 {
909 CSG_Projection Projection;
910
911 Projection.Set_UTM_WGS84(Zone, bSouth);
912
913 return( Projection );
914 }
915
916
918 // //
920
921 //---------------------------------------------------------
922 sLong CSG_Projections::Get_Count(void) const
923 {
924 return( m_pProjections->Get_Count() );
925 }
926
927 //---------------------------------------------------------
928 bool CSG_Projections::Add(const CSG_Projection &Projection)
929 {
930 return( false );
931 }
932
933 //---------------------------------------------------------
934 bool CSG_Projections::Add(const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID)
935 {
936 CSG_Table_Record *pProjection = m_pProjections->Add_Record();
937
938 pProjection->Set_Value(PRJ_FIELD_SRID , (int)m_pProjections->Get_Count());
939 pProjection->Set_Value(PRJ_FIELD_AUTH_NAME, Authority);
940 pProjection->Set_Value(PRJ_FIELD_AUTH_SRID, Authority_ID);
941 pProjection->Set_Value(PRJ_FIELD_SRTEXT , WKT);
942 pProjection->Set_Value(PRJ_FIELD_PROJ4TEXT, Proj4);
943
944 return( true );
945 }
946
947 //---------------------------------------------------------
948 CSG_Projection CSG_Projections::Get_Projection(sLong Index) const
949 {
950 CSG_Projection Projection;
951
952 if( Index >= 0 && Index < m_pProjections->Get_Count() )
953 {
954 CSG_Table_Record *pRecord = m_pProjections->Get_Record(Index);
955
956 Projection.m_Authority = pRecord->asString(PRJ_FIELD_AUTH_NAME);
957 Projection.m_Authority_ID = pRecord->asInt (PRJ_FIELD_AUTH_SRID);
958 Projection.m_WKT = pRecord->asString(PRJ_FIELD_SRTEXT );
959 Projection.m_Proj4 = pRecord->asString(PRJ_FIELD_PROJ4TEXT);
960
961 CSG_MetaData m = WKT_to_MetaData(Projection.m_WKT);
962
963 Projection.m_Name = m.Get_Property("name");
964 Projection.m_Type = !m.Get_Name().Cmp("GEOCCS") ? SG_PROJ_TYPE_CS_Geocentric
965 : !m.Get_Name().Cmp("GEOGCS") ? SG_PROJ_TYPE_CS_Geographic
966 : !m.Get_Name().Cmp("PROJCS") ? SG_PROJ_TYPE_CS_Projected
967 : SG_PROJ_TYPE_CS_Undefined;
968
969 SG_Set_Projection_Unit(m, Projection.m_Unit, Projection.m_Unit_Name, Projection.m_Unit_To_Meter);
970 }
971
972 return( Projection );
973 }
974
975 //---------------------------------------------------------
976 bool CSG_Projections::Get_Projection(CSG_Projection &Projection, int EPSG_ID) const
977 {
978 return( Get_Projection(Projection, "", EPSG_ID) );
979 }
980
981 bool CSG_Projections::Get_Projection(CSG_Projection &Projection, const CSG_String &Authority, int Authority_ID) const
982 {
983 for(sLong i=0; i<m_pProjections->Get_Count(); i++)
984 {
985 CSG_Table_Record *pProjection = m_pProjections->Get_Record(i);
986
987 if( Authority_ID == pProjection->asInt(PRJ_FIELD_AUTH_SRID)
988 && (Authority.is_Empty() || Authority.CmpNoCase(pProjection->asString(PRJ_FIELD_AUTH_NAME)) == 0) )
989 {
990 Projection = Get_Projection(i);
991
992 return( true );
993 }
994 }
995
996 return( false );
997 }
998
999
1001 // //
1003
1004 //---------------------------------------------------------
1005 bool CSG_Projections::EPSG_to_Proj4(CSG_String &Proj4, int EPSG_Code) const
1006 {
1007 for(sLong i=0; i<m_pProjections->Get_Count(); i++)
1008 {
1009 if( m_pProjections->Get_Record(i)->asInt(PRJ_FIELD_AUTH_SRID) == EPSG_Code )
1010 {
1011 Proj4 = m_pProjections->Get_Record(i)->asString(PRJ_FIELD_PROJ4TEXT);
1012
1013 return( true );
1014 }
1015 }
1016
1017 Proj4.Printf("+init=epsg:%d ", EPSG_Code);
1018
1019 return( false );
1020 }
1021
1022 //---------------------------------------------------------
1023 bool CSG_Projections::EPSG_to_WKT(CSG_String &WKT, int EPSG_Code) const
1024 {
1025 for(sLong i=0; i<m_pProjections->Get_Count(); i++)
1026 {
1027 if( m_pProjections->Get_Record(i)->asInt(PRJ_FIELD_AUTH_SRID) == EPSG_Code )
1028 {
1029 WKT = m_pProjections->Get_Record(i)->asString(PRJ_FIELD_SRTEXT);
1030
1031 return( true );
1032 }
1033 }
1034
1035 return( false );
1036 }
1037
1038
1040 // //
1042
1043 //---------------------------------------------------------
1044 CSG_String CSG_Projections::Get_Names_List(TSG_Projection_Type Type) const
1045 {
1046 CSG_String Names;
1047
1048 for(int i=0; i<Get_Count(); i++)
1049 {
1050 CSG_Table_Record *pProjection = m_pProjections->Get_Record(i);
1051
1052 CSG_String WKT = pProjection->asString(PRJ_FIELD_SRTEXT);
1053 int SRID = pProjection->asInt (PRJ_FIELD_SRID);
1054
1055 TSG_Projection_Type iType;
1056
1057 iType = !WKT.BeforeFirst('[').Cmp("PROJCS") ? SG_PROJ_TYPE_CS_Projected
1058 : !WKT.BeforeFirst('[').Cmp("GEOGCS") ? SG_PROJ_TYPE_CS_Geographic
1059 : !WKT.BeforeFirst('[').Cmp("GEOCCS") ? SG_PROJ_TYPE_CS_Geocentric
1060 : SG_PROJ_TYPE_CS_Undefined;
1061
1062 if( Type == SG_PROJ_TYPE_CS_Undefined )
1063 {
1064 Names += CSG_String::Format("{%d}%s: %s|", SRID,
1065 SG_Get_Projection_Type_Name(iType).c_str(),
1066 WKT.AfterFirst('\"').BeforeFirst('\"').c_str()
1067 );
1068 }
1069 else if( Type == iType )
1070 {
1071 Names += CSG_String::Format("{%d}%s|", SRID,
1072 WKT.AfterFirst('\"').BeforeFirst('\"').c_str()
1073 );
1074 }
1075 }
1076
1077 return( Names );
1078 }
1079
1080
1082 // //
1084
1085 //---------------------------------------------------------
1086 bool CSG_Projections::_WKT_to_MetaData(CSG_MetaData &MetaData, const CSG_String &WKT)
1087 {
1088 CSG_String Key; CSG_Strings Content; Content.Add("");
1089
1090 for(int i=0, l=-1; l!=0 && i<(int)WKT.Length(); i++)
1091 {
1092 if( l < 0 ) // read key
1093 {
1094 switch( WKT[i] )
1095 {
1096 default : Key += WKT[i]; break;
1097 case ' ' : break;
1098 case '[': case '(': l = 1 ; break;
1099 case ')': case ']': return( false );
1100 }
1101 }
1102 else // read content
1103 {
1104 bool bAdd;
1105
1106 switch( WKT[i] )
1107 {
1108 default : bAdd = true; break;
1109 case '\"': case ' ': bAdd = false; break;
1110 case '[' : case '(': bAdd = ++l > 1; break;
1111 case ']' : case ')': bAdd = l-- > 1; break;
1112 case ',' : if( !(bAdd = l > 1) ) Content.Add(""); break;
1113 }
1114
1115 if( bAdd )
1116 {
1117 Content[Content.Get_Count() - 1] += WKT[i];
1118 }
1119 }
1120 }
1121
1122 if( Key.Length() == 0 || Content[0].Length() == 0 )
1123 {
1124 return( false );
1125 }
1126
1127 //-----------------------------------------------------
1128 if( !Key.Cmp("AUTHORITY" ) && Content.Get_Count() == 2 ) // AUTHORITY ["<name>", "<code>"]
1129 {
1130 MetaData.Add_Property("authority_name", Content[0]);
1131 MetaData.Add_Property("authority_code", Content[1]);
1132
1133 return( true );
1134 }
1135
1136 CSG_MetaData *pKey = MetaData.Add_Child(Key);
1137
1138 if( (!Key.Cmp("GEOCCS" ) && Content.Get_Count() >= 4) // GEOCCS ["<name>", <datum>, <prime meridian>, <linear unit> {,<axis>, <axis>, <axis>} {,<authority>}]
1139 || (!Key.Cmp("GEOGCS" ) && Content.Get_Count() >= 4) // GEOGCS ["<name>", <datum>, <prime meridian>, <angular unit> {,<twin axes>} {,<authority>}]
1140 || (!Key.Cmp("PROJCS" ) && Content.Get_Count() >= 3) // PROJCS ["<name>", <geographic cs>, <projection>, {<parameter>,}* <linear unit> {,<twin axes>}{,<authority>}]
1141 || (!Key.Cmp("DATUM" ) && Content.Get_Count() >= 2) ) // DATUM ["<name>", <spheroid> {,<to wgs84>} {,<authority>}]
1142 {
1143 pKey->Add_Property("name", Content[0]);
1144 }
1145
1146 if( (!Key.Cmp("PRIMEM" ) && Content.Get_Count() >= 2) // PRIMEM ["<name>", <longitude> {,<authority>}]
1147 || (!Key.Cmp("UNIT" ) && Content.Get_Count() >= 2) // UNIT ["<name>", <conversion factor> {,<authority>}]
1148 || (!Key.Cmp("AXIS" ) && Content.Get_Count() >= 2) // AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
1149 || (!Key.Cmp("PARAMETER" ) && Content.Get_Count() >= 2) ) // PARAMETER ["<name>", <value>]
1150 {
1151 pKey->Add_Property("name", Content[0]);
1152
1153 pKey->Set_Content(Content[1]);
1154 }
1155
1156 if( (!Key.Cmp("SPHEROID" ) && Content.Get_Count() >= 3) ) // SPHEROID ["<name>", <semi-major axis>, <inverse flattening> {,<authority>}]
1157 {
1158 pKey->Add_Property("name", Content[0]);
1159 pKey->Add_Child ("a" , Content[1]);
1160 pKey->Add_Child ("rf" , Content[2]);
1161 }
1162
1163 if( (!Key.Cmp("TOWGS84" ) && Content.Get_Count() >= 7) ) // TOWGS84 [<dx>, <dy>, <dz>, <ex>, <ey>, <ez>, <ppm>]
1164 {
1165 pKey->Add_Child("dx" , Content[0]);
1166 pKey->Add_Child("dy" , Content[1]);
1167 pKey->Add_Child("dz" , Content[2]);
1168 pKey->Add_Child("ex" , Content[3]);
1169 pKey->Add_Child("ey" , Content[4]);
1170 pKey->Add_Child("ez" , Content[5]);
1171 pKey->Add_Child("ppm" , Content[6]);
1172 }
1173
1174 if( (!Key.Cmp("PROJECTION") && Content.Get_Count() >= 1) ) // PROJECTION ["<name>" {,<authority>}]
1175 {
1176 pKey->Set_Content(Content[0]);
1177 }
1178
1179 //-----------------------------------------------------
1180 for(int i=0; i<Content.Get_Count(); i++)
1181 {
1182 _WKT_to_MetaData(*pKey, Content[i]);
1183 }
1184
1185 return( true );
1186 }
1187
1188 //---------------------------------------------------------
1189 CSG_MetaData CSG_Projections::WKT_to_MetaData(const CSG_String &WKT)
1190 {
1191 CSG_MetaData MetaData;
1192
1193 _WKT_to_MetaData(MetaData, WKT);
1194
1195 if( MetaData.Get_Children_Count() == 1 )
1196 {
1197 return( *MetaData.Get_Child(0) );
1198 }
1199
1200 MetaData.Destroy();
1201
1202 return( MetaData );
1203 }
1204
1205
1207 // //
1209
1210 //---------------------------------------------------------
1211 // DATUM ["<name>",
1212 // SPHEROID["<name>", <semi-major axis>, <inverse flattening>]
1213 // *TOWGS84 [<dx>, <dy>, <dz>, <ex>, <ey>, <ez>, <ppm>]
1214 // ]
1215 //---------------------------------------------------------
1216 bool CSG_Projections::_WKT_to_Proj4_Set_Datum(CSG_String &Proj4, const CSG_MetaData &WKT) const
1217 {
1218 if( WKT.Cmp_Property("name", "WGS84") )
1219 {
1220 Proj4 += " +datum=WGS84";
1221
1222 return( true );
1223 }
1224
1225 double a, b;
1226
1227 if( !WKT("SPHEROID") || WKT["SPHEROID"].Get_Children_Count() != 2
1228 || !WKT["SPHEROID"][0].Get_Content().asDouble(a) || a <= 0.
1229 || !WKT["SPHEROID"][1].Get_Content().asDouble(b) || b < 0. )
1230 {
1231 return( false );
1232 }
1233
1234 b = b > 0. ? a - a / b : a;
1235
1236 Proj4 += CSG_String::Format(" +a=%f", a); // Semimajor radius of the ellipsoid axis
1237 Proj4 += CSG_String::Format(" +b=%f", b); // Semiminor radius of the ellipsoid axis
1238
1239 if( WKT("TOWGS84") && WKT["TOWGS84"].Get_Children_Count() == 7 )
1240 {
1241 Proj4 += " +towgs84=";
1242
1243 for(int i=0; i<7; i++)
1244 {
1245 if( i > 0 )
1246 {
1247 Proj4 += ",";
1248 }
1249
1250 Proj4 += WKT["TOWGS84"][i].Get_Content();
1251 }
1252 }
1253
1254 return( true );
1255 }
1256
1257 //---------------------------------------------------------
1258 bool CSG_Projections::WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) const
1259 {
1260 Proj4.Clear();
1261
1262 CSG_MetaData m = WKT_to_MetaData(WKT);
1263
1264 if( m.Get_Children_Count() == 0 )
1265 {
1266 return( false );
1267 }
1268
1269 //-----------------------------------------------------
1270 int Authority_Code;
1271 CSG_String Authority_Name;
1272
1273 if( m.Get_Property("authority_name", Authority_Name) && Authority_Name.CmpNoCase("EPSG") == 0
1274 && m.Get_Property("authority_code", Authority_Code) && EPSG_to_Proj4(Proj4, Authority_Code) )
1275 { // Proj4.Printf("+init=epsg:%d", Authority_Code);
1276 return( true );
1277 }
1278
1279 //-----------------------------------------------------
1280 double d;
1281
1282 //-----------------------------------------------------
1283 // GEOCCS["<name>",
1284 // DATUM ["<name>", ...],
1285 // PRIMEM ["<name>", <longitude>],
1286 // UNIT ["<name>", <conversion factor>],
1287 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER], AXIS...
1288 // ]
1289 if( m.Cmp_Name("GEOCCS") )
1290 {
1291 Proj4 = CSG_String::Format("+proj=geocent");
1292
1293 if( !m("DATUM") || !_WKT_to_Proj4_Set_Datum(Proj4, m["DATUM"]) )
1294 {
1295 return( false );
1296 }
1297
1298 if( m("PRIMEM") && m["PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1299 {
1300 Proj4 += CSG_String::Format(" +pm=%f", d);
1301 }
1302
1303 Proj4 += CSG_String::Format(" +no_defs"); // Don't use the /usr/share/proj/proj_def.dat defaults file
1304
1305 return( true );
1306 }
1307
1308 //-----------------------------------------------------
1309 // GEOGCS["<name>,
1310 // DATUM ["<name>", ...],
1311 // PRIMEM ["<name>", <longitude>],
1312 // UNIT ["<name>", <conversion factor>],
1313 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER], AXIS...
1314 // ]
1315 if( m.Cmp_Name("GEOGCS") )
1316 {
1317 Proj4 = "+proj=longlat";
1318
1319 if( !m("DATUM") || !_WKT_to_Proj4_Set_Datum(Proj4, m["DATUM"]) )
1320 {
1321 return( false );
1322 }
1323
1324 if( m("PRIMEM") && m["PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1325 {
1326 Proj4 += CSG_String::Format(" +pm=%f", d);
1327 }
1328
1329 Proj4 += CSG_String::Format(" +no_defs"); // Don't use the /usr/share/proj/proj_def.dat defaults file
1330
1331 return( true );
1332 }
1333
1334 //-----------------------------------------------------
1335 // PROJCS["<name>,
1336 // GEOGCS ["<name>, ...],
1337 // PROJECTION["<name>"],
1338 // *PARAMETER ["<name>", <value>], PARAMETER...
1339 // UNIT ["<name>", <conversion factor>],
1340 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER], AXIS...
1341 // ]
1342 if( m.Cmp_Name("PROJCS") && m("GEOGCS") && m("PROJECTION") && m_WKT_to_Proj4.Get_Translation(m["PROJECTION"].Get_Content(), Proj4) )
1343 {
1344 if( m["PROJECTION"].Cmp_Content("Transverse_Mercator") ) // UTM ???
1345 {
1346 double Scale = -1., Easting = -1., Northing = -1., Meridian = -1., Latitude = -1.;
1347
1348 for(int i=0; i<m.Get_Children_Count(); i++)
1349 {
1350 if( m[i].Cmp_Name("PARAMETER") )
1351 {
1352 double v;
1353
1354 if( m[i].Cmp_Property("name", "central_meridian" , true) && m[i].Get_Content().asDouble(v) ) Meridian = v;
1355 if( m[i].Cmp_Property("name", "latitude_of_origin", true) && m[i].Get_Content().asDouble(v) ) Latitude = v;
1356 if( m[i].Cmp_Property("name", "scale_factor" , true) && m[i].Get_Content().asDouble(v) ) Scale = v;
1357 if( m[i].Cmp_Property("name", "false_easting" , true) && m[i].Get_Content().asDouble(v) ) Easting = v;
1358 if( m[i].Cmp_Property("name", "false_northing" , true) && m[i].Get_Content().asDouble(v) ) Northing = v;
1359 }
1360 }
1361
1362 if( Latitude == 0. && Scale == 0.9996 && Easting == 500000. && (Northing == 0. || Northing == 10000000.) )
1363 {
1364 Proj4 = "+proj=utm";
1365
1366 if( !m["GEOGCS"]("DATUM") || !_WKT_to_Proj4_Set_Datum(Proj4, m["GEOGCS"]["DATUM"]) )
1367 {
1368 return( false );
1369 }
1370
1371 Proj4 += CSG_String::Format(" +zone=%d", (int)((183. + Meridian) / 6.));
1372
1373 if( Northing == 10000000. )
1374 {
1375 Proj4 += " +south";
1376 }
1377
1378 Proj4 += CSG_String::Format(" +no_defs"); // Don't use the /usr/share/proj/proj_def.dat defaults file
1379
1380 return( true );
1381 }
1382 }
1383
1384 //-------------------------------------------------
1385 Proj4 = "+proj=" + Proj4;
1386
1387 if( !m["GEOGCS"]("DATUM") || !_WKT_to_Proj4_Set_Datum(Proj4, m["GEOGCS"]["DATUM"]) )
1388 {
1389 return( false );
1390 }
1391
1392 if( m("PRIMEM") && m["PRIMEM"].Get_Content().asDouble(d) && d != 0. )
1393 {
1394 Proj4 += CSG_String::Format(" +pm=%f", d);
1395 }
1396
1397 for(int i=0; i<m.Get_Children_Count(); i++)
1398 {
1399 if( m[i].Cmp_Name("PARAMETER") )
1400 {
1401 CSG_String Parameter;
1402
1403 if( m_WKT_to_Proj4.Get_Translation(m[i].Get_Property("name"), Parameter) )
1404 {
1405 Proj4 += " +" + Parameter + "=" + m[i].Get_Content();
1406 }
1407 else
1408 {
1409 SG_UI_Msg_Add_Error(CSG_String::Format(">> WKT: %s [%s]", _TL("unknown parameter"), m[i].Get_Property("name")));
1410 }
1411 }
1412 }
1413
1414 if( m("UNIT") && m["UNIT"].Get_Content().asDouble(d) && d != 0. && d != 1. )
1415 {
1416 Proj4 += CSG_String::Format(" +to_meter=%f", d);
1417 }
1418
1419 Proj4 += CSG_String::Format(" +no_defs"); // Don't use the /usr/share/proj/proj_def.dat defaults file
1420
1421 return( true );
1422 }
1423
1424 //-----------------------------------------------------
1425 return( false );
1426 }
1427
1428
1430 // //
1432
1433 //---------------------------------------------------------
1434 bool CSG_Projections::_Proj4_Find_Parameter(const CSG_String &Proj4, const CSG_String &Key)
1435 {
1436 return( Proj4.Find("+" + Key) >= 0 );
1437 }
1438
1439 //---------------------------------------------------------
1440 bool CSG_Projections::_Proj4_Read_Parameter(CSG_String &Value, const CSG_String &Proj4, const CSG_String &Key)
1441 {
1442 Value.Clear();
1443
1444 int l, i = Proj4.Find("+" + Key + "=");
1445
1446 if( i >= 0 )
1447 {
1448 for(++i, l=0; l<2 && i<(int)Proj4.Length(); i++)
1449 {
1450 switch( Proj4[i] )
1451 {
1452 case '=': l++; break;
1453 case '+': l=2; break;
1454 case ' ': l=2; break;
1455 default:
1456 if( l == 1 )
1457 {
1458 Value += Proj4[i];
1459 }
1460 }
1461 }
1462 }
1463
1464 return( Value.Length() > 0 );
1465 }
1466
1467 //---------------------------------------------------------
1468 /* ellipsoids (a, b)
1469 { "MERIT" , "6378137.0" , "6356752.298" }, // MERIT 1983
1470 { "SGS85" , "6378136.0" , "6356751.302" }, // Soviet Geodetic System 85
1471 { "GRS80" , "6378137.0" , "6356752.314" }, // GRS 1980 (IUGG, 1980)
1472 { "IAU76" , "6378140.0" , "6356755.288" }, // IAU 1976
1473 { "airy" , "6377563.396" , "6356256.91" }, // Airy 1830
1474 { "APL4.9" , "6378137.0" , "6356751.796" }, // Appl. Physics. 1965
1475 { "NWL9D" , "6378145.0" , "6356759.769" }, // Naval Weapons Lab., 1965
1476 { "mod_airy" , "6377340.189" , "6356034.446" }, // Modified Airy
1477 { "andrae" , "6377104.43" , "6355847.415" }, // Andrae 1876 (Den., Iclnd.)
1478 { "aust_SA" , "6378160.0" , "6356774.719" }, // Australian Natl & S. Amer. 1969
1479 { "GRS67" , "6378160.0" , "6356774.516" }, // GRS 67 (IUGG 1967)
1480 { "bessel" , "6377397.155" , "6356078.963" }, // Bessel 1841
1481 { "bess_nam" , "6377483.865" , "6356165.383" }, // Bessel 1841 (Namibia)
1482 { "clrk66" , "6378206.4" , "6356583.8" }, // Clarke 1866
1483 { "clrk80" , "6378249.145" , "6356514.966" }, // Clarke 1880 mod.
1484 { "CPM" , "6375738.7" , "6356666.222" }, // Comm. des Poids et Mesures 1799
1485 { "delmbr" , "6376428.0" , "6355957.926" }, // Delambre 1810 (Belgium)
1486 { "engelis" , "6378136.05" , "6356751.323" }, // Engelis 1985
1487 { "evrst30" , "6377276.345" , "6356075.413" }, // Everest 1830
1488 { "evrst48" , "6377304.063" , "6356103.039" }, // Everest 1948
1489 { "evrst56" , "6377301.243" , "6356100.228" }, // Everest 1956
1490 { "evrst69" , "6377295.664" , "6356094.668" }, // Everest 1969
1491 { "evrstSS" , "6377298.556" , "6356097.55" }, // Everest (Sabah & Sarawak)
1492 { "fschr60" , "6378166.0" , "6356784.284" }, // Fischer (Mercury Datum) 1960
1493 { "fschr60m" , "6378155.0" , "6356773.32" }, // Modified Fischer 1960
1494 { "fschr68" , "6378150.0" , "6356768.337" }, // Fischer 1968
1495 { "helmert" , "6378200.0" , "6356818.17" }, // Helmert 1906
1496 { "hough" , "6378270.0" , "6356794.343" }, // Hough
1497 { "intl" , "6378388.0" , "6356911.946" }, // International 1909 (Hayford)
1498 { "krass" , "6378245.0" , "6356863.019" }, // Krassovsky, 1942
1499 { "kaula" , "6378163.0" , "6356776.992" }, // Kaula 1961
1500 { "lerch" , "6378139.0" , "6356754.292" }, // Lerch 1979
1501 { "mprts" , "6397300.0" , "6363806.283" }, // Maupertius 1738
1502 { "new_intl" , "6378157.5" , "6356772.2" }, // New International 1967
1503 { "plessis" , "6376523.0" , "6355863" }, // Plessis 1817 (France)
1504 { "SEasia" , "6378155.0" , "6356773.321" }, // Southeast Asia
1505 { "walbeck" , "6376896.0" , "6355834.847" }, // Walbeck
1506 { "WGS60" , "6378165.0" , "6356783.287" }, // WGS 60
1507 { "WGS66" , "6378145.0" , "6356759.769" }, // WGS 66
1508 { "WGS72" , "6378135.0" , "6356750.52" }, // WGS 72
1509 { "WGS84" , "6378137.0" , "6356752.314" }, // WGS 84
1510 { "sphere" , "6370997.0" , "6370997.0" } // Normal Sphere (r=6370997)
1511 */
1512
1513 bool CSG_Projections::_Proj4_Get_Ellipsoid(CSG_String &Value, const CSG_String &Proj4)
1514 {
1515 const char ellipsoid[42][2][32] =
1516 { // ellipsoid a b
1517 { "MERIT" , "6378137.0,298.257" }, // MERIT 1983
1518 { "SGS85" , "6378136.0,298.257" }, // Soviet Geodetic System 85
1519 { "GRS80" , "6378137.0,298.2572221" }, // GRS 1980 (IUGG, 1980)
1520 { "IAU76" , "6378140.0,298.257" }, // IAU 1976
1521 { "airy" , "6377563.396,299.3249753" }, // Airy 1830
1522 { "APL4.9" , "6378137.0,298.25" }, // Appl. Physics. 1965
1523 { "NWL9D" , "6378145.0,298.25" }, // Naval Weapons Lab., 1965
1524 { "mod_airy" , "6377340.189,299.3249374" }, // Modified Airy
1525 { "andrae" , "6377104.43,300" }, // Andrae 1876 (Den., Iclnd.)
1526 { "aust_SA" , "6378160.0,298.25" }, // Australian Natl & S. Amer. 1969
1527 { "GRS67" , "6378160.0,298.2471674" }, // GRS 67 (IUGG 1967)
1528 { "bessel" , "6377397.155,299.1528128" }, // Bessel 1841
1529 { "bess_nam" , "6377483.865,299.1528128" }, // Bessel 1841 (Namibia)
1530 { "clrk66" , "6378206.4,294.9786982" }, // Clarke 1866
1531 { "clrk80" , "6378249.145,293.4663" }, // Clarke 1880 mod.
1532 { "CPM" , "6375738.7,334.29" }, // Comm. des Poids et Mesures 1799
1533 { "delmbr" , "6376428.0,311.5" }, // Delambre 1810 (Belgium)
1534 { "engelis" , "6378136.05,298.2566" }, // Engelis 1985
1535 { "evrst30" , "6377276.345,300.8017" }, // Everest 1830
1536 { "evrst48" , "6377304.063,300.8017" }, // Everest 1948
1537 { "evrst56" , "6377301.243,300.8017" }, // Everest 1956
1538 { "evrst69" , "6377295.664,300.8017" }, // Everest 1969
1539 { "evrstSS" , "6377298.556,300.8017" }, // Everest (Sabah & Sarawak)
1540 { "fschr60" , "6378166.0,298.3" }, // Fischer (Mercury Datum) 1960
1541 { "fschr60m" , "6378155.0,298.3" }, // Modified Fischer 1960
1542 { "fschr68" , "6378150.0,298.3" }, // Fischer 1968
1543 { "helmert" , "6378200.0,298.3" }, // Helmert 1906
1544 { "hough" , "6378270.0,297" }, // Hough
1545 { "intl" , "6378388.0,297" }, // International 1909 (Hayford)
1546 { "krass" , "6378245.0,298.3" }, // Krassovsky, 1942
1547 { "kaula" , "6378163.0,298.24" }, // Kaula 1961
1548 { "lerch" , "6378139.0,298.257" }, // Lerch 1979
1549 { "mprts" , "6397300.0,191" }, // Maupertius 1738
1550 { "new_intl" , "6378157.5,298.2496154" }, // New International 1967
1551 { "plessis" , "6376523.0,308.6409971" }, // Plessis 1817 (France)
1552 { "SEasia" , "6378155.0,298.3000002" }, // Southeast Asia
1553 { "walbeck" , "6376896.0,302.7800002" }, // Walbeck
1554 { "WGS60" , "6378165.0,298.3" }, // WGS 60
1555 { "WGS66" , "6378145.0,298.25" }, // WGS 66
1556 { "WGS72" , "6378135.0,298.26" }, // WGS 72
1557 { "WGS84" , "6378137.0,298.2572236" }, // WGS 84
1558 { "sphere" , "6370997.0,-1" } // Normal Sphere (r=6370997)
1559 };
1560
1561 //-----------------------------------------------------
1562 if( _Proj4_Read_Parameter(Value, Proj4, "ellps") )
1563 {
1564 for(int i=0; i<42; i++)
1565 {
1566 if( !Value.CmpNoCase(ellipsoid[i][0]) )
1567 {
1568 Value.Printf("SPHEROID[\"%s\",%s]", SG_STR_MBTOSG(ellipsoid[i][0]), SG_STR_MBTOSG(ellipsoid[i][1]));
1569
1570 return( true );
1571 }
1572 }
1573 }
1574
1575 //-----------------------------------------------------
1576 double a, b;
1577
1578 a = _Proj4_Read_Parameter(Value, Proj4, "a" ) && Value.asDouble(a) ? a : 6378137.;
1579
1580 b = _Proj4_Read_Parameter(Value, Proj4, "b" ) && Value.asDouble(b) ? a / (a - b)
1581 : _Proj4_Read_Parameter(Value, Proj4, "rf") && Value.asDouble(b) ? b
1582 : _Proj4_Read_Parameter(Value, Proj4, "f" ) && Value.asDouble(b) ? 1. / b
1583 : _Proj4_Read_Parameter(Value, Proj4, "e" ) && Value.asDouble(b) ? a / (a - sqrt(b*b - a*a))
1584 : _Proj4_Read_Parameter(Value, Proj4, "es") && Value.asDouble(b) ? a / (a - sqrt( b - a*a))
1585 : 298.2572236;
1586
1587 Value = CSG_String::Format("SPHEROID[\"Ellipsoid\",%f,%f]", a, b);
1588
1589 return( true );
1590 }
1591
1592 //---------------------------------------------------------
1593 bool CSG_Projections::_Proj4_Get_Datum(CSG_String &Value, const CSG_String &Proj4)
1594 {
1595 const char datum[9][3][64] =
1596 { // datum_id ellipse definition
1597 { "WGS84" , "WGS84" , "0,0,0,0,0,0,0" },
1598 { "GGRS87" , "GRS80" , "-199.87,74.79,246.62,0,0,0,0" }, // Greek_Geodetic_Reference_System_1987
1599 { "NAD83" , "GRS80" , "0,0,0,0,0,0,0" }, // North_American_Datum_1983
1600 // { "NAD27" , "clrk66" , "nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat" }, // North_American_Datum_1927
1601 { "potsdam" , "bessel" , "606.0,23.0,413.0,0,0,0,0" }, // Potsdam Rauenberg 1950 DHDN
1602 { "carthage" , "clark80" , "-263.0,6.0,431.0,0,0,0,0" }, // Carthage 1934 Tunisia
1603 { "hermannskogel" , "bessel" , "653.0,-212.0,449.0,0,0,0,0" }, // Hermannskogel
1604 { "ire65" , "mod_airy" , "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15" }, // Ireland 1965
1605 { "nzgd49" , "intl" , "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993" }, // New Zealand Geodetic Datum 1949
1606 { "OSGB36" , "airy" , "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894" } // Airy 1830
1607 };
1608
1609 CSG_String Spheroid, ToWGS84;
1610
1611 //-----------------------------------------------------
1612 if( _Proj4_Read_Parameter(Value, Proj4, "datum") )
1613 {
1614 for(int i=0; i<9; i++)
1615 {
1616 if( !Value.CmpNoCase(datum[i][0]) && _Proj4_Get_Ellipsoid(Spheroid, CSG_String::Format("+ellps=%s", SG_STR_MBTOSG(datum[i][1]))) )
1617 {
1618 Value.Printf("DATUM[\"%s\",%s,TOWGS84[%s]]", SG_STR_MBTOSG(datum[i][0]), Spheroid.c_str(), SG_STR_MBTOSG(datum[i][2]));
1619
1620 return( true );
1621 }
1622 }
1623 }
1624
1625 //-----------------------------------------------------
1626 if( _Proj4_Get_Ellipsoid(Spheroid, Proj4) )
1627 {
1628 Value = "DATUM[\"Datum\","+ Spheroid;
1629
1630 if( _Proj4_Read_Parameter(ToWGS84, Proj4, "towgs84") )
1631 {
1632 CSG_Strings s = SG_String_Tokenize(ToWGS84, ",");
1633
1634 if( s.Get_Count() == 3 )
1635 {
1636 ToWGS84 += ",0,0,0,0";
1637 }
1638
1639 Value += ",TOWGS84[" + ToWGS84 + "]";
1640 }
1641 else
1642 {
1643 Value += ",TOWGS84[0,0,0,0,0,0,0]";
1644 }
1645
1646 Value += "]";
1647
1648 return( true );
1649 }
1650
1651 //-----------------------------------------------------
1652 Value = "DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]]";
1653
1654 return( false );
1655 }
1656
1657 //---------------------------------------------------------
1658 bool CSG_Projections::_Proj4_Get_Prime_Meridian(CSG_String &Value, const CSG_String &Proj4)
1659 {
1660 const char meridian[12][2][16] =
1661 {
1662 { "lisbon" , "-9.131906111" },
1663 { "paris" , "2.337229167" },
1664 { "bogota" , "74.08091667" },
1665 { "madrid" , "-3.687911111" },
1666 { "rome" , "12.45233333" },
1667 { "bern" , "7.439583333" },
1668 { "jakarta" , "106.8077194" },
1669 { "ferro" , "-17.66666667" },
1670 { "brussels" , "4.367975" },
1671 { "stockholm" , "18.05827778" },
1672 { "athens" , "23.7163375" },
1673 { "oslo" , "10.72291667" }
1674 };
1675
1676 //-----------------------------------------------------
1677 if( _Proj4_Read_Parameter(Value, Proj4, "pm") )
1678 {
1679 for(int i=0; i<12; i++)
1680 {
1681 if( !Value.CmpNoCase(meridian[i][0]) )
1682 {
1683 Value.Printf("PRIMEM[\"%s\",%s]", SG_STR_MBTOSG(meridian[i][0]), SG_STR_MBTOSG(meridian[i][1]));
1684
1685 return( true );
1686 }
1687 }
1688
1689 double d;
1690
1691 if( Value.asDouble(d) && d != 0. )
1692 {
1693 Value.Printf("PRIMEM[\"Prime_Meridian\",%f]", d);
1694
1695 return( true );
1696 }
1697 }
1698
1699 //-----------------------------------------------------
1700 Value = "PRIMEM[\"Greenwich\",0]";
1701
1702 return( false );
1703 }
1704
1705 //---------------------------------------------------------
1706 bool CSG_Projections::_Proj4_Get_Unit(CSG_String &Value, const CSG_String &Proj4)
1707 {
1708 //-----------------------------------------------------
1709 TSG_Projection_Unit Unit = _Proj4_Read_Parameter(Value, Proj4, "units") ? SG_Get_Projection_Unit(Value) : SG_PROJ_UNIT_Undefined;
1710
1711 if( Unit != SG_PROJ_UNIT_Undefined )
1712 {
1713 Value = "UNIT[\"" + SG_Get_Projection_Unit_Name(Unit) + "\"," + SG_Get_String(SG_Get_Projection_Unit_To_Meter(Unit), -16) + "]";
1714
1715 return( true );
1716 }
1717
1718 //-----------------------------------------------------
1719 double d;
1720
1721 if( _Proj4_Read_Parameter(Value, Proj4, "to_meter") && Value.asDouble(d) && d > 0. && d != 1. )
1722 {
1723 Value.Printf("UNIT[\"Unit\",%f]", d);
1724
1725 return( true );
1726 }
1727
1728 //-----------------------------------------------------
1729 Value = "UNIT[\"metre\",1]";
1730
1731 return( false );
1732 }
1733
1734 //---------------------------------------------------------
1735 bool CSG_Projections::WKT_from_Proj4(CSG_String &WKT, const CSG_String &Proj4) const
1736 {
1737 CSG_String Value, GeogCS, ProjCS;
1738
1739 //-----------------------------------------------------
1740 if( !_Proj4_Read_Parameter(ProjCS, Proj4, "proj") )
1741 {
1742 SG_UI_Msg_Add_Error(CSG_String::Format("Proj4 >> WKT: %s", _TL("no projection type defined")));
1743
1744 return( false );
1745 }
1746
1747 //-----------------------------------------------------
1748 // GEOGCS["<name>
1749 // DATUM ["<name>
1750 // SPHEROID["<name>", <semi-major axis>, <inverse flattening>],
1751 // *TOWGS84 [<dx>, <dy>, <dz>, <ex>, <ey>, <ez>, <ppm>]
1752 // ],
1753 // PRIMEM ["<name>", <longitude>],
1754 // UNIT ["<name>", <conversion factor>],
1755 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER],
1756 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
1757 // ]
1758
1759 GeogCS = "GEOGCS[\"GCS\",";
1760
1761 _Proj4_Get_Datum (Value, Proj4); GeogCS += Value; GeogCS += ",";
1762 _Proj4_Get_Prime_Meridian (Value, Proj4); GeogCS += Value; GeogCS += ",";
1763
1764 GeogCS += "UNIT[\"degree\",0.01745329251994328]]";
1765
1766 //-----------------------------------------------------
1767 if( !ProjCS.CmpNoCase("lonlat") || !ProjCS.CmpNoCase("longlat")
1768 || !ProjCS.CmpNoCase("latlon") || !ProjCS.CmpNoCase("latlong") )
1769 {
1770 WKT = GeogCS;
1771
1772 return( true );
1773 }
1774
1775 //-----------------------------------------------------
1776 // PROJCS["<name>
1777 // GEOGCS [ ...... ],
1778 // PROJECTION["<name>"],
1779 // *PARAMETER ["<name>", <value>], ...
1780 // UNIT ["<name>", <conversion factor>],
1781 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER],
1782 // *AXIS ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
1783 // ]
1784
1785 if( !m_Proj4_to_WKT.Get_Translation(ProjCS, Value) )
1786 {
1787 SG_UI_Msg_Add_Error(CSG_String::Format("Proj4 >> WKT: %s [%s]", _TL("no translation available"), ProjCS.c_str()));
1788
1789 // return( false );
1790 }
1791
1792 //-----------------------------------------------------
1793 // UTM ...
1794
1795 if( !ProjCS.CmpNoCase("utm") )
1796 {
1797 double Zone;
1798
1799 if( !_Proj4_Read_Parameter(Value, Proj4, "zone") || !Value.asDouble(Zone) )
1800 {
1801 SG_UI_Msg_Add_Error(CSG_String::Format("Proj4 >> WKT: %s", _TL("invalid utm zone")));
1802
1803 return( false );
1804 }
1805
1806 bool South = _Proj4_Find_Parameter(Proj4, "south");
1807
1808 WKT = CSG_String::Format("PROJCS[\"UTM zone %d%c\",%s,PROJECTION[Transverse_Mercator]", (int)Zone, South ? 'S' : 'N', GeogCS.c_str());
1809
1810 WKT += CSG_String::Format(",PARAMETER[\"%s\",%d]", SG_T("latitude_of_origin"), 0);
1811 WKT += CSG_String::Format(",PARAMETER[\"%s\",%d]", SG_T("central_meridian" ), (int)(Zone * 6 - 183));
1812 WKT += CSG_String::Format(",PARAMETER[\"%s\",%f]", SG_T("scale_factor" ), 0.9996);
1813 WKT += CSG_String::Format(",PARAMETER[\"%s\",%d]", SG_T("false_easting" ), 500000);
1814 WKT += CSG_String::Format(",PARAMETER[\"%s\",%d]", SG_T("false_northing" ), South ? 10000000 : 0);
1815 WKT += ",UNIT[\"metre\",1]]";
1816
1817 return( true );
1818 }
1819
1820 //-----------------------------------------------------
1821 // Parameters ...
1822
1823 WKT = CSG_String::Format("PROJCS[\"%s\",%s,PROJECTION[%s]", Value.c_str(), GeogCS.c_str(), Value.c_str());
1824
1825 ProjCS = Proj4;
1826
1827 while( ProjCS.Find('+') >= 0 )
1828 {
1829 CSG_String Key;
1830
1831 ProjCS = ProjCS.AfterFirst ('+');
1832 Value = ProjCS.BeforeFirst('=');
1833
1834 if( m_Proj4_to_WKT.Get_Translation(Value, Key) )
1835 {
1836 Value = ProjCS.AfterFirst('=');
1837
1838 if( Value.Find('+') >= 0 )
1839 {
1840 Value = Value.BeforeFirst('+');
1841 }
1842
1843 WKT += ",PARAMETER[\"" + Key + "\"," + Value + "]";
1844 }
1845 }
1846
1847 //-----------------------------------------------------
1848 // Unit ...
1849
1850 _Proj4_Get_Unit(Value, Proj4);
1851
1852 WKT += "," + Value + "]";
1853
1854 //-----------------------------------------------------
1855 return( true );
1856 }
1857
1858
1860 // //
1861 // //
1862 // //
1864
1865 //---------------------------------------------------------
1866 bool CSG_Projections::_Set_Dictionary(CSG_Table &Dictionary, int Direction)
1867 {
1868 const int n = 214; const char Translation[n][4][128] = {
1869 // { PROJ4 , DIR , WELL-KNOWN-TEXT , DESCRIPTION, *) projection type not verified
1870
1871 // --- projection types ---
1872 { "aea" , " ", "Albers_Conic_Equal_Area" , "Albers Equal Area" },
1873 { "aea" , "<", "Albers" , "[ESRI] Albers Equal Area" },
1874 { "aeqd" , " ", "Azimuthal_Equidistant" , "Azimuthal Equidistant" },
1875 { "airy" , " ", "Airy 1830" , "Airy 1830" },
1876 { "aitoff" , " ", "Sphere_Aitoff" , "Aitoff" },
1877 { "alsk" , " ", "Mod_Stererographics_of_Alaska" , "*) Mod. Stererographics of Alaska" },
1878 { "apian" , " ", "Apian_Globular_I" , "*) Apian Globular I" },
1879 { "august" , " ", "August_Epicycloidal" , "*) August Epicycloidal" },
1880 { "bacon" , " ", "Bacon_Globular" , "*) Bacon Globular" },
1881 { "bipc" , " ", "Bipolar_conic_of_western_hemisphere" , "*) Bipolar conic of western hemisphere" },
1882 { "boggs" , " ", "Boggs_Eumorphic" , "*) Boggs Eumorphic" },
1883 { "bonne" , " ", "Bonne" , "Bonne (Werner lat_1=90)" },
1884 { "cass" , " ", "Cassini_Soldner" , "Cassini" },
1885 { "cass" , "<", "Cassini" , "[ESRI] Cassini" },
1886 { "cc" , " ", "Central_Cylindrical" , "*) Central Cylindrical" },
1887 { "cea" , " ", "Cylindrical_Equal_Area" , "Equal Area Cylindrical, alias: Lambert Cyl.Eq.A., Normal Authalic Cyl. (FME), Behrmann (SP=30), Gall Orthogr. (SP=45)" },
1888 { "cea" , "<", "Behrmann" , "[ESRI] Behrmann (standard parallel = 30)" },
1889 { "chamb" , " ", "Chamberlin_Trimetric" , "*) Chamberlin Trimetric" },
1890 { "collg" , " ", "Collignon" , "*) Collignon" },
1891 { "crast" , " ", "Craster_Parabolic" , "[ESRI] Craster Parabolic (Putnins P4)" },
1892 { "denoy" , " ", "Denoyer_Semi_Elliptical" , "*) Denoyer Semi-Elliptical" },
1893 { "eck1" , " ", "Eckert_I" , "*) Eckert I" },
1894 { "eck2" , " ", "Eckert_II" , "*) Eckert II" },
1895 { "eck3" , " ", "Eckert_III" , "*) Eckert III" },
1896 { "eck4" , " ", "Eckert_IV" , "Eckert IV" },
1897 { "eck5" , " ", "Eckert_V" , "*) Eckert V" },
1898 { "eck6" , " ", "Eckert_VI" , "Eckert VI" },
1899 { "eqearth" , " ", "Equal_Earth" , "*) Equal Earth" },
1900 { "eqc" , " ", "Equirectangular" , "Equidistant Cylindrical (Plate Caree)" },
1901 { "eqc" , "<", "Equidistant_Cylindrical" , "[ESRI] Equidistant Cylindrical (Plate Caree)" },
1902 { "eqc" , "<", "Plate_Carree" , "[ESRI] Equidistant Cylindrical (Plate Caree)" },
1903 { "eqdc" , " ", "Equidistant_Conic" , "*) Equidistant Conic" },
1904 { "euler" , " ", "Euler" , "*) Euler" },
1905 { "etmerc" , " ", "Extended_Transverse_Mercator" , "*) Extended Transverse Mercator" },
1906 { "fahey" , " ", "Fahey" , "*) Fahey" },
1907 { "fouc" , " ", "Foucault" , "*) Foucaut" },
1908 { "fouc_s" , " ", "Foucault_Sinusoidal" , "*) Foucaut Sinusoidal" },
1909 { "gall" , " ", "Gall_Stereographic" , "Gall (Gall Stereographic)" },
1910 { "geocent" , " ", "Geocentric" , "*) Geocentric" },
1911 { "geos" , " ", "GEOS" , "Geostationary Satellite View" },
1912 { "gins8" , " ", "Ginsburg_VIII" , "*) Ginsburg VIII (TsNIIGAiK)" },
1913 { "gn_sinu" , " ", "General_Sinusoidal_Series" , "*) General Sinusoidal Series" },
1914 { "gnom" , " ", "Gnomonic" , "Gnomonic" },
1915 { "goode" , " ", "Goode_Homolosine" , "*) Goode Homolosine" },
1916 { "gs48" , " ", "Mod_Stererographics_48" , "*) Mod. Stererographics of 48 U.S." },
1917 { "gs50" , " ", "Mod_Stererographics_50" , "*) Mod. Stererographics of 50 U.S." },
1918 { "hammer" , " ", "Hammer_Eckert_Greifendorff" , "*) Hammer & Eckert-Greifendorff" },
1919 { "hatano" , " ", "Hatano_Asymmetrical_Equal_Area" , "*) Hatano Asymmetrical Equal Area" },
1920 { "igh" , " ", "Interrupted_Goodes_Homolosine" , "*) Interrupted Goode's Homolosine" },
1921 { "igh_o" , " ", "Interrupted_Goodes_Homolosine_Ocean" , "*) Interrupted Goode's Homolosine (Ocean)" },
1922 { "imw_p" , " ", "International_Map_of_the_World_Polyconic" , "*) International Map of the World Polyconic" },
1923 { "kav5" , " ", "Kavraisky_V" , "*) Kavraisky V" },
1924 { "kav7" , " ", "Kavraisky_VII" , "*) Kavraisky VII" },
1925 { "krovak" , " ", "Krovak" , "Krovak" },
1926 { "labrd" , " ", "Laborde_Oblique_Mercator" , "*) Laborde" },
1927 { "laea" , " ", "Lambert_Azimuthal_Equal_Area" , "Lambert Azimuthal Equal Area" },
1928 { "lagrng" , " ", "Lagrange" , "*) Lagrange" },
1929 { "larr" , " ", "Larrivee" , "*) Larrivee" },
1930 { "lask" , " ", "Laskowski" , "*) Laskowski" },
1931 { "lcc" , "<", "Lambert_Conformal_Conic_1SP" , "Lambert Conformal Conic (1 standard parallel)" },
1932 { "lcc" , "<", "Lambert_Conformal_Conic_2SP" , "Lambert Conformal Conic (2 standard parallels)" },
1933 { "lcc" , " ", "Lambert_Conformal_Conic" , "Lambert Conformal Conic" },
1934 { "lcca" , " ", "Lambert_Conformal_Conic_Alternative" , "*) Lambert Conformal Conic Alternative" },
1935 { "leac" , " ", "Lambert_Equal_Area_Conic" , "*) Lambert Equal Area Conic" },
1936 { "lee_os" , " ", "Lee_Oblated_Stereographic" , "*) Lee Oblated Stereographic" },
1937 { "loxim" , " ", "Loximuthal" , "[ESRI] Loximuthal" },
1938 { "lsat" , " ", "Space_oblique_for_LANDSAT" , "*) Space oblique for LANDSAT" },
1939 { "mbt_s" , " ", "McBryde_Thomas_Flat_Polar_Sine" , "*) McBryde-Thomas Flat-Polar Sine" },
1940 { "mbt_fps" , " ", "McBryde_Thomas_Flat_Polar_Sine_2" , "*) McBryde-Thomas Flat-Pole Sine (No. 2)" },
1941 { "mbtfpp" , " ", "McBryde_Thomas_Flat_Polar_Parabolic" , "*) McBride-Thomas Flat-Polar Parabolic" },
1942 { "mbtfpq" , " ", "Flat_Polar_Quartic" , "[ESRI] McBryde-Thomas Flat-Polar Quartic" },
1943 { "mbtfps" , " ", "McBryde_Thomas_Flat_Polar_Sinusoidal" , "*) McBryde-Thomas Flat-Polar Sinusoidal" },
1944 { "merc" , " ", "Mercator" , "[ESRI] Mercator" },
1945 { "merc" , "<", "Mercator_1SP" , "Mercator (1 standard parallel)" },
1946 { "merc" , "<", "Mercator_2SP" , "Mercator (2 standard parallels)" },
1947 { "mil_os" , " ", "Miller_Oblated_Stereographic" , "*) Miller Oblated Stereographic" },
1948 { "mill" , " ", "Miller_Cylindrical" , "Miller Cylindrical" },
1949 { "moll" , " ", "Mollweide" , "Mollweide" },
1950 { "murd1" , " ", "Murdoch_I" , "*) Murdoch I" },
1951 { "murd2" , " ", "Murdoch_II" , "*) Murdoch II" },
1952 { "murd3" , " ", "Murdoch_III" , "*) Murdoch III" },
1953 { "nell" , " ", "Nell" , "*) Nell" },
1954 { "nell_h" , " ", "Nell_Hammer" , "*) Nell-Hammer" },
1955 { "nicol" , " ", "Nicolosi_Globular" , "*) Nicolosi Globular" },
1956 { "nsper" , " ", "Near_sided_perspective" , "*) Near-sided perspective" },
1957 { "nzmg" , " ", "New_Zealand_Map_Grid" , "New Zealand Map Grid" },
1958 { "ob_tran" , " ", "General_Oblique_Transformation" , "*) General Oblique Transformation" },
1959 { "ocea" , " ", "Oblique_Cylindrical_Equal_Area" , "*) Oblique Cylindrical Equal Area" },
1960 { "oea" , " ", "Oblated_Equal_Area" , "*) Oblated Equal Area" },
1961 { "omerc" , " ", "Hotine_Oblique_Mercator" , "Oblique Mercator" },
1962 { "omerc" , "<", "Oblique_Mercator" , "Oblique Mercator" },
1963 { "ortel" , " ", "Ortelius_Oval" , "*) Ortelius Oval" },
1964 { "ortho" , " ", "Orthographic" , "Orthographic (ESRI: World from Space)" },
1965 { "pconic" , " ", "Perspective_Conic" , "*) Perspective Conic" },
1966 { "poly" , " ", "Polyconic" , "*) Polyconic (American)" },
1967 { "putp1" , " ", "Putnins_P1" , "*) Putnins P1" },
1968 { "putp2" , " ", "Putnins_P2" , "*) Putnins P2" },
1969 { "putp3" , " ", "Putnins_P3" , "*) Putnins P3" },
1970 { "putp3p" , " ", "Putnins_P3'" , "*) Putnins P3'" },
1971 { "putp4p" , " ", "Putnins_P4'" , "*) Putnins P4'" },
1972 { "putp5" , " ", "Putnins_P5" , "*) Putnins P5" },
1973 { "putp5p" , " ", "Putnins_P5'" , "*) Putnins P5'" },
1974 { "putp6" , " ", "Putnins_P6" , "*) Putnins P6" },
1975 { "putp6p" , " ", "Putnins_P6'" , "*) Putnins P6'" },
1976 { "qua_aut" , " ", "Quartic_Authalic" , "[ESRI] Quart c Authalic" },
1977 { "robin" , " ", "Robinson" , "Robinson" },
1978 { "rouss" , " ", "Roussilhe_Stereographic" , "*) Roussilhe Stereographic" },
1979 { "rpoly" , " ", "Rectangular_Polyconic" , "*) Rectangular Polyconic" },
1980 { "sinu" , " ", "Sinusoidal" , "Sinusoidal (Sanson-Flamsteed)" },
1981 { "somerc" , " ", "Hotine_Oblique_Mercator" , "Swiss Oblique Mercator" },
1982 { "somerc" , "<", "Swiss_Oblique_Cylindrical" , "Swiss Oblique Cylindrical" },
1983 { "somerc" , "<", "Hotine_Oblique_Mercator_Azimuth_Center" , "[ESRI] Swiss Oblique Mercator/Cylindrical" },
1984 { "stere" , "<", "Polar_Stereographic" , "Stereographic" },
1985 { "stere" , " ", "Stereographic" , "[ESRI] Stereographic" },
1986 { "sterea" , " ", "Oblique_Stereographic" , "Oblique Stereographic Alternative" },
1987 { "sterea" , "<", "Double_Stereographic" , "[ESRI]" },
1988 { "gstmerc" , " ", "Gauss_Schreiber_Transverse_Mercator" , "*) Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)" },
1989 { "tcc" , " ", "Transverse_Central_Cylindrical" , "*) Transverse Central Cylindrical" },
1990 { "tcea" , " ", "Transverse_Cylindrical_Equal_Area" , "*) Transverse Cylindrical Equal Area" },
1991 { "tissot" , " ", "Tissot_Conic" , "*) Tissot Conic" },
1992 { "tmerc" , " ", "Transverse_Mercator" , "*) Transverse Mercator" },
1993 { "tmerc" , "<", "Gauss_Kruger" , "[ESRI] DHDN" },
1994 { "tpeqd" , " ", "Two_Point_Equidistant" , "*) Two Point Equidistant" },
1995 { "tpers" , " ", "Tilted_perspective" , "*) Tilted perspective" },
1996 { "ups" , " ", "Universal_Polar_Stereographic" , "*) Universal Polar Stereographic" },
1997 { "urm5" , " ", "Urmaev_V" , "*) Urmaev V" },
1998 { "urmfps" , " ", "Urmaev_Flat_Polar_Sinusoidal" , "*) Urmaev Flat-Polar Sinusoidal" },
1999 { "utm" , ">", "Transverse_Mercator" , "*) Universal Transverse Mercator (UTM)" },
2000 { "vandg" , "<", "Van_Der_Grinten_I" , "[ESRI] van der Grinten (I)" },
2001 { "vandg" , " ", "VanDerGrinten" , "van der Grinten (I)" },
2002 { "vandg2" , " ", "VanDerGrinten_II" , "*) van der Grinten II" },
2003 { "vandg3" , " ", "VanDerGrinten_III" , "*) van der Grinten III" },
2004 { "vandg4" , " ", "VanDerGrinten_IV" , "*) van der Grinten IV" },
2005 { "vitk1" , " ", "Vitkovsky_I" , "*) Vitkovsky I" },
2006 { "wag1" , " ", "Wagner_I" , "*) Wagner I (Kavraisky VI)" },
2007 { "wag2" , " ", "Wagner_II" , "*) Wagner II" },
2008 { "wag3" , " ", "Wagner_III" , "*) Wagner III" },
2009 { "wag4" , " ", "Wagner_IV" , "*) Wagner IV" },
2010 { "wag5" , " ", "Wagner_V" , "*) Wagner V" },
2011 { "wag6" , " ", "Wagner_VI" , "*) Wagner VI" },
2012 { "wag7" , " ", "Wagner_VII" , "*) Wagner VII" },
2013 { "webmerc" , " ", "Mercator_1SP" , "Web Mercator" },
2014 { "webmerc" , "<", "Mercator_Auxiliary_Sphere" , "[ESRI] Web Mercator" },
2015 { "weren" , " ", "Werenskiold_I" , "*) Werenskiold I" },
2016 { "wink1" , " ", "Winkel_I" , "[ESRI] Winkel I" },
2017 { "wink2" , " ", "Winkel_II" , "[ESRI] Winkel II" },
2018 { "wintri" , " ", "Winkel_Tripel" , "[ESRI] Winkel Tripel" },
2019
2020 // --- general projection parameters ---
2021 { "alpha" , " ", "azimuth" , "? Used with Oblique Mercator and possibly a few others" },
2022 { "k" , ">", "scale_factor" , "Scaling factor (old name)" },
2023 { "K" , ">", "scale_factor" , "? Scaling factor (old name)" },
2024 { "k_0" , " ", "scale_factor" , "Scaling factor (new name)" },
2025 { "lat_0" , " ", "latitude_of_origin" , "Latitude of origin" },
2026 { "lat_0" , "<", "latitude_of_center" , "Latitude of center" },
2027 { "lat_0" , "<", "central_parallel" , "[ESRI] Latitude of center" },
2028 { "lat_1" , " ", "standard_parallel_1" , "Latitude of first standard parallel" },
2029 { "lat_2" , " ", "standard_parallel_2" , "Latitude of second standard parallel" },
2030 { "lat_ts" , ">", "latitude_of_origin" , "Latitude of true scale" },
2031 { "lon_0" , " ", "central_meridian" , "Central meridian" },
2032 { "lon_0" , "<", "longitude_of_center" , "Longitude of center" },
2033 { "lonc" , ">", "longitude_of_center" , "? Longitude used with Oblique Mercator and possibly a few others" },
2034 { "x_0" , " ", "false_easting" , "False easting" },
2035 { "y_0" , " ", "false_northing" , "False northing" },
2036
2037 // --- special projection parameters ---
2038 { "azi" , " ", "", "" },
2039 { "belgium" , " ", "", "" },
2040 { "beta" , " ", "", "" },
2041 { "czech" , " ", "", "" },
2042 { "gamma" , " ", "", "" },
2043 { "geoc" , " ", "", "" },
2044 { "guam" , " ", "", "" },
2045 { "h" , " ", "satellite_height", "Satellite height (geos - Geostationary Satellite View)" },
2046 { "lat_b" , " ", "", "" },
2047 { "lat_t" , " ", "", "" },
2048 { "lon_1" , " ", "", "" },
2049 { "lon_2" , " ", "", "" },
2050 { "lsat" , " ", "", "" },
2051 { "m" , " ", "", "" },
2052 { "M" , " ", "", "" },
2053 { "n" , " ", "", "" },
2054 { "no_cut" , " ", "", "" },
2055 { "no_off" , " ", "", "" },
2056 { "no_rot" , " ", "", "" },
2057 { "ns" , " ", "", "" },
2058 { "o_alpha" , " ", "", "" },
2059 { "o_lat_1" , " ", "", "" },
2060 { "o_lat_2" , " ", "", "" },
2061 { "o_lat_c" , " ", "", "" },
2062 { "o_lat_p" , " ", "", "" },
2063 { "o_lon_1" , " ", "", "" },
2064 { "o_lon_2" , " ", "", "" },
2065 { "o_lon_c" , " ", "", "" },
2066 { "o_lon_p" , " ", "", "" },
2067 { "o_proj" , " ", "", "" },
2068 { "over" , " ", "", "" },
2069 { "p" , " ", "", "" },
2070 { "path" , " ", "", "" },
2071 { "q" , " ", "", "" },
2072 { "R" , " ", "", "" },
2073 { "R_a" , " ", "", "" },
2074 { "R_A" , " ", "", "" },
2075 { "R_g" , " ", "", "" },
2076 { "R_h" , " ", "", "" },
2077 { "R_lat_a" , " ", "", "" },
2078 { "R_lat_g" , " ", "", "" },
2079 { "rot" , " ", "", "" },
2080 { "R_V" , " ", "", "" },
2081 { "s" , " ", "", "" },
2082 { "sym" , " ", "", "" },
2083 { "t" , " ", "", "" },
2084 { "theta" , " ", "", "" },
2085 { "tilt" , " ", "", "" },
2086 { "vopt" , " ", "", "" },
2087 { "W" , " ", "", "" },
2088 { "westo" , " ", "", "" },
2089
2090 // --- core projection types and parameters that don't require explicit translation ---
2091 // { "lonlat" , " ", "GEOGCS", "Lat/long (Geodetic)" },
2092 // { "latlon" , ">", "GEOGCS", "Lat/long (Geodetic alias)" },
2093 // { "latlong" , ">", "GEOGCS", "Lat/long (Geodetic alias)" },
2094 // { "longlat" , ">", "GEOGCS", "Lat/long (Geodetic alias)" },
2095
2096 // { "a" , " ", "", "Semimajor radius of the ellipsoid axis" },
2097 // { "axis" , " ", "", "Axis orientation (new in 4.8.0)" },
2098 // { "b , " ", "", "Semiminor radius of the ellipsoid axis" },
2099 // { "datum , " ", "", "Datum name (see `proj -ld`)" },
2100 // { "ellps , " ", "", "Ellipsoid name (see `proj -le`)" },
2101 // { "nadgrids , " ", "", "Filename of NTv2 grid file to use for datum transforms (see below)" },
2102 // { "no_defs , " ", "", "Don't use the /usr/share/proj/proj_def.dat defaults file" },
2103 // { "pm , " ", "", "Alternate prime meridian (typically a city name, see below)" },
2104 // { "proj , " ", "", "Projection name (see `proj -l`)" },
2105 // { "to_meter , " ", "", "Multiplier to convert map units to 1.0m" },
2106 // { "towgs84 , " ", "", "3 or 7 term datum transform parameters (see below)" },
2107 // { "units , " ", "", "meters, US survey feet, etc." },
2108 // { "south , " ", "", "Denotes southern hemisphere UTM zone" },
2109 // { "zone , " ", "", "UTM zone" },
2110 // { "lon_wrap" , " ", "", "Center longitude to use for wrapping (see below)" },
2111 // { "over" , " ", "", "Allow longitude output outside -180 to 180 range, disables wrapping (see below)" },
2112 { "" , " ", "", "" } }; // dummy
2113
2114 //-----------------------------------------------------
2115 Dictionary.Destroy();
2116 Dictionary.Set_Name("Proj.4-WKT Dictionary");
2117
2118 if( Direction == 0 )
2119 {
2120 Dictionary.Add_Field("PROJ4", SG_DATATYPE_String);
2121 Dictionary.Add_Field("DIR" , SG_DATATYPE_String);
2122 Dictionary.Add_Field("WKT" , SG_DATATYPE_String);
2123 Dictionary.Add_Field("DESC" , SG_DATATYPE_String);
2124
2125 for(int i=0; i<n; i++)
2126 {
2127 CSG_Table_Record &Entry = *Dictionary.Add_Record();
2128
2129 Entry.Set_Value(0, Translation[i][0]);
2130 Entry.Set_Value(1, Translation[i][1]);
2131 Entry.Set_Value(2, Translation[i][2]);
2132 Entry.Set_Value(3, Translation[i][3]);
2133 }
2134 }
2135 else if( Direction > 0 ) // Proj4 to WKT
2136 {
2137 Dictionary.Add_Field("PROJ4", SG_DATATYPE_String);
2138 Dictionary.Add_Field("WKT" , SG_DATATYPE_String);
2139
2140 for(int i=0; i<n; i++)
2141 {
2142 if( Translation[i][1][0] != '<' ) // only WKT to Proj4
2143 {
2144 CSG_Table_Record &Entry = *Dictionary.Add_Record();
2145
2146 Entry.Set_Value(0, Translation[i][0]);
2147 Entry.Set_Value(1, Translation[i][2]);
2148 }
2149 }
2150 }
2151 else if( Direction < 0 ) // WKT to Proj4
2152 {
2153 Dictionary.Add_Field("WKT" , SG_DATATYPE_String);
2154 Dictionary.Add_Field("PROJ4", SG_DATATYPE_String);
2155
2156 for(int i=0; i<n; i++)
2157 {
2158 if( Translation[i][1][0] != '>' ) // only Proj4 to WKT
2159 {
2160 CSG_Table_Record &Entry = *Dictionary.Add_Record();
2161
2162 Entry.Set_Value(0, Translation[i][2]);
2163 Entry.Set_Value(1, Translation[i][0]);
2164 }
2165 }
2166 }
2167
2168 return( Dictionary.Get_Count() > 0 );
2169 }
2170
2171 //---------------------------------------------------------
2172 bool CSG_Projections::_Set_Dictionary(CSG_Translator &Dictionary, int Direction)
2173 {
2174 CSG_Table Table;
2175
2176 return( _Set_Dictionary(Table, Direction) && Dictionary.Create(&Table, 0, 1, true) );
2177 }
2178
2179
2181 // //
2182 // //
2183 // //
2185
2186 //---------------------------------------------------------
2187 #include "shapes.h"
2188 #include "tool_library.h"
2189
2190 //---------------------------------------------------------
2191 bool SG_Get_Projected (CSG_Shapes *pSource, CSG_Shapes *pTarget, const CSG_Projection &Target)
2192 {
2193 if( !pSource || !pSource->is_Valid() )
2194 {
2195 return( false );
2196 }
2197
2198 if( pSource->Get_Projection() == Target )
2199 {
2200 return( pTarget ? pTarget->Create(*pSource) : true );
2201 }
2202
2203 if( !pSource->Get_Projection().is_Okay() || !Target.is_Okay() )
2204 {
2205 return( false );
2206 }
2207
2208 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("pj_proj4", 2); // Coordinate Transformation (Shapes)
2209
2210 SG_UI_ProgressAndMsg_Lock(true);
2211
2212 bool bResult = pTool && pTool->Set_Manager(NULL);
2213
2214 if( bResult )
2215 {
2216 pTool->Set_Parameter("CRS_PROJ4", Target.Get_Proj4());
2217 pTool->Set_Parameter("SOURCE" , pSource);
2218 pTool->Set_Parameter("TARGET" , pTarget);
2219 pTool->Set_Parameter("COPY" , pTarget ? true : false);
2220 pTool->Set_Parameter("PARALLEL" , true);
2221
2222 bResult = pTool->Execute();
2223 }
2224
2225 SG_UI_ProgressAndMsg_Lock(false);
2226
2227 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
2228
2229 return( bResult );
2230 }
2231
2232 //---------------------------------------------------------
2233 bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point)
2234 {
2235 if( Source == Target )
2236 {
2237 return( true );
2238 }
2239
2240 if( Source.is_Okay() && Target.is_Okay() )
2241 {
2242 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("pj_proj4", 29); // Single Coordinate Transformation
2243
2244 SG_UI_ProgressAndMsg_Lock(true);
2245
2246 bool bResult = pTool && pTool->Set_Manager(NULL)
2247 && pTool->Set_Parameter("TARGET_CRS", Target.Get_Proj4())
2248 && pTool->Set_Parameter("SOURCE_CRS", Source.Get_Proj4())
2249 && pTool->Set_Parameter("SOURCE_X" , Point.x)
2250 && pTool->Set_Parameter("SOURCE_Y" , Point.y)
2251 && pTool->Execute();
2252
2253 if( bResult )
2254 {
2255 Point.x = pTool->Get_Parameter("TARGET_X")->asDouble();
2256 Point.y = pTool->Get_Parameter("TARGET_Y")->asDouble();
2257 }
2258
2259 SG_UI_ProgressAndMsg_Lock(false);
2260
2261 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
2262
2263 return( bResult );
2264 }
2265
2266 return( false );
2267 }
2268
2269 //---------------------------------------------------------
2270 bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle)
2271 {
2272 if( Source == Target )
2273 {
2274 return( true );
2275 }
2276
2277 if( Source.is_Okay() && Target.is_Okay() )
2278 {
2279 CSG_Shapes Points[2];
2280
2281 Points[0].Create(SHAPE_TYPE_Point);
2282 Points[0].Get_Projection().Create(Source);
2283 Points[0].Add_Shape()->Add_Point(Rectangle.xMin, Rectangle.yMin);
2284 Points[0].Add_Shape()->Add_Point(Rectangle.xMin, Rectangle.yMax);
2285 Points[0].Add_Shape()->Add_Point(Rectangle.xMax, Rectangle.yMax);
2286 Points[0].Add_Shape()->Add_Point(Rectangle.xMax, Rectangle.yMin);
2287
2288 if( SG_Get_Projected(&Points[0], &Points[1], Target) )
2289 {
2290 Rectangle = Points[1].Get_Extent();
2291
2292 return( true );
2293 }
2294 }
2295
2296 return( false );
2297 }
2298
2299
2301 // //
2302 // //
2303 // //
2305
2306 //---------------------------------------------------------
2307 bool SG_Grid_Get_Geographic_Coordinates (CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
2308 {
2309 bool bResult = false;
2310
2311 if( pGrid && pGrid->is_Valid() && pGrid->Get_Projection().is_Okay() && (pLon || pLat) )
2312 {
2313 CSG_Grid Lon; if( !pLon ) { pLon = &Lon; } pLon->Create(pGrid->Get_System());
2314 CSG_Grid Lat; if( !pLat ) { pLat = &Lat; } pLat->Create(pGrid->Get_System());
2315
2316 SG_RUN_TOOL(bResult, "pj_proj4", 17, // geographic coordinate grids
2317 SG_TOOL_PARAMETER_SET("GRID", pGrid)
2318 && SG_TOOL_PARAMETER_SET("LON" , pLon )
2319 && SG_TOOL_PARAMETER_SET("LAT" , pLat )
2320 )
2321 }
2322
2323 return( bResult );
2324 }
2325
2326
2328 // //
2329 // //
2330 // //
2332
2333 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
SG_PROJ_UNIT_Indian_Foot
@ SG_PROJ_UNIT_Indian_Foot
Definition: geo_tools.h:810
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
SG_PROJ_UNIT_Int_Chain
@ SG_PROJ_UNIT_Int_Chain
Definition: geo_tools.h:802
SG_PROJ_UNIT_US_Statute_Mile
@ SG_PROJ_UNIT_US_Statute_Mile
Definition: geo_tools.h:808
CSG_Translator
Definition: api_core.h:1424
SG_T
#define SG_T(s)
Definition: api_core.h:531
SG_Get_Projection_Unit
TSG_Projection_Unit SG_Get_Projection_Unit(const CSG_String &Identifier)
Definition: projections.cpp:144
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_Projection::Assign
bool Assign(const CSG_Projection &Projection)
Definition: projections.cpp:257
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Projections::WKT_to_MetaData
static CSG_MetaData WKT_to_MetaData(const CSG_String &WKT)
Definition: projections.cpp:1189
SG_PROJ_TYPE_CS_Geographic
@ SG_PROJ_TYPE_CS_Geographic
Definition: geo_tools.h:782
SG_Get_Projection_Unit_Identifier
CSG_String SG_Get_Projection_Unit_Identifier(TSG_Projection_Unit Unit)
Definition: projections.cpp:160
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_Projections::Create
bool Create(bool bLoad_DB=true)
Definition: projections.cpp:721
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_Table_Record
Definition: table.h:130
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
SG_PROJ_UNIT_Int_Statute_Mile
@ SG_PROJ_UNIT_Int_Statute_Mile
Definition: geo_tools.h:800
SG_Projection_Units
const char SG_Projection_Units[SG_PROJ_UNIT_Undefined+1][3][32]
Definition: projections.cpp:116
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
SG_PROJ_UNIT_Int_Foot
@ SG_PROJ_UNIT_Int_Foot
Definition: geo_tools.h:798
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
TSG_Projection_Type
TSG_Projection_Type
Definition: geo_tools.h:780
CSG_Projection::~CSG_Projection
virtual ~CSG_Projection(void)
Definition: projections.cpp:241
SG_PROJ_UNIT_US_Inch
@ SG_PROJ_UNIT_US_Inch
Definition: geo_tools.h:804
SG_PROJ_UNIT_Int_Inch
@ SG_PROJ_UNIT_Int_Inch
Definition: geo_tools.h:797
CSG_Projections::Get_UTM_WGS84
static CSG_Projection Get_UTM_WGS84(int Zone, bool bSouth=false)
Definition: projections.cpp:907
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
CSG_Tool
Definition: tool.h:149
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
CSG_Projection::Set_UTM_WGS84
bool Set_UTM_WGS84(int Zone, bool bSouth=false)
Definition: projections.cpp:515
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
PRJ_FIELD_AUTH_SRID
@ PRJ_FIELD_AUTH_SRID
Definition: projections.cpp:697
SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:257
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
SG_PROJ_UNIT_Int_Link
@ SG_PROJ_UNIT_Int_Link
Definition: geo_tools.h:803
SG_PROJ_UNIT_Int_Yard
@ SG_PROJ_UNIT_Int_Yard
Definition: geo_tools.h:799
CSG_Projections::Save_Dictionary
bool Save_Dictionary(const CSG_String &FileName)
Definition: projections.cpp:847
PRJ_FIELD_PROJ4TEXT
@ PRJ_FIELD_PROJ4TEXT
Definition: projections.cpp:699
SG_PROJ_UNIT_US_Foot
@ SG_PROJ_UNIT_US_Foot
Definition: geo_tools.h:805
SG_UI_Get_Application_Path
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
Definition: api_callback.cpp:786
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_MetaData::Get_Name
const CSG_String & Get_Name(void) const
Definition: metadata.h:132
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
SG_PROJ_UNIT_Indian_Yard
@ SG_PROJ_UNIT_Indian_Yard
Definition: geo_tools.h:809
SSG_Point
Definition: geo_tools.h:128
CSG_Projections::EPSG_to_Proj4
bool EPSG_to_Proj4(CSG_String &Proj4, int EPSG_Code) const
Definition: projections.cpp:1005
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_Projection::Get_EPSG
int Get_EPSG(void) const
Definition: geo_tools.h:883
SG_Set_Projection_Unit
bool SG_Set_Projection_Unit(const CSG_MetaData &m, TSG_Projection_Unit &Unit, CSG_String &Name, double &To_Meter)
Definition: projections.cpp:208
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:394
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
SG_PROJ_UNIT_Indian_Chain
@ SG_PROJ_UNIT_Indian_Chain
Definition: geo_tools.h:811
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:437
CSG_Projection::Set_GCS_WGS84
bool Set_GCS_WGS84(void)
Definition: projections.cpp:509
SG_STR_MBTOSG
#define SG_STR_MBTOSG(s)
Definition: api_core.h:539
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Grid::is_Valid
virtual bool is_Valid(void) const
Definition: grid.cpp:449
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1022
CSG_Projection::is_Equal
bool is_Equal(const CSG_Projection &Projection) const
Definition: projections.cpp:557
PROJ4_GCS_WGS84
#define PROJ4_GCS_WGS84
Definition: projections.cpp:506
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
CSG_File::is_Writing
bool is_Writing(void) const
Definition: api_core.h:1137
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
CSG_Projections::WKT_from_Proj4
bool WKT_from_Proj4(CSG_String &WKT, const CSG_String &Proj4) const
Definition: projections.cpp:1735
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_Get_Projection_Type_Identifier
CSG_String SG_Get_Projection_Type_Identifier(TSG_Projection_Type Type)
Definition: projections.cpp:87
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
SG_PROJ_UNIT_Int_Nautical_Mile
@ SG_PROJ_UNIT_Int_Nautical_Mile
Definition: geo_tools.h:796
ESG_PROJ_FIELD_ID
ESG_PROJ_FIELD_ID
Definition: projections.cpp:694
CSG_Projections::Reset_Dictionary
bool Reset_Dictionary(void)
Definition: projections.cpp:802
CSG_Projection::Get_Proj4
const CSG_String & Get_Proj4(void) const
Definition: geo_tools.h:880
CSG_Projections::WKT_to_Proj4
bool WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) const
Definition: projections.cpp:1258
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_String::Trim_Both
int Trim_Both(void)
Definition: api_string.cpp:600
CSG_Projection::CSG_Projection
CSG_Projection(void)
Definition: projections.cpp:236
SG_PROJ_UNIT_US_Chain
@ SG_PROJ_UNIT_US_Chain
Definition: geo_tools.h:807
SG_String_Tokenize
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1493
CSG_Translator::Get_Translation
const SG_Char * Get_Translation(int i) const
Definition: api_core.h:1441
SG_Get_Projections
CSG_Projections & SG_Get_Projections(void)
Definition: projections.cpp:66
SG_PROJ_UNIT_Centimeter
@ SG_PROJ_UNIT_Centimeter
Definition: geo_tools.h:794
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
CSG_Projections::Get_Projection
CSG_Projection Get_Projection(sLong Index) const
Definition: projections.cpp:948
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Projections::Get_Count
sLong Get_Count(void) const
Definition: projections.cpp:922
TSG_Projection_Unit
TSG_Projection_Unit
Definition: geo_tools.h:790
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Strings
Definition: api_core.h:693
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
SG_PROJ_TYPE_CS_Projected
@ SG_PROJ_TYPE_CS_Projected
Definition: geo_tools.h:781
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
SG_PROJ_UNIT_US_Yard
@ SG_PROJ_UNIT_US_Yard
Definition: geo_tools.h:806
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Projection
Definition: geo_tools.h:833
SG_Get_Projected
bool SG_Get_Projected(CSG_Shapes *pSource, CSG_Shapes *pTarget, const CSG_Projection &Target)
Definition: projections.cpp:2191
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
CSG_Translator::Create
bool Create(const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
Definition: api_translator.cpp:157
CSG_MetaData::Cmp_Property
bool Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:673
CSG_Projections::Save_DB
bool Save_DB(const CSG_String &FileName)
Definition: projections.cpp:888
PRJ_FIELD_AUTH_NAME
@ PRJ_FIELD_AUTH_NAME
Definition: projections.cpp:696
PRJ_FIELD_SRID
@ PRJ_FIELD_SRID
Definition: projections.cpp:695
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
CSG_Projections::EPSG_to_WKT
bool EPSG_to_WKT(CSG_String &WKT, int EPSG_Code) const
Definition: projections.cpp:1023
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
SG_PROJ_FMT_EPSG
@ SG_PROJ_FMT_EPSG
Definition: geo_tools.h:773
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
shapes.h
SG_PROJ_UNIT_Kilometer
@ SG_PROJ_UNIT_Kilometer
Definition: geo_tools.h:791
CSG_String
Definition: api_core.h:557
SG_PROJ_UNIT_Undefined
@ SG_PROJ_UNIT_Undefined
Definition: geo_tools.h:812
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_MetaData
Definition: metadata.h:88
PRJ_FIELD_SRTEXT
@ PRJ_FIELD_SRTEXT
Definition: projections.cpp:698
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Projections::~CSG_Projections
virtual ~CSG_Projections(void)
Definition: projections.cpp:778
SG_PROJ_UNIT_Int_Fathom
@ SG_PROJ_UNIT_Int_Fathom
Definition: geo_tools.h:801
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SG_PROJ_TYPE_CS_Undefined
@ SG_PROJ_TYPE_CS_Undefined
Definition: geo_tools.h:784
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition: tool.h:183
WKT_GCS_WGS84
#define WKT_GCS_WGS84
Definition: projections.cpp:499
SG_Get_Projection_Unit_To_Meter
double SG_Get_Projection_Unit_To_Meter(TSG_Projection_Unit Unit)
Definition: projections.cpp:178
SG_PROJ_UNIT_Millimeter
@ SG_PROJ_UNIT_Millimeter
Definition: geo_tools.h:795
TSG_Projection_Format
TSG_Projection_Format
Definition: geo_tools.h:770
CSG_Projections::CSG_Projections
CSG_Projections(void)
Definition: projections.cpp:708
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
GET_DATUM
#define GET_DATUM(d, p)
SG_PROJ_UNIT_Meter
@ SG_PROJ_UNIT_Meter
Definition: geo_tools.h:792
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Projections::Load_DB
bool Load_DB(const CSG_String &FileName, bool bAppend=false)
Definition: projections.cpp:860
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_PROJ_UNIT_Decimeter
@ SG_PROJ_UNIT_Decimeter
Definition: geo_tools.h:793
CSG_Shapes
Definition: shapes.h:773
SG_Get_Projection_Unit_Name
CSG_String SG_Get_Projection_Unit_Name(TSG_Projection_Unit Unit, bool bSimple)
Definition: projections.cpp:169
CSG_Table::Save
virtual bool Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:155
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
SG_PROJ_TYPE_CS_Geocentric
@ SG_PROJ_TYPE_CS_Geocentric
Definition: geo_tools.h:783
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_Projections::Get_Names_List
CSG_String Get_Names_List(TSG_Projection_Type Type=SG_PROJ_TYPE_CS_Undefined) const
Definition: projections.cpp:1044
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Projections::Destroy
void Destroy(void)
Definition: projections.cpp:786
CSG_MetaData::Cmp_Content
bool Cmp_Content(const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:533
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
SG_Get_Projection_Type_Name
CSG_String SG_Get_Projection_Type_Name(TSG_Projection_Type Type)
Definition: projections.cpp:99
SG_Get_Projection_Type
TSG_Projection_Type SG_Get_Projection_Type(const CSG_String &Identifier)
Definition: projections.cpp:77
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
CSG_Projections::Add
bool Add(const CSG_Projection &Projection)
Definition: projections.cpp:928
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
table.h
SG_Grid_Get_Geographic_Coordinates
bool SG_Grid_Get_Geographic_Coordinates(CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
Definition: projections.cpp:2307
CSG_File::is_Reading
bool is_Reading(void) const
Definition: api_core.h:1136
CSG_Projections::Load_Dictionary
bool Load_Dictionary(const CSG_String &FileName)
Definition: projections.cpp:811
CSG_Projections::Get_GCS_WGS84
static const CSG_Projection & Get_GCS_WGS84(void)
Definition: projections.cpp:899
CSG_Projections
Definition: geo_tools.h:928
geo_tools.h
SG_PROJ_FMT_Proj4
@ SG_PROJ_FMT_Proj4
Definition: geo_tools.h:772
CSG_Projection::Get_Description
CSG_String Get_Description(void) const
Definition: projections.cpp:661
gSG_Projections
CSG_Projections gSG_Projections
Definition: projections.cpp:63
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: quadtree.cpp File Reference

  • saga_core
  • saga_api
quadtree.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: quadtree.cpp Source File

  • saga_core
  • saga_api
quadtree.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // quadtree.cpp //
15 // //
16 // Copyright (C) 2009 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // e-mail: oconrad@saga-gis.org //
42 // //
43 // contact: Olaf Conrad //
44 // Institute of Geography //
45 // University of Hamburg //
46 // Germany //
47 // //
49
50 //---------------------------------------------------------
51 #include "shapes.h"
52
53
55 // //
56 // //
57 // //
59
60 //---------------------------------------------------------
61 CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant)
62 : CSG_PRQuadTree_Item(Extent, Quadrant)
63 {
64 m_pChildren[0] = m_pChildren[1] = m_pChildren[2] = m_pChildren[3] = NULL;
65 }
66
67 //---------------------------------------------------------
68 CSG_PRQuadTree_Node::CSG_PRQuadTree_Node(CSG_PRQuadTree_Leaf *pLeaf)
69 : CSG_PRQuadTree_Item(pLeaf->m_Extent)
70 {
71 m_pChildren[0] = m_pChildren[1] = m_pChildren[2] = m_pChildren[3] = NULL;
72
73 int Quadrant = Get_Quadrant(pLeaf->Get_Point());
74
75 pLeaf->Set_Extent(m_Extent, Quadrant);
76
77 m_pChildren[Quadrant] = pLeaf;
78 }
79
80 //---------------------------------------------------------
81 CSG_PRQuadTree_Node::~CSG_PRQuadTree_Node(void)
82 {
83 for(int i=0; i<4; i++)
84 {
85 if( m_pChildren[i] )
86 {
87 if( m_pChildren[i]->is_Leaf() )
88 {
89 delete((CSG_PRQuadTree_Leaf *)m_pChildren[i]);
90 }
91 else
92 {
93 delete((CSG_PRQuadTree_Node *)m_pChildren[i]);
94 }
95 }
96 }
97 }
98
99 //---------------------------------------------------------
100 CSG_PRQuadTree_Item * CSG_PRQuadTree_Node::Get_Child(double x, double y)
101 {
102 for(int i=0; i<4; i++)
103 {
104 if( m_pChildren[i] && m_pChildren[i]->Contains(x, y) )
105 {
106 return( m_pChildren[i]->is_Node() ? m_pChildren[i]->asNode()->Get_Child(x, y) : m_pChildren[i] );
107 }
108 }
109
110 return( this );
111 }
112
113 //---------------------------------------------------------
114 bool CSG_PRQuadTree_Node::Add_Point(double x, double y, double z)
115 {
116 if( !Contains(x, y) )
117 {
118 return( false );
119 }
120
121 if( has_Statistics() )
122 {
123 Get_X()->Add_Value(x);
124 Get_Y()->Add_Value(y);
125 Get_Z()->Add_Value(z);
126 }
127
128 int Quadrant = Get_Quadrant(x, y);
129
130 //-----------------------------------------------------
131 if( m_pChildren[Quadrant] == NULL )
132 {
133 m_pChildren[Quadrant] = new CSG_PRQuadTree_Leaf(m_Extent, Quadrant, x, y, z);
134
135 return( true );
136 }
137
138 //-----------------------------------------------------
139 if( m_pChildren[Quadrant]->is_Leaf() )
140 {
141 CSG_PRQuadTree_Leaf *pLeaf = m_pChildren[Quadrant]->asLeaf();
142
143 if( x != pLeaf->Get_X() || y != pLeaf->Get_Y() )
144 {
145 if( has_Statistics() )
146 {
147 m_pChildren[Quadrant] = new CSG_PRQuadTree_Node_Statistics(pLeaf);
148 }
149 else
150 {
151 m_pChildren[Quadrant] = new CSG_PRQuadTree_Node(pLeaf);
152 }
153
154 ((CSG_PRQuadTree_Node *)m_pChildren[Quadrant])->Add_Point(x, y, z);
155 }
156 else // if( x == pLeaf->Get_X() || y == pLeaf->Get_Y() ) // duplicate !!
157 {
158 if( !pLeaf->has_Statistics() )
159 {
160 m_pChildren[Quadrant] = new CSG_PRQuadTree_Leaf_List(pLeaf->m_Extent, -1, x, y, pLeaf->m_z);
161
162 delete(pLeaf);
163 }
164
165 ((CSG_PRQuadTree_Leaf_List *)m_pChildren[Quadrant])->Add_Value(z);
166 }
167
168 return( true );
169 }
170
171 //-----------------------------------------------------
172 return( ((CSG_PRQuadTree_Node *)m_pChildren[Quadrant])->Add_Point(x, y, z) ); // if( m_pChildren[i]->is_Node() )
173 }
174
175
177 // //
178 // //
179 // //
181
182 //---------------------------------------------------------
183 CSG_PRQuadTree::CSG_PRQuadTree(void)
184 {
185 m_pRoot = NULL;
186 m_nPoints = 0;
187 m_bPolar = false;
188 }
189
190 //---------------------------------------------------------
191 CSG_PRQuadTree::CSG_PRQuadTree(const TSG_Rect &Extent, bool bStatistics)
192 {
193 m_pRoot = NULL;
194 m_nPoints = 0;
195 m_bPolar = false;
196
197 Create(Extent, bStatistics);
198 }
199
200 //---------------------------------------------------------
201 CSG_PRQuadTree::CSG_PRQuadTree(CSG_Shapes *pShapes, int Attribute, bool bStatistics)
202 {
203 m_pRoot = NULL;
204 m_nPoints = 0;
205 m_bPolar = false;
206
207 Create(pShapes, Attribute, bStatistics);
208 }
209
210 //---------------------------------------------------------
211 CSG_PRQuadTree::~CSG_PRQuadTree(void)
212 {
213 Destroy();
214 }
215
216 //---------------------------------------------------------
217 bool CSG_PRQuadTree::Create(const CSG_Rect &Extent, bool bStatistics)
218 {
219 Destroy();
220
221 if( Extent.Get_XRange() > 0.0 && Extent.Get_YRange() > 0.0 )
222 {
223 double Size = (0.5 + 0.01) * (Extent.Get_XRange() > Extent.Get_YRange() ? Extent.Get_XRange() : Extent.Get_YRange());
224
225 CSG_Rect r(
226 Extent.Get_XCenter() - Size, Extent.Get_YCenter() - Size,
227 Extent.Get_XCenter() + Size, Extent.Get_YCenter() + Size
228 );
229
230 if( bStatistics )
231 {
232 m_pRoot = new CSG_PRQuadTree_Node_Statistics(r);
233 }
234 else
235 {
236 m_pRoot = new CSG_PRQuadTree_Node(r);
237 }
238
239 return( true );
240 }
241
242 return( false );
243 }
244
245 //---------------------------------------------------------
246 bool CSG_PRQuadTree::Create(CSG_Shapes *pShapes, int Attribute, bool bStatistics)
247 {
248 Destroy();
249
250 if( pShapes && pShapes->is_Valid() && Create(pShapes->Get_Extent(), bStatistics) )
251 {
252 for(sLong iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
253 {
254 CSG_Shape *pShape = pShapes->Get_Shape(iShape);
255
256 if( Attribute < 0 || !pShape->is_NoData(Attribute) )
257 {
258 double z = Attribute < 0 ? iShape : pShape->asDouble(Attribute);
259
260 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
261 {
262 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
263 {
264 Add_Point(pShape->Get_Point(iPoint, iPart), z);
265 }
266 }
267 }
268 }
269
270 return( m_nPoints > 0 );
271 }
272
273 return( false );
274 }
275
276 //---------------------------------------------------------
277 void CSG_PRQuadTree::Destroy(void)
278 {
279 if( m_pRoot )
280 {
281 delete(m_pRoot);
282
283 m_pRoot = NULL;
284 }
285
286 m_nPoints = 0;
287
288 m_Selection.Destroy();
289 }
290
291
293 // //
295
296 //---------------------------------------------------------
297 bool CSG_PRQuadTree::Add_Point(double x, double y, double z)
298 {
299 if( _Check_Root(x, y) && m_pRoot->Add_Point(x, y, z) )
300 {
301 m_nPoints++;
302
303 return( true );
304 }
305
306 return( false );
307 }
308
309 //---------------------------------------------------------
310 bool CSG_PRQuadTree::Add_Point(const TSG_Point &p, double z)
311 {
312 return( Add_Point(p.x, p.y, z) );
313 }
314
315
317 // //
319
320 //---------------------------------------------------------
321 bool CSG_PRQuadTree::_Check_Root(double x, double y)
322 {
323 if( !m_pRoot )
324 {
325 return( false );
326 }
327
328 if( m_pRoot->Get_Extent().Contains(x, y) )
329 {
330 return( true );
331 }
332
333 //-----------------------------------------------------
334 int Quadrant = y < m_pRoot->Get_yMin() // bottom / top ?
335 ? (x < m_pRoot->Get_xMin() ? 0 : 3) // bottom: left / right ?
336 : (x < m_pRoot->Get_xMin() ? 1 : 2); // top : left / right ?
337
338 TSG_Rect Extent = m_pRoot->Get_Extent();
339
340 switch( Quadrant )
341 {
342 case 0: Extent.xMin -= m_pRoot->Get_Size(); Extent.yMin -= m_pRoot->Get_Size(); break; // bottom left
343 case 1: Extent.xMin -= m_pRoot->Get_Size(); Extent.yMax += m_pRoot->Get_Size(); break; // top left
344 case 2: Extent.xMax += m_pRoot->Get_Size(); Extent.yMin -= m_pRoot->Get_Size(); break; // bottom right
345 case 3: Extent.xMax += m_pRoot->Get_Size(); Extent.yMax += m_pRoot->Get_Size(); break; // top right
346 }
347
348 CSG_PRQuadTree_Node *pRoot;
349
350 if( m_pRoot->has_Statistics() )
351 {
352 CSG_PRQuadTree_Node_Statistics *pNode = new CSG_PRQuadTree_Node_Statistics(Extent);
353
354 pNode->m_x = ((CSG_PRQuadTree_Node_Statistics *)m_pRoot)->m_x;
355 pNode->m_y = ((CSG_PRQuadTree_Node_Statistics *)m_pRoot)->m_y;
356 pNode->m_z = ((CSG_PRQuadTree_Node_Statistics *)m_pRoot)->m_z;
357
358 pRoot = pNode;
359 }
360 else
361 {
362 pRoot = new CSG_PRQuadTree_Node(Extent);
363 }
364
365 pRoot->m_pChildren[Quadrant] = m_pRoot;
366
367 m_pRoot = pRoot;
368
369 return( _Check_Root(x, y) );
370 }
371
372
374 // //
376
377 //---------------------------------------------------------
378 inline bool CSG_PRQuadTree::_Quadrant_Contains(double x, double y, int iQuadrant, const TSG_Point &p) const
379 {
380 switch( iQuadrant )
381 {
382 case 0: return( x < p.x && y < p.y ); // lower left
383 case 1: return( x < p.x && y >= p.y ); // upper left
384 case 2: return( x >= p.x && y >= p.y ); // upper right
385 case 3: return( x >= p.x && y < p.y ); // lower right
386 }
387
388 return( true );
389 }
390
391 //---------------------------------------------------------
392 inline bool CSG_PRQuadTree::_Radius_Contains(double x, double y, double r, const TSG_Point &p) const
393 {
394 double dx, dy;
395
396 if( fabs(dx = x - p.x) <= r && fabs(dy = y - p.y) <= r )
397 {
398 return( dx*dx + dy*dy < r*r );
399 }
400
401 return( false );
402 }
403
404 //---------------------------------------------------------
405 inline bool CSG_PRQuadTree::_Radius_Contains(double x, double y, double r, int iQuadrant, const TSG_Point &p) const
406 {
407 return( _Quadrant_Contains(x, y, iQuadrant, p) && _Radius_Contains(x, y, r, p) );
408 }
409
410 //---------------------------------------------------------
411 inline bool CSG_PRQuadTree::_Quadrant_Intersects(double x, double y, int iQuadrant, CSG_PRQuadTree_Item *pItem) const
412 {
413 switch( iQuadrant )
414 {
415 case 0: return( x < pItem->Get_xMax() && y < pItem->Get_yMax() ); // lower left
416 case 1: return( x < pItem->Get_xMax() && y >= pItem->Get_yMin() ); // upper left
417 case 2: return( x >= pItem->Get_xMin() && y >= pItem->Get_yMin() ); // upper right
418 case 3: return( x >= pItem->Get_xMin() && y < pItem->Get_yMax() ); // lower right
419 }
420
421 return( true );
422 }
423
424 //---------------------------------------------------------
425 inline bool CSG_PRQuadTree::_Radius_Intersects(double x, double y, double r, CSG_PRQuadTree_Item *pItem) const
426 {
427 if( r <= 0.0 )
428 {
429 return( true );
430 }
431
432 if( pItem->Get_xMax() < x - r || pItem->Get_xMin() > x + r
433 || pItem->Get_yMax() < y - r || pItem->Get_yMin() > y + r )
434 {
435 return( false );
436 }
437
438 if( (pItem->Get_xMin() <= x && x <= pItem->Get_xMax())
439 || (pItem->Get_yMin() <= y && y <= pItem->Get_yMax()) )
440 {
441 return( true );
442 }
443
444 TSG_Point p;
445
446 if( pItem->Get_xMax() < x )
447 {
448 p.x = pItem->Get_xMax();
449 p.y = pItem->Get_yMax() < y ? pItem->Get_yMax() : pItem->Get_yMin();
450 }
451 else // if( pItem->Get_xMin() >= x )
452 {
453 p.x = pItem->Get_xMin();
454 p.y = pItem->Get_yMax() < y ? pItem->Get_yMax() : pItem->Get_yMin();
455 }
456
457 return( _Radius_Contains(x, y, r, p) );
458 }
459
460 //---------------------------------------------------------
461 inline bool CSG_PRQuadTree::_Radius_Intersects(double x, double y, double r, int iQuadrant, CSG_PRQuadTree_Item *pItem) const
462 {
463 return( _Quadrant_Intersects(x, y, iQuadrant, pItem) && _Radius_Intersects(x, y, r, pItem) );
464 }
465
466
468 // //
470
471 //---------------------------------------------------------
472 CSG_PRQuadTree_Leaf * CSG_PRQuadTree::Get_Nearest_Leaf(const TSG_Point &p, double &Distance) const
473 {
474 return( Get_Nearest_Leaf(p.x, p.y, Distance) );
475 }
476
477 CSG_PRQuadTree_Leaf * CSG_PRQuadTree::Get_Nearest_Leaf(double x, double y, double &Distance) const
478 {
479 return( _Get_Nearest_Point(m_pRoot, x, y, Distance = -1) );
480 }
481
482 //---------------------------------------------------------
483 bool CSG_PRQuadTree::Get_Nearest_Point(const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const
484 {
485 return( Get_Nearest_Point(p.x, p.y, Point, Value, Distance) );
486 }
487
488 bool CSG_PRQuadTree::Get_Nearest_Point(double x, double y, TSG_Point &Point, double &Value, double &Distance) const
489 {
490 CSG_PRQuadTree_Leaf *pLeaf = _Get_Nearest_Point(m_pRoot, x, y, Distance = -1);
491
492 if( pLeaf )
493 {
494 Point.x = pLeaf->Get_X();
495 Point.y = pLeaf->Get_Y();
496 Value = pLeaf->Get_Z();
497
498 return( true );
499 }
500
501 return( false );
502 }
503
504 //---------------------------------------------------------
505 CSG_PRQuadTree_Leaf * CSG_PRQuadTree::_Get_Nearest_Point(CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance) const
506 {
507 CSG_PRQuadTree_Leaf *pLeaf, *pNearest = NULL;
508
509 if( pItem )
510 {
511 if( pItem->is_Leaf() )
512 {
513 pLeaf = (CSG_PRQuadTree_Leaf *)pItem;
514
515 double d = SG_Get_Distance(x, y, pLeaf->Get_X(), pLeaf->Get_Y(), m_bPolar);
516
517 if( Distance < 0.0 || Distance > d )
518 {
519 Distance = d;
520 pNearest = pLeaf;
521 }
522 }
523 else // if( pItem->is_Node() )
524 {
525 int i;
526
527 if( pItem->Contains(x, y) )
528 {
529 for(i=0; i<4; i++)
530 {
531 CSG_PRQuadTree_Item *pChild = ((CSG_PRQuadTree_Node *)pItem)->Get_Child(i);
532
533 if( pChild && pChild->Contains(x, y) && (pLeaf = _Get_Nearest_Point(pChild, x, y, Distance)) != NULL )
534 {
535 pNearest = pLeaf;
536 }
537 }
538 }
539
540 for(i=0; i<4; i++)
541 {
542 CSG_PRQuadTree_Item *pChild = ((CSG_PRQuadTree_Node *)pItem)->Get_Child(i);
543
544 if( pChild && pChild->Contains(x, y) == false && (Distance < 0.0
545 || ( Distance > (x < pChild->Get_xCenter() ? pChild->Get_xMin() - x : x - pChild->Get_xMax())
546 && Distance > (y < pChild->Get_yCenter() ? pChild->Get_yMin() - y : y - pChild->Get_yMax()) ))
547 && (pLeaf = _Get_Nearest_Point(pChild, x, y, Distance)) != NULL )
548 {
549 pNearest = pLeaf;
550 }
551 }
552 }
553 }
554
555 return( pNearest );
556 }
557
558
560 // //
562
563 //---------------------------------------------------------
564 inline CSG_PRQuadTree::TLeaf * CSG_PRQuadTree::_Get_Selected(const CSG_Array &Selection, size_t i) const
565 {
566 return( (TLeaf *)Selection.Get_Entry(i) );
567 }
568
569 //---------------------------------------------------------
570 inline bool CSG_PRQuadTree::_Add_Selected(CSG_Array &Selection, CSG_PRQuadTree_Leaf *pLeaf, double Distance) const
571 {
572 if( Selection.Inc_Array() )
573 {
574 TLeaf *pL = (TLeaf *)Selection.Get_Entry(Selection.Get_Size() - 1);
575
576 pL->pLeaf = pLeaf;
577 pL->Distance = Distance;
578
579 return( true );
580 }
581
582 return( false );
583 }
584
585 //---------------------------------------------------------
586 inline bool CSG_PRQuadTree::_Set_Selected(CSG_Array &Selection, size_t i, CSG_PRQuadTree_Leaf *pLeaf, double Distance) const
587 {
588 TLeaf *pL = (TLeaf *)Selection.Get_Entry(i);
589
590 if( pL )
591 {
592 pL->pLeaf = pLeaf;
593 pL->Distance = Distance;
594
595 return( true );
596 }
597
598 return( false );
599 }
600
601
603 // //
605
606 //---------------------------------------------------------
607 size_t CSG_PRQuadTree::Select_Nearest_Points(const TSG_Point &p, size_t maxPoints, double Radius, int iQuadrant)
608 {
609 return( Select_Nearest_Points(p.x, p.y, maxPoints, Radius, iQuadrant) );
610 }
611
612 //---------------------------------------------------------
613 size_t CSG_PRQuadTree::Select_Nearest_Points(double x, double y, size_t maxPoints, double Radius, int iQuadrant)
614 {
615 return( _Select_Nearest_Points(m_Selection, x, y, maxPoints, Radius, iQuadrant) );
616 }
617
618 //---------------------------------------------------------
619 size_t CSG_PRQuadTree::_Select_Nearest_Points(CSG_Array &Selection, double x, double y, size_t maxPoints, double Radius, int iQuadrant) const
620 {
621 if( Selection.Get_Value_Size() != sizeof(TLeaf) )
622 {
623 Selection.Create(sizeof(TLeaf), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_3);
624 }
625 else
626 {
627 Selection.Set_Array(0, false);
628 }
629
630 if( m_pRoot )
631 {
632 double Distance;
633
634 if( maxPoints < 1 )
635 {
636 maxPoints = m_nPoints;
637 }
638
639 if( iQuadrant != 4 )
640 {
641 _Select_Nearest_Points(Selection, m_pRoot, x, y, Distance = 0.0, Radius, maxPoints, iQuadrant);
642 }
643 else // if( iQuadrant == 4 ) // quadrant-wise search
644 {
645 for(iQuadrant=0; iQuadrant<4; iQuadrant++)
646 {
647 _Select_Nearest_Points(Selection, m_pRoot, x, y, Distance = 0.0, Radius, maxPoints, iQuadrant);
648 }
649 }
650 }
651
652 return( Selection.Get_Size() );
653 }
654
655 //---------------------------------------------------------
656 void CSG_PRQuadTree::_Select_Nearest_Points(CSG_Array &Selection, CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance, double Radius, size_t maxPoints, int iQuadrant) const
657 {
658 //-----------------------------------------------------
659 if( pItem->is_Leaf() )
660 {
661 CSG_PRQuadTree_Leaf *pLeaf = (CSG_PRQuadTree_Leaf *)pItem;
662
663 if( _Quadrant_Contains(x, y, iQuadrant, pLeaf->Get_Point()) == false )
664 {
665 return;
666 }
667
668 double d = SG_Get_Distance(x, y, pLeaf->Get_X(), pLeaf->Get_Y(), m_bPolar);
669
670 if( Radius > 0.0 && Radius < d )
671 {
672 return;
673 }
674
675 //-------------------------------------------------
676 if( (int)Selection.Get_Size() < maxPoints )
677 {
678 if( Distance < d )
679 {
680 Distance = d;
681 }
682
683 _Add_Selected(Selection, pLeaf, d);
684 }
685 else if( d < Distance )
686 {
687 for(size_t i=0; i<(int)Selection.Get_Size(); i++)
688 {
689 if( Distance <= _Get_Selected(Selection, i)->Distance )
690 {
691 _Set_Selected(Selection, i, pLeaf, d);
692
693 break;
694 }
695 }
696
697 Distance = d;
698
699 for(size_t i=0; i<maxPoints; i++)
700 {
701 if( Distance < _Get_Selected(Selection, i)->Distance )
702 {
703 Distance = _Get_Selected(Selection, i)->Distance;
704 }
705 }
706 }
707 }
708
709 //-----------------------------------------------------
710 else // if( pItem->is_Node() )
711 {
712 int i;
713
714 CSG_PRQuadTree_Item *pChild;
715
716 for(i=0; i<4; i++)
717 {
718 if( (pChild = ((CSG_PRQuadTree_Node *)pItem)->Get_Child(i)) != NULL && pChild->Contains(x, y) == true )
719 {
720 _Select_Nearest_Points(Selection, pChild, x, y, Distance, Radius, maxPoints, iQuadrant);
721 }
722 }
723
724 for(i=0; i<4; i++)
725 {
726 if( (pChild = ((CSG_PRQuadTree_Node *)pItem)->Get_Child(i)) != NULL && pChild->Contains(x, y) == false )
727 {
728 if( _Radius_Intersects(x, y, Radius, iQuadrant, pChild) )
729 {
730 if( Get_Selected_Count() < maxPoints
731 || ( Distance > (x < pChild->Get_xCenter() ? pChild->Get_xMin() - x : x - pChild->Get_xMax())
732 && Distance > (y < pChild->Get_yCenter() ? pChild->Get_yMin() - y : y - pChild->Get_yMax()) ) )
733 {
734 _Select_Nearest_Points(Selection, pChild, x, y, Distance, Radius, maxPoints, iQuadrant);
735 }
736 }
737 }
738 }
739 }
740 }
741
742
744 // //
746
747 //---------------------------------------------------------
748 size_t CSG_PRQuadTree::Get_Nearest_Points(CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius, int iQuadrant) const
749 {
750 return( Get_Nearest_Points(Points, p.x, p.y, maxPoints, Radius, iQuadrant) );
751 }
752
753 //---------------------------------------------------------
754 size_t CSG_PRQuadTree::Get_Nearest_Points(CSG_Points_3D &Points, double x, double y, size_t maxPoints, double Radius, int iQuadrant) const
755 {
756 CSG_Array Selection;
757
758 _Select_Nearest_Points(Selection, x, y, maxPoints, Radius, iQuadrant);
759
760 Points.Clear();
761
762 for(size_t i=0; i<(int)Selection.Get_Size(); i++)
763 {
764 CSG_PRQuadTree_Leaf *pLeaf = _Get_Selected(Selection, i)->pLeaf;
765
766 Points.Add(pLeaf->Get_X(), pLeaf->Get_Y(), pLeaf->Get_Z());
767 }
768
769 return( Points.Get_Count() );
770 }
771
772
774 // //
775 // //
776 // //
778
779 //---------------------------------------------------------
CSG_Rect
Definition: geo_tools.h:471
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_PRQuadTree::Destroy
void Destroy(void)
Definition: quadtree.cpp:277
CSG_Points_3D
Definition: geo_tools.h:320
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Points_3D::Add
bool Add(double x, double y, double z)
Definition: geo_classes.cpp:582
CSG_PRQuadTree_Leaf_List
Definition: shapes.h:1002
CSG_PRQuadTree_Node_Statistics
Definition: shapes.h:1075
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_PRQuadTree_Node_Statistics::m_x
CSG_Simple_Statistics m_x
Definition: shapes.h:1101
CSG_PRQuadTree_Node::~CSG_PRQuadTree_Node
virtual ~CSG_PRQuadTree_Node(void)
Definition: quadtree.cpp:81
CSG_PRQuadTree::Get_Selected_Count
size_t Get_Selected_Count(void) const
Definition: shapes.h:1144
CSG_PRQuadTree::~CSG_PRQuadTree
virtual ~CSG_PRQuadTree(void)
Definition: quadtree.cpp:211
CSG_PRQuadTree_Node::Get_Child
CSG_PRQuadTree_Item * Get_Child(int Quadrant) const
Definition: shapes.h:1052
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:336
CSG_PRQuadTree_Leaf::Get_Y
double Get_Y(void) const
Definition: shapes.h:977
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_PRQuadTree_Item::Get_xCenter
double Get_xCenter(void) const
Definition: shapes.h:922
SSG_Point
Definition: geo_tools.h:128
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:326
CSG_PRQuadTree_Node
Definition: shapes.h:1045
CSG_PRQuadTree::Create
bool Create(const CSG_Rect &Extent, bool bStatistics=false)
Definition: quadtree.cpp:217
CSG_PRQuadTree_Leaf::Get_Point
const TSG_Point & Get_Point(void) const
Definition: shapes.h:975
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_PRQuadTree_Node::CSG_PRQuadTree_Node
CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant=-1)
Definition: quadtree.cpp:61
CSG_PRQuadTree_Item::Contains
bool Contains(const CSG_Point &p) const
Definition: shapes.h:929
CSG_Array::Destroy
bool Destroy(void)
Definition: api_memory.cpp:291
CSG_PRQuadTree_Node::Get_Y
virtual CSG_Simple_Statistics * Get_Y(void)
Definition: shapes.h:1058
CSG_PRQuadTree_Node_Statistics::m_z
CSG_Simple_Statistics m_z
Definition: shapes.h:1101
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_PRQuadTree_Leaf::Get_X
double Get_X(void) const
Definition: shapes.h:976
sLong
signed long long sLong
Definition: api_core.h:158
CSG_PRQuadTree_Item::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:962
CSG_PRQuadTree_Node::is_Node
virtual bool is_Node(void) const
Definition: shapes.h:1050
CSG_PRQuadTree_Item::is_Leaf
virtual bool is_Leaf(void) const
Definition: shapes.h:916
CSG_PRQuadTree::Select_Nearest_Points
size_t Select_Nearest_Points(const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1)
Definition: quadtree.cpp:607
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_PRQuadTree::Get_Nearest_Points
size_t Get_Nearest_Points(CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius=0., int iQuadrant=-1) const
Definition: quadtree.cpp:748
CSG_PRQuadTree_Node::Get_Z
virtual CSG_Simple_Statistics * Get_Z(void)
Definition: shapes.h:1059
CSG_PRQuadTree_Item::asNode
class CSG_PRQuadTree_Node * asNode(void) const
Definition: shapes.h:933
CSG_PRQuadTree_Leaf::Get_Z
double Get_Z(void) const
Definition: shapes.h:978
CSG_PRQuadTree_Item::Get_yMin
double Get_yMin(void) const
Definition: shapes.h:924
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_PRQuadTree_Node::Get_X
virtual CSG_Simple_Statistics * Get_X(void)
Definition: shapes.h:1057
CSG_PRQuadTree_Node_Statistics::m_y
CSG_Simple_Statistics m_y
Definition: shapes.h:1101
CSG_PRQuadTree::CSG_PRQuadTree
CSG_PRQuadTree(void)
Definition: quadtree.cpp:183
CSG_PRQuadTree::Get_Nearest_Leaf
CSG_PRQuadTree_Leaf * Get_Nearest_Leaf(const TSG_Point &p, double &Distance) const
Definition: quadtree.cpp:472
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_PRQuadTree_Node::m_pChildren
CSG_PRQuadTree_Item * m_pChildren[4]
Definition: shapes.h:1069
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
CSG_PRQuadTree_Node::Add_Point
bool Add_Point(double x, double y, double z)
Definition: quadtree.cpp:114
CSG_Array
Definition: api_core.h:308
shapes.h
CSG_Simple_Statistics::Add_Value
void Add_Value(double Value, double Weight=1.)
Definition: mat_tools.cpp:527
CSG_PRQuadTree_Item::Set_Extent
void Set_Extent(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:942
CSG_PRQuadTree_Item::Get_Extent
const CSG_Rect & Get_Extent(void) const
Definition: shapes.h:920
CSG_PRQuadTree_Item::asLeaf
class CSG_PRQuadTree_Leaf * asLeaf(void) const
Definition: shapes.h:932
CSG_PRQuadTree_Item::Get_Size
double Get_Size(void) const
Definition: shapes.h:927
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_PRQuadTree::Get_Nearest_Point
bool Get_Nearest_Point(const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const
Definition: quadtree.cpp:483
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
CSG_PRQuadTree_Leaf::m_z
double m_z
Definition: shapes.h:994
CSG_Shapes
Definition: shapes.h:773
CSG_PRQuadTree_Item::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:918
CSG_PRQuadTree_Item::Get_Quadrant
int Get_Quadrant(const TSG_Point &p) const
Definition: shapes.h:954
CSG_PRQuadTree_Item::Get_xMin
double Get_xMin(void) const
Definition: shapes.h:921
CSG_PRQuadTree_Item
Definition: shapes.h:913
CSG_Shape
Definition: shapes.h:141
CSG_PRQuadTree_Item::Get_yMax
double Get_yMax(void) const
Definition: shapes.h:926
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
CSG_PRQuadTree_Leaf
Definition: shapes.h:968
CSG_PRQuadTree::Add_Point
bool Add_Point(double x, double y, double z)
Definition: quadtree.cpp:297
CSG_PRQuadTree_Item::Get_xMax
double Get_xMax(void) const
Definition: shapes.h:923
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: saga_api.cpp File Reference

  • saga_core
  • saga_api
Functions
saga_api.cpp File Reference
#include "saga_api.h"

Go to the source code of this file.

Functions

const SG_Char * | SAGA_API_Get_Version (void)
int | SG_Compare_Version (const CSG_String &Version, int Major, int Minor, int Release)
int | SG_Compare_Version (const CSG_String &Version, const CSG_String &Release)
int | SG_Compare_SAGA_Version (int Major, int Minor, int Release)
int | SG_Compare_SAGA_Version (const CSG_String &Version)

Function Documentation

◆ SAGA_API_Get_Version()

const SG_Char* SAGA_API_Get_Version ( void )

Definition at line 63 of file saga_api.cpp.

References SAGA_VERSION, and SG_T.

◆ SG_Compare_SAGA_Version() [1/2]

int SG_Compare_SAGA_Version ( const CSG_String & Version )

Compares to current SAGA version and returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version string is assumed to have the form 'Major.Minor.Release'.

Definition at line 146 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::asInt(), and SG_Compare_SAGA_Version().

◆ SG_Compare_SAGA_Version() [2/2]

int SG_Compare_SAGA_Version | ( | int | Major,
 |  | int | Minor,
 |  | int | Release
 | ) |  |

Compares to current SAGA version and returns -1 if it is less, 1 if it is greater or 0 if it is equal.

Definition at line 125 of file saga_api.cpp.

References SAGA_MAJOR_VERSION, SAGA_MINOR_VERSION, and SAGA_RELEASE_NUMBER.

Referenced by SG_Compare_SAGA_Version().

◆ SG_Compare_Version() [1/2]

int SG_Compare_Version | ( | const CSG_String & | Version,
 |  | const CSG_String & | Release
 | ) |  |

Compares two versions numbers. Returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version strings are assumed to have the form 'Major.Minor.Release'.

Definition at line 108 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::asInt(), and SG_Compare_Version().

◆ SG_Compare_Version() [2/2]

int SG_Compare_Version | ( | const CSG_String & | Version,
 |  | int | Major,
 |  | int | Minor,
 |  | int | Release
 | ) |  |

Compares two versions numbers. Returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version string is assumed to have the form 'Major.Minor.Release'.

Definition at line 82 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), and CSG_String::asInt().

Referenced by CSG_Tool_Chain::Create(), CSG_Classifier_Supervised::Load(), and SG_Compare_Version().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: saga_api.cpp Source File

  • saga_core
  • saga_api
saga_api.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // saga_api.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "saga_api.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 const SG_Char * SAGA_API_Get_Version(void)
64 {
65 return( SG_T("SAGA Application Programming Interface - Version: ") SAGA_VERSION );
66 }
67
68
70 // //
71 // //
72 // //
74
75 //---------------------------------------------------------
81 //---------------------------------------------------------
82 int SG_Compare_Version (const CSG_String &Version, int Major, int Minor, int Release)
83 {
84 int v;
85
86 if( !Version .asInt(v) ) return( -1 );
87 if( v < Major ) return( -1 );
88 if( v > Major ) return( 1 );
89
90 if( !Version.AfterFirst('.').asInt(v) ) return( -1 );
91 if( v < Minor ) return( -1 );
92 if( v > Minor ) return( 1 );
93
94 if( !Version.AfterLast ('.').asInt(v) ) return( -1 );
95 if( v < Release ) return( -1 );
96 if( v > Release ) return( 1 );
97
98 return( 0 );
99 }
100
101 //---------------------------------------------------------
107 //---------------------------------------------------------
108 int SG_Compare_Version (const CSG_String &Version, const CSG_String &Release)
109 {
110 int v[3];
111
112 if( !Release .asInt(v[0]) ) return( -1 );
113 if( !Release.AfterFirst('.').asInt(v[1]) ) return( -1 );
114 if( !Release.AfterLast ('.').asInt(v[2]) ) return( -1 );
115
116 return( SG_Compare_Version(Version, v[0], v[1], v[2]) );
117 }
118
119 //---------------------------------------------------------
124 //---------------------------------------------------------
125 int SG_Compare_SAGA_Version(int Major, int Minor, int Release)
126 {
127 if( Major < SAGA_MAJOR_VERSION ) return( -1 );
128 if( Major > SAGA_MAJOR_VERSION ) return( 1 );
129
130 if( Minor < SAGA_MINOR_VERSION ) return( -1 );
131 if( Minor > SAGA_MINOR_VERSION ) return( 1 );
132
133 if( Release < SAGA_RELEASE_NUMBER ) return( -1 );
134 if( Release > SAGA_RELEASE_NUMBER ) return( 1 );
135
136 return( 0 );
137 }
138
139 //---------------------------------------------------------
145 //---------------------------------------------------------
146 int SG_Compare_SAGA_Version(const CSG_String &Version)
147 {
148 int v[3];
149
150 if( !Version .asInt(v[0]) ) return( -1 );
151 if( !Version.AfterFirst('.').asInt(v[1]) ) return( -1 );
152 if( !Version.AfterLast ('.').asInt(v[2]) ) return( -1 );
153
154 return( SG_Compare_SAGA_Version(v[0], v[1], v[2]) );
155 }
156
157
159 // //
160 // //
161 // //
163
164 //---------------------------------------------------------
SG_T
#define SG_T(s)
Definition: api_core.h:531
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
saga_api.h
SAGA_RELEASE_NUMBER
#define SAGA_RELEASE_NUMBER
Definition: saga_api.h:89
SAGA_MAJOR_VERSION
#define SAGA_MAJOR_VERSION
Definition: saga_api.h:87
SAGA_API_Get_Version
const SG_Char * SAGA_API_Get_Version(void)
Definition: saga_api.cpp:63
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
SG_Char
#define SG_Char
Definition: api_core.h:530
SAGA_MINOR_VERSION
#define SAGA_MINOR_VERSION
Definition: saga_api.h:88
CSG_String
Definition: api_core.h:557
SG_Compare_Version
int SG_Compare_Version(const CSG_String &Version, int Major, int Minor, int Release)
Definition: saga_api.cpp:82
CSG_String::AfterLast
CSG_String AfterLast(char Character) const
Definition: api_string.cpp:655
SG_Compare_SAGA_Version
int SG_Compare_SAGA_Version(int Major, int Minor, int Release)
Definition: saga_api.cpp:125
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: saga_api.h File Reference

  • saga_core
  • saga_api
Macros | Functions
saga_api.h File Reference
#include "tool_library.h"
#include "data_manager.h"

Go to the source code of this file.

Macros

#define | SAGA_MAJOR_VERSION 9
#define | SAGA_MINOR_VERSION 2
#define | SAGA_RELEASE_NUMBER 0
#define | SAGA_VERSION SG_T("9.2.0")

Functions

SAGA_API_DLL_EXPORT const SG_Char * | SAGA_API_Get_Version (void)
SAGA_API_DLL_EXPORT int | SG_Compare_Version (const CSG_String &Version, int Major, int Minor, int Release)
SAGA_API_DLL_EXPORT int | SG_Compare_Version (const CSG_String &Version, const CSG_String &Release)
SAGA_API_DLL_EXPORT int | SG_Compare_SAGA_Version (const CSG_String &Version)
SAGA_API_DLL_EXPORT int | SG_Compare_SAGA_Version (int Major, int Minor, int Release)

Detailed Description

This is the central header to include the complete SAGA API.

Definition in file saga_api.h.

Macro Definition Documentation

◆ SAGA_MAJOR_VERSION

#define SAGA_MAJOR_VERSION 9

Definition at line 87 of file saga_api.h.

◆ SAGA_MINOR_VERSION

#define SAGA_MINOR_VERSION 2

Definition at line 88 of file saga_api.h.

◆ SAGA_RELEASE_NUMBER

#define SAGA_RELEASE_NUMBER 0

Definition at line 89 of file saga_api.h.

◆ SAGA_VERSION

#define SAGA_VERSION SG_T("9.2.0")

Definition at line 90 of file saga_api.h.

Function Documentation

◆ SAGA_API_Get_Version()

SAGA_API_DLL_EXPORT const SG_Char* SAGA_API_Get_Version ( void )

Definition at line 63 of file saga_api.cpp.

References SAGA_VERSION, and SG_T.

◆ SG_Compare_SAGA_Version() [1/2]

SAGA_API_DLL_EXPORT int SG_Compare_SAGA_Version ( const CSG_String & Version )

Compares to current SAGA version and returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version string is assumed to have the form 'Major.Minor.Release'.

Definition at line 146 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::asInt(), and SG_Compare_SAGA_Version().

◆ SG_Compare_SAGA_Version() [2/2]

SAGA_API_DLL_EXPORT int SG_Compare_SAGA_Version | ( | int | Major,
 |  | int | Minor,
 |  | int | Release
 | ) |  |

Compares to current SAGA version and returns -1 if it is less, 1 if it is greater or 0 if it is equal.

Definition at line 125 of file saga_api.cpp.

References SAGA_MAJOR_VERSION, SAGA_MINOR_VERSION, and SAGA_RELEASE_NUMBER.

Referenced by SG_Compare_SAGA_Version().

◆ SG_Compare_Version() [1/2]

SAGA_API_DLL_EXPORT int SG_Compare_Version | ( | const CSG_String & | Version,
 |  | const CSG_String & | Release
 | ) |  |

Compares two versions numbers. Returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version strings are assumed to have the form 'Major.Minor.Release'.

Definition at line 108 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), CSG_String::asInt(), and SG_Compare_Version().

◆ SG_Compare_Version() [2/2]

SAGA_API_DLL_EXPORT int SG_Compare_Version | ( | const CSG_String & | Version,
 |  | int | Major,
 |  | int | Minor,
 |  | int | Release
 | ) |  |

Compares two versions numbers. Returns -1 if it is less, 1 if it is greater or 0 if it is equal. Version string is assumed to have the form 'Major.Minor.Release'.

Definition at line 82 of file saga_api.cpp.

References CSG_String::AfterFirst(), CSG_String::AfterLast(), and CSG_String::asInt().

Referenced by CSG_Tool_Chain::Create(), CSG_Classifier_Supervised::Load(), and SG_Compare_Version().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: saga_api.h Source File

  • saga_core
  • saga_api
saga_api.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // saga_api.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__saga_api_H
54 #define HEADER_INCLUDED__SAGA_API__saga_api_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
69 // //
71 // //
72 // //
74
75 //---------------------------------------------------------
76 #include "tool_library.h"
77 #include "data_manager.h"
78
79
81 // //
82 // //
83 // //
85
86 //---------------------------------------------------------
87 #define SAGA_MAJOR_VERSION 9
88 #define SAGA_MINOR_VERSION 2
89 #define SAGA_RELEASE_NUMBER 0
90 #define SAGA_VERSION SG_T("9.2.0")
91
92
94 // //
95 // //
96 // //
98
99 //---------------------------------------------------------
100 SAGA_API_DLL_EXPORT const SG_Char * SAGA_API_Get_Version (void);
101
102 //---------------------------------------------------------
103 SAGA_API_DLL_EXPORT int SG_Compare_Version (const CSG_String &Version, int Major, int Minor, int Release);
104 SAGA_API_DLL_EXPORT int SG_Compare_Version (const CSG_String &Version, const CSG_String &Release);
105
106 SAGA_API_DLL_EXPORT int SG_Compare_SAGA_Version (const CSG_String &Version);
107 SAGA_API_DLL_EXPORT int SG_Compare_SAGA_Version (int Major, int Minor, int Release);
108
109
111 // //
112 // //
113 // //
115
116 //---------------------------------------------------------
117 #endif // #ifndef HEADER_INCLUDED__SAGA_API__saga_api_H
data_manager.h
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
SG_Compare_SAGA_Version
SAGA_API_DLL_EXPORT int SG_Compare_SAGA_Version(const CSG_String &Version)
Definition: saga_api.cpp:146
SAGA_API_Get_Version
SAGA_API_DLL_EXPORT const SG_Char * SAGA_API_Get_Version(void)
Definition: saga_api.cpp:63
SG_Compare_Version
SAGA_API_DLL_EXPORT int SG_Compare_Version(const CSG_String &Version, int Major, int Minor, int Release)
Definition: saga_api.cpp:82
tool_library.h
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape.cpp File Reference

  • saga_core
  • saga_api
shape.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape.cpp Source File

  • saga_core
  • saga_api
shape.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Shape::CSG_Shape(CSG_Shapes *pOwner, sLong Index)
64 : CSG_Table_Record(pOwner, Index)
65 {}
66
67 //---------------------------------------------------------
68 CSG_Shape::~CSG_Shape(void)
69 {
70 Destroy();
71 }
72
73
75 // //
77
78 //---------------------------------------------------------
79 void CSG_Shape::Destroy(void)
80 {}
81
82
84 // //
86
87 //---------------------------------------------------------
88 TSG_Shape_Type CSG_Shape::Get_Type(void) const
89 {
90 return( ((CSG_Shapes *)m_pTable)->Get_Type() );
91 }
92
93 //---------------------------------------------------------
94 TSG_Vertex_Type CSG_Shape::Get_Vertex_Type(void) const
95 {
96 return( ((CSG_Shapes *)m_pTable)->Get_Vertex_Type() );
97 }
98
99
101 // //
103
104 //---------------------------------------------------------
105 inline void CSG_Shape::_Invalidate(void)
106 {
107 ((CSG_Shapes *)m_pTable)->Set_Update_Flag();
108
109 Set_Modified();
110 }
111
112
114 // //
116
117 //---------------------------------------------------------
118 TSG_Intersection CSG_Shape::Intersects(CSG_Shape *pShape)
119 {
120 if( !pShape || !Intersects(pShape->Get_Extent()) )
121 {
122 return( INTERSECTION_None );
123 }
124
125 //-----------------------------------------------------
126 if( Get_Extent().is_Equal(pShape->Get_Extent()) && Get_Part_Count() == pShape->Get_Part_Count() && Get_Point_Count() == pShape->Get_Point_Count() )
127 {
128 bool bIdentical = true;
129
130 for(int iPart=0; iPart<Get_Part_Count() && bIdentical; iPart++)
131 {
132 if( Get_Point_Count(iPart) != pShape->Get_Point_Count(iPart) )
133 {
134 bIdentical = false;
135 }
136 else for(int iPoint=0; iPoint<Get_Point_Count(iPart) && bIdentical; iPoint++)
137 {
138 CSG_Point Point(Get_Point(iPoint, iPart));
139
140 if( !Point.is_Equal(pShape->Get_Point(iPoint, iPart)) )
141 {
142 bIdentical = false;
143 }
144 }
145 }
146
147 if( bIdentical )
148 {
149 return( INTERSECTION_Identical );
150 }
151 }
152
153 //-----------------------------------------------------
154 TSG_Intersection Intersection;
155
156 if( Get_Type() >= pShape->Get_Type() && (Intersection = On_Intersects(pShape)) != INTERSECTION_None )
157 {
158 return( Intersection );
159 }
160
161 Intersection = pShape->On_Intersects(this);
162
163 if( Intersection == INTERSECTION_Contained )
164 {
165 return( INTERSECTION_Contains );
166 }
167
168 if( Intersection == INTERSECTION_Contains )
169 {
170 return( INTERSECTION_Contained );
171 }
172
173 return( Intersection );
174 }
175
176 //---------------------------------------------------------
177 TSG_Intersection CSG_Shape::Intersects(const TSG_Rect &Region)
178 {
179 TSG_Intersection Intersection = Get_Extent().Intersects(Region);
180
181 switch( Intersection )
182 {
183 default : return( Intersection );
184 case INTERSECTION_Contains:
185 case INTERSECTION_Overlaps: return( On_Intersects(Region) );
186 }
187 }
188
189
191 // //
193
194 //---------------------------------------------------------
195 bool CSG_Shape::Assign(CSG_Table_Record *pRecord)
196 {
197 return( Assign(pRecord, SHAPE_COPY) );
198 }
199
200 bool CSG_Shape::Assign(CSG_Table_Record *pRecord, bool bAssign_Attributes)
201 {
202 return( Assign(pRecord, bAssign_Attributes ? SHAPE_COPY : SHAPE_COPY_GEOM) );
203 }
204
205 bool CSG_Shape::Assign(CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy)
206 {
207 if( pRecord )
208 {
209 if( (mCopy == SHAPE_COPY || mCopy == SHAPE_COPY_GEOM) && pRecord->Get_Table()->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes )
210 {
211 CSG_Shape *pShape = (CSG_Shape *)pRecord;
212
213 if( Get_Type() == pShape->Get_Type() )
214 {
215 On_Assign(pShape);
216 }
217 }
218
219 if( (mCopy == SHAPE_COPY || mCopy == SHAPE_COPY_ATTR) )
220 {
221 return( CSG_Table_Record::Assign(pRecord) );
222 }
223
224 return( true );
225 }
226
227 return( false );
228 }
229
230
232 // //
233 // //
234 // //
236
237 //---------------------------------------------------------
SHAPE_COPY_ATTR
@ SHAPE_COPY_ATTR
Definition: shapes.h:127
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Table_Record
Definition: table.h:130
CSG_Table::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: table.h:315
CSG_Table_Record::m_pTable
class CSG_Table * m_pTable
Definition: table.h:258
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
SHAPE_COPY_GEOM
@ SHAPE_COPY_GEOM
Definition: shapes.h:126
CSG_Table_Record::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: table_record.cpp:543
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
SHAPE_COPY
@ SHAPE_COPY
Definition: shapes.h:128
CSG_Shape::CSG_Shape
CSG_Shape(class CSG_Shapes *pOwner, sLong Index)
Definition: shape.cpp:63
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Table_Record::Get_Table
class CSG_Table * Get_Table(void)
Definition: table.h:135
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape::Destroy
virtual void Destroy(void)
Definition: shape.cpp:79
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Point
Definition: geo_tools.h:135
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Shape::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shape.cpp:94
sLong
signed long long sLong
Definition: api_core.h:158
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Table_Record::Set_Modified
void Set_Modified(bool bOn=true)
Definition: table_record.cpp:220
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_Shape::_Invalidate
virtual void _Invalidate(void)
Definition: shape.cpp:105
CSG_Shape::~CSG_Shape
virtual ~CSG_Shape(void)
Definition: shape.cpp:68
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shapes
Definition: shapes.h:773
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Point::is_Equal
virtual bool is_Equal(const CSG_Point &Point, double epsilon=0.) const
Definition: geo_tools.h:174
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
CSG_Shape::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)=0
CSG_Shape::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)=0
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape_line.cpp File Reference

  • saga_core
  • saga_api
shape_line.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape_line.cpp Source File

  • saga_core
  • saga_api
shape_line.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_line.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Shape_Line::CSG_Shape_Line(CSG_Shapes *pOwner, sLong Index)
64 : CSG_Shape_Points(pOwner, Index)
65 {}
66
67 //---------------------------------------------------------
68 CSG_Shape_Line::~CSG_Shape_Line(void)
69 {}
70
71
73 // //
74 // //
75 // //
77
78 //---------------------------------------------------------
79 TSG_Intersection CSG_Shape_Line::On_Intersects(CSG_Shape *pShape)
80 {
81 if( pShape->Get_Type() == SHAPE_TYPE_Point || pShape->Get_Type() == SHAPE_TYPE_Points )
82 {
83 bool bIn = false;
84 bool bOut = false;
85
86 for(int iPart=0; iPart<m_nParts; iPart++)
87 {
88 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
89 {
90 for(int jPoint=1; jPoint<pShape->Get_Point_Count(jPart); jPoint++)
91 {
92 TSG_Point Point;
93
94 if( Get_Distance(pShape->Get_Point(jPoint, jPart), Point, iPart) == 0.0 )
95 {
96 bIn = true;
97 }
98 else
99 {
100 bOut = true;
101 }
102
103 if( bIn && bOut )
104 {
105 return( INTERSECTION_Overlaps );
106 }
107 }
108 }
109 }
110
111 if( bIn )
112 {
113 return( INTERSECTION_Contained );
114 }
115 }
116
117 //-----------------------------------------------------
118 else if( pShape->Get_Type() == SHAPE_TYPE_Line )
119 {
120 TSG_Point iA, iB, jA, jB, Crossing;
121
122 for(int iPart=0; iPart<m_nParts; iPart++)
123 {
124 if( Get_Point_Count(iPart) > 1 )
125 {
126 iA = Get_Point(0, iPart);
127
128 for(int iPoint=1; iPoint<Get_Point_Count(iPart); iPoint++)
129 {
130 iB = iA;
131 iA = Get_Point(iPoint, iPart);
132
133 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
134 {
135 if( pShape->Get_Point_Count(jPart) > 1 )
136 {
137 jA = pShape->Get_Point(0, jPart);
138
139 for(int jPoint=1; jPoint<pShape->Get_Point_Count(jPart); jPoint++)
140 {
141 jB = jA;
142 jA = pShape->Get_Point(jPoint, jPart);
143
144 if( SG_Get_Crossing(Crossing, iA, iB, jA, jB) )
145 {
146 return( INTERSECTION_Overlaps );
147 }
148 }
149 }
150 }
151 }
152 }
153 }
154 }
155
156 return( INTERSECTION_None );
157 }
158
159 //---------------------------------------------------------
160 TSG_Intersection CSG_Shape_Line::On_Intersects(TSG_Rect Region)
161 {
162 // called if polygon's bounding box contains or overlaps with region.
163 // now let's figure out how region intersects with polygon itself
164
165 //-----------------------------------------------------
166 for(int iPart=0; iPart<m_nParts; iPart++)
167 {
168 CSG_Shape_Part *pPart = m_pParts[iPart];
169
170 switch( pPart->Get_Extent().Intersects(Region) )
171 {
172 case INTERSECTION_None: // region and line part are distinct
173 break;
174
175 case INTERSECTION_Identical: // region contains line part
176 case INTERSECTION_Contained:
177 return( Get_Extent().Intersects(Region) );
178
179 case INTERSECTION_Contains:
180 case INTERSECTION_Overlaps: // region overlaps with line part's extent, now let's look at the line part itself!
181 if( pPart->Get_Count() > 1 )
182 {
183 TSG_Point *pa, *pb, c;
184
185 pb = pPart->m_Points;
186 pa = pb + 1;
187
188 for(int iPoint=1; iPoint<pPart->Get_Count(); iPoint++, pb=pa++)
189 {
190 if( SG_Get_Crossing_InRegion(c, *pa, *pb, Region) )
191 {
192 return( INTERSECTION_Overlaps );
193 }
194 }
195 }
196 break;
197 }
198 }
199
200 //-----------------------------------------------------
201 TSG_Point p = Get_Point(0, 0);
202
203 if( Region.xMin <= p.x && p.x <= Region.xMax
204 && Region.yMin <= p.y && p.y <= Region.yMax )
205 {
206 return( INTERSECTION_Contained );
207 }
208
209 return( INTERSECTION_None );
210 }
211
212
214 // //
215 // //
216 // //
218
219 //---------------------------------------------------------
220 TSG_Point CSG_Shape_Line::Get_Centroid(void)
221 {
222 return( Get_Extent().Get_Center() );
223 }
224
225
227 // //
228 // //
229 // //
231
232 //---------------------------------------------------------
233 double CSG_Shape_Line::Get_Length(void)
234 {
235 int iPart;
236 double Length;
237
238 for(iPart=0, Length=0.0; iPart<m_nParts; iPart++)
239 {
240 Length += Get_Length(iPart);
241 }
242
243 return( Length );
244 }
245
246 //---------------------------------------------------------
247 double CSG_Shape_Line::Get_Length(int iPart)
248 {
249 int iPoint;
250 double Length;
251 TSG_Point *pA, *pB;
252
253 if( iPart >= 0 && iPart < m_nParts && m_pParts[iPart]->Get_Count() > 1 )
254 {
255 pB = m_pParts[iPart]->m_Points;
256 pA = pB + 1;
257
258 for(iPoint=1, Length=0.0; iPoint<m_pParts[iPart]->Get_Count(); iPoint++, pB=pA++)
259 {
260 Length += SG_Get_Distance(*pA, *pB);
261 }
262
263 return( Length );
264 }
265
266 return( 0.0 );
267 }
268
269
271 // //
272 // //
273 // //
275
276 //---------------------------------------------------------
277 double CSG_Shape_Line::Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
278 {
279 double Distance = -1.;
280
281 if( iPart >= 0 && iPart < m_nParts && m_pParts[iPart]->Get_Count() > 1 )
282 {
283 TSG_Point *pB = m_pParts[iPart]->m_Points;
284 TSG_Point *pA = pB + 1, C;
285
286 Distance = SG_Get_Nearest_Point_On_Line(Point, *pA, *pB, Next);
287
288 for(int i=1; i<m_pParts[iPart]->Get_Count() && Distance!=0.; i++, pB=pA++)
289 {
290 double d = SG_Get_Nearest_Point_On_Line(Point, *pA, *pB, C);
291
292 if( d >= 0. && (d < Distance || Distance < 0.) )
293 {
294 Distance = d;
295 Next = C;
296 }
297 }
298 }
299
300 return( Distance );
301 }
302
303
305 // //
306 // //
307 // //
309
310 //---------------------------------------------------------
CSG_Shape_Points::m_pParts
CSG_Shape_Part ** m_pParts
Definition: shapes.h:567
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
SG_Get_Crossing_InRegion
bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
Definition: geo_functions.cpp:342
CSG_Shape_Line::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shape_line.cpp:277
C
#define C
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_Shape_Points
Definition: shapes.h:484
CSG_Shape_Line::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_line.cpp:79
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
SSG_Point
Definition: geo_tools.h:128
SG_Get_Nearest_Point_On_Line
double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch)
Definition: geo_functions.cpp:421
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shape_Line::Get_Length
double Get_Length(void)
Definition: shape_line.cpp:233
CSG_Shape_Part::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: shapes.h:384
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
sLong
signed long long sLong
Definition: api_core.h:158
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Shape_Points::m_nParts
int m_nParts
Definition: shapes.h:561
CSG_Shape_Line::~CSG_Shape_Line
virtual ~CSG_Shape_Line(void)
Definition: shape_line.cpp:68
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
shapes.h
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Points::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:541
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Shape_Part::Get_Count
int Get_Count(void) const
Definition: shapes.h:386
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Shape_Line::CSG_Shape_Line
CSG_Shape_Line(class CSG_Shapes *pOwner, sLong Index)
Definition: shape_line.cpp:63
CSG_Shapes
Definition: shapes.h:773
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
SG_Get_Crossing
bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
Definition: geo_functions.cpp:280
CSG_Shape_Line::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shape_line.cpp:220
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
CSG_Shape_Part
Definition: shapes.h:372
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape_part.cpp File Reference

  • saga_core
  • saga_api
Macros
shape_part.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Macros

#define GET_GROW_SIZE(n) (n < 128 ? 1 : (n < 2048 ? 32 : 256))

Macro Definition Documentation

◆ GET_GROW_SIZE

#define GET_GROW_SIZE ( n ) (n < 128 ? 1 : (n < 2048 ? 32 : 256))

Definition at line 107 of file shape_part.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape_part.cpp Source File

  • saga_core
  • saga_api
shape_part.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_part.cpp //
15 // //
16 // Copyright (C) 2008 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Shape_Part::CSG_Shape_Part(CSG_Shape_Points *pOwner)
64 {
65 m_pOwner = pOwner;
66
67 m_nBuffer = 0;
68 m_nPoints = 0;
69 m_Points = NULL;
70 m_Z = NULL;
71 m_M = NULL;
72
73 m_bUpdate = true;
74 }
75
76 //---------------------------------------------------------
77 CSG_Shape_Part::~CSG_Shape_Part(void)
78 {
79 Destroy();
80 }
81
82 //---------------------------------------------------------
83 bool CSG_Shape_Part::Destroy(void)
84 {
85 if( m_pOwner ) { m_pOwner->m_nPoints -= m_nPoints; }
86
87 m_nPoints = 0;
88 m_nBuffer = 0;
89
90 if( m_Points ) { SG_Free(m_Points); m_Points = NULL; }
91 if( m_Z ) { SG_Free(m_Z ); m_Z = NULL; }
92 if( m_M ) { SG_Free(m_M ); m_M = NULL; }
93
94 m_bUpdate = true;
95
96 _Invalidate();
97
98 return( true );
99 }
100
101
103 // //
105
106 //---------------------------------------------------------
107 #define GET_GROW_SIZE(n) (n < 128 ? 1 : (n < 2048 ? 32 : 256))
108
109 //---------------------------------------------------------
110 bool CSG_Shape_Part::_Alloc_Memory(int nPoints)
111 {
112 if( m_nPoints == nPoints )
113 {
114 return( true );
115 }
116
117 int nGrow = GET_GROW_SIZE(nPoints);
118 int nBuffer = (nPoints / nGrow) * nGrow;
119
120 while( nBuffer < nPoints )
121 {
122 nBuffer += nGrow;
123 }
124
125 if( m_nBuffer == nBuffer )
126 {
127 return( true );
128 }
129
130 m_nBuffer = nBuffer;
131
132 //-----------------------------------------------------
133 TSG_Point *Points = (TSG_Point *)SG_Realloc(m_Points, m_nBuffer * sizeof(TSG_Point));
134
135 if( Points == NULL )
136 {
137 return( false );
138 }
139
140 m_Points = Points;
141
142 //-----------------------------------------------------
143 if( m_Z || ((CSG_Shapes *)m_pOwner->Get_Table())->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
144 {
145 double *Z = (double *)SG_Realloc(m_Z, m_nBuffer * sizeof(double));
146
147 if( !Z )
148 {
149 return( false );
150 }
151
152 m_Z = Z;
153 }
154
155 //-----------------------------------------------------
156 if( m_M || ((CSG_Shapes *)m_pOwner->Get_Table())->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
157 {
158 double *M = (double *)SG_Realloc(m_M, m_nBuffer * sizeof(double));
159
160 if( !M )
161 {
162 return( false );
163 }
164
165 m_M = M;
166 }
167
168 return( true );
169 }
170
171
173 // //
175
176 //---------------------------------------------------------
177 bool CSG_Shape_Part::Assign(CSG_Shape_Part *pPart)
178 {
179 if( _Alloc_Memory(pPart->m_nPoints) )
180 {
181 if( m_pOwner ) { m_pOwner->m_nPoints += pPart->m_nPoints - m_nPoints; }
182
183 m_nPoints = pPart->m_nPoints;
184
185 memcpy(m_Points, pPart->m_Points, m_nPoints * sizeof(TSG_Point));
186
187 m_Extent = pPart->m_Extent;
188
189 if( m_Z && pPart->m_Z )
190 {
191 memcpy(m_Z, pPart->m_Z, m_nPoints * sizeof(double));
192
193 m_ZMin = pPart->m_ZMin;
194 m_ZMax = pPart->m_ZMax;
195 }
196
197 if( m_M && pPart->m_M )
198 {
199 memcpy(m_M, pPart->m_M, m_nPoints * sizeof(double));
200
201 m_MMin = pPart->m_MMin;
202 m_MMax = pPart->m_MMax;
203 }
204
205 m_bUpdate = pPart->m_bUpdate;
206
207 if( m_pOwner )
208 {
209 m_pOwner->_Invalidate();
210 }
211
212 return( true );
213 }
214
215 return( false );
216 }
217
218
220 // //
222
223 //---------------------------------------------------------
224 int CSG_Shape_Part::Ins_Point(double x, double y, int iPoint)
225 {
226 if( iPoint >= 0 && iPoint <= m_nPoints && _Alloc_Memory(m_nPoints + 1) )
227 {
228 for(int i=m_nPoints; i>iPoint; i--)
229 {
230 m_Points[i] = m_Points[i - 1];
231
232 if( m_Z ) { m_Z[i] = m_Z[i - 1]; }
233 if( m_M ) { m_M[i] = m_M[i - 1]; }
234 }
235
236 m_nPoints++; if( m_pOwner ) { m_pOwner->m_nPoints++; }
237
238 m_Points[iPoint].x = x;
239 m_Points[iPoint].y = y;
240
241 if( m_Z ) { m_Z[iPoint] = 0.; }
242 if( m_M ) { m_M[iPoint] = 0.; }
243
244 _Invalidate();
245
246 return( 1 );
247 }
248
249 return( 0 );
250 }
251
252 int CSG_Shape_Part::Ins_Point(const CSG_Point_3D &p, int iPoint)
253 {
254 if( Ins_Point(p.x, p.y, iPoint) )
255 {
256 Set_Z(p.z, iPoint);
257
258 return( 1 );
259 }
260
261 return( 0 );
262 }
263
264 int CSG_Shape_Part::Ins_Point(const CSG_Point_4D &p, int iPoint)
265 {
266 if( Ins_Point(p.x, p.y, iPoint) )
267 {
268 Set_Z(p.z, iPoint);
269 Set_M(p.m, iPoint);
270
271 return( 1 );
272 }
273
274 return( 0 );
275 }
276
277 //---------------------------------------------------------
278 int CSG_Shape_Part::Set_Point(double x, double y, int iPoint)
279 {
280 if( iPoint >= 0 && iPoint < m_nPoints )
281 {
282 m_Points[iPoint].x = x;
283 m_Points[iPoint].y = y;
284
285 _Invalidate();
286
287 return( 1 );
288 }
289
290 return( 0 );
291 }
292
293 int CSG_Shape_Part::Set_Point(const CSG_Point_3D &p, int iPoint)
294 {
295 if( Set_Point(p.x, p.y, iPoint) )
296 {
297 Set_Z(p.z, iPoint);
298
299 return( 1 );
300 }
301
302 return( 0 );
303 }
304
305 int CSG_Shape_Part::Set_Point(const CSG_Point_4D &p, int iPoint)
306 {
307 if( Set_Point(p.x, p.y, iPoint) )
308 {
309 Set_Z(p.z, iPoint);
310 Set_M(p.m, iPoint);
311
312 return( 1 );
313 }
314
315 return( 0 );
316 }
317
318 //---------------------------------------------------------
319 int CSG_Shape_Part::Del_Point(int iPoint)
320 {
321 if( iPoint >= 0 && iPoint < m_nPoints )
322 {
323 m_nPoints--; if( m_pOwner ) { m_pOwner->m_nPoints--; }
324
325 for(int i=iPoint; i<m_nPoints; i++)
326 {
327 m_Points[i] = m_Points[i + 1];
328
329 if( m_Z )
330 {
331 m_Z[i] = m_Z[i + 1];
332
333 if( m_M )
334 {
335 m_M[i] = m_M[i + 1];
336 }
337 }
338 }
339
340 _Alloc_Memory(m_nPoints);
341
342 _Invalidate();
343
344 return( 1 );
345 }
346
347 return( 0 );
348 }
349
350
352 // //
354
355 //---------------------------------------------------------
356 bool CSG_Shape_Part::Revert_Points(void)
357 {
358 for(int i=0, j=m_nPoints-1; i<j; i++, j--)
359 {
360 TSG_Point p = m_Points[i]; m_Points[i] = m_Points[j]; m_Points[j] = p;
361
362 if( m_Z ) { double z = m_Z[i]; m_Z[i] = m_Z[j]; m_Z[j] = z; }
363 if( m_M ) { double m = m_M[i]; m_M[i] = m_M[j]; m_M[j] = m; }
364 }
365
366 return( true );
367 }
368
369
371 // //
373
374 //---------------------------------------------------------
375 inline void CSG_Shape_Part::_Invalidate(void)
376 {
377 m_bUpdate = true;
378
379 if( m_pOwner )
380 {
381 m_pOwner->_Invalidate();
382 }
383 }
384
385 //---------------------------------------------------------
386 void CSG_Shape_Part::_Update_Extent(void)
387 {
388 if( m_bUpdate )
389 {
390 CSG_Simple_Statistics x, y, z, m;
391
392 for(int i=0; i<m_nPoints; i++)
393 {
394 x.Add_Value(m_Points[i].x);
395 y.Add_Value(m_Points[i].y);
396
397 if( m_Z ) { z.Add_Value(m_Z[i]); }
398 if( m_M ) { m.Add_Value(m_M[i]); }
399 }
400
401 m_Extent.Assign(
402 x.Get_Minimum(), y.Get_Minimum(),
403 x.Get_Maximum(), y.Get_Maximum()
404 );
405
406 m_ZMin = z.Get_Minimum(); m_ZMax = z.Get_Maximum();
407 m_MMin = m.Get_Minimum(); m_MMax = m.Get_Maximum();
408
409 m_bUpdate = false;
410 }
411 }
412
413
415 // //
416 // //
417 // //
419
420 //---------------------------------------------------------
CSG_Shape_Part::m_pOwner
class CSG_Shape_Points * m_pOwner
Definition: shapes.h:466
CSG_Shape_Part::m_MMax
double m_MMax
Definition: shapes.h:460
GET_GROW_SIZE
#define GET_GROW_SIZE(n)
Definition: shape_part.cpp:107
CSG_Shape_Part::Revert_Points
bool Revert_Points(void)
Definition: shape_part.cpp:356
CSG_Shape_Part::Destroy
virtual bool Destroy(void)
Definition: shape_part.cpp:83
CSG_Shape_Points
Definition: shapes.h:484
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Shape_Part::_Invalidate
virtual void _Invalidate(void)
Definition: shape_part.cpp:375
SSG_Point
Definition: geo_tools.h:128
CSG_Shape_Part::m_nBuffer
int m_nBuffer
Definition: shapes.h:458
CSG_Table_Record::Get_Table
class CSG_Table * Get_Table(void)
Definition: table.h:135
CSG_Shape_Part::CSG_Shape_Part
CSG_Shape_Part(class CSG_Shape_Points *pOwner)
Definition: shape_part.cpp:63
CSG_Shape_Part::Assign
virtual bool Assign(CSG_Shape_Part *pPart)
Definition: shape_part.cpp:177
CSG_Shape_Part::Ins_Point
int Ins_Point(double x, double y, int iPoint)
Definition: shape_part.cpp:224
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
CSG_Shape_Part::~CSG_Shape_Part
virtual ~CSG_Shape_Part(void)
Definition: shape_part.cpp:77
CSG_Simple_Statistics::Get_Maximum
double Get_Maximum(void)
Definition: mat_tools.h:732
CSG_Shape_Part::m_ZMin
double m_ZMin
Definition: shapes.h:460
CSG_Shape_Part::m_Z
double * m_Z
Definition: shapes.h:460
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Simple_Statistics::Get_Minimum
double Get_Minimum(void)
Definition: mat_tools.h:731
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Point_4D
Definition: geo_tools.h:364
CSG_Shape_Part::m_nPoints
int m_nPoints
Definition: shapes.h:458
CSG_Shape_Part::Set_M
void Set_M(double m, int iPoint)
Definition: shapes.h:431
CSG_Shape_Part::m_M
double * m_M
Definition: shapes.h:460
CSG_Shape_Part::Set_Z
void Set_Z(double z, int iPoint)
Definition: shapes.h:416
CSG_Shape_Part::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:464
CSG_Shape_Part::_Update_Extent
virtual void _Update_Extent(void)
Definition: shape_part.cpp:386
CSG_Shape_Part::m_ZMax
double m_ZMax
Definition: shapes.h:460
CSG_Shape_Part::m_MMin
double m_MMin
Definition: shapes.h:460
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Shape_Points::_Invalidate
virtual void _Invalidate(void)
Definition: shapes.h:574
shapes.h
CSG_Simple_Statistics::Add_Value
void Add_Value(double Value, double Weight=1.)
Definition: mat_tools.cpp:527
CSG_Shape_Part::Del_Point
int Del_Point(int iPoint)
Definition: shape_part.cpp:319
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Part::Set_Point
int Set_Point(double x, double y, int iPoint)
Definition: shape_part.cpp:278
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Shape_Part::_Alloc_Memory
virtual bool _Alloc_Memory(int nPoints)
Definition: shape_part.cpp:110
CSG_Shapes
Definition: shapes.h:773
CSG_Shape_Points::m_nPoints
int m_nPoints
Definition: shapes.h:561
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Shape_Part::m_bUpdate
bool m_bUpdate
Definition: shapes.h:456
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Shape_Part
Definition: shapes.h:372
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape_point.cpp File Reference

  • saga_core
  • saga_api
shape_point.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape_point.cpp Source File

  • saga_core
  • saga_api
shape_point.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: Shapes //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_point.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Shape_Point::CSG_Shape_Point(CSG_Shapes *pOwner, sLong Index)
64 : CSG_Shape(pOwner, Index)
65 {}
66
67 //---------------------------------------------------------
68 CSG_Shape_Point::~CSG_Shape_Point(void)
69 {}
70
71
73 // //
75
76 //---------------------------------------------------------
77 bool CSG_Shape_Point::On_Assign(CSG_Shape *pShape)
78 {
79 if( pShape->Get_Point_Count(0) > 0 )
80 {
81 Set_Point(pShape->Get_Point());
82 Set_Z (pShape->Get_Z ());
83 Set_M (pShape->Get_M ());
84
85 return( true );
86 }
87
88 return( false );
89 }
90
91
93 // //
95
96 //---------------------------------------------------------
97 const CSG_Rect & CSG_Shape_Point::Get_Extent(void)
98 {
99 static CSG_Rect Extent;
100
101 Extent.Assign(m_Point.x, m_Point.y, m_Point.x, m_Point.y);
102
103 return( Extent );
104 }
105
106 //---------------------------------------------------------
107 TSG_Intersection CSG_Shape_Point::On_Intersects(CSG_Shape *pShape)
108 {
109 return( INTERSECTION_None );
110 }
111
112 //---------------------------------------------------------
113 TSG_Intersection CSG_Shape_Point::On_Intersects(TSG_Rect Extent)
114 {
115 if( Extent.xMin <= m_Point.x && m_Point.x <= Extent.xMax
116 && Extent.yMin <= m_Point.y && m_Point.y <= Extent.yMax )
117 {
118 return( INTERSECTION_Overlaps );
119 }
120
121 return( INTERSECTION_None );
122 }
123
124
126 // //
127 // //
128 // //
130
131 //---------------------------------------------------------
CSG_Rect
Definition: geo_tools.h:471
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Shape_Point::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)
Definition: shape_point.cpp:77
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Shape_Point::~CSG_Shape_Point
virtual ~CSG_Shape_Point(void)
Definition: shape_point.cpp:68
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_Shape_Point::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shapes.h:286
shapes.h
CSG_Shape_Point::CSG_Shape_Point
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index)
Definition: shape_point.cpp:63
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Point::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shape_point.cpp:97
CSG_Shape_Point::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_point.cpp:107
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:194
CSG_Shapes
Definition: shapes.h:773
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:210
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
CSG_Shape_Point::m_Point
TSG_Point m_Point
Definition: shapes.h:312
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape_points.cpp File Reference

  • saga_core
  • saga_api
shape_points.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape_points.cpp Source File

  • saga_core
  • saga_api
shape_points.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_points.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Shape_Points::CSG_Shape_Points(CSG_Shapes *pOwner, sLong Index)
64 : CSG_Shape(pOwner, Index)
65 {
66 m_pParts = NULL;
67 m_nParts = 0;
68
69 m_nPoints = 0; // total number of points
70
71 m_bUpdate = true;
72 }
73
74 //---------------------------------------------------------
75 CSG_Shape_Points::~CSG_Shape_Points(void)
76 {
77 Destroy();
78 }
79
80
82 // //
84
85 //---------------------------------------------------------
86 void CSG_Shape_Points::Destroy(void)
87 {
88 CSG_Shape::Destroy();
89
90 Del_Parts();
91 }
92
93
95 // //
97
98 //---------------------------------------------------------
99 bool CSG_Shape_Points::On_Assign(CSG_Shape *pShape)
100 {
101 Del_Parts();
102
103 TSG_Vertex_Type Vertex_Type = Get_Vertex_Type();
104
105 if( pShape->Get_Type() == SHAPE_TYPE_Point ) // just in case...
106 {
107 Add_Point(pShape->Get_Point());
108
109 switch( Vertex_Type )
110 {
111 case SG_VERTEX_TYPE_XYZM: Get_Part(0)->Set_M(pShape->Get_M(0), 0);
112 case SG_VERTEX_TYPE_XYZ : Get_Part(0)->Set_Z(pShape->Get_Z(0), 0);
113 default: break;
114 }
115
116 return( true );
117 }
118
119 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
120 {
121 Add_Part(((CSG_Shape_Points *)pShape)->Get_Part(iPart));
122 }
123
124 return( true );
125 }
126
127
129 // //
131
132 //---------------------------------------------------------
133 int CSG_Shape_Points::_Add_Part(void)
134 {
135 m_pParts = (CSG_Shape_Part **)SG_Realloc(m_pParts, ((uLong)m_nParts + 1) * sizeof(CSG_Shape_Part *));
136
137 m_pParts[m_nParts++] = _Get_Part();
138
139 return( m_nParts );
140 }
141
142 //---------------------------------------------------------
143 int CSG_Shape_Points::Add_Part(CSG_Shape_Part *pPart, bool bRevert)
144 {
145 int iPart = m_nParts;
146
147 if( pPart && _Add_Part() > iPart )
148 {
149 m_pParts[iPart]->Assign(pPart);
150
151 if( bRevert )
152 {
153 m_pParts[iPart]->Revert_Points();
154 }
155 }
156
157 return( m_nParts );
158 }
159
160 //---------------------------------------------------------
161 int CSG_Shape_Points::Del_Part(int del_Part)
162 {
163 if( del_Part >= 0 && del_Part < m_nParts )
164 {
165 m_nParts--;
166
167 delete(m_pParts[del_Part]);
168
169 for(int iPart=del_Part; iPart<m_nParts; iPart++)
170 {
171 m_pParts[iPart] = m_pParts[iPart + 1];
172 }
173
174 m_pParts = (CSG_Shape_Part **)SG_Realloc(m_pParts, m_nParts * sizeof(CSG_Shape_Part *));
175
176 _Invalidate();
177 }
178
179 return( m_nParts );
180 }
181
182 //---------------------------------------------------------
183 int CSG_Shape_Points::Del_Parts(void)
184 {
185 for(int iPart=m_nParts-1; iPart>=0; iPart--)
186 {
187 Del_Part(iPart);
188 }
189
190 return( m_nParts );
191 }
192
193
195 // //
197
198 //---------------------------------------------------------
199 int CSG_Shape_Points::Ins_Point(double x, double y, int iPoint, int iPart)
200 {
201 if( iPart >= m_nParts )
202 {
203 for(int i=m_nParts; i<=iPart; i++)
204 {
205 _Add_Part();
206 }
207 }
208
209 return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Ins_Point(x, y, iPoint) : 0 );
210 }
211
212 //---------------------------------------------------------
213 int CSG_Shape_Points::Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart)
214 {
215 if( Ins_Point(p.x, p.y, iPoint, iPart) )
216 {
217 Set_Z(p.z, iPoint, iPart);
218
219 return( 1 );
220 }
221
222 return( 0 );
223 }
224
225 //---------------------------------------------------------
226 int CSG_Shape_Points::Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart)
227 {
228 if( Ins_Point(p.x, p.y, iPoint, iPart) )
229 {
230 Set_Z(p.z, iPoint, iPart);
231 Set_M(p.m, iPoint, iPart);
232
233 return( 1 );
234 }
235
236 return( 0 );
237 }
238
239
241 // //
243
244 //---------------------------------------------------------
245 int CSG_Shape_Points::Set_Point(double x, double y, int iPoint, int iPart)
246 {
247 return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Set_Point(x, y, iPoint) : 0 );
248 }
249
250 //---------------------------------------------------------
251 int CSG_Shape_Points::Set_Point(const CSG_Point_3D &p, int iPoint, int iPart)
252 {
253 if( Set_Point(p.x, p.y, iPoint, iPart) )
254 {
255 Set_Z(p.z, iPoint, iPart);
256
257 return( 1 );
258 }
259
260 return( 0 );
261 }
262
263 //---------------------------------------------------------
264 int CSG_Shape_Points::Set_Point(const CSG_Point_4D &p, int iPoint, int iPart)
265 {
266 if( Set_Point(p.x, p.y, iPoint, iPart) )
267 {
268 Set_Z(p.z, iPoint, iPart);
269 Set_M(p.m, iPoint, iPart);
270
271 return( 1 );
272 }
273
274 return( 0 );
275 }
276
277
279 // //
281
282 //---------------------------------------------------------
283 int CSG_Shape_Points::Del_Point(int iPoint, int iPart)
284 {
285 return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Del_Point(iPoint) : 0 );
286 }
287
288
290 // //
292
293 //---------------------------------------------------------
294 TSG_Point CSG_Shape_Points::Get_Point(int iPoint) const
295 {
296 for(int iPart=0; iPart<m_nParts; iPoint-=m_pParts[iPart++]->Get_Count())
297 {
298 if( iPoint < m_pParts[iPart]->Get_Count() )
299 {
300 return( m_pParts[iPart]->Get_Point(iPoint) );
301 }
302 }
303
304 return( (TSG_Point)CSG_Point(0., 0.) );
305 }
306
307
309 // //
311
312 //---------------------------------------------------------
313 void CSG_Shape_Points::_Update_Extent(void)
314 {
315 if( m_bUpdate )
316 {
317 int nPoints = 0;
318
319 for(int iPart=0; iPart<m_nParts; iPart++)
320 {
321 CSG_Shape_Part *pPart = m_pParts[iPart];
322
323 if( pPart->Get_Count() > 0 )
324 {
325 if( nPoints == 0 )
326 {
327 nPoints = pPart->Get_Count();
328
329 m_Extent = pPart->Get_Extent();
330
331 m_ZMin = pPart->Get_ZMin();
332 m_ZMax = pPart->Get_ZMax();
333
334 m_MMin = pPart->Get_MMin();
335 m_MMax = pPart->Get_MMax();
336 }
337 else
338 {
339 nPoints += pPart->Get_Count();
340
341 m_Extent.Union(pPart->Get_Extent());
342
343 if ( m_ZMin > pPart->Get_ZMin() ) { m_ZMin = pPart->Get_ZMin(); }
344 else if( m_ZMax < pPart->Get_ZMax() ) { m_ZMax = pPart->Get_ZMax(); }
345
346 if ( m_MMin > pPart->Get_MMin() ) { m_MMin = pPart->Get_MMin(); }
347 else if( m_MMax < pPart->Get_MMax() ) { m_MMax = pPart->Get_MMax(); }
348 }
349 }
350 }
351
352 m_bUpdate = false;
353
354 //_ASSERT(nPoints == m_nPoints);
355 }
356 }
357
358
360 // //
362
363 //---------------------------------------------------------
364 TSG_Point CSG_Shape_Points::Get_Centroid(void)
365 {
366 int n = 0; CSG_Point c(0., 0.);
367
368 for(int iPart=0; iPart<Get_Part_Count(); iPart++)
369 {
370 for(int iPoint=0; iPoint<Get_Point_Count(iPart); iPoint++)
371 {
372 c += Get_Point(iPoint, iPart);
373 n ++;
374 }
375 }
376
377 if( n > 0 )
378 {
379 c.Assign(c.x / n, c.y / n);
380 }
381
382 return( (TSG_Point)c );
383 }
384
385
387 // //
389
390 //---------------------------------------------------------
391 double CSG_Shape_Points::Get_Distance(TSG_Point Point) const
392 {
393 TSG_Point Next; return( Get_Distance(Point, Next) );
394 }
395
396 //---------------------------------------------------------
397 double CSG_Shape_Points::Get_Distance(TSG_Point Point, int iPart) const
398 {
399 TSG_Point Next; return( Get_Distance(Point, Next, iPart) );
400 }
401
402 //---------------------------------------------------------
403 double CSG_Shape_Points::Get_Distance(TSG_Point Point, TSG_Point &Next) const
404 {
405 double Distance = Get_Distance(Point, Next, 0);
406
407 for(int iPart=1; iPart<m_nParts && Distance!=0.; iPart++)
408 {
409 TSG_Point iNext; double iDistance = Get_Distance(Point, iNext, iPart);
410
411 if( iDistance >= 0. && (iDistance < Distance || Distance < 0.) )
412 {
413 Distance = iDistance; Next = iNext;
414 }
415 }
416
417 return( Distance );
418 }
419
420 //---------------------------------------------------------
421 double CSG_Shape_Points::Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
422 {
423 double Distance = -1.;
424
425 if( iPart >= 0 && iPart < m_nParts )
426 {
427 TSG_Point *pPoint = m_pParts[iPart]->m_Points;
428
429 for(int iPoint=0; iPoint<m_pParts[iPart]->Get_Count() && Distance!=0.; iPoint++, pPoint++)
430 {
431 double iDistance = SG_Get_Distance(Point, *pPoint);
432
433 if( iDistance < Distance || Distance < 0. )
434 {
435 Distance = iDistance; Next = *pPoint;
436 }
437 }
438 }
439
440 return( Distance );
441 }
442
443
445 // //
447
448 //---------------------------------------------------------
449 TSG_Intersection CSG_Shape_Points::On_Intersects(CSG_Shape *pShape)
450 {
451 CSG_Shape *piPoints, *pjPoints;
452
453 if( Get_Point_Count() < pShape->Get_Point_Count() )
454 {
455 piPoints = this;
456 pjPoints = pShape;
457 }
458 else
459 {
460 piPoints = pShape;
461 pjPoints = this;
462 }
463
464 bool bIn = false;
465 bool bOut = false;
466
467 for(int iPart=0; iPart<piPoints->Get_Part_Count(); iPart++)
468 {
469 for(int iPoint=0; iPoint<piPoints->Get_Point_Count(iPart); iPoint++)
470 {
471 CSG_Point Point = piPoints->Get_Point(iPoint, iPart);
472
473 for(int jPart=0; jPart<pjPoints->Get_Part_Count(); jPart++)
474 {
475 for(int jPoint=0; jPoint<pjPoints->Get_Point_Count(jPart); jPoint++)
476 {
477 if( Point.is_Equal(pjPoints->Get_Point(jPoint, jPart)) )
478 {
479 bIn = true;
480 }
481 else
482 {
483 bOut = true;
484 }
485
486 if( bIn && bOut )
487 {
488 return( INTERSECTION_Overlaps );
489 }
490 }
491 }
492 }
493 }
494
495 if( bIn )
496 {
497 return( piPoints == this ? INTERSECTION_Contained : INTERSECTION_Contains );
498 }
499
500 return( INTERSECTION_None );
501 }
502
503 //---------------------------------------------------------
504 TSG_Intersection CSG_Shape_Points::On_Intersects(TSG_Rect Extent)
505 {
506 for(int iPart=0; iPart<m_nParts; iPart++)
507 {
508 TSG_Point *p = m_pParts[iPart]->m_Points;
509
510 for(int iPoint=0; iPoint<m_pParts[iPart]->Get_Count(); iPoint++, p++)
511 {
512 if( Extent.xMin <= p->x && p->x <= Extent.xMax
513 && Extent.yMin <= p->y && p->y <= Extent.yMax )
514 {
515 return( INTERSECTION_Overlaps );
516 }
517 }
518 }
519
520 return( INTERSECTION_None );
521 }
522
523
525 // //
526 // //
527 // //
529
530 //---------------------------------------------------------
CSG_Shape_Part::Get_MMax
double Get_MMax(void)
Definition: shapes.h:434
CSG_Shape_Points::m_pParts
CSG_Shape_Part ** m_pParts
Definition: shapes.h:567
CSG_Shape_Points::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:539
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Shape_Part::Revert_Points
bool Revert_Points(void)
Definition: shape_part.cpp:356
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
CSG_Shape_Part::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:418
CSG_Shape_Points::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:531
CSG_Shape_Points::Del_Parts
virtual int Del_Parts(void)
Definition: shape_points.cpp:183
CSG_Shape_Points::m_MMax
double m_MMax
Definition: shapes.h:563
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Shape_Points
Definition: shapes.h:484
CSG_Shape_Points::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)
Definition: shape_points.cpp:99
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Shape_Points::_Update_Extent
void _Update_Extent(void)
Definition: shape_points.cpp:313
SSG_Point
Definition: geo_tools.h:128
CSG_Shape_Points::Destroy
virtual void Destroy(void)
Definition: shape_points.cpp:86
CSG_Shape_Points::m_ZMax
double m_ZMax
Definition: shapes.h:563
CSG_Shape_Points::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shape_points.cpp:245
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Shape_Part::Assign
virtual bool Assign(CSG_Shape_Part *pPart)
Definition: shape_part.cpp:177
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape_Points::m_MMin
double m_MMin
Definition: shapes.h:563
CSG_Shape::Destroy
virtual void Destroy(void)
Definition: shape.cpp:79
CSG_Shape_Points::Get_Distance
virtual double Get_Distance(TSG_Point Point) const
Definition: shape_points.cpp:391
CSG_Shape_Points::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:536
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shape_Points::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)
Definition: shape_points.cpp:199
CSG_Point
Definition: geo_tools.h:135
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Shape_Part::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: shapes.h:384
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Shape_Points::m_ZMin
double m_ZMin
Definition: shapes.h:563
CSG_Shape_Points::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:534
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Shape::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shape.cpp:94
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_Point_4D
Definition: geo_tools.h:364
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape_Part::Set_M
void Set_M(double m, int iPoint)
Definition: shapes.h:431
CSG_Shape_Points::_Get_Part
virtual CSG_Shape_Part * _Get_Part(void)
Definition: shapes.h:572
CSG_Point::Assign
virtual void Assign(double x, double y)
Definition: geo_classes.cpp:86
CSG_Shape_Points::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)
Definition: shapes.h:503
CSG_Shape_Points::~CSG_Shape_Points
virtual ~CSG_Shape_Points(void)
Definition: shape_points.cpp:75
CSG_Shape_Points::_Add_Part
int _Add_Part(void)
Definition: shape_points.cpp:133
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
CSG_Shape_Part::Set_Z
void Set_Z(double z, int iPoint)
Definition: shapes.h:416
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Shape_Points::m_nParts
int m_nParts
Definition: shapes.h:561
CSG_Shape_Points::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:565
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Shape_Points::_Invalidate
virtual void _Invalidate(void)
Definition: shapes.h:574
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_Shape_Points::Add_Part
virtual int Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false)
Definition: shape_points.cpp:143
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shape_Points::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:499
CSG_Shape_Points::CSG_Shape_Points
CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index)
Definition: shape_points.cpp:63
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Shape_Part::Get_Count
int Get_Count(void) const
Definition: shapes.h:386
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Points::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_points.cpp:449
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Shape_Points::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)
Definition: shape_points.cpp:283
CSG_Shape_Part::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:419
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Shapes
Definition: shapes.h:773
CSG_Shape_Points::m_nPoints
int m_nPoints
Definition: shapes.h:561
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Shape_Points::Del_Part
virtual int Del_Part(int iPart)
Definition: shape_points.cpp:161
CSG_Point::is_Equal
virtual bool is_Equal(const CSG_Point &Point, double epsilon=0.) const
Definition: geo_tools.h:174
CSG_Shape_Points::m_bUpdate
bool m_bUpdate
Definition: shapes.h:559
uLong
unsigned long long uLong
Definition: api_core.h:159
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape_Points::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shape_points.cpp:364
CSG_Shape
Definition: shapes.h:141
CSG_Shape_Part
Definition: shapes.h:372
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shape_Part::Get_MMin
double Get_MMin(void)
Definition: shapes.h:433
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shape_polygon.cpp File Reference

  • saga_core
  • saga_api
Macros
shape_polygon.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Macros

#define | BOOL3_NOTSET -1
#define | BOOL3_FALSE 0
#define | BOOL3_TRUE 1

Macro Definition Documentation

◆ BOOL3_FALSE

#define BOOL3_FALSE 0

Definition at line 64 of file shape_polygon.cpp.

◆ BOOL3_NOTSET

#define BOOL3_NOTSET -1

Definition at line 63 of file shape_polygon.cpp.

◆ BOOL3_TRUE

#define BOOL3_TRUE 1

Definition at line 65 of file shape_polygon.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shape_polygon.cpp Source File

  • saga_core
  • saga_api
shape_polygon.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_polygon.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 #define BOOL3_NOTSET -1
64 #define BOOL3_FALSE 0
65 #define BOOL3_TRUE 1
66
67
69 // //
70 // //
71 // //
73
74 //---------------------------------------------------------
75 CSG_Shape_Polygon_Part::CSG_Shape_Polygon_Part(CSG_Shape_Points *pOwner)
76 : CSG_Shape_Part(pOwner)
77 {
78 m_bLake = BOOL3_NOTSET;
79 m_bClockwise = BOOL3_NOTSET;
80 }
81
82 //---------------------------------------------------------
83 CSG_Shape_Polygon_Part::~CSG_Shape_Polygon_Part(void)
84 {}
85
86
88 // //
90
91 //---------------------------------------------------------
92 void CSG_Shape_Polygon_Part::_Invalidate(void)
93 {
94 CSG_Shape_Part::_Invalidate();
95
96 m_bLake = BOOL3_NOTSET;
97 m_bClockwise = BOOL3_NOTSET;
98 }
99
100 //---------------------------------------------------------
101 void CSG_Shape_Polygon_Part::_Update_Area(void)
102 {
103 if( m_nPoints > 2 && m_bClockwise == BOOL3_NOTSET )
104 {
105 TSG_Point *pPoint, A, B;
106
107 m_Area = 0.0;
108 m_Perimeter = 0.0;
109
110 m_Centroid.x = 0.0;
111 m_Centroid.y = 0.0;
112
113 pPoint = m_Points + m_nPoints - 1;
114 B.x = pPoint->x - Get_Extent().Get_XCenter();
115 B.y = pPoint->y - Get_Extent().Get_YCenter();
116 pPoint = m_Points;
117
118 for(int iPoint=0; iPoint<m_nPoints; iPoint++, pPoint++, B=A)
119 {
120 A.x = pPoint->x - Get_Extent().Get_XCenter();
121 A.y = pPoint->y - Get_Extent().Get_YCenter();
122
123 double d = B.x * A.y - A.x * B.y;
124
125 m_Centroid.x += d * (A.x + B.x);
126 m_Centroid.y += d * (A.y + B.y);
127
128 m_Area += d;
129
130 m_Perimeter += SG_Get_Distance(A, B);
131 }
132
133 if( m_Area != 0.0 )
134 {
135 m_Centroid.x /= (3.0 * m_Area); m_Centroid.x += Get_Extent().Get_XCenter();
136 m_Centroid.y /= (3.0 * m_Area); m_Centroid.y += Get_Extent().Get_YCenter();
137 }
138
139 m_bClockwise = m_Area < 0.0 ? BOOL3_TRUE : BOOL3_FALSE;
140
141 m_Area = fabs(m_Area) / 2.0;
142 }
143 }
144
145
147 // //
149
150 //---------------------------------------------------------
151 TSG_Polygon_Point_Relation CSG_Shape_Polygon_Part::Get_Point_Relation(const CSG_Point &p)
152 {
153 return( Get_Point_Relation(p.x, p.y) );
154 }
155
156 //---------------------------------------------------------
157 TSG_Polygon_Point_Relation CSG_Shape_Polygon_Part::Get_Point_Relation(double x, double y)
158 {
159 if( m_nPoints > 2 && Get_Extent().Contains(x, y) )
160 {
161 TSG_Point *pA = m_Points;
162 TSG_Point *pB = m_Points + m_nPoints - 1;
163
164 if( x == pB->x && y == pB->y ) // for performance reason check vertex first
165 {
166 return( SG_POLYGON_POINT_Vertex );
167 }
168
169 double dy = pB->y - pA->y; // indicates the direction that we come from
170
171 if( dy == 0.0 )
172 {
173 for(int iPoint=m_nPoints-2; dy==0.0 && iPoint>0; iPoint--)
174 {
175 dy = m_Points[iPoint].y - pA->y;
176 }
177 }
178
179 int nCrossings = 0;
180
181 for(int iPoint=0; iPoint<m_nPoints; iPoint++, pB=pA++)
182 {
183 if( x == pA->x && y == pA->y ) // for performance reason check vertex first
184 {
185 return( SG_POLYGON_POINT_Vertex );
186 }
187
188 if( pA->x == pB->x && pA->y == pB->y ) // ignore doubles
189 {
190 continue;
191 }
192
193 if( y < pA->y ) // pA above y
194 {
195 if( y > pB->y ) // pB below y
196 {
197 double cx = pB->x + (y - pB->y) * (pA->x - pB->x) / (pA->y - pB->y);
198
199 if( cx == x )
200 {
201 return( SG_POLYGON_POINT_Edge );
202 }
203
204 if( cx < x )
205 {
206 nCrossings++;
207 }
208 }
209 else if( y == pB->y && pB->x < x && dy < 0.0 )
210 {
211 nCrossings++;
212 }
213 }
214 else if( y > pA->y ) // pA below y
215 {
216 if( y < pB->y ) // pB above y
217 {
218 double cx = pB->x + (y - pB->y) * (pA->x - pB->x) / (pA->y - pB->y);
219
220 if( cx == x )
221 {
222 return( SG_POLYGON_POINT_Edge );
223 }
224
225 if( cx < x )
226 {
227 nCrossings++;
228 }
229 }
230 else if( y == pB->y && pB->x < x && dy > 0.0 )
231 {
232 nCrossings++;
233 }
234 }
235 else // pA on line y
236 {
237 if( y == pB->y ) // pB on line y
238 {
239 if( (pA->x < x && x < pB->x)
240 || (pA->x > x && x > pB->x) )
241 {
242 return( SG_POLYGON_POINT_Edge );
243 }
244 }
245 }
246
247 if( pA->y != pB->y )
248 {
249 dy = pB->y - pA->y;
250 }
251 }
252
253 if( nCrossings % 2 != 0 )
254 {
255 return( SG_POLYGON_POINT_Interior );
256 }
257 }
258
259 return( SG_POLYGON_POINT_Outside );
260 }
261
262
264 // //
266
267 //---------------------------------------------------------
268 bool CSG_Shape_Polygon_Part::is_OnEdge(const CSG_Point &p)
269 {
270 return( is_OnEdge(p.x, p.y) );
271 }
272
273 //---------------------------------------------------------
274 bool CSG_Shape_Polygon_Part::is_OnEdge(double x, double y)
275 {
276 TSG_Polygon_Point_Relation r = Get_Point_Relation(x, y);
277
278 return( r == SG_POLYGON_POINT_Vertex
279 || r == SG_POLYGON_POINT_Edge
280 );
281 }
282
283
285 // //
287
288 //---------------------------------------------------------
289 bool CSG_Shape_Polygon_Part::Contains(const CSG_Point &p)
290 {
291 return( Contains(p.x, p.y) );
292 }
293
294 //---------------------------------------------------------
295 bool CSG_Shape_Polygon_Part::Contains(double x, double y)
296 {
297 TSG_Polygon_Point_Relation r = Get_Point_Relation(x, y);
298
299 return( r == SG_POLYGON_POINT_Interior
300 || r == SG_POLYGON_POINT_Vertex
301 || r == SG_POLYGON_POINT_Edge
302 );
303
304 //-----------------------------------------------------
305 if( m_nPoints > 2 && Get_Extent().Contains(x, y) )
306 {
307 int nCrossings = 0;
308
309 TSG_Point *pA = m_Points;
310 TSG_Point *pB = m_Points + m_nPoints - 1;
311
312 for(int iPoint=0; iPoint<m_nPoints; iPoint++, pB=pA++)
313 {
314 if( y <= pA->y ) // pA on or above ray
315 {
316 if( pB->y <= y ) // pB on or below ray
317 {
318 if( ((y - pB->y) * (pA->x - pB->x)) >= ((x - pB->x) * (pA->y - pB->y)) )
319 {
320 nCrossings++;
321 }
322 }
323 }
324 else // pA below ray
325 {
326 if( pB->y >= y ) // pB above ray
327 {
328 if( ((y - pB->y) * (pA->x - pB->x)) <= ((x - pB->x) * (pA->y - pB->y)) )
329 {
330 nCrossings++;
331 }
332 }
333 }
334 }
335
336 return( nCrossings % 2 != 0 );
337 }
338
339 return( false );
340 }
341
342
344 // //
346
347 //---------------------------------------------------------
356 //---------------------------------------------------------
357 bool CSG_Shape_Polygon_Part::is_Neighbour(CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck)
358 {
359 if( !Get_Extent().Intersects(pPart->Get_Extent()) )
360 {
361 return( false );
362 }
363
364 bool bNeighbour = false;
365
366 //---------------------------------------------------------
367 for(int iPoint=0; iPoint<pPart->Get_Count(); iPoint++)
368 {
369 switch( Get_Point_Relation(pPart->Get_Point(iPoint)) )
370 {
371 case SG_POLYGON_POINT_Outside : break;
372 case SG_POLYGON_POINT_Interior: return( false );
373 case SG_POLYGON_POINT_Vertex :
374 case SG_POLYGON_POINT_Edge : if( bSimpleCheck ) { return( true ); }
375 bNeighbour = true;
376 break;
377 }
378 }
379
380 //---------------------------------------------------------
381 for(int iPoint=0; iPoint<Get_Count(); iPoint++)
382 {
383 switch( pPart->Get_Point_Relation(Get_Point(iPoint)) )
384 {
385 case SG_POLYGON_POINT_Outside : break;
386 case SG_POLYGON_POINT_Interior: return( false );
387 case SG_POLYGON_POINT_Vertex :
388 case SG_POLYGON_POINT_Edge : if( bSimpleCheck ) { return( true ); }
389 bNeighbour = true;
390 break;
391 }
392 }
393
394 return( bNeighbour );
395 }
396
397
399 // //
401
402 //---------------------------------------------------------
403 void CSG_Shape_Polygon_Part::_Add_Edge_Points(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon)
404 {
405 CSG_Points Points;
406
407 for(int i=0; i<pPart->Get_Count(); i++)
408 {
409 CSG_Point P = pPart->Get_Point(i);
410
411 if( P != P0 && P != P1 && SG_Is_Point_On_Line(P, P0, P1, true, Epsilon) )
412 {
413 Points.Add(P);
414 }
415 }
416
417 if( Points.Get_Count() == 1 )
418 {
419 Part.Add(Points[0]);
420 }
421 else if( Points.Get_Count() > 1 )
422 {
423 double *Distances = new double[Points.Get_Count()];
424
425 for(sLong i=0; i<Points.Get_Count(); i++)
426 {
427 Distances[i] = SG_Get_Distance(P0, Points[i]);
428 }
429
430 CSG_Index Index(Points.Get_Count(), Distances); delete[](Distances);
431
432 for(sLong i=0; i<Points.Get_Count(); i++)
433 {
434 Part.Add(Points[Index[i]]);
435 }
436 }
437 }
438
439 //---------------------------------------------------------
440 bool CSG_Shape_Polygon_Part::_is_OnEdge(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex, double Epsilon)
441 {
442 CSG_Point P1 = pPart->Get_Point(0, false); // close the ring, starting with last point!
443
444 if( !bVertex && P == P1 )
445 {
446 return( false );
447 }
448
449 for(int i=0; i<pPart->Get_Count(); i++)
450 {
451 CSG_Point P0 = P1; P1 = pPart->Get_Point(i);
452
453 if( !bVertex && P == P1 )
454 {
455 return( false );
456 }
457
458 if( SG_Is_Point_On_Line(P, P0, P1, true, Epsilon) )
459 {
460 return( true );
461 }
462 }
463
464 return( false );
465 }
466
467 //---------------------------------------------------------
478 //---------------------------------------------------------
479 CSG_Lines CSG_Shape_Polygon_Part::Get_Shared_Edges(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon)
480 {
481 CSG_Lines Edges;
482
483 if( Get_Extent().Intersects(pPart->Get_Extent()) )
484 {
485 if( bVertexCheck == false )
486 {
487 bool bOnEdge = is_OnEdge(pPart->Get_Point(0, false)); // close the ring, starting with last point!
488
489 if( bOnEdge )
490 {
491 Edges.Add().Add(pPart->Get_Point(0, false));
492 }
493
494 for(int i=0; i<pPart->Get_Count(); i++)
495 {
496 CSG_Point Point = pPart->Get_Point(i);
497
498 if( is_OnEdge(Point) )
499 {
500 if( !bOnEdge ) // start a new edge segment
501 {
502 Edges.Add().Add(Point);
503 }
504 else // continue edge segment
505 {
506 Edges[Edges.Get_Count() - 1].Add(Point);
507 }
508
509 bOnEdge = true;
510 }
511 else
512 {
513 bOnEdge = false;
514 }
515 }
516 }
517 else
518 {
519 CSG_Points Part; CSG_Point P1 = Get_Point(0, false); // close the ring, starting with last point!
520
521 if( _is_OnEdge(pPart, P1, true, Epsilon) ) { Part.Add(P1); }
522
523 for(int i=0; i<Get_Count(); i++)
524 {
525 CSG_Point P0 = P1; P1 = Get_Point(i);
526
527 _Add_Edge_Points(pPart, P0, P1, Part, Epsilon);
528
529 if( _is_OnEdge(pPart, P1, true, Epsilon) ) { Part.Add(P1); }
530 }
531
532 //---------------------------------------------
533 if( Part.Get_Count() > 1 )
534 {
535 P1 = Part[0]; bool bOnEdge = false;
536 CSG_Point C0 = P1;
537
538 for(sLong i=1, n=-1; i<Part.Get_Count(); i++)
539 {
540 CSG_Point C1, P0 = P1; P1 = Part[i];
541
542 C1.x = P0.x + 0.5 * (P1.x - P0.x);
543 C1.y = P0.y + 0.5 * (P1.y - P0.y);
544
545 if( C0 == C1 )
546 {
547 continue; // do not add the same edge twice (in different directions)
548 }
549
550 if( _is_OnEdge(this, C1, true, Epsilon) && _is_OnEdge(pPart, C1, true, Epsilon) )
551 {
552 if( !bOnEdge ) // start a new edge segment
553 {
554 n = Edges.Get_Count(); Edges.Add();
555 Edges[n].Add(P0);
556 Edges[n].Add(P1);
557 }
558 else // continue edge segment
559 {
560 Edges[n].Add(P1);
561 }
562
563 bOnEdge = true;
564 }
565 else
566 {
567 bOnEdge = false;
568 }
569
570 C0 = C1;
571 }
572 }
573 }
574 }
575
576 return( Edges );
577 }
578
579 //---------------------------------------------------------
585 //---------------------------------------------------------
586 double CSG_Shape_Polygon_Part::Get_Shared_Length(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon)
587 {
588 CSG_Lines Edges(Get_Shared_Edges(pPart, bVertexCheck, Epsilon));
589
590 return( Edges.Get_Length() );
591 }
592
593
595 // //
597
598 //---------------------------------------------------------
599 double CSG_Shape_Polygon_Part::Get_Distance(TSG_Point Point, TSG_Point &Next)
600 {
601 if( m_nPoints < 1 )
602 {
603 return( -1.0 );
604 }
605
606 if( Contains(Point) )
607 {
608 return( 0.0 );
609 }
610
611 TSG_Point *pB = m_Points + m_nPoints - 1;
612 TSG_Point *pA = m_Points, C;
613
614 double Distance = SG_Get_Nearest_Point_On_Line(Point, *pA, *pB, Next);
615
616 for(int iPoint=0; iPoint<m_nPoints && Distance>0.0; iPoint++, pB=pA++)
617 {
618 double d = SG_Get_Nearest_Point_On_Line(Point, *pA, *pB, C);
619
620 if( d >= 0.0 && d < Distance )
621 {
622 Distance = d;
623 Next = C;
624 }
625 }
626
627 return( Distance );
628 }
629
630
632 // //
633 // //
634 // //
636
637 //---------------------------------------------------------
638 CSG_Shape_Polygon::CSG_Shape_Polygon(CSG_Shapes *pOwner, sLong Index)
639 : CSG_Shape_Points(pOwner, Index)
640 {
641 m_bUpdate_Lakes = true;
642 }
643
644 //---------------------------------------------------------
645 CSG_Shape_Polygon::~CSG_Shape_Polygon(void)
646 {}
647
648
650 // //
652
653 //---------------------------------------------------------
654 void CSG_Shape_Polygon::_Invalidate(void)
655 {
656 CSG_Shape_Points::_Invalidate();
657
658 if( m_bUpdate_Lakes )
659 {
660 m_bUpdate_Lakes = false;
661
662 for(int i=0; i<m_nParts; i++)
663 {
664 Get_Polygon_Part(i)->m_bLake = BOOL3_NOTSET;
665 }
666 }
667 }
668
669
671 // //
673
674 //---------------------------------------------------------
675 TSG_Intersection CSG_Shape_Polygon::On_Intersects(CSG_Shape *pShape)
676 {
677 //-----------------------------------------------------
678 bool bIn = false;
679 bool bOut = false;
680
681 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
682 {
683 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
684 {
685 if( Contains(pShape->Get_Point(iPoint, iPart)) )
686 {
687 bIn = true;
688 }
689 else
690 {
691 bOut = true;
692 }
693
694 if( bIn && bOut ) // some vertices are in, some are out
695 {
696 return( INTERSECTION_Overlaps );
697 }
698 }
699 }
700
701 //-----------------------------------------------------
702 if( pShape->Get_Type() == SHAPE_TYPE_Point || pShape->Get_Type() == SHAPE_TYPE_Points )
703 {
704 return( bIn ? INTERSECTION_Contains : INTERSECTION_None ); // there are no other options for points
705 }
706
707 //-----------------------------------------------------
708 for(int iPart=0; iPart<Get_Part_Count(); iPart++)
709 {
710 if( Get_Point_Count(iPart) < 3 )
711 {
712 continue;
713 }
714
715 TSG_Point A[2], B[2], C; A[0] = Get_Point(0, iPart, false);
716
717 for(int iPoint=0; iPoint<Get_Point_Count(iPart); iPoint++)
718 {
719 A[1] = A[0]; A[0] = Get_Point(iPoint, iPart);
720
721 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
722 {
723 //-----------------------------------------
724 if( pShape->Get_Type() == SHAPE_TYPE_Line && pShape->Get_Point_Count(jPart) >= 2 )
725 {
726 B[0] = pShape->Get_Point(0, jPart);
727
728 for(int jPoint=1; jPoint<pShape->Get_Point_Count(jPart); jPoint++)
729 {
730 B[1] = B[0]; B[0] = pShape->Get_Point(jPoint, jPart);
731
732 if( SG_Get_Crossing(C, A[0], A[1], B[0], B[1]) )
733 {
734 return( INTERSECTION_Overlaps );
735 }
736 }
737 }
738
739 //-----------------------------------------
740 if( pShape->Get_Type() == SHAPE_TYPE_Polygon && pShape->Get_Point_Count(jPart) >= 3 )
741 {
742 B[0] = pShape->Get_Point(0, jPart, false);
743
744 for(int jPoint=0; jPoint<pShape->Get_Point_Count(jPart); jPoint++)
745 {
746 B[1] = B[0]; B[0] = pShape->Get_Point(jPoint, jPart);
747
748 if( SG_Get_Crossing(C, A[0], A[1], B[0], B[1]) )
749 {
750 return( INTERSECTION_Overlaps );
751 }
752 }
753 }
754 }
755 }
756 }
757
758 //-----------------------------------------------------
759 return( bIn ? INTERSECTION_Contains : INTERSECTION_None );
760 }
761
762 //---------------------------------------------------------
763 TSG_Intersection CSG_Shape_Polygon::On_Intersects(TSG_Rect Region)
764 {
765 // called if polygon's bounding box contains or overlaps with region.
766 // now let's figure out how region intersects with polygon itself
767
768 //-----------------------------------------------------
769 for(int iPart=0; iPart<m_nParts; iPart++)
770 {
771 CSG_Shape_Part *pPart = m_pParts[iPart];
772
773 switch( pPart->Get_Extent().Intersects(Region) )
774 {
775 case INTERSECTION_None: // region and polygon part are distinct
776 break;
777
778 case INTERSECTION_Identical: // region contains polygon part
779 case INTERSECTION_Contained:
780 return( Get_Extent().Intersects(Region) );
781
782 case INTERSECTION_Contains:
783 case INTERSECTION_Overlaps: // region at least partly contained by polygon part's extent, now let's look at the polygon part itself!
784 if( pPart->Get_Count() > 2 )
785 {
786 TSG_Point *pB = pPart->m_Points + pPart->m_nPoints - 1;
787 TSG_Point *pA = pPart->m_Points, C;
788
789 for(int iPoint=0; iPoint<pPart->m_nPoints; iPoint++, pB=pA++)
790 {
791 if( SG_Get_Crossing_InRegion(C, *pA, *pB, Region) )
792 {
793 return( INTERSECTION_Overlaps );
794 }
795 }
796 }
797 break;
798 }
799 }
800
801 //-----------------------------------------------------
802 return( Contains(Region.xMin, Region.yMin) ? INTERSECTION_Contains : INTERSECTION_None );
803 }
804
805
807 // //
809
810 //---------------------------------------------------------
811 bool CSG_Shape_Polygon::is_Lake(int iPart)
812 {
813 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
814
815 if( !pPart )
816 {
817 return( false );
818 }
819
820 if( pPart->m_bLake == BOOL3_NOTSET )
821 {
822 if( pPart->m_nPoints < 1 || m_nParts <= 1 )
823 {
824 pPart->m_bLake = BOOL3_FALSE;
825 }
826 else
827 {
828 m_bUpdate_Lakes = true;
829
830 pPart->m_bLake = BOOL3_FALSE;
831
832 for(int iPoint=0; iPoint<pPart->m_nPoints; iPoint++) // find a point that is not on vertex/edge
833 {
834 TSG_Point p = pPart->Get_Point(iPoint);
835 bool bEdge = false;
836 int nContained = 0;
837
838 for(iPart=0; !bEdge && iPart<m_nParts; iPart++)
839 {
840 if( pPart != m_pParts[iPart] )
841 {
842 switch( Get_Polygon_Part(iPart)->Get_Point_Relation(p) )
843 {
844 case SG_POLYGON_POINT_Outside : break;
845 case SG_POLYGON_POINT_Interior: nContained++; break;
846 case SG_POLYGON_POINT_Vertex :
847 case SG_POLYGON_POINT_Edge : bEdge = true; break;
848 }
849 }
850 }
851
852 if( !bEdge )
853 {
854 pPart->m_bLake = nContained % 2 ? BOOL3_TRUE : BOOL3_FALSE;
855
856 break;
857 }
858 }
859 }
860 }
861
862 return( pPart->m_bLake == BOOL3_TRUE );
863 }
864
865
867 // //
869
870 //---------------------------------------------------------
871 bool CSG_Shape_Polygon::is_Clockwise(int iPart)
872 {
873 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
874
875 return( pPart && pPart->is_Clockwise() );
876 }
877
878 //---------------------------------------------------------
879 double CSG_Shape_Polygon::Get_Perimeter(int iPart)
880 {
881 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
882
883 return( pPart ? pPart->Get_Perimeter() : 0.0 );
884 }
885
886 //---------------------------------------------------------
887 double CSG_Shape_Polygon::Get_Perimeter(void)
888 {
889 double Perimeter = 0.0;
890
891 for(int iPart=0; iPart<m_nParts; iPart++)
892 {
893 Perimeter += Get_Perimeter(iPart);
894 }
895
896 return( Perimeter );
897 }
898
899 //---------------------------------------------------------
900 double CSG_Shape_Polygon::Get_Area(int iPart)
901 {
902 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
903
904 return( pPart ? pPart->Get_Area() : 0.0 );
905 }
906
907 //---------------------------------------------------------
908 double CSG_Shape_Polygon::Get_Area(void)
909 {
910 double Area = 0.0;
911
912 for(int iPart=0; iPart<m_nParts; iPart++)
913 {
914 Area += is_Lake(iPart) ? -Get_Area(iPart) : Get_Area(iPart);
915 }
916
917 return( Area );
918 }
919
920 //---------------------------------------------------------
921 TSG_Point CSG_Shape_Polygon::Get_Centroid(int iPart)
922 {
923 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
924
925 if( pPart )
926 {
927 return( pPart->Get_Centroid() );
928 }
929
930 return( CSG_Point(0.0, 0.0) );
931 }
932
933 //---------------------------------------------------------
934 TSG_Point CSG_Shape_Polygon::Get_Centroid(void)
935 {
936 if( m_nParts == 1 )
937 {
938 return( Get_Centroid(0) );
939 }
940
941 int iPart;
942 double Weights;
943 TSG_Point Centroid;
944
945 Centroid.x = 0.0;
946 Centroid.y = 0.0;
947
948 for(iPart=0, Weights=0.0; iPart<m_nParts; iPart++)
949 {
950 if( !is_Lake(iPart) )
951 {
952 TSG_Point p = Get_Centroid(iPart);
953 double w = Get_Area (iPart);
954
955 Centroid.x += w * p.x;
956 Centroid.y += w * p.y;
957
958 Weights += w;
959 }
960 }
961
962 if( Weights > 0.0 )
963 {
964 Centroid.x /= Weights;
965 Centroid.y /= Weights;
966 }
967
968 return( Centroid );
969 }
970
971
973 // //
975
976 //---------------------------------------------------------
977 TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation(const CSG_Point &p, int iPart)
978 {
979 return( Get_Point_Relation(p.x, p.y, iPart) );
980 }
981
982 //---------------------------------------------------------
983 TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation(double x, double y, int iPart)
984 {
985 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
986
987 return( pPart ? pPart->Get_Point_Relation(x, y) : SG_POLYGON_POINT_Outside );
988 }
989
990 //---------------------------------------------------------
991 TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation(const CSG_Point &p)
992 {
993 return( Get_Point_Relation(p.x, p.y) );
994 }
995
996 //---------------------------------------------------------
997 TSG_Polygon_Point_Relation CSG_Shape_Polygon::Get_Point_Relation(double x, double y)
998 {
999 if( Get_Extent().Contains(x, y) )
1000 {
1001 int nContained = 0;
1002
1003 for(int iPart=0; iPart<m_nParts; iPart++)
1004 {
1005 switch( Get_Polygon_Part(iPart)->Get_Point_Relation(x, y) )
1006 {
1007 case SG_POLYGON_POINT_Outside : break;
1008 case SG_POLYGON_POINT_Interior: nContained++; break;
1009 case SG_POLYGON_POINT_Vertex : return( SG_POLYGON_POINT_Vertex );
1010 case SG_POLYGON_POINT_Edge : return( SG_POLYGON_POINT_Edge );
1011 }
1012 }
1013
1014 if( nContained % 2 != 0 )
1015 {
1016 return( SG_POLYGON_POINT_Interior );
1017 }
1018 }
1019
1020 return( SG_POLYGON_POINT_Outside );
1021 }
1022
1023
1025 // //
1027
1028 //---------------------------------------------------------
1029 bool CSG_Shape_Polygon::is_OnEdge(const CSG_Point &p, int iPart)
1030 {
1031 return( is_OnEdge(p.x, p.y, iPart) );
1032 }
1033
1034 //---------------------------------------------------------
1035 bool CSG_Shape_Polygon::is_OnEdge(double x, double y, int iPart)
1036 {
1037 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
1038
1039 return( pPart && pPart->is_OnEdge(x, y) );
1040 }
1041
1042 //---------------------------------------------------------
1043 bool CSG_Shape_Polygon::is_OnEdge(const CSG_Point &p)
1044 {
1045 return( is_OnEdge(p.x, p.y) );
1046 }
1047
1048 //---------------------------------------------------------
1049 bool CSG_Shape_Polygon::is_OnEdge(double x, double y)
1050 {
1051 if( Get_Extent().Contains(x, y) )
1052 {
1053 for(int iPart=0; iPart<m_nParts; iPart++)
1054 {
1055 if( Get_Polygon_Part(iPart)->is_OnEdge(x, y) )
1056 {
1057 return( true );
1058 }
1059 }
1060 }
1061
1062 return( false );
1063 }
1064
1065
1067 // //
1069
1070 //---------------------------------------------------------
1071 bool CSG_Shape_Polygon::Contains(const CSG_Point &p, int iPart)
1072 {
1073 return( Contains(p.x, p.y, iPart) );
1074 }
1075
1076 //---------------------------------------------------------
1077 bool CSG_Shape_Polygon::Contains(double x, double y, int iPart)
1078 {
1079 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
1080
1081 return( pPart && pPart->Contains(x, y) );
1082 }
1083
1084 //---------------------------------------------------------
1085 bool CSG_Shape_Polygon::Contains(const CSG_Point &p)
1086 {
1087 return( Contains(p.x, p.y) );
1088 }
1089
1090 //---------------------------------------------------------
1091 bool CSG_Shape_Polygon::Contains(double x, double y)
1092 {
1093 if( Get_Extent().Contains(x, y) )
1094 {
1095 int nContained = 0;
1096
1097 for(int iPart=0; iPart<m_nParts; iPart++)
1098 {
1099 if( Get_Polygon_Part(iPart)->Contains(x, y) )
1100 {
1101 nContained++;
1102 }
1103 }
1104
1105 return( nContained % 2 != 0 );
1106 }
1107
1108 return( false );
1109 }
1110
1111
1113 // //
1115
1116 //---------------------------------------------------------
1125 //---------------------------------------------------------
1126 bool CSG_Shape_Polygon::is_Neighbour(CSG_Shape_Polygon *pPolygon, bool bSimpleCheck)
1127 {
1128 if( !Get_Extent().Intersects(pPolygon->Get_Extent()) )
1129 {
1130 return( false );
1131 }
1132
1133 bool bNeighbour = false;
1134
1135 //---------------------------------------------------------
1136 for(int iPoint=0; iPoint<pPolygon->Get_Point_Count(); iPoint++)
1137 {
1138 switch( Get_Point_Relation(pPolygon->Get_Point(iPoint)) )
1139 {
1140 case SG_POLYGON_POINT_Outside : break;
1141 case SG_POLYGON_POINT_Interior: return( false );
1142 case SG_POLYGON_POINT_Vertex :
1143 case SG_POLYGON_POINT_Edge : if( bSimpleCheck ) { return( true ); }
1144 bNeighbour = true;
1145 break;
1146 }
1147 }
1148
1149 //---------------------------------------------------------
1150 for(int iPoint=0; iPoint<Get_Point_Count(); iPoint++)
1151 {
1152 switch( pPolygon->Get_Point_Relation(Get_Point(iPoint)) )
1153 {
1154 case SG_POLYGON_POINT_Outside : break;
1155 case SG_POLYGON_POINT_Interior: return( false );
1156 case SG_POLYGON_POINT_Vertex :
1157 case SG_POLYGON_POINT_Edge : if( bSimpleCheck ) { return( true ); }
1158 bNeighbour = true;
1159 break;
1160 }
1161 }
1162
1163 return( bNeighbour );
1164 }
1165
1166
1168 // //
1170
1171 //---------------------------------------------------------
1182 //---------------------------------------------------------
1183 CSG_Lines CSG_Shape_Polygon::Get_Shared_Edges(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon)
1184 {
1185 CSG_Lines Edges;
1186
1187 if( Get_Extent().Intersects(pPolygon->Get_Extent()) )
1188 {
1189 for(int i=0; i<Get_Part_Count(); i++)
1190 {
1191 for(int j=0; j<pPolygon->Get_Part_Count(); j++)
1192 {
1193 Edges.Add(Get_Polygon_Part(i)->Get_Shared_Edges(pPolygon->Get_Polygon_Part(j), bVertexCheck, Epsilon));
1194 }
1195 }
1196 }
1197
1198 return( Edges );
1199 }
1200
1201 //---------------------------------------------------------
1207 //---------------------------------------------------------
1208 double CSG_Shape_Polygon::Get_Shared_Length(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon)
1209 {
1210 CSG_Lines Edges(Get_Shared_Edges(pPolygon, bVertexCheck, Epsilon));
1211
1212 return( Edges.Get_Length() );
1213 }
1214
1215
1217 // //
1219
1220 //---------------------------------------------------------
1221 double CSG_Shape_Polygon::Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
1222 {
1223 CSG_Shape_Polygon_Part *pPart = Get_Polygon_Part(iPart);
1224
1225 return( pPart ? pPart->Get_Distance(Point, Next) : -1. );
1226 }
1227
1228
1230 // //
1231 // //
1232 // //
1234
1235 //---------------------------------------------------------
CSG_Index
Definition: mat_tools.h:185
SG_POLYGON_POINT_Edge
@ SG_POLYGON_POINT_Edge
Definition: shapes.h:638
CSG_Shape_Polygon_Part::is_Clockwise
bool is_Clockwise(void)
Definition: shapes.h:650
CSG_Shape_Polygon_Part::Get_Centroid
const TSG_Point & Get_Centroid(void)
Definition: shapes.h:656
CSG_Shape_Polygon::Get_Point_Relation
TSG_Polygon_Point_Relation Get_Point_Relation(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:977
CSG_Shape_Points::m_pParts
CSG_Shape_Part ** m_pParts
Definition: shapes.h:567
CSG_Shape_Polygon_Part::is_Neighbour
bool is_Neighbour(CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck=true)
Definition: shape_polygon.cpp:357
BOOL3_NOTSET
#define BOOL3_NOTSET
Definition: shape_polygon.cpp:63
CSG_Points::Add
bool Add(double x, double y)
Definition: geo_classes.cpp:350
SG_POLYGON_POINT_Interior
@ SG_POLYGON_POINT_Interior
Definition: shapes.h:639
CSG_Shape_Polygon::m_bUpdate_Lakes
int m_bUpdate_Lakes
Definition: shapes.h:752
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Shape_Polygon_Part::Get_Distance
double Get_Distance(TSG_Point Point, TSG_Point &Next)
Definition: shape_polygon.cpp:599
SG_Get_Crossing_InRegion
bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
Definition: geo_functions.cpp:342
CSG_Shape_Polygon_Part::~CSG_Shape_Polygon_Part
virtual ~CSG_Shape_Polygon_Part(void)
Definition: shape_polygon.cpp:83
CSG_Shape_Polygon::is_Clockwise
bool is_Clockwise(int iPart)
Definition: shape_polygon.cpp:871
A
#define A
CSG_Shape_Part::Get_Point
TSG_Point Get_Point(int iPoint, bool bAscending=true) const
Definition: shapes.h:388
C
#define C
CSG_Shape_Polygon_Part
Definition: shapes.h:645
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Shape_Polygon_Part::m_Perimeter
double m_Perimeter
Definition: shapes.h:683
CSG_Shape_Polygon_Part::Get_Point_Relation
TSG_Polygon_Point_Relation Get_Point_Relation(const CSG_Point &p)
Definition: shape_polygon.cpp:151
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_Shape_Points
Definition: shapes.h:484
CSG_Shape_Polygon::Get_Shared_Edges
CSG_Lines Get_Shared_Edges(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1183
CSG_Shape_Polygon_Part::_is_OnEdge
bool _is_OnEdge(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex, double Epsilon)
Definition: shape_polygon.cpp:440
CSG_Shape_Polygon::is_OnEdge
bool is_OnEdge(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:1029
CSG_Shape_Part::_Invalidate
virtual void _Invalidate(void)
Definition: shape_part.cpp:375
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shape_Polygon::Get_Shared_Length
double Get_Shared_Length(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1208
SSG_Point
Definition: geo_tools.h:128
SG_Get_Nearest_Point_On_Line
double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch)
Definition: geo_functions.cpp:421
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
CSG_Shape_Polygon_Part::is_OnEdge
bool is_OnEdge(const CSG_Point &p)
Definition: shape_polygon.cpp:268
TSG_Polygon_Point_Relation
TSG_Polygon_Point_Relation
Definition: shapes.h:635
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape_Polygon_Part::_Add_Edge_Points
void _Add_Edge_Points(CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon)
Definition: shape_polygon.cpp:403
CSG_Shape_Polygon_Part::m_bClockwise
int m_bClockwise
Definition: shapes.h:681
SG_POLYGON_POINT_Vertex
@ SG_POLYGON_POINT_Vertex
Definition: shapes.h:637
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shape_Polygon::Contains
bool Contains(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:1071
CSG_Point
Definition: geo_tools.h:135
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SG_POLYGON_POINT_Outside
@ SG_POLYGON_POINT_Outside
Definition: shapes.h:636
CSG_Shape_Polygon_Part::_Invalidate
virtual void _Invalidate(void)
Definition: shape_polygon.cpp:92
CSG_Shape_Polygon::Get_Centroid
TSG_Point Get_Centroid(void)
Definition: shape_polygon.cpp:934
CSG_Shape_Polygon_Part::CSG_Shape_Polygon_Part
CSG_Shape_Polygon_Part(class CSG_Shape_Points *pOwner)
Definition: shape_polygon.cpp:75
CSG_Shape_Part::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: shapes.h:384
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
CSG_Shape_Polygon_Part::m_bLake
int m_bLake
Definition: shapes.h:681
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape_Polygon_Part::m_Centroid
TSG_Point m_Centroid
Definition: shapes.h:685
CSG_Shape_Part::m_nPoints
int m_nPoints
Definition: shapes.h:458
CSG_Shape_Polygon::Get_Perimeter
double Get_Perimeter(void)
Definition: shape_polygon.cpp:887
CSG_Shape_Polygon::_Invalidate
virtual void _Invalidate(void)
Definition: shape_polygon.cpp:654
CSG_Shape_Polygon::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_polygon.cpp:675
CSG_Shape_Polygon::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shape_polygon.cpp:1221
CSG_Shape_Polygon::Get_Area
double Get_Area(void)
Definition: shape_polygon.cpp:908
CSG_Shape_Polygon::Get_Polygon_Part
CSG_Shape_Polygon_Part * Get_Polygon_Part(int iPart) const
Definition: shapes.h:707
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:239
CSG_Shape_Polygon::~CSG_Shape_Polygon
virtual ~CSG_Shape_Polygon(void)
Definition: shape_polygon.cpp:645
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Shape_Polygon::CSG_Shape_Polygon
CSG_Shape_Polygon(class CSG_Shapes *pOwner, sLong Index)
Definition: shape_polygon.cpp:638
CSG_Lines::Add
CSG_Points & Add(void)
Definition: geo_classes.cpp:437
BOOL3_TRUE
#define BOOL3_TRUE
Definition: shape_polygon.cpp:65
CSG_Points
Definition: geo_tools.h:184
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
SG_Is_Point_On_Line
bool SG_Is_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch, double Epsilon)
Definition: geo_functions.cpp:394
CSG_Shape_Points::m_nParts
int m_nParts
Definition: shapes.h:561
CSG_Shape_Points::_Invalidate
virtual void _Invalidate(void)
Definition: shapes.h:574
BOOL3_FALSE
#define BOOL3_FALSE
Definition: shape_polygon.cpp:64
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
shapes.h
B
#define B
CSG_Shape_Polygon_Part::Get_Perimeter
double Get_Perimeter(void)
Definition: shapes.h:652
CSG_Shape_Polygon::is_Neighbour
bool is_Neighbour(CSG_Shape_Polygon *pPolygon, bool bSimpleCheck=true)
Definition: shape_polygon.cpp:1126
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shape_Polygon_Part::Get_Area
double Get_Area(void)
Definition: shapes.h:654
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Points::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:541
CSG_Lines::Get_Length
double Get_Length(void) const
Definition: geo_classes.cpp:508
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
CSG_Shape_Part::Get_Count
int Get_Count(void) const
Definition: shapes.h:386
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Polygon_Part::m_Area
double m_Area
Definition: shapes.h:683
CSG_Shape_Polygon::is_Lake
bool is_Lake(int iPart)
Definition: shape_polygon.cpp:811
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
CSG_Shape_Polygon_Part::_Update_Area
void _Update_Area(void)
Definition: shape_polygon.cpp:101
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Shapes
Definition: shapes.h:773
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_Lines
Definition: geo_tools.h:216
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
SG_Get_Crossing
bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
Definition: geo_functions.cpp:280
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Shape_Polygon
Definition: shapes.h:699
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
CSG_Shape_Part
Definition: shapes.h:372
CSG_Shape_Polygon_Part::Get_Shared_Edges
CSG_Lines Get_Shared_Edges(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:479
CSG_Shape_Polygon_Part::Get_Shared_Length
double Get_Shared_Length(CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:586
CSG_Shape_Polygon_Part::Contains
bool Contains(const CSG_Point &p)
Definition: shape_polygon.cpp:289
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes.cpp File Reference

  • saga_core
  • saga_api
Functions | Variables
shapes.cpp File Reference
#include "shapes.h"
#include "pointcloud.h"
#include "tool_library.h"

Go to the source code of this file.

Functions

CSG_String | SG_Get_ShapeType_Name (TSG_Shape_Type Type)
CSG_Shapes * | SG_Create_Shapes (void)
CSG_Shapes * | SG_Create_Shapes (const CSG_Shapes &Shapes)
CSG_Shapes * | SG_Create_Shapes (const char *File)
CSG_Shapes * | SG_Create_Shapes (const wchar_t *File)
CSG_Shapes * | SG_Create_Shapes (const CSG_String &File)
CSG_Shapes * | SG_Create_Shapes (TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
CSG_Shapes * | SG_Create_Shapes (CSG_Shapes *pTemplate)
bool | SG_Shapes_Set_File_Format_Default (int Format)
TSG_Shape_File_Format | SG_Shapes_Get_File_Format_Default (void)
CSG_String | SG_Shapes_Get_File_Extension_Default (void)

Variables

static TSG_Shape_File_Format gSG_Shape_File_Format_Default = SHAPE_FILE_FORMAT_ESRI

Function Documentation

◆ SG_Create_Shapes() [1/7]

CSG_Shapes* SG_Create_Shapes ( const char * File )

Safe shapes construction

Definition at line 107 of file shapes.cpp.

References SG_Create_Shapes().

◆ SG_Create_Shapes() [2/7]

CSG_Shapes* SG_Create_Shapes ( const CSG_Shapes & Shapes )

Safe shapes construction

Definition at line 91 of file shapes.cpp.

References CSG_Shapes::Get_ObjectType(), SG_Create_PointCloud(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

◆ SG_Create_Shapes() [3/7]

CSG_Shapes* SG_Create_Shapes ( const CSG_String & File )

Safe shapes construction

Definition at line 109 of file shapes.cpp.

References CSG_Shapes::is_Valid().

◆ SG_Create_Shapes() [4/7]

CSG_Shapes* SG_Create_Shapes ( const wchar_t * File )

Safe shapes construction

Definition at line 108 of file shapes.cpp.

References SG_Create_Shapes().

◆ SG_Create_Shapes() [5/7]

CSG_Shapes* SG_Create_Shapes ( CSG_Shapes * pTemplate )

Safe shapes construction

Definition at line 123 of file shapes.cpp.

References CSG_Data_Object::Get_Name(), CSG_Shapes::Get_ObjectType(), CSG_Shapes::Get_Type(), CSG_Shapes::Get_Vertex_Type(), SG_Create_PointCloud(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

◆ SG_Create_Shapes() [6/7]

CSG_Shapes* SG_Create_Shapes | ( | TSG_Shape_Type | Type,
 |  | const SG_Char * | Name = NULL,
 |  | CSG_Table * | pTemplate = NULL,
 |  | TSG_Vertex_Type | Vertex_Type = SG_VERTEX_TYPE_XY
 | ) |  |

Safe shapes construction

Definition at line 117 of file shapes.cpp.

◆ SG_Create_Shapes() [7/7]

CSG_Shapes* SG_Create_Shapes ( void )

Safe shapes construction

Definition at line 85 of file shapes.cpp.

Referenced by SG_Create_Shapes(), and SG_Create_Table().

◆ SG_Get_ShapeType_Name()

CSG_String SG_Get_ShapeType_Name ( TSG_Shape_Type Type )

Definition at line 65 of file shapes.cpp.

References _TL, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ SG_Shapes_Get_File_Extension_Default()

CSG_String SG_Shapes_Get_File_Extension_Default ( void )

Definition at line 415 of file shapes.cpp.

References gSG_Shape_File_Format_Default, SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoJSON, and SHAPE_FILE_FORMAT_GeoPackage.

◆ SG_Shapes_Get_File_Format_Default()

TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default ( void )

Definition at line 409 of file shapes.cpp.

References gSG_Shape_File_Format_Default.

◆ SG_Shapes_Set_File_Format_Default()

bool SG_Shapes_Set_File_Format_Default ( int Format )

Definition at line 394 of file shapes.cpp.

References gSG_Shape_File_Format_Default, SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoJSON, and SHAPE_FILE_FORMAT_GeoPackage.

Variable Documentation

◆ gSG_Shape_File_Format_Default

TSG_Shape_File_Format gSG_Shape_File_Format_Default = SHAPE_FILE_FORMAT_ESRI
static

Definition at line 391 of file shapes.cpp.

Referenced by CSG_Shapes::Save(), SG_Shapes_Get_File_Extension_Default(), SG_Shapes_Get_File_Format_Default(), and SG_Shapes_Set_File_Format_Default().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes.cpp Source File

  • saga_core
  • saga_api
shapes.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54 #include "pointcloud.h"
55 #include "tool_library.h"
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
66 {
67 switch( Type )
68 {
69 case SHAPE_TYPE_Point : return( _TL("Point" ) );
70 case SHAPE_TYPE_Points : return( _TL("Points" ) );
71 case SHAPE_TYPE_Line : return( _TL("Line" ) );
72 case SHAPE_TYPE_Polygon: return( _TL("Polygon" ) );
73 default : return( _TL("Undefined") );
74 }
75 }
76
77
79 // //
80 // //
81 // //
83
84 //---------------------------------------------------------
85 CSG_Shapes * SG_Create_Shapes(void)
86 {
87 return( new CSG_Shapes );
88 }
89
90 //---------------------------------------------------------
91 CSG_Shapes * SG_Create_Shapes(const CSG_Shapes &Shapes)
92 {
93 switch( Shapes.Get_ObjectType() )
94 {
95 case SG_DATAOBJECT_TYPE_Shapes:
96 return( new CSG_Shapes(Shapes) );
97
98 case SG_DATAOBJECT_TYPE_PointCloud:
99 return( SG_Create_PointCloud(*((CSG_PointCloud *)&Shapes)) );
100
101 default:
102 return( NULL );
103 }
104 }
105
106 //---------------------------------------------------------
107 CSG_Shapes * SG_Create_Shapes(const char *File) { return( SG_Create_Shapes(CSG_String(File)) ); }
108 CSG_Shapes * SG_Create_Shapes(const wchar_t *File) { return( SG_Create_Shapes(CSG_String(File)) ); }
109 CSG_Shapes * SG_Create_Shapes(const CSG_String &File)
110 {
111 CSG_Shapes *pShapes = new CSG_Shapes(File);
112
113 if( !pShapes->is_Valid() ) { delete(pShapes); return( NULL ); } return( pShapes );
114 }
115
116 //---------------------------------------------------------
117 CSG_Shapes * SG_Create_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
118 {
119 return( new CSG_Shapes(Type, Name, pTemplate, Vertex_Type) );
120 }
121
122 //---------------------------------------------------------
123 CSG_Shapes * SG_Create_Shapes(CSG_Shapes *pTemplate)
124 {
125 if( pTemplate )
126 {
127 switch( pTemplate->Get_ObjectType() )
128 {
129 case SG_DATAOBJECT_TYPE_Shapes:
130 return( new CSG_Shapes(pTemplate->Get_Type(), pTemplate->Get_Name(), pTemplate, pTemplate->Get_Vertex_Type()) );
131
132 case SG_DATAOBJECT_TYPE_PointCloud:
133 return( SG_Create_PointCloud((CSG_PointCloud *)pTemplate) );
134
135 default:
136 break;
137 }
138 }
139
140 return( new CSG_Shapes() );
141 }
142
143
145 // //
146 // //
147 // //
149
150 //---------------------------------------------------------
151 CSG_Shapes::CSG_Shapes(void)
152 : CSG_Table()
153 {
154 _On_Construction();
155 }
156
157 //---------------------------------------------------------
158 CSG_Shapes::CSG_Shapes(const CSG_Shapes &Shapes)
159 : CSG_Table()
160 {
161 _On_Construction(); Create(Shapes);
162 }
163
164 //---------------------------------------------------------
165 CSG_Shapes::CSG_Shapes(const char *File) : CSG_Shapes(CSG_String(File)) {}
166 CSG_Shapes::CSG_Shapes(const wchar_t *File) : CSG_Shapes(CSG_String(File)) {}
167 CSG_Shapes::CSG_Shapes(const CSG_String &File)
168 : CSG_Table()
169 {
170 _On_Construction(); Create(File);
171 }
172
173 //---------------------------------------------------------
174 CSG_Shapes::CSG_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
175 : CSG_Table()
176 {
177 _On_Construction(); Create(Type, Name, pTemplate, Vertex_Type);
178 }
179
180
182 // //
183 // //
184 // //
186
187 //---------------------------------------------------------
188 void CSG_Shapes::_On_Construction(void)
189 {
190 CSG_Table::_On_Construction();
191
192 m_Type = SHAPE_TYPE_Undefined;
193 m_Vertex_Type = SG_VERTEX_TYPE_XY;
194
195 m_Encoding = SG_FILE_ENCODING_UTF8;
196 }
197
198
200 // //
202
203 //---------------------------------------------------------
204 bool CSG_Shapes::Create(const CSG_Shapes &Shapes)
205 {
206 return( Assign((CSG_Data_Object *)&Shapes) );
207 }
208
209 //---------------------------------------------------------
210 bool CSG_Shapes::Create(const char *File) { return( Create(CSG_String(File)) ); }
211 bool CSG_Shapes::Create(const wchar_t *File) { return( Create(CSG_String(File)) ); }
212 bool CSG_Shapes::Create(const CSG_String &File)
213 {
214 Destroy();
215
216 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Loading"), _TL("shapes"), File.c_str()), true);
217
218 bool bResult = false;
219
220 //-----------------------------------------------------
221 if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
222 {
223 CSG_String s(File);
224
225 s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
226 s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
227 s = s.AfterFirst(':'); CSG_String DBName(s.BeforeFirst(':'));
228 s = s.AfterFirst(':'); CSG_String Table (s.BeforeFirst(':'));
229
230 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 0, true); // CGet_Connections
231
232 if( pTool != NULL )
233 {
234 SG_UI_ProgressAndMsg_Lock(true);
235
236 //---------------------------------------------
237 CSG_Table Connections; CSG_String Connection(DBName + " [" + Host + ":" + Port + "]");
238
239 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
240
241 if( SG_TOOL_PARAMETER_SET("CONNECTIONS", &Connections) && pTool->Execute() ) // CGet_Connections
242 {
243 for(int i=0; !bResult && i<Connections.Get_Count(); i++)
244 {
245 if( !Connection.Cmp(Connections[i].asString(0)) )
246 {
247 bResult = true;
248 }
249 }
250 }
251
252 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
253
254 //---------------------------------------------
255 if( bResult && (bResult = (pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 20, true)) != NULL) == true ) // CPGIS_Shapes_Load
256 {
257 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
258
259 bResult = SG_TOOL_PARAMETER_SET("CONNECTION", Connection)
260 && SG_TOOL_PARAMETER_SET("DB_TABLE" , Table )
261 && SG_TOOL_PARAMETER_SET("SHAPES" , this )
262 && pTool->Execute();
263
264 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
265 }
266
267 SG_UI_ProgressAndMsg_Lock(false);
268 }
269 }
270 else
271 {
272 if( SG_File_Cmp_Extension(File, "shp") )
273 {
274 bResult = _Load_ESRI(File);
275 }
276
277 if( !bResult )
278 {
279 bResult = _Load_GDAL(File);
280 }
281 }
282
283 //-----------------------------------------------------
284 if( bResult )
285 {
286 Set_Modified(false);
287 Set_Update_Flag();
288
289 SG_UI_Process_Set_Ready();
290 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
291
292 return( true );
293 }
294
295 //-----------------------------------------------------
296 for(sLong iShape=Get_Count()-1; iShape>=0; iShape--) // be kind, keep at least those shapes that have been loaded successfully
297 {
298 if( !Get_Shape(iShape)->is_Valid() )
299 {
300 Del_Shape(iShape);
301 }
302 }
303
304 if( Get_Count() <= 0 )
305 {
306 Destroy();
307 }
308
309 //-----------------------------------------------------
310 SG_UI_Process_Set_Ready();
311 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
312
313 return( false );
314 }
315
316 //---------------------------------------------------------
317 bool CSG_Shapes::Create(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
318 {
319 Destroy();
320
321 CSG_Table::Create(pTemplate);
322
323 if( Name )
324 {
325 Set_Name(CSG_String(Name));
326 }
327
328 m_Type = Type; m_Vertex_Type = Vertex_Type;
329
330 return( true );
331 }
332
333
335 // //
336 // //
337 // //
339
340 //---------------------------------------------------------
341 CSG_Shapes::~CSG_Shapes(void)
342 {
343 Destroy();
344 }
345
346 //---------------------------------------------------------
347 bool CSG_Shapes::Destroy(void)
348 {
349 return( CSG_Table::Destroy() );
350 }
351
352
354 // //
355 // //
356 // //
358
359 //---------------------------------------------------------
360 bool CSG_Shapes::Assign(CSG_Data_Object *pObject)
361 {
362 if( pObject && pObject->is_Valid() && (pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_Shapes || pObject->Get_ObjectType() == SG_DATAOBJECT_TYPE_PointCloud) )
363 {
364 CSG_Shapes *pShapes = (CSG_Shapes *)pObject;
365
366 Create(pShapes->Get_Type(), pShapes->Get_Name(), pShapes, pShapes->Get_Vertex_Type());
367
368 Get_History() = pShapes->Get_History();
369
370 Get_Projection().Create(pShapes->Get_Projection());
371
372 for(sLong iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Get_Okay(); iShape++)
373 {
374 Add_Shape(pShapes->Get_Shape(iShape));
375 }
376
377 return( true );
378 }
379
380 return( false );
381 }
382
383
385 // //
386 // //
387 // //
389
390 //---------------------------------------------------------
391 static TSG_Shape_File_Format gSG_Shape_File_Format_Default = SHAPE_FILE_FORMAT_ESRI;
392
393 //---------------------------------------------------------
394 bool SG_Shapes_Set_File_Format_Default (int Format)
395 {
396 switch( Format )
397 {
398 case SHAPE_FILE_FORMAT_ESRI :
399 case SHAPE_FILE_FORMAT_GeoPackage:
400 case SHAPE_FILE_FORMAT_GeoJSON :
401 gSG_Shape_File_Format_Default = (TSG_Shape_File_Format)Format;
402 return( true );
403 }
404
405 return( false );
406 }
407
408 //---------------------------------------------------------
409 TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default (void)
410 {
411 return( gSG_Shape_File_Format_Default );
412 }
413
414 //---------------------------------------------------------
415 CSG_String SG_Shapes_Get_File_Extension_Default (void)
416 {
417 switch( gSG_Shape_File_Format_Default )
418 {
419 default:
420 case SHAPE_FILE_FORMAT_ESRI : return( "shp" );
421 case SHAPE_FILE_FORMAT_GeoPackage: return( "gpkg" );
422 case SHAPE_FILE_FORMAT_GeoJSON : return( "geojson" );
423 }
424 }
425
426
428 // //
430
431 //---------------------------------------------------------
432 bool CSG_Shapes::Save(const CSG_String &File, int Format)
433 {
434 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("shapes"), File.c_str()), true);
435
436 //-----------------------------------------------------
437 if( Format == SHAPE_FILE_FORMAT_Undefined )
438 {
439 Format = gSG_Shape_File_Format_Default;
440
441 if( SG_File_Cmp_Extension(File, "shp" ) ) Format = SHAPE_FILE_FORMAT_ESRI ;
442 if( SG_File_Cmp_Extension(File, "gpkg" ) ) Format = SHAPE_FILE_FORMAT_GeoPackage;
443 if( SG_File_Cmp_Extension(File, "geojson") ) Format = SHAPE_FILE_FORMAT_GeoJSON ;
444 }
445
446 //-----------------------------------------------------
447 bool bResult = false;
448
449 switch( Format )
450 {
451 case SHAPE_FILE_FORMAT_ESRI : bResult = _Save_ESRI(File ); break;
452 case SHAPE_FILE_FORMAT_GeoPackage: bResult = _Save_GDAL(File, "GPKG" ); break;
453 case SHAPE_FILE_FORMAT_GeoJSON : bResult = _Save_GDAL(File, "GeoJSON"); break;
454 }
455
456 //-----------------------------------------------------
457 if( bResult )
458 {
459 Set_Modified(false);
460
461 Set_File_Name(File, true);
462
463 SG_UI_Process_Set_Ready();
464 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
465
466 return( true );
467 }
468
469 SG_UI_Process_Set_Ready();
470 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
471
472 return( false );
473 }
474
475
477 // //
478 // //
479 // //
481
482 //---------------------------------------------------------
483 CSG_Table_Record * CSG_Shapes::_Get_New_Record(sLong Index)
484 {
485 switch( m_Type )
486 {
487 case SHAPE_TYPE_Polygon : return( new CSG_Shape_Polygon (this, Index) );
488 case SHAPE_TYPE_Line : return( new CSG_Shape_Line (this, Index) );
489 case SHAPE_TYPE_Points : return( new CSG_Shape_Points (this, Index) );
490 case SHAPE_TYPE_Point :
491 switch( m_Vertex_Type )
492 {
493 case SG_VERTEX_TYPE_XY : return( new CSG_Shape_Point (this, Index) );
494 case SG_VERTEX_TYPE_XYZ : return( new CSG_Shape_Point_Z (this, Index) );
495 case SG_VERTEX_TYPE_XYZM: return( new CSG_Shape_Point_ZM(this, Index) );
496 default:
497 return( NULL );
498 }
499 default:
500 return( NULL );
501 }
502 }
503
504 //---------------------------------------------------------
505 CSG_Shape * CSG_Shapes::Add_Shape(CSG_Table_Record *pCopy, TSG_ADD_Shape_Copy_Mode mCopy)
506 {
507 CSG_Shape *pShape = (CSG_Shape *)Add_Record();
508
509 if( pShape && pCopy && mCopy != SHAPE_NO_COPY )
510 {
511 pShape->Assign(pCopy, mCopy);
512 }
513
514 return( pShape );
515 }
516
517 //---------------------------------------------------------
518 bool CSG_Shapes::Del_Shape(CSG_Shape *pShape)
519 {
520 return( Del_Record(pShape->Get_Index()) );
521 }
522
523 bool CSG_Shapes::Del_Shape(sLong Index)
524 {
525 return( Del_Record(Index) );
526 }
527
528
530 // //
531 // //
532 // //
534
535 //---------------------------------------------------------
536 bool CSG_Shapes::On_Update(void)
537 {
538 if( Get_Count() > 0 )
539 {
540 CSG_Shape *pShape = Get_Shape(0);
541
542 m_Extent = pShape->Get_Extent();
543 m_ZMin = pShape->Get_ZMin();
544 m_ZMax = pShape->Get_ZMax();
545 m_MMin = pShape->Get_MMin();
546 m_MMax = pShape->Get_MMax();
547
548 for(sLong i=1; i<Get_Count(); i++)
549 {
550 pShape = Get_Shape(i);
551
552 m_Extent.Union(pShape->Get_Extent());
553
554 switch( m_Vertex_Type )
555 {
556 case SG_VERTEX_TYPE_XYZM:
557 if( m_MMin > pShape->Get_MMin() ) m_MMin = pShape->Get_MMin();
558 if( m_MMax < pShape->Get_MMax() ) m_MMax = pShape->Get_MMax();
559
560 case SG_VERTEX_TYPE_XYZ:
561 if( m_ZMin > pShape->Get_ZMin() ) m_ZMin = pShape->Get_ZMin();
562 if( m_ZMax < pShape->Get_ZMax() ) m_ZMax = pShape->Get_ZMax();
563 break;
564
565 default:
566 break;
567 }
568 }
569 }
570 else
571 {
572 m_Extent.Assign(0.0, 0.0, 0.0, 0.0);
573 }
574
575 return( CSG_Table::On_Update() );
576 }
577
578
580 // //
581 // //
582 // //
584
585 //---------------------------------------------------------
586 CSG_Shape * CSG_Shapes::Get_Shape(const CSG_Point &Point, double Epsilon)
587 {
588 CSG_Rect r(Point.x - Epsilon, Point.y - Epsilon, Point.x + Epsilon, Point.y + Epsilon);
589
590 CSG_Shape *pNearest = NULL;
591
592 if( r.Intersects(Get_Extent()) != INTERSECTION_None )
593 {
594 double dNearest = -1.;
595
596 for(sLong iShape=0; iShape<Get_Count(); iShape++)
597 {
598 CSG_Shape *pShape = Get_Shape(iShape);
599
600 if( pShape->Intersects(r) )
601 {
602 double d = pShape->Get_Distance(Point);
603
604 if( d == 0. )
605 {
606 return( pShape );
607 }
608 else if( d > 0. && d <= Epsilon && (pNearest == NULL || d < dNearest) )
609 {
610 dNearest = d;
611 pNearest = pShape;
612 }
613 }
614 }
615 }
616
617 return( pNearest );
618 }
619
620
622 // //
623 // //
624 // //
626
627 //---------------------------------------------------------
628 bool CSG_Shapes::Make_Clean(void)
629 {
630 if( m_Type != SHAPE_TYPE_Polygon )
631 {
632 return( true );
633 }
634
635 for(sLong iShape=0; iShape<Get_Count() && SG_UI_Process_Set_Progress(iShape, Get_Count()); iShape++)
636 {
637 CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)Get_Shape(iShape);
638
639 for(int iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++)
640 {
641 // currently we have to disable this check for 3D shapefiles since the
642 // _Update_Area() method can not handle polygons with no horizontal extent
643 if( m_Vertex_Type == SG_VERTEX_TYPE_XY )
644 {
645 if( pPolygon->is_Lake(iPart) == pPolygon->is_Clockwise(iPart) )
646 {// ring direction: outer rings > clockwise, inner rings (lakes) > counterclockwise !
647 pPolygon->Revert_Points(iPart);
648 }
649 }
650
651 //---------------------------------------------
652 if( !CSG_Point(pPolygon->Get_Point(0, iPart)).is_Equal(pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart)) )
653 { // last point == first point !
654 ((CSG_Shape *)pPolygon)->Add_Point(pPolygon->Get_Point(0, iPart), iPart);
655
656 if( m_Vertex_Type != SG_VERTEX_TYPE_XY )
657 {
658 pPolygon->Set_Z(pPolygon->Get_Z(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
659
660 if( m_Vertex_Type == SG_VERTEX_TYPE_XYZM )
661 {
662 pPolygon->Set_M(pPolygon->Get_M(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
663 }
664 }
665 }
666
667 //--------------------------------------------
668 // to do: ensure there is no self intersection !
669 }
670 }
671
672 return( true );
673 }
674
675
677 // //
678 // //
679 // //
681
682 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Rect
Definition: geo_tools.h:471
CSG_Shapes::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: shapes.cpp:360
gSG_Shape_File_Format_Default
static TSG_Shape_File_Format gSG_Shape_File_Format_Default
Definition: shapes.cpp:391
CSG_Shape_Point_ZM
Definition: shapes.h:344
CSG_Shapes::m_ZMin
double m_ZMin
Definition: shapes.h:843
CSG_Shapes::Del_Shape
virtual bool Del_Shape(sLong Index)
Definition: shapes.cpp:523
CSG_Shapes::m_MMax
double m_MMax
Definition: shapes.h:843
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_Shapes_Get_File_Extension_Default
CSG_String SG_Shapes_Get_File_Extension_Default(void)
Definition: shapes.cpp:415
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Shape_Points::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:550
CSG_Shapes::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: shapes.cpp:483
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Shape_Polygon::is_Clockwise
bool is_Clockwise(int iPart)
Definition: shape_polygon.cpp:871
CSG_Table_Record
Definition: table.h:130
CSG_Shape_Points::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:531
CSG_Shape_Points::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:532
CSG_Shape_Point
Definition: shapes.h:265
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
SG_Create_PointCloud
CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_Shape_Points
Definition: shapes.h:484
CSG_Tool
Definition: tool.h:149
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Shapes::~CSG_Shapes
virtual ~CSG_Shapes(void)
Definition: shapes.cpp:341
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Shapes::m_ZMax
double m_ZMax
Definition: shapes.h:843
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
CSG_Shapes::_On_Construction
virtual void _On_Construction(void)
Definition: shapes.cpp:188
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Data_Object::Get_ObjectType
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.
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:454
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_Shapes::CSG_Shapes
CSG_Shapes(void)
Definition: shapes.cpp:151
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point) const =0
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Shape_Points::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:536
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_Shapes::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shapes.h:809
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Shapes::m_MMin
double m_MMin
Definition: shapes.h:843
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shape_Line
Definition: shapes.h:601
CSG_Shapes::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: shapes.cpp:432
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
CSG_Shape_Points::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:537
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:197
SG_Shapes_Set_File_Format_Default
bool SG_Shapes_Set_File_Format_Default(int Format)
Definition: shapes.cpp:394
SHAPE_FILE_FORMAT_GeoPackage
@ SHAPE_FILE_FORMAT_GeoPackage
Definition: shapes.h:117
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:196
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1292
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
pointcloud.h
SHAPE_FILE_FORMAT_Undefined
@ SHAPE_FILE_FORMAT_Undefined
Definition: shapes.h:115
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:212
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
SG_Get_ShapeType_Name
CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition: shapes.cpp:65
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Table
Definition: table.h:283
TSG_Shape_File_Format
TSG_Shape_File_Format
Definition: shapes.h:114
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_Shapes::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: shapes.h:797
SHAPE_NO_COPY
@ SHAPE_NO_COPY
Definition: shapes.h:125
SHAPE_FILE_FORMAT_GeoJSON
@ SHAPE_FILE_FORMAT_GeoJSON
Definition: shapes.h:118
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_String
Definition: api_core.h:557
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shapes::Destroy
virtual bool Destroy(void)
Definition: shapes.cpp:347
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:213
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Point_Z
Definition: shapes.h:323
SHAPE_FILE_FORMAT_ESRI
@ SHAPE_FILE_FORMAT_ESRI
Definition: shapes.h:116
SSG_Point::y
double y
Definition: geo_tools.h:129
SG_Shapes_Get_File_Format_Default
TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default(void)
Definition: shapes.cpp:409
CSG_Shapes::Make_Clean
bool Make_Clean(void)
Definition: shapes.cpp:628
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_Shape_Polygon::is_Lake
bool is_Lake(int iPart)
Definition: shape_polygon.cpp:811
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
CSG_Shapes
Definition: shapes.h:773
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_PointCloud
Definition: pointcloud.h:105
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Shapes::On_Update
virtual bool On_Update(void)
Definition: shapes.cpp:536
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_Shape
Definition: shapes.h:141
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes.h File Reference

  • saga_core
  • saga_api
Classes | Enumerations | Functions
shapes.h File Reference
#include "table.h"

Go to the source code of this file.

Classes

class | CSG_Shape
class | CSG_Shape_Point
class | CSG_Shape_Point_Z
class | CSG_Shape_Point_ZM
class | CSG_Shape_Part
class | CSG_Shape_Points
class | CSG_Shape_Line
class | CSG_Shape_Polygon_Part
class | CSG_Shape_Polygon
class | CSG_Shapes
class | CSG_PRQuadTree_Item
class | CSG_PRQuadTree_Leaf
class | CSG_PRQuadTree_Leaf_List
class | CSG_PRQuadTree_Node
class | CSG_PRQuadTree_Node_Statistics
class | CSG_PRQuadTree
class | CSG_KDTree
class | CSG_KDTree_2D
class | CSG_KDTree_3D
class | CSG_Parameters_Point_Search
class | CSG_Parameters_Point_Search_KDTree_2D
class | CSG_Shapes_OGIS_Converter
class | CSG_Grid_OGIS_Converter

Enumerations

enum | TSG_Vertex_Type { SG_VERTEX_TYPE_XY = 0, SG_VERTEX_TYPE_XYZ, SG_VERTEX_TYPE_XYZM }
enum TSG_Shape_Type {
SHAPE_TYPE_Undefined = 0, SHAPE_TYPE_Point, SHAPE_TYPE_Points, SHAPE_TYPE_Line,
SHAPE_TYPE_Polygon
}
enum | TSG_Shape_File_Format { SHAPE_FILE_FORMAT_Undefined = 0, SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoPackage, SHAPE_FILE_FORMAT_GeoJSON }
enum | TSG_ADD_Shape_Copy_Mode { SHAPE_NO_COPY = 0, SHAPE_COPY_GEOM, SHAPE_COPY_ATTR, SHAPE_COPY }
enum | TSG_Polygon_Point_Relation { SG_POLYGON_POINT_Outside, SG_POLYGON_POINT_Vertex, SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior }
enum | ESG_OGIS_ByteOrder { SG_OGIS_BYTEORDER_XDR = 0, SG_OGIS_BYTEORDER_NDR = 1 }
enum TSG_OGIS_Type_Geometry {
SG_OGIS_TYPE_Undefined = 0, SG_OGIS_TYPE_Point = 1, SG_OGIS_TYPE_LineString = 2, SG_OGIS_TYPE_Polygon = 3,
SG_OGIS_TYPE_MultiPoint = 4, SG_OGIS_TYPE_MultiLineString = 5, SG_OGIS_TYPE_MultiPolygon = 6, SG_OGIS_TYPE_GeometryCollection = 7,
SG_OGIS_TYPE_PolyhedralSurface = 15, SG_OGIS_TYPE_TIN = 16, SG_OGIS_TYPE_Triangle = 17, SG_OGIS_TYPE_PointZ = 1001,
SG_OGIS_TYPE_LineStringZ = 1002, SG_OGIS_TYPE_PolygonZ = 1003, SG_OGIS_TYPE_MultiPointZ = 1004, SG_OGIS_TYPE_MultiLineStringZ = 1005,
SG_OGIS_TYPE_MultiPolygonZ = 1006, SG_OGIS_TYPE_GeometryCollectionZ = 1007, SG_OGIS_TYPE_PolyhedralSurfaceZ = 1015, SG_OGIS_TYPE_TINZ = 1016,
SG_OGIS_TYPE_TriangleZ = 1017, SG_OGIS_TYPE_PointM = 2001, SG_OGIS_TYPE_LineStringM = 2002, SG_OGIS_TYPE_PolygonM = 2003,
SG_OGIS_TYPE_MultiPointM = 2004, SG_OGIS_TYPE_MultiLineStringM = 2005, SG_OGIS_TYPE_MultiPolygonM = 2006, SG_OGIS_TYPE_GeometryCollectionM = 2007,
SG_OGIS_TYPE_PolyhedralSurfaceM = 2015, SG_OGIS_TYPE_TINM = 2016, SG_OGIS_TYPE_TriangleM = 2017, SG_OGIS_TYPE_PointZM = 3001,
SG_OGIS_TYPE_LineStringZM = 3002, SG_OGIS_TYPE_PolygonZM = 3003, SG_OGIS_TYPE_MultiPointZM = 3004, SG_OGIS_TYPE_MultiLineStringZM = 3005,
SG_OGIS_TYPE_MultiPolygonZM = 3006, SG_OGIS_TYPE_GeometryCollectionZM = 3007, SG_OGIS_TYPE_PolyhedralSurfaceZM = 3015, SG_OGIS_TYPE_TINZM = 3016,
SG_OGIS_TYPE_TriangleZM = 3017
}

Functions

SAGA_API_DLL_EXPORT CSG_String | SG_Get_ShapeType_Name (TSG_Shape_Type Type)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (void)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (const CSG_Shapes &Shapes)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (const char *File)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (const wchar_t *File)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (const CSG_String &File)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (TSG_Shape_Type Type, const SG_Char *Name=NULL, CSG_Table *pTemplate=NULL, TSG_Vertex_Type Vertex_Type=SG_VERTEX_TYPE_XY)
SAGA_API_DLL_EXPORT CSG_Shapes * | SG_Create_Shapes (CSG_Shapes *pTemplate)
SAGA_API_DLL_EXPORT bool | SG_Shapes_Set_File_Format_Default (int Format)
SAGA_API_DLL_EXPORT TSG_Shape_File_Format | SG_Shapes_Get_File_Format_Default (void)
SAGA_API_DLL_EXPORT CSG_String | SG_Shapes_Get_File_Extension_Default (void)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_Intersection (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_Difference (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_ExclusiveOr (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_Union (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_Dissolve (CSG_Shape *pSubject, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT bool | SG_Shape_Get_Offset (CSG_Shape *pSubject, double Size, double dArc, CSG_Shape *pSolution=NULL)
SAGA_API_DLL_EXPORT const char * | SG_Clipper_Get_Version (void)

Detailed Description

The vector data container, a specialized CSG_Table class following a geometry object based approach.

See also
CSG_Shapes
CSG_Table
CSG_Data_Object

Definition in file shapes.h.

Enumeration Type Documentation

◆ ESG_OGIS_ByteOrder

enum ESG_OGIS_ByteOrder
Enumerator
SG_OGIS_BYTEORDER_XDR
SG_OGIS_BYTEORDER_NDR

Definition at line 1456 of file shapes.h.

◆ TSG_ADD_Shape_Copy_Mode

enum TSG_ADD_Shape_Copy_Mode
Enumerator
SHAPE_NO_COPY
SHAPE_COPY_GEOM
SHAPE_COPY_ATTR
SHAPE_COPY

Definition at line 123 of file shapes.h.

◆ TSG_OGIS_Type_Geometry

enum TSG_OGIS_Type_Geometry
Enumerator
SG_OGIS_TYPE_Undefined
SG_OGIS_TYPE_Point
SG_OGIS_TYPE_LineString
SG_OGIS_TYPE_Polygon
SG_OGIS_TYPE_MultiPoint
SG_OGIS_TYPE_MultiLineString
SG_OGIS_TYPE_MultiPolygon
SG_OGIS_TYPE_GeometryCollection
SG_OGIS_TYPE_PolyhedralSurface
SG_OGIS_TYPE_TIN
SG_OGIS_TYPE_Triangle
SG_OGIS_TYPE_PointZ
SG_OGIS_TYPE_LineStringZ
SG_OGIS_TYPE_PolygonZ
SG_OGIS_TYPE_MultiPointZ
SG_OGIS_TYPE_MultiLineStringZ
SG_OGIS_TYPE_MultiPolygonZ
SG_OGIS_TYPE_GeometryCollectionZ
SG_OGIS_TYPE_PolyhedralSurfaceZ
SG_OGIS_TYPE_TINZ
SG_OGIS_TYPE_TriangleZ
SG_OGIS_TYPE_PointM
SG_OGIS_TYPE_LineStringM
SG_OGIS_TYPE_PolygonM
SG_OGIS_TYPE_MultiPointM
SG_OGIS_TYPE_MultiLineStringM
SG_OGIS_TYPE_MultiPolygonM
SG_OGIS_TYPE_GeometryCollectionM
SG_OGIS_TYPE_PolyhedralSurfaceM
SG_OGIS_TYPE_TINM
SG_OGIS_TYPE_TriangleM
SG_OGIS_TYPE_PointZM
SG_OGIS_TYPE_LineStringZM
SG_OGIS_TYPE_PolygonZM
SG_OGIS_TYPE_MultiPointZM
SG_OGIS_TYPE_MultiLineStringZM
SG_OGIS_TYPE_MultiPolygonZM
SG_OGIS_TYPE_GeometryCollectionZM
SG_OGIS_TYPE_PolyhedralSurfaceZM
SG_OGIS_TYPE_TINZM
SG_OGIS_TYPE_TriangleZM

Definition at line 1463 of file shapes.h.

◆ TSG_Polygon_Point_Relation

enum TSG_Polygon_Point_Relation
Enumerator
SG_POLYGON_POINT_Outside
SG_POLYGON_POINT_Vertex
SG_POLYGON_POINT_Edge
SG_POLYGON_POINT_Interior

Definition at line 634 of file shapes.h.

◆ TSG_Shape_File_Format

enum TSG_Shape_File_Format
Enumerator
SHAPE_FILE_FORMAT_Undefined
SHAPE_FILE_FORMAT_ESRI
SHAPE_FILE_FORMAT_GeoPackage
SHAPE_FILE_FORMAT_GeoJSON

Definition at line 113 of file shapes.h.

◆ TSG_Shape_Type

enum TSG_Shape_Type
Enumerator
SHAPE_TYPE_Undefined
SHAPE_TYPE_Point
SHAPE_TYPE_Points
SHAPE_TYPE_Line
SHAPE_TYPE_Polygon

Definition at line 99 of file shapes.h.

◆ TSG_Vertex_Type

enum TSG_Vertex_Type
Enumerator
SG_VERTEX_TYPE_XY
SG_VERTEX_TYPE_XYZ
SG_VERTEX_TYPE_XYZM

Definition at line 90 of file shapes.h.

Function Documentation

◆ SG_Clipper_Get_Version()

SAGA_API_DLL_EXPORT const char* SG_Clipper_Get_Version ( void )

Definition at line 407 of file shapes_clipper.cpp.

◆ SG_Create_Shapes() [1/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( const char * File )

Safe shapes construction

Definition at line 107 of file shapes.cpp.

References SG_Create_Shapes().

◆ SG_Create_Shapes() [2/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( const CSG_Shapes & Shapes )

Safe shapes construction

Definition at line 91 of file shapes.cpp.

References CSG_Shapes::Get_ObjectType(), SG_Create_PointCloud(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

◆ SG_Create_Shapes() [3/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( const CSG_String & File )

Safe shapes construction

Definition at line 109 of file shapes.cpp.

References CSG_Shapes::is_Valid().

◆ SG_Create_Shapes() [4/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( const wchar_t * File )

Safe shapes construction

Definition at line 108 of file shapes.cpp.

References SG_Create_Shapes().

◆ SG_Create_Shapes() [5/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( CSG_Shapes * pTemplate )

Safe shapes construction

Definition at line 123 of file shapes.cpp.

References CSG_Data_Object::Get_Name(), CSG_Shapes::Get_ObjectType(), CSG_Shapes::Get_Type(), CSG_Shapes::Get_Vertex_Type(), SG_Create_PointCloud(), SG_DATAOBJECT_TYPE_PointCloud, and SG_DATAOBJECT_TYPE_Shapes.

◆ SG_Create_Shapes() [6/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes | ( | TSG_Shape_Type | Type,
 |  | const SG_Char * | Name = NULL,
 |  | CSG_Table * | pTemplate = NULL,
 |  | TSG_Vertex_Type | Vertex_Type = SG_VERTEX_TYPE_XY
 | ) |  |

Safe shapes construction

Definition at line 117 of file shapes.cpp.

◆ SG_Create_Shapes() [7/7]

SAGA_API_DLL_EXPORT CSG_Shapes* SG_Create_Shapes ( void )

Safe shapes construction

Definition at line 85 of file shapes.cpp.

Referenced by SG_Create_Shapes(), and SG_Create_Table().

◆ SG_Get_ShapeType_Name()

SAGA_API_DLL_EXPORT CSG_String SG_Get_ShapeType_Name ( TSG_Shape_Type Type )

Definition at line 65 of file shapes.cpp.

References _TL, SHAPE_TYPE_Line, SHAPE_TYPE_Point, SHAPE_TYPE_Points, and SHAPE_TYPE_Polygon.

◆ SG_Shape_Get_Difference()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference | ( | CSG_Shape * | pSubject,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution = NULL
 | ) |  |

Definition at line 313 of file shapes_clipper.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Dissolve()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_Dissolve | ( | CSG_Shape * | pShape,
 |  | CSG_Shape * | pSolution
 | ) |  |

Assuming supplied shape object is of type polygon and has several parts, it is important that the point order of outer rings (i.e. not lakes) is clockwise, that of lakes counter-clockwise to be processed correctly by the Clipper dissolve function. This is in accordance with the simple features definition but in contrast to ESRI's Shapefile format.

Definition at line 390 of file shapes_clipper.cpp.

References CSG_Shape::Get_Extent().

◆ SG_Shape_Get_ExclusiveOr()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_ExclusiveOr | ( | CSG_Shape * | pSubject,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution = NULL
 | ) |  |

Definition at line 331 of file shapes_clipper.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Add_Part(), CSG_Shape::Add_Point(), CSG_Shape::Assign(), CSG_Shape_Points::Get_Part(), CSG_Shape_Points::Get_Part_Count(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Intersection()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection | ( | CSG_Shape * | pSubject,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution = NULL
 | ) |  |

Definition at line 293 of file shapes_clipper.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Offset()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_Offset | ( | CSG_Shape * | pSubject,
 |  | double | Size,
 |  | double | dArc,
 |  | CSG_Shape * | pSolution = NULL
 | ) |  |

Definition at line 396 of file shapes_clipper.cpp.

References CSG_Shape::Get_Extent(), CSG_Shape::Get_Type(), CSG_Rect::Inflate(), and SHAPE_TYPE_Polygon.

◆ SG_Shape_Get_Union()

SAGA_API_DLL_EXPORT bool SG_Shape_Get_Union | ( | CSG_Shape * | pSubject,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution = NULL
 | ) |  |

Definition at line 355 of file shapes_clipper.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Add_Part(), CSG_Shape::Add_Point(), CSG_Shape::Assign(), CSG_Shape_Points::Get_Part(), CSG_Shape_Points::Get_Part_Count(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shapes_Get_File_Extension_Default()

SAGA_API_DLL_EXPORT CSG_String SG_Shapes_Get_File_Extension_Default ( void )

Definition at line 415 of file shapes.cpp.

References gSG_Shape_File_Format_Default, SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoJSON, and SHAPE_FILE_FORMAT_GeoPackage.

◆ SG_Shapes_Get_File_Format_Default()

SAGA_API_DLL_EXPORT TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default ( void )

Definition at line 409 of file shapes.cpp.

References gSG_Shape_File_Format_Default.

◆ SG_Shapes_Set_File_Format_Default()

SAGA_API_DLL_EXPORT bool SG_Shapes_Set_File_Format_Default ( int Format )

Definition at line 394 of file shapes.cpp.

References gSG_Shape_File_Format_Default, SHAPE_FILE_FORMAT_ESRI, SHAPE_FILE_FORMAT_GeoJSON, and SHAPE_FILE_FORMAT_GeoPackage.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes.h Source File

  • saga_core
  • saga_api
shapes.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__shapes_H
54 #define HEADER_INCLUDED__SAGA_API__shapes_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
73 // //
75 // //
76 // //
78
79 //---------------------------------------------------------
80 #include "table.h"
81
82
84 // //
85 // //
86 // //
88
89 //---------------------------------------------------------
90 typedef enum
91 {
92 SG_VERTEX_TYPE_XY = 0,
93 SG_VERTEX_TYPE_XYZ,
94 SG_VERTEX_TYPE_XYZM
95 }
96 TSG_Vertex_Type;
97
98 //---------------------------------------------------------
99 typedef enum
100 {
101 SHAPE_TYPE_Undefined = 0,
102 SHAPE_TYPE_Point,
103 SHAPE_TYPE_Points,
104 SHAPE_TYPE_Line,
105 SHAPE_TYPE_Polygon
106 }
107 TSG_Shape_Type;
108
109 //---------------------------------------------------------
110 SAGA_API_DLL_EXPORT CSG_String SG_Get_ShapeType_Name (TSG_Shape_Type Type);
111
112 //---------------------------------------------------------
113 typedef enum
114 {
115 SHAPE_FILE_FORMAT_Undefined = 0,
116 SHAPE_FILE_FORMAT_ESRI,
117 SHAPE_FILE_FORMAT_GeoPackage,
118 SHAPE_FILE_FORMAT_GeoJSON
119 }
120 TSG_Shape_File_Format;
121
122 //---------------------------------------------------------
123 typedef enum
124 {
125 SHAPE_NO_COPY = 0,
126 SHAPE_COPY_GEOM,
127 SHAPE_COPY_ATTR,
128 SHAPE_COPY
129 }
130 TSG_ADD_Shape_Copy_Mode;
131
132
134 // //
135 // //
136 // //
138
139 //---------------------------------------------------------
140 class SAGA_API_DLL_EXPORT CSG_Shape : public CSG_Table_Record
141 {
142 friend class CSG_Shapes;
143
144 public:
145
146 //-----------------------------------------------------
147 virtual void Destroy (void);
148
149 virtual bool Assign (CSG_Table_Record *pRecord);
150 virtual bool Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes);
151 virtual bool Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy);
152
153 virtual bool is_Valid (void) const = 0;
154
155 TSG_Shape_Type Get_Type (void) const;
156 TSG_Vertex_Type Get_Vertex_Type (void) const;
157
158 class CSG_Shape_Point * asPoint (void) const { return( Get_Type() == SHAPE_TYPE_Point ? (CSG_Shape_Point *)this : NULL ); }
159 class CSG_Shape_Points * asPoints (void) const { return( Get_Type() == SHAPE_TYPE_Points ? (CSG_Shape_Points *)this : NULL ); }
160 class CSG_Shape_Line * asLine (void) const { return( Get_Type() == SHAPE_TYPE_Line ? (CSG_Shape_Line *)this : NULL ); }
161 class CSG_Shape_Polygon * asPolygon (void) const { return( Get_Type() == SHAPE_TYPE_Polygon ? (CSG_Shape_Polygon *)this : NULL ); }
162
163 //-----------------------------------------------------
164 virtual int Get_Point_Count (void) const = 0;
165 virtual int Get_Point_Count (int iPart) const = 0;
166 virtual int Get_Part_Count (void) const = 0;
167
168 virtual int Add_Part (class CSG_Shape_Part *pPart, bool bRevert = false) { return( -1 ); }
169 virtual CSG_Shape_Part * Get_Part (int iPart) const { return( NULL ); }
170 virtual int Del_Part (int iPart) { return( -1 ); }
171 virtual int Del_Parts (void) { return( -1 ); }
172
173 virtual int Add_Point (double x, double y, int iPart = 0) = 0;
174 virtual int Add_Point (const CSG_Point &p, int iPart = 0) = 0;
175 virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) = 0;
176 virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) = 0;
177
178 virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0) = 0;
179 virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) = 0;
180 virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0) = 0;
181 virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0) = 0;
182
183 virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0) = 0;
184 virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) = 0;
185 virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0) = 0;
186 virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0) = 0;
187
188 virtual int Del_Point ( int iPoint , int iPart = 0) = 0;
189
190 virtual TSG_Point Get_Point (int iPoint = 0) const = 0;
191 virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const = 0;
192
193 //-----------------------------------------------------
194 virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { }
195 virtual double Get_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( 0. ); }
196 virtual double Get_ZMin (void) { return( 0. ); }
197 virtual double Get_ZMax (void) { return( 0. ); }
198 virtual TSG_Point_3D Get_Point_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const
199 {
200 TSG_Point_3D Point; TSG_Point p = Get_Point(iPoint, iPart, bAscending);
201
202 Point.x = p.x;
203 Point.y = p.y;
204 Point.z = Get_Z(iPoint, iPart, bAscending);
205
206 return( Point );
207 }
208
209 //-----------------------------------------------------
210 virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { }
211 virtual double Get_M (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( 0. ); }
212 virtual double Get_MMin (void) { return( 0. ); }
213 virtual double Get_MMax (void) { return( 0. ); }
214 virtual TSG_Point_4D Get_Point_ZM (int iPoint = 0, int iPart = 0, bool bAscending = true) const
215 {
216 TSG_Point_4D Point; TSG_Point p = Get_Point(iPoint, iPart, bAscending);
217
218 Point.x = p.x;
219 Point.y = p.y;
220 Point.z = Get_Z(iPoint, iPart, bAscending);
221 Point.m = Get_M(iPoint, iPart, bAscending);
222
223 return( Point );
224 }
225
226 //-----------------------------------------------------
227 virtual const CSG_Rect & Get_Extent (void) = 0;
228 virtual const CSG_Rect & Get_Extent (int iPart) { return( Get_Extent() ); }
229
230 virtual TSG_Point Get_Centroid (void) = 0;
231
232 TSG_Intersection Intersects (CSG_Shape *pShape);
233 TSG_Intersection Intersects (const TSG_Rect &Extent);
234
235 virtual double Get_Distance (TSG_Point Point ) const = 0;
236 virtual double Get_Distance (TSG_Point Point , int iPart) const = 0;
237 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const = 0;
238 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const = 0;
239
240 virtual bool Revert_Points (int iPart) { return( true ); }
241
242
243 protected:
244
245 CSG_Shape(class CSG_Shapes *pOwner, sLong Index);
246 virtual ~CSG_Shape(void);
247
248 virtual bool On_Assign (CSG_Shape *pShape) = 0;
249 virtual TSG_Intersection On_Intersects (CSG_Shape *pShape) = 0;
250 virtual TSG_Intersection On_Intersects (TSG_Rect Extent) = 0;
251
252 virtual void _Invalidate (void);
253
254 };
255
256
258 // //
259 // Point //
260 // //
262
263 //---------------------------------------------------------
264 class SAGA_API_DLL_EXPORT CSG_Shape_Point : public CSG_Shape
265 {
266 friend class CSG_Shapes;
267
268 public:
269
270 virtual bool is_Valid (void) const { return( true ); }
271
272 virtual int Get_Point_Count (void) const { return( 1 ); }
273 virtual int Get_Point_Count (int iPart) const { return( 1 ); }
274 virtual int Get_Part_Count (void) const { return( 1 ); }
275
276 virtual int Add_Point (double x, double y, int iPart = 0) { return( Set_Point(x, y, 0) ); }
277 virtual int Add_Point (const CSG_Point &p, int iPart = 0) { return( Set_Point(p , 0) ); }
278 virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) { return( Set_Point(p , 0) ); }
279 virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) { return( Set_Point(p , 0) ); }
280
281 virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0) { return( Set_Point(x, y, 0) ); }
282 virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
283 virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
284 virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
285
286 virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0) { m_Point.x = x; m_Point.y = y; _Invalidate(); return( 1 ); }
287 virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; _Invalidate(); return( 1 ); }
288 virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; Set_Z(p.z, 0); _Invalidate(); return( 1 ); }
289 virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; Set_Z(p.z, 0); Set_M(p.m, 0); _Invalidate(); return( 1 ); }
290
291 virtual int Del_Point ( int iPoint , int iPart = 0) { return( -1 ); }
292
293 virtual TSG_Point Get_Point (int iPoint = 0) const { return( m_Point ); }
294 virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const { return( m_Point ); }
295
296 virtual TSG_Point Get_Centroid (void) { return( m_Point ); }
297
298 virtual const CSG_Rect & Get_Extent (void);
299
300 virtual double Get_Distance (TSG_Point Point ) const { return( SG_Get_Distance(Point, m_Point) ); }
301 virtual double Get_Distance (TSG_Point Point , int iPart) const { return( SG_Get_Distance(Point, m_Point) ); }
302 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const { Next = m_Point; return( SG_Get_Distance(Point, m_Point) ); }
303 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const { Next = m_Point; return( SG_Get_Distance(Point, m_Point) ); }
304
305
306 protected:
307
308 CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index);
309 virtual ~CSG_Shape_Point(void);
310
311
312 TSG_Point m_Point;
313
314
315 virtual bool On_Assign (CSG_Shape *pShape);
316 virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
317 virtual TSG_Intersection On_Intersects (TSG_Rect Region);
318
319 };
320
321 //---------------------------------------------------------
322 class SAGA_API_DLL_EXPORT CSG_Shape_Point_Z : public CSG_Shape_Point
323 {
324 friend class CSG_Shapes;
325
326 public:
327
328 CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index) : CSG_Shape_Point(pOwner, Index) { m_Z = 0.; }
329
330 virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { m_Z = z; _Invalidate(); }
331 virtual double Get_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( m_Z ); }
332 virtual double Get_ZMin (void) { return( m_Z ); }
333 virtual double Get_ZMax (void) { return( m_Z ); }
334
335
336 private:
337
338 double m_Z;
339
340 };
341
342 //---------------------------------------------------------
343 class SAGA_API_DLL_EXPORT CSG_Shape_Point_ZM : public CSG_Shape_Point_Z
344 {
345 friend class CSG_Shapes;
346
347 public:
348
349 CSG_Shape_Point_ZM(class CSG_Shapes *pOwner, sLong Index) : CSG_Shape_Point_Z(pOwner, Index) { m_M = 0.; }
350
351 virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { m_M = m; _Invalidate(); }
352 virtual double Get_M (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( m_M ); }
353 virtual double Get_MMin (void) { return( m_M ); }
354 virtual double Get_MMax (void) { return( m_M ); }
355
356
357 private:
358
359 double m_M;
360
361 };
362
363
365 // //
366 // Points //
367 // //
369
370 //---------------------------------------------------------
371 class SAGA_API_DLL_EXPORT CSG_Shape_Part
372 {
373 friend class CSG_Shape_Points;
374 friend class CSG_Shape_Line;
375 friend class CSG_Shape_Polygon;
376
377 public:
378
379 class CSG_Shape_Points * Get_Owner (void) { return( m_pOwner ); }
380
381 virtual bool Destroy (void);
382 virtual bool Assign (CSG_Shape_Part *pPart);
383
384 const CSG_Rect & Get_Extent (void) { _Update_Extent(); return( m_Extent ); }
385
386 int Get_Count (void) const { return( m_nPoints ); }
387
388 TSG_Point Get_Point (int iPoint, bool bAscending = true) const
389 {
390 if( iPoint >= 0 && iPoint < m_nPoints )
391 {
392 return( m_Points[bAscending ? iPoint : m_nPoints - 1 - iPoint] );
393 }
394
395 return( (TSG_Point)CSG_Point(0., 0.) );
396 }
397
398
399 int Add_Point (double x, double y ) { return( Ins_Point(x, y, m_nPoints) ); }
400 int Add_Point (const CSG_Point &p) { return( Ins_Point(p , m_nPoints) ); }
401 int Add_Point (const CSG_Point_3D &p) { return( Ins_Point(p , m_nPoints) ); }
402 int Add_Point (const CSG_Point_4D &p) { return( Ins_Point(p , m_nPoints) ); }
403
404 int Ins_Point (double x, double y , int iPoint);
405 int Ins_Point (const CSG_Point &p, int iPoint) { return( Ins_Point(p.x, p.y, iPoint) ); }
406 int Ins_Point (const CSG_Point_3D &p, int iPoint);
407 int Ins_Point (const CSG_Point_4D &p, int iPoint);
408
409 int Set_Point (double x, double y , int iPoint);
410 int Set_Point (const CSG_Point &p, int iPoint) { return( Set_Point(p.x, p.y, iPoint) ); }
411 int Set_Point (const CSG_Point_3D &p, int iPoint);
412 int Set_Point (const CSG_Point_4D &p, int iPoint);
413
414 int Del_Point ( int iPoint);
415
416 void Set_Z (double z, int iPoint) { if ( m_Z && iPoint >= 0 && iPoint < m_nPoints ) { m_Z[iPoint] = z; _Invalidate(); } }
417 double Get_Z (int iPoint, bool bAscending = true) const { return( m_Z && iPoint >= 0 && iPoint < m_nPoints ? m_Z[bAscending ? iPoint : m_nPoints - 1 - iPoint] : 0. ); }
418 double Get_ZMin (void) { _Update_Extent(); return( m_ZMin ); }
419 double Get_ZMax (void) { _Update_Extent(); return( m_ZMax ); }
420 TSG_Point_3D Get_Point_Z (int iPoint, bool bAscending = true) const
421 {
422 TSG_Point_3D Point; TSG_Point p = Get_Point(iPoint, bAscending);
423
424 Point.x = p.x;
425 Point.y = p.y;
426 Point.z = Get_Z(iPoint, bAscending);
427
428 return( Point );
429 }
430
431 void Set_M (double m, int iPoint) { if ( m_M && iPoint >= 0 && iPoint < m_nPoints ) { m_M[iPoint] = m; _Invalidate(); } }
432 double Get_M (int iPoint, bool bAscending = true) const { return( m_M && iPoint >= 0 && iPoint < m_nPoints ? m_M[bAscending ? iPoint : m_nPoints - 1 - iPoint] : 0. ); }
433 double Get_MMin (void) { _Update_Extent(); return( m_MMin ); }
434 double Get_MMax (void) { _Update_Extent(); return( m_MMax ); }
435 TSG_Point_4D Get_Point_ZM (int iPoint, bool bAscending = true) const
436 {
437 TSG_Point_4D Point; TSG_Point p = Get_Point(iPoint, bAscending);
438
439 Point.x = p.x;
440 Point.y = p.y;
441 Point.z = Get_Z(iPoint, bAscending);
442 Point.m = Get_M(iPoint, bAscending);
443
444 return( Point );
445 }
446
447 bool Revert_Points (void);
448
449
450 protected:
451
452 CSG_Shape_Part(class CSG_Shape_Points *pOwner);
453 virtual ~CSG_Shape_Part(void);
454
455
456 bool m_bUpdate;
457
458 int m_nPoints, m_nBuffer;
459
460 double *m_Z, m_ZMin, m_ZMax, *m_M, m_MMin, m_MMax;
461
462 TSG_Point *m_Points;
463
464 CSG_Rect m_Extent;
465
466 class CSG_Shape_Points *m_pOwner;
467
468
469 virtual bool _Alloc_Memory (int nPoints);
470 virtual void _Invalidate (void);
471 virtual void _Update_Extent (void);
472
473 };
474
475
477 // //
478 // Points //
479 // //
481
482 //---------------------------------------------------------
483 class SAGA_API_DLL_EXPORT CSG_Shape_Points : public CSG_Shape
484 {
485 friend class CSG_Shapes;
486 friend class CSG_Shape_Part;
487
488 public:
489
490 virtual void Destroy (void);
491
492 virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 0 ); }
493
494 virtual int Get_Point_Count (void) const { return( m_nPoints ); }
495 virtual int Get_Point_Count (int iPart) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_Count() : 0 ); }
496 virtual int Get_Part_Count (void) const { return( m_nParts ); }
497
498 virtual int Add_Part (class CSG_Shape_Part *pPart, bool bRevert = false);
499 virtual CSG_Shape_Part * Get_Part (int iPart) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart] : NULL ); }
500 virtual int Del_Part (int iPart);
501 virtual int Del_Parts (void);
502
503 virtual int Add_Point (double x, double y, int iPart = 0) { return( Ins_Point(x, y, Get_Point_Count(iPart), iPart) ); }
504 virtual int Add_Point (const CSG_Point &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
505 virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
506 virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
507
508 virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0);
509 virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) { return( Ins_Point(p.x, p.y, iPoint, iPart) ); }
510 virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0);
511 virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0);
512
513 virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0);
514 virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) { return( Set_Point(p.x, p.y, iPoint, iPart) ); }
515 virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0);
516 virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0);
517
518 virtual int Del_Point ( int iPoint , int iPart = 0);
519
520 virtual TSG_Point Get_Point (int iPoint = 0) const;
521 virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const
522 {
523 if( iPart >= 0 && iPart < m_nParts )
524 {
525 return( m_pParts[iPart]->Get_Point(iPoint, bAscending) );
526 }
527
528 return( (TSG_Point)CSG_Point(0., 0.) );
529 }
530
531 virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { if ( iPart >= 0 && iPart < m_nParts ) m_pParts[iPart]->Set_Z(z, iPoint); }
532 virtual double Get_Z ( int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_Z( iPoint, bAscending) : 0. ); }
533 virtual double Get_ZMin (void) { _Update_Extent(); return( m_ZMin ); }
534 virtual double Get_ZMax (void) { _Update_Extent(); return( m_ZMax ); }
535
536 virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { if ( iPart >= 0 && iPart < m_nParts ) m_pParts[iPart]->Set_M(m, iPoint); }
537 virtual double Get_M ( int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_M( iPoint, bAscending) : 0. ); }
538 virtual double Get_MMin (void) { _Update_Extent(); return( m_MMin ); }
539 virtual double Get_MMax (void) { _Update_Extent(); return( m_MMax ); }
540
541 virtual const CSG_Rect & Get_Extent (void) { _Update_Extent(); return( m_Extent ); }
542
543 virtual TSG_Point Get_Centroid (void);
544
545 virtual double Get_Distance (TSG_Point Point ) const;
546 virtual double Get_Distance (TSG_Point Point , int iPart) const;
547 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const;
548 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
549
550 virtual bool Revert_Points (int iPart) { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Revert_Points() : false ); }
551
552
553 protected:
554
555 CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index);
556 virtual ~CSG_Shape_Points(void);
557
558
559 bool m_bUpdate;
560
561 int m_nParts, m_nPoints;
562
563 double m_ZMin, m_ZMax, m_MMin, m_MMax;
564
565 CSG_Rect m_Extent;
566
567 CSG_Shape_Part **m_pParts;
568
569
570 int _Add_Part (void);
571
572 virtual CSG_Shape_Part * _Get_Part (void) { return( new CSG_Shape_Part(this) ); }
573
574 virtual void _Invalidate (void)
575 {
576 if( !m_bUpdate )
577 {
578 m_bUpdate = true;
579
580 CSG_Shape::_Invalidate();
581 }
582 }
583
584 void _Update_Extent (void);
585
586 virtual bool On_Assign (CSG_Shape *pShape);
587 virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
588 virtual TSG_Intersection On_Intersects (TSG_Rect Region);
589
590 };
591
592
594 // //
595 // Line //
596 // //
598
599 //---------------------------------------------------------
600 class SAGA_API_DLL_EXPORT CSG_Shape_Line : public CSG_Shape_Points
601 {
602 friend class CSG_Shapes;
603
604 public:
605
606 virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 1 ); }
607
608 virtual TSG_Point Get_Centroid (void);
609
610 double Get_Length (void);
611 double Get_Length (int iPart);
612
613 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
614
615
616 protected:
617
618 CSG_Shape_Line(class CSG_Shapes *pOwner, sLong Index);
619 virtual ~CSG_Shape_Line(void);
620
621 virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
622 virtual TSG_Intersection On_Intersects (TSG_Rect Region);
623
624 };
625
626
628 // //
629 // Polygon //
630 // //
632
633 //---------------------------------------------------------
634 typedef enum
635 {
636 SG_POLYGON_POINT_Outside,
637 SG_POLYGON_POINT_Vertex,
638 SG_POLYGON_POINT_Edge,
639 SG_POLYGON_POINT_Interior
640 }
641 TSG_Polygon_Point_Relation;
642
643 //---------------------------------------------------------
644 class SAGA_API_DLL_EXPORT CSG_Shape_Polygon_Part : public CSG_Shape_Part
645 {
646 friend class CSG_Shape_Polygon;
647
648 public:
649
650 bool is_Clockwise (void) { _Update_Area(); return( m_bClockwise == 1 ); }
651
652 double Get_Perimeter (void) { _Update_Area(); return( m_Perimeter ); }
653
654 double Get_Area (void) { _Update_Area(); return( m_Area ); }
655
656 const TSG_Point & Get_Centroid (void) { _Update_Area(); return( m_Centroid ); }
657
658 TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p);
659 TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y);
660
661 bool is_OnEdge (const CSG_Point &p);
662 bool is_OnEdge (double x, double y);
663
664 bool Contains (const CSG_Point &p);
665 bool Contains (double x, double y);
666
667 bool is_Neighbour (CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck = true);
668
669 CSG_Lines Get_Shared_Edges (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon = 0.);
670 double Get_Shared_Length (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon = 0.);
671
672 double Get_Distance (TSG_Point Point, TSG_Point &Next);
673
674
675 protected:
676
677 CSG_Shape_Polygon_Part(class CSG_Shape_Points *pOwner);
678 virtual ~CSG_Shape_Polygon_Part(void);
679
680
681 int m_bClockwise, m_bLake;
682
683 double m_Area, m_Perimeter;
684
685 TSG_Point m_Centroid;
686
687
688 virtual void _Invalidate (void);
689
690 void _Update_Area (void);
691
692 void _Add_Edge_Points (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon);
693 bool _is_OnEdge (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex , double Epsilon);
694
695 };
696
697 //---------------------------------------------------------
698 class SAGA_API_DLL_EXPORT CSG_Shape_Polygon : public CSG_Shape_Points
699 {
700 friend class CSG_Shapes;
701
702 public:
703
704 virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 2 ); }
705
706
707 CSG_Shape_Polygon_Part * Get_Polygon_Part (int iPart) const { return( (CSG_Shape_Polygon_Part *)Get_Part(iPart) ); }
708
709 bool is_Lake (int iPart);
710
711 bool is_Clockwise (int iPart);
712
713 double Get_Perimeter (int iPart);
714 double Get_Perimeter (void);
715
716 double Get_Area (int iPart);
717 double Get_Area (void);
718
719 TSG_Point Get_Centroid (int iPart);
720 TSG_Point Get_Centroid (void);
721
722 TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p, int iPart);
723 TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y, int iPart);
724 TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p);
725 TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y);
726
727
728 bool is_OnEdge (const CSG_Point &p, int iPart);
729 bool is_OnEdge (double x, double y, int iPart);
730 bool is_OnEdge (const CSG_Point &p);
731 bool is_OnEdge (double x, double y);
732
733 bool Contains (const CSG_Point &p, int iPart);
734 bool Contains (double x, double y, int iPart);
735 bool Contains (const CSG_Point &p);
736 bool Contains (double x, double y);
737
738 bool is_Neighbour (CSG_Shape_Polygon *pPolygon, bool bSimpleCheck = true);
739
740 CSG_Lines Get_Shared_Edges (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon = 0.);
741 double Get_Shared_Length (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon = 0.);
742
743 virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
744
745
746 protected:
747
748 CSG_Shape_Polygon(class CSG_Shapes *pOwner, sLong Index);
749 virtual ~CSG_Shape_Polygon(void);
750
751
752 int m_bUpdate_Lakes;
753
754
755 virtual CSG_Shape_Part * _Get_Part (void) { return( new CSG_Shape_Polygon_Part(this) ); }
756
757 virtual void _Invalidate (void);
758
759 virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
760 virtual TSG_Intersection On_Intersects (TSG_Rect Region);
761
762 };
763
764
766 // //
767 // Shapes //
768 // //
770
771 //---------------------------------------------------------
772 class SAGA_API_DLL_EXPORT CSG_Shapes : public CSG_Table
773 {
774 friend class CSG_Shape;
775
776 public:
777
778 CSG_Shapes(void);
779
780 CSG_Shapes (const CSG_Shapes &Shapes);
781 bool Create (const CSG_Shapes &Shapes);
782
783 CSG_Shapes (const char *File);
784 bool Create (const char *File);
785 CSG_Shapes (const wchar_t *File);
786 bool Create (const wchar_t *File);
787 CSG_Shapes (const CSG_String &File);
788 bool Create (const CSG_String &File);
789
790 CSG_Shapes (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
791 bool Create (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
792
793 virtual ~CSG_Shapes(void);
794
795 virtual bool Destroy (void);
796
797 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_Shapes ); }
798
799 virtual bool Assign (CSG_Data_Object *pObject);
800
801 virtual bool Save (const CSG_String &File, int Format = 0);
802 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
803 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
804
805 virtual bool is_Valid (void) const { return( m_Type != SHAPE_TYPE_Undefined && Get_Count() >= 0 ); }
806
807 virtual TSG_Shape_Type Get_Type (void) const { return( m_Type ); }
808
809 TSG_Vertex_Type Get_Vertex_Type (void) const { return( m_Vertex_Type ); }
810
811 virtual const CSG_Rect & Get_Extent (void) { Update(); return( m_Extent ); }
812
813 double Get_ZMin (void) { Update(); return( m_ZMin ); }
814 double Get_ZMax (void) { Update(); return( m_ZMax ); }
815 double Get_MMin (void) { Update(); return( m_MMin ); }
816 double Get_MMax (void) { Update(); return( m_MMax ); }
817
818 //-----------------------------------------------------
819 virtual CSG_Shape * Add_Shape (CSG_Table_Record *pCopy = NULL, TSG_ADD_Shape_Copy_Mode mCopy = SHAPE_COPY);
820 virtual bool Del_Shape (sLong Index);
821 virtual bool Del_Shape (CSG_Shape *pShape);
822 virtual bool Del_Shapes (void) { return( Del_Records() ); }
823
824 virtual CSG_Shape * Get_Shape (const CSG_Point &Point, double Epsilon = 0.);
825 virtual CSG_Shape * Get_Shape (sLong Index) const { return( (CSG_Shape *)Get_Record (Index) ); }
826 virtual CSG_Shape * Get_Shape_byIndex (sLong Index) const { return( (CSG_Shape *)Get_Record_byIndex(Index) ); }
827
828 //-----------------------------------------------------
829 bool Make_Clean (void);
830
831 //-----------------------------------------------------
832 virtual const CSG_Rect & Get_Selection_Extent (void);
833 virtual CSG_Shape * Get_Selection (sLong Index = 0) { return( (CSG_Shape *)CSG_Table::Get_Selection(Index) ); };
834
835 virtual bool Select (sLong Index , bool bInvert = false);
836 virtual bool Select (CSG_Table_Record *pShape = NULL, bool bInvert = false);
837 virtual bool Select (const TSG_Rect &Extent , bool bInvert = false);
838 virtual bool Select (const TSG_Point &Point , bool bInvert = false);
839
840
841 protected:
842
843 double m_ZMin, m_ZMax, m_MMin, m_MMax;
844
845 TSG_Shape_Type m_Type;
846
847 TSG_Vertex_Type m_Vertex_Type;
848
849 CSG_Rect m_Extent_Selected;
850
851
852 virtual bool On_Update (void);
853 virtual bool On_Reload (void);
854 virtual bool On_Delete (void);
855
856 virtual void _On_Construction (void);
857
858 virtual CSG_Table_Record * _Get_New_Record (sLong Index);
859
860
861 private:
862
863 bool _Load_GDAL (const CSG_String &File);
864 bool _Save_GDAL (const CSG_String &File, const CSG_String &Driver);
865
866 bool _Load_ESRI (const CSG_String &File);
867 bool _Save_ESRI (const CSG_String &File);
868
869 };
870
871
873 // //
874 // //
875 // //
877
878 //---------------------------------------------------------
880 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (void);
881
883 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const CSG_Shapes &Shapes);
884
886 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const char *File);
888 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const wchar_t *File);
890 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const CSG_String &File);
891
893 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
894
896 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (CSG_Shapes *pTemplate);
897
898
899 //---------------------------------------------------------
900 SAGA_API_DLL_EXPORT bool SG_Shapes_Set_File_Format_Default (int Format);
901 SAGA_API_DLL_EXPORT TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default (void);
902 SAGA_API_DLL_EXPORT CSG_String SG_Shapes_Get_File_Extension_Default (void);
903
904
906 // //
907 // Point Region QuadTree //
908 // //
910
911 //---------------------------------------------------------
912 class SAGA_API_DLL_EXPORT CSG_PRQuadTree_Item
913 {
914 public:
915
916 virtual bool is_Leaf (void) const { return( false ); }
917 virtual bool is_Node (void) const { return( false ); }
918 virtual bool has_Statistics (void) const { return( false ); }
919
920 const CSG_Rect & Get_Extent (void) const { return( m_Extent ); }
921 double Get_xMin (void) const { return( m_Extent.xMin ); }
922 double Get_xCenter (void) const { return( m_Extent.Get_XCenter() ); }
923 double Get_xMax (void) const { return( m_Extent.xMax ); }
924 double Get_yMin (void) const { return( m_Extent.yMin ); }
925 double Get_yCenter (void) const { return( m_Extent.Get_YCenter() ); }
926 double Get_yMax (void) const { return( m_Extent.yMax ); }
927 double Get_Size (void) const { return( m_Extent.Get_XRange() ); }
928
929 bool Contains (const CSG_Point &p) const { return( m_Extent.Contains(p ) ); }
930 bool Contains (double x, double y) const { return( m_Extent.Contains(x, y) ); }
931
932 class CSG_PRQuadTree_Leaf * asLeaf (void) const { return( (class CSG_PRQuadTree_Leaf *)this ); }
933 class CSG_PRQuadTree_Node * asNode (void) const { return( (class CSG_PRQuadTree_Node *)this ); }
934
935
936 protected:
937
938 CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant = -1) { Set_Extent(Extent, Quadrant); }
939
940 virtual ~CSG_PRQuadTree_Item(void) {}
941
942 void Set_Extent (const CSG_Rect &Extent, int Quadrant = -1)
943 {
944 switch( Quadrant )
945 {
946 case 0: m_Extent.Assign(Extent.Get_XMin (), Extent.Get_YMin (), Extent.Get_XCenter(), Extent.Get_YCenter()); break; // bottom left
947 case 1: m_Extent.Assign(Extent.Get_XMin (), Extent.Get_YCenter(), Extent.Get_XCenter(), Extent.Get_YMax ()); break; // top left
948 case 2: m_Extent.Assign(Extent.Get_XCenter(), Extent.Get_YCenter(), Extent.Get_XMax (), Extent.Get_YMax ()); break; // top right
949 case 3: m_Extent.Assign(Extent.Get_XCenter(), Extent.Get_YMin (), Extent.Get_XMax (), Extent.Get_YCenter()); break; // bottom right
950 default: m_Extent.Assign(Extent); break;
951 }
952 }
953
954 int Get_Quadrant (const TSG_Point &p) const { return( Get_Quadrant(p.x, p.y) ); }
955
956 int Get_Quadrant (double x, double y) const
957 {
958 return( y < Get_yCenter() ? (x < Get_xCenter() ? 0 : 3) : (x < Get_xCenter() ? 1 : 2) );
959 }
960
961
962 CSG_Rect m_Extent;
963
964 };
965
966 //---------------------------------------------------------
967 class SAGA_API_DLL_EXPORT CSG_PRQuadTree_Leaf : public CSG_PRQuadTree_Item
968 {
969 friend class CSG_PRQuadTree_Node;
970
971 public:
972
973 virtual bool is_Leaf (void) const { return( true ); }
974
975 const TSG_Point & Get_Point (void) const { return( m_Point ); }
976 double Get_X (void) const { return( m_Point.x ); }
977 double Get_Y (void) const { return( m_Point.y ); }
978 double Get_Z (void) const { return( m_z ); }
979
980
981 protected:
982
983 CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
984 : CSG_PRQuadTree_Item(Extent, Quadrant)
985 {
986 m_Point.x = x;
987 m_Point.y = y;
988 m_z = z;
989 }
990
991 virtual ~CSG_PRQuadTree_Leaf(void) {}
992
993
994 double m_z;
995
996 TSG_Point m_Point;
997
998 };
999
1000 //---------------------------------------------------------
1001 class SAGA_API_DLL_EXPORT CSG_PRQuadTree_Leaf_List : public CSG_PRQuadTree_Leaf
1002 {
1003 friend class CSG_PRQuadTree_Node;
1004
1005 public:
1006
1007 virtual bool has_Statistics (void) const { return( true ); }
1008
1009 sLong Get_Count (void) { return( s_z.Get_Count () ); }
1010 double Get_Value (sLong i) { return( s_z.Get_Value (i) ); }
1011 double Get_Minimum (void) { return( s_z.Get_Minimum () ); }
1012 double Get_Maximum (void) { return( s_z.Get_Maximum () ); }
1013 double Get_Range (void) { return( s_z.Get_Range () ); }
1014 double Get_Sum (void) { return( s_z.Get_Sum () ); }
1015 double Get_Mean (void) { return( s_z.Get_Mean () ); }
1016 double Get_Variance (void) { return( s_z.Get_Variance() ); }
1017 double Get_StdDev (void) { return( s_z.Get_StdDev () ); }
1018
1019
1020 protected:
1021
1022 CSG_PRQuadTree_Leaf_List(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
1023 : CSG_PRQuadTree_Leaf(Extent, Quadrant, x, y, z)
1024 {
1025 s_z.Create(true);
1026
1027 s_z.Add_Value(z);
1028 }
1029
1030 virtual ~CSG_PRQuadTree_Leaf_List(void) {}
1031
1032 void Add_Value (double z)
1033 {
1034 s_z.Add_Value(z);
1035
1036 m_z = s_z.Get_Mean();
1037 }
1038
1039 CSG_Simple_Statistics s_z;
1040
1041 };
1042
1043 //---------------------------------------------------------
1044 class SAGA_API_DLL_EXPORT CSG_PRQuadTree_Node : public CSG_PRQuadTree_Item
1045 {
1046 friend class CSG_PRQuadTree;
1047
1048 public:
1049
1050 virtual bool is_Node (void) const { return( true ); }
1051
1052 CSG_PRQuadTree_Item * Get_Child (int Quadrant) const { return( Quadrant >= 0 && Quadrant < 4 ? m_pChildren[Quadrant] : NULL ); }
1053 CSG_PRQuadTree_Item * Get_Child (double x, double y);
1054
1055 bool Add_Point (double x, double y, double z);
1056
1057 virtual CSG_Simple_Statistics * Get_X (void) { return( NULL ); }
1058 virtual CSG_Simple_Statistics * Get_Y (void) { return( NULL ); }
1059 virtual CSG_Simple_Statistics * Get_Z (void) { return( NULL ); }
1060
1061
1062 protected:
1063
1064 CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant = -1);
1065 CSG_PRQuadTree_Node(CSG_PRQuadTree_Leaf *pLeaf);
1066 virtual ~CSG_PRQuadTree_Node(void);
1067
1068
1069 CSG_PRQuadTree_Item *m_pChildren[4];
1070
1071 };
1072
1073 //---------------------------------------------------------
1074 class SAGA_API_DLL_EXPORT CSG_PRQuadTree_Node_Statistics : public CSG_PRQuadTree_Node
1075 {
1076 friend class CSG_PRQuadTree;
1077 friend class CSG_PRQuadTree_Node;
1078
1079 public:
1080
1081 virtual bool has_Statistics (void) const { return( true ); }
1082
1083 virtual CSG_Simple_Statistics * Get_X (void) { return( &m_x ); }
1084 virtual CSG_Simple_Statistics * Get_Y (void) { return( &m_y ); }
1085 virtual CSG_Simple_Statistics * Get_Z (void) { return( &m_z ); }
1086
1087
1088 protected:
1089
1090 CSG_PRQuadTree_Node_Statistics(const CSG_Rect &Extent, int Quadrant = -1)
1091 : CSG_PRQuadTree_Node(Extent, Quadrant)
1092 {}
1093
1094 CSG_PRQuadTree_Node_Statistics(CSG_PRQuadTree_Leaf *pLeaf)
1095 : CSG_PRQuadTree_Node(pLeaf)
1096 {}
1097
1098 virtual ~CSG_PRQuadTree_Node_Statistics(void) {}
1099
1100
1101 CSG_Simple_Statistics m_x, m_y, m_z;
1102
1103 };
1104
1105 //---------------------------------------------------------
1106 class SAGA_API_DLL_EXPORT CSG_PRQuadTree
1107 {
1108 public:
1109 CSG_PRQuadTree(void);
1110 virtual ~CSG_PRQuadTree(void);
1111
1112 CSG_PRQuadTree (const TSG_Rect &Extent, bool bStatistics = false);
1113 bool Create (const CSG_Rect &Extent, bool bStatistics = false);
1114
1115 CSG_PRQuadTree (CSG_Shapes *pShapes, int Attribute, bool bStatistics = false);
1116 bool Create (CSG_Shapes *pShapes, int Attribute, bool bStatistics = false);
1117
1118 void Destroy (void);
1119
1120 bool Add_Point (double x, double y, double z);
1121 bool Add_Point (const TSG_Point &p, double z);
1122
1123 size_t Get_Point_Count (void) const { return( m_nPoints ); }
1124
1125 const CSG_PRQuadTree_Node & Get_Root (void) const { return( *m_pRoot ); }
1126 CSG_PRQuadTree_Node * Get_Root_Pointer (void) const { return( m_pRoot ); }
1127
1128 bool is_Okay (void) const { return( m_pRoot != NULL ); }
1129
1130 bool is_Polar (void) const { return( m_bPolar ); }
1131 void Set_Polar_Search (bool bOn) { m_bPolar = bOn; }
1132
1133 CSG_PRQuadTree_Leaf * Get_Nearest_Leaf (const TSG_Point &p, double &Distance) const;
1134 CSG_PRQuadTree_Leaf * Get_Nearest_Leaf (double x, double y, double &Distance) const;
1135 bool Get_Nearest_Point (const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const;
1136 bool Get_Nearest_Point (double x, double y, TSG_Point &Point, double &Value, double &Distance) const;
1137
1138 size_t Get_Nearest_Points (CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius = 0., int iQuadrant = -1) const;
1139 size_t Get_Nearest_Points (CSG_Points_3D &Points, double x, double y, size_t maxPoints, double Radius = 0., int iQuadrant = -1) const;
1140
1141 size_t Select_Nearest_Points (const TSG_Point &p, size_t maxPoints, double Radius = 0., int iQuadrant = -1);
1142 size_t Select_Nearest_Points (double x, double y, size_t maxPoints, double Radius = 0., int iQuadrant = -1);
1143
1144 size_t Get_Selected_Count (void) const { return( m_Selection.Get_Size() ); }
1145 CSG_PRQuadTree_Leaf * Get_Selected_Leaf (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? NULL : (((TLeaf *)m_Selection.Get_Array()) + i)->pLeaf ); }
1146 double Get_Selected_Z (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? 0. : (((TLeaf *)m_Selection.Get_Array()) + i)->pLeaf->Get_Z() ); }
1147 double Get_Selected_Distance (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? -1. : (((TLeaf *)m_Selection.Get_Array()) + i)->Distance ); }
1148 bool Get_Selected_Point (size_t i, double &x, double &y, double &z) const
1149 {
1150 CSG_PRQuadTree_Leaf *pLeaf = Get_Selected_Leaf(i);
1151
1152 if( pLeaf )
1153 {
1154 x = pLeaf->Get_X();
1155 y = pLeaf->Get_Y();
1156 z = pLeaf->Get_Z();
1157
1158 return( true );
1159 }
1160
1161 return( false );
1162 }
1163
1164
1165 private:
1166
1167 typedef struct SLeaf
1168 {
1169 CSG_PRQuadTree_Leaf *pLeaf;
1170
1171 double Distance;
1172 }
1173 TLeaf;
1174
1175
1176 private:
1177
1178 bool m_bPolar;
1179
1180 size_t m_nPoints;
1181
1182 CSG_Array m_Selection;
1183
1184 CSG_PRQuadTree_Node *m_pRoot;
1185
1186 bool _Check_Root (double x, double y);
1187
1188 bool _Quadrant_Contains (double x, double y, int iQuadrant, const TSG_Point &p) const;
1189 bool _Radius_Contains (double x, double y, double r, const TSG_Point &p) const;
1190 bool _Radius_Contains (double x, double y, double r, int iQuadrant, const TSG_Point &p) const;
1191 bool _Quadrant_Intersects (double x, double y, int iQuadrant, CSG_PRQuadTree_Item *pItem) const;
1192 bool _Radius_Intersects (double x, double y, double r, CSG_PRQuadTree_Item *pItem) const;
1193 bool _Radius_Intersects (double x, double y, double r, int iQuadrant, CSG_PRQuadTree_Item *pItem) const;
1194
1195 CSG_PRQuadTree_Leaf * _Get_Nearest_Point (CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance) const;
1196
1197 TLeaf * _Get_Selected (const CSG_Array &Selection, size_t i) const;
1198 bool _Add_Selected ( CSG_Array &Selection , CSG_PRQuadTree_Leaf *pLeaf, double Distance) const;
1199 bool _Set_Selected ( CSG_Array &Selection, size_t i, CSG_PRQuadTree_Leaf *pLeaf, double Distance) const;
1200 void _Select_Nearest_Points ( CSG_Array &Selection, CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance, double Radius, size_t maxPoints, int iQuadrant) const;
1201 size_t _Select_Nearest_Points ( CSG_Array &Selection, double x, double y, size_t maxPoints, double Radius, int iQuadrant) const;
1202
1203 };
1204
1205
1207 // //
1208 // Point Search Engine //
1209 // //
1211
1212 //---------------------------------------------------------
1213 class SAGA_API_DLL_EXPORT CSG_KDTree
1214 {
1215 public:
1216 CSG_KDTree(void);
1217 virtual ~CSG_KDTree(void);
1218
1219 static const char * Get_Version (void);
1220
1221 virtual bool Destroy (void);
1222
1223 bool is_Okay (void) const { return( m_pKDTree != NULL ); }
1224
1225 size_t Get_Match_Count (void ) const { return( m_Indices.Get_Size() ); }
1226 size_t Get_Match_Index (size_t i) const { return( m_Indices [i] ); }
1227 double Get_Match_Distance (size_t i) const { return( m_Distances[i] ); }
1228 CSG_Shape * Get_Match_Shape (size_t i) const;
1229
1230 int Get_Point_Count (void) const { return( m_Points.Get_NY() ); }
1231 double * Get_Point (int i) const { return( m_Points[i] ); }
1232 double * Get_Point (size_t i) const { return( m_Points[i] ); }
1233 double * operator [] (int i) const { return( m_Points[i] ); }
1234 double * operator [] (size_t i) const { return( m_Points[i] ); }
1235 virtual double Get_Point_Value (int i) const { return( Get_Point_Value((size_t)i) ); }
1236 virtual double Get_Point_Value (size_t i) const = 0;
1237
1238
1239 protected:
1240
1241 class CSG_KDTree_Adaptor *m_pAdaptor;
1242
1243 void *m_pKDTree;
1244
1245 CSG_Array_Int m_Indices;
1246
1247 CSG_Vector m_Distances;
1248
1249 CSG_Matrix m_Points;
1250
1251
1252 void _On_Construction (void);
1253
1254 };
1255
1256
1258 // //
1260
1261 //---------------------------------------------------------
1262 class SAGA_API_DLL_EXPORT CSG_KDTree_2D : public CSG_KDTree
1263 {
1264 public:
1265 CSG_KDTree_2D(void);
1266 virtual ~CSG_KDTree_2D(void);
1267
1268 CSG_KDTree_2D (CSG_Shapes *pPoints, int Field = -1);
1269 bool Create (CSG_Shapes *pPoints, int Field = -1);
1270
1271 CSG_KDTree_2D (CSG_PointCloud *pPoints);
1272 bool Create (CSG_PointCloud *pPoints);
1273
1274 CSG_KDTree_2D (const CSG_Matrix &Points);
1275 bool Create (const CSG_Matrix &Points);
1276
1277 CSG_KDTree_2D (const double **Points, size_t nPoints);
1278 bool Create (const double **Points, size_t nPoints);
1279
1280 virtual bool Destroy (void);
1281
1282 virtual double Get_Point_Value (size_t i) const { return( m_Points[i][2] ); }
1283
1284 virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius);
1285 virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances);
1286 virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, size_t *Indices, double *Distances);
1287 virtual bool Get_Nearest_Point (double Coordinate[2], size_t &Index, double &Distance);
1288 virtual bool Get_Nearest_Point (double Coordinate[2], size_t &Index);
1289 virtual bool Get_Nearest_Value (double Coordinate[2], double &Value);
1290 virtual CSG_Shape * Get_Nearest_Shape (double Coordinate[2]);
1291 virtual size_t Get_Duplicates (double Coordinate[2], CSG_Array_Int &Indices, CSG_Vector &Distances);
1292 virtual size_t Get_Duplicates (double Coordinate[2]);
1293
1294 virtual size_t Get_Nearest_Points (double x, double y, size_t Count, double Radius);
1295 virtual size_t Get_Nearest_Points (double x, double y, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances);
1296 virtual size_t Get_Nearest_Points (double x, double y, size_t Count, size_t *Indices, double *Distances);
1297 virtual bool Get_Nearest_Point (double x, double y, size_t &Index, double &Distance);
1298 virtual bool Get_Nearest_Point (double x, double y, size_t &Index);
1299 virtual bool Get_Nearest_Value (double x, double y, double &Value);
1300 virtual CSG_Shape * Get_Nearest_Shape (double x, double y);
1301 virtual size_t Get_Duplicates (double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances);
1302 virtual size_t Get_Duplicates (double x, double y);
1303
1304 };
1305
1306
1308 // //
1310
1311 //---------------------------------------------------------
1312 class SAGA_API_DLL_EXPORT CSG_KDTree_3D : public CSG_KDTree
1313 {
1314 public:
1315 CSG_KDTree_3D(void);
1316 virtual ~CSG_KDTree_3D(void);
1317
1318 CSG_KDTree_3D (CSG_Shapes *pPoints, int Field = -1, int zField = -1, double zScale = 1.);
1319 bool Create (CSG_Shapes *pPoints, int Field = -1, int zField = -1, double zScale = 1.);
1320
1321 CSG_KDTree_3D (CSG_PointCloud *pPoints);
1322 bool Create (CSG_PointCloud *pPoints);
1323
1324 CSG_KDTree_3D (const CSG_Matrix &Points);
1325 bool Create (const CSG_Matrix &Points);
1326
1327 CSG_KDTree_3D (const double **Points, size_t nPoints);
1328 bool Create (const double **Points, size_t nPoints);
1329
1330 virtual bool Destroy (void);
1331
1332 virtual double Get_Point_Value (size_t i) const { return( m_Points[i][3] ); }
1333
1334 virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius);
1335
1336 virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, size_t *Indices, double *Distances);
1337 virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances);
1338 virtual bool Get_Nearest_Point (double Coordinate[3], size_t &Index, double &Distance);
1339 virtual bool Get_Nearest_Point (double Coordinate[3], size_t &Index);
1340 virtual bool Get_Nearest_Value (double Coordinate[3], double &Value);
1341 virtual CSG_Shape * Get_Nearest_Shape (double Coordinate[3]);
1342 virtual size_t Get_Duplicates (double Coordinate[3], CSG_Array_Int &Indices, CSG_Vector &Distances);
1343 virtual size_t Get_Duplicates (double Coordinate[3]);
1344
1345 virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius);
1346 virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius, CSG_Array_Int &Indices, CSG_Vector &Distances);
1347 virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, size_t *Indices, double *Distances);
1348 virtual bool Get_Nearest_Point (double x, double y, double z, size_t &Index, double &Distance);
1349 virtual bool Get_Nearest_Point (double x, double y, double z, size_t &Index);
1350 virtual bool Get_Nearest_Value (double x, double y, double z, double &Value);
1351 virtual CSG_Shape * Get_Nearest_Shape (double x, double y, double z);
1352 virtual size_t Get_Duplicates (double x, double y, double z, CSG_Array_Int &Indices, CSG_Vector &Distances);
1353 virtual size_t Get_Duplicates (double x, double y, double z);
1354
1355 };
1356
1357
1359 // //
1361
1362 //---------------------------------------------------------
1363 class SAGA_API_DLL_EXPORT CSG_Parameters_Point_Search
1364 {
1365 public:
1366 CSG_Parameters_Point_Search(void);
1367 virtual ~CSG_Parameters_Point_Search(void) {}
1368
1369 virtual bool Create (class CSG_Parameters *pParameters, const CSG_String &Parent = "", size_t minPoints = 0);
1370
1371 virtual bool On_Parameter_Changed (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter);
1372 virtual bool On_Parameters_Enable (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter);
1373
1374 bool Do_Use_All (void) const { return( m_maxPoints == 0 && m_Radius <= 0. ); }
1375 bool Do_Use_All (bool bUpdate);
1376
1377 size_t Get_Min_Points (void) const { return( m_minPoints ); }
1378 size_t Get_Max_Points (void) const { return( m_maxPoints ); }
1379 double Get_Radius (void) const { return( m_Radius ); }
1380
1381
1382 protected:
1383
1384 bool Update (void);
1385
1386
1387 size_t m_minPoints, m_maxPoints;
1388
1389 double m_Radius;
1390
1391 class CSG_Parameters *m_pParameters;
1392
1393 };
1394
1395 //---------------------------------------------------------
1396 class SAGA_API_DLL_EXPORT CSG_Parameters_Point_Search_KDTree_2D : public CSG_Parameters_Point_Search
1397 {
1398 public:
1399 CSG_Parameters_Point_Search_KDTree_2D(void);
1400 virtual ~CSG_Parameters_Point_Search_KDTree_2D(void) {}
1401
1402 bool Initialize (CSG_Shapes *pPoints, int zField = -1);
1403 bool Finalize (void);
1404
1405 sLong Set_Location (double x, double y);
1406 sLong Set_Location (const CSG_Point &p);
1407
1408 sLong Get_Count (void) const { return( m_pPoints ? m_pPoints->Get_Count() : m_Search.Get_Match_Count() ); }
1409 bool Get_Point (sLong Index, double &x, double &y, double &z);
1410
1411 bool Get_Points (double x, double y, CSG_Points_3D &Points);
1412 bool Get_Points (const CSG_Point &p, CSG_Points_3D &Points);
1413
1414 bool Get_Points (double x, double y, CSG_Array_Int &Indices);
1415 bool Get_Points (const CSG_Point &p, CSG_Array_Int &Indices);
1416
1417 bool Get_Points (double x, double y, CSG_Array_Int &Indices, CSG_Vector &Distances);
1418 bool Get_Points (const CSG_Point &p, CSG_Array_Int &Indices, CSG_Vector &Distances);
1419
1420
1421 private:
1422
1423 int m_zField;
1424
1425 CSG_Shapes *m_pPoints;
1426
1427 CSG_KDTree_2D m_Search;
1428
1429 };
1430
1431
1433 // //
1434 // Polygon Tools //
1435 // //
1437
1438 //---------------------------------------------------------
1439 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1440 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1441 SAGA_API_DLL_EXPORT bool SG_Shape_Get_ExclusiveOr (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1442 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Union (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1443 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Dissolve (CSG_Shape *pSubject , CSG_Shape *pSolution = NULL);
1444 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Offset (CSG_Shape *pSubject, double Size, double dArc, CSG_Shape *pSolution = NULL);
1445
1446 SAGA_API_DLL_EXPORT const char * SG_Clipper_Get_Version (void);
1447
1448
1450 // //
1451 // OpenGIS //
1452 // //
1454
1455 //---------------------------------------------------------
1456 enum ESG_OGIS_ByteOrder
1457 {
1458 SG_OGIS_BYTEORDER_XDR = 0, // Big Endian
1459 SG_OGIS_BYTEORDER_NDR = 1 // Little Endian
1460 };
1461
1462 //---------------------------------------------------------
1463 typedef enum
1464 {
1465 SG_OGIS_TYPE_Undefined = 0,
1466
1467 SG_OGIS_TYPE_Point = 1,
1468 SG_OGIS_TYPE_LineString = 2,
1469 SG_OGIS_TYPE_Polygon = 3,
1470 SG_OGIS_TYPE_MultiPoint = 4,
1471 SG_OGIS_TYPE_MultiLineString = 5,
1472 SG_OGIS_TYPE_MultiPolygon = 6,
1473 SG_OGIS_TYPE_GeometryCollection = 7,
1474 SG_OGIS_TYPE_PolyhedralSurface = 15,
1475 SG_OGIS_TYPE_TIN = 16,
1476 SG_OGIS_TYPE_Triangle = 17,
1477
1478 SG_OGIS_TYPE_PointZ = 1001,
1479 SG_OGIS_TYPE_LineStringZ = 1002,
1480 SG_OGIS_TYPE_PolygonZ = 1003,
1481 SG_OGIS_TYPE_MultiPointZ = 1004,
1482 SG_OGIS_TYPE_MultiLineStringZ = 1005,
1483 SG_OGIS_TYPE_MultiPolygonZ = 1006,
1484 SG_OGIS_TYPE_GeometryCollectionZ = 1007,
1485 SG_OGIS_TYPE_PolyhedralSurfaceZ = 1015,
1486 SG_OGIS_TYPE_TINZ = 1016,
1487 SG_OGIS_TYPE_TriangleZ = 1017,
1488
1489 SG_OGIS_TYPE_PointM = 2001,
1490 SG_OGIS_TYPE_LineStringM = 2002,
1491 SG_OGIS_TYPE_PolygonM = 2003,
1492 SG_OGIS_TYPE_MultiPointM = 2004,
1493 SG_OGIS_TYPE_MultiLineStringM = 2005,
1494 SG_OGIS_TYPE_MultiPolygonM = 2006,
1495 SG_OGIS_TYPE_GeometryCollectionM = 2007,
1496 SG_OGIS_TYPE_PolyhedralSurfaceM = 2015,
1497 SG_OGIS_TYPE_TINM = 2016,
1498 SG_OGIS_TYPE_TriangleM = 2017,
1499
1500 SG_OGIS_TYPE_PointZM = 3001,
1501 SG_OGIS_TYPE_LineStringZM = 3002,
1502 SG_OGIS_TYPE_PolygonZM = 3003,
1503 SG_OGIS_TYPE_MultiPointZM = 3004,
1504 SG_OGIS_TYPE_MultiLineStringZM = 3005,
1505 SG_OGIS_TYPE_MultiPolygonZM = 3006,
1506 SG_OGIS_TYPE_GeometryCollectionZM = 3007,
1507 SG_OGIS_TYPE_PolyhedralSurfaceZM = 3015,
1508 SG_OGIS_TYPE_TINZM = 3016,
1509 SG_OGIS_TYPE_TriangleZM = 3017
1510 }
1511 TSG_OGIS_Type_Geometry;
1512
1513
1515 // //
1517
1518 //---------------------------------------------------------
1519 class SAGA_API_DLL_EXPORT CSG_Shapes_OGIS_Converter
1520 {
1521 public:
1522 CSG_Shapes_OGIS_Converter(void) {}
1523
1524 static bool from_WKText (const CSG_String &Text, CSG_Shape *pShape);
1525 static bool to_WKText (CSG_Shape *pShape, CSG_String &Text);
1526
1527 static bool from_WKBinary (CSG_Bytes &Bytes, CSG_Shape *pShape);
1528 static bool to_WKBinary (CSG_Shape *pShape, CSG_Bytes &Bytes);
1529
1530 static bool from_ShapeType ( CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1531 static CSG_String from_ShapeType ( TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1532 static bool to_ShapeType (const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex);
1533 static TSG_Shape_Type to_ShapeType (const CSG_String &Type);
1534 static TSG_Vertex_Type to_VertexType (const CSG_String &Type);
1535
1536 static bool from_ShapeType (DWORD &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1537 static bool to_ShapeType (DWORD Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex);
1538 static TSG_Shape_Type to_ShapeType (DWORD Type);
1539 static TSG_Vertex_Type to_VertexType (DWORD Type);
1540
1541 static CSG_String Type_asWKText (DWORD Type);
1542 static DWORD Type_asWKBinary (const CSG_String &Type);
1543
1544
1545 private:
1546
1547 static bool _WKT_Read_Point (const CSG_String &Text, CSG_Shape *pShape, int iPart);
1548 static bool _WKT_Read_Points (const CSG_String &Text, CSG_Shape *pShape);
1549 static bool _WKT_Read_Parts (const CSG_String &Text, CSG_Shape *pShape);
1550 static bool _WKT_Read_Polygon (const CSG_String &Text, CSG_Shape *pShape);
1551
1552 static bool _WKT_Write_Point (CSG_String &Text, CSG_Shape *pShape, int iPoint, int iPart);
1553 static bool _WKT_Write_Points (CSG_String &Text, CSG_Shape *pShape, int iPart);
1554 static bool _WKT_Write_Parts (CSG_String &Text, CSG_Shape *pShape);
1555 static bool _WKT_Write_Polygon (CSG_String &Text, CSG_Shape *pShape);
1556
1557 static bool _WKB_Read_Point (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape, int iPart);
1558 static bool _WKB_Read_Points (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1559 static bool _WKB_Read_Polygon (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1560 static bool _WKB_Read_MultiPoint (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1561 static bool _WKB_Read_MultiLine (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1562 static bool _WKB_Read_MultiPolygon (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1563
1564 static bool _WKB_Write_Point (CSG_Bytes &Bytes, CSG_Shape *pShape, int iPoint, int iPart);
1565 static bool _WKB_Write_Points (CSG_Bytes &Bytes, CSG_Shape *pShape, int iPart);
1566 static bool _WKB_Write_MultiPoint (CSG_Bytes &Bytes, CSG_Shape *pShape);
1567 static bool _WKB_Write_MultiLine (CSG_Bytes &Bytes, CSG_Shape *pShape);
1568 static bool _WKB_Write_MultiPolygon (CSG_Bytes &Bytes, CSG_Shape *pShape);
1569
1570 };
1571
1572
1574 // //
1576
1577 //---------------------------------------------------------
1578 class SAGA_API_DLL_EXPORT CSG_Grid_OGIS_Converter
1579 {
1580 public:
1581 CSG_Grid_OGIS_Converter(void) {}
1582
1583 static bool from_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid);
1584 static bool to_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID = -1);
1585
1586 };
1587
1588
1590 // //
1591 // //
1592 // //
1594
1595 //---------------------------------------------------------
1596 #endif // #ifndef HEADER_INCLUDED__SAGA_API__shapes_H
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next) const =0
SG_POLYGON_POINT_Edge
@ SG_POLYGON_POINT_Edge
Definition: shapes.h:638
CSG_Shape_Part::Get_MMax
double Get_MMax(void)
Definition: shapes.h:434
CSG_Rect
Definition: geo_tools.h:471
CSG_Shape_Polygon_Part::is_Clockwise
bool is_Clockwise(void)
Definition: shapes.h:650
CSG_Grid_OGIS_Converter::CSG_Grid_OGIS_Converter
CSG_Grid_OGIS_Converter(void)
Definition: shapes.h:1581
SHAPE_COPY_ATTR
@ SHAPE_COPY_ATTR
Definition: shapes.h:127
CSG_Shape_Polygon_Part::Get_Centroid
const TSG_Point & Get_Centroid(void)
Definition: shapes.h:656
SG_OGIS_TYPE_TriangleM
@ SG_OGIS_TYPE_TriangleM
Definition: shapes.h:1498
CSG_Shape_Polygon::Get_Point_Relation
TSG_Polygon_Point_Relation Get_Point_Relation(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:977
CSG_Shape_Points::m_pParts
CSG_Shape_Part ** m_pParts
Definition: shapes.h:567
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point) const
Definition: shapes.h:300
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_Shape_Point_ZM
Definition: shapes.h:344
CSG_Shape_Point::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)
Definition: shapes.h:291
CSG_Shapes::m_Extent_Selected
CSG_Rect m_Extent_Selected
Definition: shapes.h:849
CSG_Shapes::m_ZMin
double m_ZMin
Definition: shapes.h:843
CSG_Shape_Part::m_pOwner
class CSG_Shape_Points * m_pOwner
Definition: shapes.h:466
CSG_Shape_Part::m_MMax
double m_MMax
Definition: shapes.h:460
CSG_Shape_Points::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:539
CSG_Shapes::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: shapes.h:803
SG_POLYGON_POINT_Interior
@ SG_POLYGON_POINT_Interior
Definition: shapes.h:639
CSG_Shape_Polygon::m_bUpdate_Lakes
int m_bUpdate_Lakes
Definition: shapes.h:752
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)=0
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:320
CSG_Parameters_Point_Search
Definition: shapes.h:1364
SG_Get_ShapeType_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition: shapes.cpp:65
CSG_Parameters_Point_Search::Get_Radius
double Get_Radius(void) const
Definition: shapes.h:1379
SG_OGIS_TYPE_TINZ
@ SG_OGIS_TYPE_TINZ
Definition: shapes.h:1486
CSG_KDTree::m_Points
CSG_Matrix m_Points
Definition: shapes.h:1249
CSG_Shapes_OGIS_Converter::CSG_Shapes_OGIS_Converter
CSG_Shapes_OGIS_Converter(void)
Definition: shapes.h:1522
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)=0
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:550
SG_OGIS_TYPE_PolygonZ
@ SG_OGIS_TYPE_PolygonZ
Definition: shapes.h:1480
CSG_PRQuadTree_Leaf::CSG_PRQuadTree_Leaf
CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
Definition: shapes.h:983
CSG_PRQuadTree_Leaf_List
Definition: shapes.h:1002
CSG_Shape_Point::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shapes.h:293
CSG_PRQuadTree_Item::Get_yCenter
double Get_yCenter(void) const
Definition: shapes.h:925
CSG_PRQuadTree_Node_Statistics
Definition: shapes.h:1075
CSG_KDTree_2D
Definition: shapes.h:1263
CSG_Shapes::Save
virtual bool Save(const char *File, int Format=0)
Definition: shapes.h:802
CSG_Shape_Points::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:538
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point &p)
Definition: shapes.h:400
CSG_PRQuadTree::Get_Root_Pointer
CSG_PRQuadTree_Node * Get_Root_Pointer(void) const
Definition: shapes.h:1126
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_KDTree_3D
Definition: shapes.h:1313
CSG_Shapes::Get_Selection
virtual CSG_Shape * Get_Selection(sLong Index=0)
Definition: shapes.h:833
CSG_PRQuadTree_Leaf_List::Get_Value
double Get_Value(sLong i)
Definition: shapes.h:1010
CSG_Shape_Points::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:533
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(sLong Index) const
Definition: shapes.h:825
CSG_Table_Record
Definition: table.h:130
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
CSG_PRQuadTree::Get_Selected_Count
size_t Get_Selected_Count(void) const
Definition: shapes.h:1144
CSG_Shape_Part::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:418
CSG_Shape_Points::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:531
CSG_Shape::Del_Parts
virtual int Del_Parts(void)
Definition: shapes.h:171
CSG_Parameters_Point_Search::Do_Use_All
bool Do_Use_All(void) const
Definition: shapes.h:1374
CSG_Shape_Points::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:532
CSG_Shape_Part::Get_Point
TSG_Point Get_Point(int iPoint, bool bAscending=true) const
Definition: shapes.h:388
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_PRQuadTree_Node_Statistics::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:1081
CSG_Shape_Point
Definition: shapes.h:265
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Shape_Point::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:274
SHAPE_COPY_GEOM
@ SHAPE_COPY_GEOM
Definition: shapes.h:126
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)
Definition: shapes.h:287
CSG_Shape::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)=0
CSG_Shape::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)=0
CSG_Shape_Part::Get_Z
double Get_Z(int iPoint, bool bAscending=true) const
Definition: shapes.h:417
CSG_PRQuadTree_Leaf_List::Get_Minimum
double Get_Minimum(void)
Definition: shapes.h:1011
CSG_KDTree::m_pKDTree
void * m_pKDTree
Definition: shapes.h:1243
CSG_Parameters_Point_Search::Get_Max_Points
size_t Get_Max_Points(void) const
Definition: shapes.h:1378
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(int iPart) const
Definition: shapes.h:495
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0)
Definition: shapes.h:284
CSG_Shape_Points::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:492
CSG_PRQuadTree_Leaf_List::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:1007
CSG_Shape_Points::m_MMax
double m_MMax
Definition: shapes.h:563
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
CSG_Shape_Polygon_Part
Definition: shapes.h:645
CSG_PRQuadTree_Leaf_List::Get_Mean
double Get_Mean(void)
Definition: shapes.h:1015
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Shape_Part::Get_Point_Z
TSG_Point_3D Get_Point_Z(int iPoint, bool bAscending=true) const
Definition: shapes.h:420
CSG_Shape_Polygon_Part::m_Perimeter
double m_Perimeter
Definition: shapes.h:683
CSG_Shapes::Get_MMin
double Get_MMin(void)
Definition: shapes.h:815
CSG_Shape_Point_ZM::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:353
SSG_Point_4D
Definition: geo_tools.h:357
SSG_Point_3D
Definition: geo_tools.h:264
SG_Shapes_Get_File_Extension_Default
SAGA_API_DLL_EXPORT CSG_String SG_Shapes_Get_File_Extension_Default(void)
Definition: shapes.cpp:415
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0)
Definition: shapes.h:288
CSG_Table_Record::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: table_record.cpp:543
CSG_KDTree::m_Distances
CSG_Vector m_Distances
Definition: shapes.h:1247
CSG_PRQuadTree_Node::Get_Child
CSG_PRQuadTree_Item * Get_Child(int Quadrant) const
Definition: shapes.h:1052
CSG_Shape_Points
Definition: shapes.h:484
CSG_Table::Get_Selection
virtual CSG_Table_Record * Get_Selection(sLong Index=0) const
Definition: table.h:415
CSG_PRQuadTree_Leaf::Get_Y
double Get_Y(void) const
Definition: shapes.h:977
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Table::On_Reload
virtual bool On_Reload(void)
Definition: table_io.cpp:64
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Shape_Polygon::Get_Shared_Edges
CSG_Lines Get_Shared_Edges(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1183
CSG_Shape::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:169
CSG_PRQuadTree_Leaf_List::Get_Sum
double Get_Sum(void)
Definition: shapes.h:1014
SG_OGIS_TYPE_PolyhedralSurfaceZM
@ SG_OGIS_TYPE_PolyhedralSurfaceZM
Definition: shapes.h:1507
SG_OGIS_TYPE_MultiPolygon
@ SG_OGIS_TYPE_MultiPolygon
Definition: shapes.h:1472
SG_Shapes_Get_File_Format_Default
SAGA_API_DLL_EXPORT TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default(void)
Definition: shapes.cpp:409
CSG_PRQuadTree_Leaf_List::Get_Count
sLong Get_Count(void)
Definition: shapes.h:1009
CSG_Shape_Points::_Update_Extent
void _Update_Extent(void)
Definition: shape_points.cpp:313
CSG_Shape_Points::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)
Definition: shapes.h:509
SG_OGIS_TYPE_PointM
@ SG_OGIS_TYPE_PointM
Definition: shapes.h:1489
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Shape_Polygon::is_OnEdge
bool is_OnEdge(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:1029
SHAPE_COPY
@ SHAPE_COPY
Definition: shapes.h:128
CSG_Shapes::Get_Shape_byIndex
virtual CSG_Shape * Get_Shape_byIndex(sLong Index) const
Definition: shapes.h:826
CSG_PRQuadTree_Item::Get_xCenter
double Get_xCenter(void) const
Definition: shapes.h:922
SG_OGIS_TYPE_PointZ
@ SG_OGIS_TYPE_PointZ
Definition: shapes.h:1478
CSG_Shape::asPoint
class CSG_Shape_Point * asPoint(void) const
Definition: shapes.h:158
CSG_Shape_Part::_Invalidate
virtual void _Invalidate(void)
Definition: shape_part.cpp:375
CSG_Shape::CSG_Shape
CSG_Shape(class CSG_Shapes *pOwner, sLong Index)
Definition: shape.cpp:63
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shape::Add_Part
virtual int Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false)
Definition: shapes.h:168
CSG_Shape_Polygon::Get_Shared_Length
double Get_Shared_Length(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1208
SG_OGIS_TYPE_MultiPoint
@ SG_OGIS_TYPE_MultiPoint
Definition: shapes.h:1470
CSG_Table::On_Delete
virtual bool On_Delete(void)
Definition: table_io.cpp:70
SG_OGIS_TYPE_MultiLineString
@ SG_OGIS_TYPE_MultiLineString
Definition: shapes.h:1471
SSG_Point
Definition: geo_tools.h:128
CSG_KDTree::Get_Match_Distance
double Get_Match_Distance(size_t i) const
Definition: shapes.h:1227
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_KDTree_3D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1332
CSG_PRQuadTree::Get_Point_Count
size_t Get_Point_Count(void) const
Definition: shapes.h:1123
CSG_Shape_Points::Destroy
virtual void Destroy(void)
Definition: shape_points.cpp:86
CSG_PRQuadTree_Node
Definition: shapes.h:1045
CSG_Shape_Points::m_ZMax
double m_ZMax
Definition: shapes.h:563
CSG_Shape_Points::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shape_points.cpp:245
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
TSG_Polygon_Point_Relation
TSG_Polygon_Point_Relation
Definition: shapes.h:635
CSG_Shapes::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:813
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point) const =0
CSG_Shape_Part::CSG_Shape_Part
CSG_Shape_Part(class CSG_Shape_Points *pOwner)
Definition: shape_part.cpp:63
CSG_Shape_Point_ZM::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:354
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)
Definition: shapes.h:506
CSG_PRQuadTree_Leaf::Get_Point
const TSG_Point & Get_Point(void) const
Definition: shapes.h:975
CSG_Shape_Part::Get_M
double Get_M(int iPoint, bool bAscending=true) const
Definition: shapes.h:432
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next) const
Definition: shapes.h:302
SG_OGIS_TYPE_MultiPolygonZM
@ SG_OGIS_TYPE_MultiPolygonZM
Definition: shapes.h:1505
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(int iPart)
Definition: shapes.h:228
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const =0
CSG_PRQuadTree_Leaf_List::Get_StdDev
double Get_StdDev(void)
Definition: shapes.h:1017
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_PRQuadTree::Get_Root
const CSG_PRQuadTree_Node & Get_Root(void) const
Definition: shapes.h:1125
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shapes.h:303
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
SG_OGIS_TYPE_PolygonM
@ SG_OGIS_TYPE_PolygonM
Definition: shapes.h:1491
SG_OGIS_TYPE_Undefined
@ SG_OGIS_TYPE_Undefined
Definition: shapes.h:1465
SG_POLYGON_POINT_Vertex
@ SG_POLYGON_POINT_Vertex
Definition: shapes.h:637
CSG_Shape_Points::m_MMin
double m_MMin
Definition: shapes.h:563
CSG_Shape::Destroy
virtual void Destroy(void)
Definition: shape.cpp:79
CSG_Shape_Points::Get_Distance
virtual double Get_Distance(TSG_Point Point) const
Definition: shape_points.cpp:391
CSG_Shape::Del_Part
virtual int Del_Part(int iPart)
Definition: shapes.h:170
SG_OGIS_BYTEORDER_NDR
@ SG_OGIS_BYTEORDER_NDR
Definition: shapes.h:1459
SG_Shape_Get_ExclusiveOr
SAGA_API_DLL_EXPORT bool SG_Shape_Get_ExclusiveOr(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:331
CSG_Shape_Points::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:536
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shape_Part::m_ZMin
double m_ZMin
Definition: shapes.h:460
CSG_Shapes::Del_Shapes
virtual bool Del_Shapes(void)
Definition: shapes.h:822
CSG_PRQuadTree::Set_Polar_Search
void Set_Polar_Search(bool bOn)
Definition: shapes.h:1131
CSG_Shape_Polygon::Contains
bool Contains(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:1071
CSG_Shapes::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shapes.h:809
CSG_Shape_Points::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)
Definition: shape_points.cpp:199
SG_OGIS_TYPE_LineString
@ SG_OGIS_TYPE_LineString
Definition: shapes.h:1468
CSG_Parameters_Point_Search_KDTree_2D
Definition: shapes.h:1397
CSG_Vector
Definition: mat_tools.h:345
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Parameter
Definition: parameters.h:207
SG_Shapes_Set_File_Format_Default
SAGA_API_DLL_EXPORT bool SG_Shapes_Set_File_Format_Default(int Format)
Definition: shapes.cpp:394
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shape_Line
Definition: shapes.h:601
SG_OGIS_TYPE_GeometryCollectionZM
@ SG_OGIS_TYPE_GeometryCollectionZM
Definition: shapes.h:1506
SG_POLYGON_POINT_Outside
@ SG_POLYGON_POINT_Outside
Definition: shapes.h:636
CSG_PRQuadTree_Item::Contains
bool Contains(const CSG_Point &p) const
Definition: shapes.h:929
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Shape::asPoints
class CSG_Shape_Points * asPoints(void) const
Definition: shapes.h:159
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const =0
CSG_PRQuadTree_Leaf_List::Get_Range
double Get_Range(void)
Definition: shapes.h:1013
CSG_Shape_Part::CSG_Shape_Points
friend class CSG_Shape_Points
Definition: shapes.h:373
CSG_Shape_Part::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: shapes.h:384
CSG_PRQuadTree_Item::is_Node
virtual bool is_Node(void) const
Definition: shapes.h:917
CSG_PRQuadTree_Node::Get_Y
virtual CSG_Simple_Statistics * Get_Y(void)
Definition: shapes.h:1058
CSG_PRQuadTree_Item::~CSG_PRQuadTree_Item
virtual ~CSG_PRQuadTree_Item(void)
Definition: shapes.h:940
CSG_Shape_Points::m_ZMin
double m_ZMin
Definition: shapes.h:563
CSG_Shape_Point_Z::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:331
CSG_Shape_Points::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:534
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
CSG_Shape_Polygon_Part::m_bLake
int m_bLake
Definition: shapes.h:681
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
SG_OGIS_TYPE_TINM
@ SG_OGIS_TYPE_TINM
Definition: shapes.h:1497
CSG_PRQuadTree_Node_Statistics::m_z
CSG_Simple_Statistics m_z
Definition: shapes.h:1101
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Shape_Points::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:537
CSG_PRQuadTree_Item::CSG_PRQuadTree_Item
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:938
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)
Definition: shapes.h:505
SG_OGIS_TYPE_TINZM
@ SG_OGIS_TYPE_TINZM
Definition: shapes.h:1508
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_Point_4D
Definition: geo_tools.h:364
CSG_PRQuadTree_Leaf::Get_X
double Get_X(void) const
Definition: shapes.h:976
SG_OGIS_TYPE_PolyhedralSurface
@ SG_OGIS_TYPE_PolyhedralSurface
Definition: shapes.h:1474
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape_Polygon_Part::m_Centroid
TSG_Point m_Centroid
Definition: shapes.h:685
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:197
CSG_Shape_Part::m_nPoints
int m_nPoints
Definition: shapes.h:458
CSG_PRQuadTree_Item::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:962
CSG_PRQuadTree_Node::is_Node
virtual bool is_Node(void) const
Definition: shapes.h:1050
CSG_Shape_Part::Set_M
void Set_M(double m, int iPoint)
Definition: shapes.h:431
CSG_Shape_Point_ZM::CSG_Shape_Point_ZM
CSG_Shape_Point_ZM(class CSG_Shapes *pOwner, sLong Index)
Definition: shapes.h:349
CSG_Shape::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:240
SHAPE_FILE_FORMAT_GeoPackage
@ SHAPE_FILE_FORMAT_GeoPackage
Definition: shapes.h:117
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:196
CSG_Shape_Polygon::_Invalidate
virtual void _Invalidate(void)
Definition: shape_polygon.cpp:654
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0)
Definition: shapes.h:283
CSG_Shape_Points::_Get_Part
virtual CSG_Shape_Part * _Get_Part(void)
Definition: shapes.h:572
CSG_PRQuadTree_Item::is_Leaf
virtual bool is_Leaf(void) const
Definition: shapes.h:916
CSG_PRQuadTree_Node_Statistics::~CSG_PRQuadTree_Node_Statistics
virtual ~CSG_PRQuadTree_Node_Statistics(void)
Definition: shapes.h:1098
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)
Definition: shapes.h:504
SG_OGIS_TYPE_Point
@ SG_OGIS_TYPE_Point
Definition: shapes.h:1467
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1292
SG_OGIS_TYPE_PolyhedralSurfaceZ
@ SG_OGIS_TYPE_PolyhedralSurfaceZ
Definition: shapes.h:1485
CSG_Shape_Points::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)
Definition: shapes.h:503
CSG_PRQuadTree_Node::Get_Z
virtual CSG_Simple_Statistics * Get_Z(void)
Definition: shapes.h:1059
CSG_Shape_Polygon::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shape_polygon.cpp:1221
CSG_Shape_Line::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:606
CSG_PRQuadTree_Item::asNode
class CSG_PRQuadTree_Node * asNode(void) const
Definition: shapes.h:933
CSG_PRQuadTree_Leaf::Get_Z
double Get_Z(void) const
Definition: shapes.h:978
SG_Shape_Get_Union
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Union(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:355
CSG_Shape_Point::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:272
CSG_PRQuadTree_Leaf_List::Get_Maximum
double Get_Maximum(void)
Definition: shapes.h:1012
CSG_Array_Int
Definition: api_core.h:421
SG_OGIS_TYPE_TriangleZ
@ SG_OGIS_TYPE_TriangleZ
Definition: shapes.h:1487
CSG_Shape::Get_Centroid
virtual TSG_Point Get_Centroid(void)=0
SG_OGIS_TYPE_GeometryCollectionZ
@ SG_OGIS_TYPE_GeometryCollectionZ
Definition: shapes.h:1484
SG_OGIS_TYPE_LineStringZM
@ SG_OGIS_TYPE_LineStringZM
Definition: shapes.h:1501
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Shape_Part::Set_Z
void Set_Z(double z, int iPoint)
Definition: shapes.h:416
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
SG_Create_Shapes
SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
CSG_PRQuadTree_Item::Get_yMin
double Get_yMin(void) const
Definition: shapes.h:924
SG_OGIS_TYPE_GeometryCollection
@ SG_OGIS_TYPE_GeometryCollection
Definition: shapes.h:1473
CSG_KDTree::m_pAdaptor
class CSG_KDTree_Adaptor * m_pAdaptor
Definition: shapes.h:1241
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
CSG_Shape_Polygon::Get_Polygon_Part
CSG_Shape_Polygon_Part * Get_Polygon_Part(int iPart) const
Definition: shapes.h:707
CSG_PRQuadTree::Get_Selected_Leaf
CSG_PRQuadTree_Leaf * Get_Selected_Leaf(size_t i) const
Definition: shapes.h:1145
CSG_Shape::CSG_Shapes
friend class CSG_Shapes
Definition: shapes.h:142
CSG_Grid_OGIS_Converter
Definition: shapes.h:1579
SG_Clipper_Get_Version
SAGA_API_DLL_EXPORT const char * SG_Clipper_Get_Version(void)
Definition: shapes_clipper.cpp:407
CSG_Shape_Part::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:464
CSG_PRQuadTree::Get_Selected_Z
double Get_Selected_Z(size_t i) const
Definition: shapes.h:1146
SHAPE_FILE_FORMAT_Undefined
@ SHAPE_FILE_FORMAT_Undefined
Definition: shapes.h:115
CSG_PRQuadTree_Node_Statistics::Get_X
virtual CSG_Simple_Statistics * Get_X(void)
Definition: shapes.h:1083
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)=0
CSG_Shape_Polygon::_Get_Part
virtual CSG_Shape_Part * _Get_Part(void)
Definition: shapes.h:755
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:212
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shapes_OGIS_Converter
Definition: shapes.h:1520
SG_OGIS_TYPE_TIN
@ SG_OGIS_TYPE_TIN
Definition: shapes.h:1475
CSG_Shape_Point_Z::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:333
SG_Shape_Get_Dissolve
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Dissolve(CSG_Shape *pSubject, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:390
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Parameters_Point_Search_KDTree_2D::~CSG_Parameters_Point_Search_KDTree_2D
virtual ~CSG_Parameters_Point_Search_KDTree_2D(void)
Definition: shapes.h:1400
CSG_Shape_Point_Z::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:332
CSG_Points
Definition: geo_tools.h:184
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Shape_Part::Get_Owner
class CSG_Shape_Points * Get_Owner(void)
Definition: shapes.h:379
CSG_Bytes
Definition: api_core.h:804
CSG_PRQuadTree_Node::Get_X
virtual CSG_Simple_Statistics * Get_X(void)
Definition: shapes.h:1057
CSG_Shape::is_Valid
virtual bool is_Valid(void) const =0
CSG_Shape_Part::Set_Point
int Set_Point(const CSG_Point &p, int iPoint)
Definition: shapes.h:410
CSG_PRQuadTree_Item::Contains
bool Contains(double x, double y) const
Definition: shapes.h:930
CSG_Shape_Part::_Update_Extent
virtual void _Update_Extent(void)
Definition: shape_part.cpp:386
CSG_Shape_Part::m_ZMax
double m_ZMax
Definition: shapes.h:460
CSG_KDTree::Get_Point
double * Get_Point(size_t i) const
Definition: shapes.h:1232
CSG_Shape_Part::m_MMin
double m_MMin
Definition: shapes.h:460
CSG_Shape::asLine
class CSG_Shape_Line * asLine(void) const
Definition: shapes.h:160
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point_3D &p)
Definition: shapes.h:401
SG_OGIS_TYPE_PolyhedralSurfaceM
@ SG_OGIS_TYPE_PolyhedralSurfaceM
Definition: shapes.h:1496
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
SG_OGIS_TYPE_GeometryCollectionM
@ SG_OGIS_TYPE_GeometryCollectionM
Definition: shapes.h:1495
CSG_Shape_Point::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shapes.h:296
CSG_Table
Definition: table.h:283
TSG_Shape_File_Format
TSG_Shape_File_Format
Definition: shapes.h:114
SG_Shape_Get_Difference
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:313
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_OGIS_TYPE_TriangleZM
@ SG_OGIS_TYPE_TriangleZM
Definition: shapes.h:1509
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:565
CSG_PRQuadTree::is_Okay
bool is_Okay(void) const
Definition: shapes.h:1128
CSG_PRQuadTree::Get_Selected_Distance
double Get_Selected_Distance(size_t i) const
Definition: shapes.h:1147
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Shape_Points::_Invalidate
virtual void _Invalidate(void)
Definition: shapes.h:574
CSG_PRQuadTree_Leaf::m_Point
TSG_Point m_Point
Definition: shapes.h:996
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_Shapes::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: shapes.h:797
SHAPE_NO_COPY
@ SHAPE_NO_COPY
Definition: shapes.h:125
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0)
Definition: shapes.h:289
CSG_Shape_Point::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shapes.h:286
SHAPE_FILE_FORMAT_GeoJSON
@ SHAPE_FILE_FORMAT_GeoJSON
Definition: shapes.h:118
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_PRQuadTree
Definition: shapes.h:1107
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Array
Definition: api_core.h:308
CSG_Parameters_Point_Search::m_pParameters
class CSG_Parameters * m_pParameters
Definition: shapes.h:1391
SG_OGIS_TYPE_Triangle
@ SG_OGIS_TYPE_Triangle
Definition: shapes.h:1476
CSG_Parameters_Point_Search_KDTree_2D::Get_Count
sLong Get_Count(void) const
Definition: shapes.h:1408
CSG_String
Definition: api_core.h:557
CSG_KDTree::Get_Match_Index
size_t Get_Match_Index(size_t i) const
Definition: shapes.h:1226
CSG_Parameters_Point_Search::~CSG_Parameters_Point_Search
virtual ~CSG_Parameters_Point_Search(void)
Definition: shapes.h:1367
CSG_Shape_Polygon_Part::Get_Perimeter
double Get_Perimeter(void)
Definition: shapes.h:652
CSG_Shape::_Invalidate
virtual void _Invalidate(void)
Definition: shape.cpp:105
CSG_Shape_Polygon::is_Neighbour
bool is_Neighbour(CSG_Shape_Polygon *pPolygon, bool bSimpleCheck=true)
Definition: shape_polygon.cpp:1126
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shape::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:499
CSG_PRQuadTree_Item::Set_Extent
void Set_Extent(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:942
CSG_Shape_Part::Add_Point
int Add_Point(double x, double y)
Definition: shapes.h:399
CSG_PRQuadTree_Item::Get_Extent
const CSG_Rect & Get_Extent(void) const
Definition: shapes.h:920
SG_OGIS_TYPE_PointZM
@ SG_OGIS_TYPE_PointZM
Definition: shapes.h:1500
CSG_Shape::Get_Point_Z
virtual TSG_Point_3D Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:198
CSG_Shapes::Destroy
virtual bool Destroy(void)
Definition: shapes.cpp:347
CSG_KDTree
Definition: shapes.h:1214
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_Shape_Polygon_Part::Get_Area
double Get_Area(void)
Definition: shapes.h:654
CSG_PRQuadTree_Item::asLeaf
class CSG_PRQuadTree_Leaf * asLeaf(void) const
Definition: shapes.h:932
CSG_KDTree::is_Okay
bool is_Okay(void) const
Definition: shapes.h:1223
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:213
CSG_PRQuadTree_Item::Get_Size
double Get_Size(void) const
Definition: shapes.h:927
CSG_Parameters_Point_Search::m_minPoints
size_t m_minPoints
Definition: shapes.h:1387
CSG_Shape::~CSG_Shape
virtual ~CSG_Shape(void)
Definition: shape.cpp:68
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, int iPart) const
Definition: shapes.h:301
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
SG_OGIS_TYPE_MultiPolygonM
@ SG_OGIS_TYPE_MultiPolygonM
Definition: shapes.h:1494
CSG_Shape_Points::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:541
CSG_Shape_Points::CSG_Shape_Part
friend class CSG_Shape_Part
Definition: shapes.h:486
CSG_Shape_Point_Z::CSG_Shape_Point_Z
CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index)
Definition: shapes.h:328
CSG_Shape_Point_ZM::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:352
CSG_PRQuadTree_Leaf_List::Add_Value
void Add_Value(double z)
Definition: shapes.h:1032
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
SG_OGIS_BYTEORDER_XDR
@ SG_OGIS_BYTEORDER_XDR
Definition: shapes.h:1458
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
SG_OGIS_TYPE_MultiPointZM
@ SG_OGIS_TYPE_MultiPointZM
Definition: shapes.h:1503
CSG_Shape_Point_Z
Definition: shapes.h:323
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0)=0
CSG_Shape::Get_Point_ZM
virtual TSG_Point_4D Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:214
SG_Shape_Get_Intersection
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:293
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)
Definition: shapes.h:278
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_KDTree::Get_Point_Value
virtual double Get_Point_Value(size_t i) const =0
CSG_Parameters_Point_Search::Get_Min_Points
size_t Get_Min_Points(void) const
Definition: shapes.h:1377
SHAPE_FILE_FORMAT_ESRI
@ SHAPE_FILE_FORMAT_ESRI
Definition: shapes.h:116
CSG_Shape_Part::Get_Count
int Get_Count(void) const
Definition: shapes.h:386
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
CSG_KDTree::Get_Point_Value
virtual double Get_Point_Value(int i) const
Definition: shapes.h:1235
CSG_Shape_Points::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_points.cpp:449
CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics
CSG_PRQuadTree_Node_Statistics(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:1090
CSG_Shape_Polygon::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:704
CSG_KDTree::m_Indices
CSG_Array_Int m_Indices
Definition: shapes.h:1245
CSG_PRQuadTree_Node_Statistics::Get_Y
virtual CSG_Simple_Statistics * Get_Y(void)
Definition: shapes.h:1084
CSG_PRQuadTree_Item::Get_Quadrant
int Get_Quadrant(double x, double y) const
Definition: shapes.h:956
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)
Definition: shapes.h:279
CSG_Shape_Point::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:270
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0)=0
ESG_OGIS_ByteOrder
ESG_OGIS_ByteOrder
Definition: shapes.h:1457
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)
Definition: shapes.h:277
CSG_KDTree::Destroy
virtual bool Destroy(void)
Definition: kdtree.cpp:279
CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics
CSG_PRQuadTree_Node_Statistics(CSG_PRQuadTree_Leaf *pLeaf)
Definition: shapes.h:1094
CSG_PRQuadTree_Leaf_List::s_z
CSG_Simple_Statistics s_z
Definition: shapes.h:1039
CSG_KDTree::Get_Point_Count
int Get_Point_Count(void) const
Definition: shapes.h:1230
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Shape_Point::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const
Definition: shapes.h:294
SG_OGIS_TYPE_MultiPointZ
@ SG_OGIS_TYPE_MultiPointZ
Definition: shapes.h:1481
CSG_KDTree::Get_Point
double * Get_Point(int i) const
Definition: shapes.h:1231
CSG_Shape_Points::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)
Definition: shape_points.cpp:283
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_PRQuadTree_Leaf_List::Get_Variance
double Get_Variance(void)
Definition: shapes.h:1016
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
CSG_Shape_Part::Ins_Point
int Ins_Point(const CSG_Point &p, int iPoint)
Definition: shapes.h:405
SG_OGIS_TYPE_PolygonZM
@ SG_OGIS_TYPE_PolygonZM
Definition: shapes.h:1502
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:194
CSG_Shape_Part::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:419
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_PRQuadTree_Leaf::m_z
double m_z
Definition: shapes.h:994
CSG_Shapes
Definition: shapes.h:773
CSG_Shape_Points::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)
Definition: shapes.h:514
CSG_Table::Save
virtual bool Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:155
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
SG_Shape_Get_Offset
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Offset(CSG_Shape *pSubject, double Size, double dArc, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:396
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)
Definition: shapes.h:282
TSG_OGIS_Type_Geometry
TSG_OGIS_Type_Geometry
Definition: shapes.h:1464
CSG_PRQuadTree_Leaf_List::~CSG_PRQuadTree_Leaf_List
virtual ~CSG_PRQuadTree_Leaf_List(void)
Definition: shapes.h:1030
CSG_Shape_Point_Z::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:330
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Lines
Definition: geo_tools.h:216
CSG_PRQuadTree_Leaf::is_Leaf
virtual bool is_Leaf(void) const
Definition: shapes.h:973
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point_4D &p)
Definition: shapes.h:402
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0)=0
CSG_Shape_Points::m_nPoints
int m_nPoints
Definition: shapes.h:561
CSG_PRQuadTree_Item::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:918
CSG_Shape::asPolygon
class CSG_Shape_Polygon * asPolygon(void) const
Definition: shapes.h:161
SG_OGIS_TYPE_Polygon
@ SG_OGIS_TYPE_Polygon
Definition: shapes.h:1469
SG_OGIS_TYPE_LineStringZ
@ SG_OGIS_TYPE_LineStringZ
Definition: shapes.h:1479
CSG_KDTree::Get_Match_Count
size_t Get_Match_Count(void) const
Definition: shapes.h:1225
SG_OGIS_TYPE_MultiPointM
@ SG_OGIS_TYPE_MultiPointM
Definition: shapes.h:1492
CSG_Shape_Part::Get_Point_ZM
TSG_Point_4D Get_Point_ZM(int iPoint, bool bAscending=true) const
Definition: shapes.h:435
CSG_Parameters
Definition: parameters.h:1650
SG_OGIS_TYPE_MultiLineStringZM
@ SG_OGIS_TYPE_MultiLineStringZM
Definition: shapes.h:1504
CSG_PRQuadTree_Item::Get_Quadrant
int Get_Quadrant(const TSG_Point &p) const
Definition: shapes.h:954
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
CSG_KDTree_2D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1282
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_PRQuadTree_Item::Get_xMin
double Get_xMin(void) const
Definition: shapes.h:921
CSG_Shape_Part::m_bUpdate
bool m_bUpdate
Definition: shapes.h:456
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const
Definition: shapes.h:521
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)
Definition: shapes.h:281
CSG_Matrix
Definition: mat_tools.h:463
CSG_Shape_Point::Get_Point_Count
virtual int Get_Point_Count(int iPart) const
Definition: shapes.h:273
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:210
CSG_PRQuadTree_Item
Definition: shapes.h:913
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Shape_Point::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)
Definition: shapes.h:276
CSG_Shape_Points::m_bUpdate
bool m_bUpdate
Definition: shapes.h:559
SG_OGIS_TYPE_MultiPolygonZ
@ SG_OGIS_TYPE_MultiPolygonZ
Definition: shapes.h:1483
CSG_Shape_Points::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shape_points.cpp:364
CSG_Shape
Definition: shapes.h:141
CSG_PRQuadTree_Node_Statistics::Get_Z
virtual CSG_Simple_Statistics * Get_Z(void)
Definition: shapes.h:1085
table.h
CSG_PRQuadTree_Item::Get_yMax
double Get_yMax(void) const
Definition: shapes.h:926
CSG_Shape_Part
Definition: shapes.h:372
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shape_Point::m_Point
TSG_Point m_Point
Definition: shapes.h:312
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)=0
CSG_Table::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: table.cpp:793
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Shape::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)=0
CSG_Parameters_Point_Search::m_Radius
double m_Radius
Definition: shapes.h:1389
CSG_Shape_Point_ZM::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:351
CSG_PRQuadTree_Leaf
Definition: shapes.h:968
SG_OGIS_TYPE_MultiLineStringM
@ SG_OGIS_TYPE_MultiLineStringM
Definition: shapes.h:1493
CSG_PRQuadTree_Leaf_List::CSG_PRQuadTree_Leaf_List
CSG_PRQuadTree_Leaf_List(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
Definition: shapes.h:1022
SG_OGIS_TYPE_MultiLineStringZ
@ SG_OGIS_TYPE_MultiLineStringZ
Definition: shapes.h:1482
CSG_PRQuadTree::is_Polar
bool is_Polar(void) const
Definition: shapes.h:1130
CSG_Shape::On_Intersects
virtual TSG_Intersection On_Intersects(TSG_Rect Extent)=0
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, int iPart) const =0
SG_OGIS_TYPE_LineStringM
@ SG_OGIS_TYPE_LineStringM
Definition: shapes.h:1490
CSG_PRQuadTree::Add_Point
bool Add_Point(double x, double y, double z)
Definition: quadtree.cpp:297
CSG_PRQuadTree_Leaf::~CSG_PRQuadTree_Leaf
virtual ~CSG_PRQuadTree_Leaf(void)
Definition: shapes.h:991
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
CSG_PRQuadTree::Get_Selected_Point
bool Get_Selected_Point(size_t i, double &x, double &y, double &z) const
Definition: shapes.h:1148
CSG_Shape::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)=0
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(int iPart) const =0
CSG_Shape_Part::Get_MMin
double Get_MMin(void)
Definition: shapes.h:433
CSG_PRQuadTree_Item::Get_xMax
double Get_xMax(void) const
Definition: shapes.h:923
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes_clipper.cpp File Reference

  • saga_core
  • saga_api
Functions
shapes_clipper.cpp File Reference
#include "shapes.h"
#include "clipper2/clipper.h"

Go to the source code of this file.

Functions

bool | SG_Shape_Get_Intersection (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
bool | SG_Shape_Get_Difference (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
bool | SG_Shape_Get_ExclusiveOr (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
bool | SG_Shape_Get_Union (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
bool | SG_Shape_Get_Dissolve (CSG_Shape *pShape, CSG_Shape *pSolution)
bool | SG_Shape_Get_Offset (CSG_Shape *pShape, double Size, double dArc, CSG_Shape *pSolution)
const char * | SG_Clipper_Get_Version (void)

Function Documentation

◆ SG_Clipper_Get_Version()

const char* SG_Clipper_Get_Version ( void )

Definition at line 407 of file shapes_clipper.cpp.

◆ SG_Shape_Get_Difference()

bool SG_Shape_Get_Difference | ( | CSG_Shape * | pShape,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution
 | ) |  |

Definition at line 313 of file shapes_clipper.cpp.

References CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Dissolve()

bool SG_Shape_Get_Dissolve | ( | CSG_Shape * | pShape,
 |  | CSG_Shape * | pSolution
 | ) |  |

Assuming supplied shape object is of type polygon and has several parts, it is important that the point order of outer rings (i.e. not lakes) is clockwise, that of lakes counter-clockwise to be processed correctly by the Clipper dissolve function. This is in accordance with the simple features definition but in contrast to ESRI's Shapefile format.

Definition at line 390 of file shapes_clipper.cpp.

◆ SG_Shape_Get_ExclusiveOr()

bool SG_Shape_Get_ExclusiveOr | ( | CSG_Shape * | pShape,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution
 | ) |  |

Definition at line 331 of file shapes_clipper.cpp.

References CSG_Shape::Add_Part(), CSG_Shape::Assign(), CSG_Shape_Points::Get_Part(), CSG_Shape_Points::Get_Part_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Intersection()

bool SG_Shape_Get_Intersection | ( | CSG_Shape * | pShape,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution
 | ) |  |

Definition at line 293 of file shapes_clipper.cpp.

References CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Offset()

bool SG_Shape_Get_Offset | ( | CSG_Shape * | pShape,
 |  | double | Size,
 |  | double | dArc,
 |  | CSG_Shape * | pSolution
 | ) |  |

Definition at line 396 of file shapes_clipper.cpp.

◆ SG_Shape_Get_Union()

bool SG_Shape_Get_Union | ( | CSG_Shape * | pShape,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pSolution
 | ) |  |

Definition at line 355 of file shapes_clipper.cpp.

References CSG_Shape::Add_Part(), CSG_Shape::Assign(), CSG_Shape_Points::Get_Part(), CSG_Shape_Points::Get_Part_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes_clipper.cpp Source File

  • saga_core
  • saga_api
shapes_clipper.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_clipper.cpp //
15 // //
16 // Copyright (C) 2022 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // e-mail: oconrad@saga-gis.de //
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Germany //
48 // //
50
51 //---------------------------------------------------------
52 #include "shapes.h"
53
54 #include "clipper2/clipper.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 class CSG_Clipper
65 {
66 public:
67
68 CSG_Clipper(void) {}
69
70 //-----------------------------------------------------
71 static bool to_Paths (const CSG_Shapes *pShapes, Clipper2Lib::PathsD &Paths)
72 {
73 if( !pShapes )
74 {
75 return( false );
76 }
77
78 Paths.clear();
79
80 for(sLong iShape=0, iPath=0; iShape<pShapes->Get_Count(); iShape++)
81 {
82 CSG_Shape &Shape = *pShapes->Get_Shape(iShape);
83
84 for(int iPart=0; iPart<Shape.Get_Part_Count(); iPart++, iPath++)
85 {
86 bool bAscending = Shape.Get_Type() != SHAPE_TYPE_Polygon
87 || (Shape.asPolygon()->is_Lake (iPart)
88 == Shape.asPolygon()->is_Clockwise(iPart));
89
90 Paths.resize(1 + iPath);
91 Paths[iPath].resize(Shape.Get_Point_Count(iPart));
92
93 for(int iPoint=0; iPoint<Shape.Get_Point_Count(iPart); iPoint++)
94 {
95 TSG_Point p = Shape.Get_Point(iPoint, iPart, bAscending);
96
97 Paths[iPath][iPoint].x = p.x;
98 Paths[iPath][iPoint].y = p.y;
99 }
100 }
101 }
102
103 return( Paths.size() > 0 );
104 }
105
106 //-----------------------------------------------------
107 static bool to_Shape (const Clipper2Lib::PathsD &Paths, CSG_Shapes *pShapes)
108 {
109 return( pShapes && pShapes->Del_Shapes() && to_Shape(Paths, pShapes->Add_Shape()) );
110 }
111
112 //-----------------------------------------------------
113 static bool to_Paths (const CSG_Shape *pShape, Clipper2Lib::PathsD &Paths, bool bCheckOrientation = true)
114 {
115 if( !pShape )
116 {
117 return( false );
118 }
119
120 Paths.clear();
121
122 for(int iPart=0, iPath=0; iPart<pShape->Get_Part_Count(); iPart++, iPath++)
123 {
124 if( pShape->Get_Point_Count(iPart) > 0 )
125 {
126 bool bAscending = !bCheckOrientation || pShape->Get_Type() != SHAPE_TYPE_Polygon
127 || (pShape->asPolygon()->is_Lake (iPart)
128 == pShape->asPolygon()->is_Clockwise(iPart));
129
130 Paths.resize(1 + iPath);
131
132 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
133 {
134 TSG_Point p = pShape->Get_Point(iPoint, iPart, bAscending);
135
136 Clipper2Lib::PointD Point(p.x, p.y);
137
138 if( iPoint == 0 || Paths[iPath].back() != Point ) // don't add duplicates !!!
139 {
140 Paths[iPath].push_back(Point);
141 }
142 }
143
144 if( pShape->Get_Type() == SHAPE_TYPE_Polygon && Paths[iPath].size() > 1 && Paths[iPath][0] == Paths[iPath].back() )
145 {
146 Paths[iPath].pop_back();
147 }
148 }
149 }
150
151 return( Paths.size() > 0 );
152 }
153
154 //-----------------------------------------------------
155 static bool to_Shape (const Clipper2Lib::PathsD &Paths, CSG_Shape *pShape)
156 {
157 if( !pShape )
158 {
159 return( false );
160 }
161
162 pShape->Del_Parts();
163
164 for(size_t iPath=0; iPath<Paths.size(); iPath++)
165 {
166 for(size_t iPoint=0; iPoint<Paths[iPath].size(); iPoint++)
167 {
168 pShape->Add_Point(Paths[iPath][iPoint].x, Paths[iPath][iPoint].y, (int)iPath);
169 }
170 }
171
172 return( pShape->is_Valid() );
173 }
174
175 //-----------------------------------------------------
176 static bool Clip (Clipper2Lib::ClipType ClipType, CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
177 {
178 Clipper2Lib::PathsD Subject, Clip, Solution;
179
180 if( to_Paths(pSubject, Subject)
181 && to_Paths(pClip , Clip ) )
182 {
183 Clipper2Lib::ClipperD Clipper(m_Precision);
184
185 Clipper.AddClip(Clip);
186
187 if( pSubject->Get_Type() == SHAPE_TYPE_Polygon )
188 {
189 Clipper.AddSubject(Subject);
190
191 if( !Clipper.Execute(ClipType, Clipper2Lib::FillRule::NonZero, Solution) )
192 {
193 return( false );
194 }
195 }
196 else
197 {
198 Clipper.AddOpenSubject(Subject);
199
200 if( !Clipper.Execute(ClipType, Clipper2Lib::FillRule::NonZero, Solution) )
201 {
202 return( false );
203 }
204 }
205
206 return( to_Shape(Solution, pSolution ? pSolution : pSubject) );
207 }
208
209 return( false );
210 }
211
212 //-----------------------------------------------------
213 static bool Dissolve (CSG_Shape *pShape, CSG_Shape *pSolution)
214 {
215 Clipper2Lib::PathsD Subject, Solution;
216
217 if( to_Paths(pShape, Subject, false) )
218 {
219 Clipper2Lib::ClipperD Clipper(m_Precision);
220
221 Clipper.AddSubject(Subject);
222
223 if( Clipper.Execute(Clipper2Lib::ClipType::Union, Clipper2Lib::FillRule::NonZero, Solution) )
224 {
225 return( to_Shape(Solution, pSolution ? pSolution : pShape) );
226 }
227 }
228
229 return( false );
230 }
231
232 //-----------------------------------------------------
233 static bool Offset (CSG_Shape *pShape, double Delta, double dArc, CSG_Shape *pSolution)
234 {
235 Clipper2Lib::PathsD Paths, Solution;
236
237 if( to_Paths(pShape, Paths) )
238 {
239 Clipper2Lib::EndType EndType;
240
241 if( pShape->Get_Type() != SHAPE_TYPE_Polygon )
242 {
243 Delta *= 2.;
244
245 EndType = Clipper2Lib::EndType::Round;
246 }
247 else
248 {
249 EndType = Clipper2Lib::EndType::Polygon;
250 }
251
252 double ArcTolerance = std::pow(10., m_Precision) * Delta * (1. - cos(dArc / 2.));
253
254 Solution = Clipper2Lib::InflatePaths(Paths, Delta, Clipper2Lib::JoinType::Round, EndType, 2., m_Precision, ArcTolerance);
255
256 return( to_Shape(Solution, pSolution ? pSolution : pShape) );
257 }
258
259 return( false );
260 }
261
262 //-----------------------------------------------------
263 static int Get_Precision (void) { return( m_Precision ); }
264
265 static bool Set_Precision (int Precision)
266 {
267 if( Precision < -8 || Precision > 8 )
268 {
269 return( false );
270 }
271
272 m_Precision = Precision;
273
274 return( true );
275 }
276
277 private:
278
279 static int m_Precision;
280 };
281
282 //---------------------------------------------------------
283 int CSG_Clipper::m_Precision = 4;
284
285
287 // //
288 // //
289 // //
291
292 //---------------------------------------------------------
293 bool SG_Shape_Get_Intersection (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
294 {
295 switch( pClip->Intersects(pShape) )
296 {
297 case INTERSECTION_None :
298 return( false );
299
300 case INTERSECTION_Identical:
301 case INTERSECTION_Contains :
302 return( !pSolution || pSolution->Assign(pShape, false) );
303
304 case INTERSECTION_Contained:
305 return( !pSolution ? pShape->Assign(pClip, false) : pSolution->Assign(pClip, false) );
306
307 case INTERSECTION_Overlaps : default:
308 return( CSG_Clipper::Clip(Clipper2Lib::ClipType::Intersection, pShape, pClip, pSolution) );
309 }
310 }
311
312 //---------------------------------------------------------
313 bool SG_Shape_Get_Difference (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
314 {
315 switch( pClip->Intersects(pShape) )
316 {
317 case INTERSECTION_None :
318 return( !pSolution || pSolution->Assign(pShape, false) );
319
320 case INTERSECTION_Identical:
321 case INTERSECTION_Contains :
322 return( false );
323
324 case INTERSECTION_Contained:
325 case INTERSECTION_Overlaps : default:
326 return( CSG_Clipper::Clip(Clipper2Lib::ClipType::Difference, pShape, pClip, pSolution) );
327 }
328 }
329
330 //---------------------------------------------------------
331 bool SG_Shape_Get_ExclusiveOr (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
332 {
333 switch( pClip->Intersects(pShape) )
334 {
335 case INTERSECTION_None :
336 if( pSolution ) { pSolution->Assign(pShape, false); } else { pSolution = pShape; }
337
338 for(int iPart=0; iPart<pClip->Get_Part_Count(); iPart++)
339 {
340 pSolution->Add_Part(pClip->Get_Part(iPart));
341 }
342 return( true );
343
344 case INTERSECTION_Identical:
345 return( false );
346
347 case INTERSECTION_Contains :
348 case INTERSECTION_Contained:
349 case INTERSECTION_Overlaps : default:
350 return( CSG_Clipper::Clip(Clipper2Lib::ClipType::Xor, pShape, pClip, pSolution) );
351 }
352 }
353
354 //---------------------------------------------------------
355 bool SG_Shape_Get_Union (CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
356 {
357 switch( pClip->Intersects(pShape) )
358 {
359 case INTERSECTION_None :
360 if( pSolution ) { pSolution->Assign(pShape, false); } else { pSolution = pShape; }
361
362 for(int iPart=0; iPart<pClip->Get_Part_Count(); iPart++)
363 {
364 pSolution->Add_Part(pClip->Get_Part(iPart));
365 }
366 return( true );
367
368 case INTERSECTION_Identical:
369 case INTERSECTION_Contained:
370 return( !pSolution || pSolution->Assign(pShape, false) );
371
372 case INTERSECTION_Contains :
373 return( !pSolution ? pShape->Assign(pClip, false) : pSolution->Assign(pClip, false) );
374
375 case INTERSECTION_Overlaps: default:
376 return( CSG_Clipper::Clip(Clipper2Lib::ClipType::Union, pShape, pClip, pSolution) );
377 }
378 }
379
380 //---------------------------------------------------------
389 //---------------------------------------------------------
390 bool SG_Shape_Get_Dissolve (CSG_Shape *pShape, CSG_Shape *pSolution)
391 {
392 return( CSG_Clipper::Dissolve(pShape, pSolution) );
393 }
394
395 //---------------------------------------------------------
396 bool SG_Shape_Get_Offset (CSG_Shape *pShape, double Size, double dArc, CSG_Shape *pSolution)
397 {
398 return( CSG_Clipper::Offset(pShape, Size, dArc, pSolution) );
399 }
400
401
403 // //
405
406 //---------------------------------------------------------
407 const char * SG_Clipper_Get_Version (void)
408 {
409 static CSG_String Version(CSG_String("Clipper2 ") + CLIPPER2_VERSION);
410
411 return( Version );
412 }
413
414
416 // //
417 // //
418 // //
420
421 //---------------------------------------------------------
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Shape_Polygon::is_Clockwise
bool is_Clockwise(int iPart)
Definition: shape_polygon.cpp:871
CSG_Shape::Del_Parts
virtual int Del_Parts(void)
Definition: shapes.h:171
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
SG_Shape_Get_Dissolve
bool SG_Shape_Get_Dissolve(CSG_Shape *pShape, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:390
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shape::Add_Part
virtual int Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false)
Definition: shapes.h:168
SSG_Point
Definition: geo_tools.h:128
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
SG_Shape_Get_Offset
bool SG_Shape_Get_Offset(CSG_Shape *pShape, double Size, double dArc, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:396
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shapes::Del_Shapes
virtual bool Del_Shapes(void)
Definition: shapes.h:822
SG_Shape_Get_Union
bool SG_Shape_Get_Union(CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:355
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
sLong
signed long long sLong
Definition: api_core.h:158
SG_Clipper_Get_Version
const char * SG_Clipper_Get_Version(void)
Definition: shapes_clipper.cpp:407
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_Shape_Get_ExclusiveOr
bool SG_Shape_Get_ExclusiveOr(CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:331
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shape::is_Valid
virtual bool is_Valid(void) const =0
SG_Shape_Get_Difference
bool SG_Shape_Get_Difference(CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:313
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
shapes.h
CSG_String
Definition: api_core.h:557
CSG_Shape_Points::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:499
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Polygon::is_Lake
bool is_Lake(int iPart)
Definition: shape_polygon.cpp:811
CSG_Shapes
Definition: shapes.h:773
CSG_Shape::asPolygon
class CSG_Shape_Polygon * asPolygon(void) const
Definition: shapes.h:161
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Shape_Polygon
Definition: shapes.h:699
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
SG_Shape_Get_Intersection
bool SG_Shape_Get_Intersection(CSG_Shape *pShape, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution)
Definition: shapes_clipper.cpp:293
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes_io.cpp File Reference

  • saga_core
  • saga_api
Macros
shapes_io.cpp File Reference
#include "shapes.h"
#include "table_dbase.h"
#include "tool_library.h"
#include "data_manager.h"

Go to the source code of this file.

Macros

#define Set_Content_Length(n)

Macro Definition Documentation

◆ Set_Content_Length

#define Set_Content_Length ( n )
Value:
Record_Header.Set_Value(4, (int)(n), true);\
fSHP.Write(Record_Header.Get_Data(), sizeof(int), 2);\
fSHX.Write_Int(fSHP_Size, true);\
fSHX.Write_Int((n) , true);\
fSHP_Size += 4 + (n);\
fSHX_Size += 4;

Definition at line 484 of file shapes_io.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes_io.cpp Source File

  • saga_core
  • saga_api
shapes_io.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_io.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54 #include "table_dbase.h"
55 #include "tool_library.h"
56 #include "data_manager.h"
57
58
60 // //
61 // //
62 // //
64
65 //---------------------------------------------------------
66 bool CSG_Shapes::On_Reload(void)
67 {
68 return( Create(Get_File_Name(false)) );
69 }
70
71 //---------------------------------------------------------
72 bool CSG_Shapes::On_Delete(void)
73 {
74 CSG_String File_Name = Get_File_Name(true);
75
76 SG_File_Delete(File_Name);
77
78 SG_File_Set_Extension(File_Name, "shp"); SG_File_Delete(File_Name); // shapes
79 SG_File_Set_Extension(File_Name, "shx"); SG_File_Delete(File_Name); // shape index
80 SG_File_Set_Extension(File_Name, "dbf"); SG_File_Delete(File_Name); // attributes
81 SG_File_Set_Extension(File_Name, "prj"); SG_File_Delete(File_Name); // projection
82 SG_File_Set_Extension(File_Name, "sbn"); SG_File_Delete(File_Name); // spatial index
83 SG_File_Set_Extension(File_Name, "sbx"); SG_File_Delete(File_Name); // spatial index
84 SG_File_Set_Extension(File_Name, "atx"); SG_File_Delete(File_Name); // attribute index
85 SG_File_Set_Extension(File_Name, "xml"); SG_File_Delete(File_Name); // metadata
86 SG_File_Set_Extension(File_Name, "cpg"); SG_File_Delete(File_Name); // code page
87 SG_File_Set_Extension(File_Name, "qix"); SG_File_Delete(File_Name); // quadtree spatial index
88
89 return( true );
90 }
91
92
94 // //
95 // //
96 // //
98
99 //---------------------------------------------------------
100 bool CSG_Shapes::_Load_GDAL(const CSG_String &File_Name)
101 {
102 CSG_Data_Manager Data;
103
104 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_gdal", 3); // Import Shapes
105
106 if( pTool )
107 {
108 if( pTool->Settings_Push(&Data) && pTool->Set_Parameter("FILES", File_Name, PARAMETER_TYPE_FilePath) )
109 {
110 SG_UI_Msg_Lock(true);
111 pTool->Execute();
112 SG_UI_Msg_Lock(false);
113 }
114
115 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
116 }
117
118 //-----------------------------------------------------
119 CSG_Shapes *pShapes = Data.Get_Shapes()->Count() ? Data.Get_Shapes()->Get(0)->asShapes() : NULL;
120
121 if( !pShapes || !Create(*pShapes) )
122 {
123 return( false );
124 }
125
126 Get_MetaData () = pShapes->Get_MetaData ();
127 Get_Projection() = pShapes->Get_Projection();
128
129 //-----------------------------------------------------
130 if( SG_File_Cmp_Extension(File_Name, "gpkg" )
131 || SG_File_Cmp_Extension(File_Name, "GeoJSON") )
132 {
133 Set_File_Name(File_Name, true);
134 }
135 else
136 {
137 Set_File_Name(File_Name, false);
138 }
139
140 return( true );
141 }
142
143 //---------------------------------------------------------
144 bool CSG_Shapes::_Save_GDAL(const CSG_String &File_Name, const CSG_String &Driver)
145 {
146 bool bResult;
147
148 SG_RUN_TOOL(bResult, "io_gdal", 4, // Export Shapes
149 SG_TOOL_PARAMETER_SET("SHAPES", this)
150 && SG_TOOL_PARAMETER_SET("FORMAT", Driver)
151 && SG_TOOL_PARAMETER_SET("FILE" , File_Name)
152 );
153
154 return( bResult );
155 }
156
157
159 // //
160 // //
161 // //
163
164 //---------------------------------------------------------
165 bool CSG_Shapes::_Load_ESRI(const CSG_String &File_Name)
166 {
167 int Type, iField, iPart, nParts, *Parts, iPoint, nPoints, iOffset;
168 double *pZ = NULL, *pM = NULL;
169 TSG_Point *pPoint;
170 CSG_Buffer File_Header(100), Record_Header(8), Content;
171 CSG_File fSHP;
172
173 //-----------------------------------------------------
174 // Open DBase File...
175
176 m_Encoding = SG_FILE_ENCODING_ANSI;
177
178 if( fSHP.Open(SG_File_Make_Path("", File_Name, "cpg")) )
179 {
180 CSG_String sLine;
181
182 if( fSHP.Read_Line(sLine) && sLine.Find("UTF-8") >= 0 )
183 {
184 m_Encoding = SG_FILE_ENCODING_UTF8;
185 }
186
187 fSHP.Close();
188 }
189
190 CSG_Table_DBase fDBF(m_Encoding);
191
192 if( !fDBF.Open_Read(SG_File_Make_Path("", File_Name, "dbf"), this, false) )
193 {
194 SG_UI_Msg_Add_Error(_TL("DBase file could not be opened."));
195
196 return( false );
197 }
198
199 fDBF.Move_First();
200
201 if( fDBF.Get_Field_Count() < 1 )
202 {
203 SG_UI_Msg_Add_Error(_TL("DBase file does not contain any attribute fields."));
204
205 return( false );
206 }
207
208 //-----------------------------------------------------
209 // Open Shapes File...
210
211 if( !fSHP.Open(SG_File_Make_Path("", File_Name, "shp"), SG_FILE_R, true) )
212 {
213 SG_UI_Msg_Add_Error(_TL("Shape file could not be opened."));
214
215 return( false );
216 }
217
218 //-----------------------------------------------------
219 // Read File Header (100 Bytes)...
220
221 if( fSHP.Read(File_Header.Get_Data(), sizeof(char), 100) != 100 )
222 {
223 SG_UI_Msg_Add_Error(_TL("corrupted file header"));
224
225 return( false );
226 }
227
228 if( File_Header.asInt( 0, true) != 9994 ) // Byte 00 -> File Code 9994 (Integer Big)...
229 {
230 SG_UI_Msg_Add_Error(_TL("invalid file code"));
231
232 return( false );
233 }
234
235 if( File_Header.asInt(28, false) != 1000 ) // Byte 28 -> Version 1000 (Integer Little)...
236 {
237 SG_UI_Msg_Add_Error(_TL("unsupported file version"));
238
239 return( false );
240 }
241
242 switch( Type = File_Header.asInt(32) ) // Byte 32 -> Shape Type (Integer Little)...
243 {
244 case 1: m_Type = SHAPE_TYPE_Point; m_Vertex_Type = SG_VERTEX_TYPE_XY; break; // Point
245 case 8: m_Type = SHAPE_TYPE_Points; m_Vertex_Type = SG_VERTEX_TYPE_XY; break; // MultiPoint
246 case 3: m_Type = SHAPE_TYPE_Line; m_Vertex_Type = SG_VERTEX_TYPE_XY; break; // PolyLine
247 case 5: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XY; break; // Polygon
248
249 case 11: m_Type = SHAPE_TYPE_Point; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PointZ
250 case 18: m_Type = SHAPE_TYPE_Points; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // MultiPointZ
251 case 13: m_Type = SHAPE_TYPE_Line; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PolyLineZ
252 case 15: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XYZM; break; // PolygonZ
253
254 case 21: m_Type = SHAPE_TYPE_Point; m_Vertex_Type = SG_VERTEX_TYPE_XYZ; break; // PointM
255 case 28: m_Type = SHAPE_TYPE_Points; m_Vertex_Type = SG_VERTEX_TYPE_XYZ; break; // MultiPointM
256 case 23: m_Type = SHAPE_TYPE_Line; m_Vertex_Type = SG_VERTEX_TYPE_XYZ; break; // PolyLineM
257 case 25: m_Type = SHAPE_TYPE_Polygon; m_Vertex_Type = SG_VERTEX_TYPE_XYZ; break; // PolygonM
258
259 default: // unsupported...
260 case 31: // unsupported: MultiPatch...
261 SG_UI_Msg_Add_Error(_TL("unsupported shape type."));
262
263 return( false );
264 }
265
266 //-----------------------------------------------------
267 // Load Shapes...
268
269 for(int iShape=0; iShape<fDBF.Get_Count() && SG_UI_Process_Set_Progress(iShape, fDBF.Get_Count()); iShape++)
270 {
271 if( fSHP.Read(Record_Header.Get_Data(0), sizeof(int), 2) != 2 ) // read record header
272 {
273 SG_UI_Msg_Add_Error(_TL("corrupted record header"));
274
275 return( false );
276 }
277
278 if( Record_Header.asInt(0, true) != iShape + 1 ) // record number
279 {
280 SG_UI_Msg_Add_Error(CSG_String::Format("%s (%d != %d)", _TL("corrupted shapefile."), Record_Header.asInt(0, true), iShape + 1));
281
282 return( false );
283 }
284
285 size_t Length = 2 * Record_Header.asInt(4, true); // content length as 16-bit words !!!
286
287 if( !Content.Set_Size(Length, false) )
288 {
289 SG_UI_Msg_Add_Error(_TL("memory allocation error."));
290
291 return( false );
292 }
293
294 if( fSHP.Read(Content.Get_Data(), sizeof(char), Length) != Length )
295 {
296 SG_UI_Msg_Add_Error(_TL("corrupted shapefile."));
297
298 return( false );
299 }
300
301 if( fDBF.isDeleted() )
302 {
303 continue; // nop
304 }
305
306 if( Content.asInt(0) != Type )
307 {
308 if( Content.asInt(0) == 0 )
309 {
310 // null shape is allowed !!!
311 }
312 else
313 {
314 SG_UI_Msg_Add_Error(_TL("corrupted shapefile."));
315
316 return( false );
317 }
318 }
319
320 //-------------------------------------------------
321 else
322 {
323 CSG_Shape *pShape = Add_Shape();
324
325 switch( m_Type )
326 {
327 default: break;
328
329 //---------------------------------------------
330 case SHAPE_TYPE_Point:
331
332 pPoint = (TSG_Point *)Content.Get_Data(4);
333
334 pShape->Add_Point(pPoint->x, pPoint->y);
335
336 switch( m_Vertex_Type ) // read Z + M
337 {
338 default: break;
339 case SG_VERTEX_TYPE_XYZM: pShape->Set_M(Content.asDouble(28), 0);
340 case SG_VERTEX_TYPE_XYZ : pShape->Set_Z(Content.asDouble(20), 0);
341 }
342
343 break;
344
345 //---------------------------------------------
346 case SHAPE_TYPE_Points:
347
348 nPoints = Content.asInt(36);
349 pPoint = (TSG_Point *)Content.Get_Data(40);
350
351 switch( m_Vertex_Type ) // read Z + M
352 {
353 default:
354 break;
355
356 case SG_VERTEX_TYPE_XYZ:
357 pZ = 56 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(56 + nPoints * 16) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8]
358 break;
359
360 case SG_VERTEX_TYPE_XYZM:
361 pZ = 56 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(56 + nPoints * 16) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8]
362 pM = 72 + nPoints * 32 <= (int)Length ? (double *)Content.Get_Data(72 + nPoints * 24) : NULL; // [40 + nPoints * 16 + 2 * 8] + [nPoints * 8 + 2 * 8] + [nPoints * 8]
363 break;
364 }
365
366 //-----------------------------------------
367 for(iPoint=0; iPoint<nPoints; iPoint++, pPoint++)
368 {
369 pShape->Add_Point(pPoint->x, pPoint->y);
370
371 if( pZ ) { pShape->Set_Z(*(pZ++), iPoint); }
372 if( pM ) { pShape->Set_M(*(pM++), iPoint); }
373 }
374
375 break;
376
377 //---------------------------------------------
378 case SHAPE_TYPE_Line :
379 case SHAPE_TYPE_Polygon:
380
381 nParts = Content.asInt(36);
382 nPoints = Content.asInt(40);
383 Parts = (int *)Content.Get_Data(44);
384 pPoint = (TSG_Point *)Content.Get_Data(44 + 4 * nParts);
385
386 switch( m_Vertex_Type ) // read Z + M
387 {
388 default:
389 break;
390
391 case SG_VERTEX_TYPE_XYZ:
392 pZ = 60 + nParts * 4 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(60 + nParts * 4 + nPoints * 16) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8]
393 break;
394
395 case SG_VERTEX_TYPE_XYZM:
396 pZ = 60 + nParts * 4 + nPoints * 24 <= (int)Length ? (double *)Content.Get_Data(60 + nParts * 4 + nPoints * 16) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8]
397 pM = 76 + nParts * 4 + nPoints * 32 <= (int)Length ? (double *)Content.Get_Data(76 + nParts * 4 + nPoints * 24) : NULL; // [44 + nParts * 4 + nPoints * 16 + 2 * 8] + [nPoints * 8 + 2 * 8] + [nPoints * 8]
398 break;
399 }
400
401 //-----------------------------------------
402 iOffset = 0;
403
404 for(iPoint=0, iPart=0; iPoint<nPoints; iPoint++, pPoint++)
405 {
406 if( iPart < nParts - 1 && iPoint >= Parts[iPart + 1] )
407 {
408 iPart++;
409 iOffset = 0;
410 }
411
412 pShape->Add_Point(pPoint->x, pPoint->y, iPart);
413
414 if( pZ ) { pShape->Set_Z(*(pZ++), iOffset, iPart); }
415 if( pM ) { pShape->Set_M(*(pM++), iOffset, iPart); }
416
417 iOffset++;
418 }
419
420 break;
421 }
422
423 //---------------------------------------------
424 for(iField=0; iField<Get_Field_Count(); iField++)
425 {
426 switch( fDBF.Get_Field_Type(iField) )
427 {
428 default:
429 pShape->Set_Value(iField, fDBF.asString(iField));
430 break;
431
432 case DBF_FT_FLOAT:
433 case DBF_FT_NUMERIC:
434 {
435 double Value;
436
437 if( fDBF.asDouble(iField, Value) )
438 {
439 pShape->Set_Value(iField, Value);
440 }
441 else
442 {
443 pShape->Set_NoData(iField);
444 }
445 }
446 break;
447 }
448 }
449 }
450
451 fDBF.Move_Next();
452 }
453
454 //-----------------------------------------------------
455 Get_Projection().Load(SG_File_Make_Path("", File_Name, "prj"), SG_PROJ_FMT_WKT);
456
457 //-----------------------------------------------------
458 Load_MetaData(File_Name);
459
460 CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
461
462 if( pFields && pFields->Get_Children_Count() == Get_Field_Count() )
463 {
464 for(iField=0; iField<Get_Field_Count(); iField++)
465 {
466 Set_Field_Name(iField, pFields->Get_Content(iField));
467 }
468 }
469
470 Set_File_Name(File_Name, true);
471
472 //-----------------------------------------------------
473 return( true );
474 }
475
476
478 // //
479 // //
480 // //
482
483 //---------------------------------------------------------
484 #define Set_Content_Length(n) Record_Header.Set_Value(4, (int)(n), true);\
485 fSHP.Write(Record_Header.Get_Data(), sizeof(int), 2);\
486 fSHX.Write_Int(fSHP_Size, true);\
487 fSHX.Write_Int((n) , true);\
488 fSHP_Size += 4 + (n);\
489 fSHX_Size += 4;
490
491 //---------------------------------------------------------
492 bool CSG_Shapes::_Save_ESRI(const CSG_String &File_Name)
493 {
494 int Type, fSHP_Size, fSHX_Size, iField, iPart, iPoint, nPoints;
495 TSG_Point Point;
496 CSG_Buffer File_Header(100), Record_Header(8), Content;
497 CSG_File fSHP, fSHX;
498
499 //-----------------------------------------------------
500 // Determine Shape Type...
501
502 switch( m_Type )
503 {
504 case SHAPE_TYPE_Point : Type = 1; break;
505 case SHAPE_TYPE_Points : Type = 8; break;
506 case SHAPE_TYPE_Line : Type = 3; break;
507 case SHAPE_TYPE_Polygon : Type = 5; break;
508 default: return( false );
509 }
510
511 TSG_Vertex_Type Vertex_Type = m_Vertex_Type == 0 ? SG_VERTEX_TYPE_XY : SG_VERTEX_TYPE_XYZM;
512
513 switch( Vertex_Type )
514 {
515 case SG_VERTEX_TYPE_XY : break;
516 case SG_VERTEX_TYPE_XYZ : Type += 20; break; // M
517 case SG_VERTEX_TYPE_XYZM: Type += 10; break; // Z (+M)
518 default: return( false );
519 }
520
521 //-----------------------------------------------------
522 // DBase File Access...
523
524 SG_File_Delete(SG_File_Make_Path("", File_Name, "cpg"));
525
526 if( m_Encoding == SG_FILE_ENCODING_UTF8 )
527 {
528 if( fSHP.Open(SG_File_Make_Path("", File_Name, "cpg"), SG_FILE_W, false) )
529 {
530 fSHP.Printf("UTF-8\n");
531
532 fSHP.Close();
533 }
534 }
535
536 CSG_Table_DBase fDBF(m_Encoding);
537
538 if( !fDBF.Open_Write(SG_File_Make_Path("", File_Name, "dbf"), this, false) )
539 {
540 return( false );
541 }
542
543 //-----------------------------------------------------
544 // Shape File Access...
545
546 if( !fSHX.Open(SG_File_Make_Path("", File_Name, "shx"), SG_FILE_W, true) )
547 {
548 SG_UI_Msg_Add_Error(_TL("index file could not be opened"));
549
550 return( false );
551 }
552
553 if( !fSHP.Open(SG_File_Make_Path("", File_Name, "shp"), SG_FILE_W, true) )
554 {
555 SG_UI_Msg_Add_Error(_TL("shape file could not be opened."));
556
557 return( false );
558 }
559
560 //-----------------------------------------------------
561 // Save Header...
562
563 Make_Clean(); // polygons: first == last point, inner rings > anti-clockwise...
564
565 Update();
566
567 File_Header.Set_Value( 0, 9994 , true ); // Byte 0 Integer Big File Code = 9994
568 File_Header.Set_Value( 4, 0 , true ); // Byte 4 Integer Big unused
569 File_Header.Set_Value( 8, 0 , true ); // Byte 8 Integer Big unused
570 File_Header.Set_Value(12, 0 , true ); // Byte 12 Integer Big unused
571 File_Header.Set_Value(16, 0 , true ); // Byte 16 Integer Big unused
572 File_Header.Set_Value(20, 0 , true ); // Byte 20 Integer Big unused
573 File_Header.Set_Value(24, 0 , true ); // Byte 24 Integer Big File Length
574 File_Header.Set_Value(28, 1000 , false); // Byte 28 Integer Little Version = 1000
575 File_Header.Set_Value(32, Type , false); // Byte 32 Integer Little Shape Type
576 File_Header.Set_Value(36, m_Extent.Get_XMin() , false); // Byte 36 Double Little Bounding Box Xmin
577 File_Header.Set_Value(44, m_Extent.Get_YMin() , false); // Byte 44 Double Little Bounding Box Ymin
578 File_Header.Set_Value(52, m_Extent.Get_XMax() , false); // Byte 52 Double Little Bounding Box Xmax
579 File_Header.Set_Value(60, m_Extent.Get_YMax() , false); // Byte 60 Double Little Bounding Box Ymax
580 File_Header.Set_Value(68, Get_ZMin() , false); // Byte 68 Double Little Bounding Box Zmin
581 File_Header.Set_Value(76, Get_ZMax() , false); // Byte 76 Double Little Bounding Box Zmax
582 File_Header.Set_Value(84, Get_MMin() , false); // Byte 84 Double Little Bounding Box Mmin
583 File_Header.Set_Value(92, Get_MMax() , false); // Byte 92 Double Little Bounding Box Mmax
584
585 fSHP.Write(File_Header.Get_Data(), sizeof(char), 100);
586 fSHX.Write(File_Header.Get_Data(), sizeof(char), 100);
587
588 fSHP_Size = 50; // file size measured in 16-bit words...
589 fSHX_Size = 50; // file size measured in 16-bit words...
590
591 //-----------------------------------------------------
592 // Save Shapes...
593
594 for(sLong iShape=0; iShape<Get_Count() && SG_UI_Process_Set_Progress(iShape, Get_Count()); iShape++)
595 {
596 CSG_Shape *pShape = Get_Shape(iShape);
597
598 //-------------------------------------------------
599 // geometries...
600
601 Record_Header.Set_Value(0, (int)iShape + 1, true); // record number
602
603 for(iPart=0, nPoints=0; iPart<pShape->Get_Part_Count(); iPart++)
604 {
605 nPoints += pShape->Get_Point_Count(iPart); // total number of points in shape
606 }
607
608 //-------------------------------------------------
609 switch( m_Type ) // write content header
610 {
611 default: break;
612
613 //-------------------------------------------------
614 case SHAPE_TYPE_Point:
615
616 switch( Vertex_Type )
617 {
618 case SG_VERTEX_TYPE_XY : Set_Content_Length(10); break;
619 case SG_VERTEX_TYPE_XYZ : Set_Content_Length(14); break;
620 case SG_VERTEX_TYPE_XYZM: Set_Content_Length(18); break;
621 }
622
623 fSHP.Write_Int (Type);
624
625 break;
626
627 //-------------------------------------------------
628 case SHAPE_TYPE_Points:
629
630 switch( Vertex_Type )
631 {
632 case SG_VERTEX_TYPE_XY : Set_Content_Length(20 + 8 * nPoints); break;
633 case SG_VERTEX_TYPE_XYZ : Set_Content_Length(28 + 12 * nPoints); break;
634 case SG_VERTEX_TYPE_XYZM: Set_Content_Length(36 + 16 * nPoints); break;
635 }
636
637 fSHP.Write_Int (Type);
638 fSHP.Write_Double (pShape->Get_Extent().Get_XMin());
639 fSHP.Write_Double (pShape->Get_Extent().Get_YMin());
640 fSHP.Write_Double (pShape->Get_Extent().Get_XMax());
641 fSHP.Write_Double (pShape->Get_Extent().Get_YMax());
642 fSHP.Write_Int (nPoints);
643
644 break;
645
646 //-------------------------------------------------
647 case SHAPE_TYPE_Line:
648 case SHAPE_TYPE_Polygon:
649
650 switch( Vertex_Type )
651 {
652 case SG_VERTEX_TYPE_XY: Set_Content_Length(22 + 2 * pShape->Get_Part_Count() + 8 * nPoints); break;
653 case SG_VERTEX_TYPE_XYZ: Set_Content_Length(30 + 2 * pShape->Get_Part_Count() + 12 * nPoints); break;
654 case SG_VERTEX_TYPE_XYZM: Set_Content_Length(38 + 2 * pShape->Get_Part_Count() + 16 * nPoints); break;
655 }
656
657 fSHP.Write_Int (Type);
658 fSHP.Write_Double (pShape->Get_Extent().Get_XMin());
659 fSHP.Write_Double (pShape->Get_Extent().Get_YMin());
660 fSHP.Write_Double (pShape->Get_Extent().Get_XMax());
661 fSHP.Write_Double (pShape->Get_Extent().Get_YMax());
662 fSHP.Write_Int (pShape->Get_Part_Count());
663 fSHP.Write_Int (nPoints);
664
665 for(iPart=0, iPoint=0; iPart<pShape->Get_Part_Count(); iPoint+=pShape->Get_Point_Count(iPart++))
666 {
667 fSHP.Write_Int(iPoint);
668 }
669
670 break;
671 }
672
673 //-------------------------------------------------
674 switch( m_Type ) // write point data
675 {
676 default: break;
677
678 //-------------------------------------------------
679 case SHAPE_TYPE_Point:
680
681 fSHP.Write(&(Point = pShape->Get_Point()), sizeof(TSG_Point));
682
683 //---------------------------------------------
684 if( Vertex_Type != SG_VERTEX_TYPE_XY )
685 {
686 fSHP.Write_Double(pShape->Get_Z(0));
687
688 if( Vertex_Type == SG_VERTEX_TYPE_XYZM )
689 {
690 fSHP.Write_Double(pShape->Get_M(0));
691 }
692 }
693
694 break;
695
696 //-------------------------------------------------
697 case SHAPE_TYPE_Points:
698 case SHAPE_TYPE_Line:
699 case SHAPE_TYPE_Polygon:
700
701 for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
702 {
703 for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
704 {
705 fSHP.Write(&(Point = pShape->Get_Point(iPoint, iPart)), sizeof(TSG_Point));
706 }
707 }
708
709 //---------------------------------------------
710 if( Vertex_Type != SG_VERTEX_TYPE_XY )
711 {
712 fSHP.Write_Double(pShape->Get_ZMin());
713 fSHP.Write_Double(pShape->Get_ZMax());
714
715 for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
716 {
717 for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
718 {
719 fSHP.Write_Double(pShape->Get_Z(iPoint, iPart));
720 }
721 }
722
723 if( Vertex_Type == SG_VERTEX_TYPE_XYZM )
724 {
725 fSHP.Write_Double(pShape->Get_MMin());
726 fSHP.Write_Double(pShape->Get_MMax());
727
728 for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
729 {
730 for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
731 {
732 fSHP.Write_Double(pShape->Get_M(iPoint, iPart));
733 }
734 }
735 }
736 }
737 }
738
739 //-------------------------------------------------
740 // attributes...
741
742 fDBF.Add_Record();
743
744 for(iField=0; iField<Get_Field_Count(); iField++)
745 {
746 if( pShape->is_NoData(iField) )
747 {
748 fDBF.Set_NoData(iField);
749 }
750 else switch( fDBF.Get_Field_Type(iField) )
751 {
752 default:
753 fDBF.Set_Value(iField, pShape->asString(iField));
754 break;
755
756 case DBF_FT_FLOAT:
757 case DBF_FT_NUMERIC:
758 fDBF.Set_Value(iField, pShape->asDouble(iField));
759 break;
760 }
761 }
762
763 fDBF.Flush_Record();
764 }
765
766 //-----------------------------------------------------
767 // File Sizes...
768
769 fSHP.Seek(24);
770 fSHP.Write_Int(fSHP_Size, true);
771
772 fSHX.Seek(24);
773 fSHX.Write_Int(fSHX_Size, true);
774
775 //-----------------------------------------------------
776 Get_Projection().Save(SG_File_Make_Path("", File_Name, "prj"), SG_PROJ_FMT_WKT);
777
778 //-----------------------------------------------------
779 CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
780
781 if( !pFields )
782 {
783 pFields = Get_MetaData_DB().Add_Child("FIELDS");
784 }
785
786 pFields->Del_Children();
787
788 for(iField=0; iField<Get_Field_Count(); iField++)
789 {
790 pFields->Add_Child("FIELD", Get_Field_Name(iField))->Add_Property("TYPE", gSG_Data_Type_Identifier[Get_Field_Type(iField)]);
791 }
792
793 Get_MetaData().Del_Child("GDAL_DRIVER");
794
795 Save_MetaData(File_Name);
796
797 //-----------------------------------------------------
798 return( true );
799 }
800
801
803 // //
804 // //
805 // //
807
808 //---------------------------------------------------------
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
DBF_FT_FLOAT
#define DBF_FT_FLOAT
Definition: table_dbase.h:77
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Shapes::On_Delete
virtual bool On_Delete(void)
Definition: shapes_io.cpp:72
CSG_Data_Manager::Get_Shapes
CSG_Data_Collection * Get_Shapes(void) const
Definition: data_manager.h:172
CSG_MetaData::Del_Child
bool Del_Child(int Index)
Definition: metadata.cpp:329
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Data_Collection::Get
CSG_Data_Object * Get(size_t i) const
Definition: data_manager.h:96
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_Data_Collection::Count
size_t Count(void) const
Definition: data_manager.h:94
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_Shapes::On_Reload
virtual bool On_Reload(void)
Definition: shapes_io.cpp:66
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
data_manager.h
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_File::Seek
bool Seek(sLong Offset, int Origin=SG_FILE_START) const
Definition: api_file.cpp:232
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
CSG_Shapes::Get_MMin
double Get_MMin(void)
Definition: shapes.h:815
CSG_Buffer::asDouble
double asDouble(int Offset, bool bBigEndian=false) const
Definition: api_core.h:271
CSG_Tool
Definition: tool.h:149
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:257
CSG_Table_DBase::Open_Write
bool Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
Definition: table_dbase.cpp:307
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:454
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
SSG_Point
Definition: geo_tools.h:128
CSG_Buffer::Set_Size
bool Set_Size(size_t Size, bool bShrink=true)
Definition: api_memory.cpp:732
CSG_File::Read
size_t Read(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:322
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Shapes::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:813
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_File
Definition: api_core.h:1116
Set_Content_Length
#define Set_Content_Length(n)
Definition: shapes_io.cpp:484
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:450
CSG_Projection::Load
bool Load(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT)
Definition: projections.cpp:413
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_Table_DBase
Definition: table_dbase.h:91
CSG_Buffer
Definition: api_core.h:224
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Buffer::asInt
int asInt(int Offset, bool bBigEndian=false) const
Definition: api_core.h:269
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
SG_UI_Msg_Lock
int SG_UI_Msg_Lock(bool bOn)
Definition: api_callback.cpp:465
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_DBase::Get_Field_Type
char Get_Field_Type(int iField)
Definition: table_dbase.h:109
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:197
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:196
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Table_DBase::Add_Record
void Add_Record(void)
Definition: table_dbase.cpp:612
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
CSG_File::Close
virtual bool Close(void)
Definition: api_file.cpp:154
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:212
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table_DBase::Flush_Record
void Flush_Record(void)
Definition: table_dbase.cpp:630
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_File::Write_Double
bool Write_Double(double Value, bool bBigEndian=false)
Definition: api_file.cpp:464
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Table::Set_Field_Name
bool Set_Field_Name(int iField, const SG_Char *Name)
Definition: table.cpp:617
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
table_dbase.h
SG_File_Set_Extension
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:934
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_Table_DBase::Set_Value
bool Set_Value(int iField, double Value)
Definition: table_dbase.cpp:771
CSG_String
Definition: api_core.h:557
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Get_MetaData_DB
CSG_MetaData & Get_MetaData_DB(void) const
Definition: dataobject.h:226
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:600
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:213
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_File::Write_Int
bool Write_Int(int Value, bool bBigEndian=false)
Definition: api_file.cpp:438
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Table_DBase::Set_NoData
bool Set_NoData(int iField)
Definition: table_dbase.cpp:904
CSG_Projection::Save
bool Save(const CSG_String &FileName, TSG_Projection_Format Format=SG_PROJ_FMT_WKT) const
Definition: projections.cpp:421
CSG_Shapes::Make_Clean
bool Make_Clean(void)
Definition: shapes.cpp:628
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:194
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_Shapes
Definition: shapes.h:773
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
DBF_FT_NUMERIC
#define DBF_FT_NUMERIC
Definition: table_dbase.h:78
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:210
CSG_Shape
Definition: shapes.h:141
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes_ogis.cpp File Reference

  • saga_core
  • saga_api
Macros
shapes_ogis.cpp File Reference
#include "shapes.h"
#include "grid.h"

Go to the source code of this file.

Macros

#define TYPE_AS_WKB(t) if( !Type.CmpNoCase(Type_asWKText(t)) ) return( t );

Macro Definition Documentation

◆ TYPE_AS_WKB

#define TYPE_AS_WKB ( t ) if( !Type.CmpNoCase(Type_asWKText(t)) ) return( t );
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes_ogis.cpp Source File

  • saga_core
  • saga_api
shapes_ogis.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_ogis.cpp //
15 // //
16 // Copyright (C) 2010 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "shapes.h"
52
53
55 // //
56 // //
57 // //
59
60 //---------------------------------------------------------
61 CSG_String CSG_Shapes_OGIS_Converter::Type_asWKText (DWORD Type)
62 {
63 switch( Type )
64 {
65 case SG_OGIS_TYPE_Point : return( "Point" );
66 case SG_OGIS_TYPE_LineString : return( "LineString" );
67 case SG_OGIS_TYPE_Polygon : return( "Polygon" );
68 case SG_OGIS_TYPE_MultiPoint : return( "MultiPoint" );
69 case SG_OGIS_TYPE_MultiLineString : return( "MultiLineString" );
70 case SG_OGIS_TYPE_MultiPolygon : return( "MultiPolygon" );
71 case SG_OGIS_TYPE_GeometryCollection : return( "GeometryCollection" );
72 case SG_OGIS_TYPE_PolyhedralSurface : return( "PolyhedralSurface" );
73 case SG_OGIS_TYPE_TIN : return( "TIN" );
74 case SG_OGIS_TYPE_Triangle : return( "Triangle" );
75
76 case SG_OGIS_TYPE_PointZ : return( "PointZ" );
77 case SG_OGIS_TYPE_LineStringZ : return( "LineStringZ" );
78 case SG_OGIS_TYPE_PolygonZ : return( "PolygonZ" );
79 case SG_OGIS_TYPE_MultiPointZ : return( "MultiPointZ" );
80 case SG_OGIS_TYPE_MultiLineStringZ : return( "MultiLineStringZ" );
81 case SG_OGIS_TYPE_MultiPolygonZ : return( "MultiPolygonZ" );
82 case SG_OGIS_TYPE_GeometryCollectionZ : return( "GeometryCollectionZ" );
83 case SG_OGIS_TYPE_PolyhedralSurfaceZ : return( "PolyhedralSurfaceZ" );
84 case SG_OGIS_TYPE_TINZ : return( "TINZ" );
85 case SG_OGIS_TYPE_TriangleZ : return( "TriangleZ" );
86
87 case SG_OGIS_TYPE_PointM : return( "PointM" );
88 case SG_OGIS_TYPE_LineStringM : return( "LineStringM" );
89 case SG_OGIS_TYPE_PolygonM : return( "PolygonM" );
90 case SG_OGIS_TYPE_MultiPointM : return( "MultiPointM" );
91 case SG_OGIS_TYPE_MultiLineStringM : return( "MultiLineStringM" );
92 case SG_OGIS_TYPE_MultiPolygonM : return( "MultiPolygonM" );
93 case SG_OGIS_TYPE_GeometryCollectionM : return( "GeometryCollectionM" );
94 case SG_OGIS_TYPE_PolyhedralSurfaceM : return( "PolyhedralSurfaceM" );
95 case SG_OGIS_TYPE_TINM : return( "TINM" );
96 case SG_OGIS_TYPE_TriangleM : return( "TriangleM" );
97
98 case SG_OGIS_TYPE_PointZM : return( "PointZM" );
99 case SG_OGIS_TYPE_LineStringZM : return( "LineStringZM" );
100 case SG_OGIS_TYPE_PolygonZM : return( "PolygonZM" );
101 case SG_OGIS_TYPE_MultiPointZM : return( "MultiPointZM" );
102 case SG_OGIS_TYPE_MultiLineStringZM : return( "MultiLineStringZM" );
103 case SG_OGIS_TYPE_MultiPolygonZM : return( "MultiPolygonZM" );
104 case SG_OGIS_TYPE_GeometryCollectionZM : return( "GeometryCollectionZM" );
105 case SG_OGIS_TYPE_PolyhedralSurfaceZM : return( "PolyhedralSurfaceZM" );
106 case SG_OGIS_TYPE_TINZM : return( "TINZM" );
107 case SG_OGIS_TYPE_TriangleZM : return( "TriangleZM" );
108 }
109
110 return( "" );
111 }
112
113 //---------------------------------------------------------
114 DWORD CSG_Shapes_OGIS_Converter::Type_asWKBinary(const CSG_String &Type)
115 {
116 #define TYPE_AS_WKB(t) if( !Type.CmpNoCase(Type_asWKText(t)) ) return( t );
117
118 TYPE_AS_WKB(SG_OGIS_TYPE_Point );
119 TYPE_AS_WKB(SG_OGIS_TYPE_LineString );
120 TYPE_AS_WKB(SG_OGIS_TYPE_Polygon );
121 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPoint );
122 TYPE_AS_WKB(SG_OGIS_TYPE_MultiLineString );
123 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPolygon );
124 TYPE_AS_WKB(SG_OGIS_TYPE_GeometryCollection );
125 TYPE_AS_WKB(SG_OGIS_TYPE_PolyhedralSurface );
126 TYPE_AS_WKB(SG_OGIS_TYPE_TIN );
127 TYPE_AS_WKB(SG_OGIS_TYPE_Triangle );
128
129 TYPE_AS_WKB(SG_OGIS_TYPE_PointZ );
130 TYPE_AS_WKB(SG_OGIS_TYPE_LineStringZ );
131 TYPE_AS_WKB(SG_OGIS_TYPE_PolygonZ );
132 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPointZ );
133 TYPE_AS_WKB(SG_OGIS_TYPE_MultiLineStringZ );
134 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPolygonZ );
135 TYPE_AS_WKB(SG_OGIS_TYPE_GeometryCollectionZ );
136 TYPE_AS_WKB(SG_OGIS_TYPE_PolyhedralSurfaceZ );
137 TYPE_AS_WKB(SG_OGIS_TYPE_TINZ );
138 TYPE_AS_WKB(SG_OGIS_TYPE_TriangleZ );
139
140 TYPE_AS_WKB(SG_OGIS_TYPE_PointM );
141 TYPE_AS_WKB(SG_OGIS_TYPE_LineStringM );
142 TYPE_AS_WKB(SG_OGIS_TYPE_PolygonM );
143 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPointM );
144 TYPE_AS_WKB(SG_OGIS_TYPE_MultiLineStringM );
145 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPolygonM );
146 TYPE_AS_WKB(SG_OGIS_TYPE_GeometryCollectionM );
147 TYPE_AS_WKB(SG_OGIS_TYPE_PolyhedralSurfaceM );
148 TYPE_AS_WKB(SG_OGIS_TYPE_TINM );
149 TYPE_AS_WKB(SG_OGIS_TYPE_TriangleM );
150
151 TYPE_AS_WKB(SG_OGIS_TYPE_PointZM );
152 TYPE_AS_WKB(SG_OGIS_TYPE_LineStringZM );
153 TYPE_AS_WKB(SG_OGIS_TYPE_PolygonZM );
154 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPointZM );
155 TYPE_AS_WKB(SG_OGIS_TYPE_MultiLineStringZM );
156 TYPE_AS_WKB(SG_OGIS_TYPE_MultiPolygonZM );
157 TYPE_AS_WKB(SG_OGIS_TYPE_GeometryCollectionZM );
158 TYPE_AS_WKB(SG_OGIS_TYPE_PolyhedralSurfaceZM );
159 TYPE_AS_WKB(SG_OGIS_TYPE_TINZM );
160 TYPE_AS_WKB(SG_OGIS_TYPE_TriangleZM );
161
162 return( SG_OGIS_TYPE_Undefined );
163 }
164
165
167 // //
168 // //
169 // //
171
172 //---------------------------------------------------------
173 inline bool CSG_Shapes_OGIS_Converter::_WKT_Read_Point(const CSG_String &Text, CSG_Shape *pShape, int iPart)
174 {
175 double x, y, z, m;
176
177 switch( pShape->Get_Vertex_Type() )
178 {
179 case SG_VERTEX_TYPE_XY:
180 if( SG_SSCANF(Text.c_str(), SG_T("%lf %lf"), &x, &y) == 2 )
181 {
182 pShape->Add_Point(x, y, iPart);
183
184 return( true );
185 }
186 break;
187
188 case SG_VERTEX_TYPE_XYZ:
189 if( SG_SSCANF(Text.c_str(), SG_T("%lf %lf %lf"), &x, &y, &z) == 3 )
190 {
191 pShape->Add_Point(x, y, iPart);
192 pShape->Set_Z (z, pShape->Get_Point_Count(iPart) - 1, iPart);
193
194 return( true );
195 }
196 break;
197
198 case SG_VERTEX_TYPE_XYZM:
199 if( SG_SSCANF(Text.c_str(), SG_T("%lf %lf %lf %lf"), &x, &y, &z, &m) == 4 )
200 {
201 pShape->Add_Point(x, y, iPart);
202 pShape->Set_Z (z, pShape->Get_Point_Count(iPart) - 1, iPart);
203 pShape->Set_M (m, pShape->Get_Point_Count(iPart) - 1, iPart);
204
205 return( true );
206 }
207 break;
208 }
209
210 return( false );
211 }
212
213 //---------------------------------------------------------
214 bool CSG_Shapes_OGIS_Converter::_WKT_Read_Points(const CSG_String &Text, CSG_Shape *pShape)
215 {
216 CSG_String s(Text.AfterFirst('(').BeforeFirst(')')); int iPart = pShape->Get_Part_Count();
217
218 while( s.Length() > 0 )
219 {
220 if( !_WKT_Read_Point(s, pShape, iPart) )
221 {
222 return( false );
223 }
224
225 s = s.AfterFirst(',');
226 }
227
228 return( pShape->Get_Point_Count(iPart) > 0 );
229 }
230
231 //---------------------------------------------------------
232 bool CSG_Shapes_OGIS_Converter::_WKT_Read_Parts(const CSG_String &Text, CSG_Shape *pShape)
233 {
234 CSG_String s(Text.AfterFirst('(').BeforeLast(')'));
235
236 while( s.Length() > 0 )
237 {
238 _WKT_Read_Points(s, pShape);
239
240 s = s.AfterFirst(',');
241 }
242
243 return( pShape->Get_Part_Count() > 0 );
244 }
245
246 //---------------------------------------------------------
247 bool CSG_Shapes_OGIS_Converter::_WKT_Read_Polygon(const CSG_String &Text, CSG_Shape *pShape)
248 {
249 CSG_String Part;
250
251 for(int i=0, Level=-2; i<(int)Text.Length(); i++)
252 {
253 if( Text[i] == '(' )
254 {
255 Level++;
256 }
257 else if( Text[i] == ')' )
258 {
259 if( Level == 0 )
260 {
261 Part += Text[i];
262 _WKT_Read_Parts(Part, pShape);
263 Part.Clear();
264 }
265
266 Level--;
267 }
268
269 if( Level >= 0 )
270 {
271 Part += Text[i];
272 }
273 }
274
275 return( pShape->Get_Part_Count() > 0 );
276 }
277
278 //---------------------------------------------------------
279 bool CSG_Shapes_OGIS_Converter::from_WKText(const CSG_String &Text, CSG_Shape *pShape)
280 {
281 pShape->Del_Parts();
282
283 CSG_String Type(Text.BeforeFirst('(')); Type.Trim_Both();
284
285 if( pShape->Get_Type() == to_ShapeType(Type) )
286 {
287 switch( Type_asWKBinary(Type) )
288 {
289 case SG_OGIS_TYPE_Point :
290 case SG_OGIS_TYPE_PointZ :
291 case SG_OGIS_TYPE_PointM :
292 case SG_OGIS_TYPE_PointZM : return( _WKT_Read_Point(Text.AfterFirst('(').BeforeFirst(')'), pShape, 0) );
293
294 case SG_OGIS_TYPE_MultiPoint :
295 case SG_OGIS_TYPE_MultiPointZ :
296 case SG_OGIS_TYPE_MultiPointM :
297 case SG_OGIS_TYPE_MultiPointZM : return( _WKT_Read_Points (Text, pShape) );
298
299 case SG_OGIS_TYPE_LineString :
300 case SG_OGIS_TYPE_LineStringZ :
301 case SG_OGIS_TYPE_LineStringM :
302 case SG_OGIS_TYPE_LineStringZM : return( _WKT_Read_Points (Text, pShape) );
303
304 case SG_OGIS_TYPE_MultiLineString :
305 case SG_OGIS_TYPE_MultiLineStringZ :
306 case SG_OGIS_TYPE_MultiLineStringM :
307 case SG_OGIS_TYPE_MultiLineStringZM:
308 return( _WKT_Read_Parts (Text, pShape) );
309
310 case SG_OGIS_TYPE_Polygon :
311 case SG_OGIS_TYPE_PolygonZ :
312 case SG_OGIS_TYPE_PolygonM :
313 case SG_OGIS_TYPE_PolygonZM : return( _WKT_Read_Parts (Text, pShape) );
314
315 case SG_OGIS_TYPE_MultiPolygon :
316 case SG_OGIS_TYPE_MultiPolygonZ :
317 case SG_OGIS_TYPE_MultiPolygonM :
318 case SG_OGIS_TYPE_MultiPolygonZM : return( _WKT_Read_Polygon(Text, pShape) );
319 }
320 }
321
322 return( false );
323 }
324
325
327 // //
329
330 //---------------------------------------------------------
331 inline bool CSG_Shapes_OGIS_Converter::_WKT_Write_Point(CSG_String &Text, CSG_Shape *pShape, int iPoint, int iPart)
332 {
333 TSG_Point Point = pShape->Get_Point(iPoint, iPart);
334
335 switch( ((CSG_Shapes *)pShape->Get_Table())->Get_Vertex_Type() )
336 {
337 case SG_VERTEX_TYPE_XY:
338 Text += CSG_String::Format("%f %f" , Point.x, Point.y);
339 break;
340
341 case SG_VERTEX_TYPE_XYZ:
342 Text += CSG_String::Format("%f %f %f" , Point.x, Point.y, pShape->Get_Z(iPoint, iPart));
343 break;
344
345 case SG_VERTEX_TYPE_XYZM:
346 Text += CSG_String::Format("%f %f %f %f", Point.x, Point.y, pShape->Get_Z(iPoint, iPart), pShape->Get_M(iPoint, iPart));
347 break;
348 }
349
350 return( false );
351 }
352
353 //---------------------------------------------------------
354 inline bool CSG_Shapes_OGIS_Converter::_WKT_Write_Points(CSG_String &Text, CSG_Shape *pShape, int iPart)
355 {
356 Text += "(";
357
358 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
359 {
360 if( iPoint > 0 )
361 {
362 Text += ", ";
363 }
364
365 _WKT_Write_Point(Text, pShape, iPoint, iPart);
366 }
367
368 if( pShape->Get_Type() == SHAPE_TYPE_Polygon && CSG_Point(pShape->Get_Point(0, iPart)) != pShape->Get_Point(pShape->Get_Point_Count(iPart) -1, iPart) )
369 {
370 Text += ", ";
371
372 _WKT_Write_Point(Text, pShape, 0, iPart);
373 }
374
375 Text += ")";
376
377 return( true );
378 }
379
380 //---------------------------------------------------------
381 inline bool CSG_Shapes_OGIS_Converter::_WKT_Write_Parts(CSG_String &Text, CSG_Shape *pShape)
382 {
383 Text += "(";
384
385 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
386 {
387 if( iPart > 0 )
388 {
389 Text += ", ";
390 }
391
392 _WKT_Write_Points(Text, pShape, iPart);
393 }
394
395 Text += ")";
396
397 return( true );
398 }
399
400 //---------------------------------------------------------
401 inline bool CSG_Shapes_OGIS_Converter::_WKT_Write_Polygon(CSG_String &Text, CSG_Shape *pShape)
402 {
403 Text += "(";
404
405 for(int iPart=0, nIslands=0; iPart<pShape->Get_Part_Count(); iPart++)
406 {
407 if( ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) == false )
408 {
409 if( nIslands++ > 0 )
410 {
411 Text += ", ";
412 }
413
414 Text += "(";
415
416 _WKT_Write_Points(Text, pShape, iPart);
417
418 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
419 {
420 if( ((CSG_Shape_Polygon *)pShape)->is_Lake(jPart) && ((CSG_Shape_Polygon *)pShape)->Contains(pShape->Get_Point(0, jPart), iPart) )
421 {
422 Text += ", ";
423
424 _WKT_Write_Points(Text, pShape, jPart);
425 }
426 }
427
428 Text += ")";
429 }
430 }
431
432 Text += ")";
433
434 return( true );
435 }
436
437 //---------------------------------------------------------
438 bool CSG_Shapes_OGIS_Converter::to_WKText(CSG_Shape *pShape, CSG_String &Text)
439 {
440 switch( pShape->Get_Type() )
441 {
442 case SHAPE_TYPE_Point : _WKT_Write_Points (Text = from_ShapeType(pShape->Get_Type(), pShape->Get_Vertex_Type()), pShape, 0); break;
443 case SHAPE_TYPE_Points : _WKT_Write_Parts (Text = from_ShapeType(pShape->Get_Type(), pShape->Get_Vertex_Type()), pShape ); break;
444 case SHAPE_TYPE_Line : _WKT_Write_Parts (Text = from_ShapeType(pShape->Get_Type(), pShape->Get_Vertex_Type()), pShape ); break;
445 case SHAPE_TYPE_Polygon: _WKT_Write_Polygon(Text = from_ShapeType(pShape->Get_Type(), pShape->Get_Vertex_Type()), pShape ); break;
446
447 default:
448 return( false );
449 }
450
451 return( true );
452 }
453
454
456 // //
458
459 //---------------------------------------------------------
460 inline bool CSG_Shapes_OGIS_Converter::_WKB_Read_Point(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape, int iPart)
461 {
462 if( !Bytes.is_EOF() )
463 {
464 double x = Bytes.Read_Double(bSwapBytes);
465 double y = Bytes.Read_Double(bSwapBytes);
466
467 pShape->Add_Point(x, y, iPart);
468
469 switch( Vertex )
470 {
471 default:
472 break;
473
474 case SG_VERTEX_TYPE_XYZ:
475 pShape->Set_Z(Bytes.Read_Double(bSwapBytes), pShape->Get_Point_Count(iPart) - 1, iPart);
476 break;
477
478 case SG_VERTEX_TYPE_XYZM:
479 pShape->Set_Z(Bytes.Read_Double(bSwapBytes), pShape->Get_Point_Count(iPart) - 1, iPart);
480 pShape->Set_M(Bytes.Read_Double(bSwapBytes), pShape->Get_Point_Count(iPart) - 1, iPart);
481 break;
482 }
483
484 return( true );
485 }
486
487 return( false );
488 }
489
490 //---------------------------------------------------------
491 bool CSG_Shapes_OGIS_Converter::_WKB_Read_Points(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape)
492 {
493 DWORD nPoints = Bytes.Read_DWord(bSwapBytes), iPart = pShape->Get_Part_Count();
494
495 for(DWORD iPoint=0; iPoint<nPoints; iPoint++)
496 {
497 if( !_WKB_Read_Point(Bytes, bSwapBytes, Vertex, pShape, iPart) )
498 {
499 return( false );
500 }
501 }
502
503 return( pShape->Get_Point_Count(iPart) > 0 );
504 }
505
506 //---------------------------------------------------------
507 bool CSG_Shapes_OGIS_Converter::_WKB_Read_Polygon(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape)
508 {
509 int nParts = (int)Bytes.Read_DWord(bSwapBytes);
510
511 for(int iPart=0; iPart<nParts; iPart++)
512 {
513 if( !_WKB_Read_Points(Bytes, bSwapBytes, Vertex, pShape) )
514 {
515 return( false );
516 }
517 }
518
519 return( pShape->Get_Part_Count() > 0 );
520 }
521
522 //---------------------------------------------------------
523 bool CSG_Shapes_OGIS_Converter::_WKB_Read_MultiPoint(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape)
524 {
525 DWORD nPoints = Bytes.Read_DWord(bSwapBytes), iPart = pShape->Get_Part_Count();
526
527 for(DWORD iPoint=0; iPoint<nPoints; iPoint++)
528 {
529 bSwapBytes = Bytes.Read_Byte() != SG_OGIS_BYTEORDER_NDR;
530
531 TSG_Shape_Type Geometry; TSG_Vertex_Type _Vertex; to_ShapeType(Bytes.Read_DWord(bSwapBytes), Geometry, _Vertex);
532
533 if( Geometry != SHAPE_TYPE_Point || Vertex != _Vertex || !_WKB_Read_Point(Bytes, bSwapBytes, Vertex, pShape, iPart) )
534 {
535 return( false );
536 }
537 }
538
539 return( pShape->Get_Point_Count(iPart) > 0 );
540 }
541
542 //---------------------------------------------------------
543 bool CSG_Shapes_OGIS_Converter::_WKB_Read_MultiLine(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape)
544 {
545 DWORD nLines = Bytes.Read_DWord(bSwapBytes);
546
547 for(DWORD iLine=0; iLine<nLines; iLine++)
548 {
549 bSwapBytes = Bytes.Read_Byte() != SG_OGIS_BYTEORDER_NDR;
550
551 TSG_Shape_Type Geometry; TSG_Vertex_Type _Vertex; to_ShapeType(Bytes.Read_DWord(bSwapBytes), Geometry, _Vertex);
552
553 if( Geometry != SHAPE_TYPE_Line || Vertex != _Vertex || !_WKB_Read_Points(Bytes, bSwapBytes, Vertex, pShape) )
554 {
555 return( false );
556 }
557 }
558
559 return( pShape->Get_Part_Count() > 0 );
560 }
561
562 //---------------------------------------------------------
563 bool CSG_Shapes_OGIS_Converter::_WKB_Read_MultiPolygon(CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape)
564 {
565 DWORD nPolygons = Bytes.Read_DWord(bSwapBytes);
566
567 for(DWORD iPolygon=0; iPolygon<nPolygons; iPolygon++)
568 {
569 bSwapBytes = Bytes.Read_Byte() != SG_OGIS_BYTEORDER_NDR;
570
571 TSG_Shape_Type Geometry; TSG_Vertex_Type _Vertex; to_ShapeType(Bytes.Read_DWord(bSwapBytes), Geometry, _Vertex);
572
573 if( Geometry != SHAPE_TYPE_Polygon || Vertex != _Vertex || !_WKB_Read_Polygon(Bytes, bSwapBytes, Vertex, pShape) )
574 {
575 return( false );
576 }
577 }
578
579 return( pShape->Get_Part_Count() > 0 );
580 }
581
582 //---------------------------------------------------------
583 bool CSG_Shapes_OGIS_Converter::from_WKBinary(CSG_Bytes &Bytes, CSG_Shape *pShape)
584 {
585 pShape->Del_Parts();
586
587 if( Bytes.Get_Count() >= 4 )
588 {
589 Bytes.Rewind();
590
591 bool bSwapBytes = Bytes.Read_Byte() != SG_OGIS_BYTEORDER_NDR;
592
593 DWORD Type = Bytes.Read_DWord();
594
595 if( pShape->Get_Type() == to_ShapeType(Type) )
596 {
597 switch( Type )
598 {
599 case SG_OGIS_TYPE_Point : return( _WKB_Read_Point (Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape, 0) );
600 case SG_OGIS_TYPE_PointZ : return( _WKB_Read_Point (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape, 0) );
601 case SG_OGIS_TYPE_PointM : return( _WKB_Read_Point (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape, 0) );
602 case SG_OGIS_TYPE_PointZM : return( _WKB_Read_Point (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape, 0) );
603
604 case SG_OGIS_TYPE_MultiPoint : return( _WKB_Read_MultiPoint (Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape ) );
605 case SG_OGIS_TYPE_MultiPointZ : return( _WKB_Read_MultiPoint (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
606 case SG_OGIS_TYPE_MultiPointM : return( _WKB_Read_MultiPoint (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
607 case SG_OGIS_TYPE_MultiPointZM : return( _WKB_Read_MultiPoint (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape ) );
608
609 case SG_OGIS_TYPE_LineString : return( _WKB_Read_Points (Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape ) );
610 case SG_OGIS_TYPE_LineStringZ : return( _WKB_Read_Points (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
611 case SG_OGIS_TYPE_LineStringM : return( _WKB_Read_Points (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
612 case SG_OGIS_TYPE_LineStringZM : return( _WKB_Read_Points (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape ) );
613
614 case SG_OGIS_TYPE_MultiLineString : return( _WKB_Read_MultiLine (Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape ) );
615 case SG_OGIS_TYPE_MultiLineStringZ : return( _WKB_Read_MultiLine (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
616 case SG_OGIS_TYPE_MultiLineStringM : return( _WKB_Read_MultiLine (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
617 case SG_OGIS_TYPE_MultiLineStringZM: return( _WKB_Read_MultiLine (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape ) );
618
619 case SG_OGIS_TYPE_Polygon : return( _WKB_Read_Polygon (Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape ) );
620 case SG_OGIS_TYPE_PolygonZ : return( _WKB_Read_Polygon (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
621 case SG_OGIS_TYPE_PolygonM : return( _WKB_Read_Polygon (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
622 case SG_OGIS_TYPE_PolygonZM : return( _WKB_Read_Polygon (Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape ) );
623
624 case SG_OGIS_TYPE_MultiPolygon : return( _WKB_Read_MultiPolygon(Bytes, bSwapBytes, SG_VERTEX_TYPE_XY , pShape ) );
625 case SG_OGIS_TYPE_MultiPolygonZ : return( _WKB_Read_MultiPolygon(Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
626 case SG_OGIS_TYPE_MultiPolygonM : return( _WKB_Read_MultiPolygon(Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZ , pShape ) );
627 case SG_OGIS_TYPE_MultiPolygonZM : return( _WKB_Read_MultiPolygon(Bytes, bSwapBytes, SG_VERTEX_TYPE_XYZM, pShape ) );
628 }
629 }
630 }
631
632 return( false );
633 }
634
635
637 // //
639
640 //---------------------------------------------------------
641 inline bool CSG_Shapes_OGIS_Converter::_WKB_Write_Point(CSG_Bytes &Bytes, CSG_Shape *pShape, int iPoint, int iPart)
642 {
643 TSG_Point Point = pShape->Get_Point(iPoint, iPart);
644
645 Bytes += Point.x;
646 Bytes += Point.y;
647
648 switch( pShape->Get_Vertex_Type() )
649 {
650 case SG_VERTEX_TYPE_XY:
651 break;
652
653 case SG_VERTEX_TYPE_XYZ:
654 Bytes += pShape->Get_Z(iPoint, iPart);
655 break;
656
657 case SG_VERTEX_TYPE_XYZM:
658 Bytes += pShape->Get_Z(iPoint, iPart);
659 Bytes += pShape->Get_M(iPoint, iPart);
660 break;
661 }
662
663 return( true );
664 }
665
666 //---------------------------------------------------------
667 bool CSG_Shapes_OGIS_Converter::_WKB_Write_Points(CSG_Bytes &Bytes, CSG_Shape *pShape, int iPart)
668 {
669 bool bFirstTwice = pShape->Get_Type() == SHAPE_TYPE_Polygon && CSG_Point(pShape->Get_Point(0, iPart)) != pShape->Get_Point(0, iPart, false);
670
671 Bytes += (DWORD)(pShape->Get_Point_Count(iPart) + (bFirstTwice ? 1 : 0));
672
673 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
674 {
675 _WKB_Write_Point(Bytes, pShape, iPoint, iPart);
676 }
677
678 if( bFirstTwice )
679 {
680 _WKB_Write_Point(Bytes, pShape, 0, iPart);
681 }
682
683 return( true );
684 }
685
686 //---------------------------------------------------------
687 bool CSG_Shapes_OGIS_Converter::_WKB_Write_MultiPoint(CSG_Bytes &Bytes, CSG_Shape *pShape)
688 {
689 Bytes += (DWORD)pShape->Get_Point_Count(); // total number of points
690
691 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
692 {
693 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
694 {
695 Bytes += (BYTE)SG_OGIS_BYTEORDER_NDR;
696
697 switch( pShape->Get_Vertex_Type() )
698 {
699 case SG_VERTEX_TYPE_XY : Bytes += (DWORD)SG_OGIS_TYPE_Point ; break;
700 case SG_VERTEX_TYPE_XYZ : Bytes += (DWORD)SG_OGIS_TYPE_PointZ ; break;
701 case SG_VERTEX_TYPE_XYZM: Bytes += (DWORD)SG_OGIS_TYPE_PointZM; break;
702 }
703
704 if( !_WKB_Write_Point(Bytes, pShape, iPoint, iPart) )
705 {
706 return( false );
707 }
708 }
709 }
710
711 return( true );
712 }
713
714 //---------------------------------------------------------
715 bool CSG_Shapes_OGIS_Converter::_WKB_Write_MultiLine(CSG_Bytes &Bytes, CSG_Shape *pShape)
716 {
717 Bytes += (DWORD)pShape->Get_Part_Count();
718
719 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
720 {
721 Bytes += (BYTE)SG_OGIS_BYTEORDER_NDR;
722
723 switch( pShape->Get_Vertex_Type() )
724 {
725 case SG_VERTEX_TYPE_XY : Bytes += (DWORD)SG_OGIS_TYPE_LineString ; break;
726 case SG_VERTEX_TYPE_XYZ : Bytes += (DWORD)SG_OGIS_TYPE_LineStringZ ; break;
727 case SG_VERTEX_TYPE_XYZM: Bytes += (DWORD)SG_OGIS_TYPE_LineStringZM; break;
728 }
729
730 if( !_WKB_Write_Points(Bytes, pShape, iPart) )
731 {
732 return( false );
733 }
734 }
735
736 return( true );
737 }
738
739 //---------------------------------------------------------
740 bool CSG_Shapes_OGIS_Converter::_WKB_Write_MultiPolygon(CSG_Bytes &Bytes, CSG_Shape *pShape)
741 {
742 int nPolygons = 0; CSG_Array_Int nRings(pShape->Get_Part_Count()), iPolygon(pShape->Get_Part_Count());
743
744 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
745 {
746 nRings[iPart] = 0;
747
748 if( ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) == false )
749 {
750 nPolygons ++;
751 nRings [iPart] ++;
752 iPolygon[iPart] = iPart;
753
754 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
755 {
756 if( ((CSG_Shape_Polygon *)pShape)->is_Lake(jPart) && ((CSG_Shape_Polygon *)pShape)->Contains(pShape->Get_Point(0, jPart), iPart) )
757 {
758 nRings [iPart] ++;
759 iPolygon[jPart] = iPart;
760 }
761 }
762 }
763 }
764
765 Bytes += (DWORD)nPolygons;
766
767 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
768 {
769 if( nRings[iPart] > 0 )
770 {
771 Bytes += (BYTE)SG_OGIS_BYTEORDER_NDR;
772
773 switch( pShape->Get_Vertex_Type() )
774 {
775 case SG_VERTEX_TYPE_XY : Bytes += (DWORD)SG_OGIS_TYPE_Polygon ; break;
776 case SG_VERTEX_TYPE_XYZ : Bytes += (DWORD)SG_OGIS_TYPE_PolygonZ ; break;
777 case SG_VERTEX_TYPE_XYZM: Bytes += (DWORD)SG_OGIS_TYPE_PolygonZM; break;
778 }
779
780 Bytes += (DWORD)nRings[iPart];
781
782 for(int jPart=0; jPart<pShape->Get_Part_Count(); jPart++)
783 {
784 if( iPolygon[jPart] == iPart )
785 {
786 if( !_WKB_Write_Points(Bytes, pShape, jPart) )
787 {
788 return( false );
789 }
790 }
791 }
792 }
793 }
794
795 return( nPolygons > 0 );
796 }
797
798 //---------------------------------------------------------
799 bool CSG_Shapes_OGIS_Converter::to_WKBinary(CSG_Shape *pShape, CSG_Bytes &Bytes)
800 {
801 DWORD Type;
802
803 if( from_ShapeType(Type, pShape->Get_Type(), pShape->Get_Vertex_Type()) )
804 {
805 Bytes.Destroy();
806
807 Bytes += (BYTE)SG_OGIS_BYTEORDER_NDR;
808 Bytes += Type;
809
810 switch( pShape->Get_Type() )
811 {
812 case SHAPE_TYPE_Point : return( _WKB_Write_Point (Bytes, pShape, 0, 0) );
813 case SHAPE_TYPE_Points : return( _WKB_Write_MultiPoint (Bytes, pShape ) );
814 case SHAPE_TYPE_Line : return( _WKB_Write_MultiLine (Bytes, pShape ) );
815 case SHAPE_TYPE_Polygon: return( _WKB_Write_MultiPolygon(Bytes, pShape ) );
816 default: break;
817 }
818 }
819
820 return( false );
821 }
822
823
825 // //
826 // //
827 // //
829
830 //---------------------------------------------------------
831 bool CSG_Shapes_OGIS_Converter::from_ShapeType(CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex)
832 {
833 switch( Vertex )
834 {
835 case SG_VERTEX_TYPE_XY:
836 switch( Shape )
837 {
838 case SHAPE_TYPE_Point : Type = Type_asWKText(SG_OGIS_TYPE_Point ); return( true );
839 case SHAPE_TYPE_Points : Type = Type_asWKText(SG_OGIS_TYPE_MultiPoint ); return( true );
840 case SHAPE_TYPE_Line : Type = Type_asWKText(SG_OGIS_TYPE_MultiLineString ); return( true );
841 case SHAPE_TYPE_Polygon: Type = Type_asWKText(SG_OGIS_TYPE_MultiPolygon ); return( true );
842 default: break;
843 }
844 break;
845
846 case SG_VERTEX_TYPE_XYZ:
847 switch( Shape )
848 {
849 case SHAPE_TYPE_Point : Type = Type_asWKText(SG_OGIS_TYPE_PointZ ); return( true );
850 case SHAPE_TYPE_Points : Type = Type_asWKText(SG_OGIS_TYPE_MultiPointZ ); return( true );
851 case SHAPE_TYPE_Line : Type = Type_asWKText(SG_OGIS_TYPE_MultiLineStringZ ); return( true );
852 case SHAPE_TYPE_Polygon: Type = Type_asWKText(SG_OGIS_TYPE_MultiPolygonZ ); return( true );
853 default: break;
854 }
855 break;
856
857 case SG_VERTEX_TYPE_XYZM:
858 switch( Shape )
859 {
860 case SHAPE_TYPE_Point : Type = Type_asWKText(SG_OGIS_TYPE_PointZM ); return( true );
861 case SHAPE_TYPE_Points : Type = Type_asWKText(SG_OGIS_TYPE_MultiPointZM ); return( true );
862 case SHAPE_TYPE_Line : Type = Type_asWKText(SG_OGIS_TYPE_MultiLineStringZM); return( true );
863 case SHAPE_TYPE_Polygon: Type = Type_asWKText(SG_OGIS_TYPE_MultiPolygonZM ); return( true );
864 default: break;
865 }
866 break;
867 }
868
869 return( false );
870 }
871
872 //---------------------------------------------------------
873 bool CSG_Shapes_OGIS_Converter::from_ShapeType(DWORD &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex)
874 {
875 switch( Vertex )
876 {
877 case SG_VERTEX_TYPE_XY:
878 switch( Shape )
879 {
880 case SHAPE_TYPE_Point : Type = SG_OGIS_TYPE_Point ; return( true );
881 case SHAPE_TYPE_Points : Type = SG_OGIS_TYPE_MultiPoint ; return( true );
882 case SHAPE_TYPE_Line : Type = SG_OGIS_TYPE_MultiLineString; return( true );
883 case SHAPE_TYPE_Polygon: Type = SG_OGIS_TYPE_MultiPolygon ; return( true );
884 default: break;
885 }
886 break;
887
888 case SG_VERTEX_TYPE_XYZ:
889 switch( Shape )
890 {
891 case SHAPE_TYPE_Point : Type = SG_OGIS_TYPE_PointZ ; return( true );
892 case SHAPE_TYPE_Points : Type = SG_OGIS_TYPE_MultiPointZ ; return( true );
893 case SHAPE_TYPE_Line : Type = SG_OGIS_TYPE_MultiLineStringZ; return( true );
894 case SHAPE_TYPE_Polygon: Type = SG_OGIS_TYPE_MultiPolygonZ ; return( true );
895 default: break;
896 }
897 break;
898
899 case SG_VERTEX_TYPE_XYZM:
900 switch( Shape )
901 {
902 case SHAPE_TYPE_Point : Type = SG_OGIS_TYPE_PointZM ; return( true );
903 case SHAPE_TYPE_Points : Type = SG_OGIS_TYPE_MultiPointZM ; return( true );
904 case SHAPE_TYPE_Line : Type = SG_OGIS_TYPE_MultiLineStringZM; return( true );
905 case SHAPE_TYPE_Polygon: Type = SG_OGIS_TYPE_MultiPolygonZM ; return( true );
906 default: break;
907 }
908 break;
909 }
910
911 return( false );
912 }
913
914 //---------------------------------------------------------
915 CSG_String CSG_Shapes_OGIS_Converter::from_ShapeType(TSG_Shape_Type Shape, TSG_Vertex_Type Vertex)
916 {
917 CSG_String Type;
918
919 from_ShapeType(Type, Shape, Vertex);
920
921 return( Type );
922 }
923
924 //---------------------------------------------------------
925 bool CSG_Shapes_OGIS_Converter::to_ShapeType(const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex)
926 {
927 switch( Type_asWKBinary(Type) )
928 {
929 case SG_OGIS_TYPE_Point : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
930 case SG_OGIS_TYPE_MultiPoint : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
931 case SG_OGIS_TYPE_LineString : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
932 case SG_OGIS_TYPE_MultiLineString : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
933 case SG_OGIS_TYPE_Polygon : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XY ; return( true );
934 case SG_OGIS_TYPE_MultiPolygon : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XY ; return( true );
935
936 case SG_OGIS_TYPE_PointZ : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
937 case SG_OGIS_TYPE_MultiPointZ : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
938 case SG_OGIS_TYPE_LineStringZ : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
939 case SG_OGIS_TYPE_MultiLineStringZ : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
940 case SG_OGIS_TYPE_PolygonZ : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
941 case SG_OGIS_TYPE_MultiPolygonZ : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
942
943 case SG_OGIS_TYPE_PointM : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
944 case SG_OGIS_TYPE_MultiPointM : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
945 case SG_OGIS_TYPE_LineStringM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
946 case SG_OGIS_TYPE_MultiLineStringM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
947 case SG_OGIS_TYPE_PolygonM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
948 case SG_OGIS_TYPE_MultiPolygonM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
949
950 case SG_OGIS_TYPE_PointZM : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
951 case SG_OGIS_TYPE_MultiPointZM : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
952 case SG_OGIS_TYPE_LineStringZM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
953 case SG_OGIS_TYPE_MultiLineStringZM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
954 case SG_OGIS_TYPE_PolygonZM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
955 case SG_OGIS_TYPE_MultiPolygonZM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
956 }
957
958 Shape = SHAPE_TYPE_Undefined; Vertex = SG_VERTEX_TYPE_XY;
959
960 return( false );
961 }
962
963 //---------------------------------------------------------
964 bool CSG_Shapes_OGIS_Converter::to_ShapeType(DWORD Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex)
965 {
966 switch( Type )
967 {
968 case SG_OGIS_TYPE_Point : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
969 case SG_OGIS_TYPE_MultiPoint : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
970 case SG_OGIS_TYPE_LineString : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
971 case SG_OGIS_TYPE_MultiLineString : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XY ; return( true );
972 case SG_OGIS_TYPE_Polygon : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XY ; return( true );
973 case SG_OGIS_TYPE_MultiPolygon : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XY ; return( true );
974
975 case SG_OGIS_TYPE_PointZ : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
976 case SG_OGIS_TYPE_MultiPointZ : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
977 case SG_OGIS_TYPE_LineStringZ : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
978 case SG_OGIS_TYPE_MultiLineStringZ : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
979 case SG_OGIS_TYPE_PolygonZ : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
980 case SG_OGIS_TYPE_MultiPolygonZ : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
981
982 case SG_OGIS_TYPE_PointM : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
983 case SG_OGIS_TYPE_MultiPointM : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
984 case SG_OGIS_TYPE_LineStringM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
985 case SG_OGIS_TYPE_MultiLineStringM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
986 case SG_OGIS_TYPE_PolygonM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
987 case SG_OGIS_TYPE_MultiPolygonM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZ ; return( true );
988
989 case SG_OGIS_TYPE_PointZM : Shape = SHAPE_TYPE_Point ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
990 case SG_OGIS_TYPE_MultiPointZM : Shape = SHAPE_TYPE_Points ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
991 case SG_OGIS_TYPE_LineStringZM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
992 case SG_OGIS_TYPE_MultiLineStringZM : Shape = SHAPE_TYPE_Line ; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
993 case SG_OGIS_TYPE_PolygonZM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
994 case SG_OGIS_TYPE_MultiPolygonZM : Shape = SHAPE_TYPE_Polygon; Vertex = SG_VERTEX_TYPE_XYZM; return( true );
995 }
996
997 Shape = SHAPE_TYPE_Undefined; Vertex = SG_VERTEX_TYPE_XY;
998
999 return( false );
1000 }
1001
1002 //---------------------------------------------------------
1003 TSG_Shape_Type CSG_Shapes_OGIS_Converter::to_ShapeType(const CSG_String &Type)
1004 {
1005 TSG_Shape_Type Geometry; TSG_Vertex_Type Vertex; to_ShapeType(Type, Geometry, Vertex);
1006
1007 return( Geometry );
1008 }
1009
1010 //---------------------------------------------------------
1011 TSG_Shape_Type CSG_Shapes_OGIS_Converter::to_ShapeType(DWORD Type)
1012 {
1013 TSG_Shape_Type Geometry; TSG_Vertex_Type Vertex; to_ShapeType(Type, Geometry, Vertex);
1014
1015 return( Geometry );
1016 }
1017
1018 //---------------------------------------------------------
1019 TSG_Vertex_Type CSG_Shapes_OGIS_Converter::to_VertexType(const CSG_String &Type)
1020 {
1021 TSG_Shape_Type Geometry; TSG_Vertex_Type Vertex; to_ShapeType(Type, Geometry, Vertex);
1022
1023 return( Vertex );
1024 }
1025
1026 //---------------------------------------------------------
1027 TSG_Vertex_Type CSG_Shapes_OGIS_Converter::to_VertexType(DWORD Type)
1028 {
1029 TSG_Shape_Type Geometry; TSG_Vertex_Type Vertex; to_ShapeType(Type, Geometry, Vertex);
1030
1031 return( Vertex );
1032 }
1033
1034
1036 // //
1037 // //
1038 // //
1040
1041 //---------------------------------------------------------
1042 // Basic Type definitions
1043 // byte : 1 byte
1044 // uint16 : 16 bit unsigned integer (2 bytes)
1045 // uint32 : 32 bit unsigned integer (4 bytes)
1046 // float64 : double precision floating point number (8 bytes)
1047 //
1048 // +------------------------------------------------------------+
1049 // | RASTER |
1050 // +---------------+-------------+------------------------------+
1051 // | - name - | - type - | - meaning - |
1052 // +---------------+-------------+------------------------------+
1053 // | endianness | byte | 1:ndr/little endian |
1054 // | | | 0:xdr/big endian |
1055 // +---------------+-------------+------------------------------+
1056 // | version | uint16 | format version (0 for this |
1057 // | | | structure) |
1058 // +---------------+-------------+------------------------------+
1059 // | nBands | uint16 | Number of bands |
1060 // +---------------+-------------+------------------------------+
1061 // | scaleX | float64 | pixel width |
1062 // | | | in geographical units |
1063 // +---------------+-------------+------------------------------+
1064 // | scaleY | float64 | pixel height |
1065 // | | | in geographical units |
1066 // +---------------+-------------+------------------------------+
1067 // | ipX | float64 | X ordinate of upper-left |
1068 // | | | pixel's upper-left corner |
1069 // | | | in geographical units |
1070 // +---------------+-------------+------------------------------+
1071 // | ipY | float64 | Y ordinate of upper-left |
1072 // | | | pixel's upper-left corner |
1073 // | | | in geographical units |
1074 // +---------------+-------------+------------------------------+
1075 // | skewX | float64 | rotation about Y-axis |
1076 // +---------------+-------------+------------------------------+
1077 // | skewY | float64 | rotation about X-axis |
1078 // +---------------+-------------+------------------------------+
1079 // | srid | int32 | Spatial reference id |
1080 // +---------------+-------------+------------------------------+
1081 // | width | uint16 | number of pixel columns |
1082 // +---------------+-------------+------------------------------+
1083 // | height | uint16 | number of pixel rows |
1084 // +---------------+-------------+------------------------------+
1085 // | bands[nBands] | RASTERBAND | Bands data |
1086 // +---------------+-------------+------------------------------+
1087
1089 // //
1091
1092 //---------------------------------------------------------
1093 #include "grid.h"
1094
1095
1097 // //
1099
1100 //---------------------------------------------------------
1101 bool CSG_Grid_OGIS_Converter::from_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid)
1102 {
1103 Bytes.Rewind();
1104
1105 //-----------------------------------------------------
1106 // Raster System
1107
1108 bool bSwap = Bytes.Read_Byte () == 0; // endiannes: 1=ndr/little endian, 0=xdr/big endian
1109 short version = Bytes.Read_Short (bSwap); // version
1110 short nBands = Bytes.Read_Short (bSwap); // number of bands
1111 double dx = Bytes.Read_Double(bSwap); // scaleX
1112 double dy = Bytes.Read_Double(bSwap); // scaleY
1113 double xMin = Bytes.Read_Double(bSwap); // ipX
1114 double yMax = Bytes.Read_Double(bSwap); // ipY
1115 double skewX = Bytes.Read_Double(bSwap); // skewX
1116 double skewY = Bytes.Read_Double(bSwap); // skewY
1117 int SRID = Bytes.Read_Int (bSwap); // srid
1118 short NX = Bytes.Read_Short (bSwap); // width
1119 short NY = Bytes.Read_Short (bSwap); // height
1120
1121 //-----------------------------------------------------
1122 // Band
1123
1124 TSG_Data_Type Type; BYTE Flags = Bytes.Read_Byte();
1125
1126 switch( Flags & 0x0F )
1127 {
1128 case 0: Type = SG_DATATYPE_Bit ; break; // 0: 1-bit boolean
1129 case 1: Type = SG_DATATYPE_Char ; break; // 1: 2-bit unsigned integer
1130 case 2: Type = SG_DATATYPE_Char ; break; // 2: 4-bit unsigned integer
1131 case 3: Type = SG_DATATYPE_Char ; break; // 3: 8-bit signed integer
1132 case 4: Type = SG_DATATYPE_Byte ; break; // 4: 8-bit unsigned integer
1133 case 5: Type = SG_DATATYPE_Short ; break; // 5: 16-bit signed integer
1134 case 6: Type = SG_DATATYPE_Word ; break; // 6: 16-bit unsigned integer
1135 case 7: Type = SG_DATATYPE_Int ; break; // 7: 32-bit signed integer
1136 case 8: Type = SG_DATATYPE_DWord ; break; // 8: 32-bit unsigned integer
1137 case 10: Type = SG_DATATYPE_Float ; break; // 10: 32-bit float
1138 case 11: Type = SG_DATATYPE_Double; break; // 11: 64-bit float
1139 }
1140
1141 // Flags |= 0x80; // isOffline: no, never here!
1142 Flags |= 0x40; // hasNodataValue
1143 // Flags |= 0x20; // isNoDataValue: no, never here!
1144 // Flags |= 0x10; // reserved (unused)
1145
1146 if( !pGrid->Create(Type, NX, NY, dx, xMin + 0.5 * dx, yMax - (NY - 0.5) * dx) )
1147 {
1148 return( false );
1149 }
1150
1151 pGrid->Get_Projection().Create(SRID);
1152
1153 double noData;
1154
1155 switch( pGrid->Get_Type() )
1156 {
1157 case SG_DATATYPE_Bit : noData = Bytes.Read_Byte ( ); break; // 0: 1-bit boolean
1158 case SG_DATATYPE_Char : noData = Bytes.Read_Char ( ); break; // 3: 8-bit signed integer
1159 case SG_DATATYPE_Byte : noData = Bytes.Read_Byte ( ); break; // 4: 8-bit unsigned integer
1160 case SG_DATATYPE_Short : noData = Bytes.Read_Short (bSwap); break; // 5: 16-bit signed integer
1161 case SG_DATATYPE_Word : noData = Bytes.Read_Word (bSwap); break; // 6: 16-bit unsigned integer
1162 case SG_DATATYPE_Int : noData = Bytes.Read_Int (bSwap); break; // 7: 32-bit signed integer
1163 case SG_DATATYPE_DWord : noData = Bytes.Read_DWord (bSwap); break; // 8: 32-bit unsigned integer
1164 case SG_DATATYPE_Float : noData = Bytes.Read_Float (bSwap); break; // 9: 32-bit float
1165 case SG_DATATYPE_Double: noData = Bytes.Read_Double(bSwap); break; // 10: 64-bit float
1166 default:
1167 break;
1168 }
1169
1170 pGrid->Set_NoData_Value(noData);
1171
1172 for(int y=0; y<pGrid->Get_NY() && SG_UI_Process_Set_Progress(y, pGrid->Get_NY()); y++)
1173 {
1174 for(int x=0; x<pGrid->Get_NX(); x++)
1175 {
1176 switch( pGrid->Get_Type() )
1177 {
1178 case SG_DATATYPE_Bit : pGrid->Set_Value(x, y, Bytes.Read_Byte ( )); break; // 0: 1-bit boolean
1179 case SG_DATATYPE_Char : pGrid->Set_Value(x, y, Bytes.Read_Char ( )); break; // 3: 8-bit signed integer
1180 case SG_DATATYPE_Byte : pGrid->Set_Value(x, y, Bytes.Read_Byte ( )); break; // 4: 8-bit unsigned integer
1181 case SG_DATATYPE_Short : pGrid->Set_Value(x, y, Bytes.Read_Short (bSwap)); break; // 5: 16-bit signed integer
1182 case SG_DATATYPE_Word : pGrid->Set_Value(x, y, Bytes.Read_Word (bSwap)); break; // 6: 16-bit unsigned integer
1183 case SG_DATATYPE_Int : pGrid->Set_Value(x, y, Bytes.Read_Int (bSwap)); break; // 7: 32-bit signed integer
1184 case SG_DATATYPE_DWord : pGrid->Set_Value(x, y, Bytes.Read_DWord (bSwap)); break; // 8: 32-bit unsigned integer
1185 case SG_DATATYPE_Float : pGrid->Set_Value(x, y, Bytes.Read_Float (bSwap)); break; // 9: 32-bit float
1186 case SG_DATATYPE_Double: pGrid->Set_Value(x, y, Bytes.Read_Double(bSwap)); break; // 10: 64-bit float
1187 default:
1188 break;
1189 }
1190 }
1191 }
1192
1193 return( true );
1194 }
1195
1196 //---------------------------------------------------------
1197 bool CSG_Grid_OGIS_Converter::to_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID)
1198 {
1199 Bytes.Clear();
1200
1201 //-----------------------------------------------------
1202 // Raster System
1203
1204 if( pGrid->Get_Projection().Get_EPSG() > 0 )
1205 {
1206 SRID = pGrid->Get_Projection().Get_EPSG();
1207 }
1208
1209 Bytes += (BYTE )1 ; // endiannes
1210 Bytes += (short )0 ; // version
1211 Bytes += (short )1 ; // number of bands
1212 Bytes += (double)pGrid->Get_Cellsize(); // scaleX
1213 Bytes += (double)pGrid->Get_Cellsize(); // scaleY
1214 Bytes += (double)pGrid->Get_XMin(true); // ipX
1215 Bytes += (double)pGrid->Get_YMax(true); // ipY
1216 Bytes += (double)0. ; // skewX
1217 Bytes += (double)0. ; // skewY
1218 Bytes += (int )SRID ; // srid
1219 Bytes += (short )pGrid->Get_NX() ; // width
1220 Bytes += (short )pGrid->Get_NY() ; // height
1221
1222 //-----------------------------------------------------
1223 // Band
1224
1225 BYTE Flags;
1226
1227 switch( pGrid->Get_Type() )
1228 {
1229 case SG_DATATYPE_Bit : Flags = 0; break; // 0: 1-bit boolean
1230 // case SG_DATATYPE_ : Flags = 1; break; // 1: 2-bit unsigned integer
1231 // case SG_DATATYPE_ : Flags = 2; break; // 2: 4-bit unsigned integer
1232 case SG_DATATYPE_Char : Flags = 3; break; // 3: 8-bit signed integer
1233 case SG_DATATYPE_Byte : Flags = 4; break; // 4: 8-bit unsigned integer
1234 case SG_DATATYPE_Short : Flags = 5; break; // 5: 16-bit signed integer
1235 case SG_DATATYPE_Word : Flags = 6; break; // 6: 16-bit unsigned integer
1236 case SG_DATATYPE_Int : Flags = 7; break; // 7: 32-bit signed integer
1237 case SG_DATATYPE_DWord : Flags = 8; break; // 8: 32-bit unsigned integer
1238 default : Flags = 10; break; // 10: 32-bit float
1239 case SG_DATATYPE_Double: Flags = 11; break; // 11: 64-bit float
1240 }
1241
1242 // Flags |= 0x80; // isOffline: no, never here!
1243 Flags |= 0x40; // hasNodataValue
1244 // Flags |= 0x20; // isNoDataValue: no, never here!
1245 // Flags |= 0x10; // reserved (unused)
1246
1247 Bytes += Flags;
1248
1249 switch( pGrid->Get_Type() )
1250 {
1251 case SG_DATATYPE_Bit : Bytes += (BYTE )0 ; break; // 0: 1-bit boolean
1252 case SG_DATATYPE_Char : Bytes += (char )pGrid->Get_NoData_Value(); break; // 3: 8-bit signed integer
1253 case SG_DATATYPE_Byte : Bytes += (BYTE )pGrid->Get_NoData_Value(); break; // 4: 8-bit unsigned integer
1254 case SG_DATATYPE_Short : Bytes += (short )pGrid->Get_NoData_Value(); break; // 5: 16-bit signed integer
1255 case SG_DATATYPE_Word : Bytes += (WORD )pGrid->Get_NoData_Value(); break; // 6: 16-bit unsigned integer
1256 case SG_DATATYPE_Int : Bytes += (int )pGrid->Get_NoData_Value(); break; // 7: 32-bit signed integer
1257 case SG_DATATYPE_DWord : Bytes += (DWORD )pGrid->Get_NoData_Value(); break; // 8: 32-bit unsigned integer
1258 default : Bytes += (float )pGrid->Get_NoData_Value(); break; // 9: 32-bit float
1259 case SG_DATATYPE_Double: Bytes += (double)pGrid->Get_NoData_Value(); break; // 10: 64-bit float
1260 }
1261
1262 for(int y=0; y<pGrid->Get_NY() && SG_UI_Process_Set_Progress(y, pGrid->Get_NY()); y++)
1263 {
1264 for(int x=0; x<pGrid->Get_NX(); x++)
1265 {
1266 double Value = pGrid->is_NoData(x, y) ? pGrid->Get_NoData_Value() : pGrid->asDouble(x, y);
1267
1268 switch( pGrid->Get_Type() )
1269 {
1270 case SG_DATATYPE_Bit : Bytes += (BYTE )Value; break; // 0: 1-bit boolean
1271 case SG_DATATYPE_Char : Bytes += (char )Value; break; // 3: 8-bit signed integer
1272 case SG_DATATYPE_Byte : Bytes += (BYTE )Value; break; // 4: 8-bit unsigned integer
1273 case SG_DATATYPE_Short : Bytes += (short )Value; break; // 5: 16-bit signed integer
1274 case SG_DATATYPE_Word : Bytes += (WORD )Value; break; // 6: 16-bit unsigned integer
1275 case SG_DATATYPE_Int : Bytes += (int )Value; break; // 7: 32-bit signed integer
1276 case SG_DATATYPE_DWord : Bytes += (DWORD )Value; break; // 8: 32-bit unsigned integer
1277 default : Bytes += (float )Value; break; // 9: 32-bit float
1278 case SG_DATATYPE_Double: Bytes += (double)Value; break; // 10: 64-bit float
1279 }
1280 }
1281 }
1282
1283 return( true );
1284 }
1285
1286
1288 // //
1289 // //
1290 // //
1292
1293 //---------------------------------------------------------
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:519
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
SG_OGIS_TYPE_TriangleM
@ SG_OGIS_TYPE_TriangleM
Definition: shapes.h:1498
CSG_Bytes::Read_DWord
DWORD Read_DWord(bool bSwapBytes=false)
Definition: api_core.h:871
CSG_Shapes_OGIS_Converter::from_WKText
static bool from_WKText(const CSG_String &Text, CSG_Shape *pShape)
Definition: shapes_ogis.cpp:279
SG_T
#define SG_T(s)
Definition: api_core.h:531
SG_OGIS_TYPE_TINZ
@ SG_OGIS_TYPE_TINZ
Definition: shapes.h:1486
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_Bytes::Read_Int
int Read_Int(bool bSwapBytes=false)
Definition: api_core.h:870
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
SG_OGIS_TYPE_PolygonZ
@ SG_OGIS_TYPE_PolygonZ
Definition: shapes.h:1480
CSG_Bytes::Destroy
bool Destroy(void)
Definition: api_memory.cpp:829
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
CSG_Shape::Del_Parts
virtual int Del_Parts(void)
Definition: shapes.h:171
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Grid::Create
bool Create(const CSG_Grid &Grid)
Definition: grid.cpp:230
CSG_Bytes::Get_Count
int Get_Count(void) const
Definition: api_core.h:823
CSG_Bytes::Read_Word
WORD Read_Word(bool bSwapBytes=false)
Definition: api_core.h:869
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Shapes_OGIS_Converter::to_WKBinary
static bool to_WKBinary(CSG_Shape *pShape, CSG_Bytes &Bytes)
Definition: shapes_ogis.cpp:799
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
grid.h
SG_SSCANF
#define SG_SSCANF
Definition: api_core.h:534
CSG_Grid_OGIS_Converter::to_WKBinary
static bool to_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID=-1)
Definition: shapes_ogis.cpp:1197
SG_OGIS_TYPE_PolyhedralSurfaceZM
@ SG_OGIS_TYPE_PolyhedralSurfaceZM
Definition: shapes.h:1507
SG_OGIS_TYPE_MultiPolygon
@ SG_OGIS_TYPE_MultiPolygon
Definition: shapes.h:1472
SG_OGIS_TYPE_PointM
@ SG_OGIS_TYPE_PointM
Definition: shapes.h:1489
SG_OGIS_TYPE_PointZ
@ SG_OGIS_TYPE_PointZ
Definition: shapes.h:1478
TYPE_AS_WKB
#define TYPE_AS_WKB(t)
SG_OGIS_TYPE_MultiPoint
@ SG_OGIS_TYPE_MultiPoint
Definition: shapes.h:1470
SG_OGIS_TYPE_MultiLineString
@ SG_OGIS_TYPE_MultiLineString
Definition: shapes.h:1471
SSG_Point
Definition: geo_tools.h:128
CSG_Table_Record::Get_Table
class CSG_Table * Get_Table(void)
Definition: table.h:135
CSG_Projection::Get_EPSG
int Get_EPSG(void) const
Definition: geo_tools.h:883
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
CSG_Shapes_OGIS_Converter::to_ShapeType
static bool to_ShapeType(const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex)
Definition: shapes_ogis.cpp:925
CSG_Shapes_OGIS_Converter::from_WKBinary
static bool from_WKBinary(CSG_Bytes &Bytes, CSG_Shape *pShape)
Definition: shapes_ogis.cpp:583
SG_OGIS_TYPE_MultiPolygonZM
@ SG_OGIS_TYPE_MultiPolygonZM
Definition: shapes.h:1505
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
SG_OGIS_TYPE_PolygonM
@ SG_OGIS_TYPE_PolygonM
Definition: shapes.h:1491
SG_OGIS_TYPE_Undefined
@ SG_OGIS_TYPE_Undefined
Definition: shapes.h:1465
CSG_String::BeforeLast
CSG_String BeforeLast(char Character) const
Definition: api_string.cpp:677
SG_OGIS_BYTEORDER_NDR
@ SG_OGIS_BYTEORDER_NDR
Definition: shapes.h:1459
CSG_Bytes::Clear
bool Clear(void)
Definition: api_memory.cpp:844
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shapes_OGIS_Converter::Type_asWKBinary
static DWORD Type_asWKBinary(const CSG_String &Type)
Definition: shapes_ogis.cpp:114
CSG_Bytes::Rewind
void Rewind(void)
Definition: api_core.h:820
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:539
SG_OGIS_TYPE_LineString
@ SG_OGIS_TYPE_LineString
Definition: shapes.h:1468
CSG_Point
Definition: geo_tools.h:135
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shapes_OGIS_Converter::to_VertexType
static TSG_Vertex_Type to_VertexType(const CSG_String &Type)
Definition: shapes_ogis.cpp:1019
SG_OGIS_TYPE_GeometryCollectionZM
@ SG_OGIS_TYPE_GeometryCollectionZM
Definition: shapes.h:1506
SG_OGIS_TYPE_TINM
@ SG_OGIS_TYPE_TINM
Definition: shapes.h:1497
CSG_Bytes::Read_Byte
BYTE Read_Byte(void)
Definition: api_core.h:866
CSG_Shape::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shape.cpp:94
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:815
SG_OGIS_TYPE_TINZM
@ SG_OGIS_TYPE_TINZM
Definition: shapes.h:1508
SG_OGIS_TYPE_PolyhedralSurface
@ SG_OGIS_TYPE_PolyhedralSurface
Definition: shapes.h:1474
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:536
CSG_String::Trim_Both
int Trim_Both(void)
Definition: api_string.cpp:600
SG_OGIS_TYPE_Point
@ SG_OGIS_TYPE_Point
Definition: shapes.h:1467
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
SG_OGIS_TYPE_PolyhedralSurfaceZ
@ SG_OGIS_TYPE_PolyhedralSurfaceZ
Definition: shapes.h:1485
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:544
CSG_Array_Int
Definition: api_core.h:421
SG_OGIS_TYPE_TriangleZ
@ SG_OGIS_TYPE_TriangleZ
Definition: shapes.h:1487
SG_OGIS_TYPE_GeometryCollectionZ
@ SG_OGIS_TYPE_GeometryCollectionZ
Definition: shapes.h:1484
SG_OGIS_TYPE_LineStringZM
@ SG_OGIS_TYPE_LineStringZM
Definition: shapes.h:1501
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
CSG_Shapes_OGIS_Converter::to_WKText
static bool to_WKText(CSG_Shape *pShape, CSG_String &Text)
Definition: shapes_ogis.cpp:438
SG_OGIS_TYPE_GeometryCollection
@ SG_OGIS_TYPE_GeometryCollection
Definition: shapes.h:1473
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
CSG_Shapes_OGIS_Converter::from_ShapeType
static bool from_ShapeType(CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex=SG_VERTEX_TYPE_XY)
Definition: shapes_ogis.cpp:831
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
SG_OGIS_TYPE_TIN
@ SG_OGIS_TYPE_TIN
Definition: shapes.h:1475
CSG_Bytes
Definition: api_core.h:804
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SG_OGIS_TYPE_PolyhedralSurfaceM
@ SG_OGIS_TYPE_PolyhedralSurfaceM
Definition: shapes.h:1496
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
SG_OGIS_TYPE_GeometryCollectionM
@ SG_OGIS_TYPE_GeometryCollectionM
Definition: shapes.h:1495
SG_OGIS_TYPE_TriangleZM
@ SG_OGIS_TYPE_TriangleZM
Definition: shapes.h:1509
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
SG_OGIS_TYPE_Triangle
@ SG_OGIS_TYPE_Triangle
Definition: shapes.h:1476
CSG_String
Definition: api_core.h:557
CSG_Grid_OGIS_Converter::from_WKBinary
static bool from_WKBinary(CSG_Bytes &Bytes, class CSG_Grid *pGrid)
Definition: shapes_ogis.cpp:1101
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:535
SG_OGIS_TYPE_PointZM
@ SG_OGIS_TYPE_PointZM
Definition: shapes.h:1500
CSG_Shapes_OGIS_Converter::Type_asWKText
static CSG_String Type_asWKText(DWORD Type)
Definition: shapes_ogis.cpp:61
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SSG_Point::x
double x
Definition: geo_tools.h:129
SG_OGIS_TYPE_MultiPolygonM
@ SG_OGIS_TYPE_MultiPolygonM
Definition: shapes.h:1494
CSG_Bytes::Read_Char
char Read_Char(void)
Definition: api_core.h:867
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
SG_OGIS_TYPE_MultiPointZM
@ SG_OGIS_TYPE_MultiPointZM
Definition: shapes.h:1503
CSG_Bytes::Read_Float
float Read_Float(bool bSwapBytes=false)
Definition: api_core.h:872
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Data_Object::Set_NoData_Value
virtual bool Set_NoData_Value(double Value)
Definition: dataobject.cpp:513
SG_OGIS_TYPE_MultiPointZ
@ SG_OGIS_TYPE_MultiPointZ
Definition: shapes.h:1481
SG_OGIS_TYPE_PolygonZM
@ SG_OGIS_TYPE_PolygonZM
Definition: shapes.h:1502
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:194
CSG_Shapes
Definition: shapes.h:773
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_Bytes::Read_Short
short Read_Short(bool bSwapBytes=false)
Definition: api_core.h:868
SG_OGIS_TYPE_Polygon
@ SG_OGIS_TYPE_Polygon
Definition: shapes.h:1469
SG_OGIS_TYPE_LineStringZ
@ SG_OGIS_TYPE_LineStringZ
Definition: shapes.h:1479
SG_OGIS_TYPE_MultiPointM
@ SG_OGIS_TYPE_MultiPointM
Definition: shapes.h:1492
CSG_Bytes::is_EOF
bool is_EOF(void)
Definition: api_core.h:821
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_OGIS_TYPE_MultiLineStringZM
@ SG_OGIS_TYPE_MultiLineStringZM
Definition: shapes.h:1504
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:699
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
CSG_Bytes::Read_Double
double Read_Double(bool bSwapBytes=false)
Definition: api_core.h:873
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:210
SG_OGIS_TYPE_MultiPolygonZ
@ SG_OGIS_TYPE_MultiPolygonZ
Definition: shapes.h:1483
CSG_Shape
Definition: shapes.h:141
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:578
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
SG_OGIS_TYPE_MultiLineStringM
@ SG_OGIS_TYPE_MultiLineStringM
Definition: shapes.h:1493
SG_OGIS_TYPE_MultiLineStringZ
@ SG_OGIS_TYPE_MultiLineStringZ
Definition: shapes.h:1482
SG_OGIS_TYPE_LineStringM
@ SG_OGIS_TYPE_LineStringM
Definition: shapes.h:1490
CSG_Grid::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grid.h:549
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes_polygons.cpp File Reference

  • saga_core
  • saga_api
Functions
shapes_polygons.cpp File Reference
#include "shapes.h"
#include "clipper1/clipper.hpp"

Go to the source code of this file.

Functions

bool | _SG_Polygon_Clip (ClipperLib::ClipType ClipType, CSG_Shape *pPolygon, CSG_Shape *pClip, CSG_Shape *pResult)
bool | SG_Shape_Get_Intersection (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
bool | SG_Shape_Get_Difference (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
bool | SG_Shape_Get_ExclusiveOr (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
bool | SG_Shape_Get_Union (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
bool | SG_Shape_Get_Dissolve (CSG_Shape *pPolygon, CSG_Shape *pResult)
bool | SG_Shape_Get_Offset (CSG_Shape *pPolygon, double dSize, double dArc, CSG_Shape *pResult)
const char * | SG_Clipper_Get_Version (void)

Function Documentation

◆ _SG_Polygon_Clip()

bool _SG_Polygon_Clip | ( | ClipperLib::ClipType | ClipType,
 |  | CSG_Shape * | pPolygon,
 |  | CSG_Shape * | pClip,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 257 of file shapes_polygons.cpp.

References CSG_Shape::Get_Extent(), CSG_Shape::Get_Type(), SHAPE_TYPE_Line, and CSG_Rect::Union().

Referenced by SG_Shape_Get_Difference(), SG_Shape_Get_ExclusiveOr(), SG_Shape_Get_Intersection(), and SG_Shape_Get_Union().

◆ SG_Clipper_Get_Version()

const char* SG_Clipper_Get_Version ( void )

Definition at line 470 of file shapes_polygons.cpp.

◆ SG_Shape_Get_Difference()

bool SG_Shape_Get_Difference | ( | CSG_Shape * | pPolygon,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 330 of file shapes_polygons.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Dissolve()

bool SG_Shape_Get_Dissolve | ( | CSG_Shape * | pPolygon,
 |  | CSG_Shape * | pResult
 | ) |  |

Assuming supplied shape object is of type polygon and has several parts, it is important that the point order of outer rings (i.e. not lakes) is clockwise, that of lakes counter-clockwise to be processed correctly by the Clipper dissolve function. This is in accordance with the simple features definition but in contrast to ESRI's Shapefile format.

Definition at line 414 of file shapes_polygons.cpp.

References CSG_Shape::Get_Extent().

◆ SG_Shape_Get_ExclusiveOr()

bool SG_Shape_Get_ExclusiveOr | ( | CSG_Shape * | pPolygon,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 349 of file shapes_polygons.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Add_Point(), CSG_Shape::Assign(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Intersection()

bool SG_Shape_Get_Intersection | ( | CSG_Shape * | pPolygon,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 307 of file shapes_polygons.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Assign(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

◆ SG_Shape_Get_Offset()

bool SG_Shape_Get_Offset | ( | CSG_Shape * | pPolygon,
 |  | double | dSize,
 |  | double | dArc,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 435 of file shapes_polygons.cpp.

References CSG_Shape::Get_Extent(), CSG_Shape::Get_Type(), CSG_Rect::Inflate(), and SHAPE_TYPE_Polygon.

◆ SG_Shape_Get_Union()

bool SG_Shape_Get_Union | ( | CSG_Shape * | pPolygon,
 |  | CSG_Shape_Polygon * | pClip,
 |  | CSG_Shape * | pResult
 | ) |  |

Definition at line 379 of file shapes_polygons.cpp.

References _SG_Polygon_Clip(), CSG_Shape::Add_Point(), CSG_Shape::Assign(), CSG_Shape::Get_Part_Count(), CSG_Shape_Points::Get_Point(), CSG_Shape_Points::Get_Point_Count(), INTERSECTION_Contained, INTERSECTION_Contains, INTERSECTION_Identical, INTERSECTION_None, INTERSECTION_Overlaps, and CSG_Shape::Intersects().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes_polygons.cpp Source File

  • saga_core
  • saga_api
shapes_polygons.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_polygons.cpp //
15 // //
16 // Copyright (C) 2011 by //
17 // Olaf Conrad //
18 // //
19 //-------------------------------------------------------//
20 // //
21 // This file is part of 'SAGA - System for Automated //
22 // Geoscientific Analyses'. //
23 // //
24 // This library is free software; you can redistribute //
25 // it and/or modify it under the terms of the GNU Lesser //
26 // General Public License as published by the Free //
27 // Software Foundation, either version 2.1 of the //
28 // License, or (at your option) any later version. //
29 // //
30 // This library is distributed in the hope that it will //
31 // be useful, but WITHOUT ANY WARRANTY; without even the //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
33 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
34 // License for more details. //
35 // //
36 // You should have received a copy of the GNU Lesser //
37 // General Public License along with this program; if //
38 // not, see <http://www.gnu.org/licenses/>. //
39 // //
40 //-------------------------------------------------------//
41 // //
42 // e-mail: oconrad@saga-gis.de //
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Hamburg //
47 // Germany //
48 // //
50
51 //---------------------------------------------------------
52 #include "shapes.h"
53
54 #include "clipper1/clipper.hpp"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 class CSG_Converter_WorldToInt
65 {
66 public:
67
68 CSG_Converter_WorldToInt (void) { Create(0.0, 1.0, 0.0, 1.0); }
69 CSG_Converter_WorldToInt (const CSG_Converter_WorldToInt &Converter) { Create(Converter); }
70 CSG_Converter_WorldToInt (double xOffset, double xScale, double yOffset, double yScale) { Create(xOffset, xScale, yOffset, yScale); }
71 CSG_Converter_WorldToInt (const CSG_Rect &Extent, bool bAspectRatio = false) { Create(Extent, bAspectRatio); }
72
73 bool Create (const CSG_Converter_WorldToInt &Converter)
74 {
75 return( Create(Converter.m_xOffset, Converter.m_xScale, Converter.m_yOffset, Converter.m_yScale) );
76 }
77
78 bool Create (double xOffset, double xScale, double yOffset, double yScale)
79 {
80 if( xScale != 0.0 && yScale != 0.0 )
81 {
82 m_xOffset = xOffset;
83 m_xScale = xScale;
84 m_yOffset = yOffset;
85 m_yScale = yScale;
86
87 return( true );
88 }
89
90 return( false );
91 }
92
93 bool Create (const CSG_Rect &Extent, bool bAspectRatio = false)
94 {
95 double xRange = Extent.Get_XRange();
96 double yRange = Extent.Get_YRange();
97 double xMin = Extent.Get_XMin ();
98 double yMin = Extent.Get_YMin ();
99
100 if( bAspectRatio )
101 {
102 if( xRange < yRange )
103 {
104 xRange = yRange;
105 }
106 else if( yRange < xRange )
107 {
108 yRange = xRange;
109 }
110 }
111
112 return( xRange > 0 && yRange > 0 ? Create(
113 xMin, (0x3FFFFFFFFFFFFFF) / xRange,
114 yMin, (0x3FFFFFFFFFFFFFF) / yRange
115 ) : false);
116 }
117
118 static ClipperLib::cInt Round (double Value) { return( (ClipperLib::cInt)(Value < 0.0 ? Value - 0.5 : Value + 0.5) ); }
119
120 ClipperLib::cInt Get_X_asInt (double Value) const { return( Round((Value - m_xOffset) * m_xScale) ); }
121 ClipperLib::cInt Get_Y_asInt (double Value) const { return( Round((Value - m_yOffset) * m_yScale) ); }
122
123 double Get_X_asWorld (ClipperLib::cInt Value) const { return( m_xOffset + Value / m_xScale ); }
124 double Get_Y_asWorld (ClipperLib::cInt Value) const { return( m_yOffset + Value / m_yScale ); }
125
126 bool Convert (CSG_Shapes *pPolygons , ClipperLib::Paths &P ) const;
127 bool Convert (const ClipperLib::Paths &P, CSG_Shapes *pPolygons) const;
128
129 bool Convert (CSG_Shape *pPolygon , ClipperLib::Paths &P) const;
130 bool Convert (const ClipperLib::Paths &P, CSG_Shape *pPolygon ) const;
131
132 double Get_xScale (void) const { return( m_xScale ); }
133 double Get_yScale (void) const { return( m_yScale ); }
134
135
136 private:
137
138 double m_xOffset, m_xScale, m_yOffset, m_yScale;
139
140
141 };
142
143
145 // //
147
148 //---------------------------------------------------------
149 bool CSG_Converter_WorldToInt::Convert(CSG_Shapes *pPolygons, ClipperLib::Paths &Polygons) const
150 {
151 Polygons.clear();
152
153 for(int iPolygon=0, jPolygon=0; iPolygon<pPolygons->Get_Count(); iPolygon++)
154 {
155 CSG_Shape *pPolygon = pPolygons->Get_Shape(iPolygon);
156
157 for(int iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++, jPolygon++)
158 {
159 bool bAscending = pPolygon->Get_Type() != SHAPE_TYPE_Polygon
160 || (((CSG_Shape_Polygon *)pPolygon)->is_Lake(iPart)
161 == ((CSG_Shape_Polygon *)pPolygon)->is_Clockwise(iPart));
162
163 Polygons.resize(1 + jPolygon);
164 Polygons[jPolygon].resize(pPolygon->Get_Point_Count(iPart));
165
166 for(int iPoint=0; iPoint<pPolygon->Get_Point_Count(iPart); iPoint++)
167 {
168 TSG_Point p = pPolygon->Get_Point(iPoint, iPart, bAscending);
169
170 Polygons[jPolygon][iPoint].X = Get_X_asInt(p.x);
171 Polygons[jPolygon][iPoint].Y = Get_Y_asInt(p.y);
172 }
173 }
174 }
175
176 return( Polygons.size() > 0 );
177 }
178
179 //---------------------------------------------------------
180 bool CSG_Converter_WorldToInt::Convert(const ClipperLib::Paths &Polygons, CSG_Shapes *pPolygons) const
181 {
182 pPolygons->Del_Shapes();
183
184 CSG_Shape *pPolygon = pPolygons->Add_Shape();
185
186 return( Convert(Polygons, pPolygon) );
187 }
188
189
191 // //
193
194 //---------------------------------------------------------
195 bool CSG_Converter_WorldToInt::Convert(CSG_Shape *pPolygon, ClipperLib::Paths &Polygons) const
196 {
197 Polygons.clear();
198
199 for(int iPart=0, iPolygon=0; iPart<pPolygon->Get_Part_Count(); iPart++, iPolygon++)
200 {
201 if( pPolygon->Get_Point_Count(iPart) > 0 )
202 {
203 bool bAscending = pPolygon->Get_Type() != SHAPE_TYPE_Polygon
204 || (((CSG_Shape_Polygon *)pPolygon)->is_Lake(iPart)
205 == ((CSG_Shape_Polygon *)pPolygon)->is_Clockwise(iPart));
206
207 Polygons.resize(1 + iPolygon);
208
209 for(int iPoint=0; iPoint<pPolygon->Get_Point_Count(iPart); iPoint++)
210 {
211 TSG_Point p = pPolygon->Get_Point(iPoint, iPart, bAscending);
212
213 ClipperLib::IntPoint Point(Get_X_asInt(p.x), Get_Y_asInt(p.y));
214
215 if( iPoint == 0 || Polygons[iPolygon].back() != Point ) // don't add duplicates !!!
216 {
217 Polygons[iPolygon].push_back(Point);
218 }
219 }
220
221 if( pPolygon->Get_Type() == SHAPE_TYPE_Polygon && Polygons[iPolygon].size() > 1 && Polygons[iPolygon][0] == Polygons[iPolygon].back() )
222 {
223 Polygons[iPolygon].pop_back();
224 }
225 }
226 }
227
228 return( Polygons.size() > 0 );
229 }
230
231 //---------------------------------------------------------
232 bool CSG_Converter_WorldToInt::Convert(const ClipperLib::Paths &Polygons, CSG_Shape *pPolygon) const
233 {
234 pPolygon->Del_Parts();
235
236 for(size_t iPolygon=0; iPolygon<Polygons.size(); iPolygon++)
237 {
238 for(size_t iPoint=0; iPoint<Polygons[iPolygon].size(); iPoint++)
239 {
240 pPolygon->Add_Point(
241 Get_X_asWorld(Polygons[iPolygon][iPoint].X),
242 Get_Y_asWorld(Polygons[iPolygon][iPoint].Y),
243 (int)iPolygon
244 );
245 }
246 }
247
248 return( pPolygon->Get_Part_Count() > 0 );
249 }
250
251
253 // //
255
256 //---------------------------------------------------------
257 bool _SG_Polygon_Clip(ClipperLib::ClipType ClipType, CSG_Shape *pPolygon, CSG_Shape *pClip, CSG_Shape *pResult)
258 {
259 CSG_Rect r(pPolygon->Get_Extent()); r.Union(pClip->Get_Extent());
260
261 CSG_Converter_WorldToInt Converter(r);
262
263 ClipperLib::Paths Polygon, Clip, Result;
264
265 if( Converter.Convert(pPolygon, Polygon)
266 && Converter.Convert(pClip , Clip ) )
267 {
268 ClipperLib::Clipper Clipper;
269
270 Clipper.AddPaths(Clip, ClipperLib::ptClip, true);
271
272 if( pPolygon->Get_Type() != SHAPE_TYPE_Line )
273 {
274 Clipper.AddPaths(Polygon, ClipperLib::ptSubject, true);
275
276 if( !Clipper.Execute(ClipType, Result) )
277 {
278 return( false );
279 }
280 }
281 else
282 {
283 Clipper.AddPaths(Polygon, ClipperLib::ptSubject, false);
284
285 ClipperLib::PolyTree PolyTree;
286
287 if( !Clipper.Execute(ClipType, PolyTree) )
288 {
289 return( false );
290 }
291
292 ClipperLib::PolyTreeToPaths(PolyTree, Result);
293 }
294
295 return( Converter.Convert(Result, pResult ? pResult : pPolygon) );
296 }
297
298 return( false );
299 }
300
301
303 // //
305
306 //---------------------------------------------------------
307 bool SG_Shape_Get_Intersection (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
308 {
309 switch( pClip->Intersects(pPolygon) )
310 {
311 case INTERSECTION_None:
312 return( false );
313
314 case INTERSECTION_Identical:
315 case INTERSECTION_Contains:
316 if( pResult ) pResult->Assign(pPolygon, false);
317 return( true );
318
319 case INTERSECTION_Contained:
320 if( pResult ) pResult ->Assign(pClip , false);
321 else pPolygon->Assign(pClip , false);
322 return( true );
323
324 case INTERSECTION_Overlaps: default:
325 return( _SG_Polygon_Clip(ClipperLib::ctIntersection , pPolygon, pClip, pResult) );
326 }
327 }
328
329 //---------------------------------------------------------
330 bool SG_Shape_Get_Difference (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
331 {
332 switch( pClip->Intersects(pPolygon) )
333 {
334 case INTERSECTION_Contains:
335 case INTERSECTION_Identical:
336 return( false );
337
338 case INTERSECTION_None:
339 if( pResult ) pResult->Assign(pPolygon, false);
340 return( true );
341
342 case INTERSECTION_Contained:
343 case INTERSECTION_Overlaps: default:
344 return( _SG_Polygon_Clip(ClipperLib::ctDifference , pPolygon, pClip, pResult) );
345 }
346 }
347
348 //---------------------------------------------------------
349 bool SG_Shape_Get_ExclusiveOr (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
350 {
351 switch( pClip->Intersects(pPolygon) )
352 {
353 case INTERSECTION_Identical:
354 return( false );
355
356 case INTERSECTION_None:
357 if( pResult ) pResult->Assign(pPolygon, false);
358 else pResult = pPolygon;
359
360 { for(int iPart=0, jPart=pResult->Get_Part_Count(); iPart<pClip->Get_Part_Count(); iPart++, jPart++)
361 {
362 for(int iPoint=0; iPoint<pClip->Get_Point_Count(iPart); iPoint++)
363 {
364 pResult->Add_Point(pClip->Get_Point(iPoint, iPart), jPart);
365 }
366 }
367 }
368
369 return( true );
370
371 case INTERSECTION_Contained:
372 case INTERSECTION_Contains:
373 case INTERSECTION_Overlaps: default:
374 return( _SG_Polygon_Clip(ClipperLib::ctXor , pPolygon, pClip, pResult) );
375 }
376 }
377
378 //---------------------------------------------------------
379 bool SG_Shape_Get_Union (CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
380 {
381 switch( pClip->Intersects(pPolygon) )
382 {
383 case INTERSECTION_Contained:
384 case INTERSECTION_Identical:
385 if( pResult ) pResult->Assign(pPolygon, false);
386 return( true );
387
388 case INTERSECTION_Contains:
389 if( pResult ) pResult ->Assign(pClip , false);
390 else pPolygon->Assign(pClip , false);
391 return( true );
392
393 case INTERSECTION_None:
394 if( pResult ) pResult->Assign(pPolygon, false);
395 else pResult = pPolygon;
396
397 { for(int iPart=0, jPart=pResult->Get_Part_Count(); iPart<pClip->Get_Part_Count(); iPart++, jPart++)
398 {
399 for(int iPoint=0; iPoint<pClip->Get_Point_Count(iPart); iPoint++)
400 {
401 pResult->Add_Point(pClip->Get_Point(iPoint, iPart), jPart);
402 }
403 }
404 }
405
406 return( true );
407
408 case INTERSECTION_Overlaps: default:
409 return( _SG_Polygon_Clip(ClipperLib::ctUnion , pPolygon, pClip, pResult) );
410 }
411 }
412
413 //---------------------------------------------------------
414 bool SG_Shape_Get_Dissolve (CSG_Shape *pPolygon, CSG_Shape *pResult)
415 {
416 CSG_Converter_WorldToInt Converter(pPolygon->Get_Extent());
417
418 ClipperLib::Paths Polygon, Result;
419
420 if( Converter.Convert(pPolygon, Polygon) )
421 {
422 ClipperLib::Clipper Clipper;
423
424 Clipper.AddPaths(Polygon, ClipperLib::ptSubject, true);
425
426 Clipper.Execute(ClipperLib::ctUnion, Result);
427
428 return( Converter.Convert(Result, pResult ? pResult : pPolygon) );
429 }
430
431 return( false );
432 }
433
434 //---------------------------------------------------------
435 bool SG_Shape_Get_Offset (CSG_Shape *pPolygon, double dSize, double dArc, CSG_Shape *pResult)
436 {
437 CSG_Rect r(pPolygon->Get_Extent()); if( dSize > 0.0 ) r.Inflate(5.0 * dSize, false);
438
439 CSG_Converter_WorldToInt Converter(r, true);
440
441 ClipperLib::Paths Paths, Result;
442
443 if( Converter.Convert(pPolygon, Paths) )
444 {
445 ClipperLib::ClipperOffset Offset(2.0, dArc * Converter.Get_xScale());
446
447 if( pPolygon->Get_Type() == SHAPE_TYPE_Polygon )
448 {
449 Offset.AddPaths(Paths, ClipperLib::jtRound, ClipperLib::etClosedPolygon);
450 }
451 else
452 {
453 Offset.AddPaths(Paths, ClipperLib::jtRound, ClipperLib::etOpenRound);
454 }
455
456 Offset.Execute(Result, dSize * Converter.Get_xScale());
457
458 return( Converter.Convert(Result, pResult ? pResult : pPolygon) );
459 }
460
461 return( false );
462 }
463
464
466 // //
468
469 //---------------------------------------------------------
470 const char * SG_Clipper_Get_Version (void)
471 {
472 return( "Clipper1 " CLIPPER_VERSION );
473 }
474
475
477 // //
478 // //
479 // //
481
482 //---------------------------------------------------------
CSG_Rect
Definition: geo_tools.h:471
SG_Shape_Get_ExclusiveOr
bool SG_Shape_Get_ExclusiveOr(CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:349
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
SG_Shape_Get_Union
bool SG_Shape_Get_Union(CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:379
CSG_Shape::Del_Parts
virtual int Del_Parts(void)
Definition: shapes.h:171
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
SG_Shape_Get_Dissolve
bool SG_Shape_Get_Dissolve(CSG_Shape *pPolygon, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:414
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
SSG_Point
Definition: geo_tools.h:128
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shapes::Del_Shapes
virtual bool Del_Shapes(void)
Definition: shapes.h:822
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_Shape_Get_Intersection
bool SG_Shape_Get_Intersection(CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:307
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
SG_Shape_Get_Difference
bool SG_Shape_Get_Difference(CSG_Shape *pPolygon, CSG_Shape_Polygon *pClip, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:330
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
SG_Shape_Get_Offset
bool SG_Shape_Get_Offset(CSG_Shape *pPolygon, double dSize, double dArc, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:435
shapes.h
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Shapes
Definition: shapes.h:773
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Shape_Polygon
Definition: shapes.h:699
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
_SG_Polygon_Clip
bool _SG_Polygon_Clip(ClipperLib::ClipType ClipType, CSG_Shape *pPolygon, CSG_Shape *pClip, CSG_Shape *pResult)
Definition: shapes_polygons.cpp:257
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
SG_Clipper_Get_Version
const char * SG_Clipper_Get_Version(void)
Definition: shapes_polygons.cpp:470
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: shapes_selection.cpp File Reference

  • saga_core
  • saga_api
shapes_selection.cpp File Reference
#include "shapes.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: shapes_selection.cpp Source File

  • saga_core
  • saga_api
shapes_selection.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes_selection.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "shapes.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 bool CSG_Shapes::Select(sLong Index, bool bInvert)
64 {
65 return( CSG_Table::Select(Index, bInvert) );
66 }
67
68 //---------------------------------------------------------
69 bool CSG_Shapes::Select(CSG_Table_Record *pShape, bool bInvert)
70 {
71 return( CSG_Table::Select(pShape, bInvert) );
72 }
73
74 //---------------------------------------------------------
75 bool CSG_Shapes::Select(const TSG_Rect &Extent, bool bInvert)
76 {
77 if( !bInvert )
78 {
79 CSG_Table::Select();
80 }
81
82 for(sLong i=0; i<Get_Count(); i++)
83 {
84 if( Get_Shape(i)->Intersects(Extent) )
85 {
86 CSG_Table::Select(i, true);
87 }
88 }
89
90 return( Get_Selection_Count() > 0 );
91 }
92
93 //---------------------------------------------------------
94 bool CSG_Shapes::Select(const TSG_Point &Point, bool bInvert)
95 {
96 if( Get_Type() != SHAPE_TYPE_Polygon )
97 {
98 return( Select(CSG_Rect(Point, Point), bInvert) );
99 }
100
101 if( !bInvert )
102 {
103 CSG_Table::Select();
104 }
105
106 for(sLong i=0; i<Get_Count(); i++)
107 {
108 if( ((CSG_Shape_Polygon *)Get_Shape(i))->Contains(Point) )
109 {
110 CSG_Table::Select(i, true);
111 }
112 }
113
114 return( Get_Selection_Count() > 0 );
115 }
116
117 //---------------------------------------------------------
118 const CSG_Rect & CSG_Shapes::Get_Selection_Extent(void)
119 {
120 if( Get_Selection_Count() > 0 )
121 {
122 m_Extent_Selected = ((CSG_Shape *)Get_Selection(0))->Get_Extent();
123
124 for(sLong i=1; i<Get_Selection_Count(); i++)
125 {
126 m_Extent_Selected.Union(((CSG_Shape *)Get_Selection(i))->Get_Extent());
127 }
128 }
129 else
130 {
131 m_Extent_Selected.Assign(0., 0., 0., 0.);
132 }
133
134 return( m_Extent_Selected );
135 }
136
137
139 // //
140 // //
141 // //
143
144 //---------------------------------------------------------
CSG_Rect
Definition: geo_tools.h:471
CSG_Shapes::m_Extent_Selected
CSG_Rect m_Extent_Selected
Definition: shapes.h:849
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Shapes::Get_Selection
virtual CSG_Shape * Get_Selection(sLong Index=0)
Definition: shapes.h:833
CSG_Table_Record
Definition: table.h:130
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
SSG_Point
Definition: geo_tools.h:128
SSG_Rect
Definition: geo_tools.h:464
CSG_Shapes::Get_Selection_Extent
virtual const CSG_Rect & Get_Selection_Extent(void)
Definition: shapes_selection.cpp:118
CSG_Table::Get_Selection_Count
sLong Get_Selection_Count(void) const
Definition: table.h:413
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
shapes.h
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Shape
Definition: shapes.h:141
CSG_Shapes::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: shapes_selection.cpp:63
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: table.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
table.cpp File Reference
#include "table.h"
#include "shapes.h"
#include "tool_library.h"

Go to the source code of this file.

Macros

#define | GET_GROW_SIZE(n) (n < 256 ? 1 : (n < 8192 ? 128 : 1024))
#define | GET_RECORD(i) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))
#define | GET_RECORD(i) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))

Functions

CSG_Table * | SG_Create_Table (void)
CSG_Table * | SG_Create_Table (const CSG_Table &Table)
CSG_Table * | SG_Create_Table (CSG_Table *pTemplate)
CSG_Table * | SG_Create_Table (const char *File, TSG_Table_File_Type Format, int Encoding)
CSG_Table * | SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format, int Encoding)
CSG_Table * | SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format, int Encoding)
CSG_Table * | SG_Create_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)
CSG_Table * | SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)
CSG_Table * | SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)

Macro Definition Documentation

◆ GET_GROW_SIZE

#define GET_GROW_SIZE ( n ) (n < 256 ? 1 : (n < 8192 ? 128 : 1024))

Definition at line 748 of file table.cpp.

◆ GET_RECORD [1/2]

#define GET_RECORD ( i ) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))

◆ GET_RECORD [2/2]

#define GET_RECORD ( i ) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))

Function Documentation

◆ SG_Create_Table() [1/9]

CSG_Table* SG_Create_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 118 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [2/9]

CSG_Table* SG_Create_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 110 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [3/9]

CSG_Table* SG_Create_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 120 of file table.cpp.

◆ SG_Create_Table() [4/9]

CSG_Table* SG_Create_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 112 of file table.cpp.

◆ SG_Create_Table() [5/9]

CSG_Table* SG_Create_Table ( const CSG_Table & Table )

Safe table construction

Definition at line 71 of file table.cpp.

References CSG_Table::Get_ObjectType(), SG_Create_Shapes(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_DATAOBJECT_TYPE_Table.

◆ SG_Create_Table() [6/9]

CSG_Table* SG_Create_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 119 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [7/9]

CSG_Table* SG_Create_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 111 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [8/9]

CSG_Table* SG_Create_Table ( CSG_Table * pTemplate )

Safe table construction

Definition at line 88 of file table.cpp.

References CSG_Table::Get_ObjectType(), SG_Create_Shapes(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_DATAOBJECT_TYPE_Table.

◆ SG_Create_Table() [9/9]

CSG_Table* SG_Create_Table ( void )

Safe table construction

Definition at line 65 of file table.cpp.

Referenced by SG_Create_Table().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table.cpp Source File

  • saga_core
  • saga_api
table.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "table.h"
54 #include "shapes.h"
55 #include "tool_library.h"
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 CSG_Table * SG_Create_Table(void)
66 {
67 return( new CSG_Table );
68 }
69
70 //---------------------------------------------------------
71 CSG_Table * SG_Create_Table(const CSG_Table &Table)
72 {
73 switch( Table.Get_ObjectType() )
74 {
75 case SG_DATAOBJECT_TYPE_Table:
76 return( new CSG_Table(Table) );
77
78 case SG_DATAOBJECT_TYPE_Shapes:
79 case SG_DATAOBJECT_TYPE_PointCloud:
80 return( SG_Create_Shapes(*((CSG_Shapes *)&Table)) );
81
82 default:
83 return( NULL );
84 }
85 }
86
87 //---------------------------------------------------------
88 CSG_Table * SG_Create_Table(CSG_Table *pTemplate)
89 {
90 if( pTemplate )
91 {
92 switch( pTemplate->Get_ObjectType() )
93 {
94 case SG_DATAOBJECT_TYPE_Table:
95 return( new CSG_Table(pTemplate) );
96
97 case SG_DATAOBJECT_TYPE_Shapes:
98 case SG_DATAOBJECT_TYPE_PointCloud:
99 return( SG_Create_Shapes((CSG_Shapes *)pTemplate) );
100
101 default:
102 break;
103 }
104 }
105
106 return( new CSG_Table() );
107 }
108
109 //---------------------------------------------------------
110 CSG_Table * SG_Create_Table(const char *File, TSG_Table_File_Type Format, int Encoding) { return( SG_Create_Table(CSG_String(File), Format, Encoding) ); }
111 CSG_Table * SG_Create_Table(const wchar_t *File, TSG_Table_File_Type Format, int Encoding) { return( SG_Create_Table(CSG_String(File), Format, Encoding) ); }
112 CSG_Table * SG_Create_Table(const CSG_String &File, TSG_Table_File_Type Format, int Encoding)
113 {
114 return( new CSG_Table(File, Format, Encoding) );
115 }
116
117 //---------------------------------------------------------
118 CSG_Table * SG_Create_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) { return( SG_Create_Table(CSG_String(File), Format, Separator, Encoding) ); }
119 CSG_Table * SG_Create_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) { return( SG_Create_Table(CSG_String(File), Format, Separator, Encoding) ); }
120 CSG_Table * SG_Create_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)
121 {
122 return( new CSG_Table(File, Format, Encoding) );
123 }
124
125
127 // //
128 // //
129 // //
131
132 //---------------------------------------------------------
133 CSG_Table::CSG_Table(void)
134 : CSG_Data_Object()
135 {
136 _On_Construction();
137 }
138
139 //---------------------------------------------------------
140 CSG_Table::CSG_Table(const CSG_Table &Table)
141 : CSG_Data_Object()
142 {
143 _On_Construction(); Create(Table);
144 }
145
146 bool CSG_Table::Create(const CSG_Table &Table)
147 {
148 return( Assign((CSG_Data_Object *)&Table) );
149 }
150
151 //---------------------------------------------------------
152 CSG_Table::CSG_Table(const char *File, TSG_Table_File_Type Format, int Encoding) : CSG_Table(CSG_String(File), Format, Encoding) {}
153 CSG_Table::CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, int Encoding) : CSG_Table(CSG_String(File), Format, Encoding) {}
154 CSG_Table::CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, int Encoding)
155 : CSG_Data_Object()
156 {
157 _On_Construction(); Create(File, Format, Encoding);
158 }
159
160 bool CSG_Table::Create(const char *File, TSG_Table_File_Type Format, int Encoding) { return( Create(CSG_String(File), Format, Encoding) ); }
161 bool CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format, int Encoding) { return( Create(CSG_String(File), Format, Encoding) ); }
162 bool CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format, int Encoding)
163 {
164 Destroy();
165
166 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Loading"), _TL("table"), File.c_str()), true);
167
168 //-----------------------------------------------------
169 bool bResult = File.BeforeFirst(':').Cmp("PGSQL") && SG_File_Exists(File) && Load(File, (int)Format, '\0', Encoding);
170
171 if( bResult )
172 {
173 Set_File_Name(File, true);
174 }
175
176 //-----------------------------------------------------
177 else if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
178 {
179 CSG_String s(File);
180
181 s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
182 s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
183 s = s.AfterFirst(':'); CSG_String DBName(s.BeforeFirst(':'));
184 s = s.AfterFirst(':'); CSG_String Table (s.BeforeFirst(':'));
185
186 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 0, true); // CGet_Connections
187
188 if( pTool != NULL )
189 {
190 SG_UI_ProgressAndMsg_Lock(true);
191
192 //---------------------------------------------
193 CSG_Table Connections; CSG_String Connection(DBName + " [" + Host + ":" + Port + "]");
194
195 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
196
197 if( SG_TOOL_PARAMETER_SET("CONNECTIONS", &Connections) && pTool->Execute() ) // CGet_Connections
198 {
199 for(int i=0; !bResult && i<Connections.Get_Count(); i++)
200 {
201 if( !Connection.Cmp(Connections[i].asString(0)) )
202 {
203 bResult = true;
204 }
205 }
206 }
207
208 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
209
210 //---------------------------------------------
211 if( bResult && (bResult = (pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 12, true)) != NULL) == true ) // CPGIS_Table_Load
212 {
213 pTool->Set_Manager(NULL); pTool->On_Before_Execution();
214
215 bResult = SG_TOOL_PARAMETER_SET("CONNECTION", Connection)
216 && SG_TOOL_PARAMETER_SET("DB_TABLE" , Table )
217 && SG_TOOL_PARAMETER_SET("TABLE" , this )
218 && pTool->Execute();
219
220 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
221 }
222
223 SG_UI_ProgressAndMsg_Lock(false);
224 }
225 }
226
227 //-----------------------------------------------------
228 if( bResult )
229 {
230 Set_Modified(false);
231 Set_Update_Flag();
232
233 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
234
235 return( true );
236 }
237
238 Destroy();
239
240 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
241
242 return( false );
243 }
244
245 //---------------------------------------------------------
246 CSG_Table::CSG_Table(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) : CSG_Table(CSG_String(File), Format, Separator, Encoding) {}
247 CSG_Table::CSG_Table(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) : CSG_Table(CSG_String(File), Format, Separator, Encoding) {}
248 CSG_Table::CSG_Table(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)
249 : CSG_Data_Object()
250 {
251 _On_Construction(); Create(File, Format, Separator, Encoding);
252 }
253
254 bool CSG_Table::Create(const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) { return( Create(CSG_String(File), Format, Separator, Encoding) ); }
255 bool CSG_Table::Create(const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding) { return( Create(CSG_String(File), Format, Separator, Encoding) ); }
256 bool CSG_Table::Create(const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding)
257 {
258 return( Load(File, (int)Format, Separator, Encoding) );
259 }
260
261 //---------------------------------------------------------
262 CSG_Table::CSG_Table(const CSG_Table *pTemplate)
263 : CSG_Data_Object()
264 {
265 _On_Construction(); Create(pTemplate);
266 }
267
268 bool CSG_Table::Create(const CSG_Table *pTemplate)
269 {
270 if( !pTemplate || pTemplate->Get_Field_Count() < 1 )
271 {
272 return( false );
273 }
274
275 Destroy();
276
277 Set_Name (pTemplate->Get_Name ());
278 Set_Description (pTemplate->Get_Description());
279 Set_NoData_Value_Range(pTemplate->Get_NoData_Value(), pTemplate->Get_NoData_Value(true));
280
281 m_Encoding = pTemplate->m_Encoding;
282
283 for(int i=0; i<pTemplate->Get_Field_Count(); i++)
284 {
285 Add_Field(pTemplate->Get_Field_Name(i), pTemplate->Get_Field_Type(i));
286 }
287
288 return( true );
289 }
290
291
293 // //
295
296 //---------------------------------------------------------
297 void CSG_Table::_On_Construction(void)
298 {
299 m_nFields = 0;
300 m_Field_Name = NULL;
301 m_Field_Type = NULL;
302 m_Field_Stats = NULL;
303
304 m_Records = NULL;
305 m_nRecords = 0;
306 m_nBuffer = 0;
307
308 m_Encoding = SG_FILE_ENCODING_UTF8;
309
310 m_Selection.Create(sizeof(sLong), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_3);
311
312 Set_Update_Flag();
313 }
314
315
317 // //
319
320 //---------------------------------------------------------
321 CSG_Table::~CSG_Table(void)
322 {
323 Destroy();
324 }
325
326 //---------------------------------------------------------
327 bool CSG_Table::Destroy(void)
328 {
329 _Destroy_Selection();
330
331 Del_Records();
332
333 if( m_nFields > 0 )
334 {
335 for(int i=0; i<m_nFields; i++)
336 {
337 delete(m_Field_Name [i]);
338 delete(m_Field_Stats[i]);
339 }
340
341 SG_Free(m_Field_Name );
342 SG_Free(m_Field_Stats);
343 SG_Free(m_Field_Type );
344
345 m_nFields = 0;
346 m_Field_Name = NULL;
347 m_Field_Type = NULL;
348 m_Field_Stats = NULL;
349 }
350
351 CSG_Data_Object::Destroy();
352
353 return( true );
354 }
355
356
358 // //
359 // Assign //
360 // //
362
363 //---------------------------------------------------------
364 CSG_Table & CSG_Table::operator = (const CSG_Table &Table)
365 {
366 Create(Table);
367
368 return( *this );
369 }
370
371 //---------------------------------------------------------
372 bool CSG_Table::Assign(CSG_Data_Object *pObject)
373 {
374 if( !pObject || !pObject->is_Valid()
375 || ( pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Table
376 && pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_Shapes
377 && pObject->Get_ObjectType() != SG_DATAOBJECT_TYPE_PointCloud ) )
378 {
379 return( false );
380 }
381
382 CSG_Table *pTable = (CSG_Table *)pObject;
383
384 if( !Create(pTable) )
385 {
386 return( false );
387 }
388
389 for(sLong i=0; i<pTable->Get_Count(); i++)
390 {
391 Add_Record(pTable->Get_Record(i));
392 }
393
394 Get_MetaData() = pTable->Get_MetaData();
395 // Get_History () = pTable->Get_History ();
396
397 return( true );
398 }
399
400 //---------------------------------------------------------
401 bool CSG_Table::Assign_Values(const CSG_Table &Table)
402 {
403 if( is_Compatible(Table) && Set_Count(Table.Get_Count()) )
404 {
405 for(sLong i=0; i<Table.Get_Count(); i++)
406 {
407 Get_Record(i)->Assign(Table.Get_Record(i));
408 }
409
410 return( true );
411 }
412
413 return( false );
414 }
415
416 //---------------------------------------------------------
417 bool CSG_Table::Assign_Values(CSG_Table *pTable)
418 {
419 return( pTable && Assign_Values(*pTable) );
420 }
421
422 //---------------------------------------------------------
423 bool CSG_Table::Assign_Values(const SG_Char *FileName)
424 {
425 CSG_Table Table; return( Table.Create(FileName) && Assign_Values(&Table) );
426 }
427
428
430 // //
431 // Checks //
432 // //
434
435 //---------------------------------------------------------
436 bool CSG_Table::is_Compatible(const CSG_Table &Table, bool bExactMatch) const
437 {
438 if( Get_Field_Count() == Table.Get_Field_Count() )
439 {
440 for(int i=0; i<Get_Field_Count(); i++)
441 {
442 if( bExactMatch )
443 {
444 if( Get_Field_Type(i) != Table.Get_Field_Type(i) )
445 {
446 return( false );
447 }
448 }
449 else switch( Get_Field_Type(i) )
450 {
451 case SG_DATATYPE_String:
452 // if( Table.Get_Field_Type(i) != SG_DATATYPE_String )
453 // {
454 // return( false );
455 // }
456 break;
457
458 default:
459 if( Table.Get_Field_Type(i) == SG_DATATYPE_String )
460 {
461 return( false );
462 }
463 break;
464 }
465 }
466
467 return( true );
468 }
469
470 return( false );
471 }
472
473 //---------------------------------------------------------
474 bool CSG_Table::is_Compatible(CSG_Table *pTable, bool bExactMatch) const
475 {
476 return( pTable && is_Compatible(*pTable, bExactMatch) );
477 }
478
479
481 // //
482 // Fields //
483 // //
485
486 //---------------------------------------------------------
487 bool CSG_Table::Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position)
488 {
489 if( Position < 0 || Position > m_nFields )
490 {
491 Position = m_nFields;
492 }
493
494 //-----------------------------------------------------
495 m_nFields++;
496
497 m_Field_Name = (CSG_String **)SG_Realloc(m_Field_Name , m_nFields * sizeof(CSG_String *));
498 m_Field_Type = (TSG_Data_Type *)SG_Realloc(m_Field_Type , m_nFields * sizeof(TSG_Data_Type ));
499 m_Field_Stats = (CSG_Simple_Statistics **)SG_Realloc(m_Field_Stats, m_nFields * sizeof(CSG_Simple_Statistics *));
500
501 //-----------------------------------------------------
502 for(int i=m_nFields-1; i>Position; i--)
503 {
504 m_Field_Name [i] = m_Field_Name [i - 1];
505 m_Field_Type [i] = m_Field_Type [i - 1];
506 m_Field_Stats[i] = m_Field_Stats[i - 1];
507 }
508
509 //-----------------------------------------------------
510 m_Field_Name [Position] = new CSG_String(!Name.is_Empty() ? Name : CSG_String::Format("FIELD_%d", m_nFields));
511 m_Field_Type [Position] = Type;
512 m_Field_Stats[Position] = new CSG_Simple_Statistics();
513
514 //-----------------------------------------------------
515 for(sLong i=0; i<m_nRecords; i++)
516 {
517 m_Records[i]->_Add_Field(Position);
518 }
519
520 Set_Modified();
521
522 return( true );
523 }
524
525 //---------------------------------------------------------
526 bool CSG_Table::Del_Field(int del_Field)
527 {
528 if( del_Field < 0 || del_Field >= m_nFields )
529 {
530 return( false );
531 }
532
533 //-----------------------------------------------------
534 delete(m_Field_Name [del_Field]);
535 delete(m_Field_Stats[del_Field]);
536
537 //-------------------------------------------------
538 m_nFields--;
539
540 for(int i=del_Field; i<m_nFields; i++)
541 {
542 m_Field_Name [i] = m_Field_Name [i + 1];
543 m_Field_Type [i] = m_Field_Type [i + 1];
544 m_Field_Stats[i] = m_Field_Stats[i + 1];
545 }
546
547 //-------------------------------------------------
548 m_Field_Name = (CSG_String **)SG_Realloc(m_Field_Name , m_nFields * sizeof(CSG_String *));
549 m_Field_Type = (TSG_Data_Type *)SG_Realloc(m_Field_Type , m_nFields * sizeof(TSG_Data_Type ));
550 m_Field_Stats = (CSG_Simple_Statistics **)SG_Realloc(m_Field_Stats, m_nFields * sizeof(CSG_Simple_Statistics *));
551
552 //-------------------------------------------------
553 for(sLong i=0; i<m_nRecords; i++)
554 {
555 m_Records[i]->_Del_Field(del_Field);
556 }
557
558 Set_Modified();
559
560 return( true );
561 }
562
563 //---------------------------------------------------------
564 bool CSG_Table::Mov_Field(int iField, int Position)
565 {
566 if( Position < 0 )
567 {
568 Position = 0;
569 }
570 else if( Position >= m_nFields - 1 )
571 {
572 Position = m_nFields - 1;
573 }
574
575 if( iField < 0 || iField >= m_nFields || iField == Position )
576 {
577 return( false );
578 }
579
580 //-----------------------------------------------------
581 if( Position > iField )
582 {
583 Position++;
584 }
585
586 if( !Add_Field(Get_Field_Name(iField), Get_Field_Type(iField), Position) )
587 {
588 return( false );
589 }
590
591 if( Position < iField )
592 {
593 iField++;
594 }
595
596 #pragma omp parallel for
597 for(sLong i=0; i<m_nRecords; i++)
598 {
599 *m_Records[i]->Get_Value(Position) = *m_Records[i]->Get_Value(iField);
600 }
601
602 if( !Del_Field(iField) )
603 {
604 return( false );
605 }
606
607 //-----------------------------------------------------
608 return( true );
609 }
610
611
613 // //
615
616 //---------------------------------------------------------
617 bool CSG_Table::Set_Field_Name(int iField, const SG_Char *Name)
618 {
619 if( iField >= 0 && iField < m_nFields && Name && *Name )
620 {
621 *(m_Field_Name[iField]) = Name;
622
623 Set_Modified();
624
625 return( true );
626 }
627
628 return( false );
629 }
630
631 //---------------------------------------------------------
632 bool CSG_Table::Set_Field_Type(int iField, TSG_Data_Type Type)
633 {
634 if( iField < 0 || iField >= m_nFields )
635 {
636 return( false );
637 }
638
639 if( m_Field_Type[iField] == Type )
640 {
641 return( true );
642 }
643
644 m_Field_Type[iField] = Type;
645
646 for(sLong i=0; i<m_nRecords; i++)
647 {
648 CSG_Table_Record *pRecord = m_Records[i];
649
650 CSG_Table_Value *pValue = CSG_Table_Record::_Create_Value(Type);
651
652 (*pValue) = *pRecord->m_Values[iField];
653
654 delete(pRecord->m_Values[iField]);
655
656 pRecord->m_Values[iField] = pValue;
657
658 pRecord->Set_Modified();
659 }
660
661 return( true );
662 }
663
664 //---------------------------------------------------------
665 int CSG_Table::Get_Field_Length(int iField, int Encoding) const
666 {
667 size_t Length = 0;
668
669 if( iField >= 0 && iField < m_nFields && m_Field_Type[iField] == SG_DATATYPE_String )
670 {
671 for(sLong i=0; i<m_nRecords; i++)
672 {
673 CSG_String s(m_Records[i]->asString(iField));
674
675 size_t nBytes;
676
677 switch( Encoding )
678 {
679 default :
680 case SG_FILE_ENCODING_UTF7 : nBytes = s.Length() ; break;
681 case SG_FILE_ENCODING_UTF8 : nBytes = s.to_UTF8().Get_Size(); break;
682 case SG_FILE_ENCODING_UTF16LE:
683 case SG_FILE_ENCODING_UTF16BE: nBytes = s.Length() * 2 ; break;
684 case SG_FILE_ENCODING_UTF32LE:
685 case SG_FILE_ENCODING_UTF32BE: nBytes = s.Length() * 4 ; break;
686 }
687
688 if( Length < nBytes )
689 {
690 Length = nBytes;
691 }
692 }
693 }
694
695 return( (int)Length );
696 }
697
698 //---------------------------------------------------------
699 int CSG_Table::Get_Field(const CSG_String &Name) const
700 {
701 for(int iField=0; iField<Get_Field_Count(); iField++)
702 {
703 if( !Name.Cmp(Get_Field_Name(iField)) )
704 {
705 return( iField );
706 }
707 }
708
709 return( -1 );
710 }
711
712 //---------------------------------------------------------
717 int CSG_Table::Find_Field(const CSG_String &Name) const
718 {
719 for(int i=0; i<Get_Field_Count(); i++)
720 {
721 if( !Name.Cmp(Get_Field_Name(i)) )
722 {
723 return( i );
724 }
725 }
726
727 return( -1 );
728 }
729
730 //---------------------------------------------------------
735 bool CSG_Table::Find_Field(const CSG_String &Name, int &Index) const
736 {
737 return( (Index = Find_Field(Name)) >= 0 );
738 }
739
740
742 // //
743 // Records //
744 // //
746
747 //---------------------------------------------------------
748 #define GET_GROW_SIZE(n) (n < 256 ? 1 : (n < 8192 ? 128 : 1024))
749
750 //---------------------------------------------------------
751 bool CSG_Table::_Inc_Array(void)
752 {
753 if( m_nRecords < m_nBuffer )
754 {
755 return( true );
756 }
757
758 CSG_Table_Record **pRecords = (CSG_Table_Record **)SG_Realloc(m_Records, (m_nBuffer + GET_GROW_SIZE(m_nBuffer)) * sizeof(CSG_Table_Record *));
759
760 if( pRecords == NULL )
761 {
762 return( false );
763 }
764
765 m_Records = pRecords;
766 m_nBuffer += GET_GROW_SIZE(m_nBuffer);
767
768 return( true );
769 }
770
771 //---------------------------------------------------------
772 bool CSG_Table::_Dec_Array(void)
773 {
774 if( m_nRecords < 0 || m_nRecords >= m_nBuffer - GET_GROW_SIZE(m_nBuffer) )
775 {
776 return( true );
777 }
778
779 CSG_Table_Record **pRecords = (CSG_Table_Record **)SG_Realloc(m_Records, (m_nBuffer - GET_GROW_SIZE(m_nBuffer)) * sizeof(CSG_Table_Record *));
780
781 if( pRecords == NULL )
782 {
783 return( false );
784 }
785
786 m_Records = pRecords;
787 m_nBuffer -= GET_GROW_SIZE(m_nBuffer);
788
789 return( true );
790 }
791
792 //---------------------------------------------------------
793 CSG_Table_Record * CSG_Table::_Get_New_Record(sLong Index)
794 {
795 return( new CSG_Table_Record(this, Index) );
796 }
797
798 //---------------------------------------------------------
799 CSG_Table_Record * CSG_Table::Add_Record(CSG_Table_Record *pCopy)
800 {
801 return( Ins_Record(m_nRecords, pCopy) );
802 }
803
804 //---------------------------------------------------------
805 CSG_Table_Record * CSG_Table::Ins_Record(sLong iRecord, CSG_Table_Record *pCopy)
806 {
807 if( iRecord < 0 ) { iRecord = 0; } else if( iRecord > m_nRecords ) { iRecord = m_nRecords; }
808
809 CSG_Table_Record *pRecord = _Inc_Array() ? _Get_New_Record(m_nRecords) : NULL;
810
811 if( pRecord )
812 {
813 if( pCopy )
814 {
815 pRecord->Assign(pCopy);
816 }
817
818 //-------------------------------------------------
819 if( iRecord < m_nRecords )
820 {
821 if( Get_Selection_Count() > 0 ) // update selection index
822 {
823 sLong *Selection = (sLong *)m_Selection.Get_Array();
824
825 for(sLong i=0; i<m_Selection.Get_Size(); i++)
826 {
827 if( Selection[i] > iRecord )
828 {
829 Selection[i]++;
830 }
831 }
832 }
833
834 for(sLong i=m_nRecords; i>iRecord; i--)
835 {
836 m_Records[i] = m_Records[i - 1]; m_Records[i]->m_Index = i;
837 }
838
839 pRecord->m_Index = iRecord;
840 }
841
842 m_Records[iRecord] = pRecord;
843 m_nRecords++;
844
845 //-------------------------------------------------
846 if( m_Index.is_Okay() )
847 {
848 m_Index.Add_Entry(iRecord);
849 }
850
851 Set_Modified();
852
853 Set_Update_Flag();
854
855 _Stats_Invalidate();
856 }
857
858 return( pRecord );
859 }
860
861 //---------------------------------------------------------
862 bool CSG_Table::Set_Record(sLong iRecord, CSG_Table_Record *pCopy)
863 {
864 if( iRecord >= 0 && iRecord < m_nRecords && pCopy )
865 {
866 return( m_Records[iRecord]->Assign(pCopy) );
867 }
868
869 return( false );
870 }
871
872 //---------------------------------------------------------
873 bool CSG_Table::Del_Record(sLong iRecord)
874 {
875 if( iRecord >= 0 && iRecord < m_nRecords )
876 {
877 if( m_Records[iRecord]->is_Selected() )
878 {
879 _Del_Selection(iRecord);
880 }
881
882 delete(m_Records[iRecord]);
883
884 m_nRecords--;
885
886 for(sLong i=iRecord; i<m_nRecords; i++)
887 {
888 m_Records[i] = m_Records[i + 1]; m_Records[i]->m_Index = i;
889 }
890
891 _Dec_Array();
892
893 //-------------------------------------------------
894 if( m_Index.is_Okay() )
895 {
896 m_Index.Del_Entry(iRecord);
897 }
898
899 Set_Modified();
900
901 Set_Update_Flag();
902
903 _Stats_Invalidate();
904
905 return( true );
906 }
907
908 return( false );
909 }
910
911 //---------------------------------------------------------
912 bool CSG_Table::Del_Records(void)
913 {
914 Del_Index();
915
916 for(sLong iRecord=0; iRecord<m_nRecords; iRecord++)
917 {
918 delete(m_Records[iRecord]);
919 }
920
921 SG_FREE_SAFE(m_Records);
922
923 m_nRecords = 0;
924 m_nBuffer = 0;
925
926 return( true );
927 }
928
929 //---------------------------------------------------------
930 bool CSG_Table::Set_Count(sLong nRecords)
931 {
932 if( m_nRecords < nRecords )
933 {
934 while( m_nRecords < nRecords && Add_Record() != NULL ) {}
935 }
936 else if( nRecords >= 0 && m_nRecords > nRecords )
937 {
938 while( m_nRecords > nRecords && Del_Record(m_nRecords - 1) ) {}
939 }
940
941 return( m_nRecords == nRecords );
942 }
943
944
946 // //
948
949 //---------------------------------------------------------
950 bool CSG_Table::Find_Record(sLong &iRecord, int iField, const CSG_String &Value, bool bCreateIndex)
951 {
952 if( iField < 0 || iField >= m_nFields || m_nRecords < 1 )
953 {
954 return( false );
955 }
956
957 if( m_nRecords == 1 )
958 {
959 return( Value.Cmp(m_Records[iRecord = 0]->asString(iField)) == 0 );
960 }
961
962 if( bCreateIndex && iField != Get_Index_Field(0) )
963 {
964 Set_Index(iField, TABLE_INDEX_Ascending);
965 }
966
967 //-----------------------------------------------------
968 if( iField != Get_Index_Field(0) )
969 {
970 for(iRecord=0; iRecord<m_nRecords; iRecord++)
971 {
972 if( Value.Cmp(m_Records[iRecord]->asString(iField)) == 0 )
973 {
974 return( true );
975 }
976 }
977 }
978
979 //-----------------------------------------------------
980 else // indexed search
981 {
982 #define GET_RECORD(i) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))
983
984 double d; bool bAscending = Get_Index_Order(0) == TABLE_INDEX_Ascending;
985
986 if( (d = Value.Cmp(GET_RECORD(0 )->asString(iField))) < 0 ) { return( false ); } else if( d == 0 ) { return( true ); }
987 if( (d = Value.Cmp(GET_RECORD(m_nRecords - 1)->asString(iField))) > 0 ) { return( false ); } else if( d == 0 ) { return( true ); }
988
989 for(sLong a=0, b=m_nRecords-1; b-a > 1; )
990 {
991 d = Value.Cmp(GET_RECORD(a + (b - a) / 2)->asString(iField));
992
993 if( d > 0. )
994 {
995 a = iRecord;
996 }
997 else if( d < 0. )
998 {
999 b = iRecord;
1000 }
1001 else
1002 {
1003 iRecord = Get_Record_byIndex(bAscending ? iRecord : m_nRecords - 1 - iRecord)->Get_Index();
1004
1005 return( true );
1006 }
1007 }
1008
1009 iRecord = Get_Record_byIndex(bAscending ? iRecord : m_nRecords - 1 - iRecord)->Get_Index();
1010 }
1011
1012 //-----------------------------------------------------
1013 return( false );
1014 }
1015
1016 //---------------------------------------------------------
1017 CSG_Table_Record * CSG_Table::Find_Record(int iField, const CSG_String &Value, bool bCreateIndex)
1018 {
1019 sLong iRecord;
1020
1021 if( Find_Record(iRecord, iField, Value, bCreateIndex) )
1022 {
1023 return( Get_Record(iRecord) );
1024 }
1025
1026 return( NULL );
1027 }
1028
1029 //---------------------------------------------------------
1030 bool CSG_Table::Find_Record(sLong &iRecord, int iField, double Value, bool bCreateIndex)
1031 {
1032 if( iField < 0 || iField >= m_nFields || m_nRecords < 1 )
1033 {
1034 return( false );
1035 }
1036
1037 if( m_nRecords == 1 )
1038 {
1039 return( Value == m_Records[iRecord = 0]->asDouble(iField) );
1040 }
1041
1042 if( bCreateIndex && iField != Get_Index_Field(0) )
1043 {
1044 Set_Index(iField, TABLE_INDEX_Ascending);
1045 }
1046
1047 //-----------------------------------------------------
1048 if( iField != Get_Index_Field(0) )
1049 {
1050 for(iRecord=0; iRecord<m_nRecords; iRecord++)
1051 {
1052 if( Value == m_Records[iRecord]->asDouble(iField) )
1053 {
1054 return( true );
1055 }
1056 }
1057 }
1058
1059 //-----------------------------------------------------
1060 else // indexed search
1061 {
1062 #define GET_RECORD(i) Get_Record_byIndex(bAscending ? (iRecord = i) : m_nRecords - 1 - (iRecord = i))
1063
1064 double d; bool bAscending = Get_Index_Order(0) == TABLE_INDEX_Ascending;
1065
1066 if( (d = Value - GET_RECORD(0 )->asDouble(iField)) < 0. ) { return( false ); } else if( d == 0. ) { return( true ); }
1067 if( (d = Value - GET_RECORD(m_nRecords - 1)->asDouble(iField)) > 0. ) { return( false ); } else if( d == 0. ) { return( true ); }
1068
1069 for(sLong a=0, b=m_nRecords-1; b-a > 1; )
1070 {
1071 d = Value - GET_RECORD(a + (b - a) / 2)->asDouble(iField);
1072
1073 if( d > 0. )
1074 {
1075 a = iRecord;
1076 }
1077 else if( d < 0. )
1078 {
1079 b = iRecord;
1080 }
1081 else
1082 {
1083 iRecord = Get_Record_byIndex(bAscending ? iRecord : m_nRecords - 1 - iRecord)->Get_Index();
1084
1085 return( true );
1086 }
1087 }
1088
1089 iRecord = Get_Record_byIndex(bAscending ? iRecord : m_nRecords - 1 - iRecord)->Get_Index();
1090 }
1091
1092 //-----------------------------------------------------
1093 return( false );
1094 }
1095
1096 //---------------------------------------------------------
1097 CSG_Table_Record * CSG_Table::Find_Record(int iField, double Value, bool bCreateIndex)
1098 {
1099 sLong iRecord;
1100
1101 if( Find_Record(iRecord, iField, Value, bCreateIndex) )
1102 {
1103 return( Get_Record(iRecord) );
1104 }
1105
1106 return( NULL );
1107 }
1108
1109
1111 // //
1112 // Value Access //
1113 // //
1115
1116 //---------------------------------------------------------
1117 void CSG_Table::Set_Modified(bool bModified)
1118 {
1119 if( bModified != is_Modified() )
1120 {
1121 CSG_Data_Object::Set_Modified(bModified);
1122
1123 if( bModified == false )
1124 {
1125 #pragma omp parallel for
1126 for(sLong iRecord=0; iRecord<m_nRecords; iRecord++)
1127 {
1128 m_Records[iRecord]->Set_Modified(false);
1129 }
1130 }
1131 }
1132 }
1133
1134 //---------------------------------------------------------
1135 bool CSG_Table::Set_Value(sLong iRecord, int iField, const SG_Char *Value)
1136 {
1137 if( iField >= 0 && iField < m_nFields )
1138 {
1139 CSG_Table_Record *pRecord = Get_Record(iRecord);
1140
1141 return( pRecord && pRecord->Set_Value(iField, Value) );
1142 }
1143
1144 return( false );
1145 }
1146
1147 //---------------------------------------------------------
1148 bool CSG_Table::Set_Value(sLong iRecord, int iField, double Value)
1149 {
1150 if( iField >= 0 && iField < m_nFields )
1151 {
1152 CSG_Table_Record *pRecord = Get_Record(iRecord);
1153
1154 return( pRecord && pRecord->Set_Value(iField, Value) );
1155 }
1156
1157 return( false );
1158 }
1159
1160 //---------------------------------------------------------
1161 bool CSG_Table::Get_Value(sLong iRecord, int iField, CSG_String &Value) const
1162 {
1163 if( iField >= 0 && iField < m_nFields )
1164 {
1165 CSG_Table_Record *pRecord = Get_Record(iRecord);
1166
1167 if( pRecord )
1168 {
1169 Value = pRecord->asString(iField);
1170
1171 return( true );
1172 }
1173 }
1174
1175 return( false );
1176 }
1177
1178 //---------------------------------------------------------
1179 bool CSG_Table::Get_Value(sLong iRecord, int iField, double &Value) const
1180 {
1181 if( iField >= 0 && iField < m_nFields )
1182 {
1183 CSG_Table_Record *pRecord = Get_Record(iRecord);
1184
1185 if( pRecord )
1186 {
1187 Value = pRecord->asDouble(iField);
1188
1189 return( true );
1190 }
1191 }
1192
1193 return( false );
1194 }
1195
1196
1198 // //
1199 // Statistics //
1200 // //
1202
1203 //---------------------------------------------------------
1204 bool CSG_Table::_Stats_Invalidate(void) const
1205 {
1206 for(int iField=0; iField<m_nFields; iField++)
1207 {
1208 m_Field_Stats[iField]->Invalidate();
1209 }
1210
1211 return( true );
1212 }
1213
1214 //---------------------------------------------------------
1215 bool CSG_Table::_Stats_Invalidate(int iField) const
1216 {
1217 if( iField >= 0 && iField < m_nFields )
1218 {
1219 m_Field_Stats[iField]->Invalidate();
1220
1221 return( true );
1222 }
1223
1224 return( false );
1225 }
1226
1227 //---------------------------------------------------------
1228 bool CSG_Table::_Stats_Update(int iField) const
1229 {
1230 if( iField < 0 || iField >= m_nFields || Get_Count() < 1 )
1231 {
1232 return( false );
1233 }
1234
1235 CSG_Simple_Statistics &Statistics = *m_Field_Stats[iField];
1236
1237 if( Statistics.is_Evaluated() )
1238 {
1239 return( true );
1240 }
1241
1242 if( Get_Max_Samples() > 0 && Get_Max_Samples() < Get_Count() )
1243 {
1244 double d = (double)Get_Count() / (double)Get_Max_Samples();
1245
1246 for(double i=0; i<(double)Get_Count(); i+=d)
1247 {
1248 CSG_Table_Record *pRecord = m_Records[(sLong)i];
1249
1250 if( !pRecord->is_NoData(iField) )
1251 {
1252 Statistics += pRecord->asDouble(iField);
1253 }
1254 }
1255
1256 Statistics.Set_Count(Statistics.Get_Count() >= Get_Max_Samples() ? Get_Count() // any no-data cells ?
1257 : (sLong)(Get_Count() * (double)Statistics.Get_Count() / (double)Get_Max_Samples())
1258 );
1259 }
1260 else
1261 {
1262 for(sLong i=0; i<Get_Count(); i++)
1263 {
1264 CSG_Table_Record *pRecord = m_Records[i];
1265
1266 if( !pRecord->is_NoData(iField) )
1267 {
1268 Statistics += pRecord->asDouble(iField);
1269 }
1270 }
1271 }
1272
1273 return( Statistics.Evaluate() ); // evaluate! prevent values to be added more than once!
1274 }
1275
1276
1278 // //
1279 // //
1280 // //
1282
1283 //---------------------------------------------------------
1284 bool CSG_Table::On_NoData_Changed(void)
1285 {
1286 _Stats_Invalidate();
1287
1288 return( CSG_Data_Object::On_NoData_Changed() );
1289 }
1290
1291 //---------------------------------------------------------
1292 bool CSG_Table::On_Update(void)
1293 {
1294 _Stats_Invalidate();
1295
1296 if( m_Index.is_Okay() )
1297 {
1298 _Index_Update();
1299 }
1300
1301 return( CSG_Data_Object::On_Update() );
1302 }
1303
1304
1306 // //
1307 // Index //
1308 // //
1310
1311 //---------------------------------------------------------
1312 bool CSG_Table::Set_Index(int Field_1, TSG_Table_Index_Order Order_1, int Field_2, TSG_Table_Index_Order Order_2, int Field_3, TSG_Table_Index_Order Order_3)
1313 {
1314 m_Index_Fields.Destroy();
1315
1316 if( Field_1 >= 0 && Field_1 < m_nFields && Order_1 != TABLE_INDEX_None )
1317 {
1318 Field_1++; m_Index_Fields += Order_1 == TABLE_INDEX_Ascending ? Field_1 : -Field_1;
1319
1320 if( Field_2 >= 0 && Field_2 < m_nFields && Order_2 != TABLE_INDEX_None )
1321 {
1322 Field_2++; m_Index_Fields += Order_2 == TABLE_INDEX_Ascending ? Field_2 : -Field_2;
1323
1324 if( Field_3 >= 0 && Field_3 < m_nFields && Order_3 != TABLE_INDEX_None )
1325 {
1326 Field_3++; m_Index_Fields += Order_3 == TABLE_INDEX_Ascending ? Field_3 : -Field_3;
1327 }
1328 }
1329
1330 _Index_Update();
1331 }
1332 else
1333 {
1334 Del_Index();
1335 }
1336
1337 return( is_Indexed() );
1338 }
1339
1340 //---------------------------------------------------------
1341 bool CSG_Table::Del_Index(void)
1342 {
1343 m_Index.Destroy();
1344
1345 m_Index_Fields.Destroy();
1346
1347 return( true );
1348 }
1349
1350 //---------------------------------------------------------
1351 bool CSG_Table::Toggle_Index(int iField)
1352 {
1353 if( iField < 0 || iField >= m_nFields )
1354 {
1355 return( false );
1356 }
1357
1358 if( iField != Get_Index_Field(0) )
1359 {
1360 return( Set_Index(iField, TABLE_INDEX_Ascending) );
1361 }
1362
1363 if( Get_Index_Order(0) == TABLE_INDEX_Ascending )
1364 {
1365 return( Set_Index(iField, TABLE_INDEX_Descending) );
1366 }
1367
1368 return( Del_Index() );
1369 }
1370
1371
1373 // //
1375
1376 //---------------------------------------------------------
1377 class CSG_Table_Record_Compare_Field : public CSG_Index::CSG_Index_Compare
1378 {
1379 public:
1380 CSG_Table_Record_Compare_Field(const CSG_Table *pTable, int Field, bool Ascending)
1381 {
1382 m_pTable = pTable;
1383 m_Field = Field;
1384 m_Ascending = Ascending;
1385
1386 if( !m_pTable || m_Field < 0 || m_Field >= m_pTable->Get_Field_Count() )
1387 {
1388 m_pTable = NULL;
1389 }
1390 }
1391
1392 bool is_Okay (void) const { return( m_pTable != NULL ); }
1393
1394 virtual int Compare (const sLong _a, const sLong _b)
1395 {
1396 sLong a = m_Ascending ? _a : _b;
1397 sLong b = m_Ascending ? _b : _a;
1398
1399 switch( m_pTable->Get_Field_Type(m_Field) )
1400 {
1401 default: {
1402 double d =
1403 m_pTable->Get_Record(a)->asDouble(m_Field) -
1404 m_pTable->Get_Record(b)->asDouble(m_Field);
1405
1406 return( d < 0. ? -1 : d > 0. ? 1 : 0 );
1407 }
1408
1409 case SG_DATATYPE_String:
1410 case SG_DATATYPE_Date :
1411 return( SG_STR_CMP(
1412 m_pTable->Get_Record(a)->asString(m_Field),
1413 m_pTable->Get_Record(b)->asString(m_Field))
1414 );
1415 }
1416 }
1417
1418
1419 private:
1420
1421 bool m_Ascending;
1422
1423 int m_Field;
1424
1425 const CSG_Table *m_pTable;
1426
1427 };
1428
1429 //---------------------------------------------------------
1430 bool CSG_Table::Set_Index(CSG_Index &Index, int Field, bool bAscending) const
1431 {
1432 CSG_Table_Record_Compare_Field Compare(this, Field, bAscending);
1433
1434 return( Compare.is_Okay() && Index.Create(Get_Count(), &Compare) );
1435 }
1436
1437
1439 // //
1441
1442 //---------------------------------------------------------
1443 class CSG_Table_Record_Compare_Fields : public CSG_Index::CSG_Index_Compare
1444 {
1445 public:
1446 CSG_Table_Record_Compare_Fields(const CSG_Table *pTable, int Fields[], int nFields, bool Ascending)
1447 : m_pTable(pTable), m_Fields(Fields), m_nFields(nFields)
1448 {
1449 m_Ascending.Create(nFields);
1450
1451 for(int i=0; m_pTable && i<m_nFields; i++)
1452 {
1453 if( m_Fields[i] >= m_pTable->Get_Field_Count() )
1454 {
1455 m_pTable = NULL;
1456 }
1457
1458 m_Ascending[i] = Ascending ? 1 : 0;
1459 }
1460 }
1461
1462 CSG_Table_Record_Compare_Fields(const CSG_Table *pTable, int Fields[], int nFields, int Ascending[])
1463 : m_pTable(pTable), m_Fields(Fields), m_nFields(nFields)
1464 {
1465 m_Ascending.Create(nFields);
1466
1467 for(int i=0; m_pTable && i<m_nFields; i++)
1468 {
1469 if( m_Fields[i] >= m_pTable->Get_Field_Count() )
1470 {
1471 m_pTable = NULL;
1472 }
1473
1474 m_Ascending[i] = Ascending[i] > 0 ? 1 : 0;
1475 }
1476 }
1477
1478 bool is_Okay (void) const { return( m_pTable != NULL ); }
1479
1480 virtual int Compare (const sLong _a, const sLong _b)
1481 {
1482 int Difference = 0;
1483
1484 for(int i=0; !Difference && i<m_nFields; i++)
1485 {
1486 int Field = m_Fields[i];
1487
1488 sLong a = m_Ascending[i] ? _a : _b;
1489 sLong b = m_Ascending[i] ? _b : _a;
1490
1491 switch( m_pTable->Get_Field_Type(Field) )
1492 {
1493 default: {
1494 double d = m_pTable->Get_Record(a)->asDouble(Field);
1495 d -= m_pTable->Get_Record(b)->asDouble(Field);
1496 Difference = d < 0. ? -1 : d > 0. ? 1 : 0;
1497 } break;
1498
1499 case SG_DATATYPE_String:
1500 case SG_DATATYPE_Date :
1501 CSG_String s (m_pTable->Get_Record(a)->asString(Field));
1502 Difference = s.Cmp(m_pTable->Get_Record(b)->asString(Field));
1503 break;
1504 }
1505 }
1506
1507 return( Difference );
1508 }
1509
1510
1511 private:
1512
1513 int *m_Fields, m_nFields;
1514
1515 CSG_Array_Int m_Ascending;
1516
1517 const CSG_Table *m_pTable;
1518
1519 };
1520
1521 //---------------------------------------------------------
1522 bool CSG_Table::Set_Index(CSG_Index &Index, int Fields[], int nFields, bool bAscending) const
1523 {
1524 CSG_Table_Record_Compare_Fields Compare(this, Fields, nFields, bAscending);
1525
1526 return( Compare.is_Okay() && Index.Create(Get_Count(), &Compare) );
1527 }
1528
1529 //---------------------------------------------------------
1530 bool CSG_Table::Set_Index(CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending) const
1531 {
1532 return( Set_Index(Index, Fields.Get_Array(), (int)Fields.Get_Size(), bAscending) );
1533 }
1534
1535 //---------------------------------------------------------
1536 void CSG_Table::_Index_Update(void)
1537 {
1538 if( m_Index_Fields.Get_Size() < 1 )
1539 {
1540 Del_Index();
1541 }
1542
1543 CSG_Array_Int Fields, Ascending;
1544
1545 for(sLong i=0; i<m_Index_Fields.Get_Size(); i++)
1546 {
1547 Fields += abs(m_Index_Fields[i]) - 1;
1548 Ascending += m_Index_Fields[i] > 0 ? 1 : 0;
1549 }
1550
1551 CSG_Table_Record_Compare_Fields Compare(this, Fields.Get_Array(), (int)Fields.Get_Size(), Ascending.Get_Array());
1552
1553 if( !Compare.is_Okay() || !m_Index.Create(Get_Count(), &Compare) )
1554 {
1555 Del_Index();
1556 }
1557 }
1558
1559
1561 // //
1562 // //
1563 // //
1565
1566 //---------------------------------------------------------
CSG_Index
Definition: mat_tools.h:185
CSG_Table::CSG_Table_Record
friend class CSG_Table_Record
Definition: table.h:284
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Table::Find_Record
virtual bool Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
Definition: table.cpp:950
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Index::is_Okay
bool is_Okay(void) const
Definition: mat_tools.h:223
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_Data_Object::Get_Max_Samples
sLong Get_Max_Samples(void) const
Definition: dataobject.h:254
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
SG_Create_Table
CSG_Table * SG_Create_Table(void)
Definition: table.cpp:65
CSG_Table::Set_Count
virtual bool Set_Count(sLong nRecords)
Definition: table.cpp:930
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
TABLE_INDEX_None
@ TABLE_INDEX_None
Definition: table.h:104
CSG_Data_Object::Get_Description
const SG_Char * Get_Description(void) const
Definition: dataobject.cpp:301
CSG_Table_Record
Definition: table.h:130
CSG_Table::_Stats_Update
virtual bool _Stats_Update(int iField) const
Definition: table.cpp:1228
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Table::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: table.h:315
CSG_Table::Get_Value
virtual bool Get_Value(sLong Index, int iField, CSG_String &Value) const
Definition: table.cpp:1161
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_Index::CSG_Index_Compare
Definition: mat_tools.h:188
CSG_Table::m_Selection
CSG_Array m_Selection
Definition: table.h:452
CSG_Table::is_Selected
virtual bool is_Selected(sLong Index) const
Definition: table.h:417
CSG_Table::Del_Field
virtual bool Del_Field(int iField)
Definition: table.cpp:526
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
GET_GROW_SIZE
#define GET_GROW_SIZE(n)
Definition: table.cpp:748
CSG_Array_Int::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:434
CSG_Table::m_Field_Name
CSG_String ** m_Field_Name
Definition: table.h:448
CSG_Table::operator=
CSG_Table & operator=(const CSG_Table &Table)
Definition: table.cpp:364
CSG_Table_Record::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: table_record.cpp:543
CSG_Table::~CSG_Table
virtual ~CSG_Table(void)
Definition: table.cpp:321
CSG_Tool
Definition: tool.h:149
CSG_Index::CSG_Index_Compare::Compare
virtual int Compare(const sLong a, const sLong b)=0
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
SG_FILE_ENCODING_UTF32BE
@ SG_FILE_ENCODING_UTF32BE
Definition: api_core.h:550
CSG_Table::CSG_Table
CSG_Table(void)
Definition: table.cpp:133
CSG_Table::Get_Index_Order
TSG_Table_Index_Order Get_Index_Order(int i) const
Definition: table.h:435
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Array_Int::Get_Array
int * Get_Array(void) const
Definition: api_core.h:437
CSG_Simple_Statistics::Evaluate
bool Evaluate(void)
Definition: mat_tools.cpp:473
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Get_ObjectType
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.
SG_STR_CMP
#define SG_STR_CMP(s1, s2)
Definition: api_core.h:538
CSG_Table::Get_Field_Length
int Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
Definition: table.cpp:665
CSG_Table_Record::m_Values
class CSG_Table_Value ** m_Values
Definition: table.h:256
CSG_Table::Set_Record
virtual bool Set_Record(sLong Index, CSG_Table_Record *pCopy)
Definition: table.cpp:862
CSG_Table_Value
Definition: table_value.h:111
CSG_Table_Record::m_Index
sLong m_Index
Definition: table.h:254
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SG_FILE_ENCODING_UTF7
@ SG_FILE_ENCODING_UTF7
Definition: api_core.h:545
CSG_Table::_Stats_Invalidate
bool _Stats_Invalidate(void) const
Definition: table.cpp:1204
CSG_Table::m_Field_Type
TSG_Data_Type * m_Field_Type
Definition: table.h:446
CSG_Table::Find_Field
int Find_Field(const CSG_String &Name) const
Definition: table.cpp:717
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Table::is_Compatible
bool is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const
Definition: table.cpp:436
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:351
CSG_Table::m_Field_Stats
CSG_Simple_Statistics ** m_Field_Stats
Definition: table.h:450
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Object::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: dataobject.cpp:542
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Simple_Statistics::Get_Count
sLong Get_Count(void) const
Definition: mat_tools.h:728
CSG_Table::Get_Selection_Count
sLong Get_Selection_Count(void) const
Definition: table.h:413
CSG_Index::Create
bool Create(sLong nValues, CSG_Index_Compare &Compare)
Definition: mat_indexing.cpp:110
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
TSG_Table_Index_Order
TSG_Table_Index_Order
Definition: table.h:103
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Table::is_Indexed
bool is_Indexed(void) const
Definition: table.h:430
CSG_Table::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: table.cpp:1284
SG_FILE_ENCODING_UTF32LE
@ SG_FILE_ENCODING_UTF32LE
Definition: api_core.h:549
CSG_Table::Mov_Field
virtual bool Mov_Field(int iField, int Position)
Definition: table.cpp:564
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Table_Record::_Create_Value
static CSG_Table_Value * _Create_Value(TSG_Data_Type Type)
Definition: table_record.cpp:110
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1292
CSG_Data_Object::is_Modified
virtual bool is_Modified(void) const
Definition: dataobject.h:219
CSG_Simple_Statistics::Invalidate
void Invalidate(void)
Definition: mat_tools.cpp:447
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:401
CSG_Array_Int
Definition: api_core.h:421
CSG_Simple_Statistics::is_Evaluated
int is_Evaluated(void) const
Definition: mat_tools.h:724
CSG_Table::Get_Index_Field
int Get_Index_Field(int i) const
Definition: table.h:434
CSG_Table::Del_Index
bool Del_Index(void)
Definition: table.cpp:1341
CSG_Table::m_nBuffer
sLong m_nBuffer
Definition: table.h:444
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Table::Set_Value
virtual bool Set_Value(sLong Index, int iField, const SG_Char *Value)
Definition: table.cpp:1135
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
CSG_Table_Record::_Add_Field
bool _Add_Field(int add_Field)
Definition: table_record.cpp:143
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
CSG_Table_Record::Set_Modified
void Set_Modified(bool bOn=true)
Definition: table_record.cpp:220
CSG_Index::Add_Entry
bool Add_Entry(sLong Position=-1)
Definition: mat_indexing.cpp:268
CSG_Simple_Statistics::Set_Count
bool Set_Count(sLong Count)
Definition: mat_tools.cpp:424
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table::_Del_Selection
bool _Del_Selection(sLong Index)
Definition: table_selection.cpp:87
SG_FILE_ENCODING_UTF16LE
@ SG_FILE_ENCODING_UTF16LE
Definition: api_core.h:547
CSG_Table::Set_Field_Name
bool Set_Field_Name(int iField, const SG_Char *Name)
Definition: table.cpp:617
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
CSG_String::to_UTF8
size_t to_UTF8(char **pString) const
Definition: api_string.cpp:813
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
TABLE_INDEX_Descending
@ TABLE_INDEX_Descending
Definition: table.h:106
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Load
bool Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:99
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
shapes.h
CSG_String
Definition: api_core.h:557
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Object::Set_Description
void Set_Description(const CSG_String &Description)
Definition: dataobject.cpp:296
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_FILE_ENCODING_UTF16BE
@ SG_FILE_ENCODING_UTF16BE
Definition: api_core.h:548
CSG_Data_Object::Get_MetaData
CSG_MetaData & Get_MetaData(void) const
Definition: dataobject.h:225
TSG_Table_File_Type
TSG_Table_File_Type
Definition: table.h:93
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Table::m_nFields
int m_nFields
Definition: table.h:442
GET_RECORD
#define GET_RECORD(i)
CSG_Table::Ins_Record
virtual CSG_Table_Record * Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:805
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
CSG_Shapes
Definition: shapes.h:773
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
CSG_Table_Record::Get_Value
CSG_Table_Value * Get_Value(int Field)
Definition: table.h:237
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Index::Del_Entry
bool Del_Entry(sLong Position=-1)
Definition: mat_indexing.cpp:289
CSG_Table::Get_Field
int Get_Field(const CSG_String &Name) const
Definition: table.cpp:699
CSG_Array_Int::Destroy
void Destroy(void)
Definition: api_core.h:429
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Data_Object::Set_NoData_Value_Range
virtual bool Set_NoData_Value_Range(double Lower, double Upper)
Definition: dataobject.cpp:519
CSG_Table::Set_Field_Type
virtual bool Set_Field_Type(int iField, TSG_Data_Type Type)
Definition: table.cpp:632
table.h
CSG_Index::Destroy
bool Destroy(void)
Definition: mat_indexing.cpp:83
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Table::Toggle_Index
bool Toggle_Index(int iField)
Definition: table.cpp:1351
CSG_Table::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: table.cpp:793
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Table_Record::_Del_Field
bool _Del_Field(int del_Field)
Definition: table_record.cpp:167
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: table.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Enumerations | Functions
table.h File Reference
#include "dataobject.h"
#include "table_value.h"

Go to the source code of this file.

Classes

class | CSG_Table_Record
class | CSG_Table

Macros

#define | SG_TABLE_REC_FLAG_Modified 0x01
#define | SG_TABLE_REC_FLAG_Selected 0x02

Enumerations

enum | TSG_Table_File_Type { TABLE_FILETYPE_Undefined = 0, TABLE_FILETYPE_Text, TABLE_FILETYPE_Text_NoHeadLine, TABLE_FILETYPE_DBase }
enum | TSG_Table_Index_Order { TABLE_INDEX_None = 0, TABLE_INDEX_Ascending, TABLE_INDEX_Descending }

Functions

SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (void)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const CSG_Table &Table)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (CSG_Table *pTemplate)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const char *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format=TABLE_FILETYPE_Undefined, int Encoding=SG_FILE_ENCODING_UNDEFINED)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
SAGA_API_DLL_EXPORT CSG_Table * | SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)

Detailed Description

The table data container, a specialized CSG_Table class following a geometry object based approach.

See also
CSG_Table_Value
CSG_Table_Record
CSG_Table
CSG_Data_Object

Definition in file table.h.

Macro Definition Documentation

◆ SG_TABLE_REC_FLAG_Modified

#define SG_TABLE_REC_FLAG_Modified 0x01

Definition at line 118 of file table.h.

◆ SG_TABLE_REC_FLAG_Selected

#define SG_TABLE_REC_FLAG_Selected 0x02

Definition at line 119 of file table.h.

Enumeration Type Documentation

◆ TSG_Table_File_Type

enum TSG_Table_File_Type
Enumerator
TABLE_FILETYPE_Undefined
TABLE_FILETYPE_Text
TABLE_FILETYPE_Text_NoHeadLine
TABLE_FILETYPE_DBase

Definition at line 92 of file table.h.

◆ TSG_Table_Index_Order

enum TSG_Table_Index_Order
Enumerator
TABLE_INDEX_None
TABLE_INDEX_Ascending
TABLE_INDEX_Descending

Definition at line 102 of file table.h.

Function Documentation

◆ SG_Create_Table() [1/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 118 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [2/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const char * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 110 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [3/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 120 of file table.cpp.

◆ SG_Create_Table() [4/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const CSG_String & | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 112 of file table.cpp.

◆ SG_Create_Table() [5/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table ( const CSG_Table & Table )

Safe table construction

Definition at line 71 of file table.cpp.

References CSG_Table::Get_ObjectType(), SG_Create_Shapes(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_DATAOBJECT_TYPE_Table.

◆ SG_Create_Table() [6/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format,
 |  | const SG_Char | Separator,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 119 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [7/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table | ( | const wchar_t * | File,
 |  | TSG_Table_File_Type | Format = TABLE_FILETYPE_Undefined,
 |  | int | Encoding = SG_FILE_ENCODING_UNDEFINED
 | ) |  |

Safe table construction

Definition at line 111 of file table.cpp.

References SG_Create_Table().

◆ SG_Create_Table() [8/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table ( CSG_Table * pTemplate )

Safe table construction

Definition at line 88 of file table.cpp.

References CSG_Table::Get_ObjectType(), SG_Create_Shapes(), SG_DATAOBJECT_TYPE_PointCloud, SG_DATAOBJECT_TYPE_Shapes, and SG_DATAOBJECT_TYPE_Table.

◆ SG_Create_Table() [9/9]

SAGA_API_DLL_EXPORT CSG_Table* SG_Create_Table ( void )

Safe table construction

Definition at line 65 of file table.cpp.

Referenced by SG_Create_Table().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table.h Source File

  • saga_core
  • saga_api
table.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__table_H
54 #define HEADER_INCLUDED__SAGA_API__table_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
74 // //
76 // //
77 // //
79
80 //---------------------------------------------------------
81 #include "dataobject.h"
82 #include "table_value.h"
83
84
86 // //
87 // //
88 // //
90
91 //---------------------------------------------------------
92 typedef enum
93 {
94 TABLE_FILETYPE_Undefined = 0,
95 TABLE_FILETYPE_Text,
96 TABLE_FILETYPE_Text_NoHeadLine,
97 TABLE_FILETYPE_DBase
98 }
99 TSG_Table_File_Type;
100
101 //---------------------------------------------------------
102 typedef enum
103 {
104 TABLE_INDEX_None = 0,
105 TABLE_INDEX_Ascending,
106 TABLE_INDEX_Descending
107 }
108 TSG_Table_Index_Order;
109
110
112 // //
113 // //
114 // //
116
117 //---------------------------------------------------------
118 #define SG_TABLE_REC_FLAG_Modified 0x01
119 #define SG_TABLE_REC_FLAG_Selected 0x02
120
121
123 // //
124 // //
125 // //
127
128 //---------------------------------------------------------
129 class SAGA_API_DLL_EXPORT CSG_Table_Record
130 {
131 friend class CSG_Table; friend class CSG_PointCloud;
132
133 public:
134
135 class CSG_Table * Get_Table (void) { return( m_pTable ); }
136 sLong Get_Index (void) const { return( m_Index ); }
137
138 bool Set_Value (int Field, const CSG_String &Value);
139 bool Set_Value (int Field, const char *Value) { return( Set_Value( Field , CSG_String(Value)) ); }
140 bool Set_Value (int Field, const wchar_t *Value) { return( Set_Value( Field , CSG_String(Value)) ); }
141 bool Set_Value (const CSG_String &Field, const CSG_String &Value);
142 bool Set_Value (const char *Field, const CSG_String &Value) { return( Set_Value(CSG_String(Field), Value ) ); }
143 bool Set_Value (const wchar_t *Field, const CSG_String &Value) { return( Set_Value(CSG_String(Field), Value ) ); }
144 bool Set_Value (const char *Field, const char *Value) { return( Set_Value(CSG_String(Field), CSG_String(Value)) ); }
145 bool Set_Value (const wchar_t *Field, const wchar_t *Value) { return( Set_Value(CSG_String(Field), CSG_String(Value)) ); }
146
147 bool Set_Value (int Field, const CSG_Bytes &Value);
148 bool Set_Value (const CSG_String &Field, const CSG_Bytes &Value);
149 bool Set_Value (const char *Field, const CSG_Bytes &Value) { return( Set_Value(CSG_String(Field), Value) ); }
150 bool Set_Value (const wchar_t *Field, const CSG_Bytes &Value) { return( Set_Value(CSG_String(Field), Value) ); }
151
152 bool Set_Value (int Field, double Value);
153 bool Set_Value (const CSG_String &Field, double Value);
154 bool Set_Value (const char *Field, double Value) { return( Set_Value(CSG_String(Field), Value) ); }
155 bool Set_Value (const wchar_t *Field, double Value) { return( Set_Value(CSG_String(Field), Value) ); }
156
157 bool Set_Value (int Field, sLong Value);
158 bool Set_Value (const CSG_String &Field, sLong Value);
159 bool Set_Value (const char *Field, sLong Value) { return( Set_Value(CSG_String(Field), Value) ); }
160 bool Set_Value (const wchar_t *Field, sLong Value) { return( Set_Value(CSG_String(Field), Value) ); }
161
162 bool Set_Value (int Field, size_t Value) { return( Set_Value(Field, (double)Value) ); }
163 bool Set_Value (const CSG_String &Field, size_t Value) { return( Set_Value(Field, (double)Value) ); }
164 bool Set_Value (const char *Field, size_t Value) { return( Set_Value(Field, (double)Value) ); }
165 bool Set_Value (const wchar_t *Field, size_t Value) { return( Set_Value(Field, (double)Value) ); }
166
167 bool Set_Value (int Field, DWORD Value) { return( Set_Value(Field, (double)Value) ); }
168 bool Set_Value (const CSG_String &Field, DWORD Value) { return( Set_Value(Field, (double)Value) ); }
169 bool Set_Value (const char *Field, DWORD Value) { return( Set_Value(Field, (double)Value) ); }
170 bool Set_Value (const wchar_t *Field, DWORD Value) { return( Set_Value(Field, (double)Value) ); }
171
172 bool Set_Value (int Field, long Value) { return( Set_Value(Field, (double)Value) ); }
173 bool Set_Value (const CSG_String &Field, long Value) { return( Set_Value(Field, (double)Value) ); }
174 bool Set_Value (const char *Field, long Value) { return( Set_Value(Field, (double)Value) ); }
175 bool Set_Value (const wchar_t *Field, long Value) { return( Set_Value(Field, (double)Value) ); }
176
177 bool Set_Value (int Field, int Value) { return( Set_Value(Field, (double)Value) ); }
178 bool Set_Value (const CSG_String &Field, int Value) { return( Set_Value(Field, (double)Value) ); }
179 bool Set_Value (const char *Field, int Value) { return( Set_Value(Field, (double)Value) ); }
180 bool Set_Value (const wchar_t *Field, int Value) { return( Set_Value(Field, (double)Value) ); }
181
182 bool Add_Value (int Field, double Value);
183 bool Add_Value (const CSG_String &Field, double Value);
184 bool Add_Value (const char *Field, double Value) { return( Add_Value(CSG_String(Field), Value) ); }
185 bool Add_Value (const wchar_t *Field, double Value) { return( Add_Value(CSG_String(Field), Value) ); }
186
187 bool Mul_Value (int Field, double Value);
188 bool Mul_Value (const CSG_String &Field, double Value);
189 bool Mul_Value (const char *Field, double Value) { return( Mul_Value(CSG_String(Field), Value) ); }
190 bool Mul_Value (const wchar_t *Field, double Value) { return( Mul_Value(CSG_String(Field), Value) ); }
191
192 bool Set_NoData (int Field);
193 bool Set_NoData (const CSG_String &Field);
194 bool Set_NoData (const char *Field) { return( Set_NoData(CSG_String(Field)) ); }
195 bool Set_NoData (const wchar_t *Field) { return( Set_NoData(CSG_String(Field)) ); }
196
197 bool is_NoData (int Field) const;
198 bool is_NoData (const CSG_String &Field) const;
199 bool is_NoData (const char *Field) const { return( is_NoData(CSG_String(Field)) ); }
200 bool is_NoData (const wchar_t *Field) const { return( is_NoData(CSG_String(Field)) ); }
201
202 const SG_Char * asString (int Field, int Decimals = -99) const;
203 const SG_Char * asString (const CSG_String &Field, int Decimals = -99) const;
204 const SG_Char * asString (const char *Field, int Decimals = -99) const { return( asString(CSG_String(Field), Decimals) ); }
205 const SG_Char * asString (const wchar_t *Field, int Decimals = -99) const { return( asString(CSG_String(Field), Decimals) ); }
206
207 SG_Char asChar (int Field) const;
208 SG_Char asChar (const CSG_String &Field) const;
209 SG_Char asChar (const char *Field) const { return( asChar (CSG_String(Field)) ); }
210 SG_Char asChar (const wchar_t *Field) const { return( asChar (CSG_String(Field)) ); }
211
212 short asShort (int Field) const;
213 short asShort (const CSG_String &Field) const;
214 short asShort (const char *Field) const { return( asShort (CSG_String(Field)) ); }
215 short asShort (const wchar_t *Field) const { return( asShort (CSG_String(Field)) ); }
216
217 int asInt (int Field) const;
218 int asInt (const CSG_String &Field) const;
219 int asInt (const char *Field) const { return( asInt (CSG_String(Field)) ); }
220 int asInt (const wchar_t *Field) const { return( asInt (CSG_String(Field)) ); }
221
222 sLong asLong (int Field) const;
223 sLong asLong (const CSG_String &Field) const;
224 sLong asLong (const char *Field) const { return( asLong (CSG_String(Field)) ); }
225 sLong asLong (const wchar_t *Field) const { return( asLong (CSG_String(Field)) ); }
226
227 float asFloat (int iField) const;
228 float asFloat (const CSG_String &Field) const;
229 float asFloat (const char *Field) const { return( asFloat (CSG_String(Field)) ); }
230 float asFloat (const wchar_t *Field) const { return( asFloat (CSG_String(Field)) ); }
231
232 double asDouble (int Field) const;
233 double asDouble (const CSG_String &Field) const;
234 double asDouble (const char *Field) const { return( asDouble(CSG_String(Field)) ); }
235 double asDouble (const wchar_t *Field) const { return( asDouble(CSG_String(Field)) ); }
236
237 CSG_Table_Value * Get_Value (int Field) { return( m_Values[Field] ); }
238 CSG_Table_Value & operator [] (int Field) const { return( *m_Values[Field] ); }
239
240 virtual bool Assign (CSG_Table_Record *pRecord);
241
242 bool is_Selected (void) const { return( (m_Flags & SG_TABLE_REC_FLAG_Selected) != 0 ); }
243 bool is_Modified (void) const { return( (m_Flags & SG_TABLE_REC_FLAG_Modified) != 0 ); }
244
245
246 protected:
247
248 CSG_Table_Record(class CSG_Table *pTable, sLong Index);
249 virtual ~CSG_Table_Record(void);
250
251
252 char m_Flags;
253
254 sLong m_Index;
255
256 class CSG_Table_Value **m_Values;
257
258 class CSG_Table *m_pTable;
259
260
261 void Set_Selected (bool bOn = true);
262 void Set_Modified (bool bOn = true);
263
264
265 static CSG_Table_Value * _Create_Value (TSG_Data_Type Type);
266
267 bool _Add_Field (int add_Field);
268 bool _Del_Field (int del_Field);
269
270 int _Get_Field (const CSG_String &Field) const;
271
272 };
273
274
276 // //
277 // //
278 // //
280
281 //---------------------------------------------------------
282 class SAGA_API_DLL_EXPORT CSG_Table : public CSG_Data_Object
283 {
284 friend class CSG_Table_Record;
285 friend class CSG_TIN;
286
287 public:
288
289 CSG_Table(void);
290
291 CSG_Table (const CSG_Table &Table);
292 bool Create (const CSG_Table &Table);
293
294 CSG_Table (const CSG_Table *pTemplate);
295 bool Create (const CSG_Table *pTemplate);
296
297 CSG_Table (const CSG_String &File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
298 bool Create (const CSG_String &File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
299 CSG_Table (const char *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
300 bool Create (const char *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
301 CSG_Table (const wchar_t *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
302 bool Create (const wchar_t *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
303
304 CSG_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
305 bool Create (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
306 CSG_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
307 bool Create (const char *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
308 CSG_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
309 bool Create (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
310
311 virtual ~CSG_Table(void);
312
313 virtual bool Destroy (void);
314
315 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_Table ); }
316
317 CSG_Table & operator = (const CSG_Table &Table);
318 virtual bool Assign (CSG_Data_Object *pTable);
319
320 bool Assign_Values (const CSG_Table &Table);
321 bool Assign_Values ( CSG_Table *pTable);
322 bool Assign_Values (const SG_Char *File);
323
324 bool Load (const CSG_String &File, int Format, SG_Char Separator, int Encoding = SG_FILE_ENCODING_UNDEFINED);
325
326 virtual bool Save (const CSG_String &File, int Format, SG_Char Separator, int Encoding = SG_FILE_ENCODING_UNDEFINED);
327 virtual bool Save (const char *File, int Format, SG_Char Separator, int Encoding = SG_FILE_ENCODING_UNDEFINED) { return( Save(CSG_String(File), Format, Separator, Encoding) ); }
328 virtual bool Save (const wchar_t *File, int Format, SG_Char Separator, int Encoding = SG_FILE_ENCODING_UNDEFINED) { return( Save(CSG_String(File), Format, Separator, Encoding) ); }
329
330 virtual bool Save (const CSG_String &File, int Format = 0);
331 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
332 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
333
334 bool Set_File_Encoding (int Encoding);
335 int Get_File_Encoding (void) const { return( m_Encoding ); }
336
337 bool Serialize (CSG_File &Stream, bool bSave);
338
339 //-----------------------------------------------------
340 virtual bool is_Valid (void) const { return( m_nFields > 0 ); }
341
342 bool is_Compatible (const CSG_Table &Table, bool bExactMatch = false) const;
343 bool is_Compatible ( CSG_Table *pTable, bool bExactMatch = false) const;
344
345 //-----------------------------------------------------
346 virtual const CSG_Rect & Get_Extent (void) { return( m_Extent ); }
347
348 //-----------------------------------------------------
349 virtual bool Add_Field (const CSG_String &Name, TSG_Data_Type Type, int Position = -1);
350 virtual bool Add_Field (const char *Name, TSG_Data_Type Type, int Position = -1) { return( Add_Field(CSG_String(Name), Type, Position) ); }
351 virtual bool Add_Field (const wchar_t *Name, TSG_Data_Type Type, int Position = -1) { return( Add_Field(CSG_String(Name), Type, Position) ); }
352 virtual bool Del_Field (int iField);
353 virtual bool Mov_Field (int iField, int Position);
354
355 int Get_Field_Count (void) const { return( m_nFields ); }
356 const SG_Char * Get_Field_Name (int iField) const { return( iField >= 0 && iField < m_nFields ? m_Field_Name[iField]->c_str() : NULL ); }
357 TSG_Data_Type Get_Field_Type (int iField) const { return( iField >= 0 && iField < m_nFields ? m_Field_Type[iField] : SG_DATATYPE_Undefined ); }
358 int Get_Field_Length (int iField, int Encoding = SG_FILE_ENCODING_UNDEFINED) const; // returns the maximum number of characters for data type string and zero for all other data types.
359 int Get_Field (const CSG_String &Name) const; // returns the zero based position of the field named 'Name' or '-1' if there is no field with such name.
360
361 bool Set_Field_Name (int iField, const SG_Char *Name);
362 virtual bool Set_Field_Type (int iField, TSG_Data_Type Type);
363
364 int Find_Field (const CSG_String &Name ) const;
365 bool Find_Field (const CSG_String &Name, int &Index) const;
366
367 sLong Get_N (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Count () : 0 ); }
368 double Get_Minimum (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Minimum () : 0. ); }
369 double Get_Maximum (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Maximum () : 0. ); }
370 double Get_Range (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Range () : 0. ); }
371 double Get_Sum (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Sum () : 0. ); }
372 double Get_Mean (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Mean () : 0. ); }
373 double Get_StdDev (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_StdDev () : 0. ); }
374 double Get_Variance (int iField) const { return( _Stats_Update(iField) ? m_Field_Stats[iField]->Get_Variance() : 0. ); }
375 const CSG_Simple_Statistics & Get_Statistics (int iField) const { _Stats_Update(iField); return( *m_Field_Stats[iField] ); }
376
377 //-----------------------------------------------------
378 virtual CSG_Table_Record * Add_Record ( CSG_Table_Record *pCopy = NULL);
379 virtual CSG_Table_Record * Ins_Record (sLong Index, CSG_Table_Record *pCopy = NULL);
380 virtual bool Set_Record (sLong Index, CSG_Table_Record *pCopy );
381 virtual bool Del_Record (sLong Index);
382 virtual bool Del_Records (void);
383
384 virtual bool Set_Count (sLong nRecords);
385 sLong Get_Count (void) const { return( m_nRecords ); }
386
387 virtual CSG_Table_Record * Get_Record (sLong Index) const { return( Index >= 0 && Index < m_nRecords ? m_Records[Index] : NULL ); }
388 virtual CSG_Table_Record & operator [] (sLong Index) const { return( *Get_Record_byIndex(Index) ); }
389
390 sLong Get_Index (sLong Index) const { return( Index >= 0 && Index < m_nRecords ? (is_Indexed() ? m_Index[Index] : Index) : -1 ); }
391
392 CSG_Table_Record * Get_Record_byIndex (sLong Index) const
393 {
394 return( Index >= 0 && Index < m_nRecords ? Get_Record(is_Indexed() ? m_Index[Index] : Index) : NULL );
395 }
396
397 //-----------------------------------------------------
398 virtual bool Find_Record (sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex = false);
399 virtual CSG_Table_Record * Find_Record ( int iField, const CSG_String &Value, bool bCreateIndex = false);
400 virtual bool Find_Record (sLong &Index, int iField, double Value, bool bCreateIndex = false);
401 virtual CSG_Table_Record * Find_Record ( int iField, double Value, bool bCreateIndex = false);
402
403 //-----------------------------------------------------
404 virtual bool Set_Value (sLong Index, int iField, const SG_Char *Value);
405 virtual bool Set_Value (sLong Index, int iField, double Value);
406
407 virtual bool Get_Value (sLong Index, int iField, CSG_String &Value) const;
408 virtual bool Get_Value (sLong Index, int iField, double &Value) const;
409
410 virtual void Set_Modified (bool bModified = true);
411
412 //-----------------------------------------------------
413 sLong Get_Selection_Count (void) const { return( m_Selection.Get_Size() ); }
414 sLong Get_Selection_Index (sLong Index = 0) const { return( Index >= 0 && Index < m_Selection.Get_Size() ? *((sLong *)m_Selection.Get_Entry(Index)) : Get_Count() ); }
415 virtual CSG_Table_Record * Get_Selection (sLong Index = 0) const { return( Index >= 0 && Index < m_Selection.Get_Size() ? Get_Record(Get_Selection_Index(Index)) : NULL ); }
416
417 virtual bool is_Selected (sLong Index) const { return( Index >= 0 && Index < m_nRecords ? m_Records[Index]->is_Selected() : false ); }
418
419 virtual bool Select (sLong Index , bool bInvert = false);
420 virtual bool Select (CSG_Table_Record *pRecord = NULL, bool bInvert = false);
421
422 virtual sLong Del_Selection (void);
423 virtual sLong Inv_Selection (void);
424
425 //-----------------------------------------------------
426 bool Set_Index (CSG_Index &Index, int Field , bool bAscending = true) const;
427 bool Set_Index (CSG_Index &Index, int Fields[], int nFields, bool bAscending = true) const;
428 bool Set_Index (CSG_Index &Index, const CSG_Array_Int &Fields, bool bAscending = true) const;
429
430 bool is_Indexed (void) const { return( m_nRecords > 0 && m_Index.Get_Count() == m_nRecords ); }
431 bool Set_Index (int Field_1, TSG_Table_Index_Order Order_1 = TABLE_INDEX_Ascending, int Field_2 = -1, TSG_Table_Index_Order Order_2 = TABLE_INDEX_None, int Field_3 = -1, TSG_Table_Index_Order Order_3 = TABLE_INDEX_None);
432 bool Del_Index (void);
433 bool Toggle_Index (int iField);
434 int Get_Index_Field (int i) const { return( i < 0 || i >= m_Index_Fields.Get_Size() ? -1 : abs(m_Index_Fields[i]) - 1 ); }
435 TSG_Table_Index_Order Get_Index_Order (int i) const { return( i < 0 || i >= m_Index_Fields.Get_Size() ? TABLE_INDEX_None : m_Index_Fields[i] > 0 ? TABLE_INDEX_Ascending : TABLE_INDEX_Descending ); }
436 int Get_Index_Field (size_t i) const { return( Get_Index_Field((int)i) ); }
437 TSG_Table_Index_Order Get_Index_Order (size_t i) const { return( Get_Index_Order((int)i) ); }
438
439
440 protected:
441
442 int m_nFields, m_Encoding;
443
444 sLong m_nRecords, m_nBuffer;
445
446 TSG_Data_Type *m_Field_Type;
447
448 CSG_String **m_Field_Name;
449
450 CSG_Simple_Statistics **m_Field_Stats;
451
452 CSG_Array m_Selection;
453
454 CSG_Rect m_Extent;
455
456
457 virtual void _On_Construction (void);
458
459 virtual CSG_Table_Record * _Get_New_Record (sLong Index);
460
461 bool _Add_Selection (sLong Index);
462 bool _Set_Selection (sLong Index, sLong Selected);
463 bool _Del_Selection (sLong Index);
464
465 bool _Stats_Invalidate (void) const;
466 bool _Stats_Invalidate (int iField) const;
467 virtual bool _Stats_Update (int iField) const;
468
469 virtual bool On_NoData_Changed (void);
470 virtual bool On_Update (void);
471
472 virtual bool On_Reload (void);
473 virtual bool On_Delete (void);
474
475
476 private:
477
478 CSG_Index m_Index;
479
480 CSG_Array_Int m_Index_Fields;
481
482 CSG_Table_Record **m_Records;
483
484
485 bool _Destroy_Selection (void);
486
487 bool _Inc_Array (void);
488 bool _Dec_Array (void);
489
490 size_t _Load_Text_Trim ( CSG_String &Text, const SG_Char Separator);
491 size_t _Load_Text_EndQuote (const CSG_String &Text, const SG_Char Separator);
492
493 bool _Load_Text (const CSG_String &File, bool bHeadline, const SG_Char Separator);
494 bool _Save_Text (const CSG_String &File, bool bHeadline, const SG_Char Separator);
495
496 bool _Load_DBase (const CSG_String &File);
497 bool _Save_DBase (const CSG_String &File);
498
499 void _Index_Update (void);
500
501 };
502
503
505 // //
506 // //
507 // //
509
510 //---------------------------------------------------------
512 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (void);
513
515 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const CSG_Table &Table);
516
518 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (CSG_Table *pTemplate);
519
521 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const char *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
523 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
525 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format = TABLE_FILETYPE_Undefined, int Encoding = SG_FILE_ENCODING_UNDEFINED);
526
528 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const char *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
530 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const wchar_t *File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
532 SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table (const CSG_String &File, TSG_Table_File_Type Format, const SG_Char Separator , int Encoding = SG_FILE_ENCODING_UNDEFINED);
533
534
536 // //
537 // //
538 // //
540
541 //---------------------------------------------------------
542 #endif // #ifndef HEADER_INCLUDED__SAGA_API__table_H
CSG_Index
Definition: mat_tools.h:185
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, size_t Value)
Definition: table.h:164
CSG_Table::CSG_Table_Record
friend class CSG_Table_Record
Definition: table.h:284
CSG_Rect
Definition: geo_tools.h:471
CSG_Table::Find_Record
virtual bool Find_Record(sLong &Index, int iField, const CSG_String &Value, bool bCreateIndex=false)
Definition: table.cpp:950
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:734
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_Table_Record::Set_Value
bool Set_Value(int Field, long Value)
Definition: table.h:172
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1001
CSG_Table::is_Valid
virtual bool is_Valid(void) const
Definition: table.h:340
table_value.h
CSG_Table::Set_Count
virtual bool Set_Count(sLong nRecords)
Definition: table.cpp:930
CSG_Table::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: table.h:332
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Table::Get_Index
sLong Get_Index(sLong Index) const
Definition: table.h:390
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, int Value)
Definition: table.h:179
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
TABLE_INDEX_None
@ TABLE_INDEX_None
Definition: table.h:104
TABLE_FILETYPE_DBase
@ TABLE_FILETYPE_DBase
Definition: table.h:97
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, const CSG_String &Value)
Definition: table.h:142
CSG_Table_Record
Definition: table.h:130
CSG_Table::_Stats_Update
virtual bool _Stats_Update(int iField) const
Definition: table.cpp:1228
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, double Value)
Definition: table.h:155
CSG_Table::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: table.h:315
CSG_Table::Inv_Selection
virtual sLong Inv_Selection(void)
Definition: table_selection.cpp:203
CSG_Table_Record::m_pTable
class CSG_Table * m_pTable
Definition: table.h:258
CSG_Table::Get_Value
virtual bool Get_Value(sLong Index, int iField, CSG_String &Value) const
Definition: table.cpp:1161
CSG_Table::m_Selection
CSG_Array m_Selection
Definition: table.h:452
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const wchar_t *Value)
Definition: table.h:140
CSG_Table::is_Selected
virtual bool is_Selected(sLong Index) const
Definition: table.h:417
CSG_Table::Del_Field
virtual bool Del_Field(int iField)
Definition: table.cpp:526
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, DWORD Value)
Definition: table.h:169
SG_TABLE_REC_FLAG_Selected
#define SG_TABLE_REC_FLAG_Selected
Definition: table.h:119
CSG_Table::m_Field_Name
CSG_String ** m_Field_Name
Definition: table.h:448
CSG_Table_Record::asChar
SG_Char asChar(const char *Field) const
Definition: table.h:209
CSG_Table::operator=
CSG_Table & operator=(const CSG_Table &Table)
Definition: table.cpp:364
CSG_Table_Record::Mul_Value
bool Mul_Value(const char *Field, double Value)
Definition: table.h:189
CSG_Data_Object::Save
virtual bool Save(const CSG_String &File, int Format=0)=0
CSG_Table::Get_Selection
virtual CSG_Table_Record * Get_Selection(sLong Index=0) const
Definition: table.h:415
CSG_Table::~CSG_Table
virtual ~CSG_Table(void)
Definition: table.cpp:321
CSG_Table_Record::asLong
sLong asLong(const wchar_t *Field) const
Definition: table.h:225
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, DWORD Value)
Definition: table.h:170
CSG_Table_Record::asShort
short asShort(const char *Field) const
Definition: table.h:214
CSG_Table_Record::is_Selected
bool is_Selected(void) const
Definition: table.h:242
CSG_Table::CSG_Table
CSG_Table(void)
Definition: table.cpp:133
CSG_Table::Get_Index_Order
TSG_Table_Index_Order Get_Index_Order(int i) const
Definition: table.h:435
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, const CSG_String &Value)
Definition: table.h:143
CSG_Table_Record::asShort
short asShort(const wchar_t *Field) const
Definition: table.h:215
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:454
CSG_Table::Get_Field_Length
int Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
Definition: table.cpp:665
CSG_Table_Record::m_Values
class CSG_Table_Value ** m_Values
Definition: table.h:256
CSG_Table::Set_Record
virtual bool Set_Record(sLong Index, CSG_Table_Record *pCopy)
Definition: table.cpp:862
CSG_Table_Value
Definition: table_value.h:111
TABLE_FILETYPE_Undefined
@ TABLE_FILETYPE_Undefined
Definition: table.h:94
CSG_Table_Record::Get_Table
class CSG_Table * Get_Table(void)
Definition: table.h:135
CSG_Table_Record::is_NoData
bool is_NoData(const char *Field) const
Definition: table.h:199
CSG_Table::operator[]
virtual CSG_Table_Record & operator[](sLong Index) const
Definition: table.h:388
CSG_Table_Record::m_Index
sLong m_Index
Definition: table.h:254
CSG_Table::Get_Index_Field
int Get_Index_Field(size_t i) const
Definition: table.h:436
CSG_File
Definition: api_core.h:1116
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
CSG_Table::_Stats_Invalidate
bool _Stats_Invalidate(void) const
Definition: table.cpp:1204
CSG_Table::m_Field_Type
TSG_Data_Type * m_Field_Type
Definition: table.h:446
CSG_Table_Record::m_Flags
char m_Flags
Definition: table.h:252
CSG_Table::Save
virtual bool Save(const wchar_t *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table.h:328
CSG_Table::Get_Index_Order
TSG_Table_Index_Order Get_Index_Order(size_t i) const
Definition: table.h:437
CSG_Table::Get_StdDev
double Get_StdDev(int iField) const
Definition: table.h:373
CSG_Table::Add_Field
virtual bool Add_Field(const wchar_t *Name, TSG_Data_Type Type, int Position=-1)
Definition: table.h:351
CSG_Table::Find_Field
int Find_Field(const CSG_String &Name) const
Definition: table.cpp:717
CSG_Table_Record::Set_Value
bool Set_Value(const CSG_String &Field, DWORD Value)
Definition: table.h:168
CSG_Table_Record::Set_Value
bool Set_Value(const CSG_String &Field, int Value)
Definition: table.h:178
CSG_Table::is_Compatible
bool is_Compatible(const CSG_Table &Table, bool bExactMatch=false) const
Definition: table.cpp:436
CSG_Table_Record::Set_Value
bool Set_Value(const CSG_String &Field, size_t Value)
Definition: table.h:163
CSG_TIN
Definition: tin.h:222
CSG_Table_Record::asChar
SG_Char asChar(const wchar_t *Field) const
Definition: table.h:210
CSG_Table::m_Field_Stats
CSG_Simple_Statistics ** m_Field_Stats
Definition: table.h:450
CSG_Table_Record::Add_Value
bool Add_Value(const wchar_t *Field, double Value)
Definition: table.h:185
CSG_Table::Add_Field
virtual bool Add_Field(const char *Name, TSG_Data_Type Type, int Position=-1)
Definition: table.h:350
CSG_Data_Object
Definition: dataobject.h:180
CSG_Data_Object::On_NoData_Changed
virtual bool On_NoData_Changed(void)
Definition: dataobject.cpp:542
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Table_Record::Set_Value
bool Set_Value(int Field, size_t Value)
Definition: table.h:162
SG_FILE_ENCODING_UNDEFINED
@ SG_FILE_ENCODING_UNDEFINED
Definition: api_core.h:551
CSG_Table::Set_File_Encoding
bool Set_File_Encoding(int Encoding)
Definition: table_io.cpp:81
CSG_Table::Get_Selection_Count
sLong Get_Selection_Count(void) const
Definition: table.h:413
CSG_Table::Serialize
bool Serialize(CSG_File &Stream, bool bSave)
Definition: table_io.cpp:538
CSG_Table::_Set_Selection
bool _Set_Selection(sLong Index, sLong Selected)
Definition: table_selection.cpp:74
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, sLong Value)
Definition: table.h:159
SG_TABLE_REC_FLAG_Modified
#define SG_TABLE_REC_FLAG_Modified
Definition: table.h:118
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, double Value)
Definition: table.h:154
CSG_Table_Record::asInt
int asInt(const char *Field) const
Definition: table.h:219
TSG_Table_Index_Order
TSG_Table_Index_Order
Definition: table.h:103
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_Record::asFloat
float asFloat(const char *Field) const
Definition: table.h:229
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:275
CSG_Table::is_Indexed
bool is_Indexed(void) const
Definition: table.h:430
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, long Value)
Definition: table.h:175
CSG_TIN::_On_Construction
void _On_Construction(void)
Definition: tin.cpp:133
CSG_Table::Get_N
sLong Get_N(int iField) const
Definition: table.h:367
CSG_Table::Mov_Field
virtual bool Mov_Field(int iField, int Position)
Definition: table.cpp:564
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:401
CSG_Table_Record::Set_NoData
bool Set_NoData(const wchar_t *Field)
Definition: table.h:195
TABLE_FILETYPE_Text_NoHeadLine
@ TABLE_FILETYPE_Text_NoHeadLine
Definition: table.h:96
CSG_Array_Int
Definition: api_core.h:421
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, size_t Value)
Definition: table.h:165
CSG_Table_Record::Set_Value
bool Set_Value(int Field, int Value)
Definition: table.h:177
CSG_Table::Get_Index_Field
int Get_Index_Field(int i) const
Definition: table.h:434
CSG_Table::Get_Maximum
double Get_Maximum(int iField) const
Definition: table.h:369
CSG_Table::Del_Index
bool Del_Index(void)
Definition: table.cpp:1341
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, const CSG_Bytes &Value)
Definition: table.h:149
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Table_Record::asLong
sLong asLong(const char *Field) const
Definition: table.h:224
CSG_Table::m_nBuffer
sLong m_nBuffer
Definition: table.h:444
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:218
CSG_Table::Set_Value
virtual bool Set_Value(sLong Index, int iField, const SG_Char *Value)
Definition: table.cpp:1135
CSG_Table::Get_Statistics
const CSG_Simple_Statistics & Get_Statistics(int iField) const
Definition: table.h:375
CSG_Table::Save
virtual bool Save(const char *File, int Format=0)
Definition: table.h:331
CSG_Table_Record::asDouble
double asDouble(const wchar_t *Field) const
Definition: table.h:235
dataobject.h
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
CSG_Table_Record::is_NoData
bool is_NoData(const wchar_t *Field) const
Definition: table.h:200
CSG_Bytes
Definition: api_core.h:804
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
CSG_Table::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: table.h:346
CSG_Table::_Del_Selection
bool _Del_Selection(sLong Index)
Definition: table_selection.cpp:87
CSG_Table::Get_Variance
double Get_Variance(int iField) const
Definition: table.h:374
CSG_Table_Record::asDouble
double asDouble(const char *Field) const
Definition: table.h:234
CSG_Table::Get_Sum
double Get_Sum(int iField) const
Definition: table.h:371
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const char *Value)
Definition: table.h:139
CSG_Table::Set_Field_Name
bool Set_Field_Name(int iField, const SG_Char *Name)
Definition: table.cpp:617
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
SG_Create_Table
SAGA_API_DLL_EXPORT CSG_Table * SG_Create_Table(void)
Definition: table.cpp:65
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, const CSG_Bytes &Value)
Definition: table.h:150
TABLE_INDEX_Descending
@ TABLE_INDEX_Descending
Definition: table.h:106
CSG_Table_Record::asInt
int asInt(const wchar_t *Field) const
Definition: table.h:220
CSG_Table::_Add_Selection
bool _Add_Selection(sLong Index)
Definition: table_selection.cpp:63
CSG_Table_Record::Mul_Value
bool Mul_Value(const wchar_t *Field, double Value)
Definition: table.h:190
CSG_Table_Record::Add_Value
bool Add_Value(const char *Field, double Value)
Definition: table.h:184
CSG_Table_Record::Set_Value
bool Set_Value(const CSG_String &Field, long Value)
Definition: table.h:173
CSG_Table_Record::Set_Value
bool Set_Value(int Field, DWORD Value)
Definition: table.h:167
CSG_Table::Get_Mean
double Get_Mean(int iField) const
Definition: table.h:372
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Load
bool Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:99
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Array
Definition: api_core.h:308
CSG_String
Definition: api_core.h:557
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Table::Get_Minimum
double Get_Minimum(int iField) const
Definition: table.h:368
CSG_Table_Record::Set_NoData
bool Set_NoData(const char *Field)
Definition: table.h:194
TSG_Table_File_Type
TSG_Table_File_Type
Definition: table.h:93
CSG_TIN::m_Extent
CSG_Rect m_Extent
Definition: tin.h:290
CSG_Table::Get_Selection_Index
sLong Get_Selection_Index(sLong Index=0) const
Definition: table.h:414
CSG_Table::m_nFields
int m_nFields
Definition: table.h:442
CSG_Table::Ins_Record
virtual CSG_Table_Record * Ins_Record(sLong Index, CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:805
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, long Value)
Definition: table.h:174
CSG_Table_Record::asString
const SG_Char * asString(const char *Field, int Decimals=-99) const
Definition: table.h:204
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_Table_Record::Set_Value
bool Set_Value(const char *Field, const char *Value)
Definition: table.h:144
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Table::Get_Range
double Get_Range(int iField) const
Definition: table.h:370
CSG_TIN::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: tin.cpp:384
CSG_Table_Record::Get_Value
CSG_Table_Value * Get_Value(int Field)
Definition: table.h:237
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Table::Save
virtual bool Save(const char *File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table.h:327
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, sLong Value)
Definition: table.h:160
TABLE_FILETYPE_Text
@ TABLE_FILETYPE_Text
Definition: table.h:95
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, int Value)
Definition: table.h:180
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Table_Record::Set_Value
bool Set_Value(const wchar_t *Field, const wchar_t *Value)
Definition: table.h:145
CSG_Table::Get_Field
int Get_Field(const CSG_String &Name) const
Definition: table.cpp:699
CSG_Table::Del_Selection
virtual sLong Del_Selection(void)
Definition: table_selection.cpp:178
CSG_Simple_Statistics
Definition: mat_tools.h:708
CSG_Table::Set_Field_Type
virtual bool Set_Field_Type(int iField, TSG_Data_Type Type)
Definition: table.cpp:632
CSG_Table_Record::is_Modified
bool is_Modified(void) const
Definition: table.h:243
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:218
CSG_Table_Record::asFloat
float asFloat(const wchar_t *Field) const
Definition: table.h:230
CSG_TIN::Create
bool Create(const CSG_TIN &TIN)
Definition: tin.cpp:150
CSG_Table::Toggle_Index
bool Toggle_Index(int iField)
Definition: table.cpp:1351
CSG_Table_Record::asString
const SG_Char * asString(const wchar_t *Field, int Decimals=-99) const
Definition: table.h:205
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
CSG_Table::Get_File_Encoding
int Get_File_Encoding(void) const
Definition: table.h:335
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: table_dbase.cpp File Reference

  • saga_core
  • saga_api
table_dbase.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "api_core.h"
#include "table_dbase.h"
#include "table.h"
#include "datetime.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_dbase.cpp Source File

  • saga_core
  • saga_api
table_dbase.cpp
Go to the documentation of this file.
1 /**********************************************************
2 * Version $Id$
3 *********************************************************/
4
6 // //
7 // SAGA //
8 // //
9 // System for Automated Geoscientific Analyses //
10 // //
11 // Application Programming Interface //
12 // //
13 // Library: SAGA_API //
14 // //
15 //-------------------------------------------------------//
16 // //
17 // table_dbase.cpp //
18 // //
19 // Copyright (C) 2005 by Olaf Conrad //
20 // //
21 //-------------------------------------------------------//
22 // //
23 // This file is part of 'SAGA - System for Automated //
24 // Geoscientific Analyses'. //
25 // //
26 // This library is free software; you can redistribute //
27 // it and/or modify it under the terms of the GNU Lesser //
28 // General Public License as published by the Free //
29 // Software Foundation, either version 2.1 of the //
30 // License, or (at your option) any later version. //
31 // //
32 // This library is distributed in the hope that it will //
33 // be useful, but WITHOUT ANY WARRANTY; without even the //
34 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
35 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
36 // License for more details. //
37 // //
38 // You should have received a copy of the GNU Lesser //
39 // General Public License along with this program; if //
40 // not, see <http://www.gnu.org/licenses/>. //
41 // //
42 //-------------------------------------------------------//
43 // //
44 // contact: Olaf Conrad //
45 // Institute of Geography //
46 // University of Goettingen //
47 // Goldschmidtstr. 5 //
48 // 37077 Goettingen //
49 // Germany //
50 // //
51 // e-mail: oconrad@saga-gis.org //
52 // //
54
55 //---------------------------------------------------------
56
57
59 // //
60 // //
61 // //
63
64 //---------------------------------------------------------
65 #include <stdlib.h>
66 #include <string.h>
67 #include <time.h>
68
69 #include "api_core.h"
70 #include "table_dbase.h"
71 #include "table.h"
72 #include "datetime.h"
73
74
76 // //
77 // //
78 // //
80
81 //---------------------------------------------------------
82 CSG_Table_DBase::CSG_Table_DBase(int Encoding)
83 {
84 m_hFile = NULL;
85 m_Record = NULL;
86 m_Fields = NULL;
87 m_nFields = 0;
88 m_Encoding = Encoding;
89 }
90
91 //---------------------------------------------------------
92 CSG_Table_DBase::~CSG_Table_DBase(void)
93 {
94 Close();
95 }
96
97 //---------------------------------------------------------
98 void CSG_Table_DBase::Close(void)
99 {
100 if( m_hFile )
101 {
102 Flush_Record();
103 Header_Write();
104
105 fclose(m_hFile);
106 m_hFile = NULL;
107 }
108
109 SG_FREE_SAFE(m_Record);
110 SG_FREE_SAFE(m_Fields);
111
112 m_nFields = 0;
113 m_nRecords = 0;
114 m_nHeaderBytes = 0;
115 m_nRecordBytes = 0;
116 m_nFileBytes = 0;
117
118 m_bModified = false;
119 }
120
121
123 // //
125
126 //---------------------------------------------------------
127 bool CSG_Table_DBase::Open_Read(const SG_Char *FileName, CSG_Table *pTable, bool bRecords_Load)
128 {
129 Close();
130
131 if( (m_hFile = fopen(CSG_String(FileName), "rb")) == NULL )
132 {
133 SG_UI_Msg_Add_Error(_TL("dbf read: could not open file"));
134
135 return( false );
136 }
137
138 m_bReadOnly = true;
139
140 if( !Header_Read() )
141 {
142 SG_UI_Msg_Add_Error(_TL("dbf read: could not read header"));
143
144 Close();
145
146 return( false );
147 }
148
149 fseek(m_hFile, 0, SEEK_END);
150 m_nFileBytes = ftell(m_hFile);
151 fseek(m_hFile, 0, SEEK_SET);
152
153 //-----------------------------------------------------
154 if( pTable )
155 {
156 int iField;
157
158 pTable->Destroy();
159
160 for(iField=0; iField<Get_Field_Count(); iField++)
161 {
162 switch( Get_Field_Type(iField) )
163 {
164 case DBF_FT_LOGICAL:
165 pTable->Add_Field(Get_Field_Name(iField), SG_DATATYPE_Char);
166 break;
167
168 case DBF_FT_CHARACTER: default:
169 pTable->Add_Field(Get_Field_Name(iField), SG_DATATYPE_String);
170 break;
171
172 case DBF_FT_DATE:
173 pTable->Add_Field(Get_Field_Name(iField), SG_DATATYPE_Date);
174 break;
175
176 case DBF_FT_FLOAT:
177 pTable->Add_Field(Get_Field_Name(iField), SG_DATATYPE_Double);
178 break;
179
180 case DBF_FT_NUMERIC:
181 pTable->Add_Field(Get_Field_Name(iField), Get_Field_Decimals(iField) > 0
182 ? SG_DATATYPE_Double
183 : SG_DATATYPE_Long
184 );
185 }
186 }
187
188 //-------------------------------------------------
189 if( bRecords_Load && Get_Count() > 0 && Move_First() )
190 {
191 for(int iRecord=0; iRecord<Get_Count() && SG_UI_Process_Set_Progress(iRecord, Get_Count()); iRecord++)
192 {
193 CSG_Table_Record *pRecord = pTable->Add_Record();
194
195 for(iField=0; iField<Get_Field_Count(); iField++)
196 {
197 switch( Get_Field_Type(iField) )
198 {
199 default:
200 pRecord->Set_Value(iField, asString(iField));
201 break;
202
203 case DBF_FT_FLOAT:
204 case DBF_FT_NUMERIC:
205 {
206 double Value;
207
208 if( asDouble(iField, Value) )
209 pRecord->Set_Value(iField, Value);
210 else
211 pRecord->Set_NoData(iField);
212 }
213 break;
214 }
215 }
216
217 Move_Next();
218 }
219
220 SG_UI_Process_Set_Ready();
221 }
222 }
223
224 return( true );
225 }
226
227 //---------------------------------------------------------
228 bool CSG_Table_DBase::Header_Read(void)
229 {
230 if( !m_hFile )
231 {
232 return( false );
233 }
234
235 //-----------------------------------------------------
236 char buf[16];
237 TDBF_Header h;
238
239 fseek(m_hFile, 0, SEEK_SET);
240
241 //-----------------------------------------------------
242 // Bytes 0-31: File Header...
243 fread(&h.FileType , sizeof(char), 1, m_hFile); // 00 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo - 0x03
244 // FoxBase+, dBaseIII+ with memo - 0x83
245 // FoxPro with memo - 0xF5
246 // dBaseIV with memo - 0x8B
247 // dBaseIV with SQL Table - 0x8E
248 fread(&h.LastUpdate , sizeof(char), 3, m_hFile); // 01-03 Last update, format YYYYMMDD **correction: it is YYMMDD**
249 fread(&m_nRecords , sizeof(char), 4, m_hFile); // 04-07 Number of records in file (32-bit number)
250 fread(&m_nHeaderBytes , sizeof(char), 2, m_hFile); // 08-09 Number of bytes in header (16-bit number)
251 fread(&m_nRecordBytes , sizeof(char), 2, m_hFile); // 10-11 Number of bytes in record (16-bit number)
252 fread( buf , sizeof(char), 2, m_hFile); // 12-13 Reserved, fill with 0x00
253 fread(&h.Transaction , sizeof(char), 1, m_hFile); // 14 dBaseIV flag, incomplete transaction
254 // Begin Transaction sets it to - 0x01
255 // End Transaction or RollBack reset it to - 0x00
256 fread(&h.bEncrypted , sizeof(char), 1, m_hFile); // 15 Encryption flag, encrypted 0x01 else 0x00
257 // Changing the flag does not encrypt or decrypt the records
258 fread( buf , sizeof(char), 12, m_hFile); // 16-27 dBaseIV multi-user environment use
259 fread(&h.ProductionIdx , sizeof(char), 1, m_hFile); // 28 Production index exists - 0x01 else 0x00
260 fread(&h.LanguageDrvID , sizeof(char), 1, m_hFile); // 29 dBaseIV language driver ID
261 fread( buf , sizeof(char), 2, m_hFile); // 30-31 Reserved fill with 0x00
262
263 //-----------------------------------------------------
264 // Bytes 32-n: Field Descriptor Array...
265 while( ftell(m_hFile) < (long)m_nHeaderBytes - 1 && !feof(m_hFile) )
266 {
267 m_Fields = (TDBF_Field *)SG_Realloc(m_Fields, (m_nFields + 1) * sizeof(TDBF_Field));
268
269 fread( m_Fields[m_nFields].Name , sizeof(char), 11, m_hFile); // 0-10 Field Name ASCII padded with 0x00
270 fread(&m_Fields[m_nFields].Type , sizeof(char), 1, m_hFile); // 11 Field Type Identifier (see table)
271 fread(&m_Fields[m_nFields].Displacement , sizeof(char), 4, m_hFile); // 12-15 Displacement of field in record
272 fread(&m_Fields[m_nFields].Width , sizeof(char), 1, m_hFile); // 16 Field length in bytes
273 fread(&m_Fields[m_nFields].Decimals , sizeof(char), 1, m_hFile); // 17 Field decimal places
274 fread( buf , sizeof(char), 2, m_hFile); // 18-19 Reserved
275 fread(&m_Fields[m_nFields].WorkAreaID , sizeof(char), 1, m_hFile); // 20 dBaseIV work area ID
276 fread( buf , sizeof(char), 10, m_hFile); // 21-30 Reserved
277 fread(&m_Fields[m_nFields].ProductionIdx , sizeof(char), 1, m_hFile); // 31 Field is part of production index - 0x01 else 0x00
278
279 m_Fields[m_nFields].Name[11] = '\0';
280
281 m_nFields++;
282 }
283
284 //-----------------------------------------------------
285 // Byte n+1: Header m_Record Terminator (0x0D)...
286 fread( buf , sizeof(char), 1, m_hFile);
287
288 if( buf[0] == 0x0d )
289 {
290 Init_Record();
291 Move_First();
292
293 return( true );
294 }
295
296 Close();
297
298 return( false );
299 }
300
301
303 // //
305
306 //---------------------------------------------------------
307 bool CSG_Table_DBase::Open_Write(const SG_Char *FileName, CSG_Table *pTable, bool bRecords_Save)
308 {
309 Close();
310
311 if( pTable == NULL || pTable->Get_Field_Count() <= 0 )
312 {
313 SG_UI_Msg_Add_Error(_TL("dbf write: invalid table"));
314
315 return( false );
316 }
317
318 if( (m_hFile = fopen(CSG_String(FileName), "w+b")) == NULL )
319 {
320 SG_UI_Msg_Add_Error(_TL("dbf write: could open file"));
321
322 return( false );
323 }
324
325 m_bReadOnly = false;
326
327 //-----------------------------------------------------
328 int iField, nBytes;
329
330 m_nFields = pTable->Get_Field_Count();
331 m_Fields = (TDBF_Field *)SG_Calloc(m_nFields, sizeof(TDBF_Field)); // init all bytes with 0x00
332
333 for(iField=0; iField<Get_Field_Count(); iField++)
334 {
335 CSG_String Name(pTable->Get_Field_Name(iField));
336
337 for(int j=0; j<11 && j<(int)Name.Length(); j++)
338 {
339 m_Fields[iField].Name[j] = Name.b_str()[j];
340 }
341
342 switch( pTable->Get_Field_Type(iField) )
343 {
344 case SG_DATATYPE_String: default:
345 m_Fields[iField].Type = DBF_FT_CHARACTER;
346 m_Fields[iField].Width = (BYTE)((nBytes = pTable->Get_Field_Length(iField, m_Encoding)) > 255 ? 255 : nBytes < 1 ? 1 : nBytes);
347 break;
348
349 case SG_DATATYPE_Date:
350 m_Fields[iField].Type = DBF_FT_DATE;
351 m_Fields[iField].Width = (BYTE)8;
352 break;
353
354 case SG_DATATYPE_Char:
355 m_Fields[iField].Type = DBF_FT_CHARACTER;
356 m_Fields[iField].Width = (BYTE)1;
357 break;
358
359 case SG_DATATYPE_Bit:
360 m_Fields[iField].Type = DBF_FT_NUMERIC;
361 m_Fields[iField].Width = (BYTE)1;
362 break;
363
364 case SG_DATATYPE_Byte:
365 m_Fields[iField].Type = DBF_FT_NUMERIC;
366 m_Fields[iField].Width = (BYTE)3;
367 break;
368
369 case SG_DATATYPE_Word:
370 case SG_DATATYPE_Short:
371 m_Fields[iField].Type = DBF_FT_NUMERIC;
372 m_Fields[iField].Width = (BYTE)6;
373 break;
374
375 case SG_DATATYPE_DWord:
376 case SG_DATATYPE_Int:
377 case SG_DATATYPE_ULong:
378 case SG_DATATYPE_Long:
379 case SG_DATATYPE_Color:
380 m_Fields[iField].Type = DBF_FT_NUMERIC;
381 m_Fields[iField].Width = (BYTE)16;
382 break;
383
384 case SG_DATATYPE_Float:
385 m_Fields[iField].Type = DBF_FT_NUMERIC;
386 m_Fields[iField].Width = (BYTE)16;
387 m_Fields[iField].Decimals = (BYTE)8;
388 break;
389
390 case SG_DATATYPE_Double:
391 m_Fields[iField].Type = DBF_FT_FLOAT;
392 m_Fields[iField].Width = (BYTE)19;
393 m_Fields[iField].Decimals = (BYTE)10;
394 break;
395 }
396 }
397
398 Header_Write();
399
400 m_nFileBytes = m_nHeaderBytes;
401
402 //-----------------------------------------------------
403 if( bRecords_Save )
404 {
405 for(sLong iRecord=0; iRecord<pTable->Get_Count() && SG_UI_Process_Set_Progress(iRecord, pTable->Get_Count()); iRecord++)
406 {
407 CSG_Table_Record *pRecord = pTable->Get_Record(iRecord);
408
409 Add_Record();
410
411 for(iField=0; iField<Get_Field_Count(); iField++)
412 {
413 if( pRecord->is_NoData(iField) )
414 {
415 Set_NoData(iField);
416 }
417 else switch( Get_Field_Type(iField) )
418 {
419 default:
420 Set_Value(iField, pRecord->asString(iField));
421 break;
422
423 case DBF_FT_FLOAT:
424 case DBF_FT_NUMERIC:
425 Set_Value(iField, pRecord->asDouble(iField));
426 break;
427 }
428 }
429
430 Flush_Record();
431 }
432
433 SG_UI_Process_Set_Ready();
434 }
435
436 return( true );
437 }
438
439 //---------------------------------------------------------
440 void CSG_Table_DBase::Header_Write(void)
441 {
442 if( !m_hFile || m_bReadOnly )
443 {
444 return;
445 }
446
447 //-----------------------------------------------------
448 char buf[16];
449 int iField;
450 time_t ltime;
451 TDBF_Header h;
452
453 time(&ltime);
454 struct tm *pTime = localtime(&ltime);
455
456 h.FileType = 0x03;
457 h.Transaction = 0;
458 h.bEncrypted = 0;
459 h.LanguageDrvID = 0;
460 h.ProductionIdx = 0;
461 h.LastUpdate[0] = (unsigned char)pTime->tm_year;
462 h.LastUpdate[1] = (unsigned char)pTime->tm_mon + 1;
463 h.LastUpdate[2] = (unsigned char)pTime->tm_mday;
464
465 m_nHeaderBytes = (m_nFields + 1) * 32 + 1;
466 m_nRecordBytes = 1; // Delete-Flag = Byte 0...
467
468 for(iField=0; iField<m_nFields; iField++)
469 {
470 if( m_Fields[iField].Type == DBF_FT_CHARACTER )
471 {
472 if( m_Fields[iField].Width < 1 )
473 {
474 m_Fields[iField].Width = 1;
475 }
476 else if( m_Fields[iField].Width > 255 )
477 {
478 m_Fields[iField].Width = 255;
479 }
480 }
481
482 m_nRecordBytes += m_Fields[iField].Width;
483 }
484
485 Init_Record();
486
487 fseek(m_hFile, 0, SEEK_SET);
488
489 memset(buf, 0, 16 * sizeof(char));
490
491 //-----------------------------------------------------
492 // Bytes 0-31: File Header...
493 fwrite(&h.FileType , sizeof(char), 1, m_hFile); // 00 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo - 0x03
494 // FoxBase+, dBaseIII+ with memo - 0x83
495 // FoxPro with memo - 0xF5
496 // dBaseIV with memo - 0x8B
497 // dBaseIV with SQL Table - 0x8E
498 fwrite(&h.LastUpdate , sizeof(char), 3, m_hFile); // 01-03 Last update, format YYYYMMDD **correction: it is YYMMDD**
499 fwrite(&m_nRecords , sizeof(char), 4, m_hFile); // 04-07 Number of records in file (32-bit number)
500 fwrite(&m_nHeaderBytes , sizeof(char), 2, m_hFile); // 08-09 Number of bytes in header (16-bit number)
501 fwrite(&m_nRecordBytes , sizeof(char), 2, m_hFile); // 10-11 Number of bytes in record (16-bit number)
502 fwrite( buf , sizeof(char), 2, m_hFile); // 12-13 Reserved, fill with 0x00
503 fwrite(&h.Transaction , sizeof(char), 1, m_hFile); // 14 dBaseIV flag, incomplete transaction
504 // Begin Transaction sets it to - 0x01
505 // End Transaction or RollBack reset it to - 0x00
506 fwrite(&h.bEncrypted , sizeof(char), 1, m_hFile); // 15 Encryption flag, encrypted 0x01 else 0x00
507 // Changing the flag does not encrypt or decrypt the records
508 fwrite( buf , sizeof(char), 12, m_hFile); // 16-27 dBaseIV multi-user environment use
509 fwrite(&h.ProductionIdx , sizeof(char), 1, m_hFile); // 28 Production index exists - 0x01 else 0x00
510 fwrite(&h.LanguageDrvID , sizeof(char), 1, m_hFile); // 29 dBaseIV language driver ID
511 fwrite( buf , sizeof(char), 2, m_hFile); // 30-31 Reserved fill with 0x00
512
513 //-----------------------------------------------------
514 // Bytes 32-n: Field Descriptor Array...
515 for(iField=0; iField<m_nFields; iField++)
516 {
517 fwrite( m_Fields[iField].Name , sizeof(char), 11, m_hFile); // 00-10 Field Name ASCII padded with 0x00
518 fwrite(&m_Fields[iField].Type , sizeof(char), 1, m_hFile); // 11 Field Type Identifier (see table)
519 fwrite(&m_Fields[iField].Displacement , sizeof(char), 4, m_hFile); // 12-15 Displacement of field in record
520 fwrite(&m_Fields[iField].Width , sizeof(char), 1, m_hFile); // 16 Field length in bytes
521 fwrite(&m_Fields[iField].Decimals , sizeof(char), 1, m_hFile); // 17 Field decimal places
522 fwrite( buf , sizeof(char), 2, m_hFile); // 18-19 Reserved
523 fwrite(&m_Fields[iField].WorkAreaID , sizeof(char), 1, m_hFile); // 20 dBaseIV work area ID
524 fwrite( buf , sizeof(char), 10, m_hFile); // 21-30 Reserved
525 fwrite(&m_Fields[iField].ProductionIdx , sizeof(char), 1, m_hFile); // 31 Field is part of production index - 0x01 else 0x00
526 }
527
528 //-----------------------------------------------------
529 // Byte n+1: Header m_Record Terminator (0x0D)...
530 buf[0] = 0x0D;
531 fwrite( buf , sizeof(char), 1, m_hFile);
532 }
533
534
536 // //
538
539 //---------------------------------------------------------
540 void CSG_Table_DBase::Init_Record(void)
541 {
542 m_Record = (char *)SG_Realloc(m_Record, m_nRecordBytes * sizeof(char));
543 m_Record[0] = ' '; // Data records are preceded by one byte, that is, a space (0x20) if the record is not deleted, an asterisk (0x2A) if the record is deleted.
544
545 for(int iField=0, iPos=1; iField<m_nFields; iPos+=m_Fields[iField++].Width)
546 {
547 m_Fields[iField].Offset = iPos;
548 }
549 }
550
551 //---------------------------------------------------------
552 int CSG_Table_DBase::Get_File_Position(void)
553 {
554 return( m_hFile ? ftell(m_hFile) : 0 );
555 }
556
557
559 // //
561
562 //---------------------------------------------------------
563 bool CSG_Table_DBase::Move_First(void)
564 {
565 bool Result = false;
566
567 if( m_hFile )
568 {
569 Flush_Record();
570
571 fseek(m_hFile, m_nHeaderBytes, SEEK_SET);
572
573 if( fread(m_Record, m_nRecordBytes, sizeof(char), m_hFile) == 1 )
574 {
575 Result = true;
576 }
577
578 fseek(m_hFile, m_nHeaderBytes, SEEK_SET);
579 }
580
581 return( Result );
582 }
583
584 //---------------------------------------------------------
585 bool CSG_Table_DBase::Move_Next(void)
586 {
587 bool Result = false;
588
589 if( m_hFile )
590 {
591 Flush_Record();
592
593 fseek(m_hFile, m_nRecordBytes, SEEK_CUR);
594
595 if( fread(m_Record, m_nRecordBytes, sizeof(char), m_hFile) == 1 )
596 {
597 Result = true;
598 }
599
600 fseek(m_hFile, -m_nRecordBytes, SEEK_CUR);
601 }
602
603 return( Result );
604 }
605
606
608 // //
610
611 //---------------------------------------------------------
612 void CSG_Table_DBase::Add_Record(void)
613 {
614 if( m_hFile )
615 {
616 m_bModified = true;
617
618 memset(m_Record, ' ', m_nRecordBytes);
619
620 fseek(m_hFile, 0, SEEK_END);
621 fwrite(m_Record, m_nRecordBytes, sizeof(char), m_hFile);
622 fseek(m_hFile, -m_nRecordBytes, SEEK_END);
623
624 m_nRecords ++;
625 m_nFileBytes += m_nRecordBytes;
626 }
627 }
628
629 //---------------------------------------------------------
630 void CSG_Table_DBase::Flush_Record(void)
631 {
632 if( m_hFile && !m_bReadOnly && m_bModified )
633 {
634 m_bModified = false;
635 fwrite(m_Record, m_nRecordBytes, sizeof(char), m_hFile);
636 fseek(m_hFile, -m_nRecordBytes, SEEK_CUR);
637 }
638 }
639
640
642 // //
644
645 //---------------------------------------------------------
646 bool CSG_Table_DBase::isDeleted(void)
647 {
648 return( m_hFile && *m_Record == '*' );
649 }
650
651 //---------------------------------------------------------
652 bool CSG_Table_DBase::asInt(int iField, int &Value)
653 {
654 double d;
655
656 if( asDouble(iField, d) )
657 {
658 Value = (int)d;
659
660 return( true );
661 }
662
663 return( false );
664 }
665
666 //---------------------------------------------------------
667 bool CSG_Table_DBase::asDouble(int iField, double &Value)
668 {
669 if( !m_hFile || iField < 0 || iField >= m_nFields )
670 {
671 return( false );
672 }
673
674 //-----------------------------------------------------
675 CSG_String s;
676
677 char *c = m_Record + m_Fields[iField].Offset;
678
679 for(int i=0; i<m_Fields[iField].Width && *c; i++, c++)
680 {
681 s += *c;
682 }
683
684 //-----------------------------------------------------
685 if( m_Fields[iField].Type == DBF_FT_FLOAT
686 || m_Fields[iField].Type == DBF_FT_NUMERIC )
687 {
688 s.Replace(",", ".");
689
690 return( s.asDouble(Value) );
691 }
692
693 //-----------------------------------------------------
694 if( m_Fields[iField].Type == DBF_FT_DATE )
695 {
696 if( s.Length() < 8 )
697 {
698 return( false );
699 }
700
701 int d = s.Mid(6, 2).asInt(); if( d < 1 ) d = 1; else if( d > 31 ) d = 31;
702 int m = s.Mid(4, 2).asInt(); if( m < 1 ) m = 1; else if( m > 12 ) m = 12;
703 int y = s.Mid(0, 4).asInt();
704
705 Value = 10000 * y + 100 * m + d;
706 }
707
708 //-----------------------------------------------------
709 return( true );
710 }
711
712 //---------------------------------------------------------
713 CSG_String CSG_Table_DBase::asString(int iField)
714 {
715 CSG_String Value;
716
717 if( !m_hFile || iField < 0 || iField >= m_nFields )
718 {
719 return( Value );
720 }
721
722 //-----------------------------------------------------
723 if( m_Fields[iField].Type != DBF_FT_DATE )
724 {
725 switch( m_Encoding )
726 {
727 case SG_FILE_ENCODING_ANSI: default:
728 { char *s = m_Record + m_Fields[iField].Offset;
729
730 for(int i=0; i<m_Fields[iField].Width && *s; i++, s++)
731 {
732 Value += *s;
733 }
734 } break;
735
736 case SG_FILE_ENCODING_UTF8:
737 Value = CSG_String::from_UTF8(m_Record + m_Fields[iField].Offset, m_Fields[iField].Width);
738 break;
739 }
740
741 Value.Trim(true);
742 }
743
744 //-----------------------------------------------------
745 if( m_Fields[iField].Type == DBF_FT_DATE ) // SAGA(DD.MM.YYYY) from DBASE(YYYYMMDD)
746 {
747 char *s = m_Record + m_Fields[iField].Offset;
748
749 Value += s[0]; // Y1
750 Value += s[1]; // Y2
751 Value += s[2]; // Y3
752 Value += s[3]; // Y4
753 Value += '-';
754 Value += s[4]; // M1
755 Value += s[5]; // M2
756 Value += '-';
757 Value += s[6]; // D1
758 Value += s[7]; // D2
759 }
760
761 //-----------------------------------------------------
762 return( Value );
763 }
764
765
767 // //
769
770 //---------------------------------------------------------
771 bool CSG_Table_DBase::Set_Value(int iField, double Value)
772 {
773 if( !m_hFile || iField < 0 || iField >= m_nFields || m_Fields[iField].Width < 1 )
774 {
775 return( false );
776 }
777
778 //-----------------------------------------------------
779 if( m_Fields[iField].Type == DBF_FT_DATE )
780 { // Value is expected to be Julian Day Number
781 CSG_DateTime d(Value);
782
783 return( Set_Value(iField, CSG_String::Format("%04d-%02d-%02d",
784 d.Get_Year (),
785 1 + (int)d.Get_Month(),
786 1 + d.Get_Day ()
787 )));
788 }
789
790 //-----------------------------------------------------
791 if( m_Fields[iField].Type == DBF_FT_FLOAT )
792 { // Number stored as a string, right justified, and padded with blanks to the width of the field.
793 char s[256];
794
795 sprintf(s, "%*.*e", m_Fields[iField].Width, m_Fields[iField].Decimals, Value);
796
797 size_t n = strlen(s); if( n > m_Fields[iField].Width ) { n = m_Fields[iField].Width; }
798
799 memset(m_Record + m_Fields[iField].Offset, ' ', m_Fields[iField].Width);
800 memcpy(m_Record + m_Fields[iField].Offset, s , M_GET_MIN(strlen(s), m_Fields[iField].Width));
801
802 m_bModified = true;
803
804 return( true );
805 }
806
807 //-----------------------------------------------------
808 if( m_Fields[iField].Type == DBF_FT_NUMERIC )
809 { // Number stored as a string, right justified, and padded with blanks to the width of the field.
810 char s[256];
811
812 if( m_Fields[iField].Decimals > 0 )
813 {
814 sprintf(s, "%*.*f", m_Fields[iField].Width, m_Fields[iField].Decimals, Value);
815 }
816 else
817 {
818 sprintf(s, "%*d" , m_Fields[iField].Width, (int)Value);
819 }
820
821 memset(m_Record + m_Fields[iField].Offset, ' ', m_Fields[iField].Width);
822 memcpy(m_Record + m_Fields[iField].Offset, s , M_GET_MIN(strlen(s), m_Fields[iField].Width));
823
824 m_bModified = true;
825
826 return( true );
827 }
828
829 //-----------------------------------------------------
830 return( false );
831 }
832
833 //---------------------------------------------------------
834 bool CSG_Table_DBase::Set_Value(int iField, const CSG_String &Value)
835 {
836 if( !m_hFile || iField < 0 || iField >= m_nFields || m_Fields[iField].Width < 1 )
837 {
838 return( false );
839 }
840
841 //-----------------------------------------------------
842 if( m_Fields[iField].Type == DBF_FT_CHARACTER )
843 { // All OEM code page characters - padded with blanks to the width of the field.
844 if( Value.Length() < 1 )
845 {
846 memset(m_Record + m_Fields[iField].Offset, ' ', m_Fields[iField].Width);
847
848 m_bModified = true;
849
850 return( true );
851 }
852
853 CSG_Buffer s;
854
855 switch( m_Encoding )
856 {
857 case SG_FILE_ENCODING_ANSI: default:
858 s = Value.to_ASCII();
859 break;
860
861 case SG_FILE_ENCODING_UTF8:
862 s = Value.to_UTF8 ();
863 break;
864 }
865
866 if( s.Get_Size() >= Value.Length() )
867 {
868 memset(m_Record + m_Fields[iField].Offset, ' ', m_Fields[iField].Width);
869 memcpy(m_Record + m_Fields[iField].Offset, s.Get_Data(), M_GET_MIN(s.Get_Size(), m_Fields[iField].Width));
870
871 m_bModified = true;
872
873 return( true );
874 }
875 }
876
877 //-----------------------------------------------------
878 if( m_Fields[iField].Type == DBF_FT_DATE ) // SAGA(YYYY-MM-DD) to DBASE(YYYYMMDD)
879 { // 8 bytes - date stored as a string in the format YYYYMMDD
880 if( Value.Length() >= 10 )
881 {
882 char *s = m_Record + m_Fields[iField].Offset;
883
884 s[0] = Value.b_str()[0]; // Y1
885 s[1] = Value.b_str()[1]; // Y2
886 s[2] = Value.b_str()[2]; // Y3
887 s[3] = Value.b_str()[3]; // Y4
888 s[4] = Value.b_str()[5]; // M1
889 s[5] = Value.b_str()[6]; // M2
890 s[6] = Value.b_str()[8]; // D1
891 s[7] = Value.b_str()[9]; // D2
892
893 m_bModified = true;
894
895 return( true );
896 }
897 }
898
899 //-----------------------------------------------------
900 return( false );
901 }
902
903 //---------------------------------------------------------
904 bool CSG_Table_DBase::Set_NoData(int iField)
905 {
906 if( !m_hFile || iField < 0 || iField >= m_nFields || m_Fields[iField].Width < 1 )
907 {
908 return( false );
909 }
910
911 //-----------------------------------------------------
912 memset(m_Record + m_Fields[iField].Offset, ' ', m_Fields[iField].Width);
913
914 m_bModified = true;
915
916 return( true );
917 }
918
919
921 // //
922 // //
923 // //
925
926 //---------------------------------------------------------
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
DBF_FT_FLOAT
#define DBF_FT_FLOAT
Definition: table_dbase.h:77
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
CSG_String::to_ASCII
bool to_ASCII(char **pString, char Replace='_') const
Definition: api_string.cpp:909
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:699
CSG_Table_Record
Definition: table.h:130
CSG_Table_DBase::~CSG_Table_DBase
virtual ~CSG_Table_DBase(void)
Definition: table_dbase.cpp:92
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_String::from_UTF8
static CSG_String from_UTF8(const char *String, size_t Length=0)
Definition: api_string.cpp:787
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Table_DBase::asInt
bool asInt(int iField, int &Value)
Definition: table_dbase.cpp:652
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Table_DBase::Get_File_Position
int Get_File_Position(void)
Definition: table_dbase.cpp:552
CSG_Table_DBase::isDeleted
bool isDeleted(void)
Definition: table_dbase.cpp:646
CSG_Table_DBase::Get_Field_Count
int Get_Field_Count(void)
Definition: table_dbase.h:103
CSG_Table_DBase::Get_Field_Decimals
int Get_Field_Decimals(int iField)
Definition: table_dbase.h:115
api_core.h
DBF_FT_CHARACTER
#define DBF_FT_CHARACTER
Definition: table_dbase.h:75
CSG_Table_DBase::Open_Write
bool Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
Definition: table_dbase.cpp:307
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Table::Get_Field_Length
int Get_Field_Length(int iField, int Encoding=SG_FILE_ENCODING_UNDEFINED) const
Definition: table.cpp:665
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_DateTime::Get_Year
int Get_Year(void) const
Definition: datetime.cpp:384
CSG_Table_DBase::Move_Next
bool Move_Next(void)
Definition: table_dbase.cpp:585
SG_Calloc
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
Definition: api_memory.cpp:71
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_Table_DBase::asString
CSG_String asString(int iField)
Definition: table_dbase.cpp:713
CSG_DateTime::Get_Month
Month Get_Month(void) const
Definition: datetime.cpp:379
CSG_Table_DBase::Move_First
bool Move_First(void)
Definition: table_dbase.cpp:563
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Buffer
Definition: api_core.h:224
CSG_Table_DBase::Open_Read
bool Open_Read(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true)
Definition: table_dbase.cpp:127
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:590
DBF_FT_LOGICAL
#define DBF_FT_LOGICAL
Definition: table_dbase.h:79
CSG_Table_DBase::Get_Count
int Get_Count(void)
Definition: table_dbase.h:122
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_DBase::Get_Field_Type
char Get_Field_Type(int iField)
Definition: table_dbase.h:109
CSG_Buffer::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:241
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Table_DBase::Add_Record
void Add_Record(void)
Definition: table_dbase.cpp:612
CSG_DateTime
Definition: datetime.h:183
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
M_GET_MIN
#define M_GET_MIN(a, b)
Definition: mat_tools.h:128
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table_DBase::Flush_Record
void Flush_Record(void)
Definition: table_dbase.cpp:630
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
table_dbase.h
CSG_String::to_UTF8
size_t to_UTF8(char **pString) const
Definition: api_string.cpp:813
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table_DBase::Set_Value
bool Set_Value(int iField, double Value)
Definition: table_dbase.cpp:771
CSG_String
Definition: api_core.h:557
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Table_DBase::CSG_Table_DBase
CSG_Table_DBase(int Encoding=SG_FILE_ENCODING_ANSI)
Definition: table_dbase.cpp:82
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Table_DBase::Close
void Close(void)
Definition: table_dbase.cpp:98
DBF_FT_DATE
#define DBF_FT_DATE
Definition: table_dbase.h:76
CSG_Table_DBase::asDouble
bool asDouble(int iField, double &Value)
Definition: table_dbase.cpp:667
CSG_DateTime::Get_Day
unsigned short Get_Day(void) const
Definition: datetime.cpp:377
CSG_Table::m_nFields
int m_nFields
Definition: table.h:442
CSG_Table_DBase::Set_NoData
bool Set_NoData(int iField)
Definition: table_dbase.cpp:904
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:986
CSG_Table_DBase::Get_Field_Name
const char * Get_Field_Name(int iField)
Definition: table_dbase.h:106
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
DBF_FT_NUMERIC
#define DBF_FT_NUMERIC
Definition: table_dbase.h:78
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
table.h
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
datetime.h
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:11 for SAGA API by doxygen 1.8.19


SAGA API: table_dbase.h File Reference

  • saga_core
  • saga_api
Classes | Macros
table_dbase.h File Reference
#include "api_core.h"

Go to the source code of this file.

Classes

class CSG_Table_DBase

Macros

#define | DBF_FT_NONE '\0'
#define | DBF_FT_CHARACTER 'C'
#define | DBF_FT_DATE 'D'
#define | DBF_FT_FLOAT 'F'
#define | DBF_FT_NUMERIC 'N'
#define | DBF_FT_LOGICAL 'L'
#define | DBF_FT_MEMO 'M'

Macro Definition Documentation

◆ DBF_FT_CHARACTER

#define DBF_FT_CHARACTER 'C'

Definition at line 75 of file table_dbase.h.

◆ DBF_FT_DATE

#define DBF_FT_DATE 'D'

Definition at line 76 of file table_dbase.h.

◆ DBF_FT_FLOAT

#define DBF_FT_FLOAT 'F'

Definition at line 77 of file table_dbase.h.

◆ DBF_FT_LOGICAL

#define DBF_FT_LOGICAL 'L'

Definition at line 79 of file table_dbase.h.

◆ DBF_FT_MEMO

#define DBF_FT_MEMO 'M'

Definition at line 80 of file table_dbase.h.

◆ DBF_FT_NONE

#define DBF_FT_NONE '\0'

Definition at line 74 of file table_dbase.h.

◆ DBF_FT_NUMERIC

#define DBF_FT_NUMERIC 'N'

Definition at line 78 of file table_dbase.h.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_dbase.h Source File

  • saga_core
  • saga_api
table_dbase.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table_dbase.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__table_dbase_H
54 #define HEADER_INCLUDED__SAGA_API__table_dbase_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 #include "api_core.h"
65
66
68 // //
69 // //
70 // //
72
73 //---------------------------------------------------------
74 #define DBF_FT_NONE '\0'
75 #define DBF_FT_CHARACTER 'C'
76 #define DBF_FT_DATE 'D'
77 #define DBF_FT_FLOAT 'F'
78 #define DBF_FT_NUMERIC 'N'
79 #define DBF_FT_LOGICAL 'L'
80 #define DBF_FT_MEMO 'M'
81
82
84 // //
85 // //
86 // //
88
89 //---------------------------------------------------------
90 class CSG_Table_DBase
91 {
92 public:
93 CSG_Table_DBase(int Encoding = SG_FILE_ENCODING_ANSI);
94 virtual ~CSG_Table_DBase(void);
95
96 //-----------------------------------------------------
97 void Close (void);
98
99 bool Open_Read (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load = true);
100 bool Open_Write (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save = true);
101
102 //-----------------------------------------------------
103 int Get_Field_Count (void)
104 { return( m_nFields ); }
105
106 const char * Get_Field_Name (int iField)
107 { return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Name : NULL ); }
108
109 char Get_Field_Type (int iField)
110 { return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Type : DBF_FT_NONE ); }
111
112 int Get_Field_Width (int iField)
113 { return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Width : 0 ); }
114
115 int Get_Field_Decimals (int iField)
116 { return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Decimals : 0 ); }
117
118
119 //-----------------------------------------------------
120 int Get_File_Position (void);
121 int Get_File_Length (void) { return( m_nFileBytes ); }
122 int Get_Count (void) { return( m_nRecords ); }
123
124 //-----------------------------------------------------
125 bool Move_First (void);
126 bool Move_Next (void);
127
128 //-----------------------------------------------------
129 void Add_Record (void);
130 void Flush_Record (void);
131
132 //-----------------------------------------------------
133 bool isDeleted (void);
134
135 bool asInt (int iField, int &Value);
136 bool asDouble (int iField, double &Value);
137 CSG_String asString (int iField);
138
139 //-----------------------------------------------------
140 bool Set_Value (int iField, double Value);
141 bool Set_Value (int iField, const CSG_String &Value);
142 bool Set_NoData (int iField);
143
144
145 private:
146 typedef struct
147 {
148 char Name[12], Type, Displacement[4], WorkAreaID, ProductionIdx;
149
150 unsigned char Width, Decimals;
151
152 int Offset;
153 }
154 TDBF_Field;
155
156 typedef struct
157 {
158 char LastUpdate[3], Transaction, LanguageDrvID, ProductionIdx;
159
160 unsigned char FileType, bEncrypted;
161 }
162 TDBF_Header;
163
164
165 private:
166
167 bool m_bReadOnly, m_bModified;
168
169 char *m_Record;
170
171 short m_nHeaderBytes, m_nRecordBytes;
172
173 int m_nFields, m_nRecords, m_Encoding;
174
175 long m_nFileBytes;
176
177 FILE *m_hFile;
178
179 TDBF_Field *m_Fields;
180
181
182 void Header_Write (void);
183 bool Header_Read (void);
184
185 void Init_Record (void);
186
187 };
188
189
191 // //
192 // //
193 // //
195
196 //---------------------------------------------------------
197 #endif // #ifndef HEADER_INCLUDED__SAGA_API__table_dbase_H
CSG_Table_DBase::~CSG_Table_DBase
virtual ~CSG_Table_DBase(void)
Definition: table_dbase.cpp:92
CSG_Table_DBase::asInt
bool asInt(int iField, int &Value)
Definition: table_dbase.cpp:652
CSG_Table_DBase::Get_File_Position
int Get_File_Position(void)
Definition: table_dbase.cpp:552
CSG_Table_DBase::isDeleted
bool isDeleted(void)
Definition: table_dbase.cpp:646
CSG_Table_DBase::Get_Field_Count
int Get_Field_Count(void)
Definition: table_dbase.h:103
CSG_Table_DBase::Get_Field_Decimals
int Get_Field_Decimals(int iField)
Definition: table_dbase.h:115
api_core.h
CSG_Table_DBase::Open_Write
bool Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
Definition: table_dbase.cpp:307
CSG_Table_DBase::Get_Field_Width
int Get_Field_Width(int iField)
Definition: table_dbase.h:112
CSG_Table_DBase::Get_File_Length
int Get_File_Length(void)
Definition: table_dbase.h:121
CSG_Table_DBase::Move_Next
bool Move_Next(void)
Definition: table_dbase.cpp:585
CSG_Table_DBase::asString
CSG_String asString(int iField)
Definition: table_dbase.cpp:713
CSG_Table_DBase::Move_First
bool Move_First(void)
Definition: table_dbase.cpp:563
CSG_Table_DBase
Definition: table_dbase.h:91
CSG_Table_DBase::Open_Read
bool Open_Read(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true)
Definition: table_dbase.cpp:127
CSG_Table_DBase::Get_Count
int Get_Count(void)
Definition: table_dbase.h:122
CSG_Table_DBase::Get_Field_Type
char Get_Field_Type(int iField)
Definition: table_dbase.h:109
CSG_Table_DBase::Add_Record
void Add_Record(void)
Definition: table_dbase.cpp:612
CSG_Table_DBase::Flush_Record
void Flush_Record(void)
Definition: table_dbase.cpp:630
CSG_Table
Definition: table.h:283
DBF_FT_NONE
#define DBF_FT_NONE
Definition: table_dbase.h:74
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table_DBase::Set_Value
bool Set_Value(int iField, double Value)
Definition: table_dbase.cpp:771
CSG_String
Definition: api_core.h:557
CSG_Table_DBase::CSG_Table_DBase
CSG_Table_DBase(int Encoding=SG_FILE_ENCODING_ANSI)
Definition: table_dbase.cpp:82
CSG_Table_DBase::Close
void Close(void)
Definition: table_dbase.cpp:98
CSG_Table_DBase::asDouble
bool asDouble(int iField, double &Value)
Definition: table_dbase.cpp:667
CSG_Table_DBase::Set_NoData
bool Set_NoData(int iField)
Definition: table_dbase.cpp:904
CSG_Table_DBase::Get_Field_Name
const char * Get_Field_Name(int iField)
Definition: table_dbase.h:106
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:544
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_io.cpp File Reference

  • saga_core
  • saga_api
table_io.cpp File Reference
#include "table.h"
#include "table_dbase.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_io.cpp Source File

  • saga_core
  • saga_api
table_io.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table_io.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "table.h"
54 #include "table_dbase.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 bool CSG_Table::On_Reload(void)
65 {
66 return( Create(Get_File_Name(false)) );
67 }
68
69 //---------------------------------------------------------
70 bool CSG_Table::On_Delete(void)
71 {
72 return( SG_File_Delete(Get_File_Name(false)) );
73 }
74
75
77 // //
79
80 //---------------------------------------------------------
81 bool CSG_Table::Set_File_Encoding(int Encoding)
82 {
83 if( Encoding >= 0 && Encoding < SG_FILE_ENCODING_UNDEFINED )
84 {
85 m_Encoding = Encoding;
86
87 return( true );
88 }
89
90 return( false );
91 }
92
93
95 // //
97
98 //---------------------------------------------------------
99 bool CSG_Table::Load(const CSG_String &FileName, int Format, SG_Char Separator, int Encoding)
100 {
101 Set_File_Encoding(Encoding);
102
103 if( !SG_File_Exists(FileName) )
104 {
105 return( false );
106 }
107
108 //-----------------------------------------------------
109 if( Format == TABLE_FILETYPE_Undefined )
110 {
111 Format = SG_File_Cmp_Extension(FileName, "dbf") ? TABLE_FILETYPE_DBase : TABLE_FILETYPE_Text;
112 }
113
114 if( Separator == '\0' )
115 {
116 Separator = SG_File_Cmp_Extension(FileName, "csv") ? ',' : '\t'; // comma separated values or tab spaced text
117 }
118
119 //-----------------------------------------------------
120 Destroy();
121
122 switch( Format )
123 {
124 case TABLE_FILETYPE_Text: default: if( !_Load_Text (FileName, true , Separator) ) return( false ); break;
125 case TABLE_FILETYPE_Text_NoHeadLine: if( !_Load_Text (FileName, false, Separator) ) return( false ); break;
126 case TABLE_FILETYPE_DBase : if( !_Load_DBase(FileName ) ) return( false ); break;
127 }
128
129 //-----------------------------------------------------
130 Set_Name(SG_File_Get_Name(FileName, false));
131
132 Load_MetaData(FileName);
133
134 CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
135
136 if( pFields && pFields->Get_Children_Count() == Get_Field_Count() )
137 {
138 for(int iField=0; iField<Get_Field_Count(); iField++)
139 {
140 Set_Field_Name(iField, pFields->Get_Content(iField));
141 }
142 }
143
144 //-----------------------------------------------------
145 return( true );
146 }
147
148 //---------------------------------------------------------
149 bool CSG_Table::Save(const CSG_String &FileName, int Format)
150 {
151 return( Save(FileName, Format, '\0', m_Encoding) );
152 }
153
154 //---------------------------------------------------------
155 bool CSG_Table::Save(const CSG_String &FileName, int Format, SG_Char Separator, int Encoding)
156 {
157 SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("table"), FileName.c_str()), true);
158
159 Set_File_Encoding(Encoding);
160
161 //-----------------------------------------------------
162 if( Format <= TABLE_FILETYPE_Undefined || Format > TABLE_FILETYPE_DBase )
163 {
164 if( SG_File_Cmp_Extension(FileName, "dbf") )
165 {
166 Format = TABLE_FILETYPE_DBase;
167 }
168 else
169 {
170 Format = TABLE_FILETYPE_Text;
171
172 if( Separator == '\0' )
173 {
174 Separator = SG_File_Cmp_Extension(FileName, "csv") ? ',' : '\t'; // comma separated values or tab spaced text
175 }
176 }
177 }
178
179 //-----------------------------------------------------
180 bool bResult = false;
181
182 switch( Format )
183 {
184 case TABLE_FILETYPE_Text: default: bResult = _Save_Text (FileName, true , Separator); break;
185 case TABLE_FILETYPE_Text_NoHeadLine: bResult = _Save_Text (FileName, false, Separator); break;
186 case TABLE_FILETYPE_DBase : bResult = _Save_DBase(FileName ); break;
187 }
188
189 //-----------------------------------------------------
190 CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
191
192 if( !pFields )
193 {
194 pFields = Get_MetaData_DB().Add_Child("FIELDS");
195 }
196
197 pFields->Del_Children();
198
199 for(int iField=0; iField<Get_Field_Count(); iField++)
200 {
201 pFields->Add_Child("FIELD", Get_Field_Name(iField))->Add_Property("TYPE", gSG_Data_Type_Identifier[Get_Field_Type(iField)]);
202 }
203
204 //-----------------------------------------------------
205 if( bResult )
206 {
207 Set_Modified(false);
208
209 Set_Update_Flag();
210
211 Set_File_Type(Format);
212
213 Set_File_Name(FileName, true);
214
215 Save_MetaData(FileName);
216
217 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
218
219 return( true );
220 }
221
222 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
223
224 return( false );
225 }
226
227
229 // //
230 // Text //
231 // //
233
234 //---------------------------------------------------------
235 size_t CSG_Table::_Load_Text_Trim(CSG_String &s, const SG_Char Separator)
236 {
237 for(size_t i=0; i<s.Length(); i++)
238 {
239 SG_Char c = s[i];
240
241 if( c == Separator || (c != ' ' && c != '\t' && c != '\n' && c != '\v' && c != '\f' && c != '\r') )
242 {
243 if( i > 0 )
244 {
245 s = s.Right(s.Length() - i);
246 }
247
248 return( i );
249 }
250 }
251
252 return( 0 );
253 }
254
255 //---------------------------------------------------------
256 size_t CSG_Table::_Load_Text_EndQuote(const CSG_String &s, const SG_Char Separator)
257 {
258 if( s.Length() > 1 && s[0] == '\"' )
259 {
260 bool bInQuotes = true;
261
262 for(size_t i=1; i<s.Length(); i++)
263 {
264 if( bInQuotes )
265 {
266 if( s[i] == '\"' )
267 {
268 bInQuotes = false;
269 }
270 }
271 else if( s[i] == '\"' )
272 {
273 bInQuotes = true;
274 }
275 else if( s[i] == Separator )
276 {
277 return( i );
278 }
279 }
280
281 if( s[s.Length() - 1] == '\"' )
282 {
283 return( s.Length() );
284 }
285 }
286
287 return( 0 );
288 }
289
290 //---------------------------------------------------------
291 bool CSG_Table::_Load_Text(const CSG_String &FileName, bool bHeadline, const SG_Char Separator)
292 {
293 CSG_File Stream;
294
295 if( Stream.Open(FileName, SG_FILE_R, false, m_Encoding) == false )
296 {
297 return( false );
298 }
299
300 sLong fLength = Stream.Length();
301
302 if( fLength <= 0 )
303 {
304 return( false );
305 }
306
307 CSG_String sLine;
308
309 if( !Stream.Read_Line(sLine) )
310 {
311 return( false );
312 }
313
314 //-----------------------------------------------------
315 CSG_Table Table;
316
317 _Load_Text_Trim(sLine, Separator);
318
319 while( !sLine.is_Empty() )
320 {
321 CSG_String sField;
322
323 if( sLine[0] == '\"' ) // value in quotas
324 {
325 sField = sLine.AfterFirst('\"').BeforeFirst('\"');
326 sLine = sLine.AfterFirst('\"').AfterFirst ('\"');
327 }
328 else
329 {
330 sField = sLine.BeforeFirst(Separator);
331 }
332
333 sLine = sLine.AfterFirst(Separator); _Load_Text_Trim(sLine, Separator);
334
335 if( !bHeadline || sField.Length() == 0 )
336 {
337 sField.Printf("F%02d", Table.Get_Field_Count() + 1);
338 }
339
340 Table.Add_Field(sField, SG_DATATYPE_String);
341 }
342
343 //-----------------------------------------------------
344 TSG_Data_Type *Type = new TSG_Data_Type[Table.Get_Field_Count()];
345
346 for(int iField=0; iField<Table.Get_Field_Count(); iField++)
347 {
348 Type[iField] = SG_DATATYPE_Int;
349 }
350
351 if( !bHeadline )
352 {
353 Stream.Seek_Start();
354 }
355
356 while( Stream.Read_Line(sLine) && SG_UI_Process_Set_Progress((double)Stream.Tell(), (double)fLength) )
357 {
358 if( sLine.Length() < 1 )
359 {
360 continue;
361 }
362
363 CSG_Table_Record *pRecord = Table.Add_Record();
364
365 _Load_Text_Trim(sLine, Separator);
366
367 for(int iField=0; iField<Table.Get_Field_Count() && !sLine.is_Empty(); iField++)
368 {
369 size_t Position = _Load_Text_EndQuote(sLine, Separator); CSG_String sField;
370
371 if( Position > 0 ) // value in quotas !!!
372 {
373 if( Position - 2 > 0 )
374 {
375 sField = sLine.Mid(1, Position - 2);
376 }
377 else
378 {
379 sField.Clear();
380 }
381
382 sLine = sLine.Right(sLine.Length() - Position);
383
384 Type[iField] = SG_DATATYPE_String;
385 }
386 else
387 {
388 sField = sLine.BeforeFirst(Separator);
389 }
390
391 sLine = sLine.AfterFirst(Separator); _Load_Text_Trim(sLine, Separator);
392
393 //---------------------------------------------
394 if( Type[iField] != SG_DATATYPE_String && !sField.is_Empty() )
395 {
396 try
397 {
398 size_t pos; double Value = std::stod(sField.to_StdString(), &pos);
399
400 if( pos < sField.Length() )
401 {
402 Type[iField] = SG_DATATYPE_String;
403 }
404 else if( Type[iField] != SG_DATATYPE_Double && (Value - (int)Value != 0. || sField.Find('.') >= 0) )
405 {
406 Type[iField] = SG_DATATYPE_Double;
407 }
408 }
409 catch(...)
410 {
411 Type[iField] = SG_DATATYPE_String;
412 }
413 }
414
415 pRecord->Set_Value(iField, sField);
416 }
417 }
418
419 //-----------------------------------------------------
420 if( Table.Get_Field_Count() > 0 )
421 {
422 for(int iField=0; iField<Table.Get_Field_Count(); iField++)
423 {
424 Add_Field(Table.Get_Field_Name(iField), Type[iField]);
425 }
426
427 for(sLong iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
428 {
429 CSG_Table_Record *pRecord = Add_Record();
430
431 for(int iField=0; iField<Get_Field_Count(); iField++)
432 {
433 if( *Table[iRecord].asString(iField) )
434 {
435 pRecord->Set_Value(iField, Table[iRecord].asString(iField));
436 }
437 else
438 {
439 pRecord->Set_NoData(iField);
440 }
441 }
442 }
443 }
444
445 delete[](Type);
446
447 SG_UI_Process_Set_Ready();
448
449 return( Get_Field_Count() > 0 );
450 }
451
452 //---------------------------------------------------------
453 bool CSG_Table::_Save_Text(const CSG_String &FileName, bool bHeadline, const SG_Char Separator)
454 {
455 CSG_File Stream;
456
457 if( Get_Field_Count() <= 0 || Stream.Open(FileName, SG_FILE_W, false, m_Encoding) == false )
458 {
459 return( false );
460 }
461
462 //-----------------------------------------------------
463 for(int iField=0; iField<Get_Field_Count(); iField++)
464 {
465 Stream.Printf("%s%c", Get_Field_Name(iField), iField < Get_Field_Count() - 1 ? Separator : '\n');
466 }
467
468 //-----------------------------------------------------
469 for(sLong iRecord=0; iRecord<Get_Count() && SG_UI_Process_Set_Progress(iRecord, Get_Count()); iRecord++)
470 {
471 CSG_Table_Record *pRecord = Get_Record_byIndex(iRecord);
472
473 for(int iField=0; iField<Get_Field_Count(); iField++)
474 {
475 switch( Get_Field_Type(iField) )
476 {
477 case SG_DATATYPE_String:
478 case SG_DATATYPE_Date :
479 if( !pRecord->is_NoData(iField) )
480 {
481 Stream.Printf("\"%s\"", pRecord->asString(iField));
482 }
483 else
484 {
485 Stream.Printf("\"\"");
486 }
487 break;
488
489 default:
490 if( !pRecord->is_NoData(iField) )
491 {
492 Stream.Printf("%s", pRecord->asString(iField));
493 }
494 break;
495 }
496
497 Stream.Printf("%c", iField < Get_Field_Count() - 1 ? Separator : '\n');
498 }
499 }
500
501 //-----------------------------------------------------
502 SG_UI_Process_Set_Ready();
503
504 return( true );
505 }
506
507
509 // //
510 // DBase //
511 // //
513
514 //---------------------------------------------------------
515 bool CSG_Table::_Load_DBase(const CSG_String &FileName)
516 {
517 CSG_Table_DBase dbf(m_Encoding);
518
519 return( dbf.Open_Read(FileName, this) );
520 }
521
522 //---------------------------------------------------------
523 bool CSG_Table::_Save_DBase(const CSG_String &FileName)
524 {
525 CSG_Table_DBase dbf(m_Encoding);
526
527 return( dbf.Open_Write(FileName, this) );
528 }
529
530
532 // //
533 // Serialize //
534 // //
536
537 //---------------------------------------------------------
538 bool CSG_Table::Serialize(CSG_File &Stream, bool bSave)
539 {
540 const SG_Char Separator = SG_T('\t');
541
542 //-----------------------------------------------------
543 if( bSave )
544 {
545 Stream.Printf("%d %d\n", m_nFields, m_nRecords);
546
547 for(int iField=0; iField<m_nFields; iField++)
548 {
549 Stream.Printf("%d \"%s\"\n", Get_Field_Type(iField), Get_Field_Name(iField));
550 }
551
552 for(sLong iRecord=0; iRecord<m_nRecords; iRecord++)
553 {
554 for(int iField=0; iField<m_nFields; iField++)
555 {
556 Stream.Printf("%s%c", Get_Record(iRecord)->asString(iField), iField < m_nFields - 1 ? Separator : '\n');
557 }
558 }
559
560 return( true );
561 }
562
563 //-----------------------------------------------------
564 CSG_String sLine; int nFields, FieldType; sLong nRecords;
565
566 if( Stream.Read_Line(sLine) && SG_SSCANF(sLine, SG_T("%d %lld"), &nFields, &nRecords) == 2 && nFields > 0 )
567 {
568 Destroy();
569
570 for(int iField=0; iField<nFields; iField++)
571 {
572 if( Stream.Read_Line(sLine) && SG_SSCANF(sLine, SG_T("%d"), &FieldType) == 1 )
573 {
574 Add_Field(sLine.AfterFirst('\"').BeforeFirst('\"'), (TSG_Data_Type)FieldType);
575 }
576 }
577
578 for(sLong iRecord=0; iRecord<nRecords; iRecord++)
579 {
580 if( Stream.Read_Line(sLine) )
581 {
582 CSG_Table_Record *pRecord = Add_Record();
583
584 for(int iField=0; iField<m_nFields; iField++)
585 {
586 pRecord->Set_Value(iField, sLine.BeforeFirst(Separator));
587
588 sLine = sLine.AfterFirst(Separator);
589 }
590 }
591 }
592
593 return( true );
594 }
595
596 //-----------------------------------------------------
597 return( false );
598 }
599
600
602 // //
603 // //
604 // //
606
607 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_File::Seek_Start
bool Seek_Start(void) const
Definition: api_file.cpp:251
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
TABLE_FILETYPE_DBase
@ TABLE_FILETYPE_DBase
Definition: table.h:97
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:699
CSG_Table_Record
Definition: table.h:130
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Data_Object::Save_MetaData
bool Save_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:618
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Table::On_Reload
virtual bool On_Reload(void)
Definition: table_io.cpp:64
SG_SSCANF
#define SG_SSCANF
Definition: api_core.h:534
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
SG_FILE_R
@ SG_FILE_R
Definition: api_core.h:1101
TABLE_FILETYPE_Undefined
@ TABLE_FILETYPE_Undefined
Definition: table.h:94
CSG_Table::On_Delete
virtual bool On_Delete(void)
Definition: table_io.cpp:70
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_File
Definition: api_core.h:1116
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Table_DBase
Definition: table_dbase.h:91
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_String::to_StdString
std::string to_StdString(void) const
Definition: api_string.cpp:954
SG_FILE_ENCODING_UNDEFINED
@ SG_FILE_ENCODING_UNDEFINED
Definition: api_core.h:551
CSG_Table::Set_File_Encoding
bool Set_File_Encoding(int Encoding)
Definition: table_io.cpp:81
CSG_Table::Serialize
bool Serialize(CSG_File &Stream, bool bSave)
Definition: table_io.cpp:538
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
CSG_File::Read_Line
bool Read_Line(CSG_String &sLine) const
Definition: api_file.cpp:379
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Data_Object::Set_File_Type
void Set_File_Type(int Type)
Definition: dataobject.h:263
TABLE_FILETYPE_Text_NoHeadLine
@ TABLE_FILETYPE_Text_NoHeadLine
Definition: table.h:96
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:392
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:442
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Table::Set_Field_Name
bool Set_Field_Name(int iField, const SG_Char *Name)
Definition: table.cpp:617
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
gSG_Data_Type_Identifier
const char gSG_Data_Type_Identifier[][32]
Definition: api_core.h:1031
CSG_Table
Definition: table.h:283
table_dbase.h
CSG_File::Length
sLong Length(void) const
Definition: api_file.cpp:220
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table::Load
bool Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:99
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
CSG_String
Definition: api_core.h:557
CSG_MetaData
Definition: metadata.h:88
CSG_Data_Object::Get_MetaData_DB
CSG_MetaData & Get_MetaData_DB(void) const
Definition: dataobject.h:226
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
CSG_Data_Object::Load_MetaData
bool Load_MetaData(const CSG_String &FileName)
Definition: dataobject.cpp:595
CSG_Table::m_nFields
int m_nFields
Definition: table.h:442
CSG_Table::Save
virtual bool Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:155
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
TABLE_FILETYPE_Text
@ TABLE_FILETYPE_Text
Definition: table.h:95
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
table.h
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
CSG_File::Tell
sLong Tell(void) const
Definition: api_file.cpp:255
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_record.cpp File Reference

  • saga_core
  • saga_api
table_record.cpp File Reference
#include "table.h"
#include "table_value.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_record.cpp Source File

  • saga_core
  • saga_api
table_record.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table_record.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "table.h"
54 #include "table_value.h"
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
64 CSG_Table_Record::CSG_Table_Record(CSG_Table *pTable, sLong Index)
65 {
66 m_pTable = pTable;
67 m_Index = Index;
68 m_Flags = 0;
69
70 if( m_pTable && m_pTable->Get_Field_Count() > 0 )
71 {
72 m_Values = (CSG_Table_Value **)SG_Malloc(m_pTable->Get_Field_Count() * sizeof(CSG_Table_Value *));
73
74 for(int iField=0; iField<m_pTable->Get_Field_Count(); iField++)
75 {
76 m_Values[iField] = _Create_Value(m_pTable->Get_Field_Type(iField));
77 }
78 }
79 else
80 {
81 m_Values = NULL;
82 }
83 }
84
85 //---------------------------------------------------------
86 CSG_Table_Record::~CSG_Table_Record(void)
87 {
88 if( is_Selected() )
89 {
90 m_pTable->Select(m_Index, true);
91 }
92
93 if( m_pTable->Get_Field_Count() > 0 )
94 {
95 for(int iField=0; iField<m_pTable->Get_Field_Count(); iField++)
96 {
97 delete(m_Values[iField]);
98 }
99
100 SG_Free(m_Values);
101 }
102 }
103
104
106 // //
108
109 //---------------------------------------------------------
110 CSG_Table_Value * CSG_Table_Record::_Create_Value(TSG_Data_Type Type)
111 {
112 switch( Type )
113 {
114 default:
115 case SG_DATATYPE_String: return( new CSG_Table_Value_String() );
116
117 case SG_DATATYPE_Date : return( new CSG_Table_Value_Date () );
118
119 case SG_DATATYPE_Color :
120 case SG_DATATYPE_Byte :
121 case SG_DATATYPE_Char :
122 case SG_DATATYPE_Word :
123 case SG_DATATYPE_Short :
124 case SG_DATATYPE_DWord :
125 case SG_DATATYPE_Int : return( new CSG_Table_Value_Int () );
126
127 case SG_DATATYPE_ULong :
128 case SG_DATATYPE_Long : return( new CSG_Table_Value_Long () );
129
130 case SG_DATATYPE_Float :
131 case SG_DATATYPE_Double: return( new CSG_Table_Value_Double() );
132
133 case SG_DATATYPE_Binary: return( new CSG_Table_Value_Binary() );
134 }
135 }
136
137
139 // //
141
142 //---------------------------------------------------------
143 bool CSG_Table_Record::_Add_Field(int add_Field)
144 {
145 if( add_Field < 0 )
146 {
147 add_Field = 0;
148 }
149 else if( add_Field >= m_pTable->Get_Field_Count() )
150 {
151 add_Field = m_pTable->Get_Field_Count() - 1;
152 }
153
154 m_Values = (CSG_Table_Value **)SG_Realloc(m_Values, m_pTable->Get_Field_Count() * sizeof(CSG_Table_Value *));
155
156 for(int iField=m_pTable->Get_Field_Count()-1; iField>add_Field; iField--)
157 {
158 m_Values[iField] = m_Values[iField - 1];
159 }
160
161 m_Values[add_Field] = _Create_Value(m_pTable->Get_Field_Type(add_Field));
162
163 return( true );
164 }
165
166 //---------------------------------------------------------
167 bool CSG_Table_Record::_Del_Field(int del_Field)
168 {
169 delete(m_Values[del_Field]);
170
171 for(int iField=del_Field; iField<m_pTable->Get_Field_Count(); iField++)
172 {
173 m_Values[iField] = m_Values[iField + 1];
174 }
175
176 m_Values = (CSG_Table_Value **)SG_Realloc(m_Values, m_pTable->Get_Field_Count() * sizeof(CSG_Table_Value *));
177
178 return( true );
179 }
180
181 //---------------------------------------------------------
182 int CSG_Table_Record::_Get_Field(const CSG_String &Field) const
183 {
184 if( Field.Length() )
185 {
186 for(int iField=0; iField<m_pTable->Get_Field_Count(); iField++)
187 {
188 if( !Field.Cmp(m_pTable->Get_Field_Name(iField)) )
189 {
190 return( iField );
191 }
192 }
193 }
194
195 return( -1 );
196 }
197
198
200 // //
202
203 //---------------------------------------------------------
204 void CSG_Table_Record::Set_Selected(bool bOn)
205 {
206 if( bOn != is_Selected() )
207 {
208 if( bOn )
209 {
210 m_Flags |= SG_TABLE_REC_FLAG_Selected;
211 }
212 else
213 {
214 m_Flags &= ~SG_TABLE_REC_FLAG_Selected;
215 }
216 }
217 }
218
219 //---------------------------------------------------------
220 void CSG_Table_Record::Set_Modified(bool bOn)
221 {
222 if( bOn != is_Modified() )
223 {
224 if( bOn )
225 {
226 m_Flags |= SG_TABLE_REC_FLAG_Modified;
227 }
228 else
229 {
230 m_Flags &= ~SG_TABLE_REC_FLAG_Modified;
231 }
232 }
233
234 if( bOn )
235 {
236 m_pTable->Set_Modified();
237 }
238 }
239
240
242 // //
244
245 //---------------------------------------------------------
246 bool CSG_Table_Record::Set_Value(int Field, const CSG_Bytes &Value)
247 {
248 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
249 {
250 if( m_Values[Field]->Set_Value(Value) )
251 {
252 Set_Modified(true);
253
254 m_pTable->Set_Update_Flag();
255 m_pTable->_Stats_Invalidate(Field);
256
257 return( true );
258 }
259 }
260
261 return( false );
262 }
263
264 bool CSG_Table_Record::Set_Value(const CSG_String &Field, const CSG_Bytes &Value)
265 {
266 return( Set_Value(_Get_Field(Field), Value) );
267 }
268
269 //---------------------------------------------------------
270 bool CSG_Table_Record::Set_Value(int Field, const CSG_String &Value)
271 {
272 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
273 {
274 if( m_Values[Field]->Set_Value(Value) )
275 {
276 Set_Modified(true);
277
278 m_pTable->Set_Update_Flag();
279 m_pTable->_Stats_Invalidate(Field);
280
281 return( true );
282 }
283 }
284
285 return( false );
286 }
287
288 bool CSG_Table_Record::Set_Value(const CSG_String &Field, const CSG_String &Value)
289 {
290 return( Set_Value(_Get_Field(Field), Value) );
291 }
292
293 //---------------------------------------------------------
294 bool CSG_Table_Record::Set_Value(int Field, sLong Value)
295 {
296 return( Set_Value(Field, (double)Value) );
297 }
298
299 bool CSG_Table_Record::Set_Value(const CSG_String &Field, sLong Value)
300 {
301 return( Set_Value(Field, (double)Value) );
302 }
303
304 //---------------------------------------------------------
305 bool CSG_Table_Record::Set_Value(int Field, double Value)
306 {
307 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
308 {
309 if( m_Values[Field]->Set_Value(Value) )
310 {
311 Set_Modified(true);
312
313 m_pTable->Set_Update_Flag();
314 m_pTable->_Stats_Invalidate(Field);
315
316 return( true );
317 }
318 }
319
320 return( false );
321 }
322
323 bool CSG_Table_Record::Set_Value(const CSG_String &Field, double Value)
324 {
325 return( Set_Value(_Get_Field(Field), Value) );
326 }
327
328 //---------------------------------------------------------
329 bool CSG_Table_Record::Add_Value(int Field, double Value)
330 {
331 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
332 {
333 return( Set_Value(Field, asDouble(Field) + Value) );
334 }
335
336 return( false );
337 }
338
339 bool CSG_Table_Record::Add_Value(const CSG_String &Field, double Value)
340 {
341 return( Add_Value(_Get_Field(Field), Value) );
342 }
343
344 //---------------------------------------------------------
345 bool CSG_Table_Record::Mul_Value(int Field, double Value)
346 {
347 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
348 {
349 return( Set_Value(Field, asDouble(Field) * Value) );
350 }
351
352 return( false );
353 }
354
355 bool CSG_Table_Record::Mul_Value(const CSG_String &Field, double Value)
356 {
357 return( Mul_Value(_Get_Field(Field), Value) );
358 }
359
360
362 // //
364
365 //---------------------------------------------------------
366 bool CSG_Table_Record::Set_NoData(int Field)
367 {
368 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
369 {
370 switch( m_pTable->Get_Field_Type(Field) )
371 {
372 default:
373 case SG_DATATYPE_String:
374 if( !m_Values[Field]->Set_Value(SG_T("")) )
375 return( false );
376 break;
377
378 case SG_DATATYPE_Date :
379 case SG_DATATYPE_Color :
380 case SG_DATATYPE_Byte :
381 case SG_DATATYPE_Char :
382 case SG_DATATYPE_Word :
383 case SG_DATATYPE_Short :
384 case SG_DATATYPE_DWord :
385 case SG_DATATYPE_Int :
386 case SG_DATATYPE_ULong :
387 case SG_DATATYPE_Long :
388 case SG_DATATYPE_Float :
389 case SG_DATATYPE_Double:
390 if( !m_Values[Field]->Set_Value(m_pTable->Get_NoData_Value()) )
391 return( false );
392 break;
393
394 case SG_DATATYPE_Binary:
395 m_Values[Field]->asBinary().Destroy();
396 break;
397 }
398
399 Set_Modified(true);
400
401 m_pTable->Set_Update_Flag();
402 m_pTable->_Stats_Invalidate(Field);
403
404 return( true );
405 }
406
407 return( false );
408 }
409
410 bool CSG_Table_Record::Set_NoData(const CSG_String &Field)
411 {
412 return( Set_NoData(_Get_Field(Field)) );
413 }
414
415 //---------------------------------------------------------
416 bool CSG_Table_Record::is_NoData(int Field) const
417 {
418 if( Field >= 0 && Field < m_pTable->Get_Field_Count() )
419 {
420 switch( m_pTable->Get_Field_Type(Field) )
421 {
422 default:
423 case SG_DATATYPE_String:
424 return( !m_Values[Field]->asString() || !*m_Values[Field]->asString() );
425
426 case SG_DATATYPE_Date :
427 case SG_DATATYPE_Color :
428 case SG_DATATYPE_Byte :
429 case SG_DATATYPE_Char :
430 case SG_DATATYPE_Word :
431 case SG_DATATYPE_Short :
432 case SG_DATATYPE_DWord :
433 case SG_DATATYPE_Int :
434 case SG_DATATYPE_ULong :
435 case SG_DATATYPE_Long :
436 return( m_pTable->is_NoData_Value(m_Values[Field]->asInt()) );
437
438 case SG_DATATYPE_Float :
439 case SG_DATATYPE_Double:
440 return( m_pTable->is_NoData_Value(m_Values[Field]->asDouble()) );
441
442 case SG_DATATYPE_Binary:
443 return( m_Values[Field]->asBinary().Get_Count() == 0 );
444 }
445 }
446
447 return( true );
448 }
449
450 bool CSG_Table_Record::is_NoData(const CSG_String &Field) const
451 {
452 return( is_NoData(_Get_Field(Field)) );
453 }
454
455
457 // //
459
460 //---------------------------------------------------------
461 const SG_Char * CSG_Table_Record::asString(int Field, int Decimals) const
462 {
463 return( Field >= 0 && Field < m_pTable->Get_Field_Count() ? m_Values[Field]->asString(Decimals) : NULL );
464 }
465
466 const SG_Char * CSG_Table_Record::asString(const CSG_String &Field, int Decimals) const
467 {
468 return( asString(_Get_Field(Field), Decimals) );
469 }
470
471 //---------------------------------------------------------
472 SG_Char CSG_Table_Record::asChar(int Field) const
473 {
474 return( (SG_Char)asInt(Field) );
475 }
476
477 SG_Char CSG_Table_Record::asChar(const CSG_String &Field) const
478 {
479 return( asChar(_Get_Field(Field)) );
480 }
481
482 //---------------------------------------------------------
483 short CSG_Table_Record::asShort(int Field) const
484 {
485 return( (short)asInt(Field) );
486 }
487
488 short CSG_Table_Record::asShort(const CSG_String &Field) const
489 {
490 return( asShort(_Get_Field(Field)) );
491 }
492
493 //---------------------------------------------------------
494 int CSG_Table_Record::asInt(int Field) const
495 {
496 return( Field >= 0 && Field < m_pTable->Get_Field_Count() ? m_Values[Field]->asInt() : 0 );
497 }
498
499 int CSG_Table_Record::asInt(const CSG_String &Field) const
500 {
501 return( asInt(_Get_Field(Field)) );
502 }
503
504 //---------------------------------------------------------
505 sLong CSG_Table_Record::asLong(int Field) const
506 {
507 return( Field >= 0 && Field < m_pTable->Get_Field_Count() ? m_Values[Field]->asLong() : 0 );
508 }
509
510 sLong CSG_Table_Record::asLong(const CSG_String &Field) const
511 {
512 return( asLong(_Get_Field(Field)) );
513 }
514
515 //---------------------------------------------------------
516 float CSG_Table_Record::asFloat(int Field) const
517 {
518 return( (float)asDouble(Field) );
519 }
520
521 float CSG_Table_Record::asFloat(const CSG_String &Field) const
522 {
523 return( asFloat(_Get_Field(Field)) );
524 }
525
526 //---------------------------------------------------------
527 double CSG_Table_Record::asDouble(int Field) const
528 {
529 return( Field >= 0 && Field < m_pTable->Get_Field_Count() ? m_Values[Field]->asDouble() : 0. );
530 }
531
532 double CSG_Table_Record::asDouble(const CSG_String &Field) const
533 {
534 return( asDouble(_Get_Field(Field)) );
535 }
536
537
539 // //
541
542 //---------------------------------------------------------
543 bool CSG_Table_Record::Assign(CSG_Table_Record *pRecord)
544 {
545 if( pRecord )
546 {
547 int nFields = m_pTable->Get_Field_Count() < pRecord->m_pTable->Get_Field_Count()
548 ? m_pTable->Get_Field_Count() : pRecord->m_pTable->Get_Field_Count();
549
550 for(int iField=0; iField<nFields; iField++)
551 {
552 *(m_Values[iField]) = *(pRecord->m_Values[iField]);
553 }
554
555 Set_Modified();
556
557 return( true );
558 }
559
560 return( false );
561 }
562
563
565 // //
566 // //
567 // //
569
570 //---------------------------------------------------------
SG_DATATYPE_Color
@ SG_DATATYPE_Color
Definition: api_core.h:999
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
SG_T
#define SG_T(s)
Definition: api_core.h:531
table_value.h
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:991
SG_DATATYPE_Binary
@ SG_DATATYPE_Binary
Definition: api_core.h:1000
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Table_Record::asShort
short asShort(int Field) const
Definition: table_record.cpp:483
CSG_Bytes::Destroy
bool Destroy(void)
Definition: api_memory.cpp:829
CSG_Table_Record::~CSG_Table_Record
virtual ~CSG_Table_Record(void)
Definition: table_record.cpp:86
CSG_Table_Record
Definition: table.h:130
CSG_Table_Record::Set_Selected
void Set_Selected(bool bOn=true)
Definition: table_record.cpp:204
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:244
CSG_Table_Record::m_pTable
class CSG_Table * m_pTable
Definition: table.h:258
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
SG_TABLE_REC_FLAG_Selected
#define SG_TABLE_REC_FLAG_Selected
Definition: table.h:119
CSG_Table_Record::asLong
sLong asLong(int Field) const
Definition: table_record.cpp:505
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:246
CSG_Table_Record::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: table_record.cpp:543
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:987
CSG_Table_Value::asBinary
virtual CSG_Bytes asBinary(void) const
Definition: table_value.h:126
CSG_Table_Record::is_Selected
bool is_Selected(void) const
Definition: table.h:242
CSG_Table::Get_Field_Count
int Get_Field_Count(void) const
Definition: table.h:355
CSG_Table_Record::asChar
SG_Char asChar(int Field) const
Definition: table_record.cpp:472
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Table_Record::m_Values
class CSG_Table_Value ** m_Values
Definition: table.h:256
CSG_Table_Value
Definition: table_value.h:111
CSG_Table_Value_String
Definition: table_value.h:230
CSG_Table_Record::m_Index
sLong m_Index
Definition: table.h:254
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Table_Record::is_NoData
bool is_NoData(int Field) const
Definition: table_record.cpp:416
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Table::_Stats_Invalidate
bool _Stats_Invalidate(void) const
Definition: table.cpp:1204
CSG_Table_Record::m_Flags
char m_Flags
Definition: table.h:252
CSG_Table_Value_Int
Definition: table_value.h:384
CSG_Table_Value_Binary
Definition: table_value.h:160
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:994
CSG_Table_Record::asString
const SG_Char * asString(int Field, int Decimals=-99) const
Definition: table_record.cpp:461
CSG_Table_Record::CSG_Table_Record
CSG_Table_Record(class CSG_Table *pTable, sLong Index)
Definition: table_record.cpp:64
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
CSG_Table_Value_Double
Definition: table_value.h:544
SG_TABLE_REC_FLAG_Modified
#define SG_TABLE_REC_FLAG_Modified
Definition: table.h:118
CSG_Table_Value_Date
Definition: table_value.h:299
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_Record::_Create_Value
static CSG_Table_Value * _Create_Value(TSG_Data_Type Type)
Definition: table_record.cpp:110
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:995
CSG_Table_Record::asFloat
float asFloat(int iField) const
Definition: table_record.cpp:516
SG_DATATYPE_Date
@ SG_DATATYPE_Date
Definition: api_core.h:998
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:989
CSG_Table_Record::_Add_Field
bool _Add_Field(int add_Field)
Definition: table_record.cpp:143
CSG_Table_Record::Add_Value
bool Add_Value(int Field, double Value)
Definition: table_record.cpp:329
CSG_Bytes
Definition: api_core.h:804
CSG_Table_Record::Set_Modified
void Set_Modified(bool bOn=true)
Definition: table_record.cpp:220
CSG_Table
Definition: table.h:283
CSG_Table_Value_Long
Definition: table_value.h:464
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
CSG_Table_Value::asDouble
virtual double asDouble(void) const =0
CSG_Table_Record::Set_Value
bool Set_Value(int Field, const CSG_String &Value)
Definition: table_record.cpp:270
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:990
CSG_Table_Record::Mul_Value
bool Mul_Value(int Field, double Value)
Definition: table_record.cpp:345
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:985
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
CSG_Table_Value::asInt
virtual int asInt(void) const =0
CSG_Table_Record::is_Modified
bool is_Modified(void) const
Definition: table.h:243
table.h
CSG_Table_Record::Set_NoData
bool Set_NoData(int Field)
Definition: table_record.cpp:366
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:993
CSG_Table_Record::_Get_Field
int _Get_Field(const CSG_String &Field) const
Definition: table_record.cpp:182
CSG_Table_Record::_Del_Field
bool _Del_Field(int del_Field)
Definition: table_record.cpp:167
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_selection.cpp File Reference

  • saga_core
  • saga_api
table_selection.cpp File Reference
#include "table.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_selection.cpp Source File

  • saga_core
  • saga_api
table_selection.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table_selection.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "table.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 bool CSG_Table::_Add_Selection(sLong iRecord)
64 {
65 if( m_Selection.Inc_Array() )
66 {
67 return( _Set_Selection(iRecord, m_Selection.Get_Size() - 1) );
68 }
69
70 return( false );
71 }
72
73 //---------------------------------------------------------
74 bool CSG_Table::_Set_Selection(sLong Index, sLong Selected)
75 {
76 if( Selected < m_Selection.Get_Size() )
77 {
78 *((sLong *)m_Selection.Get_Entry(Selected)) = Index;
79
80 return( true );
81 }
82
83 return( false );
84 }
85
86 //---------------------------------------------------------
87 bool CSG_Table::_Del_Selection(sLong Index)
88 {
89 for(sLong i=0; i<m_Selection.Get_Size(); i++)
90 {
91 if( Index == Get_Selection_Index(i) )
92 {
93 sLong *Selection = (sLong *)m_Selection.Get_Array();
94
95 for(sLong j=i+1; j<m_Selection.Get_Size(); i++, j++)
96 {
97 Selection[i] = Selection[j];
98 }
99
100 m_Selection.Dec_Array();
101
102 return( true );
103 }
104 }
105
106 return( false );
107 }
108
109
111 // //
113
114 //---------------------------------------------------------
115 bool CSG_Table::_Destroy_Selection(void)
116 {
117 if( Get_Selection_Count() > 0 )
118 {
119 for(size_t iRecord=0; iRecord<(size_t)m_nRecords; iRecord++)
120 {
121 m_Records[iRecord]->Set_Selected(false);
122 }
123
124 m_Selection.Set_Array(0);
125 }
126
127 return( true );
128 }
129
130
132 // //
134
135 //---------------------------------------------------------
136 bool CSG_Table::Select(sLong iRecord, bool bInvert)
137 {
138 if( !bInvert )
139 {
140 _Destroy_Selection();
141 }
142
143 CSG_Table_Record *pRecord = Get_Record(iRecord);
144
145 if( pRecord == NULL )
146 {
147 return( false );
148 }
149
150 if( pRecord->is_Selected() == false )
151 {
152 pRecord->Set_Selected(true);
153
154 _Add_Selection(iRecord);
155 }
156 else // if( pRecord->is_Selected() == true )
157 {
158 pRecord->Set_Selected(false);
159
160 _Del_Selection(iRecord);
161 }
162
163 return( true );
164 }
165
166 //---------------------------------------------------------
167 bool CSG_Table::Select(CSG_Table_Record *pRecord, bool bInvert)
168 {
169 return( Select(pRecord ? pRecord->Get_Index() : -1, bInvert) );
170 }
171
172
174 // //
176
177 //---------------------------------------------------------
178 sLong CSG_Table::Del_Selection(void)
179 {
180 sLong n = 0;
181
182 if( Get_Selection_Count() > 0 )
183 {
184 for(sLong i=m_nRecords-1; i>=0; i--)
185 {
186 if( m_Records[i]->is_Selected() )
187 {
188 m_Records[i]->Set_Selected(false);
189
190 Del_Record(i);
191
192 n++;
193 }
194 }
195
196 m_Selection.Set_Array(0);
197 }
198
199 return( n );
200 }
201
202 //---------------------------------------------------------
203 sLong CSG_Table::Inv_Selection(void)
204 {
205 if( m_nRecords > 0 )
206 {
207 m_Selection.Set_Array(m_nRecords - m_Selection.Get_Size());
208
209 for(sLong i=0, n=0; i<Get_Count(); i++)
210 {
211 CSG_Table_Record *pRecord = Get_Record(i);
212
213 if( pRecord->is_Selected() == false )//&& n < m_Selection.Get_Size() )
214 {
215 pRecord->Set_Selected(true);
216
217 *((sLong *)m_Selection.Get_Entry(n++)) = i;
218 }
219 else
220 {
221 pRecord->Set_Selected(false);
222 }
223 }
224 }
225
226 return( Get_Selection_Count() );
227 }
228
229
231 // //
232 // //
233 // //
235
236 //---------------------------------------------------------
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Table_Record
Definition: table.h:130
CSG_Table_Record::Set_Selected
void Set_Selected(bool bOn=true)
Definition: table_record.cpp:204
CSG_Table::Inv_Selection
virtual sLong Inv_Selection(void)
Definition: table_selection.cpp:203
CSG_Table::m_Selection
CSG_Array m_Selection
Definition: table.h:452
CSG_Table::is_Selected
virtual bool is_Selected(sLong Index) const
Definition: table.h:417
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_Table_Record::is_Selected
bool is_Selected(void) const
Definition: table.h:242
CSG_Table::Get_Selection_Count
sLong Get_Selection_Count(void) const
Definition: table.h:413
CSG_Table::_Set_Selection
bool _Set_Selection(sLong Index, sLong Selected)
Definition: table_selection.cpp:74
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Table::_Del_Selection
bool _Del_Selection(sLong Index)
Definition: table_selection.cpp:87
CSG_Table::_Add_Selection
bool _Add_Selection(sLong Index)
Definition: table_selection.cpp:63
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
CSG_Array::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_memory.cpp:425
CSG_Table::Get_Selection_Index
sLong Get_Selection_Index(sLong Index=0) const
Definition: table.h:414
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
CSG_Table::Del_Selection
virtual sLong Del_Selection(void)
Definition: table_selection.cpp:178
table.h
CSG_Table::m_nRecords
sLong m_nRecords
Definition: table.h:444
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_value.h File Reference

  • saga_core
  • saga_api
Classes | Enumerations
table_value.h File Reference
#include "datetime.h"

Go to the source code of this file.

Classes

class | CSG_Table_Value
class | CSG_Table_Value_Binary
class | CSG_Table_Value_String
class | CSG_Table_Value_Date
class | CSG_Table_Value_Int
class | CSG_Table_Value_Long
class | CSG_Table_Value_Double

Enumerations

enum TSG_Table_Value_Type {
SG_TABLE_VALUE_TYPE_Binary, SG_TABLE_VALUE_TYPE_String, SG_TABLE_VALUE_TYPE_Date, SG_TABLE_VALUE_TYPE_Int,
SG_TABLE_VALUE_TYPE_Long, SG_TABLE_VALUE_TYPE_Double
}

Detailed Description

Lightweight classes for storing a table record's attribute data.

See also
CSG_Table_Value
CSG_Table_Record
CSG_Table
CSG_Data_Object

Definition in file table_value.h.

Enumeration Type Documentation

◆ TSG_Table_Value_Type

enum TSG_Table_Value_Type
Enumerator
SG_TABLE_VALUE_TYPE_Binary
SG_TABLE_VALUE_TYPE_String
SG_TABLE_VALUE_TYPE_Date
SG_TABLE_VALUE_TYPE_Int
SG_TABLE_VALUE_TYPE_Long
SG_TABLE_VALUE_TYPE_Double

Definition at line 91 of file table_value.h.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: table_value.h Source File

  • saga_core
  • saga_api
table_value.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // table_value.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__table_value_H
54 #define HEADER_INCLUDED__SAGA_API__table_value_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
74 // //
76 // //
77 // //
79
80 //---------------------------------------------------------
81 #include "datetime.h"
82
83
85 // //
86 // //
87 // //
89
90 //---------------------------------------------------------
91 typedef enum
92 {
93 SG_TABLE_VALUE_TYPE_Binary,
94 SG_TABLE_VALUE_TYPE_String,
95 SG_TABLE_VALUE_TYPE_Date,
96 SG_TABLE_VALUE_TYPE_Int,
97 SG_TABLE_VALUE_TYPE_Long,
98 SG_TABLE_VALUE_TYPE_Double
99 }
100 TSG_Table_Value_Type;
101
102
104 // //
105 // //
106 // //
108
109 //---------------------------------------------------------
110 class CSG_Table_Value
111 {
112 public:
113 CSG_Table_Value(void) {}
114 virtual ~CSG_Table_Value(void) {}
115
116 virtual TSG_Table_Value_Type Get_Type (void) const = 0;
117
118 //-----------------------------------------------------
119 virtual bool Set_Value (const CSG_Bytes &Value) = 0;
120 virtual bool Set_Value (const SG_Char *Value) = 0;
121 virtual bool Set_Value (int Value) = 0;
122 virtual bool Set_Value (sLong Value) = 0;
123 virtual bool Set_Value (double Value) = 0;
124
125 //-----------------------------------------------------
126 virtual CSG_Bytes asBinary (void) const
127 {
128 const SG_Char *s = asString();
129
130 return( CSG_Bytes((BYTE *)s, (int)(s && *s ? SG_STR_LEN(s) : 0) * sizeof(SG_Char)) );
131 }
132
133 virtual const SG_Char * asString (int Decimals =-99) const = 0;
134 virtual int asInt (void) const = 0;
135 virtual sLong asLong (void) const = 0;
136 virtual double asDouble (void) const = 0;
137
138 //-----------------------------------------------------
139 virtual bool is_Equal (const CSG_Table_Value &Value) const = 0;
140 bool operator == (const CSG_Table_Value &Value) const { return( is_Equal(Value) ); }
141
142 //-----------------------------------------------------
143 operator const SG_Char * (void) const { return( asString() ); }
144 operator double (void) const { return( asDouble() ); }
145
146 //-----------------------------------------------------
147 virtual CSG_Table_Value & operator = (const SG_Char *Value) { Set_Value(Value); return( *this ); }
148 virtual CSG_Table_Value & operator = (double Value) { Set_Value(Value); return( *this ); }
149 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) = 0;
150
151 };
152
153
155 // //
157
158 //---------------------------------------------------------
159 class CSG_Table_Value_Binary : public CSG_Table_Value
160 {
161 public:
162 CSG_Table_Value_Binary(void) {}
163 virtual ~CSG_Table_Value_Binary(void) {}
164
165 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_Binary ); }
166
167 //-----------------------------------------------------
168 virtual bool Set_Value (const CSG_Bytes &Value)
169 {
170 return( m_Value.Create(Value) );
171 }
172
173 virtual bool Set_Value (const SG_Char *Value)
174 {
175 return( m_Value.Create((BYTE *)Value, (int)((Value && *Value ? SG_STR_LEN(Value) : 0 * sizeof(SG_Char)))) );
176 }
177
178 virtual bool Set_Value (int Value)
179 {
180 return( m_Value.Create((BYTE *)&Value, sizeof(Value)) );
181 }
182
183 virtual bool Set_Value (sLong Value)
184 {
185 return( m_Value.Create((BYTE *)&Value, sizeof(Value)) );
186 }
187
188 virtual bool Set_Value (double Value)
189 {
190 return( m_Value.Create((BYTE *)&Value, sizeof(Value)) );
191 }
192
193 //-----------------------------------------------------
194 virtual bool Set_NoData (void) { return( m_Value.Destroy() ); }
195 virtual bool is_NoData (void) const { return( m_Value.Get_Count() <= 0 ); }
196
197 //-----------------------------------------------------
198 virtual CSG_Bytes asBinary (void) const { return( m_Value ); }
199 virtual const SG_Char * asString (int Decimals =-99) const { return( (const SG_Char *)m_Value.Get_Bytes() ); }
200 virtual int asInt (void) const { return( m_Value.Get_Count() ); }
201 virtual sLong asLong (void) const { return( m_Value.Get_Count() ); }
202 virtual double asDouble (void) const { return( 0.0 ); }
203
204 //-----------------------------------------------------
205 virtual bool is_Equal (const CSG_Table_Value &Value) const
206 {
207 return( !SG_STR_CMP(asString(), Value.asString()) );
208 }
209
210 //-----------------------------------------------------
211 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) { Set_Value(Value.asBinary()); return( *this ); }
212
213 //-----------------------------------------------------
214 CSG_Bytes & Get_Binary (void) { return( m_Value ); }
215
216
217 private:
218
219 CSG_Bytes m_Value;
220
221 };
222
223
225 // //
227
228 //---------------------------------------------------------
229 class CSG_Table_Value_String : public CSG_Table_Value
230 {
231 public:
232 CSG_Table_Value_String(void) {}
233 virtual ~CSG_Table_Value_String(void) {}
234
235 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_String ); }
236
237 //-----------------------------------------------------
238 virtual bool Set_Value (const CSG_Bytes &Value)
239 {
240 return( Set_Value((SG_Char *)Value.Get_Bytes()) );
241 }
242
243 virtual bool Set_Value (const SG_Char *Value)
244 {
245 if( Value && m_Value.Cmp(Value) )
246 {
247 m_Value = Value;
248
249 return( true );
250 }
251
252 return( false );
253 }
254
255 virtual bool Set_Value (int Value)
256 {
257 return( Set_Value(CSG_String::Format("%d" , Value).c_str()) );
258 }
259
260 virtual bool Set_Value (sLong Value)
261 {
262 return( Set_Value(CSG_String::Format("%lld", Value).c_str()) );
263 }
264
265 virtual bool Set_Value (double Value)
266 {
267 return( Set_Value(CSG_String::Format("%f" , Value).c_str()) );
268 }
269
270 //-----------------------------------------------------
271 virtual const SG_Char * asString (int Decimals =-99) const { return( m_Value ); }
272 virtual int asInt (void) const { return( m_Value.asInt () ); }
273 virtual sLong asLong (void) const { return( m_Value.asInt () ); }
274 virtual double asDouble (void) const { return( m_Value.asDouble() ); }
275
276 //-----------------------------------------------------
277 virtual bool is_Equal (const CSG_Table_Value &Value) const
278 {
279 return( !m_Value.Cmp(Value.asString()) );
280 }
281
282 //-----------------------------------------------------
283 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) { Set_Value(Value.asString()); return( *this ); }
284
285
286 private:
287
288 CSG_String m_Value;
289
290 };
291
292
294 // //
296
297 //---------------------------------------------------------
298 class CSG_Table_Value_Date : public CSG_Table_Value
299 {
300 public:
301 CSG_Table_Value_Date(void) { m_Value = 0.0; }
302 virtual ~CSG_Table_Value_Date(void) {}
303
304 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_Date ); }
305
306 //-----------------------------------------------------
307 virtual bool Set_Value (const CSG_Bytes &Value)
308 {
309 return( Set_Value((SG_Char *)Value.Get_Bytes()) );
310 }
311
312 virtual bool Set_Value (const SG_Char *Value)
313 {
314 return( Set_Value(SG_Date_To_JulianDayNumber(Value)) );
315 }
316
317 virtual bool Set_Value (int Value)
318 {
319 return( Set_Value((double)Value) );
320 }
321
322 virtual bool Set_Value (sLong Value)
323 {
324 return( Set_Value((double)Value) );
325 }
326
327 virtual bool Set_Value (double Value)
328 {
329 if( m_Value != Value )
330 {
331 m_Value = Value;
332 m_Date = SG_JulianDayNumber_To_Date(m_Value);
333
334 return( true );
335 }
336
337 return( false );
338 }
339
340 //-----------------------------------------------------
341 virtual const SG_Char * asString (int Decimals =-99) const { return( m_Date ); }
342 virtual int asInt (void) const { return( (int)m_Value ); }
343 virtual sLong asLong (void) const { return( (sLong)m_Value ); }
344 virtual double asDouble (void) const { return( m_Value ); }
345
346 //-----------------------------------------------------
347 virtual bool is_Equal (const CSG_Table_Value &Value) const
348 {
349 return( m_Value == Value.asDouble() );
350 }
351
352 //-----------------------------------------------------
353 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value)
354 {
355 switch( Value.Get_Type() )
356 {
357 case SG_TABLE_VALUE_TYPE_Binary:
358 case SG_TABLE_VALUE_TYPE_String:
359 Set_Value(Value.asString());
360 return( *this );
361
362 default:
363 Set_Value(Value.asDouble());
364 return( *this );
365 }
366 }
367
368
369 private:
370
371 double m_Value; // Julian Day Number
372
373 CSG_String m_Date ; // yyyy-mm-dd (ISO 8601)
374
375 };
376
377
379 // //
381
382 //---------------------------------------------------------
383 class CSG_Table_Value_Int : public CSG_Table_Value
384 {
385 public:
386 CSG_Table_Value_Int(void) { m_Value = 0; }
387 virtual ~CSG_Table_Value_Int(void) {}
388
389 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_Int ); }
390
391 //-----------------------------------------------------
392 virtual bool Set_Value (const CSG_Bytes &Value)
393 {
394 return( Set_Value((SG_Char *)Value.Get_Bytes()) );
395 }
396
397 virtual bool Set_Value (const SG_Char *Value)
398 {
399 int i;
400 CSG_String s(Value);
401
402 return( s.asInt(i) ? Set_Value(i) : false );
403 }
404
405 virtual bool Set_Value (int Value)
406 {
407 if( m_Value != Value )
408 {
409 m_Value = Value;
410
411 return( true );
412 }
413
414 return( false );
415 }
416
417 virtual bool Set_Value (sLong Value)
418 {
419 return( Set_Value((int)Value) );
420 }
421
422 virtual bool Set_Value (double Value)
423 {
424 return( Set_Value((int)Value) );
425 }
426
427 //-----------------------------------------------------
428 virtual const SG_Char * asString (int Decimals =-99) const
429 {
430 static CSG_String s;
431
432 s.Printf("%d", m_Value);
433
434 return( s.c_str() );
435 }
436
437 virtual int asInt (void) const { return( m_Value ); }
438 virtual sLong asLong (void) const { return( m_Value ); }
439 virtual double asDouble (void) const { return( m_Value ); }
440
441 //-----------------------------------------------------
442 virtual bool is_Equal (const CSG_Table_Value &Value) const
443 {
444 return( m_Value == Value.asInt() );
445 }
446
447 //-----------------------------------------------------
448 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) { Set_Value(Value.asInt()); return( *this ); }
449
450
451 private:
452
453 int m_Value;
454
455 };
456
457
459 // //
461
462 //---------------------------------------------------------
463 class CSG_Table_Value_Long : public CSG_Table_Value
464 {
465 public:
466 CSG_Table_Value_Long(void) { m_Value = 0; }
467 virtual ~CSG_Table_Value_Long(void) {}
468
469 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_Long ); }
470
471 //-----------------------------------------------------
472 virtual bool Set_Value (const CSG_Bytes &Value)
473 {
474 return( Set_Value((SG_Char *)Value.Get_Bytes()) );
475 }
476
477 virtual bool Set_Value (const SG_Char *Value)
478 {
479 int i;
480 CSG_String s(Value);
481
482 return( s.asInt(i) ? Set_Value(i) : false );
483 }
484
485 virtual bool Set_Value (int Value)
486 {
487 return( Set_Value((sLong)Value) );
488 }
489
490 virtual bool Set_Value (sLong Value)
491 {
492 if( m_Value != Value )
493 {
494 m_Value = Value;
495
496 return( true );
497 }
498
499 return( false );
500 }
501
502 virtual bool Set_Value (double Value)
503 {
504 return( Set_Value((sLong)Value) );
505 }
506
507 //-----------------------------------------------------
508 virtual const SG_Char * asString (int Decimals =-99) const
509 {
510 static CSG_String s;
511
512 s.Printf("%lld", m_Value);
513
514 return( s.c_str() );
515 }
516
517 virtual int asInt (void) const { return( (int)m_Value ); }
518 virtual sLong asLong (void) const { return( m_Value ); }
519 virtual double asDouble (void) const { return( (double)m_Value ); }
520
521 //-----------------------------------------------------
522 virtual bool is_Equal (const CSG_Table_Value &Value) const
523 {
524 return( m_Value == Value.asLong() );
525 }
526
527 //-----------------------------------------------------
528 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) { Set_Value(Value.asLong()); return( *this ); }
529
530
531 private:
532
533 sLong m_Value;
534
535 };
536
537
539 // //
541
542 //---------------------------------------------------------
543 class CSG_Table_Value_Double : public CSG_Table_Value
544 {
545 public:
546 CSG_Table_Value_Double(void) { m_Value = 0.0; }
547 virtual ~CSG_Table_Value_Double(void) {}
548
549 virtual TSG_Table_Value_Type Get_Type (void) const { return( SG_TABLE_VALUE_TYPE_Double ); }
550
551 //-----------------------------------------------------
552 virtual bool Set_Value (const CSG_Bytes &Value)
553 {
554 return( Set_Value((SG_Char *)Value.Get_Bytes()) );
555 }
556
557 virtual bool Set_Value (const SG_Char *Value)
558 {
559 double d;
560 CSG_String s(Value);
561
562 return( s.asDouble(d) ? Set_Value(d) : false );
563 }
564
565 virtual bool Set_Value (int Value)
566 {
567 return( Set_Value((double)Value) );
568 }
569
570 virtual bool Set_Value (sLong Value)
571 {
572 return( Set_Value((double)Value) );
573 }
574
575 virtual bool Set_Value (double Value)
576 {
577 if( m_Value != Value )
578 {
579 m_Value = Value;
580
581 return( true );
582 }
583
584 return( false );
585 }
586
587 //-----------------------------------------------------
588 virtual const SG_Char * asString (int Decimals =-99) const
589 {
590 static CSG_String s;
591
592 s = SG_Get_String(m_Value, Decimals);
593
594 return( s.c_str() );
595 }
596
597 virtual int asInt (void) const { return( (int )m_Value ); }
598 virtual sLong asLong (void) const { return( (sLong)m_Value ); }
599 virtual double asDouble (void) const { return( m_Value ); }
600
601 //-----------------------------------------------------
602 virtual bool is_Equal (const CSG_Table_Value &Value) const
603 {
604 return( m_Value == Value.asDouble() );
605 }
606
607 //-----------------------------------------------------
608 virtual CSG_Table_Value & operator = (const CSG_Table_Value &Value) { Set_Value(Value.asDouble()); return( *this ); }
609
610
611 private:
612
613 double m_Value;
614
615 };
616
617
619 // //
620 // //
621 // //
623
624 //---------------------------------------------------------
625 #endif // #ifndef HEADER_INCLUDED__SAGA_API__table_value_H
CSG_Table_Value_Date::CSG_Table_Value_Date
CSG_Table_Value_Date(void)
Definition: table_value.h:301
CSG_Table_Value_Long::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:508
TSG_Table_Value_Type
TSG_Table_Value_Type
Definition: table_value.h:92
CSG_Table_Value_Long::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:477
CSG_Table_Value_Date::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:317
CSG_Table_Value_Binary::~CSG_Table_Value_Binary
virtual ~CSG_Table_Value_Binary(void)
Definition: table_value.h:163
CSG_Table_Value_Long::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:522
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Table_Value_String::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:255
CSG_Table_Value_Date::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:304
CSG_Table_Value_Date::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:327
CSG_Table_Value_String::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:271
SG_TABLE_VALUE_TYPE_String
@ SG_TABLE_VALUE_TYPE_String
Definition: table_value.h:94
CSG_Table_Value_Date::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:312
CSG_Table_Value_String::CSG_Table_Value_String
CSG_Table_Value_String(void)
Definition: table_value.h:232
CSG_Table_Value_Int::~CSG_Table_Value_Int
virtual ~CSG_Table_Value_Int(void)
Definition: table_value.h:387
CSG_Table_Value_Long::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:469
CSG_Table_Value_Double::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:557
CSG_Bytes::Destroy
bool Destroy(void)
Definition: api_memory.cpp:829
CSG_Table_Value_String::~CSG_Table_Value_String
virtual ~CSG_Table_Value_String(void)
Definition: table_value.h:233
CSG_Table_Value::operator=
virtual CSG_Table_Value & operator=(const SG_Char *Value)
Definition: table_value.h:147
CSG_Table_Value::Set_Value
virtual bool Set_Value(const SG_Char *Value)=0
CSG_Table_Value::asLong
virtual sLong asLong(void) const =0
CSG_Table_Value_String::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:243
CSG_Table_Value::~CSG_Table_Value
virtual ~CSG_Table_Value(void)
Definition: table_value.h:114
SG_Get_String
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
Definition: api_string.cpp:1337
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
CSG_Bytes::Get_Count
int Get_Count(void) const
Definition: api_core.h:823
CSG_Table_Value_Binary::asLong
virtual sLong asLong(void) const
Definition: table_value.h:201
CSG_Table_Value_Date::asLong
virtual sLong asLong(void) const
Definition: table_value.h:343
CSG_Table_Value::Set_Value
virtual bool Set_Value(double Value)=0
CSG_Table_Value_String::asInt
virtual int asInt(void) const
Definition: table_value.h:272
CSG_Table_Value::CSG_Table_Value
CSG_Table_Value(void)
Definition: table_value.h:113
CSG_Table_Value_Double::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:588
CSG_Table_Value::asBinary
virtual CSG_Bytes asBinary(void) const
Definition: table_value.h:126
CSG_Table_Value_Long::asLong
virtual sLong asLong(void) const
Definition: table_value.h:518
CSG_Table_Value_Date::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:353
CSG_Table_Value_Double::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:570
CSG_Table_Value_Binary::asBinary
virtual CSG_Bytes asBinary(void) const
Definition: table_value.h:198
CSG_Table_Value_Binary::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:178
CSG_Table_Value_String::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:283
CSG_Table_Value_String::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:277
CSG_Table_Value_Binary::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:183
CSG_Table_Value_Int::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:392
CSG_Table_Value_Long::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:472
SG_TABLE_VALUE_TYPE_Date
@ SG_TABLE_VALUE_TYPE_Date
Definition: table_value.h:95
SG_STR_CMP
#define SG_STR_CMP(s1, s2)
Definition: api_core.h:538
CSG_Table_Value_String::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:260
CSG_Table_Value_Long::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:485
CSG_Table_Value
Definition: table_value.h:111
CSG_Table_Value_String
Definition: table_value.h:230
CSG_Table_Value_Int::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:417
CSG_Table_Value_Int::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:405
CSG_Table_Value_Int::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:442
CSG_Table_Value_Binary::Get_Binary
CSG_Bytes & Get_Binary(void)
Definition: table_value.h:214
CSG_Table_Value_Double::asInt
virtual int asInt(void) const
Definition: table_value.h:597
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Table_Value_Binary::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:188
CSG_Table_Value_Long::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:502
CSG_Table_Value_Int
Definition: table_value.h:384
CSG_Table_Value_Binary::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:173
CSG_Table_Value_Long::asInt
virtual int asInt(void) const
Definition: table_value.h:517
CSG_Table_Value_Binary
Definition: table_value.h:160
CSG_Table_Value::Set_Value
virtual bool Set_Value(sLong Value)=0
CSG_Table_Value::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const =0
CSG_Table_Value_Int::asDouble
virtual double asDouble(void) const
Definition: table_value.h:439
CSG_Table_Value_Binary::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:165
SG_TABLE_VALUE_TYPE_Int
@ SG_TABLE_VALUE_TYPE_Int
Definition: table_value.h:96
CSG_Table_Value_Int::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:428
CSG_Table_Value_String::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:235
CSG_Table_Value_Int::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:422
CSG_Table_Value_Date::asDouble
virtual double asDouble(void) const
Definition: table_value.h:344
CSG_Table_Value_Binary::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:211
CSG_Table_Value_Double
Definition: table_value.h:544
CSG_Table_Value_Date::~CSG_Table_Value_Date
virtual ~CSG_Table_Value_Date(void)
Definition: table_value.h:302
CSG_Table_Value_Date::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:322
CSG_Table_Value_Long::Set_Value
virtual bool Set_Value(sLong Value)
Definition: table_value.h:490
SG_STR_LEN
#define SG_STR_LEN
Definition: api_core.h:536
CSG_Table_Value_Long::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:528
CSG_Table_Value_Int::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:448
CSG_Table_Value_Date
Definition: table_value.h:299
CSG_Table_Value_Binary::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:168
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Table_Value_Double::asDouble
virtual double asDouble(void) const
Definition: table_value.h:599
CSG_Table_Value_Int::asLong
virtual sLong asLong(void) const
Definition: table_value.h:438
CSG_Table_Value_Int::CSG_Table_Value_Int
CSG_Table_Value_Int(void)
Definition: table_value.h:386
CSG_Table_Value_Long::asDouble
virtual double asDouble(void) const
Definition: table_value.h:519
CSG_Table_Value_Binary::CSG_Table_Value_Binary
CSG_Table_Value_Binary(void)
Definition: table_value.h:162
CSG_Table_Value::operator==
bool operator==(const CSG_Table_Value &Value) const
Definition: table_value.h:140
CSG_Table_Value::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const =0
CSG_Table_Value_Int::Set_Value
virtual bool Set_Value(const SG_Char *Value)
Definition: table_value.h:397
CSG_Bytes::Get_Bytes
BYTE * Get_Bytes(void) const
Definition: api_core.h:824
CSG_Table_Value_Binary::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:199
CSG_Table_Value_Binary::asInt
virtual int asInt(void) const
Definition: table_value.h:200
SG_TABLE_VALUE_TYPE_Double
@ SG_TABLE_VALUE_TYPE_Double
Definition: table_value.h:98
CSG_Bytes::Create
bool Create(void)
Definition: api_memory.cpp:784
CSG_Table_Value_Double::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:549
CSG_Bytes
Definition: api_core.h:804
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table_Value_Double::Set_Value
virtual bool Set_Value(int Value)
Definition: table_value.h:565
CSG_Table_Value_Date::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:347
CSG_Table_Value_String::asLong
virtual sLong asLong(void) const
Definition: table_value.h:273
CSG_Table_Value_Long
Definition: table_value.h:464
CSG_Table_Value_Double::CSG_Table_Value_Double
CSG_Table_Value_Double(void)
Definition: table_value.h:546
CSG_Table_Value_Double::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:575
CSG_Table_Value_Double::asLong
virtual sLong asLong(void) const
Definition: table_value.h:598
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Table_Value_Int::Get_Type
virtual TSG_Table_Value_Type Get_Type(void) const
Definition: table_value.h:389
CSG_String
Definition: api_core.h:557
CSG_Table_Value_Date::asInt
virtual int asInt(void) const
Definition: table_value.h:342
CSG_Table_Value_Binary::asDouble
virtual double asDouble(void) const
Definition: table_value.h:202
CSG_Table_Value::asDouble
virtual double asDouble(void) const =0
CSG_Table_Value::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)=0
SG_Date_To_JulianDayNumber
double SG_Date_To_JulianDayNumber(int y, int m, int d)
Definition: datetime.cpp:729
CSG_Table_Value_Binary::is_NoData
virtual bool is_NoData(void) const
Definition: table_value.h:195
CSG_Table_Value_Long::CSG_Table_Value_Long
CSG_Table_Value_Long(void)
Definition: table_value.h:466
SG_JulianDayNumber_To_Date
bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
Definition: datetime.cpp:678
CSG_Table_Value_Date::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:307
SG_TABLE_VALUE_TYPE_Long
@ SG_TABLE_VALUE_TYPE_Long
Definition: table_value.h:97
CSG_Table_Value_Binary::Set_NoData
virtual bool Set_NoData(void)
Definition: table_value.h:194
CSG_Table_Value_Int::asInt
virtual int asInt(void) const
Definition: table_value.h:437
CSG_Table_Value_Double::~CSG_Table_Value_Double
virtual ~CSG_Table_Value_Double(void)
Definition: table_value.h:547
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_Table_Value_Double::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:602
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Table_Value_Binary::is_Equal
virtual bool is_Equal(const CSG_Table_Value &Value) const
Definition: table_value.h:205
CSG_Table_Value::asString
virtual const SG_Char * asString(int Decimals=-99) const =0
CSG_Table_Value_String::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:238
SG_TABLE_VALUE_TYPE_Binary
@ SG_TABLE_VALUE_TYPE_Binary
Definition: table_value.h:93
CSG_Table_Value::Set_Value
virtual bool Set_Value(int Value)=0
CSG_Table_Value_String::Set_Value
virtual bool Set_Value(double Value)
Definition: table_value.h:265
CSG_Table_Value::asInt
virtual int asInt(void) const =0
CSG_Table_Value_Long::~CSG_Table_Value_Long
virtual ~CSG_Table_Value_Long(void)
Definition: table_value.h:467
CSG_Table_Value_Double::operator=
virtual CSG_Table_Value & operator=(const CSG_Table_Value &Value)
Definition: table_value.h:608
CSG_Table_Value_String::asDouble
virtual double asDouble(void) const
Definition: table_value.h:274
CSG_Table_Value_Double::Set_Value
virtual bool Set_Value(const CSG_Bytes &Value)
Definition: table_value.h:552
CSG_Table_Value_Date::asString
virtual const SG_Char * asString(int Decimals=-99) const
Definition: table_value.h:341
datetime.h
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin.cpp File Reference

  • saga_core
  • saga_api
Functions
tin.cpp File Reference
#include "tin.h"

Go to the source code of this file.

Functions

CSG_TIN * | SG_Create_TIN (void)
CSG_TIN * | SG_Create_TIN (const CSG_TIN &TIN)
CSG_TIN * | SG_Create_TIN (const char *File)
CSG_TIN * | SG_Create_TIN (const wchar_t *File)
CSG_TIN * | SG_Create_TIN (const CSG_String &File)
CSG_TIN * | SG_Create_TIN (CSG_Shapes *pShapes)

Function Documentation

◆ SG_Create_TIN() [1/6]

CSG_TIN* SG_Create_TIN ( const char * File )

Safe TIN construction

Definition at line 75 of file tin.cpp.

References SG_Create_TIN().

◆ SG_Create_TIN() [2/6]

CSG_TIN* SG_Create_TIN ( const CSG_String & File )

Safe TIN construction

Definition at line 77 of file tin.cpp.

References CSG_TIN::is_Valid().

◆ SG_Create_TIN() [3/6]

CSG_TIN* SG_Create_TIN ( const CSG_TIN & TIN )

Safe TIN construction

Definition at line 69 of file tin.cpp.

◆ SG_Create_TIN() [4/6]

CSG_TIN* SG_Create_TIN ( const wchar_t * File )

Safe TIN construction

Definition at line 76 of file tin.cpp.

References SG_Create_TIN().

◆ SG_Create_TIN() [5/6]

CSG_TIN* SG_Create_TIN ( CSG_Shapes * pShapes )

Safe TIN construction

Definition at line 85 of file tin.cpp.

◆ SG_Create_TIN() [6/6]

CSG_TIN* SG_Create_TIN ( void )

Safe TIN construction

Definition at line 63 of file tin.cpp.

Referenced by SG_Create_TIN().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin.cpp Source File

  • saga_core
  • saga_api
tin.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tin.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tin.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_TIN * SG_Create_TIN(void)
64 {
65 return( new CSG_TIN );
66 }
67
68 //---------------------------------------------------------
69 CSG_TIN * SG_Create_TIN(const CSG_TIN &TIN)
70 {
71 return( new CSG_TIN(TIN) );
72 }
73
74 //---------------------------------------------------------
75 CSG_TIN * SG_Create_TIN(const char *File) { return( SG_Create_TIN(CSG_String(File)) ); }
76 CSG_TIN * SG_Create_TIN(const wchar_t *File) { return( SG_Create_TIN(CSG_String(File)) ); }
77 CSG_TIN * SG_Create_TIN(const CSG_String &File)
78 {
79 CSG_TIN *pTIN = new CSG_TIN(File);
80
81 if( !pTIN->is_Valid() ) { delete(pTIN); return( NULL ); } return( pTIN );
82 }
83
84 //---------------------------------------------------------
85 CSG_TIN * SG_Create_TIN(CSG_Shapes *pShapes)
86 {
87 return( new CSG_TIN(pShapes) );
88 }
89
90
92 // //
93 // //
94 // //
96
97 //---------------------------------------------------------
98 CSG_TIN::CSG_TIN(void)
99 : CSG_Table()
100 {
101 _On_Construction();
102 }
103
104 //---------------------------------------------------------
105 CSG_TIN::CSG_TIN(const CSG_TIN &TIN)
106 : CSG_Table()
107 {
108 _On_Construction(); Create(TIN);
109 }
110
111 //---------------------------------------------------------
112 CSG_TIN::CSG_TIN(const char *File) : CSG_TIN(CSG_String(File)) {}
113 CSG_TIN::CSG_TIN(const wchar_t *File) : CSG_TIN(CSG_String(File)) {}
114 CSG_TIN::CSG_TIN(const CSG_String &File)
115 : CSG_Table()
116 {
117 _On_Construction(); Create(File);
118 }
119
120 //---------------------------------------------------------
121 CSG_TIN::CSG_TIN(CSG_Shapes *pShapes)
122 : CSG_Table()
123 {
124 _On_Construction(); Create(pShapes);
125 }
126
127
129 // //
131
132 //---------------------------------------------------------
133 void CSG_TIN::_On_Construction(void)
134 {
135 CSG_Table::_On_Construction();
136
137 m_Edges = NULL;
138 m_nEdges = 0;
139
140 m_Triangles = NULL;
141 m_nTriangles = 0;
142 }
143
144
146 // //
148
149 //---------------------------------------------------------
150 bool CSG_TIN::Create(const CSG_TIN &TIN)
151 {
152 return( Assign((CSG_Data_Object *)&TIN) );
153 }
154
155 //---------------------------------------------------------
156 bool CSG_TIN::Create(const char *File) { return( Create(CSG_String(File)) ); }
157 bool CSG_TIN::Create(const wchar_t *File) { return( Create(CSG_String(File)) ); }
158 bool CSG_TIN::Create(const CSG_String &File)
159 {
160 CSG_Shapes Shapes(File);
161
162 if( Create(&Shapes) )
163 {
164 Get_History().Add_Child(_TL("Created from file"), File);
165 Get_History().Add_Children(Shapes.Get_History());
166
167 Set_File_Name(File, true);
168 Set_Modified(false);
169 Set_Update_Flag();
170
171 return( true );
172 }
173
174 return( false );
175 }
176
177 //---------------------------------------------------------
178 bool CSG_TIN::Create(CSG_Shapes *pShapes)
179 {
180 Destroy();
181
182 if( pShapes && pShapes->is_Valid() )
183 {
184 SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Create TIN from shapes"), pShapes->Get_Name()), true);
185
186 CSG_Table::Create(pShapes);
187
188 Set_Name(pShapes->Get_Name());
189
190 //-------------------------------------------------
191 for(sLong iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
192 {
193 CSG_Shape *pShape = pShapes->Get_Shape(iShape);
194
195 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
196 {
197 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
198 {
199 Add_Node(pShape->Get_Point(iPoint, iPart), pShape, false);
200 }
201 }
202 }
203
204 SG_UI_Process_Set_Ready();
205
206 if( Update() )
207 {
208 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
209
210 return( true );
211 }
212 }
213
214 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
215
216 return( false );
217 }
218
219
221 // //
223
224 //---------------------------------------------------------
225 CSG_TIN::~CSG_TIN(void)
226 {
227 Destroy();
228 }
229
230 //---------------------------------------------------------
231 bool CSG_TIN::Destroy(void)
232 {
233 _Destroy_Triangles();
234 _Destroy_Edges();
235 _Destroy_Nodes();
236
237 CSG_Table::Destroy();
238
239 return( true );
240 }
241
242
244 // //
246
247 //---------------------------------------------------------
248 bool CSG_TIN::_Destroy_Nodes(void)
249 {
250 return( Del_Records() );
251 }
252
253 //---------------------------------------------------------
254 bool CSG_TIN::_Destroy_Edges(void)
255 {
256 if( m_nEdges > 0 )
257 {
258 for(sLong i=0; i<m_nEdges; i++)
259 {
260 delete(m_Edges[i]);
261 }
262
263 SG_Free(m_Edges);
264 m_Edges = NULL;
265 m_nEdges = 0;
266 }
267
268 return( true );
269 }
270
271 //---------------------------------------------------------
272 bool CSG_TIN::_Destroy_Triangles(void)
273 {
274 if( m_nTriangles > 0 )
275 {
276 for(sLong i=0; i<m_nTriangles; i++)
277 {
278 delete(m_Triangles[i]);
279 }
280
281 SG_Free(m_Triangles);
282 m_Triangles = NULL;
283 m_nTriangles = 0;
284 }
285
286 return( true );
287 }
288
289
291 // //
293
294 //---------------------------------------------------------
295 bool CSG_TIN::Assign(CSG_Data_Object *pObject)
296 {
297 if( pObject && pObject->is_Valid() && pObject->Get_ObjectType() == Get_ObjectType() )
298 {
299 CSG_TIN *pTIN = (CSG_TIN *)pObject;
300
301 Destroy();
302
303 CSG_Table::Create(pTIN);
304
305 Set_Name(pTIN->Get_Name());
306
307 Get_History() = pTIN->Get_History();
308
309 //-------------------------------------------------
310 for(sLong iNode=0; iNode<pTIN->Get_Node_Count(); iNode++)
311 {
312 CSG_TIN_Node *pNode = pTIN->Get_Node(iNode);
313
314 Add_Node(pNode->Get_Point(), pNode, false);
315 }
316
317 //-------------------------------------------------
318 for(sLong iTriangle=0; iTriangle<pTIN->Get_Triangle_Count(); iTriangle++)
319 {
320 CSG_TIN_Triangle *pTriangle = pTIN->Get_Triangle(iTriangle);
321
322 _Add_Triangle(
323 Get_Node(pTriangle->Get_Node(0)->Get_Index()),
324 Get_Node(pTriangle->Get_Node(1)->Get_Index()),
325 Get_Node(pTriangle->Get_Node(2)->Get_Index())
326 );
327 }
328
329 return( true );
330 }
331
332 return( false );
333 }
334
335
337 // //
339
340 //---------------------------------------------------------
341 bool CSG_TIN::Save(const CSG_String &File, int Format)
342 {
343 bool bResult = false;
344
345 if( Get_Triangle_Count() > 0 )
346 {
347 switch( Format )
348 {
349 case 0: default:
350 {
351 CSG_Shapes Points;
352
353 Points.Create(SHAPE_TYPE_Point, Get_Name(), this);
354
355 for(sLong i=0; i<Get_Node_Count(); i++)
356 {
357 CSG_TIN_Node *pNode = Get_Node(i);
358
359 Points.Add_Shape(pNode)->Add_Point(pNode->Get_Point());
360 }
361
362 bResult = Points.Save(File);
363 }
364 break;
365 }
366 }
367
368 if( bResult )
369 {
370 Set_Modified(false);
371
372 Set_File_Name(File, true);
373 }
374
375 return( bResult );
376 }
377
378
380 // //
382
383 //---------------------------------------------------------
384 CSG_Table_Record * CSG_TIN::_Get_New_Record(sLong Index)
385 {
386 return( new CSG_TIN_Node(this, Index) );
387 }
388
389 //---------------------------------------------------------
390 CSG_TIN_Node * CSG_TIN::Add_Node(TSG_Point Point, CSG_Table_Record *pRecord, bool bUpdateNow)
391 {
392 CSG_TIN_Node *pNode = (CSG_TIN_Node *)Add_Record(pRecord);
393
394 if( pNode )
395 {
396 pNode->m_Point = Point;
397
398 if( bUpdateNow )
399 {
400 Update();
401 }
402 }
403
404 return( pNode );
405 }
406
407 //---------------------------------------------------------
408 bool CSG_TIN::Del_Node(sLong Index, bool bUpdateNow)
409 {
410 if( Del_Record(Index) )
411 {
412 if( bUpdateNow )
413 {
414 Update();
415 }
416
417 return( true );
418 }
419
420 return( false );
421 }
422
423
425 // //
427
428 //---------------------------------------------------------
429 inline bool CSG_TIN::_Add_Edge(CSG_TIN_Node *a, CSG_TIN_Node *b)
430 {
431 m_Edges = (CSG_TIN_Edge **)SG_Realloc(m_Edges, (m_nEdges + 1) * sizeof(CSG_TIN_Edge *));
432 m_Edges[m_nEdges++] = new CSG_TIN_Edge(a, b);
433
434 return( true );
435 }
436
437 //---------------------------------------------------------
438 bool CSG_TIN::_Add_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c)
439 {
440 CSG_TIN_Triangle *pTriangle;
441
442 m_Triangles = (CSG_TIN_Triangle **)SG_Realloc(m_Triangles, (m_nTriangles + 1) * sizeof(CSG_TIN_Triangle *));
443 m_Triangles[m_nTriangles++] = pTriangle = new CSG_TIN_Triangle(a, b, c);
444
445 if( a->_Add_Neighbor(b) )
446 {
447 b->_Add_Neighbor(a);
448 _Add_Edge(a, b);
449 }
450
451 if( b->_Add_Neighbor(c) )
452 {
453 c->_Add_Neighbor(b);
454 _Add_Edge(b, c);
455 }
456
457 if( c->_Add_Neighbor(a) )
458 {
459 a->_Add_Neighbor(c);
460 _Add_Edge(c, a);
461 }
462
463 a->_Add_Triangle(pTriangle);
464 b->_Add_Triangle(pTriangle);
465 c->_Add_Triangle(pTriangle);
466
467 return( true );
468 }
469
470
472 // //
474
475 //---------------------------------------------------------
476 bool CSG_TIN::On_Update(void)
477 {
478 return( _Triangulate() );
479 }
480
481
483 // //
485
486 //---------------------------------------------------------
487 bool CSG_TIN::On_Reload(void)
488 {
489 return( Create(Get_File_Name(false)) );
490 }
491
492 //---------------------------------------------------------
493 bool CSG_TIN::On_Delete(void)
494 {
495 return( false );
496 }
497
498
500 // //
501 // //
502 // //
504
505 //---------------------------------------------------------
CSG_TIN::_Add_Edge
bool _Add_Edge(CSG_TIN_Node *a, CSG_TIN_Node *b)
Definition: tin.cpp:429
CSG_TIN::m_Triangles
CSG_TIN_Triangle ** m_Triangles
Definition: tin.h:294
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Data_Object::Set_File_Name
void Set_File_Name(const CSG_String &FileName)
Definition: dataobject.cpp:307
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:586
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_TIN::Del_Node
bool Del_Node(sLong Index, bool bUpdateNow)
Definition: tin.cpp:408
CSG_Table_Record
Definition: table.h:130
CSG_TIN_Triangle::Get_Node
CSG_TIN_Node * Get_Node(int iNode)
Definition: tin.h:178
CSG_TIN::_Destroy_Nodes
bool _Destroy_Nodes(void)
Definition: tin.cpp:248
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_TIN::Get_Node
CSG_TIN_Node * Get_Node(sLong Index) const
Definition: tin.h:262
CSG_TIN::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: tin.cpp:341
CSG_TIN::On_Reload
virtual bool On_Reload(void)
Definition: tin.cpp:487
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:204
CSG_TIN::is_Valid
virtual bool is_Valid(void) const
Definition: tin.h:252
CSG_TIN::Get_Node_Count
sLong Get_Node_Count(void) const
Definition: tin.h:261
CSG_TIN::On_Delete
virtual bool On_Delete(void)
Definition: tin.cpp:493
CSG_TIN::m_nTriangles
sLong m_nTriangles
Definition: tin.h:288
CSG_TIN::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: tin.h:244
CSG_TIN::Get_Triangle_Count
sLong Get_Triangle_Count(void) const
Definition: tin.h:267
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Data_Object::Get_ObjectType
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.
SG_Create_TIN
CSG_TIN * SG_Create_TIN(void)
Definition: tin.cpp:63
tin.h
CSG_TIN::_Destroy_Triangles
bool _Destroy_Triangles(void)
Definition: tin.cpp:272
SSG_Point
Definition: geo_tools.h:128
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:273
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1117
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:505
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_TIN
Definition: tin.h:222
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Data_Object
Definition: dataobject.h:180
CSG_TIN::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: tin.cpp:295
CSG_Shapes::Save
virtual bool Save(const CSG_String &File, int Format=0)
Definition: shapes.cpp:432
CSG_TIN::Add_Node
CSG_TIN_Node * Add_Node(TSG_Point Point, CSG_Table_Record *pRecord, bool bUpdateNow)
Definition: tin.cpp:390
sLong
signed long long sLong
Definition: api_core.h:158
CSG_TIN::CSG_TIN
CSG_TIN(void)
Definition: tin.cpp:98
CSG_TIN::_On_Construction
void _On_Construction(void)
Definition: tin.cpp:133
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table
Definition: table.h:283
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:873
CSG_TIN_Triangle
Definition: tin.h:173
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
CSG_String
Definition: api_core.h:557
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
CSG_TIN_Node
Definition: tin.h:93
CSG_TIN::Destroy
virtual bool Destroy(void)
Definition: tin.cpp:231
CSG_TIN::m_nEdges
sLong m_nEdges
Definition: tin.h:288
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_TIN_Edge
Definition: tin.h:146
CSG_TIN::Get_Triangle
CSG_TIN_Triangle * Get_Triangle(sLong Index) const
Definition: tin.h:268
CSG_Shapes
Definition: shapes.h:773
CSG_TIN::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: tin.cpp:384
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_TIN::~CSG_TIN
virtual ~CSG_TIN(void)
Definition: tin.cpp:225
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_TIN::On_Update
virtual bool On_Update(void)
Definition: tin.cpp:476
CSG_TIN::_Triangulate
bool _Triangulate(void)
Definition: tin_triangulation.cpp:94
CSG_Shape
Definition: shapes.h:141
CSG_TIN::Create
bool Create(const CSG_TIN &TIN)
Definition: tin.cpp:150
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_TIN::_Destroy_Edges
bool _Destroy_Edges(void)
Definition: tin.cpp:254
CSG_TIN::m_Edges
CSG_TIN_Edge ** m_Edges
Definition: tin.h:292
CSG_TIN::_Add_Triangle
bool _Add_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c)
Definition: tin.cpp:438
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
CSG_TIN_Node::Get_Point
const TSG_Point & Get_Point(void)
Definition: tin.h:100
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin.h File Reference

  • saga_core
  • saga_api
Classes | Functions
tin.h File Reference
#include "shapes.h"

Go to the source code of this file.

Classes

class | CSG_TIN_Node
class | CSG_TIN_Edge
class | CSG_TIN_Triangle
class | CSG_TIN
struct | CSG_TIN::TTIN_Edge
struct | CSG_TIN::TTIN_Triangle

Functions

SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (void)
SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (const CSG_TIN &TIN)
SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (CSG_Shapes *pShapes)
SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (const char *File)
SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (const wchar_t *File)
SAGA_API_DLL_EXPORT CSG_TIN * | SG_Create_TIN (const CSG_String &File)

Detailed Description

Classes for the construction and management of Triangulated Irregular Networks (TIN) from point data. The core class CSG_TIN is derived from CSG_Shapes.

See also
CSG_TIN
CSG_Shapes
CSG_Table
CSG_Data_Object

Definition in file tin.h.

Function Documentation

◆ SG_Create_TIN() [1/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( const char * File )

Safe TIN construction

Definition at line 75 of file tin.cpp.

References SG_Create_TIN().

◆ SG_Create_TIN() [2/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( const CSG_String & File )

Safe TIN construction

Definition at line 77 of file tin.cpp.

References CSG_TIN::is_Valid().

◆ SG_Create_TIN() [3/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( const CSG_TIN & TIN )

Safe TIN construction

Definition at line 69 of file tin.cpp.

◆ SG_Create_TIN() [4/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( const wchar_t * File )

Safe TIN construction

Definition at line 76 of file tin.cpp.

References SG_Create_TIN().

◆ SG_Create_TIN() [5/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( CSG_Shapes * pShapes )

Safe TIN construction

Definition at line 85 of file tin.cpp.

◆ SG_Create_TIN() [6/6]

SAGA_API_DLL_EXPORT CSG_TIN* SG_Create_TIN ( void )

Safe TIN construction

Definition at line 63 of file tin.cpp.

Referenced by SG_Create_TIN().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin.h Source File

  • saga_core
  • saga_api
tin.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tin.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__tin_H
54 #define HEADER_INCLUDED__SAGA_API__tin_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
75 // //
77 // //
78 // //
80
81 //---------------------------------------------------------
82 #include "shapes.h"
83
84
86 // //
87 // //
88 // //
90
91 //---------------------------------------------------------
92 class SAGA_API_DLL_EXPORT CSG_TIN_Node : public CSG_Table_Record
93 {
94 friend class CSG_TIN;
95
96 public:
97
98 int Get_ID (void) { return( m_ID ); }
99
100 const TSG_Point & Get_Point (void) { return( m_Point ); }
101 double Get_X (void) { return( m_Point.x ); }
102 double Get_Y (void) { return( m_Point.y ); }
103
104 int Get_Neighbor_Count (void) { return( m_nNeighbors ); }
105 CSG_TIN_Node * Get_Neighbor (int iNeighbor) { return( iNeighbor >= 0 && iNeighbor < m_nNeighbors ? m_Neighbors[iNeighbor] : NULL ); }
106 double Get_Gradient (int iNeighbor, int iField);
107
108 int Get_Triangle_Count (void) { return( m_nTriangles ); }
109 class CSG_TIN_Triangle * Get_Triangle (int iTriangle) { return( iTriangle >= 0 && iTriangle < m_nTriangles ? m_Triangles[iTriangle] : NULL ); }
110
111 bool Get_Polygon (CSG_Points &Points);
112 double Get_Polygon_Area (void);
113
114
115 private:
116
117 CSG_TIN_Node(CSG_TIN *pOwner, sLong Index);
118 virtual ~CSG_TIN_Node(void);
119
120
121 int m_ID, m_nNeighbors, m_nTriangles;
122
123 TSG_Point m_Point;
124
125 CSG_TIN_Node **m_Neighbors;
126
127 class CSG_TIN_Triangle **m_Triangles;
128
129
130 bool _Add_Neighbor (CSG_TIN_Node *pNeighbor);
131 bool _Add_Triangle (class CSG_TIN_Triangle *pTriangle);
132
133 bool _Del_Relations (void);
134
135 };
136
137
139 // //
140 // //
141 // //
143
144 //---------------------------------------------------------
145 class SAGA_API_DLL_EXPORT CSG_TIN_Edge
146 {
147 friend class CSG_TIN;
148
149 public:
150
151 CSG_TIN_Node * Get_Node (int iNode) { return( m_Nodes[iNode % 2] ); }
152
153
154 private:
155
156 CSG_TIN_Edge(CSG_TIN_Node *a, CSG_TIN_Node *b);
157 virtual ~CSG_TIN_Edge(void);
158
159
160 CSG_TIN_Node *m_Nodes[2];
161
162 };
163
164
166 // //
167 // //
168 // //
170
171 //---------------------------------------------------------
172 class SAGA_API_DLL_EXPORT CSG_TIN_Triangle
173 {
174 friend class CSG_TIN;
175
176 public:
177
178 CSG_TIN_Node * Get_Node (int iNode) { return( m_Nodes[iNode % 3] ); }
179
180 const CSG_Rect & Get_Extent (void) { return( m_Extent ); }
181
182 double Get_Area (void) { return( m_Area ); }
183
184 bool is_Containing (const TSG_Point &p);
185 bool is_Containing (double x, double y);
186
187 bool Get_Value (int zField, const TSG_Point &p, double &z);
188 bool Get_Value (int zField, double x, double y, double &z);
189
190 bool Get_Gradient (int zField, double &Decline, double &Azimuth);
191
192 void Get_CircumCircle (TSG_Point &Point, double &Radius) { Point = m_Center; Radius = m_Radius; }
193 double Get_CircumCircle_Radius (void) { return( m_Radius ); }
194 TSG_Point Get_CircumCircle_Point (void) { return( m_Center ); }
195
196
197 private:
198
199 CSG_TIN_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c);
200 virtual ~CSG_TIN_Triangle(void);
201
202
203 double m_Area, m_Radius;
204
205 TSG_Point m_Center;
206
207 CSG_Rect m_Extent;
208
209 CSG_TIN_Node *m_Nodes[3];
210
211 };
212
213
215 // //
216 // //
217 // //
219
220 //---------------------------------------------------------
221 class SAGA_API_DLL_EXPORT CSG_TIN : public CSG_Table
222 {
223 public:
224
225 CSG_TIN(void);
226
227 CSG_TIN (const CSG_TIN &TIN);
228 bool Create (const CSG_TIN &TIN);
229
230 CSG_TIN (CSG_Shapes *pShapes);
231 bool Create (CSG_Shapes *pShapes);
232
233 CSG_TIN (const CSG_String &File);
234 bool Create (const CSG_String &File);
235 CSG_TIN (const char *File);
236 bool Create (const char *File);
237 CSG_TIN (const wchar_t *File);
238 bool Create (const wchar_t *File);
239
240 virtual ~CSG_TIN(void);
241
242 virtual bool Destroy (void);
243
244 virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_TIN ); }
245
246 virtual bool Save (const CSG_String &File, int Format = 0);
247 virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
248 virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
249
250 virtual bool Assign (CSG_Data_Object *pObject);
251
252 virtual bool is_Valid (void) const { return( Get_Count() >= 3 ); }
253
254 const CSG_Rect & Get_Extent (void) { Update(); return( m_Extent ); }
255
256
257 //-----------------------------------------------------
258 CSG_TIN_Node * Add_Node (TSG_Point Point, CSG_Table_Record *pRecord, bool bUpdateNow);
259 bool Del_Node (sLong Index, bool bUpdateNow);
260
261 sLong Get_Node_Count (void) const { return( Get_Count() ); }
262 CSG_TIN_Node * Get_Node (sLong Index) const { return( (CSG_TIN_Node *)Get_Record(Index) ); }
263
264 sLong Get_Edge_Count (void) const { return( m_nEdges ); }
265 CSG_TIN_Edge * Get_Edge (sLong Index) const { return( Index >= 0 && Index < m_nEdges ? m_Edges[Index] : NULL ); }
266
267 sLong Get_Triangle_Count (void) const { return( m_nTriangles ); }
268 CSG_TIN_Triangle * Get_Triangle (sLong Index) const { return( Index >= 0 && Index < m_nTriangles ? m_Triangles[Index] : NULL ); }
269
270
271 protected:
272
273 typedef struct
274 {
275 int p1, p2;
276 }
277 TTIN_Edge;
278
279 typedef struct
280 {
281 int p1, p2, p3;
282 }
283 TTIN_Triangle;
284
285
286 protected:
287
288 sLong m_nEdges, m_nTriangles;
289
290 CSG_Rect m_Extent;
291
292 CSG_TIN_Edge **m_Edges;
293
294 CSG_TIN_Triangle **m_Triangles;
295
296
297 virtual bool On_Update (void);
298 virtual bool On_Reload (void);
299 virtual bool On_Delete (void);
300
301 void _On_Construction (void);
302
303 virtual CSG_Table_Record * _Get_New_Record (sLong Index);
304
305 bool _Destroy_Nodes (void);
306 bool _Destroy_Edges (void);
307 bool _Destroy_Triangles (void);
308
309 bool _Add_Edge (CSG_TIN_Node *a, CSG_TIN_Node *b);
310 bool _Add_Triangle (CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c);
311
312 bool _Triangulate (void);
313 bool _Triangulate (CSG_TIN_Node **Nodes, int nNodes, TTIN_Triangle *Triangles, int &nTriangles);
314 int _CircumCircle (double xp, double yp, double x1, double y1, double x2, double y2, double x3, double y3, double *xc, double *yc, double *r);
315
316 };
317
318
320 // //
321 // //
322 // //
324
325 //---------------------------------------------------------
327 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (void);
328
330 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (const CSG_TIN &TIN);
331
333 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (CSG_Shapes *pShapes);
334
336 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (const char *File);
338 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (const wchar_t *File);
340 SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN (const CSG_String &File);
341
342
344 // //
345 // //
346 // //
348
349 //---------------------------------------------------------
350 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tin_H
CSG_Rect
Definition: geo_tools.h:471
CSG_TIN_Node::Get_ID
int Get_ID(void)
Definition: tin.h:98
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:372
CSG_TIN_Triangle::Get_CircumCircle_Radius
double Get_CircumCircle_Radius(void)
Definition: tin.h:193
CSG_TIN::Get_Edge
CSG_TIN_Edge * Get_Edge(sLong Index) const
Definition: tin.h:265
CSG_TIN::m_Triangles
CSG_TIN_Triangle ** m_Triangles
Definition: tin.h:294
CSG_TIN::TTIN_Triangle
Definition: tin.h:280
CSG_TIN::Save
virtual bool Save(const char *File, int Format=0)
Definition: tin.h:247
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:714
CSG_TIN_Node::Get_X
double Get_X(void)
Definition: tin.h:101
CSG_Table_Record
Definition: table.h:130
SG_Create_TIN
SAGA_API_DLL_EXPORT CSG_TIN * SG_Create_TIN(void)
Definition: tin.cpp:63
CSG_TIN_Triangle::Get_Node
CSG_TIN_Node * Get_Node(int iNode)
Definition: tin.h:178
CSG_Table::Get_Value
virtual bool Get_Value(sLong Index, int iField, CSG_String &Value) const
Definition: table.cpp:1161
CSG_TIN::Get_Node
CSG_TIN_Node * Get_Node(sLong Index) const
Definition: tin.h:262
CSG_Table::Get_Record
virtual CSG_Table_Record * Get_Record(sLong Index) const
Definition: table.h:387
CSG_TIN::is_Valid
virtual bool is_Valid(void) const
Definition: tin.h:252
CSG_TIN::Get_Node_Count
sLong Get_Node_Count(void) const
Definition: tin.h:261
CSG_TIN::m_nTriangles
sLong m_nTriangles
Definition: tin.h:288
CSG_TIN::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: tin.h:244
CSG_TIN::Get_Triangle_Count
sLong Get_Triangle_Count(void) const
Definition: tin.h:267
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:327
CSG_Table::On_Reload
virtual bool On_Reload(void)
Definition: table_io.cpp:64
CSG_TIN::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: tin.h:248
CSG_Table::On_Delete
virtual bool On_Delete(void)
Definition: table_io.cpp:70
SSG_Point
Definition: geo_tools.h:128
CSG_TIN_Triangle::Get_CircumCircle_Point
TSG_Point Get_CircumCircle_Point(void)
Definition: tin.h:194
CSG_TIN_Node::Get_Triangle_Count
int Get_Triangle_Count(void)
Definition: tin.h:108
CSG_TIN
Definition: tin.h:222
CSG_TIN::TTIN_Edge
Definition: tin.h:274
CSG_TIN::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: tin.h:254
CSG_Data_Object
Definition: dataobject.h:180
CSG_TIN::TTIN_Triangle::p3
int p3
Definition: tin.h:281
sLong
signed long long sLong
Definition: api_core.h:158
CSG_TIN_Node::Get_Y
double Get_Y(void)
Definition: tin.h:102
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1292
CSG_TIN_Triangle::Get_CircumCircle
void Get_CircumCircle(TSG_Point &Point, double &Radius)
Definition: tin.h:192
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_TIN_Edge::Get_Node
CSG_TIN_Node * Get_Node(int iNode)
Definition: tin.h:151
CSG_Points
Definition: geo_tools.h:184
CSG_Table
Definition: table.h:283
CSG_TIN_Triangle::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: tin.h:180
CSG_TIN_Triangle
Definition: tin.h:173
CSG_Table::Create
bool Create(const CSG_Table &Table)
Definition: table.cpp:146
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
shapes.h
CSG_String
Definition: api_core.h:557
CSG_TIN_Node::Get_Neighbor
CSG_TIN_Node * Get_Neighbor(int iNeighbor)
Definition: tin.h:105
CSG_TIN::Get_Edge_Count
sLong Get_Edge_Count(void) const
Definition: tin.h:264
CSG_TIN_Node::Get_Neighbor_Count
int Get_Neighbor_Count(void)
Definition: tin.h:104
CSG_TIN_Node
Definition: tin.h:93
CSG_TIN::m_Extent
CSG_Rect m_Extent
Definition: tin.h:290
CSG_TIN_Edge
Definition: tin.h:146
CSG_TIN::Get_Triangle
CSG_TIN_Triangle * Get_Triangle(sLong Index) const
Definition: tin.h:268
CSG_Shapes
Definition: shapes.h:773
CSG_Table::Save
virtual bool Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:155
CSG_TIN_Triangle::Get_Area
double Get_Area(void)
Definition: tin.h:182
CSG_TIN_Node::Get_Triangle
class CSG_TIN_Triangle * Get_Triangle(int iTriangle)
Definition: tin.h:109
CSG_Table::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: table.cpp:793
CSG_TIN::TTIN_Edge::p2
int p2
Definition: tin.h:275
CSG_TIN::m_Edges
CSG_TIN_Edge ** m_Edges
Definition: tin.h:292
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
CSG_Table::CSG_TIN
friend class CSG_TIN
Definition: table.h:285
CSG_TIN_Node::Get_Point
const TSG_Point & Get_Point(void)
Definition: tin.h:100
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin_elements.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
tin_elements.cpp File Reference
#include "tin.h"

Go to the source code of this file.

Macros

#define IS_ONLINE(A, B) (A.y == B.y && ((A.x <= x && x <= B.x) || (B.x <= x && x <= A.x)))

Functions

int SG_TIN_Compare_Triangle_Center (const void *pz1, const void *pz2)

Macro Definition Documentation

◆ IS_ONLINE

#define IS_ONLINE | ( | A,
 |  | B
 | ) | (A.y == B.y && ((A.x <= x && x <= B.x) || (B.x <= x && x <= A.x)))

Definition at line 304 of file tin_elements.cpp.

Function Documentation

◆ SG_TIN_Compare_Triangle_Center()

int SG_TIN_Compare_Triangle_Center | ( | const void * | pz1,
 |  | const void * | pz2
 | ) |  |

Definition at line 166 of file tin_elements.cpp.

Referenced by CSG_TIN_Node::Get_Polygon().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin_elements.cpp Source File

  • saga_core
  • saga_api
tin_elements.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tin_elements.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tin.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_TIN_Node::CSG_TIN_Node(CSG_TIN *pOwner, sLong Index)
64 : CSG_Table_Record(pOwner, Index)
65 {
66 m_Point.x = m_Point.y = 0.;
67
68 m_Neighbors = NULL;
69 m_nNeighbors = 0;
70
71 m_Triangles = NULL;
72 m_nTriangles = 0;
73 }
74
75 //---------------------------------------------------------
76 CSG_TIN_Node::~CSG_TIN_Node(void)
77 {
78 _Del_Relations();
79 }
80
81 //---------------------------------------------------------
82 bool CSG_TIN_Node::_Add_Triangle(CSG_TIN_Triangle *pTriangle)
83 {
84 for(int i=0; i<m_nTriangles; i++)
85 {
86 if( m_Triangles[i] == pTriangle )
87 {
88 return( false );
89 }
90 }
91
92 m_Triangles = (CSG_TIN_Triangle **)SG_Realloc(m_Triangles, ((uLong)m_nTriangles + 1) * sizeof(CSG_TIN_Triangle *));
93 m_Triangles[m_nTriangles++] = pTriangle;
94
95 // _Add_Neighbor(pTriangle->Get_Point());
96 // _Add_Neighbor(pTriangle->Get_Point(1));
97 // _Add_Neighbor(pTriangle->Get_Point(2));
98
99 return( true );
100 }
101
102 //---------------------------------------------------------
103 bool CSG_TIN_Node::_Add_Neighbor(CSG_TIN_Node *pNeighbor)
104 {
105 if( pNeighbor == this )
106 {
107 return( false );
108 }
109
110 for(int i=0; i<m_nNeighbors; i++)
111 {
112 if( m_Neighbors[i] == pNeighbor )
113 {
114 return( false );
115 }
116 }
117
118 m_Neighbors = (CSG_TIN_Node **)SG_Realloc(m_Neighbors, ((uLong)m_nNeighbors + 1) * sizeof(CSG_TIN_Node *));
119 m_Neighbors[m_nNeighbors++] = pNeighbor;
120
121 return( true );
122 }
123
124 //---------------------------------------------------------
125 bool CSG_TIN_Node::_Del_Relations(void)
126 {
127 if( m_nTriangles > 0 )
128 {
129 SG_Free(m_Triangles);
130 m_Triangles = NULL;
131 m_nTriangles = 0;
132 }
133
134 if( m_nNeighbors > 0 )
135 {
136 SG_Free(m_Neighbors);
137 m_Neighbors = NULL;
138 m_nNeighbors = 0;
139 }
140
141 return( true );
142 }
143
144 //---------------------------------------------------------
145 double CSG_TIN_Node::Get_Gradient(int iNeighbor, int iField)
146 {
147 double dx, dy, dz;
148 CSG_TIN_Node *pNeighbor;
149
150 if( (pNeighbor = Get_Neighbor(iNeighbor)) != NULL )
151 {
152 dx = Get_X() - pNeighbor->Get_X();
153 dy = Get_Y() - pNeighbor->Get_Y();
154 dz = asDouble(iField) - pNeighbor->asDouble(iField);
155
156 if( (dx = sqrt(dx*dx + dy*dy)) > 0.0 )
157 {
158 return( dz / dx );
159 }
160 }
161
162 return( 0.0 );
163 }
164
165 //---------------------------------------------------------
166 int SG_TIN_Compare_Triangle_Center(const void *pz1, const void *pz2)
167 {
168 double z1 = ((TSG_Point_3D *)pz1)->z;
169 double z2 = ((TSG_Point_3D *)pz2)->z;
170
171 return( z1 < z2 ? -1 : z1 > z2 ? 1 : 0 );
172 }
173
174 //---------------------------------------------------------
175 bool CSG_TIN_Node::Get_Polygon(CSG_Points &Points)
176 {
177 Points.Clear();
178
179 if( m_nTriangles >= 3 )
180 {
181 int i; CSG_Points_3D p;
182
183 for(i=0; i<m_nTriangles; i++)
184 {
185 TSG_Point c = m_Triangles[i]->Get_CircumCircle_Point();
186
187 p.Add(c.x, c.y, atan2(m_Point.y - c.y, m_Point.x - c.x));
188 }
189
190 qsort(&(p[0]), p.Get_Count(), sizeof(TSG_Point_3D), SG_TIN_Compare_Triangle_Center);
191
192 for(i=0; i<m_nTriangles; i++)
193 {
194 Points.Add(p[i].x, p[i].y);
195 }
196
197 return( true );
198 }
199
200 return( false );
201 }
202
203 //---------------------------------------------------------
204 double CSG_TIN_Node::Get_Polygon_Area(void)
205 {
206 CSG_Points Points;
207
208 if( Get_Polygon(Points) )
209 {
210 return( SG_Get_Polygon_Area(Points) );
211 }
212
213 return( 0.0 );
214 }
215
216
218 // //
219 // //
220 // //
222
223 //---------------------------------------------------------
224 CSG_TIN_Edge::CSG_TIN_Edge(CSG_TIN_Node *a, CSG_TIN_Node *b)
225 {
226 m_Nodes[0] = a;
227 m_Nodes[1] = b;
228 }
229
230 //---------------------------------------------------------
231 CSG_TIN_Edge::~CSG_TIN_Edge(void)
232 {
233 }
234
235
237 // //
238 // //
239 // //
241
242 //---------------------------------------------------------
243 CSG_TIN_Triangle::CSG_TIN_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c)
244 {
245 m_Nodes[0] = a;
246 m_Nodes[1] = b;
247 m_Nodes[2] = c;
248
249 //-----------------------------------------------------
250 double xMin, yMin, xMax, yMax;
251
252 xMin = xMax = a->Get_X();
253 yMin = yMax = a->Get_Y();
254
255 if( xMin > b->Get_X() )
256 xMin = b->Get_X();
257 else if( xMax < b->Get_X() )
258 xMax = b->Get_X();
259
260 if( yMin > b->Get_Y() )
261 yMin = b->Get_Y();
262 else if( yMax < b->Get_Y() )
263 yMax = b->Get_Y();
264
265 if( xMin > c->Get_X() )
266 xMin = c->Get_X();
267 else if( xMax < c->Get_X() )
268 xMax = c->Get_X();
269
270 if( yMin > c->Get_Y() )
271 yMin = c->Get_Y();
272 else if( yMax < c->Get_Y() )
273 yMax = c->Get_Y();
274
275 m_Extent.Assign(xMin, yMin, xMax, yMax);
276
277 //-----------------------------------------------------
278 m_Area = fabs( a->Get_X() * (b->Get_Y() - c->Get_Y())
279 + b->Get_X() * (c->Get_Y() - a->Get_Y())
280 + c->Get_X() * (a->Get_Y() - b->Get_Y()) ) / 2.0;
281
282 //-----------------------------------------------------
283 TSG_Point Points[3];
284
285 Points[0] = m_Nodes[0]->Get_Point();
286 Points[1] = m_Nodes[1]->Get_Point();
287 Points[2] = m_Nodes[2]->Get_Point();
288
289 SG_Get_Triangle_CircumCircle(Points, m_Center, m_Radius);
290 }
291
292 //---------------------------------------------------------
293 CSG_TIN_Triangle::~CSG_TIN_Triangle(void)
294 {}
295
296
297 //---------------------------------------------------------
298 bool CSG_TIN_Triangle::is_Containing(const TSG_Point &Point)
299 {
300 return( is_Containing(Point.x, Point.y) );
301 }
302
303 //---------------------------------------------------------
304 #define IS_ONLINE(A, B) (A.y == B.y && ((A.x <= x && x <= B.x) || (B.x <= x && x <= A.x)))
305
306 //---------------------------------------------------------
307 bool CSG_TIN_Triangle::is_Containing(double x, double y)
308 {
309 if( m_Extent.Contains(x, y) )
310 {
311 int nCrossings;
312 TSG_Point A, B, C;
313
314 if( (x == m_Nodes[0]->Get_Point().x && y == m_Nodes[0]->Get_Point().y)
315 || (x == m_Nodes[1]->Get_Point().x && y == m_Nodes[1]->Get_Point().y)
316 || (x == m_Nodes[2]->Get_Point().x && y == m_Nodes[2]->Get_Point().y) )
317 return( true );
318
319 if( y == m_Extent.Get_YMin() || y == m_Extent.Get_YMax() )
320 {
321 if( IS_ONLINE(m_Nodes[0]->Get_Point(), m_Nodes[1]->Get_Point())
322 || IS_ONLINE(m_Nodes[1]->Get_Point(), m_Nodes[2]->Get_Point())
323 || IS_ONLINE(m_Nodes[2]->Get_Point(), m_Nodes[0]->Get_Point()) )
324 return( true );
325 }
326
327 nCrossings = 0;
328
329 if( (y == m_Nodes[0]->Get_Point().y && x > m_Nodes[0]->Get_Point().x)
330 || (y == m_Nodes[1]->Get_Point().y && x > m_Nodes[1]->Get_Point().x)
331 || (y == m_Nodes[2]->Get_Point().y && x > m_Nodes[2]->Get_Point().x) )
332 nCrossings = -1;
333
334 A.x = m_Extent.xMin - 1.0;
335 B.x = x;
336 A.y = B.y = y;
337
338 if( SG_Get_Crossing(C, m_Nodes[0]->Get_Point(), m_Nodes[1]->Get_Point(), A, B) )
339 nCrossings++;
340
341 if( SG_Get_Crossing(C, m_Nodes[1]->Get_Point(), m_Nodes[2]->Get_Point(), A, B) )
342 nCrossings++;
343
344 if( SG_Get_Crossing(C, m_Nodes[2]->Get_Point(), m_Nodes[0]->Get_Point(), A, B) )
345 nCrossings++;
346
347 return( nCrossings == 1 );
348 }
349
350 return( false );
351 }
352
353 //---------------------------------------------------------
354 bool CSG_TIN_Triangle::Get_Value(int zField, const TSG_Point &p, double &z)
355 {
356 return( Get_Value(zField, p.x, p.y, z) );
357 }
358
359 bool CSG_TIN_Triangle::Get_Value(int zField, double x, double y, double &z)
360 {
361 CSG_Vector B, Z(3);
362 CSG_Matrix M(3, 3), Mt;
363
364 for(int i=0; i<3; i++)
365 {
366 M[i][0] = 1.0;
367 M[i][1] = m_Nodes[i]->Get_X();
368 M[i][2] = m_Nodes[i]->Get_Y();
369 Z[i] = m_Nodes[i]->asDouble(zField);
370 }
371
372 Mt = M.Get_Transpose();
373 B = (Mt * M).Get_Inverse() * (Mt * Z);
374
375 z = B[0] + B[1] * x + B[2] * y;
376
377 return( true );
378 }
379
380 //---------------------------------------------------------
381 bool CSG_TIN_Triangle::Get_Gradient(int zField, double &Decline, double &Azimuth)
382 {
383 int i;
384 double x[3], y[3], z[3], A, B, C;
385
386 for(i=0; i<3; i++)
387 {
388 x[i] = m_Nodes[i]->Get_X();
389 y[i] = m_Nodes[i]->Get_Y();
390 z[i] = m_Nodes[i]->asDouble(zField);
391 }
392
393 A = z[0] * (x[1] - x[2]) + z[1] * (x[2] - x[0]) + z[2] * (x[0] - x[1]);
394 B = y[0] * (z[1] - z[2]) + y[1] * (z[2] - z[0]) + y[2] * (z[0] - z[1]);
395 C = x[0] * (y[1] - y[2]) + x[1] * (y[2] - y[0]) + x[2] * (y[0] - y[1]);
396
397 if( C != 0.0 )
398 {
399 A = - A / C;
400 B = - B / C;
401
402 Decline = atan(sqrt(A*A + B*B));
403
404 if( A != 0.0 )
405 Azimuth = M_PI_180 + atan2(B, A);
406 else
407 Azimuth = B > 0.0 ? M_PI_270 : (B < 0.0 ? M_PI_090 : -1.0);
408
409 return( true );
410 }
411
412 Decline = -1.0;
413 Azimuth = -1.0;
414
415 return( false );
416 }
417
418
420 // //
421 // //
422 // //
424
425 //---------------------------------------------------------
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Points::Add
bool Add(double x, double y)
Definition: geo_classes.cpp:350
CSG_Points_3D
Definition: geo_tools.h:320
CSG_TIN::m_Triangles
CSG_TIN_Triangle ** m_Triangles
Definition: tin.h:294
SG_Get_Triangle_CircumCircle
bool SG_Get_Triangle_CircumCircle(TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
Definition: geo_functions.cpp:465
CSG_Points_3D::Add
bool Add(double x, double y, double z)
Definition: geo_classes.cpp:582
CSG_TIN_Node::Get_X
double Get_X(void)
Definition: tin.h:101
A
#define A
CSG_Table_Record
Definition: table.h:130
SG_Get_Polygon_Area
double SG_Get_Polygon_Area(TSG_Point *Points, int nPoints)
Definition: geo_functions.cpp:514
C
#define C
CSG_TIN::m_nTriangles
sLong m_nTriangles
Definition: tin.h:288
SSG_Point_3D
Definition: geo_tools.h:264
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:336
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
IS_ONLINE
#define IS_ONLINE(A, B)
Definition: tin_elements.cpp:304
CSG_TIN_Node::Get_Polygon_Area
double Get_Polygon_Area(void)
Definition: tin_elements.cpp:204
tin.h
SSG_Point
Definition: geo_tools.h:128
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
CSG_TIN_Triangle::Get_CircumCircle_Point
TSG_Point Get_CircumCircle_Point(void)
Definition: tin.h:194
CSG_TIN
Definition: tin.h:222
CSG_Vector
Definition: mat_tools.h:345
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
SG_TIN_Compare_Triangle_Center
int SG_TIN_Compare_Triangle_Center(const void *pz1, const void *pz2)
Definition: tin_elements.cpp:166
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
sLong
signed long long sLong
Definition: api_core.h:158
CSG_TIN_Node::Get_Y
double Get_Y(void)
Definition: tin.h:102
M_PI_180
#define M_PI_180
Definition: mat_tools.h:104
CSG_Points
Definition: geo_tools.h:184
CSG_Matrix::Get_Transpose
CSG_Matrix Get_Transpose(void) const
Definition: mat_matrix.cpp:1829
M_PI_270
#define M_PI_270
Definition: mat_tools.h:106
CSG_TIN_Node::Get_Polygon
bool Get_Polygon(CSG_Points &Points)
Definition: tin_elements.cpp:175
CSG_TIN_Triangle::Get_Value
bool Get_Value(int zField, const TSG_Point &p, double &z)
Definition: tin_elements.cpp:354
CSG_TIN_Triangle
Definition: tin.h:173
CSG_TIN_Triangle::is_Containing
bool is_Containing(const TSG_Point &p)
Definition: tin_elements.cpp:298
B
#define B
M_PI_090
#define M_PI_090
Definition: mat_tools.h:102
CSG_TIN_Node::Get_Neighbor
CSG_TIN_Node * Get_Neighbor(int iNeighbor)
Definition: tin.h:105
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_TIN_Node
Definition: tin.h:93
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_TIN_Node::Get_Gradient
double Get_Gradient(int iNeighbor, int iField)
Definition: tin_elements.cpp:145
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Points::Clear
bool Clear(void)
Definition: geo_tools.h:190
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_Get_Crossing
bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch)
Definition: geo_functions.cpp:280
CSG_Matrix
Definition: mat_tools.h:463
CSG_TIN_Triangle::Get_Gradient
bool Get_Gradient(int zField, double &Decline, double &Azimuth)
Definition: tin_elements.cpp:381
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_TIN_Node::Get_Point
const TSG_Point & Get_Point(void)
Definition: tin.h:100
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin_triangulation.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
tin_triangulation.cpp File Reference
#include "tin.h"

Go to the source code of this file.

Macros

#define IS_IDENTICAL(a, b) (a == b)

Functions

int SG_TIN_Compare (const void *pp1, const void *pp2)

Macro Definition Documentation

◆ IS_IDENTICAL

#define IS_IDENTICAL | ( | a,
 |  | b
 | ) | (a == b)

Definition at line 370 of file tin_triangulation.cpp.

Function Documentation

◆ SG_TIN_Compare()

int SG_TIN_Compare | ( | const void * | pp1,
 |  | const void * | pp2
 | ) |  |

Definition at line 73 of file tin_triangulation.cpp.

References CSG_TIN_Node::Get_X(), and CSG_TIN_Node::Get_Y().

Referenced by CSG_TIN::_Triangulate().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tin_triangulation.cpp Source File

  • saga_core
  • saga_api
tin_triangulation.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tin_triangulation.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 //
54 // The Delaunay Triangulation algorithm used here is based
55 // on Paul Bourke's C source codes, which can be found at:
56 //
57 // http://astronomy.swin.edu.au/~pbourke/
58 //
59 //---------------------------------------------------------
60
61
62 //---------------------------------------------------------
63 #include "tin.h"
64
65
67 // //
68 // //
69 // //
71
72 //---------------------------------------------------------
73 int SG_TIN_Compare(const void *pp1, const void *pp2)
74 {
75 CSG_TIN_Node *p1 = *((CSG_TIN_Node **)pp1);
76 CSG_TIN_Node *p2 = *((CSG_TIN_Node **)pp2);
77
78 if( p1->Get_X() < p2->Get_X() ) { return( -1 ); }
79 if( p1->Get_X() > p2->Get_X() ) { return( 1 ); }
80 if( p1->Get_Y() < p2->Get_Y() ) { return( -1 ); }
81 if( p1->Get_Y() > p2->Get_Y() ) { return( 1 ); }
82
83 return( 0 );
84 }
85
86
88 // //
89 // //
90 // //
92
93 //---------------------------------------------------------
94 bool CSG_TIN::_Triangulate(void)
95 {
96 _Destroy_Edges(); _Destroy_Triangles();
97
98 //-----------------------------------------------------
99 CSG_TIN_Node **Nodes = (CSG_TIN_Node **)SG_Malloc((Get_Node_Count() + 3l) * sizeof(CSG_TIN_Node *));
100
101 for(sLong i=0; i<Get_Node_Count(); i++)
102 {
103 Nodes[i] = Get_Node(i); Nodes[i]->_Del_Relations();
104 }
105
106 //-----------------------------------------------------
107 qsort(Nodes, Get_Node_Count(), sizeof(CSG_TIN_Node *), SG_TIN_Compare);
108
109 for(sLong i=0, j=0, n=Get_Node_Count(); j<n; i++) // remove duplicates
110 {
111 Nodes[i] = Nodes[j++];
112
113 while( j < n
114 && Nodes[i]->Get_X() == Nodes[j]->Get_X()
115 && Nodes[i]->Get_Y() == Nodes[j]->Get_Y() )
116 {
117 Del_Node(Nodes[j++]->Get_Index(), false);
118 }
119 }
120
121 //-----------------------------------------------------
122 for(sLong i=Get_Node_Count(); i<Get_Node_Count()+3l; i++)
123 {
124 Nodes[i] = new CSG_TIN_Node(this, 0);
125 }
126
127 //-----------------------------------------------------
128 TTIN_Triangle *Triangles = (TTIN_Triangle *)SG_Malloc(Get_Node_Count() * 3l * sizeof(TTIN_Triangle));
129
130 int nTriangles; bool bResult = _Triangulate(Nodes, (int)Get_Node_Count(), Triangles, nTriangles);
131
132 if( bResult )
133 {
134 for(int i=0; i<nTriangles && SG_UI_Process_Set_Progress(i, nTriangles); i++)
135 {
136 _Add_Triangle(Nodes[Triangles[i].p1], Nodes[Triangles[i].p2], Nodes[Triangles[i].p3]);
137 }
138 }
139
140 SG_Free(Triangles);
141
142 //-----------------------------------------------------
143 for(sLong i=Get_Node_Count(); i<Get_Node_Count()+3l; i++)
144 {
145 delete(Nodes[i]);
146 }
147
148 SG_Free(Nodes);
149
150 SG_UI_Process_Set_Ready();
151
152 return( bResult );
153 }
154
155
157 // //
159
160 //---------------------------------------------------------
161 bool CSG_TIN::_Triangulate(CSG_TIN_Node **Points, int nPoints, TTIN_Triangle *Triangles, int &nTriangles)
162 {
163 if( nPoints >= 3 ) // Update extent...
164 {
165 m_Extent.Assign(Points[0]->Get_Point(), Points[0]->Get_Point());
166
167 for(int i=1; i<nPoints; i++)
168 {
169 m_Extent.Union(Points[i]->Get_Point());
170 }
171 }
172 else
173 {
174 return( false );
175 }
176
177 int status = 0, emax = 200, trimax = 4 * nPoints;
178
179 //-----------------------------------------------------
180 int *complete = (int *)SG_Malloc(trimax * sizeof(int)); // Allocate memory for the completeness list, flag for each triangle
181
182 if( complete == NULL )
183 {
184 return( false );
185 }
186
187 //-----------------------------------------------------
188 TTIN_Edge *edges = (TTIN_Edge *)SG_Malloc(emax * sizeof(TTIN_Edge)); // Allocate memory for the edge list
189
190 if( edges == NULL )
191 {
192 SG_Free(complete); return( false );
193 }
194
195 //-----------------------------------------------------
196 // Find the maximum and minimum vertex bounds.
197 // This is to allow calculation of the bounding triangle
198 // Set up the supertriangle
199 // This is a triangle which encompasses all the sample points.
200 // The supertriangle coordinates are added to the end of the
201 // vertex list. The supertriangle is the first triangle in
202 // the triangle list.
203
204 double dmax = m_Extent.Get_XRange() > m_Extent.Get_YRange() ? m_Extent.Get_XRange() : m_Extent.Get_YRange();
205
206 Points[nPoints + 0]->m_Point.x = m_Extent.Get_XCenter() - 20 * dmax;
207 Points[nPoints + 1]->m_Point.x = m_Extent.Get_XCenter();
208 Points[nPoints + 2]->m_Point.x = m_Extent.Get_XCenter() + 20 * dmax;
209
210 Points[nPoints + 0]->m_Point.y = m_Extent.Get_YCenter() - dmax;
211 Points[nPoints + 1]->m_Point.y = m_Extent.Get_YCenter() + 20 * dmax;
212 Points[nPoints + 2]->m_Point.y = m_Extent.Get_YCenter() - dmax;
213
214 Triangles[0].p1 = nPoints;
215 Triangles[0].p2 = nPoints + 1;
216 Triangles[0].p3 = nPoints + 2;
217
218 complete [0] = false;
219
220 nTriangles = 1;
221
222 //-----------------------------------------------------
223 // Include each point one at a time into the existing mesh
224 for(int i=0; i<nPoints && SG_UI_Process_Set_Progress(i, nPoints); i++)
225 {
226 double xp = Points[i]->Get_X();
227 double yp = Points[i]->Get_Y();
228
229 int nedge = 0;
230
231 //-------------------------------------------------
232 // Set up the edge buffer.
233 // If the point (xp,yp) lies inside the circumcircle then the
234 // three edges of that triangle are added to the edge buffer
235 // and that triangle is removed.
236 for(int j=0; j<nTriangles; j++)
237 {
238 if( complete[j] )
239 {
240 continue;
241 }
242
243 double x1 = Points[Triangles[j].p1]->Get_X();
244 double y1 = Points[Triangles[j].p1]->Get_Y();
245 double x2 = Points[Triangles[j].p2]->Get_X();
246 double y2 = Points[Triangles[j].p2]->Get_Y();
247 double x3 = Points[Triangles[j].p3]->Get_X();
248 double y3 = Points[Triangles[j].p3]->Get_Y();
249
250 double xc, yc, r; int inside = _CircumCircle(xp, yp, x1, y1, x2, y2, x3, y3, &xc, &yc, &r);
251
252 if( xc + r < xp )
253 {
254 complete[j] = true;
255 }
256
257 if( inside )
258 {
259 if( nedge + 3 >= emax ) // Check that we haven't exceeded the edge list size
260 {
261 emax += 100; TTIN_Edge *_edges = (TTIN_Edge *)SG_Realloc(edges, emax * sizeof(TTIN_Edge));
262
263 if( _edges == NULL )
264 {
265 SG_Free(edges); SG_Free(complete); return( false );
266 }
267
268 edges = _edges;
269 }
270
271 edges[nedge + 0].p1 = Triangles[j].p1;
272 edges[nedge + 0].p2 = Triangles[j].p2;
273 edges[nedge + 1].p1 = Triangles[j].p2;
274 edges[nedge + 1].p2 = Triangles[j].p3;
275 edges[nedge + 2].p1 = Triangles[j].p3;
276 edges[nedge + 2].p2 = Triangles[j].p1;
277
278 nedge += 3;
279
280 Triangles[j] = Triangles[nTriangles - 1];
281 complete [j] = complete [nTriangles - 1];
282
283 nTriangles--; j--;
284 }
285 }
286
287 //-------------------------------------------------
288 // Tag multiple edges
289 // Note: if all triangles are specified anticlockwise then all
290 // interior edges are opposite pointing in direction.
291 for(int j=0; j<nedge-1; j++)
292 {
293 for(int k=j+1; k<nedge; k++)
294 {
295 if( (edges[j].p1 == edges[k].p2) && (edges[j].p2 == edges[k].p1) )
296 {
297 edges[j].p1 = -1;
298 edges[j].p2 = -1;
299 edges[k].p1 = -1;
300 edges[k].p2 = -1;
301 }
302
303 // Shouldn't need the following, see note above
304 if( (edges[j].p1 == edges[k].p1) && (edges[j].p2 == edges[k].p2) )
305 {
306 edges[j].p1 = -1;
307 edges[j].p2 = -1;
308 edges[k].p1 = -1;
309 edges[k].p2 = -1;
310 }
311 }
312 }
313
314 //-------------------------------------------------
315 // Form new triangles for the current point
316 // Skipping over any tagged edges.
317 // All edges are arranged in clockwise order.
318 for(int j=0; j<nedge; j++)
319 {
320 if( edges[j].p1 < 0 || edges[j].p2 < 0 )
321 {
322 continue;
323 }
324
325 if( nTriangles >= trimax )
326 {
327 SG_Free(edges); SG_Free(complete); return( false );
328 }
329
330 Triangles[nTriangles].p1 = edges[j].p1;
331 Triangles[nTriangles].p2 = edges[j].p2;
332 Triangles[nTriangles].p3 = i;
333 complete [nTriangles] = false;
334 nTriangles++;
335 }
336 }
337
338 //-----------------------------------------------------
339 // Remove triangles with supertriangle vertices
340 // These are triangles which have a vertex number greater than nPoints
341 for(int i=0; i<nTriangles; i++)
342 {
343 if( Triangles[i].p1 >= nPoints
344 || Triangles[i].p2 >= nPoints
345 || Triangles[i].p3 >= nPoints )
346 {
347 Triangles[i] = Triangles[nTriangles - 1];
348 nTriangles--;
349 i--;
350 }
351 }
352
353 //-----------------------------------------------------
354 return( true );
355 }
356
357
359 // //
361
362 //---------------------------------------------------------
363 // Return true if a point (xp,yp) is inside the circumcircle made up
364 // of the points (x1,y1), (x2,y2), (x3,y3)
365 // The circumcircle centre is returned in (xc,yc) and the radius r
366 // NOTE: A point on the edge is inside the circumcircle
367 //
368
369 //---------------------------------------------------------
370 #define IS_IDENTICAL(a, b) (a == b) // #define IS_IDENTICAL(a, b) (fabs(a - b) < 0.0001)
371
372 //---------------------------------------------------------
373 int CSG_TIN::_CircumCircle(double xp, double yp, double x1, double y1, double x2, double y2, double x3, double y3, double *xc, double *yc, double *r)
374 {
375 double m1, m2, mx1, mx2, my1, my2,
376 dx, dy, rsqr, drsqr;
377
378 // Check for coincident points
379 if( IS_IDENTICAL(y1, y2) && IS_IDENTICAL(y2, y3) )
380 {
381 return( false );
382 }
383
384 //-----------------------------------------------------
385 if( IS_IDENTICAL(y2, y1) )
386 {
387 m2 = -(x3 - x2) / (y3 - y2);
388 mx2 = (x2 + x3) / 2.0;
389 my2 = (y2 + y3) / 2.0;
390 *xc = (x2 + x1) / 2.0;
391
392 *yc = m2 * (*xc - mx2) + my2;
393 }
394 else if( IS_IDENTICAL(y3, y2) )
395 {
396 m1 = -(x2 - x1) / (y2 - y1);
397 mx1 = (x1 + x2) / 2.0;
398 my1 = (y1 + y2) / 2.0;
399 *xc = (x3 + x2) / 2.0;
400
401 *yc = m1 * (*xc - mx1) + my1;
402 }
403 else
404 {
405 m1 = -(x2 - x1) / (y2 - y1);
406 m2 = -(x3 - x2) / (y3 - y2);
407 mx1 = (x1 + x2) / 2.0;
408 mx2 = (x2 + x3) / 2.0;
409 my1 = (y1 + y2) / 2.0;
410 my2 = (y2 + y3) / 2.0;
411
412 *xc = (m1 * mx1 - m2 * mx2 + my2 - my1) / (m1 - m2);
413 *yc = m1 * (*xc - mx1) + my1;
414 }
415
416 //-----------------------------------------------------
417 dx = x2 - *xc;
418 dy = y2 - *yc;
419 rsqr = dx*dx + dy*dy;
420 *r = sqrt(rsqr);
421
422 dx = xp - *xc;
423 dy = yp - *yc;
424 drsqr = dx*dx + dy*dy;
425
426 return( drsqr <= rsqr ? 1 : 0 );
427 }
428
429
431 // //
432 // //
433 // //
435
436 //---------------------------------------------------------
CSG_TIN::TTIN_Edge::p1
int p1
Definition: tin.h:275
CSG_Table::Get_Index
sLong Get_Index(sLong Index) const
Definition: table.h:390
CSG_TIN::TTIN_Triangle
Definition: tin.h:280
CSG_TIN_Node::Get_X
double Get_X(void)
Definition: tin.h:101
CSG_TIN::Del_Node
bool Del_Node(sLong Index, bool bUpdateNow)
Definition: tin.cpp:408
CSG_TIN::TTIN_Triangle::p2
int p2
Definition: tin.h:281
CSG_TIN::Get_Node
CSG_TIN_Node * Get_Node(sLong Index) const
Definition: tin.h:262
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_TIN::Get_Node_Count
sLong Get_Node_Count(void) const
Definition: tin.h:261
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
tin.h
CSG_TIN::_Destroy_Triangles
bool _Destroy_Triangles(void)
Definition: tin.cpp:272
CSG_TIN::TTIN_Edge
Definition: tin.h:274
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_TIN::TTIN_Triangle::p1
int p1
Definition: tin.h:281
CSG_TIN::TTIN_Triangle::p3
int p3
Definition: tin.h:281
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
sLong
signed long long sLong
Definition: api_core.h:158
CSG_TIN_Node::Get_Y
double Get_Y(void)
Definition: tin.h:102
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
SG_TIN_Compare
int SG_TIN_Compare(const void *pp1, const void *pp2)
Definition: tin_triangulation.cpp:73
IS_IDENTICAL
#define IS_IDENTICAL(a, b)
Definition: tin_triangulation.cpp:370
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_TIN_Node
Definition: tin.h:93
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
CSG_TIN::m_Extent
CSG_Rect m_Extent
Definition: tin.h:290
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_TIN::_Triangulate
bool _Triangulate(void)
Definition: tin_triangulation.cpp:94
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_TIN::_Destroy_Edges
bool _Destroy_Edges(void)
Definition: tin.cpp:254
CSG_TIN::TTIN_Edge::p2
int p2
Definition: tin.h:275
CSG_TIN::_Add_Triangle
bool _Add_Triangle(CSG_TIN_Node *a, CSG_TIN_Node *b, CSG_TIN_Node *c)
Definition: tin.cpp:438
CSG_TIN::_CircumCircle
int _CircumCircle(double xp, double yp, double x1, double y1, double x2, double y2, double x3, double y3, double *xc, double *yc, double *r)
Definition: tin_triangulation.cpp:373
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool.cpp File Reference

  • saga_core
  • saga_api
Macros
tool.cpp File Reference
#include "saga_api.h"
#include "data_manager.h"
#include "tool.h"
#include "tool_chain.h"
#include <wx/string.h>

Go to the source code of this file.

Macros

#define | ADD_MESSAGE_EXECUTION(Text, Style) { SG_UI_Msg_Add(Text, true, Style); if( has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }
#define | _TOOL_EXCEPTION
#define | GET_ID1(p)
#define | GET_ID2(p, s) CSG_String::Format("%s_%s", GET_ID1(p), s).c_str()

Macro Definition Documentation

◆ _TOOL_EXCEPTION

#define _TOOL_EXCEPTION

◆ ADD_MESSAGE_EXECUTION

#define ADD_MESSAGE_EXECUTION | ( | Text,
 |  | Style
 | ) | { SG_UI_Msg_Add(Text, true, Style); if( has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }

◆ GET_ID1

#define GET_ID1 ( p )
Value:
(p->Get_Parameters()->Get_Identifier().Length() > 0 \
? CSG_String::Format("%s_%s", p->Get_Parameters()->Get_Identifier().c_str(), p->Get_Identifier()) \
: CSG_String::Format(p->Get_Identifier())).c_str()

◆ GET_ID2

#define GET_ID2 | ( | p,
 |  | s
 | ) | CSG_String::Format("%s_%s", GET_ID1(p), s).c_str()
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool.cpp Source File

  • saga_core
  • saga_api
tool.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "saga_api.h"
52 #include "data_manager.h"
53 #include "tool.h"
54 #include "tool_chain.h"
55
56 #include <wx/string.h>
57
58
60 // //
61 // //
62 // //
64
65 //---------------------------------------------------------
66 CSG_Tool::CSG_Tool(void)
67 {
68 m_ID = "-1";
69 m_Version = "1.0";
70
71 m_bError_Ignore = false;
72 m_bExecutes = false;
73 m_bWithGUI = true;
74
75 m_pParameters = NULL;
76 m_npParameters = 0;
77
78 Parameters.Create(this, SG_T("Tool"));
79 Parameters.Set_Callback_On_Parameter_Changed(&_On_Parameter_Changed);
80 Parameters.m_pTool = this;
81
82 Set_Show_Progress(true);
83 }
84
85 //---------------------------------------------------------
86 CSG_Tool::~CSG_Tool(void)
87 {
88 if( m_Settings_Stack.Get_Size() > 0 )
89 {
90 for(size_t i=0; i<m_Settings_Stack.Get_uSize(); i++)
91 {
92 delete(((CSG_Parameters **)m_Settings_Stack.Get_Array())[i]);
93 }
94 }
95
96 if( m_pParameters )
97 {
98 for(int i=0; i<m_npParameters; i++)
99 {
100 delete(m_pParameters[i]);
101 }
102
103 SG_Free(m_pParameters);
104 }
105
106 Destroy();
107 }
108
109
111 // //
113
114 //---------------------------------------------------------
115 void CSG_Tool::Destroy(void)
116 {
117 m_bError_Ignore = false;
118
119 History_Supplement.Destroy();
120 }
121
122
124 // //
126
127 //---------------------------------------------------------
128 const CSG_String & CSG_Tool::Get_Library(void) const
129 {
130 return( m_Library );
131 }
132
133 //---------------------------------------------------------
134 const CSG_String & CSG_Tool::Get_File_Name(void) const
135 {
136 return( m_File_Name );
137 }
138
139 //---------------------------------------------------------
140 void CSG_Tool::Set_Name(const CSG_String &String)
141 {
142 Parameters.Set_Name(String);
143 }
144
145 const CSG_String & CSG_Tool::Get_Name(void) const
146 {
147 return( Parameters.Get_Name() );
148 }
149
150 //---------------------------------------------------------
151 void CSG_Tool::Set_Author(const CSG_String &String)
152 {
153 m_Author = String;
154 }
155
156 const CSG_String & CSG_Tool::Get_Author(void) const
157 {
158 return( m_Author );
159 }
160
161 //---------------------------------------------------------
162 void CSG_Tool::Set_Version(const CSG_String &String)
163 {
164 m_Version = String;
165 }
166
167 const CSG_String & CSG_Tool::Get_Version(void) const
168 {
169 return( m_Version );
170 }
171
172 //---------------------------------------------------------
173 void CSG_Tool::Set_Description(const CSG_String &String)
174 {
175 Parameters.Set_Description(String);
176 }
177
178 const CSG_String & CSG_Tool::Get_Description(void) const
179 {
180 return( Parameters.Get_Description().is_Empty() ? Get_Name() : Parameters.Get_Description() );
181 }
182
183 //---------------------------------------------------------
184 void CSG_Tool::Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link, const SG_Char *Link_Text)
185 {
186 Parameters.Add_Reference(Authors, Year, Title, Where, Link, Link_Text);
187 }
188
189 void CSG_Tool::Add_Reference(const CSG_String &Link, const SG_Char *Link_Text)
190 {
191 Parameters.Add_Reference(Link, Link_Text);
192 }
193
194 const CSG_Strings & CSG_Tool::Get_References(void) const
195 {
196 return( Parameters.Get_References() );
197 }
198
199 //---------------------------------------------------------
200 CSG_String CSG_Tool::Get_MenuPath(bool bSolved)
201 {
202 if( !bSolved )
203 {
204 return( Get_MenuPath() );
205 }
206
207 CSG_String Menu = Get_MenuPath();
208
209 if( Menu.Length() > 1 && Menu[1] == ':' )
210 {
211 if( Menu[0] == 'A' || Menu[0] == 'a' ) // absolute menu path, overwrites library's default menu path
212 {
213 return( Menu.AfterFirst(':') );
214 }
215
216 Menu = Menu.AfterFirst(':'); // Menu[0] == 'R' || Menu[0] == 'r' // menu path explicitly declared as relative to library's default menu path
217 }
218
219 if( m_Library_Menu.is_Empty() )
220 {
221 return( Menu );
222 }
223
224 if( Menu.is_Empty() )
225 {
226 return( m_Library_Menu );
227 }
228
229 return( m_Library_Menu + "|" + Menu );
230 }
231
232 //---------------------------------------------------------
233 bool CSG_Tool::has_GUI(void) const
234 {
235 return( m_bWithGUI && SG_UI_Get_Window_Main() != NULL );
236 }
237
238
240 // //
241 // //
242 // //
244
245 //---------------------------------------------------------
246 bool CSG_Tool::Execute(bool bAddHistory)
247 {
248 #define ADD_MESSAGE_EXECUTION(Text, Style) { SG_UI_Msg_Add(Text, true, Style); if( has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }
249
250 //-----------------------------------------------------
251 if( m_bExecutes )
252 {
253 return( false );
254 }
255
256 m_bExecutes = true;
257
258 m_bError_Ignore = false;
259
260 bool bResult = false;
261
262 m_Execution_Info.Clear();
263
264 History_Supplement.Destroy();
265
266 //-----------------------------------------------------
267 if( Parameters.Get_Manager() == &SG_Get_Data_Manager() )
268 {
269 ADD_MESSAGE_EXECUTION(CSG_String::Format("[%s] %s...", Get_Name().c_str(), _TL("Execution started")), SG_UI_MSG_STYLE_SUCCESS);
270 }
271
272 Update_Parameter_States();
273
274 if( Parameters.DataObjects_Create() == false )
275 {
276 _Synchronize_DataObjects(); // not all, but some objects might have been created!
277 }
278 else
279 {
280 Parameters.Msg_String(false);
281
282 // SG_UI_Process_Set_Busy(true, CSG_String::Format("%s: %s...", _TL("Executing"), Get_Name().c_str()));
283 CSG_DateTime Started(CSG_DateTime::Now());
284
286 //#if !defined(_DEBUG)
287 #define _TOOL_EXCEPTION
288 try
289 {
290 //#endif
292
293 bResult = On_Execute();
294
296 #ifdef _TOOL_EXCEPTION
297 } // try
298 catch(const std::exception &Exception)
299 {
300 Message_Dlg(Exception.what() , CSG_String::Format("%s | %s", Get_Name().c_str(), _TL("Access violation!")));
301 }
302 catch(...)
303 {
304 Message_Dlg(_TL("unspecified exception"), CSG_String::Format("%s | %s", Get_Name().c_str(), _TL("Access violation!")));
305 }
306 #endif
307
309 CSG_TimeSpan Span = CSG_DateTime::Now() - Started;
310 // SG_UI_Process_Set_Busy(false);
311
312 _Synchronize_DataObjects();
313
314 if( !Process_Get_Okay(false) )
315 {
316 SG_UI_Msg_Add(_TL("Execution has been stopped by user!"), true, SG_UI_MSG_STYLE_BOLD);
317
318 bResult = false;
319 }
320
321 if( bResult && bAddHistory )
322 {
323 _Set_Output_History();
324 }
325
326 //-------------------------------------------------
327 if( is_Interactive() )
328 {
329 if( bResult )
330 {
331 CSG_String Text(CSG_String::Format("\n%s...", _TL("Interactive tool started and is waiting for user input.")));
332
333 SG_UI_Msg_Add (Text, false, SG_UI_MSG_STYLE_BOLD);
334 SG_UI_Msg_Add_Execution(Text, false, SG_UI_MSG_STYLE_BOLD);
335 }
336 else
337 {
338 ADD_MESSAGE_EXECUTION(_TL("Interactive tool initialization failed."), SG_UI_MSG_STYLE_FAILURE);
339 }
340 }
341 else
342 {
343 CSG_String Time =
344 Span.Get_Hours () >= 1 ? (Span.Format("%Hh %Mm %Ss"))
345 : Span.Get_Minutes () >= 1 ? (Span.Format( "%Mm %Ss"))
346 : Span.Get_Seconds () >= 1 ? (Span.Format( "%Ss"))
347 : Span.Get_Milliseconds() >= 1 ? (Span.Format("%l ") + _TL("milliseconds"))
348 : CSG_String(_TL("less than 1 millisecond"));
349
350 if( Parameters.Get_Manager() != &SG_Get_Data_Manager() )
351 {
352 SG_UI_Msg_Add_Execution(CSG_String::Format("\n[%s] %s: %s", Get_Name().c_str(),
353 _TL("execution time"), Time.c_str()),
354 false, SG_UI_MSG_STYLE_NORMAL
355 );
356 }
357 else
358 {
359 SG_UI_Msg_Add_Execution(CSG_String::Format("\n__________\n%s %s: %lld %s (%s)\n", _TL("total"),
360 _TL("execution time"), Span.Get_Milliseconds(), _TL("milliseconds"), Time.c_str()),
361 false, SG_UI_MSG_STYLE_BOLD
362 );
363
364 ADD_MESSAGE_EXECUTION(CSG_String::Format("[%s] %s (%s)", Get_Name().c_str(),
365 bResult ? _TL("Execution succeeded") : _TL("Execution failed"), Time.c_str()),
366 bResult ? SG_UI_MSG_STYLE_SUCCESS : SG_UI_MSG_STYLE_FAILURE
367 );
368 }
369 }
370 }
371
372 //-----------------------------------------------------
373 History_Supplement.Destroy();
374
375 m_bExecutes = false;
376
377 SG_UI_Process_Set_Okay ();
378 SG_UI_Process_Set_Ready();
379
380 return( bResult );
381 }
382
383
385 // //
386 // //
387 // //
389
390 //---------------------------------------------------------
391 bool CSG_Tool::_Synchronize_DataObjects(void)
392 {
393 Parameters.DataObjects_Synchronize();
394
395 for(int i=0; i<m_npParameters; i++)
396 {
397 m_pParameters[i]->DataObjects_Synchronize();
398 }
399
400 CSG_Projection Projection;
401
402 if( do_Sync_Projections() && Get_Projection(Projection) )
403 {
404 Parameters.DataObjects_Set_Projection(Projection);
405
406 for(int j=0; j<m_npParameters; j++)
407 {
408 m_pParameters[j]->DataObjects_Set_Projection(Projection);
409 }
410
411 return( true );
412 }
413
414 return( false );
415 }
416
417 //---------------------------------------------------------
418 bool CSG_Tool::Get_Projection(CSG_Projection &Projection) const
419 {
420 Projection.Destroy();
421
422 Parameters.DataObjects_Get_Projection(Projection);
423
424 for(int i=0; i<m_npParameters && !Projection.is_Okay(); i++)
425 {
426 m_pParameters[i]->DataObjects_Get_Projection(Projection);
427 }
428
429 return( Projection.is_Okay() );
430 }
431
432
434 // //
435 // Parameters //
436 // //
438
439 //---------------------------------------------------------
440 int CSG_Tool::_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
441 {
442 CSG_Parameters *pParameters = pParameter ? pParameter ->Get_Parameters() : NULL;
443 CSG_Tool *pTool = pParameters ? pParameters->Get_Tool () : NULL;
444
445 if( pTool )
446 {
447 if( Flags & PARAMETER_CHECK_VALUES )
448 {
449 pTool->On_Parameter_Changed(pParameters, pParameter);
450 }
451
452 if( Flags & PARAMETER_CHECK_ENABLE )
453 {
454 pTool->On_Parameters_Enable(pParameters, pParameter);
455 }
456
457 return( 1 );
458 }
459
460 return( 0 );
461 }
462
463 //---------------------------------------------------------
464 int CSG_Tool::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
465 {
466 return( 1 );
467 }
468
469 //---------------------------------------------------------
470 int CSG_Tool::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
471 {
472 return( 1 );
473 }
474
475
477 // //
478 // Extra Parameters //
479 // //
481
482 //---------------------------------------------------------
483 CSG_Parameters * CSG_Tool::Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
484 {
485 CSG_Parameters *pParameters;
486
487 m_pParameters = (CSG_Parameters **)SG_Realloc(m_pParameters, (m_npParameters + 1) * sizeof(CSG_Parameters *));
488 pParameters = m_pParameters[m_npParameters++] = new CSG_Parameters();
489
490 pParameters->Create(this, Name, Description, Identifier);
491 pParameters->Set_Callback_On_Parameter_Changed(&_On_Parameter_Changed);
492 pParameters->m_pTool = this;
493
494 return( pParameters );
495 }
496
497 //---------------------------------------------------------
498 CSG_Parameters * CSG_Tool::Get_Parameters(const CSG_String &Identifier)
499 {
500 for(int i=0; i<m_npParameters; i++)
501 {
502 if( m_pParameters[i]->Cmp_Identifier(Identifier) )
503 {
504 return( m_pParameters[i] );
505 }
506 }
507
508 return( NULL );
509 }
510
511 //---------------------------------------------------------
512 bool CSG_Tool::Dlg_Parameters(const CSG_String &Identifier)
513 {
514 CSG_Parameters *pParameters = Get_Parameters(Identifier);
515
516 if( pParameters && (!pParameters->is_Managed() || Dlg_Parameters(pParameters, Get_Name())) )
517 {
518 pParameters->Set_History(History_Supplement);
519
520 return( true );
521 }
522
523 return( false );
524 }
525
526 //---------------------------------------------------------
527 bool CSG_Tool::Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption)
528 {
529 return( pParameters ? SG_UI_Dlg_Parameters(pParameters, Caption) : false );
530 }
531
532
534 // //
536
537 //---------------------------------------------------------
538 void CSG_Tool::Set_Callback(bool bActive)
539 {
540 Parameters.Set_Callback(bActive);
541
542 for(int i=0; i<m_npParameters; i++)
543 {
544 m_pParameters[i]->Set_Callback(bActive);
545 }
546 }
547
548 //---------------------------------------------------------
549 bool CSG_Tool::Set_Manager(CSG_Data_Manager *pManager)
550 {
551 Parameters.Set_Manager(pManager);
552
553 for(int i=0; i<m_npParameters; i++)
554 {
555 m_pParameters[i]->Set_Manager(pManager);
556 }
557
558 return( true );
559 }
560
561 //---------------------------------------------------------
562 CSG_Data_Manager * CSG_Tool::Get_Manager(void) const
563 {
564 return( Parameters.Get_Manager() );
565 }
566
567 //---------------------------------------------------------
568 CSG_Data_Manager * CSG_Tool::Create_Manager(void)
569 {
570 Set_Manager(new CSG_Data_Manager());
571
572 return( Get_Manager() );
573 }
574
575 //---------------------------------------------------------
576 bool CSG_Tool::Delete_Manager(bool bDetachData, bool bReset)
577 {
578 CSG_Data_Manager *pManager = Get_Manager();
579
580 if( pManager && pManager != &SG_Get_Data_Manager() )
581 {
582 pManager->Delete_All(bDetachData);
583
584 delete(pManager);
585
586 return( bReset ? Set_Manager(&SG_Get_Data_Manager()) : Set_Manager(NULL) );
587 }
588
589 return( false );
590 }
591
592
594 // //
595 // //
596 // //
598
599 //---------------------------------------------------------
600 bool CSG_Tool::Settings_Push(CSG_Data_Manager *pManager)
601 {
602 if( m_Settings_Stack.Get_Value_Size() != sizeof(CSG_Parameters *) )
603 {
604 m_Settings_Stack.Create(sizeof(CSG_Parameters *));
605 }
606
607 size_t n = m_Settings_Stack.Get_Size();
608
609 CSG_Parameters **pP = (CSG_Parameters **)m_Settings_Stack.Get_Array(n + 1 + m_npParameters);
610
611 if( pP )
612 {
613 pP[n++] = new CSG_Parameters(Parameters); Parameters.Restore_Defaults(true); Parameters.Set_Manager(pManager);
614
615 for(int i=0; i<m_npParameters; i++)
616 {
617 pP[n++] = new CSG_Parameters(*m_pParameters[i]); m_pParameters[i]->Restore_Defaults(true); m_pParameters[i]->Set_Manager(pManager);
618 }
619
620 return( true );
621 }
622
623 return( false );
624 }
625
626 //---------------------------------------------------------
627 bool CSG_Tool::Settings_Pop(void)
628 {
629 CSG_Parameters **pP = (CSG_Parameters **)m_Settings_Stack.Get_Array();
630
631 if( pP && (int)m_Settings_Stack.Get_Size() >= 1 + m_npParameters )
632 {
633 size_t n = m_Settings_Stack.Get_Size() - 1;
634
635 for(int i=m_npParameters-1; i>=0; i--, n--)
636 {
637 m_pParameters[i]->Assign_Values(pP[n]); m_pParameters[i]->Set_Manager(pP[n]->Get_Manager()); delete(pP[n]);
638 }
639
640 Parameters.Assign_Values(pP[n]); Parameters.Set_Manager(pP[n]->Get_Manager()); delete(pP[n]);
641
642 m_Settings_Stack.Set_Array(n);
643
644 return( true );
645 }
646
647 return( false );
648 }
649
650
652 // //
653 // Progress //
654 // //
656
657 //---------------------------------------------------------
658 void CSG_Tool::Set_Show_Progress(bool bOn)
659 {
660 m_bShow_Progress = bOn;
661 }
662
663 //---------------------------------------------------------
664 bool CSG_Tool::Set_Progress(int Position, int Range) const
665 {
666 return( Set_Progress((double)Position / (double)Range) );
667 }
668
669 //---------------------------------------------------------
670 bool CSG_Tool::Set_Progress(sLong Position, sLong Range) const
671 {
672 return( Set_Progress((double)Position / (double)Range) );
673 }
674
675 //---------------------------------------------------------
676 bool CSG_Tool::Set_Progress(double Position, double Range) const
677 {
678 return( m_bShow_Progress ? SG_UI_Process_Set_Progress(Position, Range) : Process_Get_Okay(false) );
679 }
680
681 //---------------------------------------------------------
682 bool CSG_Tool::Stop_Execution(bool bDialog)
683 {
684 m_bExecutes = false;
685
686 return( SG_UI_Stop_Execution(bDialog) );
687 }
688
689
691 // //
692 // Message //
693 // //
695
696 //---------------------------------------------------------
697 void CSG_Tool::Message_Dlg(const CSG_String &Text, const SG_Char *Caption)
698 {
699 SG_UI_Dlg_Message(Text, Caption && Caption[0] != '\0' ? Caption : Get_Name().c_str());
700 }
701
702 //---------------------------------------------------------
703 bool CSG_Tool::Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption)
704 {
705 return( SG_UI_Dlg_Continue(Text, Caption && Caption[0] != '\0' ? Caption : Get_Name().c_str()) );
706 }
707
708 //---------------------------------------------------------
709 bool CSG_Tool::Error_Set(TSG_Tool_Error Error_ID)
710 {
711 switch( Error_ID )
712 {
713 default:
714 return( Error_Set(_TL("Unknown Error")) );
715
716 case TOOL_ERROR_Calculation:
717 return( Error_Set(_TL("Calculation Error")) );
718 }
719 }
720
721 //---------------------------------------------------------
722 bool CSG_Tool::Error_Set(const CSG_String &Text)
723 {
724 SG_UI_Msg_Add_Error(Text);
725
726 m_Execution_Info += "\n____\n" + Text;
727
728 if( SG_UI_Process_Get_Okay(false) && !m_bError_Ignore )
729 {
730 switch( SG_UI_Dlg_Error(Text, CSG_String::Format("%s: %s?", _TL("Error"), _TL("Ignore"))) )
731 {
732 default:
733 SG_UI_Process_Set_Okay(false);
734 break;
735
736 case 1:
737 m_bError_Ignore = true;
738 break;
739 }
740 }
741
742 return( SG_UI_Process_Get_Okay(false) );
743 }
744
745 //---------------------------------------------------------
746 bool CSG_Tool::Error_Fmt(const char *Format, ...)
747 {
748 wxString _s;
749
750 va_list argptr;
751
752 #ifdef _SAGA_LINUX
753 // workaround as we only use wide characters
754 // since wx 2.9.4 so interpret strings as multibyte
755 wxString _Format(Format); _Format.Replace("%s", "%ls");
756 va_start(argptr, _Format);
757 _s.PrintfV(_Format, argptr);
758 #else
759 va_start(argptr, Format);
760 _s.PrintfV(Format, argptr);
761 #endif
762
763 va_end(argptr);
764
765 CSG_String s(&_s);
766
767 return( Error_Set(s) );
768 }
769
770 //---------------------------------------------------------
771 bool CSG_Tool::Error_Fmt(const wchar_t *Format, ...)
772 {
773 wxString _s;
774
775 va_list argptr;
776
777 #ifdef _SAGA_LINUX
778 // workaround as we only use wide characters
779 // since wx 2.9.4 so interpret strings as multibyte
780 wxString _Format(Format); _Format.Replace("%s", "%ls");
781 va_start(argptr, _Format);
782 _s.PrintfV(_Format, argptr);
783 #else
784 va_start(argptr, Format);
785 _s.PrintfV(Format, argptr);
786 #endif
787
788 va_end(argptr);
789
790 CSG_String s(&_s);
791
792 return( Error_Set(s) );
793 }
794
795
797 // //
798 // DataObjects / GUI Interaction //
799 // //
801
802 //---------------------------------------------------------
803 bool CSG_Tool::DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate)
804 {
805 if( Parameters.Get_Manager() )
806 {
807 Parameters.Get_Manager()->Add(pDataObject);
808 }
809
810 if( Parameters.Get_Manager() == &SG_Get_Data_Manager() ) // prevent that local data manager send their data objects to gui
811 {
812 return( SG_UI_DataObject_Add(pDataObject, bUpdate) );
813 }
814
815 return( true );
816 }
817
818 //---------------------------------------------------------
819 void CSG_Tool::DataObject_Update_All(void)
820 {
821 for(int i=0; i<Parameters.Get_Count(); i++)
822 {
823 if( Parameters(i)->is_Output() )
824 {
825 if( Parameters(i)->is_DataObject() )
826 {
827 DataObject_Update(Parameters(i)->asDataObject(), false);
828 }
829 else if( Parameters(i)->is_DataObject_List() )
830 {
831 for(int j=0; j<Parameters(i)->asList()->Get_Item_Count(); j++)
832 {
833 DataObject_Update(Parameters(i)->asList()->Get_Item(j), false);
834 }
835 }
836 }
837 }
838 }
839
840
842 // //
843 // Static Data Message/Progress Functions //
844 // //
846
847 //---------------------------------------------------------
848 bool CSG_Tool::Process_Get_Okay(bool bBlink)
849 {
850 return( SG_UI_Process_Get_Okay(bBlink) );
851 }
852
853 //---------------------------------------------------------
854 void CSG_Tool::Process_Set_Text(const CSG_String &Text)
855 {
856 SG_UI_Process_Set_Text(Text);
857 }
858
859 //---------------------------------------------------------
860 void CSG_Tool::Process_Set_Text(const char *Format, ...)
861 {
862 wxString _s;
863
864 va_list argptr;
865
866 #ifdef _SAGA_LINUX
867 // workaround as we only use wide characters
868 // since wx 2.9.4 so interpret strings as multibyte
869 wxString _Format(Format); _Format.Replace("%s", "%ls");
870 va_start(argptr, _Format);
871 _s.PrintfV(_Format, argptr);
872 #else
873 va_start(argptr, Format);
874 _s.PrintfV(Format, argptr);
875 #endif
876
877 va_end(argptr);
878
879 CSG_String s(&_s);
880
881 SG_UI_Process_Set_Text(s);
882 }
883
884 //---------------------------------------------------------
885 void CSG_Tool::Process_Set_Text(const wchar_t *Format, ...)
886 {
887 wxString _s;
888
889 va_list argptr;
890
891 #ifdef _SAGA_LINUX
892 // workaround as we only use wide characters
893 // since wx 2.9.4 so interpret strings as multibyte
894 wxString _Format(Format); _Format.Replace("%s", "%ls");
895 va_start(argptr, _Format);
896 _s.PrintfV(_Format, argptr);
897 #else
898 va_start(argptr, Format);
899 _s.PrintfV(Format, argptr);
900 #endif
901
902 va_end(argptr);
903
904 CSG_String s(&_s);
905
906 SG_UI_Process_Set_Text(s);
907 }
908
909 //---------------------------------------------------------
910 void CSG_Tool::Message_Add(const CSG_String &Text, bool bNewLine)
911 {
912 SG_UI_Msg_Add_Execution(Text, bNewLine);
913
914 if( bNewLine )
915 {
916 m_Execution_Info += "\n";
917 }
918
919 m_Execution_Info += Text;
920 }
921
922 //---------------------------------------------------------
923 void CSG_Tool::Message_Fmt(const char *Format, ...)
924 {
925 wxString _s;
926
927 va_list argptr;
928
929 #ifdef _SAGA_LINUX
930 // workaround as we only use wide characters
931 // since wx 2.9.4 so interpret strings as multibyte
932 wxString _Format(Format); _Format.Replace("%s", "%ls");
933 va_start(argptr, _Format);
934 _s.PrintfV(_Format, argptr);
935 #else
936 va_start(argptr, Format);
937 _s.PrintfV(Format, argptr);
938 #endif
939
940 va_end(argptr);
941
942 CSG_String s(&_s);
943
944 Message_Add(s, false);
945 }
946
947 //---------------------------------------------------------
948 void CSG_Tool::Message_Fmt(const wchar_t *Format, ...)
949 {
950 wxString _s;
951
952 va_list argptr;
953
954 #ifdef _SAGA_LINUX
955 // workaround as we only use wide characters
956 // since wx 2.9.4 so interpret strings as multibyte
957 wxString _Format(Format); _Format.Replace("%s", "%ls");
958 va_start(argptr, _Format);
959 _s.PrintfV(_Format, argptr);
960 #else
961 va_start(argptr, Format);
962 _s.PrintfV(Format, argptr);
963 #endif
964
965 va_end(argptr);
966
967 CSG_String s(&_s);
968
969 Message_Add(s, false);
970 }
971
972
974 // //
975 // Static Data Object Property Functions //
976 // //
978
979 //---------------------------------------------------------
980 bool CSG_Tool::DataObject_Update(CSG_Data_Object *pDataObject, int Show)
981 {
982 return( SG_UI_DataObject_Update(pDataObject, Show, NULL) );
983 }
984
985 bool CSG_Tool::DataObject_Update(CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show)
986 {
987 CSG_Parameters P;
988
989 return( DataObject_Get_Parameters(pDataObject, P)
990 && P.Set_Parameter("STRETCH_UPDATE" , false ) // internal update flag
991 && P.Set_Parameter("STRETCH_DEFAULT" , 3 ) // manual
992 && P.Set_Parameter("METRIC_ZRANGE.MIN", Minimum)
993 && P.Set_Parameter("METRIC_ZRANGE.MAX", Maximum)
994 && SG_UI_DataObject_Update(pDataObject, Show, &P)
995 );
996 }
997
998 //---------------------------------------------------------
999 bool CSG_Tool::DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors)
1000 {
1001 return( SG_UI_DataObject_Colors_Get(pDataObject, &Colors) );
1002 }
1003
1004 bool CSG_Tool::DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
1005 {
1006 CSG_Colors c(Colors);
1007
1008 return( SG_UI_DataObject_Colors_Set(pDataObject, &c) );
1009 }
1010
1011 bool CSG_Tool::DataObject_Set_Colors(CSG_Data_Object *pDataObject, int nColors, int Palette, bool bRevert)
1012 {
1013 CSG_Colors c(nColors, Palette, bRevert);
1014
1015 return( SG_UI_DataObject_Colors_Set(pDataObject, &c) );
1016 }
1017
1018 //---------------------------------------------------------
1019 bool CSG_Tool::DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
1020 {
1021 return( SG_UI_DataObject_Params_Get(pDataObject, &Parameters) );
1022 }
1023
1024 bool CSG_Tool::DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
1025 {
1026 return( SG_UI_DataObject_Params_Set(pDataObject, &Parameters) );
1027 }
1028
1029 bool CSG_Tool::DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy)
1030 {
1031 if( pDataObject == pCopy )
1032 {
1033 return( true );
1034 }
1035
1036 CSG_Parameters P;
1037
1038 if( DataObject_Get_Parameters(pCopy, P) )
1039 {
1040 P.Del_Parameter("OBJECT_NODATA" );
1041 P.Del_Parameter("OBJECT_Z_FACTOR");
1042 P.Del_Parameter("OBJECT_Z_OFFSET");
1043
1044 return( DataObject_Set_Parameters(pDataObject, P) );
1045 }
1046
1047 return( false );
1048 }
1049
1050 //---------------------------------------------------------
1051 CSG_Parameter * CSG_Tool::DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID)
1052 {
1053 static CSG_Parameters P;
1054
1055 return( DataObject_Get_Parameters(pDataObject, P) ? P(ID) : NULL );
1056 }
1057
1058 bool CSG_Tool::DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
1059 {
1060 CSG_Parameters P;
1061
1062 return( P._Add(pParameter) != NULL && DataObject_Set_Parameters(pDataObject, P) );
1063 }
1064
1065 bool CSG_Tool::DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID)
1066 {
1067 CSG_Parameter *pParameter = DataObject_Get_Parameter(pCopy, ID);
1068
1069 return( DataObject_Set_Parameter(pDataObject, pParameter) );
1070 }
1071
1072 bool CSG_Tool::DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value)
1073 {
1074 CSG_Parameters P;
1075
1076 if( DataObject_Get_Parameters(pDataObject, P) && P(ID) )
1077 {
1078 return( P(ID)->Set_Value(Value) && DataObject_Set_Parameter(pDataObject, P(ID)) );
1079 }
1080
1081 return( false );
1082 }
1083
1084 bool CSG_Tool::DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value)
1085 {
1086 CSG_Parameters P;
1087
1088 if( DataObject_Get_Parameters(pDataObject, P) && P(ID) )
1089 {
1090 return( P(ID)->Set_Value(Value) && DataObject_Set_Parameter(pDataObject, P(ID)) );
1091 }
1092
1093 return( false );
1094 }
1095
1096 bool CSG_Tool::DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value)
1097 {
1098 CSG_Parameters P;
1099
1100 if( DataObject_Get_Parameters(pDataObject, P) && P(ID) )
1101 {
1102 return( P(ID)->Set_Value(Value) && DataObject_Set_Parameter(pDataObject, P(ID)) );
1103 }
1104
1105 return( false );
1106 }
1107
1108 bool CSG_Tool::DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value)
1109 {
1110 CSG_Parameters P;
1111
1112 if( DataObject_Get_Parameters(pDataObject, P) && P(ID) )
1113 {
1114 return( P(ID)->Set_Value(Value) && DataObject_Set_Parameter(pDataObject, P(ID)) );
1115 }
1116
1117 return( false );
1118 }
1119
1120 bool CSG_Tool::DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal) // Range Parameter
1121 {
1122 CSG_Parameters P;
1123
1124 if( DataObject_Get_Parameters(pDataObject, P) && P(ID) && P(ID)->Get_Type() == PARAMETER_TYPE_Range )
1125 {
1126 return( P(ID)->asRange()->Set_Range(loVal, hiVal) && DataObject_Set_Parameter(pDataObject, P(ID)) );
1127 }
1128
1129 return( false );
1130 }
1131
1132
1134 // //
1135 // //
1136 // //
1138
1139 //---------------------------------------------------------
1143 //---------------------------------------------------------
1144 bool CSG_Tool::Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue) { return( Parameters.Set_Parameter(ID, pValue) ); }
1145 bool CSG_Tool::Set_Parameter(const char *ID, CSG_Parameter *pValue) { return( Parameters.Set_Parameter(ID, pValue) ); }
1146 bool CSG_Tool::Set_Parameter(const wchar_t *ID, CSG_Parameter *pValue) { return( Parameters.Set_Parameter(ID, pValue) ); }
1147
1148 //---------------------------------------------------------
1152 //---------------------------------------------------------
1153 bool CSG_Tool::Set_Parameter(const CSG_String &ID, int Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1154 bool CSG_Tool::Set_Parameter(const char *ID, int Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1155 bool CSG_Tool::Set_Parameter(const wchar_t *ID, int Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1156
1157 //---------------------------------------------------------
1161 //---------------------------------------------------------
1162 bool CSG_Tool::Set_Parameter(const CSG_String &ID, double Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1163 bool CSG_Tool::Set_Parameter(const char *ID, double Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1164 bool CSG_Tool::Set_Parameter(const wchar_t *ID, double Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1165
1166 //---------------------------------------------------------
1170 //---------------------------------------------------------
1171 bool CSG_Tool::Set_Parameter(const CSG_String &ID, void *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1172 bool CSG_Tool::Set_Parameter(const char *ID, void *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1173 bool CSG_Tool::Set_Parameter(const wchar_t *ID, void *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1174
1175 //---------------------------------------------------------
1179 //---------------------------------------------------------
1180 bool CSG_Tool::Set_Parameter(const CSG_String &ID, const CSG_String &Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1181 bool CSG_Tool::Set_Parameter(const char *ID, const CSG_String &Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1182 bool CSG_Tool::Set_Parameter(const wchar_t *ID, const CSG_String &Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1183
1184 //---------------------------------------------------------
1188 //---------------------------------------------------------
1189 bool CSG_Tool::Set_Parameter(const CSG_String &ID, const char *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1190 bool CSG_Tool::Set_Parameter(const char *ID, const char *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1191 bool CSG_Tool::Set_Parameter(const wchar_t *ID, const char *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1192
1193 //---------------------------------------------------------
1197 //---------------------------------------------------------
1198 bool CSG_Tool::Set_Parameter(const CSG_String &ID, const wchar_t *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1199 bool CSG_Tool::Set_Parameter(const char *ID, const wchar_t *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1200 bool CSG_Tool::Set_Parameter(const wchar_t *ID, const wchar_t *Value, int Type) { return( Parameters.Set_Parameter(ID, Value, Type) ); }
1201
1202
1204 // //
1205 // //
1206 // //
1208
1209 //---------------------------------------------------------
1215 bool CSG_Tool::Reset(bool bManager)
1216 {
1217 Reset_Grid_System();
1218
1219 if( bManager )
1220 {
1221 Reset_Manager();
1222 }
1223
1224 for(int i=0; i<m_npParameters; i++)
1225 {
1226 m_pParameters[i]->Restore_Defaults(true);
1227 }
1228
1229 return( Parameters.Restore_Defaults(true) );
1230 }
1231
1232 //---------------------------------------------------------
1237 bool CSG_Tool::Reset_Manager(void)
1238 {
1239 return( Set_Manager(&SG_Get_Data_Manager()) );
1240 }
1241
1242 //---------------------------------------------------------
1247 bool CSG_Tool::Reset_Grid_System(void)
1248 {
1249 for(int i=0; i<m_npParameters; i++)
1250 {
1251 m_pParameters[i]->Reset_Grid_System();
1252 }
1253
1254 return( Parameters.Reset_Grid_System() );
1255 }
1256
1257 //---------------------------------------------------------
1262 bool CSG_Tool::Set_Grid_System(const CSG_Grid_System &System)
1263 {
1264 return( Parameters.Set_Grid_System(System) );
1265 }
1266
1267 //---------------------------------------------------------
1272 CSG_Grid_System * CSG_Tool::Get_Grid_System(void) const
1273 {
1274 return( Parameters.Get_Grid_System() );
1275 }
1276
1277
1279 // //
1280 // //
1281 // //
1283
1284 //---------------------------------------------------------
1285 bool CSG_Tool::Update_Parameter_States(void)
1286 {
1287 _Update_Parameter_States(&Parameters);
1288
1289 for(int i=0; i<Get_Parameters_Count(); i++)
1290 {
1291 _Update_Parameter_States(Get_Parameters(i));
1292 }
1293
1294 return( true );
1295 }
1296
1297 //---------------------------------------------------------
1298 void CSG_Tool::_Update_Parameter_States(CSG_Parameters *pParameters)
1299 {
1300 if( pParameters )
1301 {
1302 for(int i=0; i<pParameters->Get_Count(); i++)
1303 {
1304 CSG_Parameter *pParameter = pParameters->Get_Parameter(i);
1305
1306 if( pParameter->Get_Type() == PARAMETER_TYPE_Parameters )
1307 {
1308 _Update_Parameter_States(pParameter->asParameters());
1309 }
1310 else
1311 {
1312 On_Parameters_Enable(pParameters, pParameter);
1313 }
1314 }
1315 }
1316 }
1317
1318
1320 // //
1321 // Script //
1322 // //
1324
1325 //---------------------------------------------------------
1326 CSG_String CSG_Tool::Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters)
1327 {
1328 switch( Type )
1329 {
1330 case TOOL_SCRIPT_CMD_SHELL : return( _Get_Script_CMD ( bHeader, bAllParameters, Type) );
1331 case TOOL_SCRIPT_CMD_BATCH : return( _Get_Script_CMD ( bHeader, bAllParameters, Type) );
1332 case TOOL_SCRIPT_CHAIN : return( CSG_Tool_Chain::Get_Script(this, bHeader, bAllParameters ) );
1333 case TOOL_SCRIPT_PYTHON : return( _Get_Script_Python ( bHeader, bAllParameters ) );
1334 case TOOL_SCRIPT_PYTHON_WRAP_NAME : return( _Get_Script_Python_Wrap ( bHeader, true , false ) );
1335 case TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL: return( _Get_Script_Python_Wrap ( bHeader, true , true ) );
1336 case TOOL_SCRIPT_PYTHON_WRAP_ID : return( _Get_Script_Python_Wrap ( bHeader, false, false ) );
1337 case TOOL_SCRIPT_PYTHON_WRAP_ID_CALL : return( _Get_Script_Python_Wrap ( bHeader, false, true ) );
1338 }
1339
1340 return( "" );
1341 }
1342
1343
1345 // //
1347
1348 //---------------------------------------------------------
1349 CSG_String CSG_Tool::_Get_Script_CMD(bool bHeader, bool bAllParameters, TSG_Tool_Script_Type Type)
1350 {
1351 CSG_String Script;
1352
1353 if( bHeader )
1354 {
1355 switch( Type )
1356 {
1357 case TOOL_SCRIPT_CMD_BATCH: // DOS/Windows Batch Script
1358 Script += "@ECHO OFF\n\n";
1359 Script += "PUSHD %~dp0\n\n";
1360 Script += "REM SET SAGA_TLB=C:\\MyTools\n\n";
1361 Script += "SET SAGA_CMD=" + SG_UI_Get_Application_Path(true) + "saga_cmd.exe\n\n";
1362 Script += "REM Tool: " + Get_Name() + "\n\n";
1363 Script += "%SAGA_CMD%";
1364 break;
1365
1366 default : // Bash Shell Script
1367 Script += "#!/bin/bash\n\n";
1368 Script += "# export SAGA_TLB=/home/myhome/mytools\n\n";
1369 Script += "# tool: " + Get_Name() + "\n\n";
1370 Script += "saga_cmd";
1371 break;
1372 }
1373 }
1374 else
1375 {
1376 Script += "saga_cmd";
1377 }
1378
1379 //-----------------------------------------------------
1380 Script += Get_Library().Contains(" ") // white space? use quotation marks!
1381 ? " \"" + Get_Library() + "\""
1382 : " " + Get_Library();
1383
1384 Script += Get_ID().Contains (" ") // white space? use quotation marks!
1385 ? " \"" + Get_ID () + "\""
1386 : " " + Get_ID ();
1387
1388 _Get_Script_CMD(Script, Get_Parameters(), bAllParameters, Type);
1389
1390 for(int i=0; i<Get_Parameters_Count(); i++)
1391 {
1392 _Get_Script_CMD(Script, Get_Parameters(i), bAllParameters, Type);
1393 }
1394
1395 //-----------------------------------------------------
1396 if( bHeader && Type == TOOL_SCRIPT_CMD_BATCH )
1397 {
1398 Script += "\n\nPAUSE\n";
1399 }
1400
1401 return( Script );
1402 }
1403
1404 //---------------------------------------------------------
1405 void CSG_Tool::_Get_Script_CMD(CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, TSG_Tool_Script_Type Type)
1406 {
1407 #define GET_ID1(p) (p->Get_Parameters()->Get_Identifier().Length() > 0 \
1408 ? CSG_String::Format("%s_%s", p->Get_Parameters()->Get_Identifier().c_str(), p->Get_Identifier()) \
1409 : CSG_String::Format(p->Get_Identifier())).c_str()
1410
1411 #define GET_ID2(p, s) CSG_String::Format("%s_%s", GET_ID1(p), s).c_str()
1412
1413 CSG_String Prefix;
1414
1415 switch( Type )
1416 {
1417 case TOOL_SCRIPT_CMD_BATCH: Prefix = " ^\n -" ; break;
1418 default : Prefix = " \\\n -"; break;
1419 }
1420
1421 //-----------------------------------------------------
1422 for(int iParameter=0; iParameter<pParameters->Get_Count(); iParameter++)
1423 {
1424 CSG_Parameter *p = pParameters->Get_Parameter(iParameter);
1425
1426 if( !bAllParameters && (!p->is_Enabled(false) || p->is_Information() || !p->do_UseInCMD()) )
1427 {
1428 continue;
1429 }
1430
1431 switch( p->Get_Type() )
1432 {
1433 default:
1434 break;
1435
1436 case PARAMETER_TYPE_Bool :
1437 Script += Prefix + CSG_String::Format("%s=%d", GET_ID1(p), p->asBool() ? 1 : 0);
1438 break;
1439
1440 case PARAMETER_TYPE_Int :
1441 case PARAMETER_TYPE_Data_Type :
1442 case PARAMETER_TYPE_Choice :
1443 case PARAMETER_TYPE_Table_Field :
1444 Script += Prefix + CSG_String::Format("%s=%d", GET_ID1(p), p->asInt());
1445 break;
1446
1447 case PARAMETER_TYPE_Choices :
1448 case PARAMETER_TYPE_Table_Fields:
1449 if( p->asString() && *p->asString() )
1450 Script += Prefix + CSG_String::Format("%s=%s", GET_ID1(p), p->asString());
1451 break;
1452
1453 case PARAMETER_TYPE_Color :
1454 Script += Prefix + CSG_String::Format("%s=\"%s\"", GET_ID1(p), SG_Color_To_Text(p->asColor()).c_str());
1455 break;
1456
1457 case PARAMETER_TYPE_Double :
1458 case PARAMETER_TYPE_Degree :
1459 Script += Prefix + CSG_String::Format("%s=%g", GET_ID1(p), p->asDouble());
1460 break;
1461
1462 case PARAMETER_TYPE_Range :
1463 Script += Prefix + CSG_String::Format("%s=%g", GET_ID2(p, SG_T("MIN")), p->asRange()->Get_Min());
1464 Script += Prefix + CSG_String::Format("%s=%g", GET_ID2(p, SG_T("MAX")), p->asRange()->Get_Max());
1465 break;
1466
1467 case PARAMETER_TYPE_String :
1468 if( ((CSG_Parameter_String *)p)->is_Password() )
1469 {
1470 Script += Prefix + CSG_String::Format("%s=\"***\"", GET_ID1(p));
1471 break;
1472 }
1473
1474 case PARAMETER_TYPE_Date :
1475 case PARAMETER_TYPE_Text :
1476 case PARAMETER_TYPE_FilePath :
1477 Script += Prefix + CSG_String::Format("%s=\"%s\"", GET_ID1(p), p->asString());
1478 break;
1479
1480 case PARAMETER_TYPE_FixedTable :
1481 Script += Prefix + CSG_String::Format("%s=%s", GET_ID1(p), p->asString());
1482 break;
1483
1484 case PARAMETER_TYPE_Grid_System :
1485 if( p->Get_Children_Count() == 0 )
1486 {
1487 Script += Prefix + CSG_String::Format("%s=%d", GET_ID2(p, SG_T("NX")), p->asGrid_System()->Get_NX());
1488 Script += Prefix + CSG_String::Format("%s=%d", GET_ID2(p, SG_T("NY")), p->asGrid_System()->Get_NY());
1489 Script += Prefix + CSG_String::Format("%s=%g", GET_ID2(p, SG_T( "X")), p->asGrid_System()->Get_XMin());
1490 Script += Prefix + CSG_String::Format("%s=%g", GET_ID2(p, SG_T( "Y")), p->asGrid_System()->Get_YMin());
1491 Script += Prefix + CSG_String::Format("%s=%g", GET_ID2(p, SG_T( "D")), p->asGrid_System()->Get_Cellsize());
1492 }
1493 break;
1494
1495 case PARAMETER_TYPE_DataObject_Output:
1496 case PARAMETER_TYPE_Grid :
1497 case PARAMETER_TYPE_Grids :
1498 case PARAMETER_TYPE_Table :
1499 case PARAMETER_TYPE_Shapes :
1500 case PARAMETER_TYPE_TIN :
1501 case PARAMETER_TYPE_PointCloud :
1502 if( p->is_Input() )
1503 {
1504 Script += Prefix + CSG_String::Format("%s=\"%s\"", GET_ID1(p), SG_Get_Data_Manager().Exists(p->asDataObject()) && p->asDataObject()->Get_File_Name() ? p->asDataObject()->Get_File_Name() : SG_T("input file"));
1505 }
1506 else
1507 {
1508 CSG_String ext;
1509
1510 switch( p->Get_DataObject_Type() )
1511 {
1512 case SG_DATAOBJECT_TYPE_Grid : ext = "sg-grd-z"; break;
1513 case SG_DATAOBJECT_TYPE_Grids : ext = "sg-gds-z"; break;
1514 case SG_DATAOBJECT_TYPE_Table : ext = "txt" ; break;
1515 case SG_DATAOBJECT_TYPE_Shapes : ext = "geojson" ; break;
1516 case SG_DATAOBJECT_TYPE_PointCloud: ext = "sg-pts-z"; break;
1517 case SG_DATAOBJECT_TYPE_TIN : ext = "geojson" ; break;
1518 default : ext = "dat" ; break;
1519 }
1520
1521 Script += Prefix + CSG_String::Format("%s=\"%s.%s\"", GET_ID1(p), p->Get_Name(), ext.c_str());
1522 }
1523 break;
1524
1525 case PARAMETER_TYPE_Grid_List :
1526 case PARAMETER_TYPE_Grids_List :
1527 case PARAMETER_TYPE_Table_List :
1528 case PARAMETER_TYPE_Shapes_List :
1529 case PARAMETER_TYPE_TIN_List :
1530 case PARAMETER_TYPE_PointCloud_List :
1531 if( p->is_Input() )
1532 {
1533 Script += Prefix + CSG_String::Format("%s=", GET_ID1(p));
1534
1535 if( p->asList()->Get_Item_Count() == 0 )
1536 {
1537 Script += "file(s)";
1538 }
1539 else
1540 {
1541 Script += SG_File_Exists(p->asList()->Get_Item(0)->Get_File_Name())
1542 ? p->asList()->Get_Item(0)->Get_File_Name() : _TL("memory");
1543
1544 for(int iObject=1; iObject<p->asList()->Get_Item_Count(); iObject++)
1545 {
1546 Script += ";";
1547 Script += SG_File_Exists(p->asList()->Get_Item(iObject)->Get_File_Name())
1548 ? p->asList()->Get_Item(iObject)->Get_File_Name() : _TL("memory");
1549 }
1550 }
1551 }
1552 else
1553 {
1554 Script += Prefix + CSG_String::Format("%s=\"%s\"", GET_ID1(p), p->Get_Name());
1555 }
1556 break;
1557 }
1558 }
1559 }
1560
1561
1563 // //
1565
1566 //---------------------------------------------------------
1567 CSG_String CSG_Tool::_Get_Script_Python(bool bHeader, bool bAllParameters)
1568 {
1569 CSG_String Script, Name(Get_Name());
1570
1571 Name.Replace(" ", "_");
1572 Name.Replace("(", "");
1573 Name.Replace(")", "");
1574 Name.Replace("[", "");
1575 Name.Replace("]", "");
1576 Name.Replace(".", "");
1577 Name.Replace(",", "");
1578 Name.Replace("/", "");
1579 Name.Replace("-", "");
1580
1581 //-----------------------------------------------------
1582 if( bHeader )
1583 {
1584 Script += "#! /usr/bin/env python\n";
1585 Script += "\n";
1586 Script += "#_________________________________________\n";
1587 Script += "##########################################\n";
1588 Script += "\n";
1589 #ifdef _SAGA_MSW
1590 CSG_String AppPath = SG_UI_Get_Application_Path(true); AppPath.Replace("\\", "/");
1591 Script += "# Initialize the environment...\n";
1592 Script += "\n";
1593 Script += "# Windows: Let the 'SAGA_PATH' environment variable point to\n";
1594 Script += "# the SAGA installation folder before importing 'saga_api'!\n";
1595 Script += "# This can be defined globally in the Windows system or\n";
1596 Script += "# user environment variable settings, in the 'PySAGA/__init__.py'\n";
1597 Script += "# file, or in the individual Python script itself. To do the latter\n";
1598 Script += "# just uncomment the following line and adjust the path accordingly:\n";
1599 Script += "###import os; os.environ['SAGA_PATH'] = '" + AppPath + "'\n";
1600 Script += "\n";
1601 Script += "# Windows: The most convenient way to make PySAGA available to all your\n";
1602 Script += "# Python scripts is to copy the PySAGA folder to the 'Lib/site-packages/'\n";
1603 Script += "# folder of your Python installation. If don't want to do this or if you\n";
1604 Script += "# don't have the rights to do so, you can also copy it to the folder with\n";
1605 Script += "# the Python scripts in which you want to use PySAGA, or alternatively\n";
1606 Script += "# you can add the path containing the PySAGA folder (e.g. the path to your\n";
1607 Script += "# SAGA installation) to the PYTHONPATH environment variable. To do this\n";
1608 Script += "# from within your script you can also take the following command (just\n";
1609 Script += "# uncomment the following line and adjust the path accordingly):\n";
1610 Script += "###import sys; sys.path.insert(1, '" + AppPath + "')\n";
1611 Script += "\n";
1612 #endif // _SAGA_MSW
1613 Script += "# Import saga_api from PySAGA:\n";
1614 Script += "from PySAGA import saga_api\n";
1615 Script += "\n";
1616 Script += "\n";
1617 Script += "#_________________________________________\n";
1618 Script += "##########################################\n";
1619 Script += "def Run_" + Name + "(Results):\n";
1620 }
1621
1622 //-----------------------------------------------------
1623 if( bHeader ) Script += " # Get the tool:\n";
1624 Script += " Tool = saga_api.SG_Get_Tool_Library_Manager().Get_Tool('" + Get_Library() + "', '" + Get_ID() + "')\n";
1625 Script += " if not Tool:\n";
1626 Script += " saga_api.SG_UI_Msg_Add_Error('Failed to request tool: " + Get_Name() + "')\n";
1627 Script += " return False\n";
1628 Script += "\n";
1629 if( bHeader ) Script += " # Set the parameter interface:\n";
1630 Script += " Tool.Reset()\n";
1631
1632 //-------------------------------------------------
1633 _Get_Script_Python(Script, Get_Parameters(), bAllParameters);
1634
1635 for(int iParameters=0; iParameters<Get_Parameters_Count(); iParameters++)
1636 {
1637 _Get_Script_Python(Script, Get_Parameters(iParameters), bAllParameters, Get_Parameters(iParameters)->Get_Identifier());
1638 }
1639
1640 //-------------------------------------------------
1641 Script += "\n";
1642 if( bHeader ) Script += " # Execute the tool:\n";
1643 Script += " if not Tool.Execute():\n";
1644 Script += " saga_api.SG_UI_Msg_Add_Error('failed to execute tool: ' + Tool.Get_Name().c_str())\n";
1645 Script += " return False\n";
1646 Script += "\n";
1647 if( bHeader ) Script += " # Request the results:\n";
1648
1649 for(int iParameter=0; iParameter<Get_Parameters()->Get_Count(); iParameter++)
1650 {
1651 CSG_Parameter *p = Get_Parameters()->Get_Parameter(iParameter);
1652
1653 if( p->is_Output() )
1654 {
1655 CSG_String id(p->Get_Identifier()), type, ext;
1656
1657 switch( p->Get_DataObject_Type() )
1658 {
1659 case SG_DATAOBJECT_TYPE_Grid : type = "Grid" ; ext = "sg-grd-z"; break;
1660 case SG_DATAOBJECT_TYPE_Grids : type = "Grids" ; ext = "sg-gds-z"; break;
1661 case SG_DATAOBJECT_TYPE_Table : type = "Table" ; ext = "txt" ; break;
1662 case SG_DATAOBJECT_TYPE_Shapes : type = "Shapes" ; ext = "geojson" ; break;
1663 case SG_DATAOBJECT_TYPE_PointCloud: type = "PointCloud"; ext = "sg-pts-z"; break;
1664 case SG_DATAOBJECT_TYPE_TIN : type = "TIN" ; ext = "geojson" ; break;
1665 default : type = "" ; ext = "" ; break;
1666 }
1667
1668 if( p->is_DataObject() )
1669 {
1670 Script += " Data = Tool.Get_Parameter('" + id + "').as" + type + "()\n";
1671
1672 if( bHeader )
1673 {
1674 Script += " Data.Save('{:s}/{:s}.{:s}'.format(Results, Data.Get_Name(), '" + ext + "'))\n\n";
1675 }
1676 }
1677 else if( p->is_DataObject_List() )
1678 {
1679 Script += " List = Tool.Get_Parameter('" + id + "').as" + type + "List()\n";
1680 Script += " for i in range(0, List.Get_Item_Count()):\n";
1681
1682 if( bHeader )
1683 {
1684 Script += " List.Get_Item(i).Save('{:s}/{:s}_{:d}.{:s}'.format(Results, List.Get_Name(), i, '" + ext + "'))\n\n";
1685 }
1686 else
1687 {
1688 Script += " Data = List.Get_Item(i)\n";
1689 }
1690 }
1691 }
1692 }
1693
1694 //-----------------------------------------------------
1695 if( bHeader )
1696 {
1697 Script += " # job is done, free memory resources:\n";
1698 Script += " saga_api.SG_Get_Data_Manager().Delete_All()\n";
1699 Script += "\n";
1700 Script += " return True\n";
1701 Script += "\n";
1702 Script += "\n";
1703 Script += "#_________________________________________\n";
1704 Script += "##########################################\n";
1705 Script += "print('This is a simple template for using a SAGA tool through Python.')\n";
1706 Script += "print('Please edit the script to make it work properly before using it!')\n";
1707 Script += "\n";
1708 Script += "# Run_" + Name + "('.')\n";
1709 }
1710
1711 return( Script );
1712 }
1713
1714 //---------------------------------------------------------
1715 void CSG_Tool::_Get_Script_Python(CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, const CSG_String &Prefix)
1716 {
1717 for(int iParameter=0; iParameter<pParameters->Get_Count(); iParameter++)
1718 {
1719 CSG_Parameter *p = pParameters->Get_Parameter(iParameter);
1720
1721 if( !bAllParameters && (!p->is_Enabled(false) || p->is_Information() || !p->do_UseInCMD()) )
1722 {
1723 continue;
1724 }
1725
1726 CSG_String ID(p->Get_Identifier());
1727
1728 if( !Prefix.is_Empty() )
1729 {
1730 ID.Prepend(Prefix + ".");
1731 }
1732
1733 switch( p->Get_Type() )
1734 {
1735 default:
1736 break;
1737
1738 case PARAMETER_TYPE_Bool :
1739 Script += CSG_String::Format(" Tool.Set_Parameter('%s', %s)\n", ID.c_str(), p->asBool() ? SG_T("True") : SG_T("False"));
1740 break;
1741
1742 case PARAMETER_TYPE_Int :
1743 Script += CSG_String::Format(" Tool.Set_Parameter('%s', %d)\n", ID.c_str(), p->asInt());
1744 break;
1745
1746 case PARAMETER_TYPE_Data_Type :
1747 case PARAMETER_TYPE_Choice :
1748 Script += CSG_String::Format(" Tool.Set_Parameter('%s', %d) # '%s'\n", ID.c_str(), p->asInt(), p->asString());
1749 break;
1750
1751 case PARAMETER_TYPE_Choices :
1752 case PARAMETER_TYPE_Table_Field :
1753 case PARAMETER_TYPE_Table_Fields :
1754 Script += CSG_String::Format(" Tool.Set_Parameter('%s', '%s')\n", ID.c_str(), p->asString());
1755 break;
1756
1757 case PARAMETER_TYPE_Color :
1758 Script += CSG_String::Format(" Tool.Set_Parameter('%s', '%s')\n", ID.c_str(), SG_Color_To_Text(p->asColor()).c_str());
1759 break;
1760
1761 case PARAMETER_TYPE_Double :
1762 case PARAMETER_TYPE_Degree :
1763 Script += CSG_String::Format(" Tool.Set_Parameter('%s', %g)\n", ID.c_str(), p->asDouble());
1764 break;
1765
1766 case PARAMETER_TYPE_Range :
1767 Script += CSG_String::Format(" Tool.Set_Parameter('%s.MIN', %g)\n", ID.c_str(), p->asRange()->Get_Min());
1768 Script += CSG_String::Format(" Tool.Set_Parameter('%s.MAX', %g)\n", ID.c_str(), p->asRange()->Get_Max());
1769 break;
1770
1771 case PARAMETER_TYPE_String :
1772 if( ((CSG_Parameter_String *)p)->is_Password() )
1773 {
1774 Script += CSG_String::Format(" Tool.Set_Parameter('%s', '***')\n", ID.c_str());
1775 break;
1776 }
1777
1778 case PARAMETER_TYPE_Date :
1779 case PARAMETER_TYPE_Text :
1780 case PARAMETER_TYPE_FilePath :
1781 Script += CSG_String::Format(" Tool.Set_Parameter('%s', '%s')\n", ID.c_str(), p->asString());
1782 break;
1783
1784 case PARAMETER_TYPE_FixedTable :
1785 Script += CSG_String::Format(" Tool.Set_Parameter('%s', saga_api.SG_Create_Table('table.txt'))\n", ID.c_str());
1786 break;
1787
1788 case PARAMETER_TYPE_Grid_System :
1789 if( p->Get_Children_Count() == 0 )
1790 {
1791 Script += CSG_String::Format(" Tool.Set_Parameter('%s', saga_api.CSG_Grid_System(%g, %g, %g, %d, %d))\n", ID.c_str(),
1792 p->asGrid_System()->Get_Cellsize(),
1793 p->asGrid_System()->Get_XMin(), p->asGrid_System()->Get_YMin(),
1794 p->asGrid_System()->Get_NX (), p->asGrid_System()->Get_NY ()
1795 );
1796 }
1797 break;
1798
1799 case PARAMETER_TYPE_Grid :
1800 case PARAMETER_TYPE_Grids :
1801 case PARAMETER_TYPE_Table :
1802 case PARAMETER_TYPE_Shapes :
1803 case PARAMETER_TYPE_TIN :
1804 case PARAMETER_TYPE_PointCloud :
1805 if( p->is_Input() )
1806 {
1807 Script += CSG_String::Format(" Tool.Set_Parameter('%s', saga_api.SG_Get_Data_Manager().Add('%s input file%s'))\n", ID.c_str(),
1808 SG_Get_DataObject_Name(p->Get_DataObject_Type()).c_str(), p->is_Optional() ? SG_T(", optional") : SG_T("")
1809 );
1810 }
1811 else if( p->is_Output() && p->is_Optional() )
1812 {
1813 Script += CSG_String::Format(" Tool.Set_Parameter('%s', saga_api.SG_Get_Create_Pointer()) # optional output, remove this line, if you don't want to create it\n", ID.c_str());
1814 }
1815 break;
1816
1817 case PARAMETER_TYPE_Grid_List :
1818 case PARAMETER_TYPE_Grids_List :
1819 case PARAMETER_TYPE_Table_List :
1820 case PARAMETER_TYPE_Shapes_List :
1821 case PARAMETER_TYPE_TIN_List :
1822 case PARAMETER_TYPE_PointCloud_List:
1823 if( p->is_Input() )
1824 {
1825 Script += CSG_String::Format(" Tool.Get_Parameter('%s').asList().Add_Item('%s input list%s')\n", ID.c_str(),
1826 SG_Get_DataObject_Name(p->Get_DataObject_Type()).c_str(), p->is_Optional() ? SG_T(", optional") : SG_T("")
1827 );
1828 }
1829 break;
1830
1831 case PARAMETER_TYPE_Parameters :
1832 _Get_Script_Python(Script, p->asParameters(), bAllParameters, ID);
1833 break;
1834 }
1835 }
1836 }
1837
1838
1840 // //
1842
1843 //---------------------------------------------------------
1844 CSG_String CSG_Tool::_Get_Script_Python_Wrap(bool bHeader, bool bName, bool bCall)
1845 {
1846 CSG_String Arguments, Description, Code;
1847
1848 for(int i=0; i<Parameters.Get_Count(); i++) // add input that is not optional in 1st place
1849 {
1850 _Get_Script_Python_Wrap(Parameters[i], PARAMETER_INPUT , Arguments, Description, Code, bCall && bHeader);
1851 }
1852
1853 for(int i=0; i<Parameters.Get_Count(); i++) // add optional input in 2nd place
1854 {
1855 _Get_Script_Python_Wrap(Parameters[i], PARAMETER_INPUT_OPTIONAL, Arguments, Description, Code, bCall && bHeader);
1856 }
1857
1858 for(int i=0; i<Parameters.Get_Count(); i++) // add output
1859 {
1860 _Get_Script_Python_Wrap(Parameters[i], PARAMETER_OUTPUT , Arguments, Description, Code, bCall && bHeader);
1861 }
1862
1863 for(int i=0; i<Parameters.Get_Count(); i++) // add options
1864 {
1865 _Get_Script_Python_Wrap(Parameters[i], 0 , Arguments, Description, Code, bCall && bHeader);
1866 }
1867
1868 //---------------------------------------------------------
1869 CSG_String Name, Expected(Get_Name()); Expected.Replace("'", "\\'");
1870
1871 if( bName )
1872 {
1873 Name = "Run_" + Get_Name();
1874
1875 Name.Replace(" ", "_");
1876 Name.Replace("(", "");
1877 Name.Replace(")", "");
1878 Name.Replace("[", "");
1879 Name.Replace("]", "");
1880 Name.Replace(".", "");
1881 Name.Replace(",", "");
1882 Name.Replace("/", "");
1883 Name.Replace("-", "");
1884 Name.Replace("'", "");
1885 Name.Replace("&", "and");
1886 }
1887 else
1888 {
1889 Name = "tool__" + Get_Library() + "_" + Get_ID();
1890
1891 Name.Replace(" ", "_");
1892 }
1893
1894 CSG_Strings _Description = SG_String_Tokenize(Get_Description(), "\n");
1895
1896 //---------------------------------------------------------
1897 CSG_String Script;
1898
1899 if( bCall )
1900 {
1901 if( bHeader )
1902 {
1903 Script += "#! /usr/bin/env python\n";
1904 Script += "from PySAGA import saga_api; from PySAGA.tools import " + Get_Library() + "\n\n";
1905 Script += Code + "\n";
1906 }
1907 else
1908 {
1909 Script += "#! /usr/bin/env python\n";
1910 Script += "from PySAGA.tools import " + Get_Library() + "\n\n";
1911 }
1912
1913 Script += Get_Library() + '.' + Name + "(" + Arguments + ", Verbose=2)\n";
1914 }
1915 else
1916 {
1917 if( bHeader )
1918 {
1919 Script += "#! /usr/bin/env python\n";
1920 Script += "from PySAGA.helper import Tool_Wrapper\n\n";
1921 }
1922
1923 Script += "def " + Name + "(" + Arguments + ", Verbose=2):\n";
1924 Script += " '''\n";
1925 Script += " " + Get_Name() + "\n";
1926 Script += " ----------\n";
1927 Script += " [" + Get_Library() + "." + Get_ID() + "]\\n\n";
1928 for(int i=0; i<_Description.Get_Count(); i++)
1929 {
1930 _Description[i].Trim_Both(); Script += " " + _Description[i] + "\\n\n";
1931 }
1932 Script += " Arguments\n";
1933 Script += " ----------\n";
1934 Script += Description + "\n";
1935 Script += " - Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\\n\n";
1936 Script += " Returns\n";
1937 Script += " ----------\n";
1938 Script += " `boolean` : `True` on success, `False` on failure.\n";
1939 Script += " '''\n";
1940 Script += " Tool = Tool_Wrapper('" + Get_Library() + "', '" + Get_ID() + "', '" + Expected + "')\n";
1941 Script += " if Tool.is_Okay():\n";
1942 Script += Code;
1943 Script += " return Tool.Execute(Verbose)\n";
1944 Script += " return False\n\n";
1945 }
1946
1947 return( Script );
1948 }
1949
1950 //---------------------------------------------------------
1951 bool CSG_Tool::_Get_Script_Python_Wrap(const CSG_Parameter &Parameter, int Constraint, CSG_String &Arguments, CSG_String &Description, CSG_String &Code, bool bCall, const CSG_String &Prefix)
1952 {
1953 if( Parameter.do_UseInCMD() == false
1954 || Parameter.is_Information()
1955 || Parameter.Get_Type() == PARAMETER_TYPE_Node
1956 || Parameter.Cmp_Identifier("PARAMETERS_GRID_SYSTEM") )
1957 {
1958 return( false );
1959 }
1960
1961 if( bCall && !Parameter.is_Enabled() )
1962 {
1963 return( false );
1964 }
1965
1966 //-----------------------------------------------------
1967 CSG_String ID(Parameter.Get_Identifier());
1968
1969 if( !Prefix.is_Empty() )
1970 {
1971 ID.Prepend(Prefix + ".");
1972 }
1973
1974 CSG_String Argument(ID);
1975
1976 if( Argument[0] >= '0' && Argument[0] <= '9' )
1977 {
1978 Argument.Prepend('_');
1979 }
1980
1981 Argument.Replace(".", "_");
1982 Argument.Replace("|", "_");
1983 Argument.Replace(" ", "_");
1984
1985 if( Argument.Length() > 2 )
1986 {
1987 Argument.Make_Upper();
1988 }
1989
1990 //-----------------------------------------------------
1991 if( Parameter.asParameters() ) // PARAMETER_TYPE_Parameters
1992 {
1993 bool bResult = false;
1994
1995 for(int i=0; i<(*Parameter.asParameters()).Get_Count(); i++)
1996 {
1997 if( _Get_Script_Python_Wrap((*Parameter.asParameters())[i], Constraint, Arguments, Description, Code, bCall, ID) )
1998 {
1999 bResult = true;
2000 }
2001 }
2002
2003 return( bResult );
2004 }
2005
2006 //-----------------------------------------------------
2007 if( Parameter.is_Input () && !Parameter.is_Optional() && Constraint != PARAMETER_INPUT ) { return( false ); }
2008 if( Parameter.is_Input () && Parameter.is_Optional() && Constraint != PARAMETER_INPUT_OPTIONAL ) { return( false ); }
2009 if( Parameter.is_Output() && Constraint != PARAMETER_OUTPUT ) { return( false ); }
2010 if( Parameter.is_Option() && Constraint != 0 ) { return( false ); }
2011
2012 //-----------------------------------------------------
2013 if( bCall )
2014 {
2015 CSG_String Value;
2016
2017 if( Parameter.is_DataObject() )
2018 {
2019 Value = Parameter.Get_Identifier(); Value.Make_Lower();
2020
2021 if( Parameter.is_Input() )
2022 {
2023 if( !Parameter.asDataObject() && Parameter.is_Optional() ) // don't add optional input that has not been set
2024 {
2025 return( false );
2026 }
2027
2028 CSG_String File(Parameter.asDataObject() && Parameter.asDataObject()->Get_File_Name()
2029 ? Parameter.asDataObject()->Get_File_Name() : SG_T("data object file")
2030 ); File.Replace("\\", "/");
2031
2032 Code += Value + " = saga_api." + SG_Get_DataObject_Class_Name(Parameter.Get_DataObject_Type()) + "('" + File + "') # input data object\n";
2033 }
2034 else // if( Parameter.is_Output() )
2035 {
2036 if( !Parameter.asDataObject() && Parameter.is_Optional() ) // don't add optional output that has not been requested
2037 {
2038 return( false );
2039 }
2040
2041 Code += Value + " = saga_api." + SG_Get_DataObject_Class_Name(Parameter.Get_DataObject_Type()) + "() # output data object\n";
2042 }
2043 }
2044 else if( Parameter.is_DataObject_List() )
2045 {
2046 Value = Parameter.Get_Identifier(); Value.Make_Lower();
2047
2048 if( Parameter.is_Input() )
2049 {
2050 if( Parameter.asList()->Get_Item_Count() < 1 && Parameter.is_Optional() ) // don't add optional input that has not been set
2051 {
2052 return( false );
2053 }
2054
2055 Code += Value + " = [] # Python list with input data objects of type 'saga_api." + SG_Get_DataObject_Class_Name(Parameter.Get_DataObject_Type()) + "'\n";
2056 }
2057 else // if( Parameter.is_Output() )
2058 {
2059 Code += Value + " = [] # Python list, will become filled after successful execution with output data objects of type 'saga_api." + SG_Get_DataObject_Class_Name(Parameter.Get_DataObject_Type()) + "'\n";
2060 }
2061 }
2062 else if( Parameter.is_Option() )
2063 {
2064 if( Parameter.is_Default() )
2065 {
2066 return( false );
2067 }
2068
2069 switch( Parameter.Get_Type() )
2070 {
2071 case PARAMETER_TYPE_Bool : Value = Parameter.asBool() ? "True" : "False"; break;
2072
2073 case PARAMETER_TYPE_Int : Value.Printf("%d", Parameter.asInt()); break;
2074
2075 case PARAMETER_TYPE_Double :
2076 case PARAMETER_TYPE_Degree : Value.Printf("%f", Parameter.asDouble()); break;
2077
2078 case PARAMETER_TYPE_Color : Value = SG_Color_To_Text(Parameter.asColor()); break;
2079
2080 case PARAMETER_TYPE_String :
2081 case PARAMETER_TYPE_Text :
2082 case PARAMETER_TYPE_Date :
2083 case PARAMETER_TYPE_Range :
2084 case PARAMETER_TYPE_Data_Type :
2085 case PARAMETER_TYPE_Choice :
2086 case PARAMETER_TYPE_Choices :
2087 case PARAMETER_TYPE_Table_Field :
2088 case PARAMETER_TYPE_Table_Fields:
2089 case PARAMETER_TYPE_FilePath : Value.Printf("'%s'", Parameter.asString()); break;
2090
2091 default : return( false );
2092 }
2093 }
2094
2095 if( !Value.is_Empty() )
2096 {
2097 if( !Arguments.is_Empty() )
2098 {
2099 Arguments += ", ";
2100 }
2101
2102 Arguments += Argument + "=" + Value;
2103 }
2104
2105 return( true );
2106 }
2107
2108 //-----------------------------------------------------
2109 if( !Arguments.is_Empty() )
2110 {
2111 Arguments += ", ";
2112 }
2113
2114 Arguments += Argument + "=None";
2115
2116 //-----------------------------------------------------
2117 Code += " ";
2118
2119 if( Parameter.is_Input () ) { Code += "Tool.Set_Input "; }
2120 if( Parameter.is_Output() ) { Code += "Tool.Set_Output"; }
2121 if( Parameter.is_Option() ) { Code += "Tool.Set_Option"; }
2122
2123 Code += CSG_String::Format("('%s', %s)\n", ID.c_str(), Argument.c_str());
2124
2125 //-----------------------------------------------------
2126 Description += " - " + Argument + " [`";
2127
2128 if( Parameter.is_Input() )
2129 {
2130 Description += Parameter.is_Optional() ? "optional input " : "input ";
2131 }
2132 else if( Parameter.is_Output() )
2133 {
2134 Description += "output ";
2135 }
2136
2137 Description += Parameter.Get_Type_Name() + "`] : " + Parameter.Get_Name();
2138
2139 CSG_String s(Parameter.Get_Description(PARAMETER_DESCRIPTION_PROPERTIES|PARAMETER_DESCRIPTION_TEXT, SG_T(" ")));
2140
2141 if( !s.is_Empty() )
2142 {
2143 Description += ". " + s;
2144 }
2145
2146 Description += "\n";
2147
2148 return( true );
2149 }
2150
2151
2153 // //
2154 // History //
2155 // //
2157
2158 //---------------------------------------------------------
2159 CSG_MetaData CSG_Tool::_Get_Output_History(void)
2160 {
2161 CSG_MetaData History;
2162
2163 History.Set_Name(SG_META_HISTORY);
2164 History.Add_Property("saga-version", SAGA_VERSION);
2165
2166 if( SG_Get_History_Depth() )
2167 {
2168 CSG_MetaData *pTool = History.Add_Child("TOOL");
2169
2170 pTool->Add_Property("library", Get_Library());
2171 pTool->Add_Property("id" , Get_ID ());
2172 pTool->Add_Property("name" , Get_Name ());
2173
2174 Parameters.Set_History(*pTool);
2175
2176 pTool->Add_Children(History_Supplement);
2177
2178 CSG_MetaData *pOutput = pTool->Add_Child("OUTPUT");
2179 pOutput->Add_Property("type", "");
2180 pOutput->Add_Property("id" , "");
2181 pOutput->Add_Property("name", "");
2182
2183 pTool->Del_Children(SG_Get_History_Depth(), SG_T("TOOL"));
2184 }
2185
2186 return( History );
2187 }
2188
2189 //---------------------------------------------------------
2190 void CSG_Tool::_Set_Output_History(void)
2191 {
2192 CSG_MetaData History(_Get_Output_History());
2193
2194 //-----------------------------------------------------
2195 for(int j=-1; j<Get_Parameters_Count(); j++)
2196 {
2197 CSG_Parameters *pParameters = j < 0 ? &Parameters : Get_Parameters(j);
2198
2199 for(int i=0; i<pParameters->Get_Count(); i++)
2200 {
2201 CSG_Parameter *pParameter = pParameters->Get_Parameter(i);
2202
2203 if( pParameter->is_Output() )//&& (pParameter->is_Enabled() || !has_GUI()) )
2204 {
2205 DataObject_Set_History(pParameter, &History);
2206 }
2207 }
2208 }
2209 }
2210
2211 //---------------------------------------------------------
2212 bool CSG_Tool::DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory)
2213 {
2214 if( !pParameter )
2215 {
2216 return( false );
2217 }
2218
2219 //-----------------------------------------------------
2220 CSG_MetaData History;
2221
2222 if( !pHistory )
2223 {
2224 History = _Get_Output_History();
2225
2226 pHistory = &History;
2227 }
2228
2229 //-----------------------------------------------------
2230 CSG_MetaData *pOutput = pHistory->Get_Child("TOOL") ? pHistory->Get_Child("TOOL")->Get_Child("OUTPUT") : NULL;
2231
2232 if( pOutput )
2233 {
2234 pOutput->Set_Property("type", pParameter->Get_Type_Identifier());
2235 pOutput->Set_Property("id" , pParameter->Get_Identifier ());
2236 pOutput->Set_Property("name", pParameter->Get_Name ());
2237 }
2238
2239 //-----------------------------------------------------
2240 if( pParameter->is_DataObject() )
2241 {
2242 if( pParameter->asDataObject() )
2243 {
2244 if( pOutput )
2245 {
2246 pOutput->Set_Content(pParameter->asDataObject()->Get_Name());
2247 }
2248
2249 pParameter->asDataObject()->Get_History().Assign(*pHistory);
2250
2251 return( true );
2252 }
2253 }
2254
2255 //-----------------------------------------------------
2256 else if( pParameter->is_DataObject_List() )
2257 {
2258 for(int j=0; j<pParameter->asList()->Get_Item_Count(); j++)
2259 {
2260 if( pOutput )
2261 {
2262 pOutput->Set_Content(pParameter->asList()->Get_Item(j)->Get_Name());
2263 }
2264
2265 pParameter->asList()->Get_Item(j)->Get_History().Assign(*pHistory);
2266 }
2267
2268 return( true );
2269 }
2270
2271 //-----------------------------------------------------
2272 return( false );
2273 }
2274
2275
2277 // //
2278 // //
2279 // //
2281
2282 //---------------------------------------------------------
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_Parameters::Get_Description
const CSG_String & Get_Description(void) const
Definition: parameters.h:1691
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
CSG_Parameters::Get_Grid_System
CSG_Grid_System * Get_Grid_System(void) const
Definition: parameters.h:1847
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
GET_ID1
#define GET_ID1(p)
CSG_Tool::Reset_Manager
bool Reset_Manager(void)
Definition: tool.cpp:1237
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Tool::Get_Projection
bool Get_Projection(CSG_Projection &Projection) const
Definition: tool.cpp:418
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Tool_Chain::Get_Script
static CSG_String Get_Script(CSG_Tool *pTool, bool bHeader, bool bAllParameters=true)
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_Tool::DataObject_Update
static bool DataObject_Update(CSG_Data_Object *pDataObject, int Show=SG_UI_DATAOBJECT_UPDATE)
Definition: tool.cpp:980
CSG_Tool::DataObject_Set_Parameter
static bool DataObject_Set_Parameter(CSG_Data_Object *pDataObject, CSG_Parameter *pParameter)
Definition: tool.cpp:1058
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
SG_UI_DataObject_Params_Set
bool SG_UI_DataObject_Params_Set(CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
Definition: api_callback.cpp:697
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_Data_Object::Get_History
CSG_MetaData & Get_History(void)
Definition: dataobject.h:227
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Tool::Add_Parameters
CSG_Parameters * Add_Parameters(const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
Definition: tool.cpp:483
TOOL_SCRIPT_CHAIN
@ TOOL_SCRIPT_CHAIN
Definition: tool.h:123
CSG_Tool::History_Supplement
CSG_MetaData History_Supplement
Definition: tool.h:253
SG_UI_Dlg_Continue
bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:380
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_Tool::Message_Add
void Message_Add(const CSG_String &Text, bool bNewLine=true)
Definition: tool.cpp:910
CSG_Parameter_Range::Get_Max
double Get_Max(void) const
Definition: parameter_data.cpp:832
CSG_Tool::Set_Show_Progress
void Set_Show_Progress(bool bOn=true)
Definition: tool.cpp:658
CSG_TimeSpan::Get_Hours
int Get_Hours(void) const
Definition: datetime.h:161
CSG_Parameters::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: parameters.cpp:2003
CSG_Parameters::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: parameters.cpp:2014
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
CSG_Parameters::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: parameters.h:1674
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: parameter.cpp:128
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
CSG_Tool::Create_Manager
class CSG_Data_Manager * Create_Manager(void)
Definition: tool.cpp:568
data_manager.h
SG_UI_MSG_STYLE_NORMAL
@ SG_UI_MSG_STYLE_NORMAL
Definition: api_core.h:1493
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_Grid_System
Definition: grid.h:200
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Tool::Set_Version
void Set_Version(const CSG_String &String)
Definition: tool.cpp:162
CSG_Parameter::asColor
long asColor(void) const
Definition: parameters.h:282
SG_UI_Msg_Add_Execution
void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:517
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:600
SG_UI_Process_Set_Okay
bool SG_UI_Process_Set_Okay(bool bOkay)
Definition: api_callback.cpp:223
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
CSG_Tool::Dlg_Parameters
bool Dlg_Parameters(const CSG_String &Identifier)
Definition: tool.cpp:512
tool_chain.h
TOOL_SCRIPT_CMD_SHELL
@ TOOL_SCRIPT_CMD_SHELL
Definition: tool.h:121
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
CSG_Parameters::is_Managed
bool is_Managed(void) const
Definition: parameters.h:1844
saga_api.h
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Tool::Reset
bool Reset(bool bManager=true)
Definition: tool.cpp:1215
SG_UI_Stop_Execution
bool SG_UI_Stop_Execution(bool bDialog)
Definition: api_callback.cpp:342
CSG_Tool
Definition: tool.h:149
CSG_TimeSpan::Get_Milliseconds
sLong Get_Milliseconds(void) const
Definition: datetime.h:164
CSG_Tool::DataObject_Set_History
bool DataObject_Set_History(CSG_Parameter *pParameter, CSG_MetaData *pHistory=NULL)
Definition: tool.cpp:2212
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:578
SG_Get_Data_Manager
CSG_Data_Manager & SG_Get_Data_Manager(void)
Definition: data_manager.cpp:65
CSG_Tool::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: tool.cpp:184
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Tool::~CSG_Tool
virtual ~CSG_Tool(void)
Definition: tool.cpp:86
CSG_Tool::Get_Script
CSG_String Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)
Definition: tool.cpp:1326
CSG_Tool::Error_Set
bool Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
Definition: tool.cpp:709
CSG_Parameter::do_UseInCMD
bool do_UseInCMD(void) const
Definition: parameter.cpp:171
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
Definition: tool.h:126
SG_UI_Get_Application_Path
CSG_String SG_UI_Get_Application_Path(bool bPathOnly)
Definition: api_callback.cpp:786
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_Tool::do_Sync_Projections
virtual bool do_Sync_Projections(void) const
Definition: tool.h:227
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
CSG_TimeSpan
Definition: datetime.h:91
CSG_Tool::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool.cpp:194
TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
Definition: tool.h:128
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_Parameter::Get_Parameters
CSG_Parameters * Get_Parameters(void) const
Definition: parameter.cpp:99
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:394
CSG_Tool::Set_Author
void Set_Author(const CSG_String &String)
Definition: tool.cpp:151
tool.h
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:102
CSG_Tool::Get_Manager
class CSG_Data_Manager * Get_Manager(void) const
Definition: tool.cpp:562
CSG_Tool::Get_Version
const CSG_String & Get_Version(void) const
Definition: tool.cpp:167
CSG_Parameters::Msg_String
bool Msg_String(bool bOptionsOnly)
Definition: parameters.cpp:1859
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
CSG_Tool::DataObject_Get_Parameter
static CSG_Parameter * DataObject_Get_Parameter(CSG_Data_Object *pDataObject, const CSG_String &ID)
Definition: tool.cpp:1051
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
CSG_Tool::Stop_Execution
bool Stop_Execution(bool bDialog=true)
Definition: tool.cpp:682
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:294
GET_ID2
#define GET_ID2(p, s)
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
CSG_Tool::DataObject_Set_Parameters
static bool DataObject_Set_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
Definition: tool.cpp:1024
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Parameters::Set_Name
void Set_Name(const CSG_String &Name)
Definition: parameters.cpp:272
SG_UI_Dlg_Message
void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:362
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
CSG_Parameters::Assign_Values
bool Assign_Values(CSG_Parameters *pSource)
Definition: parameters.cpp:1459
TSG_Tool_Error
TSG_Tool_Error
Definition: tool.h:112
CSG_TimeSpan::Format
CSG_String Format(const CSG_String &format="") const
Definition: datetime.cpp:65
CSG_Tool::DataObject_Add
bool DataObject_Add(CSG_Data_Object *pDataObject, bool bUpdate=false)
Definition: tool.cpp:803
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Data_Manager::Delete_All
bool Delete_All(bool bDetach=false)
Definition: data_manager.cpp:782
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
CSG_Parameters::Restore_Defaults
bool Restore_Defaults(bool bClearData=false)
Definition: parameters.cpp:1421
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(void)
Definition: tool.h:179
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Tool::Process_Get_Okay
static bool Process_Get_Okay(bool bBlink=false)
Definition: tool.cpp:848
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:208
CSG_MetaData::Del_Children
bool Del_Children(int Depth=0, const SG_Char *Name=NULL)
Definition: metadata.cpp:373
SG_META_HISTORY
#define SG_META_HISTORY
Definition: dataobject.h:93
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
SG_UI_Dlg_Parameters
bool SG_UI_Dlg_Parameters(CSG_Parameters *pParameters, const CSG_String &Caption)
Definition: api_callback.cpp:442
CSG_Parameters::Get_Tool
class CSG_Tool * Get_Tool(void) const
Definition: parameters.h:1672
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
SG_UI_DataObject_Update
bool SG_UI_DataObject_Update(CSG_Data_Object *pDataObject, int Show, CSG_Parameters *pParameters)
Definition: api_callback.cpp:611
CSG_Parameters::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: parameters.cpp:292
CSG_Tool::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool.h:175
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:128
CSG_Tool::DataObject_Get_Colors
static bool DataObject_Get_Colors(CSG_Data_Object *pDataObject, CSG_Colors &Colors)
Definition: tool.cpp:999
SG_UI_DataObject_Add
bool SG_UI_DataObject_Add(CSG_Data_Object *pDataObject, int Show)
Definition: api_callback.cpp:598
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Tool::Destroy
virtual void Destroy(void)
Definition: tool.cpp:115
SG_UI_DataObject_Colors_Set
bool SG_UI_DataObject_Colors_Set(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
Definition: api_callback.cpp:671
CSG_Tool::DataObject_Get_Parameters
static bool DataObject_Get_Parameters(CSG_Data_Object *pDataObject, CSG_Parameters &Parameters)
Definition: tool.cpp:1019
CSG_Tool::Set_Callback
void Set_Callback(bool bActive=true)
Definition: tool.cpp:538
TOOL_SCRIPT_CMD_BATCH
@ TOOL_SCRIPT_CMD_BATCH
Definition: tool.h:122
CSG_Tool::Message_Dlg
void Message_Dlg(const CSG_String &Text, const SG_Char *Caption=NULL)
Definition: tool.cpp:697
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Tool::DataObject_Update_All
void DataObject_Update_All(void)
Definition: tool.cpp:819
SG_String_Tokenize
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1493
TOOL_SCRIPT_PYTHON
@ TOOL_SCRIPT_PYTHON
Definition: tool.h:124
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Tool::Message_Dlg_Confirm
bool Message_Dlg_Confirm(const CSG_String &Text, const SG_Char *Caption=NULL)
Definition: tool.cpp:703
CSG_Data_Object::Get_File_Name
const SG_Char * Get_File_Name(bool bNative=true) const
Definition: dataobject.cpp:331
SG_Color_To_Text
CSG_String SG_Color_To_Text(long Color, bool bHexadecimal)
Definition: api_colors.cpp:138
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:163
CSG_Parameters::Get_References
const CSG_Strings & Get_References(void) const
Definition: parameters.h:1696
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Tool::Process_Set_Text
static void Process_Set_Text(const CSG_String &Text)
Definition: tool.cpp:854
CSG_Array::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:328
SG_UI_MSG_STYLE_BOLD
@ SG_UI_MSG_STYLE_BOLD
Definition: api_core.h:1494
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Parameters::Create
bool Create(const CSG_Parameters &Parameters)
Definition: parameters.cpp:122
CSG_Strings
Definition: api_core.h:693
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Tool::Update_Parameter_States
bool Update_Parameter_States(void)
Definition: tool.cpp:1285
CSG_Tool::On_Execute
virtual bool On_Execute(void)=0
TOOL_ERROR_Calculation
@ TOOL_ERROR_Calculation
Definition: tool.h:114
CSG_DateTime
Definition: datetime.h:183
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1191
CSG_Tool::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool.cpp:134
CSG_Tool::On_Parameter_Changed
virtual int On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: tool.cpp:464
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_Tool::Set_Name
void Set_Name(const CSG_String &String)
Definition: tool.cpp:140
CSG_MetaData::Assign
bool Assign(const CSG_MetaData &MetaData, bool bAddChildren=true)
Definition: metadata.cpp:761
ADD_MESSAGE_EXECUTION
#define ADD_MESSAGE_EXECUTION(Text, Style)
CSG_Tool::Set_Description
void Set_Description(const CSG_String &String)
Definition: tool.cpp:173
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_TimeSpan::Get_Minutes
int Get_Minutes(void) const
Definition: datetime.h:162
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
SG_UI_DataObject_Colors_Get
bool SG_UI_DataObject_Colors_Get(CSG_Data_Object *pDataObject, CSG_Colors *pColors)
Definition: api_callback.cpp:658
CSG_Projection
Definition: geo_tools.h:833
CSG_Tool::has_GUI
bool has_GUI(void) const
Definition: tool.cpp:233
CSG_Tool::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: tool.cpp:1247
SG_UI_Dlg_Error
int SG_UI_Dlg_Error(const CSG_String &Message, const CSG_String &Caption)
Definition: api_callback.cpp:396
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
TOOL_SCRIPT_PYTHON_WRAP_NAME
@ TOOL_SCRIPT_PYTHON_WRAP_NAME
Definition: tool.h:125
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:275
SG_UI_DataObject_Params_Get
bool SG_UI_DataObject_Params_Get(CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
Definition: api_callback.cpp:684
CSG_TimeSpan::Get_Seconds
sLong Get_Seconds(void) const
Definition: datetime.h:163
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Parameters::Set_Description
void Set_Description(const CSG_String &Description)
Definition: parameters.cpp:282
CSG_String::Contains
bool Contains(const CSG_String &String) const
Definition: api_string.cpp:633
CSG_Tool::DataObject_Set_Colors
static bool DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
Definition: tool.cpp:1004
CSG_String
Definition: api_core.h:557
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Tool::Get_Author
const CSG_String & Get_Author(void) const
Definition: tool.cpp:156
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Tool::Settings_Pop
bool Settings_Pop(void)
Definition: tool.cpp:627
CSG_Parameter_String
Definition: parameters.h:799
SG_Get_History_Depth
int SG_Get_History_Depth(void)
Definition: dataobject.cpp:159
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:600
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
PARAMETER_DESCRIPTION_TEXT
#define PARAMETER_DESCRIPTION_TEXT
Definition: parameters.h:110
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Tool::Get_Description
const CSG_String & Get_Description(void) const
Definition: tool.cpp:178
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Tool::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:233
TOOL_SCRIPT_PYTHON_WRAP_ID
@ TOOL_SCRIPT_PYTHON_WRAP_ID
Definition: tool.h:127
CSG_Tool::Set_Progress
virtual bool Set_Progress(int Position, int Range) const
Definition: tool.cpp:664
CSG_Tool::Delete_Manager
bool Delete_Manager(bool bDetachData=false, bool bReset=true)
Definition: tool.cpp:576
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
CSG_Tool::CSG_Tool
CSG_Tool(void)
Definition: tool.cpp:66
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:771
CSG_Parameters::Set_Manager
void Set_Manager(class CSG_Data_Manager *pManager)
Definition: parameters.cpp:206
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Parameters::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: parameters.cpp:1348
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
TSG_Tool_Script_Type
TSG_Tool_Script_Type
Definition: tool.h:120
PARAMETER_DESCRIPTION_PROPERTIES
#define PARAMETER_DESCRIPTION_PROPERTIES
Definition: parameters.h:109
PARAMETER_CHECK_VALUES
#define PARAMETER_CHECK_VALUES
Definition: parameters.h:189
CSG_Parameters::Get_Name
const CSG_String & Get_Name(void) const
Definition: parameters.h:1688
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Parameters::Set_Callback_On_Parameter_Changed
TSG_PFNC_Parameter_Changed Set_Callback_On_Parameter_Changed(TSG_PFNC_Parameter_Changed pCallback)
Definition: parameters.cpp:1285
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
PARAMETER_CHECK_ENABLE
#define PARAMETER_CHECK_ENABLE
Definition: parameters.h:190
CSG_Parameters
Definition: parameters.h:1650
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:518
CSG_Parameter_Range::Get_Min
double Get_Min(void) const
Definition: parameter_data.cpp:814
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Parameter::Cmp_Identifier
bool Cmp_Identifier(const CSG_String &Identifier) const
Definition: parameter.cpp:552
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:968
CSG_Tool::Error_Fmt
bool Error_Fmt(const char *Format,...)
Definition: tool.cpp:746
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:161
CSG_Tool::Message_Fmt
void Message_Fmt(const char *Format,...)
Definition: tool.cpp:923
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:565
CSG_Parameter::is_Default
virtual bool is_Default(void) const
Definition: parameter.cpp:881
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:238
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
CSG_Tool::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: tool.cpp:1262
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
SG_Get_DataObject_Class_Name
CSG_String SG_Get_DataObject_Class_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:101
CSG_Tool::Get_Parameters_Count
int Get_Parameters_Count(void)
Definition: tool.h:178
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Tool::On_Parameters_Enable
virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: tool.cpp:470
CSG_Parameters::Set_History
bool Set_History(CSG_MetaData &History, bool bOptions=true, bool bDataObjects=true)
Definition: parameters.cpp:1884
CSG_Parameters::Set_Callback
bool Set_Callback(bool bActive=true)
Definition: parameters.cpp:1306
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
PARAMETER_INPUT
#define PARAMETER_INPUT
Definition: parameters.h:94
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:122
CSG_Colors
Definition: api_core.h:1329
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Tool::Get_Grid_System
CSG_Grid_System * Get_Grid_System(void) const
Definition: tool.cpp:1272
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Typedefs | Enumerations | Variables
tool.h File Reference
#include "parameters.h"

Go to the source code of this file.

Classes

class | CSG_Tool
class | CSG_Tool_Grid
class | CSG_Tool_Interactive_Base
class | CSG_Tool_Interactive
class | CSG_Tool_Grid_Interactive
class | CSG_Tool_Library_Interface

Macros

#define | TOOL_INTERACTIVE_KEY_LEFT 0x01
#define | TOOL_INTERACTIVE_KEY_MIDDLE 0x02
#define | TOOL_INTERACTIVE_KEY_RIGHT 0x04
#define | TOOL_INTERACTIVE_KEY_SHIFT 0x08
#define | TOOL_INTERACTIVE_KEY_ALT 0x10
#define | TOOL_INTERACTIVE_KEY_CTRL 0x20
#define | SYMBOL_TLB_Initialize "TLB_Initialize"
#define | SYMBOL_TLB_Finalize "TLB_Finalize"
#define | SYMBOL_TLB_Get_Interface "TLB_Get_Interface"
#define | TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)
#define | TLB_INTERFACE_INITIALIZE
#define | TLB_INTERFACE_FINALIZE
#define | TLB_INTERFACE TLB_INTERFACE_INITIALIZE TLB_INTERFACE_FINALIZE

Typedefs

typedef CSG_Tool *(* | TSG_PFNC_TLB_Create_Tool) (int i)
typedef CSG_String(* | TSG_PFNC_TLB_Get_Info) (int i)
typedef bool(* | TSG_PFNC_TLB_Initialize) (const SG_Char *)
typedef bool(* | TSG_PFNC_TLB_Finalize) (void)
typedef CSG_Tool_Library_Interface *(* | TSG_PFNC_TLB_Get_Interface) (void)

Enumerations

enum | TSG_Summary_Format { SG_SUMMARY_FMT_FLAT = 0, SG_SUMMARY_FMT_HTML, SG_SUMMARY_FMT_XML }
enum TSG_Tool_Type {
TOOL_TYPE_Base = 0, TOOL_TYPE_Interactive, TOOL_TYPE_Grid, TOOL_TYPE_Grid_Interactive,
TOOL_TYPE_Chain
}
enum | TSG_Tool_Error { TOOL_ERROR_Unknown = 0, TOOL_ERROR_Calculation }
enum TSG_Tool_Script_Type {
TOOL_SCRIPT_CMD_SHELL = 0, TOOL_SCRIPT_CMD_BATCH, TOOL_SCRIPT_CHAIN, TOOL_SCRIPT_PYTHON,
TOOL_SCRIPT_PYTHON_WRAP_NAME, TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL, TOOL_SCRIPT_PYTHON_WRAP_ID, TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
}
enum TSG_Tool_Interactive_Mode {
TOOL_INTERACTIVE_UNDEFINED = 0, TOOL_INTERACTIVE_LDOWN, TOOL_INTERACTIVE_LUP, TOOL_INTERACTIVE_LDCLICK,
TOOL_INTERACTIVE_MDOWN, TOOL_INTERACTIVE_MUP, TOOL_INTERACTIVE_MDCLICK, TOOL_INTERACTIVE_RDOWN,
TOOL_INTERACTIVE_RUP, TOOL_INTERACTIVE_RDCLICK, TOOL_INTERACTIVE_MOVE, TOOL_INTERACTIVE_MOVE_LDOWN,
TOOL_INTERACTIVE_MOVE_MDOWN, TOOL_INTERACTIVE_MOVE_RDOWN
}
enum | TSG_Tool_Interactive_DragMode { TOOL_INTERACTIVE_DRAG_NONE = 0, TOOL_INTERACTIVE_DRAG_LINE, TOOL_INTERACTIVE_DRAG_BOX, TOOL_INTERACTIVE_DRAG_CIRCLE }
enum TSG_TLB_Info {
TLB_INFO_Name = 0, TLB_INFO_Description, TLB_INFO_Author, TLB_INFO_Version,
TLB_INFO_Menu_Path, TLB_INFO_Category, TLB_INFO_User, TLB_INFO_File,
TLB_INFO_Library, TLB_INFO_SAGA_Version, TLB_INFO_Count
}

Variables

CSG_Tool_Library_Interface TLB_Interface

Detailed Description

The definition of the base classes for any SAGA tool.

See also
CSG_Tool
CSG_Tool_Grid
CSG_Tool_Interactive
CSG_Tool_Library
CSG_Tool_Library_Manager

Definition in file tool.h.

Macro Definition Documentation

◆ SYMBOL_TLB_Finalize

#define SYMBOL_TLB_Finalize "TLB_Finalize"

Definition at line 667 of file tool.h.

◆ SYMBOL_TLB_Get_Interface

#define SYMBOL_TLB_Get_Interface "TLB_Get_Interface"

Definition at line 670 of file tool.h.

◆ SYMBOL_TLB_Initialize

#define SYMBOL_TLB_Initialize "TLB_Initialize"

Definition at line 664 of file tool.h.

◆ TLB_INTERFACE

#define TLB_INTERFACE TLB_INTERFACE_INITIALIZE TLB_INTERFACE_FINALIZE

Definition at line 696 of file tool.h.

◆ TLB_INTERFACE_FINALIZE

#define TLB_INTERFACE_FINALIZE
Value:
extern "C" _SAGA_DLL_EXPORT bool TLB_Finalize (void)\
{\
return( true );\
}\

Definition at line 690 of file tool.h.

◆ TLB_INTERFACE_INITIALIZE

#define TLB_INTERFACE_INITIALIZE
Value:
CSG_Tool_Library_Interface TLB_Interface;\
\
extern "C" _SAGA_DLL_EXPORT CSG_Tool_Library_Interface * TLB_Get_Interface (void)\
{\
return( &TLB_Interface );\
}\
\
extern "C" _SAGA_DLL_EXPORT bool TLB_Initialize (const SG_Char *TLB_Path)\
{\
return( TLB_Interface.Create(SAGA_VERSION, TLB_Path, Get_Info, Create_Tool) );\
}\

Definition at line 677 of file tool.h.

◆ TLB_INTERFACE_SKIP_TOOL

#define TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)

Definition at line 674 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_ALT

#define TOOL_INTERACTIVE_KEY_ALT 0x10

Definition at line 484 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_CTRL

#define TOOL_INTERACTIVE_KEY_CTRL 0x20

Definition at line 485 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_LEFT

#define TOOL_INTERACTIVE_KEY_LEFT 0x01

Definition at line 480 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_MIDDLE

#define TOOL_INTERACTIVE_KEY_MIDDLE 0x02

Definition at line 481 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_RIGHT

#define TOOL_INTERACTIVE_KEY_RIGHT 0x04

Definition at line 482 of file tool.h.

◆ TOOL_INTERACTIVE_KEY_SHIFT

#define TOOL_INTERACTIVE_KEY_SHIFT 0x08

Definition at line 483 of file tool.h.

Typedef Documentation

◆ TSG_PFNC_TLB_Create_Tool

typedef CSG_Tool*(* TSG_PFNC_TLB_Create_Tool) (int i)

Definition at line 630 of file tool.h.

◆ TSG_PFNC_TLB_Finalize

typedef bool(* TSG_PFNC_TLB_Finalize) (void)

Definition at line 668 of file tool.h.

◆ TSG_PFNC_TLB_Get_Info

typedef CSG_String(* TSG_PFNC_TLB_Get_Info) (int i)

Definition at line 631 of file tool.h.

◆ TSG_PFNC_TLB_Get_Interface

typedef CSG_Tool_Library_Interface*(* TSG_PFNC_TLB_Get_Interface) (void)

Definition at line 671 of file tool.h.

◆ TSG_PFNC_TLB_Initialize

typedef bool(* TSG_PFNC_TLB_Initialize) (const SG_Char *)

Definition at line 665 of file tool.h.

Enumeration Type Documentation

◆ TSG_Summary_Format

enum TSG_Summary_Format
Enumerator
SG_SUMMARY_FMT_FLAT
SG_SUMMARY_FMT_HTML
SG_SUMMARY_FMT_XML

Definition at line 91 of file tool.h.

◆ TSG_TLB_Info

enum TSG_TLB_Info
Enumerator
TLB_INFO_Name
TLB_INFO_Description
TLB_INFO_Author
TLB_INFO_Version
TLB_INFO_Menu_Path
TLB_INFO_Category
TLB_INFO_User
TLB_INFO_File
TLB_INFO_Library
TLB_INFO_SAGA_Version
TLB_INFO_Count

Definition at line 613 of file tool.h.

◆ TSG_Tool_Error

enum TSG_Tool_Error
Enumerator
TOOL_ERROR_Unknown
TOOL_ERROR_Calculation

Definition at line 111 of file tool.h.

◆ TSG_Tool_Interactive_DragMode

enum TSG_Tool_Interactive_DragMode
Enumerator
TOOL_INTERACTIVE_DRAG_NONE
TOOL_INTERACTIVE_DRAG_LINE
TOOL_INTERACTIVE_DRAG_BOX
TOOL_INTERACTIVE_DRAG_CIRCLE

Definition at line 470 of file tool.h.

◆ TSG_Tool_Interactive_Mode

enum TSG_Tool_Interactive_Mode
Enumerator
TOOL_INTERACTIVE_UNDEFINED
TOOL_INTERACTIVE_LDOWN
TOOL_INTERACTIVE_LUP
TOOL_INTERACTIVE_LDCLICK
TOOL_INTERACTIVE_MDOWN
TOOL_INTERACTIVE_MUP
TOOL_INTERACTIVE_MDCLICK
TOOL_INTERACTIVE_RDOWN
TOOL_INTERACTIVE_RUP
TOOL_INTERACTIVE_RDCLICK
TOOL_INTERACTIVE_MOVE
TOOL_INTERACTIVE_MOVE_LDOWN
TOOL_INTERACTIVE_MOVE_MDOWN
TOOL_INTERACTIVE_MOVE_RDOWN

Definition at line 450 of file tool.h.

◆ TSG_Tool_Script_Type

enum TSG_Tool_Script_Type
Enumerator
TOOL_SCRIPT_CMD_SHELL
TOOL_SCRIPT_CMD_BATCH
TOOL_SCRIPT_CHAIN
TOOL_SCRIPT_PYTHON
TOOL_SCRIPT_PYTHON_WRAP_NAME
TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
TOOL_SCRIPT_PYTHON_WRAP_ID
TOOL_SCRIPT_PYTHON_WRAP_ID_CALL

Definition at line 119 of file tool.h.

◆ TSG_Tool_Type

enum TSG_Tool_Type
Enumerator
TOOL_TYPE_Base
TOOL_TYPE_Interactive
TOOL_TYPE_Grid
TOOL_TYPE_Grid_Interactive
TOOL_TYPE_Chain

Definition at line 100 of file tool.h.

Variable Documentation

◆ TLB_Interface

CSG_Tool_Library_Interface TLB_Interface
extern
CSG_Tool_Library_Interface
Definition: tool.h:635
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
CSG_Tool_Library_Interface::Create
bool Create(const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool)
Definition: tool_library_interface.cpp:80
SG_Char
#define SG_Char
Definition: api_core.h:530
_SAGA_DLL_EXPORT
#define _SAGA_DLL_EXPORT
Definition: api_core.h:86
TLB_Interface
CSG_Tool_Library_Interface TLB_Interface
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool.h Source File

  • saga_core
  • saga_api
tool.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__tool_H
54 #define HEADER_INCLUDED__SAGA_API__tool_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
74 // //
76 // //
77 // //
79
80 //---------------------------------------------------------
81 #include "parameters.h"
82
83
85 // //
86 // //
87 // //
89
90 //---------------------------------------------------------
91 typedef enum
92 {
93 SG_SUMMARY_FMT_FLAT = 0,
94 SG_SUMMARY_FMT_HTML,
95 SG_SUMMARY_FMT_XML
96 }
97 TSG_Summary_Format;
98
99 //---------------------------------------------------------
100 typedef enum
101 {
102 TOOL_TYPE_Base = 0,
103 TOOL_TYPE_Interactive,
104 TOOL_TYPE_Grid,
105 TOOL_TYPE_Grid_Interactive,
106 TOOL_TYPE_Chain
107 }
108 TSG_Tool_Type;
109
110 //---------------------------------------------------------
111 typedef enum
112 {
113 TOOL_ERROR_Unknown = 0,
114 TOOL_ERROR_Calculation
115 }
116 TSG_Tool_Error;
117
118 //---------------------------------------------------------
119 typedef enum
120 {
121 TOOL_SCRIPT_CMD_SHELL = 0,
122 TOOL_SCRIPT_CMD_BATCH,
123 TOOL_SCRIPT_CHAIN,
124 TOOL_SCRIPT_PYTHON,
125 TOOL_SCRIPT_PYTHON_WRAP_NAME,
126 TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL,
127 TOOL_SCRIPT_PYTHON_WRAP_ID,
128 TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
129 }
130 TSG_Tool_Script_Type;
131
132
134 // //
135 // CSG_Tool //
136 // //
138
139 //---------------------------------------------------------
147 //---------------------------------------------------------
148 class SAGA_API_DLL_EXPORT CSG_Tool
149 {
150 friend class CSG_Tool_Interactive_Base;
151 friend class CSG_Tool_Library_Interface;
152 friend class CSG_Tool_Chain;
153
154 public:
155
156 CSG_Tool(void);
157 virtual ~CSG_Tool(void);
158
159 virtual void Destroy (void);
160
161 virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Base ); }
162
163 const CSG_String & Get_ID (void) const { return( m_ID ); }
164
165 const CSG_String & Get_Library (void) const;
166 const CSG_String & Get_File_Name (void) const; // Returns the file name of the tool's library or, if this is a tool chain, the associated XML file.
167 const CSG_String & Get_Name (void) const;
168 const CSG_String & Get_Author (void) const;
169 const CSG_String & Get_Version (void) const;
170 const CSG_String & Get_Description (void) const;
171 const CSG_Strings & Get_References (void) const;
172 const SG_Char * Get_Icon (void) { return( NULL ); }
173 CSG_String Get_Summary (bool bParameters = true, const CSG_String &Menu = "", const CSG_String &Description = "", int Format = SG_SUMMARY_FMT_HTML);
174
175 virtual CSG_String Get_MenuPath (void) { return( SG_T("") ); }
176 virtual CSG_String Get_MenuPath (bool bSolved);
177
178 int Get_Parameters_Count (void) { return( m_npParameters ); }
179 CSG_Parameters * Get_Parameters (void) { return( &Parameters ); }
180 CSG_Parameters * Get_Parameters (int i) { return( i >= 0 && i < m_npParameters ? m_pParameters[i] : NULL ); }
181 CSG_Parameters * Get_Parameters (const CSG_String &Identifier);
182
183 CSG_Parameter * Get_Parameter (const CSG_String &ID) const { return( Parameters(ID) ); }
184 CSG_Parameter * Get_Parameter (const char *ID) const { return( Parameters(ID) ); }
185 CSG_Parameter * Get_Parameter (const wchar_t *ID) const { return( Parameters(ID) ); }
186 bool Set_Parameter (const CSG_String &ID, CSG_Parameter *pValue);
187 bool Set_Parameter (const char *ID, CSG_Parameter *pValue);
188 bool Set_Parameter (const wchar_t *ID, CSG_Parameter *pValue);
189 bool Set_Parameter (const CSG_String &ID, int Value, int Type = PARAMETER_TYPE_Undefined);
190 bool Set_Parameter (const char *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
191 bool Set_Parameter (const wchar_t *ID, int Value, int Type = PARAMETER_TYPE_Undefined);
192 bool Set_Parameter (const CSG_String &ID, double Value, int Type = PARAMETER_TYPE_Undefined);
193 bool Set_Parameter (const char *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
194 bool Set_Parameter (const wchar_t *ID, double Value, int Type = PARAMETER_TYPE_Undefined);
195 bool Set_Parameter (const CSG_String &ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
196 bool Set_Parameter (const char *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
197 bool Set_Parameter (const wchar_t *ID, void *Value, int Type = PARAMETER_TYPE_Undefined);
198 bool Set_Parameter (const CSG_String &ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
199 bool Set_Parameter (const char *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
200 bool Set_Parameter (const wchar_t *ID, const CSG_String &Value, int Type = PARAMETER_TYPE_Undefined);
201 bool Set_Parameter (const CSG_String &ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
202 bool Set_Parameter (const char *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
203 bool Set_Parameter (const wchar_t *ID, const char *Value, int Type = PARAMETER_TYPE_Undefined);
204 bool Set_Parameter (const CSG_String &ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
205 bool Set_Parameter (const char *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
206 bool Set_Parameter (const wchar_t *ID, const wchar_t *Value, int Type = PARAMETER_TYPE_Undefined);
207
208 bool Reset (bool bManager = true);
209 bool Reset_Manager (void);
210 bool Reset_Grid_System (void);
211
212 bool Update_Parameter_States (void);
213
214 void Set_Callback (bool bActive = true);
215
216 bool Set_Manager (class CSG_Data_Manager *pManager);
217 class CSG_Data_Manager * Get_Manager (void) const;
218 class CSG_Data_Manager * Create_Manager (void);
219 bool Delete_Manager (bool bDetachData = false, bool bReset = true);
220
221 bool Set_Grid_System (const CSG_Grid_System &System);
222 CSG_Grid_System * Get_Grid_System (void) const;
223
224 bool Settings_Push (class CSG_Data_Manager *pManager = NULL);
225 bool Settings_Pop (void);
226
227 virtual bool do_Sync_Projections (void) const { return( true ); }
228
229 virtual bool needs_GUI (void) const { return( false ); }
230 bool has_GUI (void) const;
231
232 virtual bool is_Grid (void) const { return( false ); }
233 virtual bool is_Interactive (void) const { return( false ); }
234 bool is_Progress (void) const { return( SG_UI_Process_Get_Okay(false) ); }
235 bool is_Executing (void) const { return( m_bExecutes ); }
236
237 void Set_Show_Progress (bool bOn = true);
238
239 virtual bool On_Before_Execution (void) { return( true ); }
240 virtual bool On_After_Execution (void) { return( true ); }
241
242 bool Execute (bool bAddHistory = false);
243
244 const SG_Char * Get_Execution_Info (void) const { return( m_Execution_Info ); }
245
246 CSG_String Get_Script (TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters = false);
247
248
249 protected:
250
251 CSG_Parameters Parameters;
252
253 CSG_MetaData History_Supplement;
254
255
256 //-----------------------------------------------------
257 void Set_Name (const CSG_String &String);
258 void Set_Author (const CSG_String &String);
259 void Set_Version (const CSG_String &String);
260 void Set_Description (const CSG_String &String);
261
262 void Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link = NULL, const SG_Char *Link_Text = NULL);
263 void Add_Reference (const CSG_String &Link, const SG_Char *Link_Text = NULL);
264
265 //-----------------------------------------------------
266 virtual bool On_Execute (void) = 0;
267
268 virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
269 virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
270
271 TSG_PFNC_Parameter_Changed Get_Parameter_Changed (void) { return( _On_Parameter_Changed ); }
272
273 //-----------------------------------------------------
274 CSG_Parameters * Add_Parameters (const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
275 bool Dlg_Parameters (const CSG_String &Identifier);
276 bool Dlg_Parameters (CSG_Parameters *pParameters, const CSG_String &Caption);
277
278 //-----------------------------------------------------
279 virtual bool Set_Progress (int Position, int Range ) const;
280 virtual bool Set_Progress (sLong Position, sLong Range ) const;
281 virtual bool Set_Progress (double Position, double Range = 1.) const;
282
283 bool Stop_Execution (bool bDialog = true);
284
285 void Message_Dlg (const CSG_String &Text, const SG_Char *Caption = NULL);
286 bool Message_Dlg_Confirm (const CSG_String &Text, const SG_Char *Caption = NULL);
287
288 void Message_Add (const CSG_String &Text, bool bNewLine = true);
289 void Message_Fmt (const char *Format, ...);
290 void Message_Fmt (const wchar_t *Format, ...);
291
292 bool Error_Set (TSG_Tool_Error Error_ID = TOOL_ERROR_Unknown);
293 bool Error_Set (const CSG_String &Text);
294 bool Error_Fmt (const char *Format, ...);
295 bool Error_Fmt (const wchar_t *Format, ...);
296
297 //-----------------------------------------------------
298 bool DataObject_Add (CSG_Data_Object *pDataObject, bool bUpdate = false);
299
300 void DataObject_Update_All (void);
301
302 bool DataObject_Set_History (CSG_Parameter *pParameter, CSG_MetaData *pHistory = NULL);
303
304 bool Get_Projection (CSG_Projection &Projection) const;
305
306
307 public: // static functions...
308
309 static bool Process_Get_Okay (bool bBlink = false);
310 static void Process_Set_Text (const CSG_String &Text);
311 static void Process_Set_Text (const char *Format, ...);
312 static void Process_Set_Text (const wchar_t *Format, ...);
313
314 static bool DataObject_Update (CSG_Data_Object *pDataObject , int Show = SG_UI_DATAOBJECT_UPDATE);
315 static bool DataObject_Update (CSG_Data_Object *pDataObject, double Minimum, double Maximum, int Show = SG_UI_DATAOBJECT_UPDATE);
316
317 static bool DataObject_Get_Colors (CSG_Data_Object *pDataObject, CSG_Colors &Colors);
318 static bool DataObject_Set_Colors (CSG_Data_Object *pDataObject, const CSG_Colors &Colors);
319 static bool DataObject_Set_Colors (CSG_Data_Object *pDataObject, int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
320
321 static bool DataObject_Get_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters);
322 static bool DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Parameters &Parameters);
323 static bool DataObject_Set_Parameters (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy);
324
325 static CSG_Parameter * DataObject_Get_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID);
326 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Parameter *pParameter);
327 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, CSG_Data_Object *pCopy, const CSG_String &ID);
328 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, int Value);
329 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double Value);
330 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, void *Value);
331 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, const SG_Char *Value);
332 static bool DataObject_Set_Parameter (CSG_Data_Object *pDataObject, const CSG_String &ID, double loVal, double hiVal); // Range Parameter
333
334
335 private:
336
337 bool m_bExecutes, m_bError_Ignore, m_bShow_Progress, m_bWithGUI;
338
339 int m_npParameters;
340
341 CSG_Array m_Settings_Stack;
342
343 CSG_Parameters **m_pParameters;
344
345 CSG_String m_ID, m_Library, m_Library_Menu, m_File_Name, m_Author, m_Version, m_Execution_Info;
346
347
348 bool _Synchronize_DataObjects (void);
349
350 CSG_String _Get_Script_CMD (bool bHeader, bool bAllParameters, TSG_Tool_Script_Type Type);
351 void _Get_Script_CMD (CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, TSG_Tool_Script_Type Type);
352
353 CSG_String _Get_Script_Python (bool bHeader, bool bAllParameters);
354 void _Get_Script_Python (CSG_String &Script, CSG_Parameters *pParameters, bool bAllParameters, const CSG_String &Prefix = "");
355
356 CSG_String _Get_Script_Python_Wrap (bool bHeader, bool bName, bool bCall);
357 bool _Get_Script_Python_Wrap (const CSG_Parameter &Parameter, int Constraint, CSG_String &Arguments, CSG_String &Description, CSG_String &Code, bool bCall, const CSG_String &Prefix = "");
358
359 CSG_MetaData _Get_Output_History (void);
360 void _Set_Output_History (void);
361
362 void _Update_Parameter_States (CSG_Parameters *pParameters);
363
364 static int _On_Parameter_Changed (CSG_Parameter *pParameter, int Flags);
365
366 };
367
368
370 // //
371 // CSG_Tool_Grid //
372 // //
374
375 //---------------------------------------------------------
379 //---------------------------------------------------------
380 class SAGA_API_DLL_EXPORT CSG_Tool_Grid : public CSG_Tool
381 {
382 public:
383 CSG_Tool_Grid(void);
384 virtual ~CSG_Tool_Grid(void);
385
386 virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Grid ); }
387
388 const CSG_Grid_System & Get_System (void) const { return( *Parameters.Get_Grid_System() ); }
389 bool Set_System (const CSG_Grid_System &System);
390
391 virtual bool is_Grid (void) const { return( true ); }
392
393
394 protected:
395
396 virtual bool Set_Progress_Cells (sLong Cell) const;
397 virtual bool Set_Progress_Rows (int Row) const;
398
399 //-----------------------------------------------------
400 int Get_NX (void) const { return( Get_System().Get_NX () ); }
401 int Get_NY (void) const { return( Get_System().Get_NY () ); }
402 sLong Get_NCells (void) const { return( Get_System().Get_NCells () ); }
403 double Get_XMin (void) const { return( Get_System().Get_XMin () ); }
404 double Get_YMin (void) const { return( Get_System().Get_YMin () ); }
405 double Get_XMax (void) const { return( Get_System().Get_XMax () ); }
406 double Get_YMax (void) const { return( Get_System().Get_YMax () ); }
407 double Get_Cellsize (void) const { return( Get_System().Get_Cellsize() ); }
408 double Get_Cellarea (void) const { return( Get_System().Get_Cellarea() ); }
409
410 double Get_Length (int i) const { return( Get_System().Get_Length (i) ); }
411 double Get_UnitLength (int i) const { return( Get_System().Get_UnitLength(i) ); }
412 bool is_InGrid (int x, int y) const { return( Get_System().is_InGrid(x, y) ); }
413 bool is_InGrid (int x, int y, int Rand) const { return( Get_System().is_InGrid(x, y, Rand) ); }
414
415 static int Get_xTo (int i, int x = 0) { return( CSG_Grid_System::Get_xTo (i, x) ); }
416 static int Get_yTo (int i, int y = 0) { return( CSG_Grid_System::Get_yTo (i, y) ); }
417 static int Get_xFrom (int i, int x = 0) { return( CSG_Grid_System::Get_xFrom(i, x) ); }
418 static int Get_yFrom (int i, int y = 0) { return( CSG_Grid_System::Get_yFrom(i, y) ); }
419
420 //-----------------------------------------------------
421 void Lock_Create (void);
422 void Lock_Destroy (void);
423
424 bool is_Locked (int x, int y) { return( Lock_Get(x, y) != 0 ); }
425 char Lock_Get (int x, int y) { return( m_pLock && x >= 0 && x < Get_NX() && y >= 0 && y < Get_NY() ? m_pLock->asChar(x, y) : 0 ); }
426
427 void Lock_Set (int x, int y, char Value = 1)
428 {
429 if( m_pLock && x >= 0 && x < Get_NX() && y >= 0 && y < Get_NY() )
430 {
431 m_pLock->Set_Value(x, y, Value);
432 }
433 }
434
435
436 private:
437
438 CSG_Grid *m_pLock;
439
440 };
441
442
444 // //
445 // CSG_Tool_Interactive_Base //
446 // //
448
449 //---------------------------------------------------------
450 typedef enum
451 {
452 TOOL_INTERACTIVE_UNDEFINED = 0,
453 TOOL_INTERACTIVE_LDOWN,
454 TOOL_INTERACTIVE_LUP,
455 TOOL_INTERACTIVE_LDCLICK,
456 TOOL_INTERACTIVE_MDOWN,
457 TOOL_INTERACTIVE_MUP,
458 TOOL_INTERACTIVE_MDCLICK,
459 TOOL_INTERACTIVE_RDOWN,
460 TOOL_INTERACTIVE_RUP,
461 TOOL_INTERACTIVE_RDCLICK,
462 TOOL_INTERACTIVE_MOVE,
463 TOOL_INTERACTIVE_MOVE_LDOWN,
464 TOOL_INTERACTIVE_MOVE_MDOWN,
465 TOOL_INTERACTIVE_MOVE_RDOWN
466 }
467 TSG_Tool_Interactive_Mode;
468
469 //---------------------------------------------------------
470 typedef enum
471 {
472 TOOL_INTERACTIVE_DRAG_NONE = 0,
473 TOOL_INTERACTIVE_DRAG_LINE,
474 TOOL_INTERACTIVE_DRAG_BOX,
475 TOOL_INTERACTIVE_DRAG_CIRCLE
476 }
477 TSG_Tool_Interactive_DragMode;
478
479 //---------------------------------------------------------
480 #define TOOL_INTERACTIVE_KEY_LEFT 0x01
481 #define TOOL_INTERACTIVE_KEY_MIDDLE 0x02
482 #define TOOL_INTERACTIVE_KEY_RIGHT 0x04
483 #define TOOL_INTERACTIVE_KEY_SHIFT 0x08
484 #define TOOL_INTERACTIVE_KEY_ALT 0x10
485 #define TOOL_INTERACTIVE_KEY_CTRL 0x20
486
487 //---------------------------------------------------------
491 //---------------------------------------------------------
492 class SAGA_API_DLL_EXPORT CSG_Tool_Interactive_Base
493 {
494 friend class CSG_Tool_Interactive;
495 friend class CSG_Tool_Grid_Interactive;
496
497 public:
498 CSG_Tool_Interactive_Base(void);
499 virtual ~CSG_Tool_Interactive_Base(void);
500
501 bool Set_Projection (const CSG_Projection &Projection);
502
503 bool Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys);
504 bool Execute_Keyboard (int Character, int Keys);
505 bool Execute_Finish (void);
506
507 int Get_Drag_Mode (void) const { return( m_Drag_Mode ); }
508
509
510 protected:
511
512 const CSG_Projection & Get_Projection (void) const { return( m_Projection ); }
513
514 virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode);
515 virtual bool On_Execute_Keyboard (int Character);
516 virtual bool On_Execute_Finish (void);
517
518 const CSG_Point & Get_Position (void) const { return( m_Point ); }
519 double Get_xPosition (void) const { return( m_Point .x ); }
520 double Get_yPosition (void) const { return( m_Point .y ); }
521
522 const CSG_Point & Get_Position_Last (void) const { return( m_Point_Last ); }
523 double Get_xPosition_Last (void) const { return( m_Point_Last.x ); }
524 double Get_yPosition_Last (void) const { return( m_Point_Last.y ); }
525
526 bool is_Shift (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_SHIFT) != 0 ); }
527 bool is_Alt (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_ALT ) != 0 ); }
528 bool is_Ctrl (void) const { return( (m_Keys & TOOL_INTERACTIVE_KEY_CTRL ) != 0 ); }
529
530 void Set_Drag_Mode (int Drag_Mode);
531
532
533 private:
534
535 int m_Keys, m_Drag_Mode;
536
537 CSG_Point m_Point, m_Point_Last;
538
539 CSG_Projection m_Projection;
540
541 CSG_Tool *m_pTool;
542
543 };
544
545
547 // //
548 // CSG_Tool_Interactive //
549 // //
551
552 //---------------------------------------------------------
556 //---------------------------------------------------------
557 class SAGA_API_DLL_EXPORT CSG_Tool_Interactive : public CSG_Tool_Interactive_Base, public CSG_Tool
558 {
559 public:
560 CSG_Tool_Interactive(void);
561 virtual ~CSG_Tool_Interactive(void);
562
563 virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Interactive ); }
564
565 virtual bool needs_GUI (void) const { return( true ); }
566
567 virtual bool is_Interactive (void) const { return( true ); }
568
569 };
570
571
573 // //
574 // CSG_Tool_Grid_Interactive //
575 // //
577
578 //---------------------------------------------------------
582 //---------------------------------------------------------
583 class SAGA_API_DLL_EXPORT CSG_Tool_Grid_Interactive : public CSG_Tool_Interactive_Base, public CSG_Tool_Grid
584 {
585 public:
586 CSG_Tool_Grid_Interactive(void);
587 virtual ~CSG_Tool_Grid_Interactive(void);
588
589 virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Grid_Interactive ); }
590
591 virtual bool needs_GUI (void) const { return( true ); }
592
593 virtual bool is_Interactive (void) const { return( true ); }
594
595
596 protected:
597
598 bool Get_Grid_Pos (int &x, int &y) const;
599
600 int Get_xGrid (void) const;
601 int Get_yGrid (void) const;
602
603 };
604
605
607 // //
608 // Tool Library Interface Definitions //
609 // //
611
612 //---------------------------------------------------------
613 typedef enum
614 {
615 TLB_INFO_Name = 0,
616 TLB_INFO_Description,
617 TLB_INFO_Author,
618 TLB_INFO_Version,
619 TLB_INFO_Menu_Path,
620 TLB_INFO_Category,
621 TLB_INFO_User,
622 TLB_INFO_File,
623 TLB_INFO_Library,
624 TLB_INFO_SAGA_Version,
625 TLB_INFO_Count
626 }
627 TSG_TLB_Info;
628
629 //---------------------------------------------------------
630 typedef CSG_Tool * (* TSG_PFNC_TLB_Create_Tool) (int i);
631 typedef CSG_String (* TSG_PFNC_TLB_Get_Info ) (int i);
632
633 //---------------------------------------------------------
634 class SAGA_API_DLL_EXPORT CSG_Tool_Library_Interface
635 {
636 public:
637 CSG_Tool_Library_Interface(void);
638 virtual ~CSG_Tool_Library_Interface(void);
639
640 bool Create (const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool);
641 bool Destroy (void);
642
643 const CSG_String & Get_Info (int ID);
644
645 int Get_Count (void);
646 CSG_Tool * Get_Tool (int i);
647
648 CSG_Tool * Create_Tool (int i, bool bWithGUI = false);
649 bool Delete_Tool (CSG_Tool *pTool);
650 bool Delete_Tools (void);
651
652
653 private:
654
655 CSG_Strings m_Info;
656
657 CSG_Array_Pointer m_Tools, m_xTools;
658
659 TSG_PFNC_TLB_Create_Tool m_Fnc_Create_Tool;
660
661 };
662
663 //---------------------------------------------------------
664 #define SYMBOL_TLB_Initialize "TLB_Initialize"
665 typedef bool (* TSG_PFNC_TLB_Initialize) (const SG_Char *);
666
667 #define SYMBOL_TLB_Finalize "TLB_Finalize"
668 typedef bool (* TSG_PFNC_TLB_Finalize) (void);
669
670 #define SYMBOL_TLB_Get_Interface "TLB_Get_Interface"
671 typedef CSG_Tool_Library_Interface * (* TSG_PFNC_TLB_Get_Interface) (void);
672
673 //---------------------------------------------------------
674 #define TLB_INTERFACE_SKIP_TOOL ((CSG_Tool *)0x1)
675
676 //---------------------------------------------------------
677 #define TLB_INTERFACE_INITIALIZE CSG_Tool_Library_Interface TLB_Interface;\
678 \
679 extern "C" _SAGA_DLL_EXPORT CSG_Tool_Library_Interface * TLB_Get_Interface (void)\
680 {\
681 return( &TLB_Interface );\
682 }\
683 \
684 extern "C" _SAGA_DLL_EXPORT bool TLB_Initialize (const SG_Char *TLB_Path)\
685 {\
686 return( TLB_Interface.Create(SAGA_VERSION, TLB_Path, Get_Info, Create_Tool) );\
687 }\
688
689 //---------------------------------------------------------
690 #define TLB_INTERFACE_FINALIZE extern "C" _SAGA_DLL_EXPORT bool TLB_Finalize (void)\
691 {\
692 return( true );\
693 }\
694
695 //---------------------------------------------------------
696 #define TLB_INTERFACE TLB_INTERFACE_INITIALIZE TLB_INTERFACE_FINALIZE
697
698 //---------------------------------------------------------
699 #ifndef SWIG
700
701 extern CSG_Tool_Library_Interface TLB_Interface;
702
703 #endif // #ifdef SWIG
704
705
707 // //
708 // //
709 // //
711
712 //---------------------------------------------------------
713 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tool_H
TOOL_INTERACTIVE_LDCLICK
@ TOOL_INTERACTIVE_LDCLICK
Definition: tool.h:455
CSG_Tool_Grid::is_InGrid
bool is_InGrid(int x, int y) const
Definition: tool.h:412
CSG_Tool_Interactive
Definition: tool.h:558
CSG_Tool_Library_Interface
Definition: tool.h:635
CSG_Grid_System::Get_xTo
static int Get_xTo(int Direction, int x=0)
Definition: grid.h:310
CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base
CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:81
CSG_Tool_Grid::Get_yFrom
static int Get_yFrom(int i, int y=0)
Definition: tool.h:418
CSG_Tool::Reset_Manager
bool Reset_Manager(void)
Definition: tool.cpp:1237
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Tool_Grid::Lock_Get
char Lock_Get(int x, int y)
Definition: tool.h:425
CSG_Tool_Interactive_Base::Get_xPosition_Last
double Get_xPosition_Last(void) const
Definition: tool.h:523
CSG_Tool_Grid::Get_UnitLength
double Get_UnitLength(int i) const
Definition: tool.h:411
TOOL_INTERACTIVE_DRAG_LINE
@ TOOL_INTERACTIVE_DRAG_LINE
Definition: tool.h:473
TOOL_TYPE_Chain
@ TOOL_TYPE_Chain
Definition: tool.h:106
TOOL_SCRIPT_CHAIN
@ TOOL_SCRIPT_CHAIN
Definition: tool.h:123
CSG_Tool_Grid::Get_XMax
double Get_XMax(void) const
Definition: tool.h:405
TLB_INFO_Library
@ TLB_INFO_Library
Definition: tool.h:623
CSG_Tool::History_Supplement
CSG_MetaData History_Supplement
Definition: tool.h:253
CSG_Tool_Interactive_Base::On_Execute_Keyboard
virtual bool On_Execute_Keyboard(int Character)
Definition: tool_interactive_base.cpp:166
CSG_Tool_Interactive_Base::Get_Position_Last
const CSG_Point & Get_Position_Last(void) const
Definition: tool.h:522
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(int i)
Definition: tool.h:180
CSG_Tool_Interactive_Base::is_Shift
bool is_Shift(void) const
Definition: tool.h:526
CSG_Tool::Get_Summary
CSG_String Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
Definition: tool_summary.cpp:258
CSG_Tool::On_After_Execution
virtual bool On_After_Execution(void)
Definition: tool.h:240
CSG_Tool_Interactive_Base::On_Execute_Finish
virtual bool On_Execute_Finish(void)
Definition: tool_interactive_base.cpp:201
CSG_Tool::Get_Parameter_Changed
TSG_PFNC_Parameter_Changed Get_Parameter_Changed(void)
Definition: tool.h:271
TLB_INFO_Version
@ TLB_INFO_Version
Definition: tool.h:618
CSG_Tool_Grid::Get_NY
int Get_NY(void) const
Definition: tool.h:401
TLB_INFO_SAGA_Version
@ TLB_INFO_SAGA_Version
Definition: tool.h:624
CSG_Tool_Interactive_Base::Get_yPosition
double Get_yPosition(void) const
Definition: tool.h:520
CSG_Tool_Interactive_Base::~CSG_Tool_Interactive_Base
virtual ~CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:93
CSG_Grid_System
Definition: grid.h:200
CSG_Tool_Interactive::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:565
CSG_Tool_Grid::Get_Length
double Get_Length(int i) const
Definition: tool.h:410
CSG_Tool_Interactive_Base::is_Ctrl
bool is_Ctrl(void) const
Definition: tool.h:528
CSG_Tool_Grid::Get_yTo
static int Get_yTo(int i, int y=0)
Definition: tool.h:416
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const char *ID) const
Definition: tool.h:184
TOOL_INTERACTIVE_DRAG_NONE
@ TOOL_INTERACTIVE_DRAG_NONE
Definition: tool.h:472
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:201
CSG_Tool::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:229
TLB_INFO_Category
@ TLB_INFO_Category
Definition: tool.h:620
CSG_Tool_Interactive_Base::Execute_Position
bool Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
Definition: tool_interactive_base.cpp:108
CSG_Tool::is_Executing
bool is_Executing(void) const
Definition: tool.h:235
TOOL_SCRIPT_CMD_SHELL
@ TOOL_SCRIPT_CMD_SHELL
Definition: tool.h:121
CSG_Tool_Grid::Get_YMin
double Get_YMin(void) const
Definition: tool.h:404
TOOL_INTERACTIVE_KEY_CTRL
#define TOOL_INTERACTIVE_KEY_CTRL
Definition: tool.h:485
CSG_Tool
Definition: tool.h:149
CSG_Grid_System::Get_yTo
static int Get_yTo(int Direction, int y=0)
Definition: grid.h:324
TOOL_ERROR_Unknown
@ TOOL_ERROR_Unknown
Definition: tool.h:113
CSG_Tool_Interactive_Base::Get_Projection
const CSG_Projection & Get_Projection(void) const
Definition: tool.h:512
CSG_Tool::~CSG_Tool
virtual ~CSG_Tool(void)
Definition: tool.cpp:86
TOOL_INTERACTIVE_RUP
@ TOOL_INTERACTIVE_RUP
Definition: tool.h:460
SG_SUMMARY_FMT_HTML
@ SG_SUMMARY_FMT_HTML
Definition: tool.h:94
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL
Definition: tool.h:126
CSG_Tool_Grid
Definition: tool.h:381
TLB_INFO_User
@ TLB_INFO_User
Definition: tool.h:621
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
CSG_Tool::do_Sync_Projections
virtual bool do_Sync_Projections(void) const
Definition: tool.h:227
SG_SUMMARY_FMT_XML
@ SG_SUMMARY_FMT_XML
Definition: tool.h:95
TLB_INFO_Name
@ TLB_INFO_Name
Definition: tool.h:615
TOOL_INTERACTIVE_MOVE
@ TOOL_INTERACTIVE_MOVE
Definition: tool.h:462
CSG_Tool::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool.cpp:194
TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
@ TOOL_SCRIPT_PYTHON_WRAP_ID_CALL
Definition: tool.h:128
CSG_Tool_Interactive_Base::Get_xPosition
double Get_xPosition(void) const
Definition: tool.h:519
CSG_Tool_Interactive_Base::Execute_Keyboard
bool Execute_Keyboard(int Character, int Keys)
Definition: tool_interactive_base.cpp:141
CSG_Data_Manager::Get_Grid_System
CSG_Grid_Collection * Get_Grid_System(size_t i) const
Definition: data_manager.h:175
TSG_Tool_Interactive_Mode
TSG_Tool_Interactive_Mode
Definition: tool.h:451
TSG_Tool_Interactive_DragMode
TSG_Tool_Interactive_DragMode
Definition: tool.h:471
TOOL_INTERACTIVE_RDOWN
@ TOOL_INTERACTIVE_RDOWN
Definition: tool.h:459
CSG_Tool_Grid::Get_Cellarea
double Get_Cellarea(void) const
Definition: tool.h:408
CSG_Tool::Get_Version
const CSG_String & Get_Version(void) const
Definition: tool.cpp:167
CSG_Tool_Grid::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:386
TLB_INFO_Count
@ TLB_INFO_Count
Definition: tool.h:625
CSG_Tool_Interactive_Base::CSG_Tool_Interactive
friend class CSG_Tool_Interactive
Definition: tool.h:494
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1144
SG_UI_DATAOBJECT_UPDATE
@ SG_UI_DATAOBJECT_UPDATE
Definition: api_core.h:1509
TLB_INFO_Description
@ TLB_INFO_Description
Definition: tool.h:616
TSG_PFNC_TLB_Get_Info
CSG_String(* TSG_PFNC_TLB_Get_Info)(int i)
Definition: tool.h:631
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const wchar_t *ID) const
Definition: tool.h:185
CSG_Tool_Interactive_Base::Execute_Finish
bool Execute_Finish(void)
Definition: tool_interactive_base.cpp:172
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Parameter
Definition: parameters.h:207
CSG_Tool_Interactive_Base::Set_Drag_Mode
void Set_Drag_Mode(int Drag_Mode)
Definition: tool_interactive_base.cpp:212
SG_SUMMARY_FMT_FLAT
@ SG_SUMMARY_FMT_FLAT
Definition: tool.h:93
CSG_Tool_Interactive_Base::Set_Projection
bool Set_Projection(const CSG_Projection &Projection)
Definition: tool_interactive_base.cpp:102
PARAMETER_TYPE_Undefined
@ PARAMETER_TYPE_Undefined
Definition: parameters.h:165
TSG_Tool_Error
TSG_Tool_Error
Definition: tool.h:112
TOOL_INTERACTIVE_LDOWN
@ TOOL_INTERACTIVE_LDOWN
Definition: tool.h:453
TLB_INFO_File
@ TLB_INFO_File
Definition: tool.h:622
SG_COLORS_DEFAULT
@ SG_COLORS_DEFAULT
Definition: api_core.h:1285
CSG_Tool_Grid_Interactive::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:591
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(void)
Definition: tool.h:179
CSG_Tool_Grid::Lock_Set
void Lock_Set(int x, int y, char Value=1)
Definition: tool.h:427
CSG_Tool_Grid::Get_YMax
double Get_YMax(void) const
Definition: tool.h:406
TOOL_INTERACTIVE_MDCLICK
@ TOOL_INTERACTIVE_MDCLICK
Definition: tool.h:458
CSG_Tool::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool.h:175
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:128
CSG_Tool_Interactive_Base::Get_yPosition_Last
double Get_yPosition_Last(void) const
Definition: tool.h:524
CSG_Tool::Destroy
virtual void Destroy(void)
Definition: tool.cpp:115
CSG_Tool::Set_Callback
void Set_Callback(bool bActive=true)
Definition: tool.cpp:538
TSG_PFNC_TLB_Finalize
bool(* TSG_PFNC_TLB_Finalize)(void)
Definition: tool.h:668
CSG_Tool::is_Grid
virtual bool is_Grid(void) const
Definition: tool.h:232
TOOL_SCRIPT_CMD_BATCH
@ TOOL_SCRIPT_CMD_BATCH
Definition: tool.h:122
CSG_Tool::Get_Execution_Info
const SG_Char * Get_Execution_Info(void) const
Definition: tool.h:244
TOOL_SCRIPT_PYTHON
@ TOOL_SCRIPT_PYTHON
Definition: tool.h:124
TOOL_TYPE_Grid_Interactive
@ TOOL_TYPE_Grid_Interactive
Definition: tool.h:105
CSG_Tool_Grid_Interactive::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:589
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:163
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Tool::is_Progress
bool is_Progress(void) const
Definition: tool.h:234
CSG_Tool_Grid_Interactive::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:593
CSG_Tool_Grid::is_Grid
virtual bool is_Grid(void) const
Definition: tool.h:391
CSG_Tool_Interactive_Base::Get_Drag_Mode
int Get_Drag_Mode(void) const
Definition: tool.h:507
CSG_Strings
Definition: api_core.h:693
CSG_Tool::Update_Parameter_States
bool Update_Parameter_States(void)
Definition: tool.cpp:1285
CSG_Tool::On_Execute
virtual bool On_Execute(void)=0
TOOL_ERROR_Calculation
@ TOOL_ERROR_Calculation
Definition: tool.h:114
CSG_Tool_Interactive_Base::Get_Position
const CSG_Point & Get_Position(void) const
Definition: tool.h:518
CSG_Tool_Grid::Get_xTo
static int Get_xTo(int i, int x=0)
Definition: tool.h:415
CSG_Tool::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool.cpp:134
TOOL_INTERACTIVE_KEY_ALT
#define TOOL_INTERACTIVE_KEY_ALT
Definition: tool.h:484
parameters.h
CSG_Grid_System::Get_yFrom
static int Get_yFrom(int Direction, int y=0)
Definition: grid.h:339
TOOL_INTERACTIVE_UNDEFINED
@ TOOL_INTERACTIVE_UNDEFINED
Definition: tool.h:452
CSG_Tool_Chain
Definition: tool_chain.h:78
CSG_Projection
Definition: geo_tools.h:833
CSG_Tool_Grid::is_Locked
bool is_Locked(int x, int y)
Definition: tool.h:424
TLB_INFO_Author
@ TLB_INFO_Author
Definition: tool.h:617
CSG_Tool::Reset_Grid_System
bool Reset_Grid_System(void)
Definition: tool.cpp:1247
CSG_Tool_Grid::is_InGrid
bool is_InGrid(int x, int y, int Rand) const
Definition: tool.h:413
TOOL_INTERACTIVE_MOVE_LDOWN
@ TOOL_INTERACTIVE_MOVE_LDOWN
Definition: tool.h:463
TOOL_TYPE_Interactive
@ TOOL_TYPE_Interactive
Definition: tool.h:103
CSG_Tool_Interactive_Base::CSG_Tool_Grid_Interactive
friend class CSG_Tool_Grid_Interactive
Definition: tool.h:495
CSG_Tool_Chain::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool_chain.h:99
TOOL_SCRIPT_PYTHON_WRAP_NAME
@ TOOL_SCRIPT_PYTHON_WRAP_NAME
Definition: tool.h:125
SG_Char
#define SG_Char
Definition: api_core.h:530
TOOL_INTERACTIVE_MUP
@ TOOL_INTERACTIVE_MUP
Definition: tool.h:457
CSG_Array
Definition: api_core.h:308
TSG_PFNC_TLB_Initialize
bool(* TSG_PFNC_TLB_Initialize)(const SG_Char *)
Definition: tool.h:665
CSG_String
Definition: api_core.h:557
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Tool::Get_Author
const CSG_String & Get_Author(void) const
Definition: tool.cpp:156
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:549
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
TOOL_INTERACTIVE_LUP
@ TOOL_INTERACTIVE_LUP
Definition: tool.h:454
TOOL_INTERACTIVE_MOVE_MDOWN
@ TOOL_INTERACTIVE_MOVE_MDOWN
Definition: tool.h:464
TOOL_INTERACTIVE_RDCLICK
@ TOOL_INTERACTIVE_RDCLICK
Definition: tool.h:461
CSG_Tool::Get_Description
const CSG_String & Get_Description(void) const
Definition: tool.cpp:178
CSG_Tool_Grid::Get_NX
int Get_NX(void) const
Definition: tool.h:400
CSG_Tool_Interactive_Base
Definition: tool.h:493
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
CSG_Tool::Get_Parameter
CSG_Parameter * Get_Parameter(const CSG_String &ID) const
Definition: tool.h:183
CSG_Tool_Grid::Get_XMin
double Get_XMin(void) const
Definition: tool.h:403
CSG_Tool::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:233
TOOL_SCRIPT_PYTHON_WRAP_ID
@ TOOL_SCRIPT_PYTHON_WRAP_ID
Definition: tool.h:127
CSG_Grid_System::Get_xFrom
static int Get_xFrom(int Direction, int x=0)
Definition: grid.h:338
CSG_Tool_Interactive::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:567
TOOL_INTERACTIVE_DRAG_CIRCLE
@ TOOL_INTERACTIVE_DRAG_CIRCLE
Definition: tool.h:475
CSG_Tool_Grid_Interactive
Definition: tool.h:584
CSG_Grid
Definition: grid.h:473
CSG_Tool_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: tool.h:388
CSG_Tool::CSG_Tool
CSG_Tool(void)
Definition: tool.cpp:66
TSG_PFNC_Parameter_Changed
int(* TSG_PFNC_Parameter_Changed)(CSG_Parameter *pParameter, int Flags)
Definition: parameters.h:1646
TSG_PFNC_TLB_Create_Tool
CSG_Tool *(* TSG_PFNC_TLB_Create_Tool)(int i)
Definition: tool.h:630
TOOL_INTERACTIVE_DRAG_BOX
@ TOOL_INTERACTIVE_DRAG_BOX
Definition: tool.h:474
CSG_Tool_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: tool.h:402
TSG_Tool_Script_Type
TSG_Tool_Script_Type
Definition: tool.h:120
CSG_Tool_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: tool.h:407
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
CSG_Tool_Interactive_Base::is_Alt
bool is_Alt(void) const
Definition: tool.h:527
CSG_Tool_Interactive::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:563
CSG_Parameters
Definition: parameters.h:1650
TSG_TLB_Info
TSG_TLB_Info
Definition: tool.h:614
TOOL_INTERACTIVE_MOVE_RDOWN
@ TOOL_INTERACTIVE_MOVE_RDOWN
Definition: tool.h:465
TSG_Summary_Format
TSG_Summary_Format
Definition: tool.h:92
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:161
CSG_Tool::Get_Icon
const SG_Char * Get_Icon(void)
Definition: tool.h:172
TLB_Interface
CSG_Tool_Library_Interface TLB_Interface
TOOL_INTERACTIVE_KEY_SHIFT
#define TOOL_INTERACTIVE_KEY_SHIFT
Definition: tool.h:483
CSG_Tool::Get_Parameters_Count
int Get_Parameters_Count(void)
Definition: tool.h:178
CSG_Colors
Definition: api_core.h:1329
TLB_INFO_Menu_Path
@ TLB_INFO_Menu_Path
Definition: tool.h:619
TOOL_TYPE_Grid
@ TOOL_TYPE_Grid
Definition: tool.h:104
TOOL_INTERACTIVE_MDOWN
@ TOOL_INTERACTIVE_MDOWN
Definition: tool.h:456
CSG_Tool_Grid::Get_xFrom
static int Get_xFrom(int i, int x=0)
Definition: tool.h:417
CSG_Tool_Interactive_Base::On_Execute_Position
virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
Definition: tool_interactive_base.cpp:135
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_chain.cpp File Reference

  • saga_core
  • saga_api
Macros
tool_chain.cpp File Reference
#include "saga_api.h"
#include "tool_chain.h"

Go to the source code of this file.

Macros

#define | GET_XML_CONTENT(XML, ID, DEFAULT, TRANSLATE) (!XML(ID) ? CSG_String(DEFAULT) : !TRANSLATE ? XML[ID].Get_Content() : CSG_String(SG_Translate(XML[ID].Get_Content())))
#define | IS_TRUE_STRING(String) (!String.CmpNoCase("true") || !String.CmpNoCase("1"))
#define | IS_TRUE_PROPERTY(Item, Property) (Item.Cmp_Property(Property, "true", true) || Item.Cmp_Property(Property, "1"))
#define | Get_List_Count(p) (p->asGridList() ? p->asGridList()->Get_Grid_Count() : p->asList() ? p->asList()->Get_Item_Count() : 0)
#define | Get_List_Item(p, i) (p->asGridList() ? p->asGridList()->Get_Grid (i) : p->asList() ? p->asList()->Get_Item (i) : NULL)

Macro Definition Documentation

◆ Get_List_Count

#define Get_List_Count ( p ) (p->asGridList() ? p->asGridList()->Get_Grid_Count() : p->asList() ? p->asList()->Get_Item_Count() : 0)

Definition at line 68 of file tool_chain.cpp.

◆ Get_List_Item

#define Get_List_Item | ( | p,
 |  | i
 | ) | (p->asGridList() ? p->asGridList()->Get_Grid (i) : p->asList() ? p->asList()->Get_Item (i) : NULL)

Definition at line 69 of file tool_chain.cpp.

◆ GET_XML_CONTENT

#define GET_XML_CONTENT | ( | XML,
 |  | ID,
 |  | DEFAULT,
 |  | TRANSLATE
 | ) | (!XML(ID) ? CSG_String(DEFAULT) : !TRANSLATE ? XML[ID].Get_Content() : CSG_String(SG_Translate(XML[ID].Get_Content())))

Definition at line 63 of file tool_chain.cpp.

◆ IS_TRUE_PROPERTY

#define IS_TRUE_PROPERTY | ( | Item,
 |  | Property
 | ) | (Item.Cmp_Property(Property, "true", true) || Item.Cmp_Property(Property, "1"))

Definition at line 66 of file tool_chain.cpp.

◆ IS_TRUE_STRING

#define IS_TRUE_STRING ( String ) (!String.CmpNoCase("true") || !String.CmpNoCase("1"))

Definition at line 65 of file tool_chain.cpp.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_chain.cpp Source File

  • saga_core
  • saga_api
tool_chain.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_chain.cpp //
15 // //
16 // Copyright (C) 2014 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "saga_api.h"
52
53 #include "tool_chain.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 #define GET_XML_CONTENT(XML, ID, DEFAULT, TRANSLATE) (!XML(ID) ? CSG_String(DEFAULT) : !TRANSLATE ? XML[ID].Get_Content() : CSG_String(SG_Translate(XML[ID].Get_Content())))
64
65 #define IS_TRUE_STRING(String) (!String.CmpNoCase("true") || !String.CmpNoCase("1"))
66 #define IS_TRUE_PROPERTY(Item, Property) (Item.Cmp_Property(Property, "true", true) || Item.Cmp_Property(Property, "1"))
67
68 #define Get_List_Count(p) (p->asGridList() ? p->asGridList()->Get_Grid_Count() : p->asList() ? p->asList()->Get_Item_Count() : 0)
69 #define Get_List_Item(p, i) (p->asGridList() ? p->asGridList()->Get_Grid (i) : p->asList() ? p->asList()->Get_Item (i) : NULL)
70
71
73 // //
74 // //
75 // //
77
78 //---------------------------------------------------------
79 CSG_Tool_Chain::CSG_Tool_Chain(void)
80 {
81 // nop
82 }
83
84 //---------------------------------------------------------
85 CSG_Tool_Chain::CSG_Tool_Chain(const CSG_Tool_Chain &Tool, bool bWithGUI)
86 {
87 Create(Tool, bWithGUI);
88 }
89
90 //---------------------------------------------------------
91 CSG_Tool_Chain::CSG_Tool_Chain(const CSG_String &File)
92 {
93 Create(File);
94 }
95
96 //---------------------------------------------------------
97 CSG_Tool_Chain::CSG_Tool_Chain(const CSG_MetaData &Chain)
98 {
99 Create(Chain);
100 }
101
102 //---------------------------------------------------------
103 CSG_Tool_Chain::~CSG_Tool_Chain(void)
104 {
105 Reset();
106 }
107
108 //---------------------------------------------------------
109 void CSG_Tool_Chain::Reset(void)
110 {
111 Parameters.Del_Parameters();
112 Parameters.Del_References();
113
114 m_Chain.Destroy();
115
116 m_Conditions.Destroy();
117
118 m_Menu.Clear();
119 }
120
121 //---------------------------------------------------------
122 void CSG_Tool_Chain::Set_Library_Menu(const CSG_String &Menu)
123 {
124 m_Library_Menu = Menu;
125 }
126
127
129 // //
131
132 //---------------------------------------------------------
133 bool CSG_Tool_Chain::Create(const CSG_Tool_Chain &Tool, bool bWithGUI)
134 {
135 if( !Create(Tool.m_Chain) )
136 {
137 return( false );
138 }
139
140 m_ID = Tool.m_ID;
141 m_Library = Tool.m_Library;
142 m_Library_Menu = Tool.m_Library_Menu;
143 m_File_Name = Tool.m_File_Name;
144 m_bWithGUI = bWithGUI;
145
146 return( true );
147 }
148
149 //---------------------------------------------------------
150 bool CSG_Tool_Chain::Create(const CSG_String &File)
151 {
152 CSG_MetaData Chain;
153
154 if( File.Right(sizeof(".pyt.xml")).Make_Lower().Find(".pyt.xml") >= 0 )
155 {
156 return( false );
157 }
158
159 if( !Chain.Load(File) )
160 {
161 Error_Fmt("%s: %s", _TL("failed to load or parse xml file"), File.c_str());
162
163 return( false );
164 }
165
166 if( Chain.Cmp_Name("toolchains") ) // don't report any error, this xml-file provides info for a category of tool chains
167 {
168 return( false );
169 }
170
171 if( !Chain.Cmp_Name("toolchain") || !Chain("identifier") || !Chain("parameters") )
172 {
173 Error_Fmt("%s: %s", _TL("xml file is not a valid tool chain"), File.c_str());
174
175 return( false );
176 }
177
178 //-----------------------------------------------------
179 SG_UI_Msg_Add(CSG_String::Format("%s: %s...", File.Cmp(m_File_Name) ? _TL("Loading tool chain") : _TL("Reloading tool chain"), File.c_str()), true);
180
181 if( Create(Chain) )
182 {
183 m_File_Name = File;
184
185 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
186
187 return( true );
188 }
189
190 m_File_Name.Clear(); Reset();
191
192 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
193
194 return( false );
195 }
196
197 //---------------------------------------------------------
198 bool CSG_Tool_Chain::Create(const CSG_MetaData &Chain)
199 {
200 if( !Chain.Cmp_Name("toolchain") || !Chain("identifier") || !Chain("parameters") || !Chain("tools") )
201 {
202 return( false );
203 }
204
205 if( SG_Compare_Version(Chain.Get_Property("saga-version"), "2.1.3") < 0 )
206 {
207 Error_Fmt("%s %s: %s", _TL("Warning"), _TL("unsupported tool chain version"), Chain.Get_Property("saga-version"));
208 }
209
210 //-----------------------------------------------------
211 Reset();
212
213 m_Chain = Chain;
214 m_ID = GET_XML_CONTENT(m_Chain, "identifier" , "" , false) ;
215 m_Library = GET_XML_CONTENT(m_Chain, "group" , "toolchains" , false) ;
216 m_Menu = GET_XML_CONTENT(m_Chain, "menu" , "" , true) ;
217 Set_Name (GET_XML_CONTENT(m_Chain, "name" , _TL("Not Named" ), true));
218 Set_Author (GET_XML_CONTENT(m_Chain, "author" , _TL("unknown" ), false));
219 Set_Description (GET_XML_CONTENT(m_Chain, "description", _TL("no description"), true));
220
221 if( m_Library.is_Empty() )
222 {
223 m_Library = "toolchains";
224 }
225
226 Add_References();
227
228 CSG_String Description = Get_Description();
229 Description.Replace("[[", "<"); // support for xml/html tags
230 Description.Replace("]]", ">");
231 Set_Description(Description);
232
233 if( !m_Menu.is_Empty() && (m_Menu.Length() < 2 || m_Menu[1] != ':') )
234 {
235 if( IS_TRUE_PROPERTY(m_Chain["menu"], "absolute") )
236 m_Menu.Prepend("A:"); // absolute path
237 else
238 m_Menu.Prepend("R:"); // relative path
239 }
240
241 m_bAddHistory = IS_TRUE_PROPERTY(m_Chain["tools"], "history");
242
243 //-----------------------------------------------------
244 for(int i=0; i<m_Chain["parameters"].Get_Children_Count(); i++)
245 {
246 const CSG_MetaData &Parameter = m_Chain["parameters"][i];
247
248 CSG_String ID = Parameter.Get_Property("varname");
249
250 if( ID.is_Empty() || Parameters(ID) )
251 {
252 continue;
253 }
254
255 if( Parameter.Get_Property("with_gui") && !IS_TRUE_PROPERTY(Parameter, "with_gui") && has_GUI() == false )
256 {
257 continue;
258 }
259
260 if( Parameter.Get_Property("with_cmd") && !IS_TRUE_PROPERTY(Parameter, "with_cmd") && has_GUI() != false )
261 {
262 continue;
263 }
264
265 //-------------------------------------------------
266 int Constraint = 0;
267 CSG_String Value;
268 bool bMin = false, bMax = false;
269 double Min = 0. , Max = 0.;
270
271 if( Parameter.Cmp_Name("input") )
272 {
273 Constraint = IS_TRUE_PROPERTY(Parameter, "optional") ? PARAMETER_INPUT_OPTIONAL : PARAMETER_INPUT;
274 }
275 else if( Parameter.Cmp_Name("output") )
276 {
277 Constraint = IS_TRUE_PROPERTY(Parameter, "optional") ? PARAMETER_OUTPUT_OPTIONAL : PARAMETER_OUTPUT;
278 }
279 else if( Parameter.Cmp_Name("option") && Parameter("value") )
280 {
281 Value = Parameter.Get_Content("value");
282
283 bMin = Parameter["value"].Get_Property("min", Min);
284 bMax = Parameter["value"].Get_Property("max", Max);
285 }
286
287 //-------------------------------------------------
288 if( Parameter("condition") )
289 {
290 CSG_MetaData &Conditions = *m_Conditions.Add_Child(ID);
291
292 for(int j=0; j<Parameter.Get_Children_Count(); j++) // there might be more than one condition to be checked
293 {
294 if( Parameter[j].Cmp_Name("condition") )
295 {
296 Conditions.Add_Child(Parameter[j]);
297 }
298 }
299 }
300
301 //-------------------------------------------------
302 CSG_String Name = SG_Translate(Parameter.Get_Content("name" ));
303 CSG_String Desc = SG_Translate(Parameter.Get_Content("description"));
304
305 CSG_Parameter *pParent = Parameters(Parameter.Get_Property("parent"));
306 CSG_String ParentID(pParent ? pParent->Get_Identifier() : SG_T(""));
307
308 //-------------------------------------------------
309 switch( SG_Parameter_Type_Get_Type(Parameter.Get_Property("type")) )
310 {
311 case PARAMETER_TYPE_Node : Parameters.Add_Node (ParentID, ID, Name, Desc); break;
312
313 case PARAMETER_TYPE_Bool : Parameters.Add_Bool (ParentID, ID, Name, Desc, IS_TRUE_STRING(Value)); break;
314 case PARAMETER_TYPE_Int : Parameters.Add_Int (ParentID, ID, Name, Desc, Value.asInt (), (int)Min, bMin, (int)Max, bMax); break;
315 case PARAMETER_TYPE_Double : Parameters.Add_Double (ParentID, ID, Name, Desc, Value.asDouble(), Min, bMin, Max, bMax); break;
316 case PARAMETER_TYPE_Degree : Parameters.Add_Degree (ParentID, ID, Name, Desc, Value.asDouble(), Min, bMin, Max, bMax); break;
317
318 case PARAMETER_TYPE_Date : Parameters.Add_Date (ParentID, ID, Name, Desc, 0.)->Set_Value(Value); break;
319
320 case PARAMETER_TYPE_Range : Parameters.Add_Range (ParentID, ID, Name, Desc, Value.BeforeFirst(';').asDouble(), Value.AfterFirst(';').asDouble(), Min, bMin, Max, bMax); break;
321 case PARAMETER_TYPE_Data_Type :
322 case PARAMETER_TYPE_Choice : Parameters.Add_Choice (ParentID, ID, Name, Desc, Parameter.Get_Content("choices"))->Set_Value(Value); break;
323 case PARAMETER_TYPE_Choices : Parameters.Add_Choices (ParentID, ID, Name, Desc, Parameter.Get_Content("choices"))->Set_Value(Value); break;
324
325 case PARAMETER_TYPE_String : Parameters.Add_String (ParentID, ID, Name, Desc, Value, false); break;
326 case PARAMETER_TYPE_Text : Parameters.Add_String (ParentID, ID, Name, Desc, Value, true); break;
327
328 case PARAMETER_TYPE_FilePath : Parameters.Add_FilePath (ParentID, ID, Name, Desc, Parameter.Get_Content("filter"), Value,
329 IS_TRUE_PROPERTY(Parameter, "save" ),
330 IS_TRUE_PROPERTY(Parameter, "directory"),
331 IS_TRUE_PROPERTY(Parameter, "multiple" )
332 ); break;
333
334 case PARAMETER_TYPE_Font : break;
335 case PARAMETER_TYPE_Color : Parameters.Add_Color (ParentID, ID, Name, Desc, Value.asInt()); break;
336 case PARAMETER_TYPE_Colors : Parameters.Add_Colors (ParentID, ID, Name, Desc); break;
337 case PARAMETER_TYPE_FixedTable : Parameters.Add_FixedTable (ParentID, ID, Name, Desc)->Serialize(*Parameter("option"), false); break;
338
339 case PARAMETER_TYPE_Grid_System : Parameters.Add_Grid_System (ParentID, ID, Name, Desc); break;
340
341 case PARAMETER_TYPE_Table_Field : Parameters.Add_Table_Field (ParentID, ID, Name, Desc, (!Value.CmpNoCase("true") || !Value.CmpNoCase("1"))); break;
342 case PARAMETER_TYPE_Table_Fields : Parameters.Add_Table_Fields (ParentID, ID, Name, Desc); break;
343
344 case PARAMETER_TYPE_Grid : Parameter.Cmp_Property("target", "none")
345 ? Parameters.Add_Grid_Output ( "", ID, Name, Desc)
346 : Parameters.Add_Grid (ParentID, ID, Name, Desc, Constraint); break;
347
348 case PARAMETER_TYPE_Grids : Parameter.Cmp_Property("target", "none")
349 ? Parameters.Add_Grids_Output ( "", ID, Name, Desc)
350 : Parameters.Add_Grids (ParentID, ID, Name, Desc, Constraint); break;
351
352 case PARAMETER_TYPE_Table : Parameters.Add_Table (ParentID, ID, Name, Desc, Constraint); break;
353
354 case PARAMETER_TYPE_Shapes : Parameters.Add_Shapes (ParentID, ID, Name, Desc, Constraint,
355 Parameter.Cmp_Property("feature_type", "point" ) ? SHAPE_TYPE_Point :
356 Parameter.Cmp_Property("feature_type", "points" ) ? SHAPE_TYPE_Points :
357 Parameter.Cmp_Property("feature_type", "line" ) ? SHAPE_TYPE_Line :
358 Parameter.Cmp_Property("feature_type", "polygon") ? SHAPE_TYPE_Polygon : SHAPE_TYPE_Undefined
359 ); break;
360
361 case PARAMETER_TYPE_TIN : Parameters.Add_TIN (ParentID, ID, Name, Desc, Constraint); break;
362 case PARAMETER_TYPE_PointCloud : Parameters.Add_PointCloud (ParentID, ID, Name, Desc, Constraint); break;
363
364 case PARAMETER_TYPE_Grid_List : Parameters.Add_Grid_List (ParentID, ID, Name, Desc, Constraint, !IS_TRUE_PROPERTY(Parameter, "no_system")); break;
365 case PARAMETER_TYPE_Grids_List : Parameters.Add_Grids_List (ParentID, ID, Name, Desc, Constraint, !IS_TRUE_PROPERTY(Parameter, "no_system")); break;
366 case PARAMETER_TYPE_Table_List : Parameters.Add_Table_List (ParentID, ID, Name, Desc, Constraint); break;
367 case PARAMETER_TYPE_Shapes_List : Parameters.Add_Shapes_List (ParentID, ID, Name, Desc, Constraint); break;
368 case PARAMETER_TYPE_TIN_List : Parameters.Add_TIN_List (ParentID, ID, Name, Desc, Constraint); break;
369 case PARAMETER_TYPE_PointCloud_List : Parameters.Add_PointCloud_List(ParentID, ID, Name, Desc, Constraint); break;
370
371 case PARAMETER_TYPE_DataObject_Output: break;
372 case PARAMETER_TYPE_Parameters : break; // to do ?
373
374 default: break;
375 }
376 }
377
378 //-----------------------------------------------------
379 return( is_Okay() );
380 }
381
382
384 // //
386
387 //---------------------------------------------------------
388 bool CSG_Tool_Chain::do_Sync_Projections(void) const
389 {
390 return( !m_Chain("CRS_SYNC") || IS_TRUE_STRING(m_Chain["CRS_SYNC"].Get_Content()) );
391 }
392
393 //---------------------------------------------------------
394 void CSG_Tool_Chain::Add_References(void)
395 {
396 for(int i=0; i<m_Chain.Get_Children_Count(); i++)
397 {
398 if( !m_Chain[i].Get_Name().CmpNoCase("REFERENCE") )
399 {
400 CSG_String Authors, Year, Title, Where, Link, Link_Text, DOI;
401
402 if( m_Chain[i]("AUTHORS" ) ) Authors = m_Chain[i].Get_Content("AUTHORS" );
403 if( m_Chain[i]("YEAR" ) ) Year = m_Chain[i].Get_Content("YEAR" );
404 if( m_Chain[i]("TITLE" ) ) Title = m_Chain[i].Get_Content("TITLE" );
405 if( m_Chain[i]("WHERE" ) ) Where = m_Chain[i].Get_Content("WHERE" );
406 if( m_Chain[i]("LINK" ) ) Link = m_Chain[i].Get_Content("LINK" );
407 if( m_Chain[i]("LINK_TEXT") ) Link_Text = m_Chain[i].Get_Content("LINK_TEXT");
408 if( m_Chain[i]("DOI" ) ) DOI = m_Chain[i].Get_Content("DOI" );
409
410 if( !DOI.is_Empty() )
411 {
412 Link = "https://doi.org/" + DOI; Link_Text = "doi:" + DOI;
413 }
414
415 if( !Authors.is_Empty() && !Year.is_Empty() && !Title.is_Empty() )
416 {
417 Add_Reference(Authors, Year, Title, Where, Link.c_str(), Link_Text.c_str());
418 }
419 else if( !Link.is_Empty() )
420 {
421 Add_Reference(Link, Link_Text.c_str());
422 }
423 }
424 }
425 }
426
427
429 // //
431
432 //---------------------------------------------------------
433 int CSG_Tool_Chain::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
434 {
435 for(int iParameter=0; iParameter<m_Conditions.Get_Children_Count(); iParameter++)
436 {
437 const CSG_MetaData &Conditions = m_Conditions[iParameter];
438
439 if( (*pParameters)(Conditions.Get_Name()) )
440 {
441 bool bEnable = true;
442
443 for(int iCondition=0; bEnable && iCondition<Conditions.Get_Children_Count(); iCondition++)
444 {
445 bEnable = Check_Condition(Conditions[iCondition], pParameters);
446 }
447
448 (*pParameters)(Conditions.Get_Name())->Set_Enabled(bEnable);
449 }
450 }
451
452 return( CSG_Tool::On_Parameters_Enable(pParameters, pParameter) );
453 }
454
455
457 // //
459
460 //---------------------------------------------------------
461 bool CSG_Tool_Chain::On_Execute(void)
462 {
463 bool bResult = Data_Initialize();
464
465 if( !bResult )
466 {
467 Error_Set(_TL("no data objects"));
468 }
469
470 for(int i=0; bResult && i<m_Chain["tools"].Get_Children_Count(); i++)
471 {
472 bResult = Tool_Run(m_Chain["tools"][i]);
473 }
474
475 Data_Finalize();
476
477 return( bResult );
478 }
479
480
482 // //
484
485 //---------------------------------------------------------
486 bool CSG_Tool_Chain::Data_Add(const CSG_String &ID, CSG_Parameter *pData)
487 {
488 if( !pData )
489 {
490 return( false );
491 }
492
493 CSG_Parameter *pParameter = m_Data(ID); // check if the local data manager already has a parameter with this identifier
494
495 if( pParameter ) // it has, so don't add twice!
496 {
497 if( pParameter->is_Input() && pParameter->Get_Type() != pData->Get_Type() ) // don't allow to change parameter's data object type!
498 {
499 Error_Fmt("%s\n[%s] %s <> %s", _TL("Tool chain uses same variable name for different data object types."),
500 ID.c_str(), pParameter->Get_Type_Identifier().c_str(), pData->Get_Type_Identifier().c_str()
501 );
502
503 return( false );
504 }
505 }
506
507 //-----------------------------------------------------
508 else switch( pData->Get_Type() )
509 {
510 case PARAMETER_TYPE_PointCloud : pParameter = m_Data.Add_PointCloud ("", ID, "", "", 0 ); break;
511 case PARAMETER_TYPE_Grid : pParameter = m_Data.Add_Grid ("", ID, "", "", 0 ); break;
512 case PARAMETER_TYPE_Grids : pParameter = m_Data.Add_Grids ("", ID, "", "", 0 ); break;
513 case PARAMETER_TYPE_Table : pParameter = m_Data.Add_Table ("", ID, "", "", 0 ); break;
514 case PARAMETER_TYPE_Shapes : pParameter = m_Data.Add_Shapes ("", ID, "", "", 0 ); break;
515 case PARAMETER_TYPE_TIN : pParameter = m_Data.Add_TIN ("", ID, "", "", 0 ); break;
516
517 case PARAMETER_TYPE_PointCloud_List: pParameter = m_Data.Add_PointCloud_List("", ID, "", "", 0 ); break;
518 case PARAMETER_TYPE_Grid_List : pParameter = m_Data.Add_Grid_List ("", ID, "", "", 0, false); break;
519 case PARAMETER_TYPE_Grids_List : pParameter = m_Data.Add_Grids_List ("", ID, "", "", 0, false); break;
520 case PARAMETER_TYPE_Table_List : pParameter = m_Data.Add_Table_List ("", ID, "", "", 0 ); break;
521 case PARAMETER_TYPE_Shapes_List : pParameter = m_Data.Add_Shapes_List ("", ID, "", "", 0 ); break;
522 case PARAMETER_TYPE_TIN_List : pParameter = m_Data.Add_TIN_List ("", ID, "", "", 0 ); break;
523
524 case PARAMETER_TYPE_DataObject_Output:
525 switch( pData->Get_DataObject_Type() )
526 {
527 case SG_DATAOBJECT_TYPE_PointCloud: pParameter = m_Data.Add_PointCloud ("", ID, "", "", 0 ); break;
528 case SG_DATAOBJECT_TYPE_Grid : pParameter = m_Data.Add_Grid ("", ID, "", "", 0 ); break;
529 case SG_DATAOBJECT_TYPE_Grids : pParameter = m_Data.Add_Grids ("", ID, "", "", 0 ); break;
530 case SG_DATAOBJECT_TYPE_Table : pParameter = m_Data.Add_Table ("", ID, "", "", 0 ); break;
531 case SG_DATAOBJECT_TYPE_Shapes : pParameter = m_Data.Add_Shapes ("", ID, "", "", 0 ); break;
532 case SG_DATAOBJECT_TYPE_TIN : pParameter = m_Data.Add_TIN ("", ID, "", "", 0 ); break;
533 default:
534 return( true );
535 }
536 break;
537
538 default:
539 return( true );
540 }
541
542 //-----------------------------------------------------
543 if( pData->is_DataObject() )
544 {
545 if( pParameter->is_DataObject() )
546 {
547 pParameter->Set_Value(pData->asDataObject());
548 }
549 else
550 {
551 pParameter->asList()->Add_Item(pData->asDataObject());
552 }
553
554 m_Data_Manager.Add(pData->asDataObject());
555 }
556 else if( pData->is_DataObject_List() && pParameter->is_DataObject_List() )
557 {
558 for(int i=0; i<Get_List_Count(pData); i++)
559 {
560 pParameter->asList()->Add_Item(Get_List_Item(pData, i));
561 m_Data_Manager.Add (Get_List_Item(pData, i));
562 }
563 }
564
565 return( true );
566 }
567
568 //---------------------------------------------------------
569 bool CSG_Tool_Chain::Data_Add_TempList(const CSG_String &ID, const CSG_String &Type)
570 {
571 if( !m_Data(ID) )
572 {
573 switch( SG_Parameter_Type_Get_Type(Type) )
574 {
575 case PARAMETER_TYPE_PointCloud_List: m_Data.Add_PointCloud_List("", ID, "", "", 0 ); break;
576 case PARAMETER_TYPE_Grid_List : m_Data.Add_Grid_List ("", ID, "", "", 0, false); break;
577 case PARAMETER_TYPE_Grids_List : m_Data.Add_Grids_List ("", ID, "", "", 0, false); break;
578 case PARAMETER_TYPE_Table_List : m_Data.Add_Table_List ("", ID, "", "", 0 ); break;
579 case PARAMETER_TYPE_Shapes_List : m_Data.Add_Shapes_List ("", ID, "", "", 0 ); break;
580 case PARAMETER_TYPE_TIN_List : m_Data.Add_TIN_List ("", ID, "", "", 0 ); break;
581
582 default:
583 Error_Fmt("%s: %s [%s|%s]", SG_T("datalist"), _TL("unsupported data list type"), ID.c_str(), Type.c_str());
584
585 return( false );
586 }
587 }
588
589 return( true );
590 }
591
592 //---------------------------------------------------------
593 bool CSG_Tool_Chain::Data_Del_Temp(const CSG_String &ID, bool bData)
594 {
595 CSG_Parameter *pData = m_Data(ID);
596
597 if( pData )
598 {
599 if( bData )
600 {
601 if( pData->is_DataObject() )
602 {
603 m_Data_Manager.Delete(pData->asDataObject());
604 }
605 else if( pData->is_DataObject_List() )
606 {
607 for(int i=0; i<Get_List_Count(pData); i++)
608 {
609 m_Data_Manager.Delete(Get_List_Item(pData, i));
610 }
611 }
612 }
613
614 m_Data.Del_Parameter(ID);
615 }
616
617 return( true );
618 }
619
620
622 // //
624
625 //---------------------------------------------------------
626 bool CSG_Tool_Chain::Data_Exists(CSG_Data_Object *pData)
627 {
628 for(int i=0; i<m_Data.Get_Count(); i++)
629 {
630 if( m_Data(i)->is_DataObject() )
631 {
632 if( pData == m_Data(i)->asDataObject() )
633 {
634 return( true );
635 }
636 }
637 else if( m_Data(i)->is_DataObject_List() )
638 {
639 for(int j=0; j<Get_List_Count(m_Data(i)); j++)
640 {
641 if( pData == Get_List_Item(m_Data(i), j) )
642 {
643 return( true );
644 }
645 }
646 }
647 }
648
649 return( false );
650 }
651
652 //---------------------------------------------------------
653 bool CSG_Tool_Chain::Data_Initialize(void)
654 {
655 m_Data.Set_Manager(NULL);
656
657 for(int i=0; i<Parameters.Get_Count(); i++)
658 {
659 CSG_Parameter *pParameter = Parameters(i);
660
661 if( !(pParameter->is_DataObject() && !pParameter->asDataObject()) )
662 {
663 if( !Data_Add(pParameter->Get_Identifier(), pParameter) )
664 {
665 return( false );
666 }
667 }
668 }
669
670 return( true );
671 }
672
673 //---------------------------------------------------------
674 bool CSG_Tool_Chain::Data_Finalize(void)
675 {
676 //-----------------------------------------------------
677 for(int i=0; i<Parameters.Get_Count(); i++) // detach non temporary data before freeing the local data manager !!!
678 {
679 if( Parameters(i)->is_DataObject() )
680 {
681 if( m_Data(Parameters(i)->Get_Identifier()) )
682 {
683 if( Parameters(i)->Get_Type() == PARAMETER_TYPE_DataObject_Output || (Parameters(i)->is_Output() && !Parameters(i)->is_Optional()) )
684 {
685 Parameters(i)->Set_Value(m_Data(Parameters(i)->Get_Identifier())->asDataObject());
686 }
687 }
688
689 m_Data_Manager.Delete(Parameters(i)->asDataObject(), true);
690 }
691 else if( Parameters(i)->is_DataObject_List() )
692 {
693 if( Parameters(i)->is_Output() && m_Data(Parameters(i)->Get_Identifier()) ) // output lists cannot be up-to-date yet
694 {
695 CSG_Parameter *pData = m_Data(Parameters(i)->Get_Identifier());
696
697 for(int j=0; j<Get_List_Count(pData); j++) // csg_parameter::assign() will not work, if parameters data manager is the standard data manager because it checks for existing data sets
698 {
699 Parameters(i)->asList()->Add_Item(Get_List_Item(pData, j));
700 }
701 }
702
703 for(int j=0; j<Get_List_Count(Parameters(i)); j++)
704 {
705 m_Data_Manager.Delete(Get_List_Item(Parameters(i), j), true);
706 }
707 }
708 }
709
710 m_Data_Manager.Delete_All();
711
712 m_Data.Destroy();
713
714 //-----------------------------------------------------
715 for(int i=0; i<m_Chain["parameters"].Get_Children_Count(); i++)
716 {
717 const CSG_MetaData &Parameter = m_Chain["parameters"][i];
718
719 if( Parameter.Cmp_Name("output") )
720 {
721 CSG_Parameter *pParameter = Parameters(Parameter.Get_Property("varname"));
722
723 if( pParameter && pParameter->is_DataObject() && pParameter->asDataObject() && pParameter->asDataObject() != DATAOBJECT_CREATE )
724 {
725 if( Parameter("colours") )
726 {
727 DataObject_Set_Colors(pParameter->asDataObject(), 11,
728 Parameter["colours"].Get_Content().asInt(), IS_TRUE_PROPERTY(Parameter["colours"], "revert")
729 );
730 }
731
732 if( Parameter("output_name") )
733 {
734 if( IS_TRUE_PROPERTY(Parameter["output_name"], "input") )
735 {
736 CSG_Parameter *pInput = Parameters(Parameter["output_name"].Get_Content());
737
738 if( pInput && pInput->is_DataObject() && pInput->asDataObject() )
739 {
740 CSG_String Suffix;
741
742 if( Parameter["output_name"].Get_Property("suffix", Suffix) && !Suffix.is_Empty() )
743 {
744 Suffix = " [" + Suffix + "]";
745 }
746
747 pParameter->asDataObject()->Set_Name(pInput->asDataObject()->Get_Name() + Suffix);
748 }
749 }
750 else if( !Parameter["output_name"].Get_Content().is_Empty() )
751 {
752 pParameter->asDataObject()->Set_Name(Parameter["output_name"].Get_Content());
753 }
754 }
755 }
756 }
757 }
758
759 //-----------------------------------------------------
760 return( true );
761 }
762
763
765 // //
767
768 //---------------------------------------------------------
769 bool CSG_Tool_Chain::Parameter_isCompatible(TSG_Parameter_Type A, TSG_Parameter_Type B)
770 {
771 if( A == B )
772 {
773 return( true );
774 }
775
776 switch( A )
777 {
778 default:
779 return( false );
780
781 case PARAMETER_TYPE_Table:
782 return( B == PARAMETER_TYPE_Shapes
783 || B == PARAMETER_TYPE_PointCloud
784 || B == PARAMETER_TYPE_TIN );
785
786 case PARAMETER_TYPE_Shapes:
787 return( B == PARAMETER_TYPE_PointCloud );
788 }
789 }
790
791
793 // //
795
796 //---------------------------------------------------------
797 bool CSG_Tool_Chain::Check_Condition(const CSG_MetaData &Condition, CSG_Parameters *pData)
798 {
799 //-----------------------------------------------------
800 CSG_String Type;
801
802 if( !Condition.Cmp_Name("condition") || !Condition.Get_Property("type", Type) )
803 {
804 return( true );
805 }
806
807 //-----------------------------------------------------
808 CSG_String Variable;
809
810 if( !Condition.Get_Property("varname", Variable) && !Condition.Get_Property("variable", Variable) )
811 {
812 Variable = Condition.Get_Content();
813 }
814
815 //-----------------------------------------------------
816 if( !Type.CmpNoCase("has_gui" ) ) // executed from saga_gui ? (tool might offer different parameters if called from saga_cmd, python etc.)
817 {
818 return( IS_TRUE_STRING(Variable) ? has_GUI() != false : has_GUI() == false );
819 }
820
821 //-----------------------------------------------------
822 if( !Type.CmpNoCase("exists" ) ) // data object exists
823 {
824 CSG_Parameter *pParameter = (*pData)(Variable);
825
826 return( pParameter && ((pParameter->is_DataObject() && pParameter->asDataObject()) || (pParameter->is_DataObject_List() && pParameter->asList()->Get_Item_Count())) );
827 }
828
829 if( !Type.CmpNoCase("not_exists") ) // data object does not exist
830 {
831 return( (*pData)(Variable) == NULL || (*pData)(Variable)->asDataObject() == NULL );
832 }
833
834 //-----------------------------------------------------
835 CSG_Parameter *pOption = (*pData)(Variable);
836
837 if( pOption == NULL )
838 {
839 return( true );
840 }
841
842 switch( pOption->Get_Type() )
843 {
844 //-----------------------------------------------------
845 case PARAMETER_TYPE_Bool :
846 {
847 CSG_String Value;
848
849 if( Condition.Get_Property("value", Value) )
850 {
851 if( !Type.CmpNoCase("=") || !Type.CmpNoCase("equal" ) ) { return( (IS_TRUE_STRING(Value) ? pOption->asBool() : !pOption->asBool()) ); }
852 else if( !Type.CmpNoCase("!") || !Type.CmpNoCase("not_equal") ) { return( (IS_TRUE_STRING(Value) ? !pOption->asBool() : pOption->asBool()) ); }
853 }
854 }
855 break;
856
857 //-----------------------------------------------------
858 case PARAMETER_TYPE_Int :
859 case PARAMETER_TYPE_Color :
860 case PARAMETER_TYPE_Data_Type:
861 case PARAMETER_TYPE_Choice :
862 {
863 int Value;
864
865 if( Condition.Get_Property("value", Value) )
866 {
867 if( !Type.CmpNoCase("=") || !Type.CmpNoCase("equal" ) ) { if( Value != pOption->asInt() ) { return( false ); } }
868 else if( !Type.CmpNoCase("!") || !Type.CmpNoCase("not_equal") ) { if( Value == pOption->asInt() ) { return( false ); } }
869 else if( !Type.CmpNoCase("<") || !Type.CmpNoCase("less" ) ) { if( Value >= pOption->asInt() ) { return( false ); } }
870 else if( !Type.CmpNoCase(">") || !Type.CmpNoCase("greater" ) ) { if( Value <= pOption->asInt() ) { return( false ); } }
871 }
872 }
873 break;
874
875 //-----------------------------------------------------
876 case PARAMETER_TYPE_Double :
877 case PARAMETER_TYPE_Degree :
878 {
879 double Value;
880
881 if( Condition.Get_Property("value", Value) )
882 {
883 if( !Type.CmpNoCase("=") || !Type.CmpNoCase("equal" ) ) { if( Value != pOption->asDouble() ) { return( false ); } }
884 else if( !Type.CmpNoCase("!") || !Type.CmpNoCase("not_equal") ) { if( Value == pOption->asDouble() ) { return( false ); } }
885 else if( !Type.CmpNoCase("<") || !Type.CmpNoCase("less" ) ) { if( Value >= pOption->asDouble() ) { return( false ); } }
886 else if( !Type.CmpNoCase(">") || !Type.CmpNoCase("greater" ) ) { if( Value <= pOption->asDouble() ) { return( false ); } }
887 }
888 }
889 break;
890
891 //-----------------------------------------------------
892 case PARAMETER_TYPE_String :
893 case PARAMETER_TYPE_Text :
894 case PARAMETER_TYPE_FilePath :
895 {
896 CSG_String Value;
897
898 Condition.Get_Property("value", Value); // no 'if', bcos empty string would return false !!
899
900 {
901 if( !Type.CmpNoCase("=") || !Type.CmpNoCase("equal" ) ) { if( Value.Cmp(pOption->asString()) != 0 ) { return( false ); } }
902 else if( !Type.CmpNoCase("!") || !Type.CmpNoCase("not_equal") ) { if( Value.Cmp(pOption->asString()) == 0 ) { return( false ); } }
903 else if( !Type.CmpNoCase("<") || !Type.CmpNoCase("less" ) ) { if( Value.Cmp(pOption->asString()) >= 0 ) { return( false ); } }
904 else if( !Type.CmpNoCase(">") || !Type.CmpNoCase("greater" ) ) { if( Value.Cmp(pOption->asString()) <= 0 ) { return( false ); } }
905 }
906 }
907 break;
908
909 //-----------------------------------------------------
910 case PARAMETER_TYPE_Grid_System:
911 {
912 CSG_String Value;
913
914 if( Condition.Get_Property("value", Value) )
915 {
916 bool bValid = pOption->asGrid_System()->is_Valid();
917
918 if( !Type.CmpNoCase("=") || !Type.CmpNoCase("equal" ) ) { return( (IS_TRUE_STRING(Value) ? bValid : !bValid) ); }
919 else if( !Type.CmpNoCase("!") || !Type.CmpNoCase("not_equal") ) { return( (IS_TRUE_STRING(Value) ? !bValid : bValid) ); }
920 }
921 }
922 break;
923
924 //-----------------------------------------------------
925 default:
926 // nop
927 break;
928 }
929
930 return( true );
931 }
932
933
935 // //
937
938 //---------------------------------------------------------
939 bool CSG_Tool_Chain::ForEach(const CSG_MetaData &Commands)
940 {
941 for(int i=0; i<Commands.Get_Children_Count(); i++) // add internal target lists, if any..
942 {
943 if( Commands[i].Cmp_Name("output") || Commands[i].Cmp_Name("datalist") )
944 {
945 Data_Add_TempList(Commands[i].Get_Content(), Commands[i].Get_Property("type"));
946 }
947 }
948
949 //-----------------------------------------------------
950 bool bIgnoreErrors = IS_TRUE_PROPERTY(Commands, "ignore_errors");
951
952 CSG_String VarName;
953
954 if( Commands.Get_Property("varname", VarName) )
955 {
956 return( ForEach_Iterator(Commands, VarName, bIgnoreErrors) );
957 }
958
959 if( Commands.Get_Property("input", VarName) )
960 {
961 return( ForEach_Object (Commands, VarName, bIgnoreErrors)
962 || ForEach_File (Commands, VarName, bIgnoreErrors) );
963 }
964
965 Error_Set("foreach statement misses iterator or input list definition");
966
967 return( false );
968 }
969
970 //---------------------------------------------------------
971 bool CSG_Tool_Chain::ForEach_Iterator(const CSG_MetaData &Commands, const CSG_String &VarName, bool bIgnoreErrors)
972 {
973 CSG_Parameter *pIterator = Parameters(VarName);
974
975 if( pIterator )
976 {
977 Error_Set("foreach statement iterator variable name is already in use");
978
979 return( false );
980 }
981
982 //-----------------------------------------------------
983 CSG_String s;
984
985 double begin = Commands.Get_Property("begin", s) ? (Parameters(s) ? Parameters[s].asDouble() : s.asDouble()) : 0.;
986 double end = Commands.Get_Property("end" , s) ? (Parameters(s) ? Parameters[s].asDouble() : s.asDouble()) : 0.;
987
988 if( begin >= end )
989 {
990 Error_Set("foreach iterator statement with invalid range (define begin < end)");
991
992 return( false );
993 }
994
995 double step = 1.;
996
997 if( Commands.Get_Property("steps", s) )
998 {
999 double steps = Parameters(s) ? Parameters[s].asDouble() : s.asDouble();
1000
1001 if( steps > 0 )
1002 {
1003 step = (end - begin) / steps;
1004 }
1005 }
1006 else if( Commands.Get_Property("step", s) )
1007 {
1008 step = Parameters(s) ? Parameters[s].asDouble() : s.asDouble();
1009 }
1010
1011 if( step <= 0. )
1012 {
1013 Error_Set("foreach iterator statement with invalid step size (define step > 0 or steps > 0)");
1014
1015 return( false );
1016 }
1017
1018 Message_Fmt("\nfor i = %f to %f step %f (%d steps)", begin, end, step, (int)((end - begin) / step));
1019
1020 //-----------------------------------------------------
1021 bool bResult = true;
1022
1023 pIterator = Parameters.Add_Double("", VarName, "Iterator", "");
1024
1025 for(double i=begin; bResult && i<=end; i+=step)
1026 {
1027 Message_Fmt("\nfor step: %f", i);
1028
1029 pIterator->Set_Value(i);
1030
1031 for(int iTool=0; bResult && iTool<Commands.Get_Children_Count(); iTool++)
1032 {
1033 const CSG_MetaData &Tool = Commands[iTool];
1034
1035 if( Tool.Cmp_Name("tool") )
1036 {
1037 bResult = Tool_Run(Tool, bIgnoreErrors);
1038
1039 if( !bResult && bIgnoreErrors )
1040 {
1041 bResult = true;
1042 }
1043 }
1044 }
1045 }
1046
1047 Parameters.Del_Parameter(VarName);
1048
1049 return( bResult );
1050 }
1051
1052 //---------------------------------------------------------
1053 bool CSG_Tool_Chain::ForEach_Object(const CSG_MetaData &Commands, const CSG_String &ListVarName, bool bIgnoreErrors)
1054 {
1055 CSG_Parameter *pList = m_Data(ListVarName);
1056
1057 if( !pList )
1058 {
1059 return( false );
1060 }
1061
1062 //-----------------------------------------------------
1063 bool bResult = true;
1064
1065 if( pList->is_DataObject_List() )
1066 {
1067 for(int iObject=0; bResult && iObject<Get_List_Count(pList->asList()); iObject++)
1068 {
1069 for(int iTool=0; bResult && iTool<Commands.Get_Children_Count(); iTool++)
1070 {
1071 const CSG_MetaData &Tool = Commands[iTool];
1072
1073 if( Tool.Cmp_Name("tool") )
1074 {
1075 for(int j=0; j<Tool.Get_Children_Count(); j++)
1076 {
1077 if( Tool[j].Cmp_Name("input") && Tool[j].Get_Content().Find(ListVarName) == 0 )
1078 {
1079 Tool(j)->Set_Content(ListVarName + CSG_String::Format("[%d]", iObject));
1080 }
1081 }
1082 }
1083
1084 bResult = Tool_Run(Tool, bIgnoreErrors);
1085 }
1086
1087 if( !bResult && bIgnoreErrors )
1088 {
1089 bResult = true;
1090 }
1091 }
1092 }
1093
1094 //-----------------------------------------------------
1095 else if( pList->Get_Type() == PARAMETER_TYPE_Grids )
1096 {
1097 for(int iObject=0; bResult && iObject<pList->asGrids()->Get_Grid_Count(); iObject++)
1098 {
1099 for(int iTool=0; bResult && iTool<Commands.Get_Children_Count(); iTool++)
1100 {
1101 const CSG_MetaData &Tool = Commands[iTool];
1102
1103 if( Tool.Cmp_Name("tool") )
1104 {
1105 for(int j=0; j<Tool.Get_Children_Count(); j++)
1106 {
1107 if( Tool[j].Cmp_Name("input") && Tool[j].Get_Content().Find(ListVarName) == 0 )
1108 {
1109 Tool(j)->Set_Content(ListVarName + CSG_String::Format("[%d]", iObject));
1110 }
1111 }
1112 }
1113
1114 bResult = Tool_Run(Tool, bIgnoreErrors);
1115 }
1116
1117 if( !bResult && bIgnoreErrors )
1118 {
1119 bResult = true;
1120 }
1121 }
1122 }
1123
1124 return( bResult );
1125 }
1126
1127 //---------------------------------------------------------
1128 bool CSG_Tool_Chain::ForEach_File(const CSG_MetaData &Commands, const CSG_String &ListVarName, bool bIgnoreErrors)
1129 {
1130 CSG_Parameter *pList = Parameters(ListVarName);
1131
1132 if( !pList || pList->Get_Type() != PARAMETER_TYPE_FilePath )
1133 {
1134 return( false );
1135 }
1136
1137 CSG_Strings Files;
1138
1139 pList->asFilePath()->Get_FilePaths(Files);
1140
1141 //-----------------------------------------------------
1142 bool bResult = true;
1143
1144 for(int iFile=0; bResult && iFile<Files.Get_Count(); iFile++)
1145 {
1146 for(int iTool=0; bResult && iTool<Commands.Get_Children_Count(); iTool++)
1147 {
1148 const CSG_MetaData &Tool = Commands[iTool];
1149
1150 if( Tool.Cmp_Name("tool") )
1151 {
1152 CSG_Array_Int Input;
1153
1154 for(int j=0; j<Tool.Get_Children_Count(); j++)
1155 {
1156 if( Tool[j].Cmp_Name("option") && Tool[j].Get_Content().Find(ListVarName) == 0 && IS_TRUE_PROPERTY(Tool[j], "varname") )
1157 {
1158 Tool(j)->Set_Content(Files[iFile]);
1159 Tool(j)->Set_Property("varname", "false");
1160
1161 Input += j;
1162 }
1163 }
1164
1165 bResult = Tool_Run(Tool, bIgnoreErrors);
1166
1167 for(size_t i=0; i<Input.Get_uSize(); i++)
1168 {
1169 Tool(Input[i])->Set_Content(ListVarName);
1170 Tool(Input[i])->Set_Property("varname", "true");
1171 }
1172 }
1173 else
1174 {
1175 bResult = Tool_Run(Tool, bIgnoreErrors);
1176 }
1177
1178 if( !bResult && bIgnoreErrors )
1179 {
1180 bResult = true;
1181 }
1182 }
1183 }
1184
1185 return( bResult );
1186 }
1187
1188
1190 // //
1192
1193 //---------------------------------------------------------
1194 bool CSG_Tool_Chain::Tool_Run(const CSG_MetaData &Tool, bool bShowError)
1195 {
1196 //-----------------------------------------------------
1197 if( Tool.Cmp_Name("comment") )
1198 {
1199 return( true );
1200 }
1201
1202 //-----------------------------------------------------
1203 if( Tool.Cmp_Name("datalist") )
1204 {
1205 return( Data_Add_TempList(Tool.Get_Content(), Tool.Get_Property("type")) );
1206 }
1207
1208 if( Tool.Cmp_Name("delete") )
1209 {
1210 return( Data_Del_Temp(Tool.Get_Content(), IS_TRUE_PROPERTY(Tool, "data")) );
1211 }
1212
1213 //-----------------------------------------------------
1214 if( Tool.Cmp_Name("condition") )
1215 {
1216 const CSG_MetaData *pTools = (!Check_Condition(Tool, &m_Data) || !Check_Condition(Tool, &Parameters))
1217 ? Tool("else") : (Tool("if") ? Tool("if") : &Tool);
1218
1219 for(int i=0; pTools && i<pTools->Get_Children_Count(); i++)
1220 {
1221 if( !Tool_Run((*pTools)[i]) )
1222 {
1223 return( false );
1224 }
1225 }
1226
1227 return( true );
1228 }
1229
1230 //-----------------------------------------------------
1231 if( Tool.Cmp_Name("foreach") )
1232 {
1233 return( ForEach(Tool) );
1234 }
1235
1236 //-----------------------------------------------------
1237 if( !Tool.Cmp_Name("tool") )
1238 {
1239 return( true ); // only proceed, if it is tagged as tool...
1240 }
1241
1242 if( !Tool.Get_Property("library") || !(Tool.Get_Property("tool") || Tool.Get_Property("module")) )
1243 {
1244 if( bShowError ) Error_Set(_TL("invalid tool definition"));
1245
1246 return( false );
1247 }
1248
1249 //-----------------------------------------------------
1250 const SG_Char *Name = Tool.Get_Property("tool") ? Tool.Get_Property("tool") : Tool.Get_Property("module");
1251
1252 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool(Tool.Get_Property("library"), Name,
1253 IS_TRUE_PROPERTY(Tool, "with_gui") // this option allows to run a tool in 'gui-mode', e.g. to popup variogram dialogs for kriging interpolation
1254 );
1255
1256 if( !pTool )
1257 {
1258 if( bShowError ) Error_Fmt("%s [%s].[%s]", _TL("could not find tool"), Tool.Get_Property("library"), Name);
1259
1260 return( false );
1261 }
1262
1263 //-----------------------------------------------------
1264 Process_Set_Text(pTool->Get_Name());
1265
1266 pTool->Settings_Push(&m_Data_Manager);
1267
1268 bool bResult = false;
1269
1270 if( !pTool->On_Before_Execution() )
1271 {
1272 if( bShowError ) Error_Fmt("%s [%s].[%s]", _TL("before tool execution check failed"), pTool->Get_Library().c_str(), pTool->Get_Name().c_str());
1273 }
1274 else if( !Tool_Initialize(Tool, pTool) )
1275 {
1276 if( bShowError ) Error_Fmt("%s [%s].[%s]", _TL("tool initialization failed" ), pTool->Get_Library().c_str(), pTool->Get_Name().c_str());
1277 }
1278 else if( !(bResult = pTool->Execute(m_bAddHistory)) )
1279 {
1280 Message_Fmt ("%s [%s].[%s]", _TL("tool execution failed" ), pTool->Get_Library().c_str(), pTool->Get_Name().c_str());
1281 }
1282
1283 if( bResult )
1284 {
1285 pTool->On_After_Execution();
1286 }
1287
1288 Tool_Finalize(Tool, pTool);
1289
1290 pTool->Settings_Pop();
1291
1292 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
1293
1294 return( bResult );
1295 }
1296
1297
1299 // //
1301
1302 //---------------------------------------------------------
1303 bool CSG_Tool_Chain::Tool_Check_Condition(const CSG_MetaData &Tool)
1304 {
1305 if( Tool("condition") )
1306 {
1307 for(int i=0; i<Tool.Get_Children_Count(); i++) // there might be more than one condition to be checked
1308 {
1309 if( !Check_Condition(Tool[i], &m_Data) )
1310 {
1311 return( false );
1312 }
1313 }
1314 }
1315
1316 return( true );
1317 }
1318
1319
1321 // //
1323
1324 //---------------------------------------------------------
1325 bool CSG_Tool_Chain::Tool_Get_Parameter(CSG_String ID, CSG_Parameters *pParameters, CSG_Parameter **ppParameter, CSG_Parameter **ppOwner)
1326 {
1327 CSG_Parameter *pParameter = (*pParameters)(ID.BeforeFirst('.'));
1328
1329 if( pParameter )
1330 {
1331 switch( pParameter->Get_Type() )
1332 {
1333 default:
1334 *ppParameter = pParameter;
1335
1336 return( true );
1337
1338 case PARAMETER_TYPE_Parameters:
1339 *ppOwner = pParameter;
1340
1341 return( Tool_Get_Parameter(ID.AfterFirst('.'), pParameter->asParameters(), ppParameter, ppOwner) );
1342
1343 case PARAMETER_TYPE_Range:
1344 if( !ID.AfterFirst('.').CmpNoCase("min") || !ID.AfterFirst('.').CmpNoCase("minimum") )
1345 {
1346 *ppParameter = pParameter->asRange()->Get_Min_Parameter();
1347 *ppOwner = pParameter;
1348 }
1349 else if( !ID.AfterFirst('.').CmpNoCase("max") || !ID.AfterFirst('.').CmpNoCase("maximum") )
1350 {
1351 *ppParameter = pParameter->asRange()->Get_Max_Parameter();
1352 *ppOwner = pParameter;
1353 }
1354 else
1355 {
1356 *ppParameter = pParameter;
1357 }
1358
1359 return( true );
1360 }
1361 }
1362
1363 return( false );
1364 }
1365
1366 //---------------------------------------------------------
1367 bool CSG_Tool_Chain::Tool_Get_Parameter(const CSG_MetaData &Parameter, CSG_Tool *pTool, CSG_Parameter **ppParameter, CSG_Parameter **ppOwner)
1368 {
1369 CSG_String ID(Parameter.Get_Property("parms"));
1370
1371 if( !ID.is_Empty() )
1372 {
1373 ID += '.';
1374 }
1375
1376 ID += Parameter.Get_Property("id");
1377
1378 //-----------------------------------------------------
1379 CSG_Parameter *pOwner; if( !ppOwner ) { ppOwner = &pOwner; } *ppOwner = NULL;
1380
1381 CSG_Parameters *pParameters = pTool->Get_Parameters(ID.BeforeFirst('.'));
1382
1383 if( pParameters )
1384 {
1385 ID = ID.AfterFirst('.');
1386 }
1387 else
1388 {
1389 pParameters = pTool->Get_Parameters();
1390 }
1391
1392 return( Tool_Get_Parameter(ID, pParameters, ppParameter, ppOwner) );
1393 }
1394
1395 //---------------------------------------------------------
1396 bool CSG_Tool_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Tool *pTool)
1397 {
1398 //-----------------------------------------------------
1399 for(int i=0; i<Tool.Get_Children_Count(); i++) // check for invalid parameters...
1400 {
1401 const CSG_MetaData &Parameter = Tool[i]; if( Parameter.Cmp_Name("comment") ) { continue; }
1402
1403 CSG_Parameter *pParameter, *pOwner;
1404
1405 if( !Tool_Get_Parameter(Parameter, pTool, &pParameter, &pOwner) )
1406 {
1407 Error_Fmt("%s: %s", _TL("parameter not found"), Parameter.Get_Property("id"));
1408
1409 return( false );
1410 }
1411 }
1412
1413 //-----------------------------------------------------
1414 if( Tool.Get_Property("grid_system") )
1415 {
1416 CSG_Parameter *pParameter = Parameters(Tool.Get_Property("grid_system"));
1417
1418 if( pParameter && pParameter->asGrid_System() )
1419 {
1420 if( !pTool->Set_Grid_System(*pParameter->asGrid_System()) )
1421 {
1422 Message_Fmt("\n%s: %s\n", _TL("Warning"), _TL("failed to set tool's grid system"));
1423 }
1424 }
1425 }
1426
1427 //-----------------------------------------------------
1428 for(int i=0; i<Tool.Get_Children_Count(); i++) // initialize all options first, some might en-/disable mandatory input data
1429 {
1430 const CSG_MetaData &Parameter = Tool[i]; if( !Parameter.Cmp_Name("option") ) { continue; }
1431
1432 CSG_Parameter *pParameter, *pOwner; Tool_Get_Parameter(Parameter, pTool, &pParameter, &pOwner);
1433
1434 if( IS_TRUE_PROPERTY(Parameter, "varname")
1435 ? pParameter->Set_Value(Parameters(Parameter.Get_Content()))
1436 : pParameter->Set_Value( Parameter.Get_Content() ) )
1437 {
1438 pParameter->has_Changed(); if( pOwner ) { pOwner->has_Changed(); }
1439 }
1440 }
1441
1442 //-----------------------------------------------------
1443 for(int i=0; i<Tool.Get_Children_Count(); i++) // set data input first
1444 {
1445 const CSG_MetaData &Parameter = Tool[i]; if( !Parameter.Cmp_Name("input") ) { continue; }
1446
1447 CSG_Parameter *pParameter, *pOwner; Tool_Get_Parameter(Parameter, pTool, &pParameter, &pOwner);
1448
1449 int Index;
1450
1451 if( Parameter.Get_Content().Find('[') < 1 || !Parameter.Get_Content().AfterFirst('[').asInt(Index) )
1452 {
1453 Index = -1;
1454 }
1455
1456 bool bResult = false;
1457
1458 CSG_Parameter *pData = m_Data(Index < 0 ? Parameter.Get_Content() : Parameter.Get_Content().BeforeFirst('['));
1459
1460 if( pData && (pParameter->is_DataObject() || pParameter->is_DataObject_List()) )
1461 {
1462 if( Index >= 0 && (pData->is_DataObject_List() || pData->asGrids()) )
1463 {
1464 CSG_Data_Object *pObject = pData->is_DataObject_List()
1465 ? pData->asList ()->Get_Item (Index)
1466 : pData->asGrids()->Get_Grid_Ptr(Index);
1467
1468 if( pParameter->is_DataObject() )
1469 {
1470 bResult = pParameter->Set_Value(pObject);
1471 }
1472 if( pParameter->is_DataObject_List() )
1473 {
1474 bResult = pParameter->asList()->Add_Item(pObject);
1475 }
1476 }
1477 else if( pParameter->Get_Type() == pData->Get_Type() )
1478 {
1479 if( pParameter->is_DataObject_List() && pParameter->asList()->Get_Item_Count() > 0 )
1480 {
1481 bResult = true;
1482
1483 for(int i=0; bResult && i<pData->asList()->Get_Item_Count(); i++)
1484 {
1485 bResult = pParameter->asList()->Add_Item(pData->asList()->Get_Item(i));
1486 }
1487 }
1488 else
1489 {
1490 bResult = pParameter->Assign(pData);
1491 }
1492 }
1493 else if( pParameter->is_DataObject_List() && pData->is_DataObject() )
1494 {
1495 bResult = pParameter->asList()->Add_Item(pData->asDataObject());
1496 }
1497 else if( Parameter_isCompatible(pParameter->Get_Type(), pData->Get_Type()) )
1498 {
1499 bResult = pParameter->Set_Value(pData->asDataObject());
1500 }
1501 }
1502
1503 if( bResult )
1504 {
1505 pParameter->has_Changed(); if( pOwner ) { pOwner->has_Changed(); }
1506 }
1507 else if( pParameter->is_Enabled() )
1508 {
1509 Error_Fmt("%s: %s", _TL("set input"), Parameter.Get_Property("id"));
1510
1511 return( false );
1512 }
1513 }
1514
1515 //-----------------------------------------------------
1516 for(int i=0; i<Tool.Get_Children_Count(); i++) // now set all options
1517 {
1518 const CSG_MetaData &Parameter = Tool[i]; if( !Parameter.Cmp_Name("option") ) { continue; }
1519
1520 CSG_Parameter *pParameter, *pOwner; Tool_Get_Parameter(Parameter, pTool, &pParameter, &pOwner);
1521
1522 if( IS_TRUE_PROPERTY(Parameter, "varname") )
1523 { // does option want a value from tool chain parameters and do these provide one ?
1524 switch( pParameter->Get_Type() )
1525 {
1526 default:
1527 pParameter->Set_Value(Parameters(Parameter.Get_Content()));
1528 break;
1529
1530 case PARAMETER_TYPE_FixedTable:
1531 if( m_Data(Parameter.Get_Content()) && pParameter->asTable()->Assign_Values(m_Data(Parameter.Get_Content())->asTable()) )
1532 {
1533 pParameter->has_Changed();
1534 }
1535 break;
1536 }
1537 }
1538 else
1539 {
1540 switch( pParameter->Get_Type() )
1541 {
1542 case PARAMETER_TYPE_FixedTable:
1543 if( Parameter("OPTION") )
1544 {
1545 pParameter->Serialize(*Parameter("OPTION"), false);
1546 }
1547 break;
1548
1549 default: {
1550 CSG_String Value(Parameter.Get_Content());
1551
1552 if( Value.Find("$(") >= 0 )
1553 {
1554 for(int j=0; j<Parameters.Get_Count(); j++)
1555 {
1556 CSG_String Var; Var.Printf("$(%s)", Parameters(j)->Get_Identifier());
1557
1558 if( Value.Find(Var) >= 0 )
1559 {
1560 Value.Replace(Var, Parameters(j)->asString());
1561 }
1562 }
1563 }
1564
1565 pParameter->Set_Value(Value);
1566
1567 if( pOwner )
1568 {
1569 pOwner->has_Changed();
1570 }
1571
1572 break; }
1573 }
1574 }
1575 }
1576
1577 //-----------------------------------------------------
1578 for(int i=0; i<Tool.Get_Children_Count(); i++) // finally set the data output
1579 {
1580 const CSG_MetaData &Parameter = Tool[i]; if( !Parameter.Cmp_Name("output") ) { continue; }
1581
1582 CSG_Parameter *pParameter, *pOwner; Tool_Get_Parameter(Parameter, pTool, &pParameter, &pOwner);
1583
1584 if( !pParameter->Assign(m_Data(Parameter.Get_Content())) )
1585 {
1586 if( pParameter->is_DataObject() )
1587 {
1588 pParameter->Set_Value(DATAOBJECT_CREATE);
1589 }
1590 else if( pParameter->is_DataObject_List() )
1591 {
1592 pParameter->asList()->Del_Items();
1593 }
1594 else if( pParameter->asGrids() )
1595 {
1596 pParameter->asGrids()->Del_Grids();
1597 }
1598 }
1599 }
1600
1601 //-----------------------------------------------------
1602 return( true );
1603 }
1604
1605 //---------------------------------------------------------
1606 bool CSG_Tool_Chain::Tool_Finalize(const CSG_MetaData &Tool, CSG_Tool *pTool)
1607 {
1608 for(int i=0; i<Tool.Get_Children_Count(); i++) // add all data objects declared as output to variable list
1609 {
1610 const CSG_MetaData &Parameter = Tool[i];
1611
1612 if( Parameter.Cmp_Name("output") )
1613 {
1614 CSG_String ID (Parameter.Get_Property("id" ));
1615 CSG_String ID_parms(Parameter.Get_Property("parms"));
1616
1617 CSG_Parameter *pParameter = pTool->Get_Parameters(ID_parms)
1618 ? (*pTool->Get_Parameters(ID_parms))(ID)
1619 : (*pTool->Get_Parameters( ))(ID);
1620
1621 if( !pParameter || !Data_Add(Parameter.Get_Content(), pParameter) )
1622 {
1623 return( false );
1624 }
1625 }
1626 }
1627
1628 //-----------------------------------------------------
1629 for(int i=-1; i<pTool->Get_Parameters_Count(); i++) // save memory: free all data objects that have not been added to variable list
1630 {
1631 CSG_Parameters *pParameters = i < 0 ? pTool->Get_Parameters() : pTool->Get_Parameters(i);
1632
1633 for(int j=0; j<pParameters->Get_Count(); j++)
1634 {
1635 CSG_Parameter *pParameter = (*pParameters)(j);
1636
1637 if( pParameter->is_Output() )
1638 {
1639 if( pParameter->is_DataObject() )
1640 {
1641 if( !Data_Exists(pParameter->asDataObject()) )
1642 {
1643 m_Data_Manager.Delete(pParameter->asDataObject());
1644 }
1645 }
1646 else if( pParameter->is_DataObject_List() )
1647 {
1648 for(int k=0; k<Get_List_Count(pParameter); k++)
1649 {
1650 if( !Data_Exists(Get_List_Item(pParameter, k)) )
1651 {
1652 m_Data_Manager.Delete(Get_List_Item(pParameter, k));
1653 }
1654 }
1655 }
1656 }
1657 }
1658 }
1659
1660 //-----------------------------------------------------
1661 return( true );
1662 }
1663
1664
1666 // //
1667 // //
1668 // //
1670
1671 //---------------------------------------------------------
1672 CSG_String CSG_Tool_Chain::Get_Script(CSG_Tool *pTool, bool bHeader, bool bAllParameters)
1673 {
1674 CSG_MetaData Tool; Tool.Set_Name("tool");
1675
1676 Tool.Add_Property("library", pTool->Get_Library());
1677 Tool.Add_Property("tool" , pTool->Get_ID ());
1678 Tool.Add_Property("name" , pTool->Get_Name ());
1679
1680 _Get_Script_Tool(Tool, pTool->Get_Parameters(), bAllParameters, "", bHeader);
1681
1682 for(int i=0; i<pTool->Get_Parameters_Count(); i++)
1683 {
1684 _Get_Script_Tool(Tool, pTool->Get_Parameters(i), bAllParameters, pTool->Get_Parameters(i)->Get_Identifier() + '.', bHeader);
1685 }
1686
1687 if( !bHeader )
1688 {
1689 return( Tool.asText(1) );
1690 }
1691
1692 //-----------------------------------------------------
1693 CSG_MetaData Parameters;
1694
1695 _Get_Script_Parameters(Parameters, pTool->Get_Parameters(), "");
1696
1697 for(int i=0; i<pTool->Get_Parameters_Count(); i++)
1698 {
1699 _Get_Script_Parameters(Parameters, pTool->Get_Parameters(i), pTool->Get_Parameters(i)->Get_Identifier() + '.');
1700 }
1701
1702 //-----------------------------------------------------
1703 CSG_MetaData Tools; Tools.Set_Name("toolchain");
1704
1705 Tools.Add_Property("saga-version", SAGA_VERSION);
1706
1707 Tools.Add_Child("group" );
1708 Tools.Add_Child("identifier" , "define-a-unique-tool-identifier-here");
1709 Tools.Add_Child("name" , pTool->Get_Name() + " [Tool Chain]");
1710 Tools.Add_Child("author" );
1711 Tools.Add_Child("description");
1712 Tools.Add_Child("menu" , pTool->Get_MenuPath(true))->Add_Property("absolute", "true");
1713 Tools.Add_Child("crs_sync" , "true");
1714 Tools.Add_Child("parameters" )->Add_Children(Parameters);
1715 Tools.Add_Child("tools" )->Add_Child(Tool);
1716 Tools ("tools" )->Add_Property("history", "false");
1717
1718 return( Tools.asText(1) );
1719 }
1720
1721 //---------------------------------------------------------
1722 bool CSG_Tool_Chain::_Get_Script_Tool(CSG_MetaData &Tool, CSG_Parameters *pParameters, bool bAllParameters, const CSG_String &Prefix, bool bVarNames)
1723 {
1724 for(int iParameter=0; iParameter<pParameters->Get_Count(); iParameter++)
1725 {
1726 CSG_Parameter *pParameter = pParameters->Get_Parameter(iParameter);
1727
1728 if( !bAllParameters && (!pParameter->is_Enabled(false) || pParameter->is_Information()) )
1729 {
1730 continue;
1731 }
1732
1733 CSG_MetaData *pChild = NULL;
1734
1735 switch( pParameter->Get_Type() )
1736 {
1737 case PARAMETER_TYPE_Parameters :
1738 _Get_Script_Tool(Tool, pParameter->asParameters(), bAllParameters, Prefix + pParameter->Get_Identifier() + '.', true);
1739 break;
1740
1741 case PARAMETER_TYPE_Bool :
1742 pChild = Tool.Add_Child("option", pParameter->asBool() ? "true" : "false");
1743 break;
1744
1745 case PARAMETER_TYPE_Int :
1746 case PARAMETER_TYPE_Double :
1747 case PARAMETER_TYPE_Degree :
1748 case PARAMETER_TYPE_Date :
1749 case PARAMETER_TYPE_Range :
1750 case PARAMETER_TYPE_String :
1751 case PARAMETER_TYPE_Text :
1752 case PARAMETER_TYPE_FilePath :
1753 case PARAMETER_TYPE_Choices :
1754 case PARAMETER_TYPE_Table_Field :
1755 case PARAMETER_TYPE_Table_Fields:
1756 pChild = Tool.Add_Child("option", pParameter->asString());
1757 break;
1758
1759 case PARAMETER_TYPE_Data_Type :
1760 case PARAMETER_TYPE_Choice :
1761 pChild = Tool.Add_Child("option", pParameter->asInt());
1762 break;
1763
1764 case PARAMETER_TYPE_FixedTable :
1765 pChild = Tool.Add_Child("option");
1766 pParameter->Serialize(*pChild, true);
1767 break;
1768
1769 case PARAMETER_TYPE_Grid_System :
1770 if( pParameter->Get_Children_Count() == 0 )
1771 {
1772 pChild = Tool.Add_Child("option", pParameter->asString());
1773 }
1774 break;
1775
1776 default:
1777 if( pParameter->is_Input() )
1778 {
1779 pChild = Tool.Add_Child("input");
1780 pChild->Set_Content(pParameter->is_Optional() ? "INPUT_OPTIONAL" : "INPUT");
1781 }
1782 else if( pParameter->is_Output() )
1783 {
1784 pChild = Tool.Add_Child("output");
1785 pChild->Set_Content("OUTPUT");
1786 }
1787 break;
1788 }
1789
1790 if( pChild )
1791 {
1792 pChild->Add_Property("id", Prefix + pParameter->Get_Identifier());
1793
1794 if( bVarNames )
1795 {
1796 if( pParameter->is_Option() )
1797 {
1798 pChild->Add_Property("varname", "true");
1799 }
1800
1801 pChild->Set_Content(Prefix + pParameter->Get_Identifier());
1802 }
1803 }
1804 }
1805
1806 return( true );
1807 }
1808
1809 //---------------------------------------------------------
1810 bool CSG_Tool_Chain::_Get_Script_Parameters(CSG_MetaData &Parameters, CSG_Parameters *pParameters, const CSG_String &Prefix)
1811 {
1812 for(int i=0; i<pParameters->Get_Count(); i++)
1813 {
1814 CSG_Parameter *pParameter = pParameters->Get_Parameter(i);
1815
1816 if( pParameter->Get_Type() == PARAMETER_TYPE_Parameters )
1817 {
1818 _Get_Script_Parameters(Parameters, pParameter->asParameters(), Prefix + pParameter->Get_Identifier() + '.');
1819
1820 continue; // no support for sub-parameter-lists in here
1821 }
1822
1823 CSG_MetaData &Parameter = *Parameters.Add_Child(
1824 pParameter->is_Option() ? "option" :
1825 pParameter->is_Output() ? "output" : "input"
1826 );
1827
1828 Parameter.Add_Property("varname" , pParameter->Get_Identifier ());
1829 Parameter.Add_Property("type" , SG_Parameter_Type_Get_Identifier(pParameter->Get_Type()));
1830 Parameter.Add_Child ("name" , pParameter->Get_Name ());
1831 Parameter.Add_Child ("description", pParameter->Get_Description());
1832
1833 if( pParameter->Get_Parent() )
1834 {
1835 Parameter.Add_Property("parent", pParameter->Get_Parent()->Get_Identifier());
1836 }
1837
1838 if( pParameter->Get_Type() == PARAMETER_TYPE_Node
1839 || pParameter->Get_Type() == PARAMETER_TYPE_Grid_System )
1840 {
1841 continue; // nothing more to do for these types
1842 }
1843
1844 if( pParameter->is_Option() )
1845 {
1846 CSG_MetaData &Value = *Parameter.Add_Child("value", pParameter->asString());
1847
1848 if( pParameter->asValue() )
1849 {
1850 if( pParameter->asValue()->has_Minimum() ) Value.Add_Property("min", pParameter->asValue()->Get_Minimum());
1851 if( pParameter->asValue()->has_Maximum() ) Value.Add_Property("max", pParameter->asValue()->Get_Maximum());
1852 }
1853
1854 if( pParameter->asChoice () ) Parameter.Add_Child("choices", pParameter->asChoice ()->Get_Items());
1855 if( pParameter->asChoices() ) Parameter.Add_Child("choices", pParameter->asChoices()->Get_Items());
1856
1857 if( pParameter->asFilePath() )
1858 {
1859 Parameter.Add_Property("save" , pParameter->asFilePath()->is_Save () ? "true" : "false");
1860 Parameter.Add_Property("directory", pParameter->asFilePath()->is_Directory() ? "true" : "false");
1861 Parameter.Add_Property("multiple" , pParameter->asFilePath()->is_Multiple () ? "true" : "false");
1862 Parameter.Add_Child ("filter" , pParameter->asFilePath()->Get_Filter());
1863 }
1864
1865 if( pParameter->Get_Type() == PARAMETER_TYPE_FixedTable )
1866 {
1867 pParameter->Serialize(Parameter, true);
1868 }
1869
1870 if( pParameter->Get_Type() == PARAMETER_TYPE_Table_Field )
1871 {
1872 Value.Set_Content(pParameter->is_Optional() ? "true" : "false");
1873 }
1874 }
1875 else // data objects
1876 {
1877 if( pParameter->is_Optional() )
1878 {
1879 Parameter.Add_Property("optional", "true");
1880 }
1881
1882 if( pParameter->Get_Type() == PARAMETER_TYPE_DataObject_Output )
1883 {
1884 switch( ((CSG_Parameter_Data_Object_Output *)pParameter)->Get_DataObject_Type() )
1885 {
1886 case SG_DATAOBJECT_TYPE_Grid:
1887 Parameter.Set_Property("type" , SG_Parameter_Type_Get_Identifier(PARAMETER_TYPE_Grid));
1888 Parameter.Add_Property("target", "none");
1889 break;
1890
1891 case SG_DATAOBJECT_TYPE_Grids:
1892 Parameter.Set_Property("type" , SG_Parameter_Type_Get_Identifier(PARAMETER_TYPE_Grids));
1893 Parameter.Add_Property("target", "none");
1894 break;
1895
1896 default:
1897 break;
1898 }
1899 }
1900
1901 if( pParameter->Get_Type() == PARAMETER_TYPE_Shapes )
1902 {
1903 switch( ((CSG_Parameter_Shapes *)pParameter)->Get_Shape_Type() )
1904 {
1905 case SHAPE_TYPE_Point : Parameter.Add_Property("feature_type", "point" ); break;
1906 case SHAPE_TYPE_Points : Parameter.Add_Property("feature_type", "points" ); break;
1907 case SHAPE_TYPE_Line : Parameter.Add_Property("feature_type", "line" ); break;
1908 case SHAPE_TYPE_Polygon: Parameter.Add_Property("feature_type", "polygon"); break;
1909 default: break;
1910 }
1911 }
1912
1913 if( pParameter->Get_Type() == PARAMETER_TYPE_Grid_List
1914 && !((CSG_Parameter_Grid_List *)pParameter)->Get_System() )
1915 {
1916 Parameter.Add_Property("no_system", "true");
1917 }
1918
1919 if( pParameter->Get_Type() == PARAMETER_TYPE_Grids_List
1920 && !((CSG_Parameter_Grid_List *)pParameter)->Get_System() )
1921 {
1922 Parameter.Add_Property("no_system", "true");
1923 }
1924 }
1925 }
1926
1927 return( true );
1928 }
1929
1930
1932 // //
1933 // //
1934 // //
1936
1937 //---------------------------------------------------------
1938 CSG_Tool_Chains::CSG_Tool_Chains(const CSG_String &Library_Name, const CSG_String &Path)
1939 {
1940 m_Library_Name = Library_Name;
1941
1942 //-----------------------------------------------------
1943 if( m_Library_Name.is_Empty() || !m_Library_Name.Cmp("toolchains") )
1944 {
1945 m_Library_Name = "_tool_chains_uncategorized";
1946 m_Name = _TL("Uncategorized Tool Chains");
1947 m_Description = _TL("Uncategorized Tool Chains");
1948 m_Menu = _TL("Uncategorized Tool Chains");
1949 }
1950
1951 //-----------------------------------------------------
1952 else
1953 {
1954 CSG_MetaData XML(SG_File_Make_Path(Path, Library_Name, "xml"));
1955
1956 if( !XML.Cmp_Name("toolchains") )
1957 {
1958 XML.Destroy();
1959 }
1960
1961 m_Name = GET_XML_CONTENT(XML, "name" , m_Library_Name , true);
1962 m_Description = GET_XML_CONTENT(XML, "description", _TL("no description"), true);
1963 m_Menu = GET_XML_CONTENT(XML, "menu" , _TL("Tool Chains" ), true);
1964
1965 m_Description.Replace("[[", "<"); // support for xml/html tags
1966 m_Description.Replace("]]", ">");
1967
1968 // add references...
1969 for(int i=0; i<XML.Get_Children_Count(); i++)
1970 {
1971 if( !XML[i].Get_Name().CmpNoCase("REFERENCE") )
1972 {
1973 CSG_String Authors, Year, Title, Where, Link, Link_Text, DOI;
1974
1975 if( XML[i]("AUTHORS" ) ) Authors = XML[i].Get_Content("AUTHORS" );
1976 if( XML[i]("YEAR" ) ) Year = XML[i].Get_Content("YEAR" );
1977 if( XML[i]("TITLE" ) ) Title = XML[i].Get_Content("TITLE" );
1978 if( XML[i]("WHERE" ) ) Where = XML[i].Get_Content("WHERE" );
1979 if( XML[i]("LINK" ) ) Link = XML[i].Get_Content("LINK" );
1980 if( XML[i]("LINK_TEXT") ) Link_Text = XML[i].Get_Content("LINK_TEXT");
1981 if( XML[i]("DOI" ) ) DOI = XML[i].Get_Content("DOI" );
1982
1983 if( !DOI.is_Empty() )
1984 {
1985 Link = "https://doi.org/" + DOI; Link_Text = "doi:" + DOI;
1986 }
1987
1988 if( !Authors.is_Empty() && !Year.is_Empty() && !Title.is_Empty() )
1989 {
1990 Add_Reference(Authors, Year, Title, Where, Link.c_str(), Link_Text.c_str());
1991 }
1992 else if( !Link.is_Empty() )
1993 {
1994 Add_Reference(Link, Link_Text.c_str());
1995 }
1996 }
1997 }
1998 }
1999 }
2000
2001 //---------------------------------------------------------
2002 CSG_Tool_Chains::~CSG_Tool_Chains(void)
2003 {
2004 Delete_Tools();
2005
2006 for(size_t i=0; i<m_Tools.Get_uSize(); i++)
2007 {
2008 delete((CSG_Tool_Chain *)m_Tools[i]);
2009 }
2010 }
2011
2012
2014 // //
2016
2017 //---------------------------------------------------------
2018 CSG_String CSG_Tool_Chains::Get_Info(int Type) const
2019 {
2020 switch( Type )
2021 {
2022 case TLB_INFO_Name : return( m_Name );
2023 case TLB_INFO_Description: return( m_Description );
2024 case TLB_INFO_Menu_Path : return( m_Menu );
2025 case TLB_INFO_Category : return( _TL("Tool Chains") );
2026 }
2027
2028 return( "" );
2029 }
2030
2031 //---------------------------------------------------------
2032 bool CSG_Tool_Chains::Add_Tool(CSG_Tool_Chain *pTool)
2033 {
2034 m_Tools.Add(pTool);
2035
2036 pTool->Set_Library_Menu(Get_Info(TLB_INFO_Menu_Path));
2037
2038 return( true );
2039 }
2040
2041 //---------------------------------------------------------
2042 CSG_Tool * CSG_Tool_Chains::Get_Tool(int Index, TSG_Tool_Type Type) const
2043 {
2044 CSG_Tool *pTool = Index >= 0 && Index < Get_Count() ? (CSG_Tool_Chain *)m_Tools[Index] : NULL;
2045
2046 return( pTool && (Type == TOOL_TYPE_Base || Type == pTool->Get_Type()) ? pTool : NULL );
2047 }
2048
2049
2051 // //
2053
2054 //---------------------------------------------------------
2055 CSG_Tool * CSG_Tool_Chains::Create_Tool(const CSG_String &Name, bool bWithGUI)
2056 {
2057 CSG_Tool *pTool = CSG_Tool_Library::Get_Tool(Name);
2058
2059 if( pTool && pTool->Get_Type() == TOOL_TYPE_Chain )
2060 {
2061 m_xTools.Add(pTool = new CSG_Tool_Chain(*((CSG_Tool_Chain *)pTool), bWithGUI));
2062
2063 return( pTool );
2064 }
2065
2066 return( NULL );
2067 }
2068
2069 //---------------------------------------------------------
2070 bool CSG_Tool_Chains::Delete_Tool(CSG_Tool *pTool)
2071 {
2072 if( m_xTools.Del(pTool) || m_Tools.Del(pTool) )
2073 {
2074 delete((CSG_Tool_Chain *)pTool);
2075
2076 return( true );
2077 }
2078
2079 return( false );
2080 }
2081
2082 //---------------------------------------------------------
2083 bool CSG_Tool_Chains::Delete_Tools(void)
2084 {
2085 for(size_t i=0; i<m_xTools.Get_uSize(); i++)
2086 {
2087 delete((CSG_Tool_Chain *)m_xTools[i]);
2088 }
2089
2090 m_xTools.Destroy();
2091
2092 return( true );
2093 }
2094
2095
2097 // //
2098 // //
2099 // //
2101
2102 //---------------------------------------------------------
2103 bool CSG_Tool_Chain::Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
2104 {
2105 if( SG_Compare_Version(History.Get_Property("saga-version"), "2.1.3") < 0 || !(History("TOOL") || History("MODULE")) )
2106 {
2107 return( false );
2108 }
2109
2110 const CSG_MetaData &Tool(History("TOOL") ? History["TOOL"] : History["MODULE"]);
2111
2112 if( !Tool("OUTPUT") )
2113 {
2114 return( false );
2115 }
2116
2117 //-----------------------------------------------------
2118 CSG_MetaData Chain;
2119
2120 Chain.Set_Name ("toolchain" );
2121 Chain.Add_Property("saga-version", SAGA_VERSION);
2122
2123 Chain.Add_Child ("group" , "toolchains");
2124 Chain.Add_Child ("identifier" , SG_File_Get_Name(File, false));
2125 Chain.Add_Child ("name" , SG_File_Get_Name(File, false));
2126 Chain.Add_Child ("description", _TL("created from history"));
2127
2128 Chain.Add_Child ("parameters" );
2129 Chain.Add_Child ("tools" );
2130
2131 _Save_History_Add_Tool(Tool, *Chain("parameters"), *Chain("tools"), true);
2132
2133 for(int i=0; i<Chain["tools"].Get_Children_Count(); i++)
2134 {
2135 Chain["tools"](i)->Del_Property("id");
2136 }
2137
2138 return( Chain.Save(File) );
2139 }
2140
2141 //---------------------------------------------------------
2142 bool CSG_Tool_Chain::_Save_History_Add_Tool(const CSG_MetaData &History, CSG_MetaData &Parms, CSG_MetaData &Tools, bool bAddOutput)
2143 {
2144 if( !History("OUTPUT") || !History["OUTPUT"].Get_Property("id") )
2145 {
2146 return( false );
2147 }
2148
2149 //-----------------------------------------------------
2150 CSG_MetaData *pParameter, &Tool = *Tools.Ins_Child("tool", 0);
2151
2152 CSG_String Tool_ID(CSG_String::Format("tool_%02d", Tools.Get_Children_Count()));
2153
2154 Tool.Add_Property("id" , Tool_ID);
2155 Tool.Add_Property("library", History.Get_Property("library"));
2156 Tool.Add_Property("tool" , History.Get_Property("id" ));
2157 Tool.Add_Property("name" , History.Get_Property("name" ));
2158
2159 //-----------------------------------------------------
2160 const CSG_MetaData &Output = History["OUTPUT"];
2161
2162 CSG_String VarName = CSG_String::Format("%s__%s", Tool_ID.c_str(), Output.Get_Property("id"));
2163
2164 pParameter = Tool.Add_Child("output", VarName);
2165 pParameter->Add_Property("parms", Output.Get_Property("parms"));
2166 pParameter->Add_Property("id" , Output.Get_Property("id" ));
2167
2168 if( bAddOutput )
2169 {
2170 pParameter = Parms.Add_Child("output");
2171
2172 pParameter->Add_Property("varname" , VarName);
2173 pParameter->Add_Property("type" , Output.Get_Property("type"));
2174 pParameter->Add_Child ("name" , Output.Get_Property("name"));
2175 // pParameter->Add_Child ("description", Output.Get_Property("name"));
2176 }
2177
2178 //-----------------------------------------------------
2179 for(int i=0; i<History.Get_Children_Count(); i++) // Options and Input
2180 {
2181 CSG_MetaData *pChild = History.Get_Child(i);
2182
2183 if( !pChild->Get_Name().Cmp("OPTION") )
2184 {
2185 pParameter = NULL;
2186
2187 switch( SG_Parameter_Type_Get_Type(pChild->Get_Property("type")) )
2188 {
2189 case PARAMETER_TYPE_Bool :
2190 case PARAMETER_TYPE_Int :
2191 case PARAMETER_TYPE_Double :
2192 case PARAMETER_TYPE_Degree :
2193 case PARAMETER_TYPE_Date :
2194 case PARAMETER_TYPE_Range :
2195 case PARAMETER_TYPE_String :
2196 case PARAMETER_TYPE_Text :
2197 case PARAMETER_TYPE_FilePath :
2198 case PARAMETER_TYPE_Table_Field :
2199 case PARAMETER_TYPE_Table_Fields:
2200 case PARAMETER_TYPE_Choices :
2201 pParameter = Tool.Add_Child("option", pChild->Get_Content());
2202 break;
2203
2204 case PARAMETER_TYPE_Data_Type :
2205 case PARAMETER_TYPE_Choice :
2206 pParameter = Tool.Add_Child("option", pChild->Get_Property("index"));
2207 break;
2208
2209 case PARAMETER_TYPE_Grid_System :
2210 if( pChild->Get_Children_Count() == 0 )
2211 {
2212 pParameter = Tool.Add_Child("option", pChild->Get_Content());
2213 }
2214 break;
2215
2216 default: break;
2217 }
2218
2219 if( pParameter )
2220 {
2221 pParameter->Add_Property("parms", pChild->Get_Property("parms"));
2222 pParameter->Add_Property("id" , pChild->Get_Property("id" ));
2223 }
2224 }
2225 else if( !pChild->Get_Name().Cmp("INPUT") )
2226 {
2227 _Save_History_Add_Input(*pChild, Parms, Tool);
2228 }
2229 else if( !pChild->Get_Name().Cmp("INPUT_LIST") )
2230 {
2231 for(int j=0; j<pChild->Get_Children_Count(); j++)
2232 {
2233 _Save_History_Add_Input(*pChild->Get_Child(j), Parms, Tool);
2234 }
2235 }
2236 }
2237
2238 return( true );
2239 }
2240
2241 //---------------------------------------------------------
2242 bool CSG_Tool_Chain::_Save_History_Add_Input(const CSG_MetaData &History, CSG_MetaData &Parms, CSG_MetaData &Tool)
2243 {
2244 CSG_MetaData *pInput = Tool.Add_Child("input");
2245
2246 pInput->Add_Property("parms", History.Get_Property("parms"));
2247 pInput->Add_Property("id" , History.Get_Property("id" ));
2248
2249 if( History("TOOL") || History("MODULE") )
2250 {
2251 const CSG_MetaData &History_Tool(History("TOOL") ? History["TOOL"] : History["MODULE"]);
2252
2253 if( History_Tool("OUTPUT") && History_Tool["OUTPUT"].Get_Property("id") )
2254 {
2255 pInput->Fmt_Content("tool_%02d__%s", Tool.Get_Parent()->Get_Children_Count() + 1, History_Tool["OUTPUT"].Get_Property("id"));
2256
2257 return( _Save_History_Add_Tool(History_Tool, Parms, *Tool.Get_Parent()) );
2258 }
2259 }
2260
2261 CSG_String VarName = CSG_String::Format("%s__%s", Tool.Get_Property("id"), History.Get_Property("id"));
2262
2263 pInput->Set_Content(VarName);
2264
2265 CSG_MetaData *pParameter = Parms.Ins_Child("input", 0);
2266
2267 pParameter->Add_Property("varname" , VarName);
2268 pParameter->Add_Property("type" , History.Get_Property("type"));
2269 pParameter->Add_Child ("name" , History.Get_Property("name"));
2270 // pParameter->Add_Child ("description", History.Get_Property("name"));
2271
2272 return( true );
2273 }
2274
2275
2277 // //
2278 // //
2279 // //
2281
2282 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_MetaData::Destroy
void Destroy(void)
Definition: metadata.cpp:148
CSG_Parameter::Set_Value
virtual bool Set_Value(int Value)
Definition: parameter.cpp:745
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameter_File_Name::Get_Filter
const SG_Char * Get_Filter(void) const
Definition: parameter_data.cpp:1553
CSG_Tool_Chains::Add_Tool
bool Add_Tool(CSG_Tool_Chain *pTool)
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
CSG_Parameter_File_Name::Get_FilePaths
bool Get_FilePaths(CSG_Strings &FilePaths) const
Definition: parameter_data.cpp:1575
CSG_Parameters::Del_References
void Del_References(void)
Definition: parameters.cpp:326
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_Parameters::Add_Date
CSG_Parameter * Add_Date(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0)
Definition: parameters.cpp:416
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Parameters::Add_Grid_System
CSG_Parameter * Add_Grid_System(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Grid_System *pInit=NULL)
Definition: parameters.cpp:567
CSG_Tool_Chain::Get_Script
static CSG_String Get_Script(CSG_Tool *pTool, bool bHeader, bool bAllParameters=true)
CSG_Parameters::Add_Degree
CSG_Parameter * Add_Degree(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)
Definition: parameters.cpp:411
TOOL_TYPE_Chain
@ TOOL_TYPE_Chain
Definition: tool.h:106
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_Parameter_List::Add_Item
virtual bool Add_Item(CSG_Data_Object *pItem)
Definition: parameter_data.cpp:3013
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
CSG_Tool_Chain::CSG_Tool_Chain
CSG_Tool_Chain(void)
Definition: tool_chain.cpp:79
CSG_Parameters::Add_Colors
CSG_Parameter * Add_Colors(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Colors *pInit=NULL)
Definition: parameters.cpp:536
CSG_Tool_Chains::CSG_Tool_Chains
CSG_Tool_Chains(const CSG_String &Library_Name, const CSG_String &Path)
CSG_MetaData::Get_Children_Count
int Get_Children_Count(void) const
Definition: metadata.h:149
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
CSG_Parameter::asInt
int asInt(void) const
Definition: parameters.h:281
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Tool::On_After_Execution
virtual bool On_After_Execution(void)
Definition: tool.h:240
CSG_Parameter::asString
const SG_Char * asString(void) const
Definition: parameters.h:284
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:994
CSG_MetaData::Get_Content
const CSG_String & Get_Content(void) const
Definition: metadata.h:135
A
#define A
CSG_MetaData::Set_Content
void Set_Content(const CSG_String &Content)
Definition: metadata.h:142
CSG_Parameter_Value::Get_Maximum
double Get_Maximum(void) const
Definition: parameters.h:444
CSG_Tool_Chains::Get_Info
virtual CSG_String Get_Info(int Type) const
CSG_Parameters::Del_Parameters
bool Del_Parameters(void)
Definition: parameters.cpp:1255
CSG_Parameter_Value::has_Minimum
bool has_Minimum(void) const
Definition: parameters.h:441
CSG_Tool_Chain::do_Sync_Projections
virtual bool do_Sync_Projections(void) const
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
PARAMETER_TYPE_Grids_List
@ PARAMETER_TYPE_Grids_List
Definition: parameters.h:155
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
CSG_Parameter_List::Get_Item
CSG_Data_Object * Get_Item(int Index) const
Definition: parameters.h:1368
CSG_Tool_Chain::On_Parameters_Enable
virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
CSG_Parameters::Add_Node
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:371
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_MetaData::Set_Property
bool Set_Property(const CSG_String &Name, const CSG_String &Value, bool bAddIfNotExists=true)
Definition: metadata.cpp:600
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
tool_chain.h
CSG_Tool_Library::Get_Name
CSG_String Get_Name(void) const
Definition: tool_library.h:120
TLB_INFO_Category
@ TLB_INFO_Category
Definition: tool.h:620
saga_api.h
PARAMETER_TYPE_TIN
@ PARAMETER_TYPE_TIN
Definition: parameters.h:152
CSG_Parameters::Add_Grids_List
CSG_Parameter * Add_Grids_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:698
CSG_Parameter_Data_Object_Output
Definition: parameters.h:1165
CSG_Tool
Definition: tool.h:149
SG_Translate
SAGA_API_DLL_EXPORT const SG_Char * SG_Translate(const CSG_String &Text)
Definition: api_translator.cpp:93
CSG_Parameters::Add_String
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)
Definition: parameters.cpp:489
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:290
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:246
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:578
CSG_Parameters::Add_Double
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)
Definition: parameters.cpp:406
CSG_Tool::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: tool.cpp:184
SG_DATAOBJECT_TYPE_Grids
@ SG_DATAOBJECT_TYPE_Grids
Definition: dataobject.h:119
CSG_Tool::Error_Set
bool Error_Set(TSG_Tool_Error Error_ID=TOOL_ERROR_Unknown)
Definition: tool.cpp:709
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
CSG_Parameter::asDataObject
CSG_Data_Object * asDataObject(void) const
Definition: parameter.cpp:972
CSG_Parameter::Assign
bool Assign(CSG_Parameter *pSource)
Definition: parameter.cpp:1072
CSG_Parameter_File_Name::is_Directory
bool is_Directory(void) const
Definition: parameters.h:868
CSG_MetaData::Save
bool Save(const CSG_String &File, const SG_Char *Extension=NULL) const
Definition: metadata.cpp:883
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
CSG_MetaData::Get_Child
CSG_MetaData * Get_Child(int Index) const
Definition: metadata.h:150
TLB_INFO_Name
@ TLB_INFO_Name
Definition: tool.h:615
CSG_MetaData::Get_Name
const CSG_String & Get_Name(void) const
Definition: metadata.h:132
PARAMETER_TYPE_PointCloud
@ PARAMETER_TYPE_PointCloud
Definition: parameters.h:147
CSG_String::Prepend
CSG_String & Prepend(const CSG_String &String)
Definition: api_string.cpp:347
CSG_Parameter_File_Name::is_Save
bool is_Save(void) const
Definition: parameters.h:862
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_Tool::Set_Author
void Set_Author(const CSG_String &String)
Definition: tool.cpp:151
CSG_Tool_Chain::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool_chain.h:92
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Parameter_File_Name::is_Multiple
bool is_Multiple(void) const
Definition: parameters.h:865
CSG_Parameters::Add_PointCloud
CSG_Parameter * Add_PointCloud(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:886
PARAMETER_INPUT_OPTIONAL
#define PARAMETER_INPUT_OPTIONAL
Definition: parameters.h:102
PARAMETER_TYPE_Shapes_List
@ PARAMETER_TYPE_Shapes_List
Definition: parameters.h:157
PARAMETER_TYPE_Grids
@ PARAMETER_TYPE_Grids
Definition: parameters.h:149
CSG_MetaData::Get_Property
const SG_Char * Get_Property(int i) const
Definition: metadata.h:181
Get_List_Count
#define Get_List_Count(p)
Definition: tool_chain.cpp:68
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
CSG_Parameter::Serialize
bool Serialize(CSG_MetaData &MetaData, bool bSave)
Definition: parameter.cpp:1096
CSG_Parameters::Add_Range
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)
Definition: parameters.cpp:432
CSG_Tool_Chain::On_Execute
virtual bool On_Execute(void)
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
CSG_Parameter::is_DataObject_List
bool is_DataObject_List(void) const
Definition: parameter.cpp:294
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
TLB_INFO_Description
@ TLB_INFO_Description
Definition: tool.h:616
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
CSG_Parameter_Shapes
Definition: parameters.h:1278
CSG_Parameter_List::Del_Items
virtual bool Del_Items(void)
Definition: parameter_data.cpp:3055
CSG_Tool_Chains::Delete_Tools
virtual bool Delete_Tools(void)
CSG_MetaData::Cmp_Name
bool Cmp_Name(const CSG_String &String, bool bNoCase=true) const
Definition: metadata.cpp:437
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
CSG_Parameters::Add_TIN_List
CSG_Parameter * Add_TIN_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:871
CSG_MetaData::Ins_Child
CSG_MetaData * Ins_Child(int Position)
Definition: metadata.cpp:215
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
CSG_Parameters::Add_FixedTable
CSG_Parameter * Add_FixedTable(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, CSG_Table *pInit=NULL)
Definition: parameters.cpp:548
PARAMETER_TYPE_Table
@ PARAMETER_TYPE_Table
Definition: parameters.h:150
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
CSG_Data_Manager::Delete_All
bool Delete_All(bool bDetach=false)
Definition: data_manager.cpp:782
CSG_Tool_Chains::Create_Tool
virtual CSG_Tool * Create_Tool(const CSG_String &Name, bool bWithGUI=false)
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
DATAOBJECT_CREATE
#define DATAOBJECT_CREATE
Definition: dataobject.h:130
CSG_Tool::Get_Parameters
CSG_Parameters * Get_Parameters(void)
Definition: tool.h:179
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
CSG_Array_Pointer::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:382
CSG_Parameters::Add_FilePath
CSG_Parameter * Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
Definition: parameters.cpp:500
CSG_Parameter::is_Enabled
bool is_Enabled(bool bCheckEnv=true) const
Definition: parameter.cpp:208
CSG_Tool_Chain::Set_Library_Menu
void Set_Library_Menu(const CSG_String &Menu)
Definition: tool_chain.cpp:122
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
SG_Parameter_Type_Get_Identifier
CSG_String SG_Parameter_Type_Get_Identifier(TSG_Parameter_Type Type)
Definition: parameter_data.cpp:114
CSG_Parameters::Add_Shapes_List
CSG_Parameter * Add_Shapes_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:832
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
CSG_Parameters::Add_Grid_List
CSG_Parameter * Add_Grid_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true)
Definition: parameters.cpp:632
CSG_Tool::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool.h:175
CSG_Data_Manager::Delete
bool Delete(CSG_Data_Collection *pCollection, bool bDetach=false)
Definition: data_manager.cpp:686
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:128
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Tool_Chain::Create
bool Create(const CSG_Tool_Chain &Tool, bool bWithGUI)
Definition: tool_chain.cpp:133
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Parameters::Add_Color
CSG_Parameter * Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
Definition: parameters.cpp:426
SG_Parameter_Type_Get_Type
TSG_Parameter_Type SG_Parameter_Type_Get_Type(const CSG_String &Identifier)
Definition: parameter_data.cpp:164
CSG_Grids::Get_Grid_Ptr
CSG_Grid * Get_Grid_Ptr(int i) const
Definition: grids.h:248
CSG_Parameter_Grid_List
Definition: parameters.h:1402
CSG_Parameters::Add_Int
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)
Definition: parameters.cpp:401
PARAMETER_TYPE_Grid
@ PARAMETER_TYPE_Grid
Definition: parameters.h:148
CSG_Parameters::Add_Table_List
CSG_Parameter * Add_Table_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:793
CSG_Table::Assign_Values
bool Assign_Values(const CSG_Table &Table)
Definition: table.cpp:401
CSG_Array_Int
Definition: api_core.h:421
CSG_Parameters::Add_Table
CSG_Parameter * Add_Table(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:771
CSG_Tool_Library::m_Library_Name
CSG_String m_Library_Name
Definition: tool_library.h:161
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:163
PARAMETER_TYPE_Grid_List
@ PARAMETER_TYPE_Grid_List
Definition: parameters.h:154
CSG_Tool::Process_Set_Text
static void Process_Set_Text(const CSG_String &Text)
Definition: tool.cpp:854
CSG_Tool_Library::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: tool_library.cpp:242
CSG_Parameters::Add_Grids
CSG_Parameter * Add_Grids(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:658
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
SG_DATAOBJECT_TYPE_TIN
@ SG_DATAOBJECT_TYPE_TIN
Definition: dataobject.h:122
CSG_Strings
Definition: api_core.h:693
CSG_Parameters::Add_Table_Fields
CSG_Parameter * Add_Table_Fields(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:754
CSG_Parameters::Add_Grid
CSG_Parameter * Add_Grid(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, bool bSystem_Dependent=true, TSG_Data_Type Preferred_Type=SG_DATATYPE_Undefined)
Definition: parameters.cpp:582
CSG_Tool_Chains::Delete_Tool
virtual bool Delete_Tool(CSG_Tool *pTool)
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Tool_Chain::Save_History_to_Model
static bool Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
CSG_Parameter::asFilePath
class CSG_Parameter_File_Name * asFilePath(void) const
Definition: parameter.cpp:1042
CSG_Parameters::Del_Parameter
bool Del_Parameter(int i)
Definition: parameters.cpp:1191
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:235
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
CSG_MetaData::Add_Children
bool Add_Children(const CSG_MetaData &MetaData)
Definition: metadata.cpp:351
CSG_Tool::Set_Name
void Set_Name(const CSG_String &String)
Definition: tool.cpp:140
CSG_Parameters::Add_TIN
CSG_Parameter * Add_TIN(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:849
CSG_Tool::Set_Description
void Set_Description(const CSG_String &String)
Definition: tool.cpp:173
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Parameters::Add_Grids_Output
CSG_Parameter * Add_Grids_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:686
CSG_Parameter_List::Get_Item_Count
int Get_Item_Count(void) const
Definition: parameters.h:1367
CSG_Tool_Chain
Definition: tool_chain.h:78
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
CSG_Parameters::Get_Identifier
const CSG_String & Get_Identifier(void) const
Definition: parameters.h:1685
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Parameter_Data_Object_Output::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1168
CSG_Parameters::Add_Shapes
CSG_Parameter * Add_Shapes(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint, TSG_Shape_Type Shape_Type=SHAPE_TYPE_Undefined)
Definition: parameters.cpp:808
CSG_Tool::has_GUI
bool has_GUI(void) const
Definition: tool.cpp:233
CSG_MetaData::Cmp_Property
bool Cmp_Property(const CSG_String &Name, const CSG_String &String, bool bNoCase=false) const
Definition: metadata.cpp:673
CSG_Parameter_Value::has_Maximum
bool has_Maximum(void) const
Definition: parameters.h:445
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
GET_XML_CONTENT
#define GET_XML_CONTENT(XML, ID, DEFAULT, TRANSLATE)
Definition: tool_chain.cpp:63
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:644
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_Parameter::Get_Children_Count
int Get_Children_Count(void) const
Definition: parameters.h:254
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:105
CSG_Parameter::is_DataObject
bool is_DataObject(void) const
Definition: parameter.cpp:275
CSG_MetaData::Get_Parent
CSG_MetaData * Get_Parent(void) const
Definition: metadata.h:147
CSG_Array_Pointer::Destroy
void Destroy(void)
Definition: api_core.h:376
SG_Char
#define SG_Char
Definition: api_core.h:530
B
#define B
CSG_Tool::DataObject_Set_Colors
static bool DataObject_Set_Colors(CSG_Data_Object *pDataObject, const CSG_Colors &Colors)
Definition: tool.cpp:1004
CSG_String
Definition: api_core.h:557
CSG_Data_Manager::Add
bool Add(CSG_Data_Object *pObject)
Definition: data_manager.cpp:428
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
SG_DATAOBJECT_TYPE_Table
@ SG_DATAOBJECT_TYPE_Table
Definition: dataobject.h:120
CSG_Tool_Library::Get_Tool
virtual CSG_Tool * Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
Definition: tool_library.cpp:149
CSG_MetaData
Definition: metadata.h:88
CSG_Tool::Settings_Pop
bool Settings_Pop(void)
Definition: tool.cpp:627
CSG_Tool_Chain::is_Okay
bool is_Okay(void) const
Definition: tool_chain.h:96
CSG_MetaData::Load
bool Load(const CSG_String &File, const SG_Char *Extension=NULL)
Definition: metadata.cpp:790
CSG_Tool::Settings_Push
bool Settings_Push(class CSG_Data_Manager *pManager=NULL)
Definition: tool.cpp:600
CSG_Parameter_Shapes::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1281
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
CSG_Parameter::has_Changed
bool has_Changed(int Check_Flags=PARAMETER_CHECK_ALL)
Definition: parameter.cpp:832
IS_TRUE_PROPERTY
#define IS_TRUE_PROPERTY(Item, Property)
Definition: tool_chain.cpp:66
CSG_Parameter::asDouble
double asDouble(void) const
Definition: parameters.h:283
CSG_Parameters::Add_Grid_Output
CSG_Parameter * Add_Grid_Output(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description)
Definition: parameters.cpp:620
CSG_Parameters::Destroy
void Destroy(void)
Definition: parameters.cpp:182
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Tool::Get_Description
const CSG_String & Get_Description(void) const
Definition: tool.cpp:178
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
PARAMETER_TYPE_PointCloud_List
@ PARAMETER_TYPE_PointCloud_List
Definition: parameters.h:159
CSG_Parameter_Grid_List::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const
Definition: parameters.h:1405
PARAMETER_TYPE_Table_List
@ PARAMETER_TYPE_Table_List
Definition: parameters.h:156
CSG_Parameter_Value::Get_Minimum
double Get_Minimum(void) const
Definition: parameters.h:440
CSG_Array_Pointer::Add
bool Add(void *Value)
Definition: api_memory.cpp:485
CSG_Parameter::asRange
class CSG_Parameter_Range * asRange(void) const
Definition: parameter.cpp:1041
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
CSG_Parameters::Add_PointCloud_List
CSG_Parameter * Add_PointCloud_List(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Constraint)
Definition: parameters.cpp:908
SG_Compare_Version
int SG_Compare_Version(const CSG_String &Version, int Major, int Minor, int Release)
Definition: saga_api.cpp:82
CSG_MetaData::Fmt_Content
void Fmt_Content(const char *Format,...)
Definition: metadata.cpp:491
CSG_Parameters::Set_Manager
void Set_Manager(class CSG_Data_Manager *pManager)
Definition: parameters.cpp:206
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
CSG_Tool_Chains::Get_Tool
virtual CSG_Tool * Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:760
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:239
CSG_Parameter_Range::Get_Min_Parameter
CSG_Parameter_Double * Get_Min_Parameter(void) const
Definition: parameters.h:620
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_Parameters::Add_Choices
CSG_Parameter * Add_Choices(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items)
Definition: parameters.cpp:479
CSG_Tool_Chains::~CSG_Tool_Chains
virtual ~CSG_Tool_Chains(void)
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_Parameters
Definition: parameters.h:1650
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:518
CSG_Array_Int::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:435
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_MetaData::asText
CSG_String asText(int Flags=0) const
Definition: metadata.cpp:700
CSG_Parameter::asGrids
CSG_Grids * asGrids(void) const
Definition: parameter.cpp:974
CSG_Parameter::asGrid_System
CSG_Grid_System * asGrid_System(void) const
Definition: parameter.cpp:968
CSG_Tool::Error_Fmt
bool Error_Fmt(const char *Format,...)
Definition: tool.cpp:746
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:161
CSG_Tool::Message_Fmt
void Message_Fmt(const char *Format,...)
Definition: tool.cpp:923
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:565
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter_Range::Get_Max_Parameter
CSG_Parameter_Double * Get_Max_Parameter(void) const
Definition: parameters.h:624
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:238
CSG_Tool_Chains::Get_Count
virtual int Get_Count(void) const
Definition: tool_chain.h:183
PARAMETER_OUTPUT
#define PARAMETER_OUTPUT
Definition: parameters.h:95
CSG_Parameter_Choices::Get_Items
CSG_String Get_Items(void) const
Definition: parameter_data.cpp:1327
CSG_Tool::Set_Grid_System
bool Set_Grid_System(const CSG_Grid_System &System)
Definition: tool.cpp:1262
PARAMETER_TYPE_TIN_List
@ PARAMETER_TYPE_TIN_List
Definition: parameters.h:158
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
Get_List_Item
#define Get_List_Item(p, i)
Definition: tool_chain.cpp:69
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
CSG_Parameter::asList
class CSG_Parameter_List * asList(void) const
Definition: parameter.cpp:1046
IS_TRUE_STRING
#define IS_TRUE_STRING(String)
Definition: tool_chain.cpp:65
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
PARAMETER_TYPE_Shapes
@ PARAMETER_TYPE_Shapes
Definition: parameters.h:151
CSG_Parameter_Choice::Get_Items
CSG_String Get_Items(void) const
Definition: parameter_data.cpp:974
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_Tool::Get_Parameters_Count
int Get_Parameters_Count(void)
Definition: tool.h:178
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
CSG_Tool::On_Parameters_Enable
virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
Definition: tool.cpp:470
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter::is_Information
bool is_Information(void) const
Definition: parameters.h:234
PARAMETER_INPUT
#define PARAMETER_INPUT
Definition: parameters.h:94
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Parameter::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: parameter.cpp:122
CSG_Grids::Del_Grids
bool Del_Grids(bool bDetach=false)
Definition: grids.cpp:803
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
TLB_INFO_Menu_Path
@ TLB_INFO_Menu_Path
Definition: tool.h:619
PARAMETER_OUTPUT_OPTIONAL
#define PARAMETER_OUTPUT_OPTIONAL
Definition: parameters.h:103
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
CSG_Parameters::Add_Table_Field
CSG_Parameter * Add_Table_Field(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bAllowNone=false)
Definition: parameters.cpp:724
CSG_Tool_Chain::~CSG_Tool_Chain
virtual ~CSG_Tool_Chain(void)
Definition: tool_chain.cpp:103
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
CSG_Parameters::Add_Choice
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)
Definition: parameters.cpp:464
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_chain.h File Reference

  • saga_core
  • saga_api
Classes
tool_chain.h File Reference
#include "tool_library.h"
#include "data_manager.h"

Go to the source code of this file.

Classes

class | CSG_Tool_Chain
class | CSG_Tool_Chains
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_chain.h Source File

  • saga_core
  • saga_api
tool_chain.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_chain.h //
15 // //
16 // Copyright (C) 2014 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__tool_chain_H
52 #define HEADER_INCLUDED__SAGA_API__tool_chain_H
53
54
56 // //
57 // //
58 // //
60
61 //---------------------------------------------------------
62 #include "tool_library.h"
63 #include "data_manager.h"
64
65
67 // //
68 // CSG_Tool_Chain //
69 // //
71
72 //---------------------------------------------------------
76 //---------------------------------------------------------
77 class SAGA_API_DLL_EXPORT CSG_Tool_Chain : public CSG_Tool
78 {
79 public:
80 CSG_Tool_Chain(void);
81 virtual ~CSG_Tool_Chain(void);
82
83 CSG_Tool_Chain (const CSG_Tool_Chain &Tool, bool bWithGUI);
84 bool Create (const CSG_Tool_Chain &Tool, bool bWithGUI);
85
86 CSG_Tool_Chain (const CSG_String &File);
87 bool Create (const CSG_String &File);
88
89 CSG_Tool_Chain (const CSG_MetaData &Chain);
90 bool Create (const CSG_MetaData &Chain);
91
92 virtual TSG_Tool_Type Get_Type (void) const { return( TOOL_TYPE_Chain ); }
93
94 virtual bool do_Sync_Projections (void) const;
95
96 bool is_Okay (void) const { return( m_Chain.Get_Children_Count() > 0 ); }
97
98 void Set_Library_Menu (const CSG_String &Menu);
99 virtual CSG_String Get_MenuPath (void) { return( m_Menu ); }
100 const CSG_String & Get_Library_Name (void) const { return( m_Library_Name ); }
101
102 static CSG_String Get_Script (CSG_Tool *pTool, bool bHeader, bool bAllParameters = true);
103
104 static bool Save_History_to_Model (const CSG_MetaData &History, const CSG_String &File);
105
106
107 protected:
108
109 virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter);
110
111 virtual bool On_Execute (void);
112
113
114 private:
115
116 bool m_bAddHistory;
117
118 CSG_String m_Library_Name, m_Menu;
119
120 CSG_MetaData m_Chain, m_Conditions;
121
122 CSG_Parameters m_Data;
123
124 CSG_Data_Manager m_Data_Manager;
125
126
127 void Reset (void);
128
129 void Add_References (void);
130
131 bool Data_Add (const CSG_String &ID, CSG_Parameter *pData);
132 bool Data_Add_TempList (const CSG_String &ID, const CSG_String &Type);
133 bool Data_Del_Temp (const CSG_String &ID, bool bData);
134 bool Data_Exists (CSG_Data_Object *pData);
135 bool Data_Initialize (void);
136 bool Data_Finalize (void);
137
138 bool Parameter_isCompatible (TSG_Parameter_Type A, TSG_Parameter_Type B);
139
140 bool Check_Condition (const CSG_MetaData &Condition, CSG_Parameters *pData);
141
142 bool ForEach (const CSG_MetaData &Commands);
143 bool ForEach_Iterator (const CSG_MetaData &Commands, const CSG_String & VarName, bool bIgnoreErrors);
144 bool ForEach_Object (const CSG_MetaData &Commands, const CSG_String &ListVarName, bool bIgnoreErrors);
145 bool ForEach_File (const CSG_MetaData &Commands, const CSG_String &ListVarName, bool bIgnoreErrors);
146
147 bool Tool_Run (const CSG_MetaData &Tool, bool bShowError = true);
148 bool Tool_Check_Condition (const CSG_MetaData &Tool);
149 bool Tool_Get_Parameter (const CSG_String ID, CSG_Parameters *pParameters, CSG_Parameter **ppParameter, CSG_Parameter **ppOwner = NULL);
150 bool Tool_Get_Parameter (const CSG_MetaData &Parameter, CSG_Tool *pTool , CSG_Parameter **ppParameter, CSG_Parameter **ppOwner = NULL);
151 bool Tool_Initialize (const CSG_MetaData &Tool, CSG_Tool *pTool);
152 bool Tool_Finalize (const CSG_MetaData &Tool, CSG_Tool *pTool);
153
154 //-----------------------------------------------------
155 static bool _Get_Script_Tool (CSG_MetaData &Tool , CSG_Parameters *pParameters, bool bAllParameters, const CSG_String &Prefix, bool bVarNames);
156 static bool _Get_Script_Parameters (CSG_MetaData &Parameters, CSG_Parameters *pParameters, const CSG_String &Prefix);
157
158 static bool _Save_History_Add_Tool (const CSG_MetaData &History, CSG_MetaData &Parms, CSG_MetaData &Tools, bool bAddOutput = false);
159 static bool _Save_History_Add_Input (const CSG_MetaData &History, CSG_MetaData &Parms, CSG_MetaData &Tool);
160
161 };
162
163
165 // //
166 // //
167 // //
169
170 //---------------------------------------------------------
171 class SAGA_API_DLL_EXPORT CSG_Tool_Chains : public CSG_Tool_Library
172 {
173 friend class CSG_Tool_Library_Manager;
174
175 public:
176
177 virtual TSG_Tool_Library_Type Get_Type (void) const { return( TOOL_CHAINS ); }
178
179 virtual CSG_String Get_Info (int Type) const;
180
181 bool Add_Tool (CSG_Tool_Chain *pTool);
182
183 virtual int Get_Count (void) const { return( (int)m_Tools.Get_Size() ); }
184
185 virtual CSG_Tool * Get_Tool (int Index, TSG_Tool_Type Type = TOOL_TYPE_Base) const;
186
187 virtual CSG_Tool * Create_Tool (const CSG_String &Name, bool bWithGUI = false);
188 virtual bool Delete_Tool (CSG_Tool *pTool);
189 virtual bool Delete_Tools (void);
190
191 virtual CSG_String Get_File_Name (int Index) const { return( Index >= 0 && Index < Get_Count() ? ((CSG_Tool *)m_Tools[Index])->Get_File_Name() : "" ); }
192
193
194 protected:
195
196 CSG_Tool_Chains(const CSG_String &Library_Name, const CSG_String &Path);
197 virtual ~CSG_Tool_Chains(void);
198
199
200 private:
201
202 CSG_Array_Pointer m_Tools, m_xTools;
203
204 CSG_String m_Name, m_Description, m_Menu;
205
206 };
207
208
210 // //
211 // //
212 // //
214
215 //---------------------------------------------------------
216 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tool_chain_H
CSG_Tool_Chains
Definition: tool_chain.h:172
CSG_Tool_Chains::Add_Tool
bool Add_Tool(CSG_Tool_Chain *pTool)
TSG_Tool_Library_Type
TSG_Tool_Library_Type
Definition: tool_library.h:92
CSG_Tool_Chain::Get_Script
static CSG_String Get_Script(CSG_Tool *pTool, bool bHeader, bool bAllParameters=true)
TOOL_TYPE_Chain
@ TOOL_TYPE_Chain
Definition: tool.h:106
CSG_Tool_Chains::CSG_Tool_Chains
CSG_Tool_Chains(const CSG_String &Library_Name, const CSG_String &Path)
A
#define A
CSG_Tool_Library
Definition: tool_library.h:107
data_manager.h
CSG_Tool_Chains::Get_Info
virtual CSG_String Get_Info(int Type) const
CSG_Tool_Chain::do_Sync_Projections
virtual bool do_Sync_Projections(void) const
CSG_Tool_Chain::On_Parameters_Enable
virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
CSG_Tool::Reset
bool Reset(bool bManager=true)
Definition: tool.cpp:1215
CSG_Tool
Definition: tool.h:149
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
CSG_Tool_Chain::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool_chain.h:92
CSG_Tool_Chain::On_Execute
virtual bool On_Execute(void)
CSG_Tool_Chain::Get_Library_Name
const CSG_String & Get_Library_Name(void) const
Definition: tool_chain.h:100
CSG_Tool_Chains::Delete_Tools
virtual bool Delete_Tools(void)
CSG_Data_Object
Definition: dataobject.h:180
CSG_Parameter
Definition: parameters.h:207
CSG_Tool_Chains::Create_Tool
virtual CSG_Tool * Create_Tool(const CSG_String &Name, bool bWithGUI=false)
CSG_Tool_Library::Get_Count
virtual int Get_Count(void) const
Definition: tool_library.h:130
CSG_Tool_Chains::Get_File_Name
virtual CSG_String Get_File_Name(int Index) const
Definition: tool_chain.h:191
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
TOOL_CHAINS
@ TOOL_CHAINS
Definition: tool_library.h:94
CSG_Tool_Chains::Delete_Tool
virtual bool Delete_Tool(CSG_Tool *pTool)
CSG_Tool_Chain::Save_History_to_Model
static bool Save_History_to_Model(const CSG_MetaData &History, const CSG_String &File)
CSG_Tool_Chain
Definition: tool_chain.h:78
CSG_Tool_Chain::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool_chain.h:99
B
#define B
CSG_String
Definition: api_core.h:557
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Data_Manager
Definition: data_manager.h:164
CSG_MetaData
Definition: metadata.h:88
CSG_Tool_Chain::is_Okay
bool is_Okay(void) const
Definition: tool_chain.h:96
CSG_Tool::CSG_Tool_Chain
friend class CSG_Tool_Chain
Definition: tool.h:152
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
CSG_Tool_Chains::Get_Tool
virtual CSG_Tool * Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
tool_library.h
CSG_Tool_Chains::~CSG_Tool_Chains
virtual ~CSG_Tool_Chains(void)
CSG_Parameters
Definition: parameters.h:1650
CSG_Tool_Chains::Get_Type
virtual TSG_Tool_Library_Type Get_Type(void) const
Definition: tool_chain.h:177
CSG_Tool_Chains::Get_Count
virtual int Get_Count(void) const
Definition: tool_chain.h:183
TSG_Parameter_Type
TSG_Parameter_Type
Definition: parameters.h:122
CSG_Tool_Library_Manager
Definition: tool_library.h:186
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_grid.cpp File Reference

  • saga_core
  • saga_api
tool_grid.cpp File Reference
#include "tool.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_grid.cpp Source File

  • saga_core
  • saga_api
tool_grid.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_grid.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tool.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Tool_Grid::CSG_Tool_Grid(void)
64 : CSG_Tool()
65 {
66 m_pLock = NULL;
67
68 Parameters.Use_Grid_System();
69 }
70
71 //---------------------------------------------------------
72 CSG_Tool_Grid::~CSG_Tool_Grid(void)
73 {
74 Lock_Destroy();
75 }
76
77
79 // //
81
82 //---------------------------------------------------------
83 bool CSG_Tool_Grid::Set_System(const CSG_Grid_System &System)
84 {
85 if( Parameters.Get_Grid_System() )
86 {
87 return( Parameters.Get_Grid_System()->Create(System) );
88 }
89
90 return( false );
91 }
92
93
95 // //
97
98 //---------------------------------------------------------
99 bool CSG_Tool_Grid::Set_Progress_Cells(sLong Cell) const
100 {
101 if( Get_System().is_Valid() )
102 {
103 return( CSG_Tool::Set_Progress((double)Cell, (double)Get_NCells() - 1.) );
104 }
105
106 return( is_Progress() );
107 }
108
109 //---------------------------------------------------------
110 bool CSG_Tool_Grid::Set_Progress_Rows(int Row) const
111 {
112 return( CSG_Tool::Set_Progress((double)Row, (double)Get_NY() - 1.) );
113 }
114
115
117 // //
119
120 //---------------------------------------------------------
121 void CSG_Tool_Grid::Lock_Create(void)
122 {
123 if( Get_System().is_Valid() )
124 {
125 if( m_pLock && Get_System().is_Equal(m_pLock->Get_System()) )
126 {
127 m_pLock->Assign(0.0);
128 }
129 else
130 {
131 Lock_Destroy();
132
133 m_pLock = new CSG_Grid(
134 SG_DATATYPE_Char, Get_NX(), Get_NY(), Get_Cellsize(), Get_XMin(), Get_YMin()
135 );
136 }
137 }
138 }
139
140 //---------------------------------------------------------
141 void CSG_Tool_Grid::Lock_Destroy(void)
142 {
143 if( m_pLock )
144 {
145 delete(m_pLock);
146
147 m_pLock = NULL;
148 }
149 }
150
151
153 // //
154 // //
155 // //
157
158 //---------------------------------------------------------
CSG_Parameters::Get_Grid_System
CSG_Grid_System * Get_Grid_System(void) const
Definition: parameters.h:1847
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
CSG_Tool_Grid::Lock_Create
void Lock_Create(void)
Definition: tool_grid.cpp:121
CSG_Tool_Grid::Get_NY
int Get_NY(void) const
Definition: tool.h:401
CSG_Grid_System
Definition: grid.h:200
CSG_Tool_Grid::Lock_Destroy
void Lock_Destroy(void)
Definition: tool_grid.cpp:141
CSG_Tool_Grid::Get_YMin
double Get_YMin(void) const
Definition: tool.h:404
CSG_Tool
Definition: tool.h:149
CSG_Tool_Grid::CSG_Tool_Grid
CSG_Tool_Grid(void)
Definition: tool_grid.cpp:63
CSG_Grid_System::Create
bool Create(const CSG_Grid_System &System)
Definition: grid_system.cpp:129
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:531
tool.h
CSG_Tool_Grid::Set_System
bool Set_System(const CSG_Grid_System &System)
Definition: tool_grid.cpp:83
CSG_Parameters::Use_Grid_System
bool Use_Grid_System(void)
Definition: parameters.cpp:224
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Grid::Assign
virtual bool Assign(double Value=0.0)
Definition: grid_operation.cpp:77
CSG_Tool::is_Progress
bool is_Progress(void) const
Definition: tool.h:234
CSG_Tool_Grid::Set_Progress_Cells
virtual bool Set_Progress_Cells(sLong Cell) const
Definition: tool_grid.cpp:99
CSG_Tool_Grid::Set_Progress_Rows
virtual bool Set_Progress_Rows(int Row) const
Definition: tool_grid.cpp:110
CSG_Tool_Grid::~CSG_Tool_Grid
virtual ~CSG_Tool_Grid(void)
Definition: tool_grid.cpp:72
CSG_Tool_Grid::Get_NX
int Get_NX(void) const
Definition: tool.h:400
CSG_Tool_Grid::Get_XMin
double Get_XMin(void) const
Definition: tool.h:403
CSG_Tool::Set_Progress
virtual bool Set_Progress(int Position, int Range) const
Definition: tool.cpp:664
CSG_Grid
Definition: grid.h:473
CSG_Tool_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: tool.h:388
CSG_Tool_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: tool.h:402
CSG_Tool_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: tool.h:407
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:988
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_grid_interactive.cpp File Reference

  • saga_core
  • saga_api
tool_grid_interactive.cpp File Reference
#include "tool.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_grid_interactive.cpp Source File

  • saga_core
  • saga_api
tool_grid_interactive.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_grid_interactive.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tool.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Tool_Grid_Interactive::CSG_Tool_Grid_Interactive(void)
64 {
65 m_pTool = this;
66 }
67
68 //---------------------------------------------------------
69 CSG_Tool_Grid_Interactive::~CSG_Tool_Grid_Interactive(void)
70 {
71 }
72
73
75 // //
77
78 //---------------------------------------------------------
79 bool CSG_Tool_Grid_Interactive::Get_Grid_Pos(int &x, int &y) const
80 {
81 if( !Get_System().is_Valid() )
82 {
83 x = 0; y = 0; return( false );
84 }
85
86 bool bResult = true;
87
88 x = (int)(0.5 + (Get_xPosition() - Get_XMin()) / Get_Cellsize());
89 if ( x < 0 ) { x = 0 ; bResult = false; }
90 else if( x >= Get_NX() ) { x = Get_NX() - 1; bResult = false; }
91
92 y = (int)(0.5 + (Get_yPosition() - Get_YMin()) / Get_Cellsize());
93 if ( y < 0 ) { y = 0 ; bResult = false; }
94 else if( y >= Get_NY() ) { y = Get_NY() - 1; bResult = false; }
95
96 return( bResult );
97 }
98
99 //---------------------------------------------------------
100 int CSG_Tool_Grid_Interactive::Get_xGrid(void) const
101 {
102 if( Get_System().is_Valid() )
103 {
104 int x = (int)(0.5 + (Get_xPosition() - Get_XMin()) / Get_Cellsize());
105
106 return( x < 0 ? 0 : x < Get_NX() ? x : Get_NX() - 1 );
107 }
108
109 return( 0 );
110 }
111
112 //---------------------------------------------------------
113 int CSG_Tool_Grid_Interactive::Get_yGrid(void) const
114 {
115 if( Get_System().is_Valid() )
116 {
117 int y = (int)(0.5 + (Get_yPosition() - Get_YMin()) / Get_Cellsize());
118
119 return( y < 0 ? 0 : y < Get_NY() ? y : Get_NY() - 1 );
120 }
121
122 return( 0 );
123 }
124
125
127 // //
128 // //
129 // //
131
132 //---------------------------------------------------------
CSG_Tool_Grid_Interactive::Get_xGrid
int Get_xGrid(void) const
Definition: tool_grid_interactive.cpp:100
CSG_Tool_Grid::Get_NY
int Get_NY(void) const
Definition: tool.h:401
CSG_Tool_Interactive_Base::Get_yPosition
double Get_yPosition(void) const
Definition: tool.h:520
CSG_Tool_Grid::Get_YMin
double Get_YMin(void) const
Definition: tool.h:404
CSG_Tool_Interactive_Base::Get_xPosition
double Get_xPosition(void) const
Definition: tool.h:519
tool.h
CSG_Tool_Grid_Interactive::Get_Grid_Pos
bool Get_Grid_Pos(int &x, int &y) const
Definition: tool_grid_interactive.cpp:79
CSG_Tool_Grid_Interactive::Get_yGrid
int Get_yGrid(void) const
Definition: tool_grid_interactive.cpp:113
CSG_Tool_Grid::Get_NX
int Get_NX(void) const
Definition: tool.h:400
CSG_Tool_Grid::Get_XMin
double Get_XMin(void) const
Definition: tool.h:403
CSG_Tool_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: tool.h:388
CSG_Tool_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: tool.h:407
CSG_Tool_Grid_Interactive::~CSG_Tool_Grid_Interactive
virtual ~CSG_Tool_Grid_Interactive(void)
Definition: tool_grid_interactive.cpp:69
CSG_Tool_Grid_Interactive::CSG_Tool_Grid_Interactive
CSG_Tool_Grid_Interactive(void)
Definition: tool_grid_interactive.cpp:63
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_interactive.cpp File Reference

  • saga_core
  • saga_api
tool_interactive.cpp File Reference
#include "tool.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_interactive.cpp Source File

  • saga_core
  • saga_api
tool_interactive.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_interactive.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tool.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Tool_Interactive::CSG_Tool_Interactive(void)
64 {
65 m_pTool = this;
66 }
67
68 //---------------------------------------------------------
69 CSG_Tool_Interactive::~CSG_Tool_Interactive(void)
70 {}
71
72
74 // //
75 // //
76 // //
78
79 //---------------------------------------------------------
CSG_Tool_Interactive::~CSG_Tool_Interactive
virtual ~CSG_Tool_Interactive(void)
Definition: tool_interactive.cpp:69
tool.h
CSG_Tool_Interactive::CSG_Tool_Interactive
CSG_Tool_Interactive(void)
Definition: tool_interactive.cpp:63
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_interactive_base.cpp File Reference

  • saga_core
  • saga_api
Macros
tool_interactive_base.cpp File Reference
#include "tool.h"

Go to the source code of this file.

Macros

#define | ADD_MESSAGE_EXECUTION(Text, Style) { SG_UI_Msg_Add(Text, true, Style); if( m_pTool->has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }
#define | ADD_MESSAGE_TIME(Start)

Macro Definition Documentation

◆ ADD_MESSAGE_EXECUTION

#define ADD_MESSAGE_EXECUTION | ( | Text,
 |  | Style
 | ) | { SG_UI_Msg_Add(Text, true, Style); if( m_pTool->has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }

Definition at line 63 of file tool_interactive_base.cpp.

◆ ADD_MESSAGE_TIME

#define ADD_MESSAGE_TIME ( Start )
Value:
{ CSG_TimeSpan Time = CSG_DateTime::Now() - Start; CSG_String s;\
if( Time.Get_Hours () >= 1 ) { s = Time.Format("%Hh %Mm %Ss"); } else\
if( Time.Get_Minutes () >= 1 ) { s = Time.Format( "%Mm %Ss"); } else\
if( Time.Get_Seconds () >= 1 ) { s = Time.Format( "%Ss"); } else\
if( Time.Get_Milliseconds() >= 1 ) { s = Time.Format("%l ") + _TL("milliseconds"); } else { s = _TL("less than 1 millisecond"); }\
SG_UI_Msg_Add_Execution(CSG_String::Format("\n[%s] %s %s", m_pTool->Get_Name().c_str(), _TL("finished in"), s.c_str()), false);\
}

Definition at line 65 of file tool_interactive_base.cpp.

_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_TimeSpan::Get_Hours
int Get_Hours(void) const
Definition: datetime.h:161
CSG_TimeSpan::Get_Milliseconds
sLong Get_Milliseconds(void) const
Definition: datetime.h:164
CSG_TimeSpan
Definition: datetime.h:91
CSG_TimeSpan::Format
CSG_String Format(const CSG_String &format="") const
Definition: datetime.cpp:65
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_TimeSpan::Get_Minutes
int Get_Minutes(void) const
Definition: datetime.h:162
CSG_TimeSpan::Get_Seconds
sLong Get_Seconds(void) const
Definition: datetime.h:163
CSG_String
Definition: api_core.h:557
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_interactive_base.cpp Source File

  • saga_core
  • saga_api
tool_interactive_base.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_interactive_base.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "tool.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 #define ADD_MESSAGE_EXECUTION(Text, Style) { SG_UI_Msg_Add(Text, true, Style); if( m_pTool->has_GUI() ) { SG_UI_Msg_Add_Execution(Text, true, Style); } }
64
65 #define ADD_MESSAGE_TIME(Start) { CSG_TimeSpan Time = CSG_DateTime::Now() - Start; CSG_String s;\
66 if( Time.Get_Hours () >= 1 ) { s = Time.Format("%Hh %Mm %Ss"); } else\
67 if( Time.Get_Minutes () >= 1 ) { s = Time.Format( "%Mm %Ss"); } else\
68 if( Time.Get_Seconds () >= 1 ) { s = Time.Format( "%Ss"); } else\
69 if( Time.Get_Milliseconds() >= 1 ) { s = Time.Format("%l ") + _TL("milliseconds"); } else { s = _TL("less than 1 millisecond"); }\
70 SG_UI_Msg_Add_Execution(CSG_String::Format("\n[%s] %s %s", m_pTool->Get_Name().c_str(), _TL("finished in"), s.c_str()), false);\
71 }
72
73
75 // //
76 // //
77 // //
79
80 //---------------------------------------------------------
81 CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base(void)
82 {
83 m_pTool = NULL;
84
85 m_Keys = 0;
86 m_Drag_Mode = TOOL_INTERACTIVE_DRAG_BOX;
87
88 m_Point .Assign(0., 0.);
89 m_Point_Last.Assign(0., 0.);
90 }
91
92 //---------------------------------------------------------
93 CSG_Tool_Interactive_Base::~CSG_Tool_Interactive_Base(void)
94 {}
95
96
98 // //
100
101 //---------------------------------------------------------
102 bool CSG_Tool_Interactive_Base::Set_Projection(const CSG_Projection &Projection)
103 {
104 return( m_Projection.Create(Projection) );
105 }
106
107 //---------------------------------------------------------
108 bool CSG_Tool_Interactive_Base::Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
109 {
110 if( !m_pTool || m_pTool->m_bExecutes )
111 {
112 return( false );
113 }
114
115 m_pTool->m_bError_Ignore = false;
116 m_pTool->m_bExecutes = true;
117 m_Point_Last = m_Point;
118 m_Point = ptWorld;
119 m_Keys = Keys;
120
121 CSG_DateTime Started(CSG_DateTime::Now());
122 bool bResult = On_Execute_Position(m_Point, Mode);
123 if( bResult ) ADD_MESSAGE_TIME(Started);
124
125 m_Keys = 0;
126 m_pTool->m_bExecutes = false;
127
128 m_pTool->_Synchronize_DataObjects();
129
130 SG_UI_Process_Set_Okay(); SG_UI_Process_Set_Ready();
131
132 return( bResult );
133 }
134
135 bool CSG_Tool_Interactive_Base::On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
136 {
137 return( false );
138 }
139
140 //---------------------------------------------------------
141 bool CSG_Tool_Interactive_Base::Execute_Keyboard(int Character, int Keys)
142 {
143 if( !m_pTool || m_pTool->m_bExecutes )
144 {
145 return( false );
146 }
147
148 m_pTool->m_bError_Ignore = false;
149 m_pTool->m_bExecutes = true;
150 m_Keys = Keys;
151
152 CSG_DateTime Started(CSG_DateTime::Now());
153 bool bResult = On_Execute_Keyboard(Character);
154 if( bResult ) ADD_MESSAGE_TIME(Started);
155
156 m_Keys = 0;
157 m_pTool->m_bExecutes = false;
158
159 m_pTool->_Synchronize_DataObjects();
160
161 SG_UI_Process_Set_Okay(); SG_UI_Process_Set_Ready();
162
163 return( bResult );
164 }
165
166 bool CSG_Tool_Interactive_Base::On_Execute_Keyboard(int Character)
167 {
168 return( false );
169 }
170
171 //---------------------------------------------------------
172 bool CSG_Tool_Interactive_Base::Execute_Finish(void)
173 {
174 if( !m_pTool || m_pTool->m_bExecutes )
175 {
176 return( false );
177 }
178
179 m_pTool->m_bError_Ignore = false;
180 m_pTool->m_bExecutes = true;
181
182 CSG_DateTime Started(CSG_DateTime::Now());
183 bool bResult = On_Execute_Finish();
184 if( bResult ) ADD_MESSAGE_TIME(Started);
185
186 m_pTool->m_bExecutes = false;
187
188 m_pTool->_Synchronize_DataObjects();
189
190 SG_UI_Process_Set_Okay(); SG_UI_Process_Set_Ready();
191
192 ADD_MESSAGE_EXECUTION(CSG_String::Format("[%s] %s", m_pTool->Get_Name().c_str(), bResult
193 ? _TL("Interactive tool execution has been stopped")
194 : _TL("Interactive tool execution failed")),
195 bResult ? SG_UI_MSG_STYLE_SUCCESS : SG_UI_MSG_STYLE_FAILURE
196 );
197
198 return( bResult );
199 }
200
201 bool CSG_Tool_Interactive_Base::On_Execute_Finish(void)
202 {
203 return( true );
204 }
205
206
208 // //
210
211 //---------------------------------------------------------
212 void CSG_Tool_Interactive_Base::Set_Drag_Mode(int Drag_Mode)
213 {
214 m_Drag_Mode = Drag_Mode;
215 }
216
217
219 // //
220 // //
221 // //
223
224 //---------------------------------------------------------
CSG_Tool_Interactive_Base::CSG_Tool_Interactive_Base
CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:81
ADD_MESSAGE_TIME
#define ADD_MESSAGE_TIME(Start)
Definition: tool_interactive_base.cpp:65
ADD_MESSAGE_EXECUTION
#define ADD_MESSAGE_EXECUTION(Text, Style)
Definition: tool_interactive_base.cpp:63
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Tool_Interactive_Base::On_Execute_Keyboard
virtual bool On_Execute_Keyboard(int Character)
Definition: tool_interactive_base.cpp:166
CSG_DateTime::Now
static CSG_DateTime Now(void)
Definition: datetime.cpp:581
CSG_Tool_Interactive_Base::On_Execute_Finish
virtual bool On_Execute_Finish(void)
Definition: tool_interactive_base.cpp:201
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_Tool_Interactive_Base::~CSG_Tool_Interactive_Base
virtual ~CSG_Tool_Interactive_Base(void)
Definition: tool_interactive_base.cpp:93
SG_UI_Process_Set_Okay
bool SG_UI_Process_Set_Okay(bool bOkay)
Definition: api_callback.cpp:223
CSG_Tool_Interactive_Base::Execute_Position
bool Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode, int Keys)
Definition: tool_interactive_base.cpp:108
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
CSG_Tool_Interactive_Base::Execute_Keyboard
bool Execute_Keyboard(int Character, int Keys)
Definition: tool_interactive_base.cpp:141
TSG_Tool_Interactive_Mode
TSG_Tool_Interactive_Mode
Definition: tool.h:451
tool.h
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
CSG_Tool_Interactive_Base::Execute_Finish
bool Execute_Finish(void)
Definition: tool_interactive_base.cpp:172
CSG_Point
Definition: geo_tools.h:135
CSG_Tool_Interactive_Base::Set_Drag_Mode
void Set_Drag_Mode(int Drag_Mode)
Definition: tool_interactive_base.cpp:212
CSG_Tool_Interactive_Base::Set_Projection
bool Set_Projection(const CSG_Projection &Projection)
Definition: tool_interactive_base.cpp:102
CSG_Point::Assign
virtual void Assign(double x, double y)
Definition: geo_classes.cpp:86
CSG_DateTime
Definition: datetime.h:183
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Projection
Definition: geo_tools.h:833
TOOL_INTERACTIVE_DRAG_BOX
@ TOOL_INTERACTIVE_DRAG_BOX
Definition: tool.h:474
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:299
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
CSG_Tool_Interactive_Base::On_Execute_Position
virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Tool_Interactive_Mode Mode)
Definition: tool_interactive_base.cpp:135
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library.cpp File Reference

  • saga_core
  • saga_api
Functions | Variables
tool_library.cpp File Reference
#include <wx/dynlib.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/utils.h>
#include "tool_chain.h"

Go to the source code of this file.

Functions

CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager (void)

Variables

CSG_Tool_Library_Manager g_Tool_Library_Manager

Function Documentation

◆ SG_Get_Tool_Library_Manager()

CSG_Tool_Library_Manager& SG_Get_Tool_Library_Manager ( void )

Definition at line 286 of file tool_library.cpp.

References g_Tool_Library_Manager.

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), SG_Get_Projected(), and SG_Initialize_Environment().

Variable Documentation

◆ g_Tool_Library_Manager

CSG_Tool_Library_Manager g_Tool_Library_Manager

Definition at line 283 of file tool_library.cpp.

Referenced by CSG_Tool_Library_Manager::CSG_Tool_Library_Manager(), and SG_Get_Tool_Library_Manager().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library.cpp Source File

  • saga_core
  • saga_api
tool_library.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_library.cpp //
15 // //
16 // Copyright (C) 2006 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include <wx/dynlib.h>
54 #include <wx/dir.h>
55 #include <wx/filename.h>
56 #include <wx/utils.h>
57
58 #include "tool_chain.h"
59
60
62 // //
63 // //
64 // //
66
67 //---------------------------------------------------------
68 CSG_Tool_Library::CSG_Tool_Library(void)
69 {
70 m_pInterface = NULL;
71 m_pLibrary = NULL;
72 }
73
74 //---------------------------------------------------------
75 CSG_Tool_Library::CSG_Tool_Library(const CSG_String &File)
76 {
77 m_pLibrary = new wxDynamicLibrary(SG_File_Get_Path_Absolute(File).c_str(), wxDL_DEFAULT|wxDL_QUIET);
78
79 if( m_pLibrary->IsLoaded()
80 && m_pLibrary->HasSymbol(SYMBOL_TLB_Get_Interface)
81 && m_pLibrary->HasSymbol(SYMBOL_TLB_Initialize)
82 && m_pLibrary->HasSymbol(SYMBOL_TLB_Finalize)
83 && ((TSG_PFNC_TLB_Initialize)m_pLibrary->GetSymbol(SYMBOL_TLB_Initialize))(File) )
84 {
85 m_pInterface = ((TSG_PFNC_TLB_Get_Interface)m_pLibrary->GetSymbol(SYMBOL_TLB_Get_Interface))();
86
87 if( m_pInterface->Get_Count() > 0 )
88 {
89 m_File_Name = m_pInterface->Get_Info(TLB_INFO_File );
90 m_Library_Name = m_pInterface->Get_Info(TLB_INFO_Library);
91
92 return; // success
93 }
94 }
95
96 _Destroy();
97 }
98
99 //---------------------------------------------------------
100 CSG_Tool_Library::~CSG_Tool_Library(void)
101 {
102 _Destroy();
103 }
104
105 //---------------------------------------------------------
106 bool CSG_Tool_Library::_Destroy(void)
107 {
108 if( m_pLibrary )
109 {
110 if( m_pLibrary->IsLoaded() && m_pLibrary->HasSymbol(SYMBOL_TLB_Finalize) )
111 {
112 TSG_PFNC_TLB_Finalize TLB_Finalize = (TSG_PFNC_TLB_Finalize)m_pLibrary->GetSymbol(SYMBOL_TLB_Finalize);
113
114 TLB_Finalize();
115 }
116
117 delete(m_pLibrary);
118
119 m_pLibrary = NULL;
120 }
121
122 m_pInterface = NULL;
123
124 return( true );
125 }
126
127
129 // //
131
132 //---------------------------------------------------------
133 CSG_String CSG_Tool_Library::Get_Info(int Type) const
134 {
135 if( m_pInterface != NULL )
136 {
137 return( m_pInterface->Get_Info(Type) );
138 }
139
140 return( "" );
141 }
142
143
145 // //
147
148 //---------------------------------------------------------
149 CSG_Tool * CSG_Tool_Library::Get_Tool(int Index, TSG_Tool_Type Type) const
150 {
151 CSG_Tool *pTool = m_pInterface && Index >= 0 && Index < Get_Count() ? m_pInterface->Get_Tool(Index) : NULL;
152
153 return( pTool && (Type == TOOL_TYPE_Base || Type == pTool->Get_Type()) ? pTool : NULL );
154 }
155
156 //---------------------------------------------------------
157 CSG_Tool * CSG_Tool_Library::Get_Tool(const char *Name, TSG_Tool_Type Type) const { return( Get_Tool(CSG_String(Name), Type) ); }
158 CSG_Tool * CSG_Tool_Library::Get_Tool(const wchar_t *Name, TSG_Tool_Type Type) const { return( Get_Tool(CSG_String(Name), Type) ); }
159 CSG_Tool * CSG_Tool_Library::Get_Tool(const CSG_String &Name, TSG_Tool_Type Type) const
160 {
161 for(int i=0; i<Get_Count(); i++)
162 {
163 CSG_Tool *pTool = Get_Tool(i, Type);
164
165 if( pTool && (!pTool->Get_ID().Cmp(Name) || !pTool->Get_Name().Cmp(Name)) )
166 {
167 return( pTool );
168 }
169 }
170
171 return( NULL );
172 }
173
174
176 // //
178
179 //---------------------------------------------------------
189 //---------------------------------------------------------
190 CSG_Tool * CSG_Tool_Library::Create_Tool(int Index, bool bWithGUI)
191 {
192 return( m_pInterface ? m_pInterface->Create_Tool(Index, bWithGUI) : NULL );
193 }
194
195 //---------------------------------------------------------
196 CSG_Tool * CSG_Tool_Library::Create_Tool(const char *Name, bool bWithGUI) { return( Create_Tool(CSG_String(Name), bWithGUI) ); }
197 CSG_Tool * CSG_Tool_Library::Create_Tool(const wchar_t *Name, bool bWithGUI) { return( Create_Tool(CSG_String(Name), bWithGUI) ); }
198 CSG_Tool * CSG_Tool_Library::Create_Tool(const CSG_String &Name, bool bWithGUI)
199 {
200 int Index; return( Name.asInt(Index) ? Create_Tool(Index, bWithGUI) : NULL );
201 }
202
203 //---------------------------------------------------------
208 //---------------------------------------------------------
209 bool CSG_Tool_Library::Delete_Tool(CSG_Tool *pTool)
210 {
211 return( m_pInterface ? m_pInterface->Delete_Tool(pTool) : false );
212 }
213
214 //---------------------------------------------------------
215 bool CSG_Tool_Library::Delete_Tools(void)
216 {
217 return( m_pInterface ? m_pInterface->Delete_Tools() : false );
218 }
219
220
222 // //
224
225 //---------------------------------------------------------
226 CSG_String CSG_Tool_Library::Get_Menu(int i) const
227 {
228 if( Get_Tool(i) )
229 {
230 return( Get_Tool(i)->Get_MenuPath(true) );
231 }
232
233 return( "" );
234 }
235
236
238 // //
240
241 //---------------------------------------------------------
242 void CSG_Tool_Library::Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link, const SG_Char *Link_Text)
243 {
244 CSG_String Reference = Authors;
245
246 Reference.Printf("<b>%s (%s):</b> %s. %s", Authors.c_str(), Year.c_str(), Title.c_str(), Where.c_str());
247
248 if( Link && *Link )
249 {
250 Reference += CSG_String::Format(" <a href=\"%s\">%s</a>.", Link, Link_Text && *Link_Text ? Link_Text : Link);
251 }
252
253 if( !Reference.is_Empty() )
254 {
255 m_References += Reference;
256 }
257
258 m_References.Sort();
259 }
260
261 //---------------------------------------------------------
262 void CSG_Tool_Library::Add_Reference(const CSG_String &Link, const SG_Char *Link_Text)
263 {
264 m_References += CSG_String::Format("<a href=\"%s\">%s</a>", Link.c_str(), Link_Text && *Link_Text ? Link_Text : Link.c_str());
265
266 m_References.Sort();
267 }
268
269 //---------------------------------------------------------
270 void CSG_Tool_Library::Del_References(void)
271 {
272 m_References.Clear();
273 }
274
275
277 // //
278 // //
279 // //
281
282 //---------------------------------------------------------
283 CSG_Tool_Library_Manager g_Tool_Library_Manager;
284
285 //---------------------------------------------------------
286 CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager (void)
287 {
288 return( g_Tool_Library_Manager );
289 }
290
291
293 // //
295
296 //---------------------------------------------------------
297 CSG_Tool_Library_Manager::CSG_Tool_Library_Manager(void)
298 {
299 m_pLibraries = NULL;
300 m_nLibraries = 0;
301
302 if( this == &g_Tool_Library_Manager )
303 {
304 CSG_Random::Initialize(); // initialize with current time on startup
305 }
306 }
307
308 //---------------------------------------------------------
309 CSG_Tool_Library_Manager::~CSG_Tool_Library_Manager(void)
310 {
311 Destroy();
312 }
313
314
316 // //
318
319 //---------------------------------------------------------
320 int CSG_Tool_Library_Manager::Get_Tool_Count(void) const
321 {
322 int nTools = 0;
323
324 for(int i=0; i<m_nLibraries; i++)
325 {
326 nTools += m_pLibraries[i]->Get_Count();
327 }
328
329 return( nTools );
330 }
331
332
334 // //
336
337 //---------------------------------------------------------
338 CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library(const CSG_String &File)
339 {
340 if( !SG_File_Cmp_Extension(File, "mlb" )
341 && !SG_File_Cmp_Extension(File, "dll" )
342 && !SG_File_Cmp_Extension(File, "so" )
343 && !SG_File_Cmp_Extension(File, "dylib") )
344 {
345 return( _Add_Tool_Chain(File) );
346 }
347
348 //-----------------------------------------------------
349 SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Loading library"), File.c_str()), true);
350
351 wxFileName fn(File.c_str());
352
353 for(int i=0; i<Get_Count(); i++)
354 {
355 if( fn == Get_Library(i)->Get_File_Name().c_str() )
356 {
357 SG_UI_Msg_Add(_TL("has already been loaded"), false);
358
359 return( NULL );
360 }
361 }
362
363 //-----------------------------------------------------
364 CSG_Tool_Library *pLibrary = new CSG_Tool_Library(File);
365
366 if( pLibrary->is_Valid() )
367 {
368 m_pLibraries = (CSG_Tool_Library **)SG_Realloc(m_pLibraries, (m_nLibraries + 1) * sizeof(CSG_Tool_Library *));
369 m_pLibraries[m_nLibraries++] = pLibrary;
370
371 SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
372
373 return( pLibrary );
374 }
375
376 delete(pLibrary);
377
378 SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
379
380 return( NULL );
381 }
382
383 CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library(const char *File)
384 {
385 return( Add_Library(CSG_String(File)) );
386 }
387
388 CSG_Tool_Library * CSG_Tool_Library_Manager::Add_Library(const wchar_t *File)
389 {
390 return( Add_Library(CSG_String(File)) );
391 }
392
393 //---------------------------------------------------------
394 int CSG_Tool_Library_Manager::Add_Directory(const CSG_String &Directory, bool bOnlySubDirectories)
395 {
396 int nOpened = 0;
397 wxDir Dir;
398
399 if( Dir.Open(Directory.c_str()) )
400 {
401 wxString FileName, DirName(Dir.GetName());
402
403 if( !bOnlySubDirectories && Dir.GetFirst(&FileName, wxEmptyString, wxDIR_FILES) )
404 {
405 do
406 { if( FileName.Find("saga_") < 0 && FileName.Find("wx") < 0 )
407 if( Add_Library(SG_File_Make_Path(&DirName, &FileName)) )
408 {
409 nOpened++;
410 }
411 }
412 while( Dir.GetNext(&FileName) );
413 }
414
415 if( Dir.GetFirst(&FileName, wxEmptyString, wxDIR_DIRS) )
416 {
417 do
418 {
419 if( FileName.CmpNoCase("dll") )
420 {
421 nOpened += Add_Directory(SG_File_Make_Path(&DirName, &FileName), false);
422 }
423 }
424 while( Dir.GetNext(&FileName) );
425 }
426 }
427
428 return( nOpened );
429 }
430
431 int CSG_Tool_Library_Manager::Add_Directory(const char *Directory, bool bOnlySubDirectories)
432 {
433 return( Add_Directory(CSG_String(Directory), bOnlySubDirectories) );
434 }
435
436 int CSG_Tool_Library_Manager::Add_Directory(const wchar_t *Directory, bool bOnlySubDirectories)
437 {
438 return( Add_Directory(CSG_String(Directory), bOnlySubDirectories) );
439 }
440
441
443 // //
445
446 //---------------------------------------------------------
447 CSG_Tool_Library * CSG_Tool_Library_Manager::_Add_Tool_Chain(const CSG_String &File)
448 {
449 if( !SG_File_Cmp_Extension(File, "xml") )
450 {
451 return( NULL );
452 }
453
454 //-----------------------------------------------------
455 CSG_Tool_Chains *pLibrary = NULL;
456 CSG_Tool_Chain *pTool = NULL;
457
458 //-----------------------------------------------------
459 { // is tool chain already loaded ?
460 wxFileName fn(File.c_str());
461
462 for(int iLibrary=0; !pTool && iLibrary<Get_Count(); iLibrary++)
463 {
464 if( Get_Library(iLibrary)->Get_Type() == TOOL_CHAINS )
465 {
466 for(int iTool=0; !pTool && iTool<Get_Library(iLibrary)->Get_Count(); iTool++)
467 {
468 if( fn == ((CSG_Tool_Chain *)Get_Library(iLibrary)->Get_Tool(iTool))->Get_File_Name().c_str() )
469 {
470 pLibrary = (CSG_Tool_Chains *)Get_Library(iLibrary);
471 pTool = (CSG_Tool_Chain *)Get_Library(iLibrary)->Get_Tool(iTool);
472 }
473 }
474 }
475 }
476
477 if( pTool ) // ...then try to reload !
478 {
479 SG_UI_ProgressAndMsg_Lock(true);
480 CSG_Tool_Chain Tool(File); // don't reset loaded tool in case reloading fails!!!
481 SG_UI_ProgressAndMsg_Lock(false);
482
483 if( Tool.is_Okay() )
484 {
485 pTool->Create(File);
486 }
487
488 return( pLibrary );
489 }
490 }
491
492 //-----------------------------------------------------
493 pTool = new CSG_Tool_Chain(File);
494
495 if( !pTool || !pTool->is_Okay() )
496 {
497 if( pTool )
498 {
499 delete(pTool);
500 }
501
502 return( NULL );
503 }
504
505 //-----------------------------------------------------
506 CSG_String Library = pTool->Get_Library();
507
508 for(int iLibrary=0; !pLibrary && iLibrary<Get_Count(); iLibrary++)
509 {
510 if( Get_Library(iLibrary)->Get_Type() == TOOL_CHAINS
511 && Get_Library(iLibrary)->Get_Library_Name().Cmp(Library) == 0 )
512 {
513 pLibrary = (CSG_Tool_Chains *)Get_Library(iLibrary);
514 }
515 }
516
517 if( !pLibrary && (pLibrary = new CSG_Tool_Chains(pTool->Get_Library(), SG_File_Get_Path(File))) != NULL )
518 {
519 m_pLibraries = (CSG_Tool_Library **)SG_Realloc(m_pLibraries, (m_nLibraries + 1) * sizeof(CSG_Tool_Library *));
520 m_pLibraries[m_nLibraries++] = pLibrary;
521 }
522
523 if( !pLibrary ) // this should never happen, but who knows...
524 {
525 SG_UI_Msg_Add_Error(CSG_String::Format("%s %s: %s", _TL("ERROR"), _TL("tool chain library"), File.c_str()));
526
527 delete(pTool);
528
529 return( NULL );
530 }
531
532 pLibrary->Add_Tool(pTool);
533
534 //-----------------------------------------------------
535 return( pLibrary );
536 }
537
538
540 // //
542
543 //---------------------------------------------------------
544 bool CSG_Tool_Library_Manager::Destroy(void)
545 {
546 if( m_pLibraries )
547 {
548 for(int i=0; i<Get_Count(); i++)
549 {
550 // #ifndef _SAGA_MSW
551 if( !SG_UI_Get_Window_Main() && m_pLibraries[i]->m_pLibrary )
552 {
553 m_pLibraries[i]->m_pLibrary->Detach();
554 }
555 // #endif
556
557 delete(m_pLibraries[i]);
558 }
559
560 SG_Free(m_pLibraries);
561
562 m_pLibraries = NULL;
563 m_nLibraries = 0;
564 }
565
566 return( true );
567 }
568
569
571 // //
573
574 //---------------------------------------------------------
575 bool CSG_Tool_Library_Manager::Del_Library(CSG_Tool_Library *pLibrary)
576 {
577 for(int i=0; i<Get_Count(); i++)
578 {
579 if( pLibrary == Get_Library(i) )
580 {
581 return( Del_Library(i) );
582 }
583 }
584
585 return( false );
586 }
587
588 //---------------------------------------------------------
589 bool CSG_Tool_Library_Manager::Del_Library(int i)
590 {
591 if( i >= 0 && i < Get_Count() )
592 {
593 delete(m_pLibraries[i]);
594
595 for(m_nLibraries--; i<m_nLibraries; i++)
596 {
597 m_pLibraries[i] = m_pLibraries[i + 1];
598 }
599
600 m_pLibraries = (CSG_Tool_Library **)SG_Realloc(m_pLibraries, m_nLibraries * sizeof(CSG_Tool_Library *));
601
602 return( true );
603 }
604
605 return( false );
606 }
607
608
610 // //
612
613 //---------------------------------------------------------
614 CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library(const CSG_String &Name, bool bLibrary) const
615 {
616 for(int i=0; i<Get_Count(); i++)
617 {
618 CSG_Tool_Library *pLibrary = Get_Library(i);
619
620 if( !Name.Cmp(bLibrary ? pLibrary->Get_Library_Name() : pLibrary->Get_Name()) )
621 {
622 return( pLibrary );
623 }
624 }
625
626 return( NULL );
627 }
628
629 CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library(const char *Name, bool bLibrary) const
630 {
631 return( Get_Library(CSG_String(Name), bLibrary) );
632 }
633
634 CSG_Tool_Library * CSG_Tool_Library_Manager::Get_Library(const wchar_t *Name, bool bLibrary) const
635 {
636 return( Get_Library(CSG_String(Name), bLibrary) );
637 }
638
639 //---------------------------------------------------------
640 bool CSG_Tool_Library_Manager::is_Loaded(CSG_Tool_Library *pLibrary) const
641 {
642 for(int i=0; i<Get_Count(); i++)
643 {
644 if( pLibrary == Get_Library(i) )
645 {
646 return( true );
647 }
648 }
649
650 return( false );
651 }
652
653
655 // //
657
658 //---------------------------------------------------------
659 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const char *Library, int ID) const { return( Get_Tool(CSG_String(Library), ID) ); }
660 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const wchar_t *Library, int ID) const { return( Get_Tool(CSG_String(Library), ID) ); }
661 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const CSG_String &Library, int ID) const
662 {
663 return( Get_Tool(Library, CSG_String::Format("%d", ID)) );
664 }
665
666 //---------------------------------------------------------
667 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const char *Library, const char *Name) const { return( Get_Tool(CSG_String(Library), CSG_String(Name)) ); }
668 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const wchar_t *Library, const wchar_t *Name) const { return( Get_Tool(CSG_String(Library), CSG_String(Name)) ); }
669 CSG_Tool * CSG_Tool_Library_Manager::Get_Tool(const CSG_String &Library, const CSG_String &Name) const
670 {
671 for(int i=0; i<Get_Count(); i++)
672 {
673 CSG_Tool_Library *pLibrary = Get_Library(i);
674
675 if( pLibrary->Get_Library_Name().Cmp(Library) == 0 )
676 {
677 CSG_Tool *pTool = pLibrary->Get_Tool(Name);
678
679 if( pTool )
680 {
681 return( pTool );
682 }
683 }
684 }
685
686 return( NULL );
687 }
688
689
691 // //
693
694 //---------------------------------------------------------
695 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const char *Library, int Index, bool bWithGUI) const { return( Create_Tool(CSG_String(Library), Index, bWithGUI) ); }
696 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const wchar_t *Library, int Index, bool bWithGUI) const { return( Create_Tool(CSG_String(Library), Index, bWithGUI) ); }
697 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const CSG_String &Library, int Index, bool bWithGUI) const
698 {
699 return( Create_Tool(Library, CSG_String::Format("%d", Index), bWithGUI) );
700 }
701
702 //---------------------------------------------------------
703 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const char *Library, const char *Name, bool bWithGUI) const { return( Create_Tool(CSG_String(Library), CSG_String(Name), bWithGUI) ); }
704 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const wchar_t *Library, const wchar_t *Name, bool bWithGUI) const { return( Create_Tool(CSG_String(Library), CSG_String(Name), bWithGUI) ); }
705 CSG_Tool * CSG_Tool_Library_Manager::Create_Tool(const CSG_String &Library, const CSG_String &Name, bool bWithGUI) const
706 {
707 for(int i=0; i<Get_Count(); i++)
708 {
709 CSG_Tool_Library *pLibrary = Get_Library(i);
710
711 if( pLibrary->Get_Library_Name().Cmp(Library) == 0 )
712 {
713 CSG_Tool *pTool = pLibrary->Create_Tool(Name, bWithGUI);
714
715 if( pTool )
716 {
717 return( pTool );
718 }
719 }
720 }
721
722 return( NULL );
723 }
724
725 //---------------------------------------------------------
726 bool CSG_Tool_Library_Manager::Delete_Tool(CSG_Tool *pTool) const
727 {
728 for(int i=0; i<Get_Count(); i++)
729 {
730 if( Get_Library(i)->Delete_Tool(pTool) )
731 {
732 return( true );
733 }
734 }
735
736 return( false );
737 }
738
739
741 // //
743
744 //---------------------------------------------------------
745 bool CSG_Tool_Library_Manager::Create_Python_ToolBox(const CSG_String &Destination, bool bClean, bool bName, bool bSingleFile) const
746 {
747 const char *Header =
748 "#! /usr/bin/env python\n\n"
749 "'''\n"
750 "Python Interface to SAGA Tools Library\n"
751 "----------\n"
752 "- Category : %s\n"
753 "- Name : %s\n"
754 "- ID : %s\n\n"
755 "Description\n"
756 "----------\n%s\n"
757 "'''\n\n"
758 "from PySAGA.helper import Tool_Wrapper\n\n";
759
760 CSG_File Stream;
761
762 if( bSingleFile )
763 {
764 if( SG_File_Exists(Destination) )
765 {
766 SG_File_Delete(Destination);
767 }
768
769 if( !Stream.Open(Destination, SG_FILE_W, false, SG_FILE_ENCODING_UTF8) )
770 {
771 SG_UI_Msg_Add_Error(CSG_String::Format("%s: %s", _TL("failed to create destination file"), Destination.c_str()));
772
773 return( false );
774 }
775
776 Stream.Write("#! /usr/bin/env python\n\n'''\n");
777 Stream.Write("Python Interface to SAGA Tools\n");
778 Stream.Write("----------\n'''\n\n");
779 Stream.Write("from PySAGA.helper import Tool_Wrapper\n\n");
780 }
781 else
782 {
783 if( !SG_Dir_Exists(Destination) && !SG_Dir_Create(Destination, true) )
784 {
785 SG_UI_Msg_Add_Error(CSG_String::Format("%s: %s", _TL("failed to create destination folder"), Destination.c_str()));
786
787 return( false );
788 }
789
790 if( bClean )
791 {
792 CSG_Strings Files;
793
794 SG_Dir_List_Files(Files, Destination);
795
796 for(int i=0; i<Files.Get_Count(); i++)
797 {
798 SG_File_Delete(Files[i]);
799 }
800 }
801 }
802
803 //-----------------------------------------------------
804 for(int iLibrary=0; iLibrary<Get_Count() && SG_UI_Process_Set_Progress(iLibrary, Get_Count()); iLibrary++)
805 {
806 CSG_Tool_Library *pLibrary = Get_Library(iLibrary);
807
808 if( !pLibrary->Get_Category ().Cmp("SAGA Development" ) // generally exclude certain categories/libraries
809 || !pLibrary->Get_Category ().Cmp("Garden" )
810 || !pLibrary->Get_Library_Name().Cmp("vis_3d_viewer" )
811 || !pLibrary->Get_Library_Name().Cmp("grid_calculus_bsl")
812 || pLibrary->Get_Type() == TOOL_CHAINS ) // exclude tool chains in 1st run
813 {
814 continue;
815 }
816
817 SG_UI_Process_Set_Text(CSG_String::Format("%s: %s", SG_T("Library"), pLibrary->Get_Library_Name().c_str()));
818
819 if( !bSingleFile )
820 {
821 if( !Stream.Open(SG_File_Make_Path(Destination, pLibrary->Get_Library_Name(), "py"), SG_FILE_W, false, SG_FILE_ENCODING_UTF8) )
822 {
823 continue;
824 }
825
826 Stream.Printf(Header, pLibrary->Get_Category().c_str(), pLibrary->Get_Name().c_str(), pLibrary->Get_Library_Name().c_str(), pLibrary->Get_Description().c_str());
827 }
828
829 for(int iTool=0; iTool<pLibrary->Get_Count(); iTool++)
830 {
831 CSG_Tool *pTool = pLibrary->Get_Tool(iTool);
832
833 if( pTool && pTool != TLB_INTERFACE_SKIP_TOOL && !pTool->needs_GUI() && !pTool->is_Interactive() && pTool->Get_Parameters_Count() == 0 )
834 {
835 Stream.Write(pTool->Get_Script(bName ? TOOL_SCRIPT_PYTHON_WRAP_NAME : TOOL_SCRIPT_PYTHON_WRAP_ID, false));
836 }
837 }
838 }
839
840 //-----------------------------------------------------
841 for(int iLibrary=0; iLibrary<Get_Count() && SG_UI_Process_Set_Progress(iLibrary, Get_Count()); iLibrary++)
842 {
843 CSG_Tool_Library *pLibrary = Get_Library(iLibrary);
844
845 if( !pLibrary->Get_Category().Cmp("SAGA Development" ) // generally exclude certain categories
846 || !pLibrary->Get_Category().Cmp("Garden" )
847 || pLibrary->Get_Type() != TOOL_CHAINS ) // process tool chains in 2nd run
848 {
849 continue;
850 }
851
852 SG_UI_Process_Set_Text(CSG_String::Format("%s: %s", SG_T("Library"), pLibrary->Get_Library_Name().c_str()));
853
854 if( !bSingleFile )
855 {
856 CSG_String File(SG_File_Make_Path(Destination, pLibrary->Get_Library_Name(), "py"));
857
858 if( SG_File_Exists(File) )
859 {
860 if( !Stream.Open(File, SG_FILE_RW, false, SG_FILE_ENCODING_UTF8) )
861 {
862 continue;
863 }
864
865 Stream.Seek_End();
866 }
867 else
868 {
869 if( !Stream.Open(File, SG_FILE_W, false, SG_FILE_ENCODING_UTF8) )
870 {
871 continue;
872 }
873
874 Stream.Printf(Header, pLibrary->Get_Category().c_str(), pLibrary->Get_Name().c_str(), pLibrary->Get_Library_Name().c_str(), pLibrary->Get_Description().c_str());
875 }
876 }
877
878 for(int iTool=0; iTool<pLibrary->Get_Count(); iTool++)
879 {
880 CSG_Tool *pTool = pLibrary->Get_Tool(iTool);
881
882 if( pTool && pTool != TLB_INTERFACE_SKIP_TOOL && !pTool->needs_GUI() && !pTool->is_Interactive() && pTool->Get_Parameters_Count() == 0 )
883 {
884 Stream.Write(pTool->Get_Script(bName ? TOOL_SCRIPT_PYTHON_WRAP_NAME : TOOL_SCRIPT_PYTHON_WRAP_ID, false));
885 }
886 }
887 }
888
889 return( true );
890 }
891
892
894 // //
895 // //
896 // //
898
899 //---------------------------------------------------------
CSG_Tool_Library_Interface::Get_Tool
CSG_Tool * Get_Tool(int i)
Definition: tool_library_interface.cpp:173
CSG_Tool_Chains
Definition: tool_chain.h:172
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
CSG_Tool_Chains::Add_Tool
bool Add_Tool(CSG_Tool_Chain *pTool)
CSG_Tool_Library_Manager::~CSG_Tool_Library_Manager
virtual ~CSG_Tool_Library_Manager(void)
Definition: tool_library.cpp:309
SG_File_Get_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
SG_T
#define SG_T(s)
Definition: api_core.h:531
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Tool_Library_Manager::Destroy
bool Destroy(void)
Definition: tool_library.cpp:544
CSG_Tool_Library_Manager::Get_Tool
CSG_Tool * Get_Tool(const CSG_String &Library, int Index) const
Definition: tool_library.cpp:661
TLB_INFO_Library
@ TLB_INFO_Library
Definition: tool.h:623
CSG_Tool_Library_Manager::Add_Library
CSG_Tool_Library * Add_Library(const CSG_String &File)
Definition: tool_library.cpp:338
SG_Dir_Exists
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
Definition: api_file.cpp:727
CSG_Tool_Library
Definition: tool_library.h:107
CSG_Tool_Library::CSG_Tool_Library
CSG_Tool_Library(void)
Definition: tool_library.cpp:68
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1496
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:722
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:928
CSG_Tool::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:229
tool_chain.h
CSG_Tool_Library::Get_Name
CSG_String Get_Name(void) const
Definition: tool_library.h:120
CSG_Tool
Definition: tool.h:149
CSG_Tool_Library::Del_References
void Del_References(void)
Definition: tool_library.cpp:270
CSG_Tool_Library_Manager::Del_Library
bool Del_Library(int i)
Definition: tool_library.cpp:589
CSG_Tool::Get_Script
CSG_String Get_Script(TSG_Tool_Script_Type Type, bool bHeader, bool bAllParameters=false)
Definition: tool.cpp:1326
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
SG_File_Delete
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
Definition: api_file.cpp:840
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
CSG_Tool_Library::~CSG_Tool_Library
virtual ~CSG_Tool_Library(void)
Definition: tool_library.cpp:100
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
CSG_File
Definition: api_core.h:1116
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SYMBOL_TLB_Initialize
#define SYMBOL_TLB_Initialize
Definition: tool.h:664
TSG_PFNC_TLB_Get_Interface
CSG_Tool_Library_Interface *(* TSG_PFNC_TLB_Get_Interface)(void)
Definition: tool.h:671
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1497
SG_FILE_RW
@ SG_FILE_RW
Definition: api_core.h:1103
CSG_Random::Initialize
static void Initialize(void)
Definition: mat_tools.cpp:260
CSG_Tool_Library::Delete_Tools
virtual bool Delete_Tools(void)
Definition: tool_library.cpp:215
SG_File_Exists
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
Definition: api_file.cpp:834
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:728
CSG_Tool_Library_Interface::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool)
Definition: tool_library_interface.cpp:210
CSG_Tool_Library_Manager::is_Loaded
bool is_Loaded(CSG_Tool_Library *pLibrary) const
Definition: tool_library.cpp:640
CSG_Tool_Library::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool_library.h:116
CSG_Tool_Library_Manager::Get_Count
int Get_Count(void) const
Definition: tool_library.h:193
TLB_INTERFACE_SKIP_TOOL
#define TLB_INTERFACE_SKIP_TOOL
Definition: tool.h:674
SG_Dir_Create
SAGA_API_DLL_EXPORT bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath=false)
Definition: api_file.cpp:733
TLB_INFO_File
@ TLB_INFO_File
Definition: tool.h:622
CSG_Tool_Library::Get_Count
virtual int Get_Count(void) const
Definition: tool_library.h:130
SYMBOL_TLB_Get_Interface
#define SYMBOL_TLB_Get_Interface
Definition: tool.h:670
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
CSG_Tool_Library::Delete_Tool
virtual bool Delete_Tool(CSG_Tool *pTool)
Definition: tool_library.cpp:209
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:128
CSG_Tool_Library::Get_Description
CSG_String Get_Description(void) const
Definition: tool_library.h:121
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Tool_Chain::Create
bool Create(const CSG_Tool_Chain &Tool, bool bWithGUI)
Definition: tool_chain.cpp:133
CSG_Tool_Library::Get_Library_Name
const CSG_String & Get_Library_Name(void) const
Definition: tool_library.h:117
TSG_PFNC_TLB_Finalize
bool(* TSG_PFNC_TLB_Finalize)(void)
Definition: tool.h:668
g_Tool_Library_Manager
CSG_Tool_Library_Manager g_Tool_Library_Manager
Definition: tool_library.cpp:283
SG_UI_Process_Set_Text
void SG_UI_Process_Set_Text(const CSG_String &Text)
Definition: api_callback.cpp:317
CSG_Tool_Library::m_Library_Name
CSG_String m_Library_Name
Definition: tool_library.h:161
CSG_Tool_Library_Interface::Get_Count
int Get_Count(void)
Definition: tool_library_interface.cpp:167
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:163
CSG_Tool_Library::Get_Info
virtual CSG_String Get_Info(int Type) const
Definition: tool_library.cpp:133
CSG_Tool_Library::Add_Reference
void Add_Reference(const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link=NULL, const SG_Char *Link_Text=NULL)
Definition: tool_library.cpp:242
CSG_Tool_Library::Get_Menu
CSG_String Get_Menu(void) const
Definition: tool_library.h:124
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
CSG_Strings
Definition: api_core.h:693
CSG_Tool_Library_Manager::CSG_Tool_Library_Manager
CSG_Tool_Library_Manager(void)
Definition: tool_library.cpp:297
TOOL_CHAINS
@ TOOL_CHAINS
Definition: tool_library.h:94
CSG_Tool_Library_Interface::Delete_Tools
bool Delete_Tools(void)
Definition: tool_library_interface.cpp:226
SG_Dir_List_Files
SAGA_API_DLL_EXPORT bool SG_Dir_List_Files(CSG_Strings &List, const CSG_String &Directory)
Definition: api_file.cpp:795
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Tool_Chain
Definition: tool_chain.h:78
CSG_Tool_Library::Get_Type
virtual TSG_Tool_Library_Type Get_Type(void) const
Definition: tool_library.h:112
CSG_Tool_Library_Manager::Create_Python_ToolBox
bool Create_Python_ToolBox(const CSG_String &Destination, bool bClean=true, bool bName=true, bool bSingleFile=false) const
Definition: tool_library.cpp:745
TOOL_SCRIPT_PYTHON_WRAP_NAME
@ TOOL_SCRIPT_PYTHON_WRAP_NAME
Definition: tool.h:125
SG_File_Get_Path_Absolute
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
Definition: api_file.cpp:883
SG_Char
#define SG_Char
Definition: api_core.h:530
TSG_PFNC_TLB_Initialize
bool(* TSG_PFNC_TLB_Initialize)(const SG_Char *)
Definition: tool.h:665
CSG_String
Definition: api_core.h:557
SYMBOL_TLB_Finalize
#define SYMBOL_TLB_Finalize
Definition: tool.h:667
CSG_Tool_Library_Interface::Get_Info
const CSG_String & Get_Info(int ID)
Definition: tool_library_interface.cpp:156
CSG_Tool_Library::Get_Tool
virtual CSG_Tool * Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
Definition: tool_library.cpp:149
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1121
CSG_Tool_Chain::is_Okay
bool is_Okay(void) const
Definition: tool_chain.h:96
CSG_Tool_Library::is_Valid
bool is_Valid(void) const
Definition: tool_library.h:114
CSG_File::Printf
int Printf(const char *Format,...)
Definition: api_file.cpp:271
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:249
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
CSG_Tool_Library::Create_Tool
virtual CSG_Tool * Create_Tool(int Index, bool bWithGUI=false)
Definition: tool_library.cpp:190
CSG_Tool::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:233
TOOL_SCRIPT_PYTHON_WRAP_ID
@ TOOL_SCRIPT_PYTHON_WRAP_ID
Definition: tool.h:127
CSG_Tool_Library_Manager::Add_Directory
int Add_Directory(const CSG_String &Directory, bool bOnlySubDirectories=false)
Definition: tool_library.cpp:394
CSG_Tool_Library_Manager::Get_Tool_Count
int Get_Tool_Count(void) const
Definition: tool_library.cpp:320
SG_UI_Get_Window_Main
void * SG_UI_Get_Window_Main(void)
Definition: api_callback.cpp:771
CSG_Tool_Library_Manager::Get_Library
CSG_Tool_Library * Get_Library(int i) const
Definition: tool_library.h:207
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:577
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Tool_Library_Interface::Create_Tool
CSG_Tool * Create_Tool(int i, bool bWithGUI=false)
Definition: tool_library_interface.cpp:189
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:161
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:546
CSG_Tool_Library::Get_Category
CSG_String Get_Category(void) const
Definition: tool_library.h:125
CSG_Tool_Library::m_File_Name
CSG_String m_File_Name
Definition: tool_library.h:161
CSG_Tool::Get_Parameters_Count
int Get_Parameters_Count(void)
Definition: tool.h:178
CSG_File::Seek_End
bool Seek_End(void) const
Definition: api_file.cpp:252
CSG_Tool_Library_Manager
Definition: tool_library.h:186
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:490
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library.h File Reference

  • saga_core
  • saga_api
Classes | Macros | Enumerations | Functions
tool_library.h File Reference
#include "tool.h"

Go to the source code of this file.

Classes

class | CSG_Tool_Library
class | CSG_Tool_Library_Manager

Macros

#define | SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
#define | SG_RUN_TOOL_ExitOnError(LIBRARY, TOOL, CONDITION)
#define | SG_RUN_TOOL_KEEP_PARMS(bRetVal, LIBRARY, TOOL, PARMS, CONDITION)
#define | SG_RUN_TOOL_KEEP_PARMS_ExitOnError(LIBRARY, TOOL, PARMS, CONDITION)
#define | SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE) pTool->Get_Parameters()->Set_Parameter(IDENTIFIER, VALUE)
#define | SG_TOOL_PARAMLIST_ADD(IDENTIFIER, VALUE)
#define | SG_TOOL_SET_DATAOBJECT_LIST(IDENTIFIER, VALUE)

Enumerations

enum TSG_Tool_Library_Type { TOOL_LIBRARY = 0, TOOL_CHAINS }

Functions

SAGA_API_DLL_EXPORT CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager (void)

Detailed Description

The definitions needed for any SAGA tool library and the tool library management, including the SAGA API's default tool library manager.

See also
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager
CSG_Tool_Library

Definition in file tool_library.h.

Macro Definition Documentation

◆ SG_RUN_TOOL

#define SG_RUN_TOOL | ( | bRetVal,
 |  | LIBRARY,
 |  | TOOL,
 |  | CONDITION
 | ) |

Definition at line 257 of file tool_library.h.

◆ SG_RUN_TOOL_ExitOnError

#define SG_RUN_TOOL_ExitOnError | ( | LIBRARY,
 |  | TOOL,
 |  | CONDITION
 | ) |
Value:
{\
\
bool bResult;\
\
SG_RUN_TOOL(bResult, LIBRARY, TOOL, CONDITION)\
\
if( !bResult )\
{\
return( false );\
}\
}

Definition at line 290 of file tool_library.h.

◆ SG_RUN_TOOL_KEEP_PARMS

#define SG_RUN_TOOL_KEEP_PARMS | ( | bRetVal,
 |  | LIBRARY,
 |  | TOOL,
 |  | PARMS,
 |  | CONDITION
 | ) |

Definition at line 303 of file tool_library.h.

◆ SG_RUN_TOOL_KEEP_PARMS_ExitOnError

#define SG_RUN_TOOL_KEEP_PARMS_ExitOnError | ( | LIBRARY,
 |  | TOOL,
 |  | PARMS,
 |  | CONDITION
 | ) |
Value:
{\
\
bool bResult;\
\
SG_RUN_TOOL_KEEP_PARMS(bResult, LIBRARY, TOOL, PARMS, CONDITION)\
\
if( !bResult )\
{\
return( false );\
}\
}

Definition at line 338 of file tool_library.h.

◆ SG_TOOL_PARAMETER_SET

#define SG_TOOL_PARAMETER_SET | ( | IDENTIFIER,
 |  | VALUE
 | ) | pTool->Get_Parameters()->Set_Parameter(IDENTIFIER, VALUE)

Definition at line 351 of file tool_library.h.

◆ SG_TOOL_PARAMLIST_ADD

#define SG_TOOL_PARAMLIST_ADD | ( | IDENTIFIER,
 |  | VALUE
 | ) |
Value:
(\
pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)\
&& pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
&& pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Add_Item(VALUE)\
)

Definition at line 353 of file tool_library.h.

◆ SG_TOOL_SET_DATAOBJECT_LIST

#define SG_TOOL_SET_DATAOBJECT_LIST | ( | IDENTIFIER,
 |  | VALUE
 | ) |
Value:
(\
pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)\
&& pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
&& pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Assign(VALUE)\
)

Definition at line 359 of file tool_library.h.

Enumeration Type Documentation

◆ TSG_Tool_Library_Type

enum TSG_Tool_Library_Type
Enumerator
TOOL_LIBRARY
TOOL_CHAINS

Definition at line 91 of file tool_library.h.

Function Documentation

◆ SG_Get_Tool_Library_Manager()

SAGA_API_DLL_EXPORT CSG_Tool_Library_Manager& SG_Get_Tool_Library_Manager ( void )

Definition at line 286 of file tool_library.cpp.

References g_Tool_Library_Manager.

Referenced by CSG_Shapes::Create(), CSG_Table::Create(), SG_Get_Projected(), and SG_Initialize_Environment().

SG_RUN_TOOL
#define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION)
Definition: tool_library.h:257
SG_RUN_TOOL_KEEP_PARMS
#define SG_RUN_TOOL_KEEP_PARMS(bRetVal, LIBRARY, TOOL, PARMS, CONDITION)
Definition: tool_library.h:303
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library.h Source File

  • saga_core
  • saga_api
tool_library.h
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_library.h //
15 // //
16 // Copyright (C) 2006 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__tool_library_H
54 #define HEADER_INCLUDED__SAGA_API__tool_library_H
55
56
58 // //
59 // //
60 // //
62
63 //---------------------------------------------------------
74 // //
76 // //
77 // //
79
80 //---------------------------------------------------------
81 #include "tool.h"
82
83
85 // //
86 // //
87 // //
89
90 //---------------------------------------------------------
91 typedef enum
92 {
93 TOOL_LIBRARY = 0,
94 TOOL_CHAINS
95 }
96 TSG_Tool_Library_Type;
97
98
100 // //
101 // //
102 // //
104
105 //---------------------------------------------------------
106 class SAGA_API_DLL_EXPORT CSG_Tool_Library
107 {
108 friend class CSG_Tool_Library_Manager;
109
110 public:
111
112 virtual TSG_Tool_Library_Type Get_Type (void) const { return( TOOL_LIBRARY ); }
113
114 bool is_Valid (void) const { return( Get_Count() > 0 ); }
115
116 const CSG_String & Get_File_Name (void) const { return( m_File_Name ); }
117 const CSG_String & Get_Library_Name (void) const { return( m_Library_Name ); }
118
119 virtual CSG_String Get_Info (int Type) const;
120 CSG_String Get_Name (void) const { return( Get_Info(TLB_INFO_Name ) ); }
121 CSG_String Get_Description (void) const { return( Get_Info(TLB_INFO_Description) ); }
122 CSG_String Get_Author (void) const { return( Get_Info(TLB_INFO_Author ) ); }
123 CSG_String Get_Version (void) const { return( Get_Info(TLB_INFO_Version ) ); }
124 CSG_String Get_Menu (void) const { return( Get_Info(TLB_INFO_Menu_Path ) ); }
125 CSG_String Get_Category (void) const { return( Get_Info(TLB_INFO_Category ) ); }
126
127 CSG_String Get_Summary (int Format = SG_SUMMARY_FMT_HTML, bool bInteractive = true) const;
128 bool Get_Summary (const CSG_String &Path) const;
129
130 virtual int Get_Count (void) const { return( m_pInterface ? m_pInterface->Get_Count() : 0 ); }
131
132 virtual CSG_Tool * Get_Tool (int Index, TSG_Tool_Type Type = TOOL_TYPE_Base) const;
133 virtual CSG_Tool * Get_Tool (const CSG_String &Name, TSG_Tool_Type Type = TOOL_TYPE_Base) const;
134 virtual CSG_Tool * Get_Tool (const char *Name, TSG_Tool_Type Type = TOOL_TYPE_Base) const;
135 virtual CSG_Tool * Get_Tool (const wchar_t *Name, TSG_Tool_Type Type = TOOL_TYPE_Base) const;
136
137 virtual CSG_Tool * Create_Tool (int Index, bool bWithGUI = false);
138 virtual CSG_Tool * Create_Tool (const CSG_String &Name, bool bWithGUI = false);
139 virtual CSG_Tool * Create_Tool (const char *Name, bool bWithGUI = false);
140 virtual CSG_Tool * Create_Tool (const wchar_t *Name, bool bWithGUI = false);
141
142 virtual bool Delete_Tool (CSG_Tool *pTool);
143 virtual bool Delete_Tools (void);
144
145 virtual CSG_String Get_File_Name (int i) const { return( "" ); }
146 virtual CSG_String Get_Menu (int i) const;
147
148 void Add_Reference (const CSG_String &Authors, const CSG_String &Year, const CSG_String &Title, const CSG_String &Where, const SG_Char *Link = NULL, const SG_Char *Link_Text = NULL);
149 void Add_Reference (const CSG_String &Link, const SG_Char *Link_Text = NULL);
150 void Del_References (void);
151 const CSG_Strings & Get_References (void) const { return( m_References ); }
152
153
154 protected:
155
156 CSG_Tool_Library(void);
157 CSG_Tool_Library(const CSG_String &File);
158 virtual ~CSG_Tool_Library(void);
159
160
161 CSG_String m_File_Name, m_Library_Name;
162
163
164 private:
165
166 bool _Destroy (void);
167
168
169 CSG_Strings m_References;
170
171 CSG_Tool_Library_Interface *m_pInterface;
172
173 class wxDynamicLibrary *m_pLibrary;
174
175 };
176
177
179 // //
180 // //
181 // //
183
184 //---------------------------------------------------------
185 class SAGA_API_DLL_EXPORT CSG_Tool_Library_Manager
186 {
187 public:
188 CSG_Tool_Library_Manager(void);
189 virtual ~CSG_Tool_Library_Manager(void);
190
191 bool Destroy (void);
192
193 int Get_Count (void) const { return( m_nLibraries ); }
194 int Get_Tool_Count (void) const;
195
196 CSG_Tool_Library * Add_Library (const CSG_String &File);
197 CSG_Tool_Library * Add_Library (const char *File);
198 CSG_Tool_Library * Add_Library (const wchar_t *File);
199
200 int Add_Directory (const CSG_String &Directory, bool bOnlySubDirectories = false);
201 int Add_Directory (const char *Directory, bool bOnlySubDirectories = false);
202 int Add_Directory (const wchar_t *Directory, bool bOnlySubDirectories = false);
203
204 bool Del_Library (int i);
205 bool Del_Library (CSG_Tool_Library *pLibrary);
206
207 CSG_Tool_Library * Get_Library (int i) const { return( i >= 0 && i < Get_Count() ? m_pLibraries[i] : NULL ); }
208 CSG_Tool_Library * Get_Library (const CSG_String &Name, bool bLibrary) const;
209 CSG_Tool_Library * Get_Library (const char *Name, bool bLibrary) const;
210 CSG_Tool_Library * Get_Library (const wchar_t *Name, bool bLibrary) const;
211
212 bool is_Loaded (CSG_Tool_Library *pLibrary) const;
213
214 CSG_Tool * Get_Tool (const CSG_String &Library, int Index) const;
215 CSG_Tool * Get_Tool (const char *Library, int Index) const;
216 CSG_Tool * Get_Tool (const wchar_t *Library, int Index) const;
217 CSG_Tool * Get_Tool (const CSG_String &Library, const CSG_String &Name) const;
218 CSG_Tool * Get_Tool (const char *Library, const char *Name) const;
219 CSG_Tool * Get_Tool (const wchar_t *Library, const wchar_t *Name) const;
220
221 CSG_Tool * Create_Tool (const CSG_String &Library, int Index, bool bWithGUI = false) const;
222 CSG_Tool * Create_Tool (const char *Library, int Index, bool bWithGUI = false) const;
223 CSG_Tool * Create_Tool (const wchar_t *Library, int Index, bool bWithGUI = false) const;
224 CSG_Tool * Create_Tool (const CSG_String &Library, const CSG_String &Name, bool bWithGUI = false) const;
225 CSG_Tool * Create_Tool (const char *Library, const char *Name, bool bWithGUI = false) const;
226 CSG_Tool * Create_Tool (const wchar_t *Library, const wchar_t *Name, bool bWithGUI = false) const;
227 bool Delete_Tool (CSG_Tool *pTool) const;
228
229 CSG_String Get_Summary (int Format = SG_SUMMARY_FMT_HTML) const;
230 bool Get_Summary (const CSG_String &Path) const;
231
232 bool Create_Python_ToolBox (const CSG_String &Destination, bool bClean = true, bool bName = true, bool bSingleFile = false) const;
233
234
235 private:
236
237 int m_nLibraries;
238
239 CSG_Tool_Library **m_pLibraries;
240
241
242 CSG_Tool_Library * _Add_Tool_Chain (const CSG_String &File);
243
244 };
245
246 //---------------------------------------------------------
247 SAGA_API_DLL_EXPORT CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager (void);
248
249
251 // //
252 // //
253 // //
255
256 //---------------------------------------------------------
257 #define SG_RUN_TOOL(bRetVal, LIBRARY, TOOL, CONDITION) {\
258 \
259 bRetVal = false;\
260 \
261 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool(SG_T(LIBRARY), TOOL);\
262 \
263 if( pTool == NULL )\
264 {\
265 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("could not find tool"), SG_T(LIBRARY)));\
266 }\
267 else\
268 {\
269 SG_UI_Process_Set_Text(pTool->Get_Name());\
270 \
271 pTool->Settings_Push();\
272 \
273 if( !pTool->On_Before_Execution() || !(CONDITION) )\
274 {\
275 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not initialize tool"), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
276 }\
277 else if( !pTool->Execute(false) )\
278 {\
279 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not execute tool" ), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
280 }\
281 else\
282 {\
283 bRetVal = true;\
284 }\
285 \
286 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);\
287 }\
288 }
289
290 #define SG_RUN_TOOL_ExitOnError(LIBRARY, TOOL, CONDITION) {\
291 \
292 bool bResult;\
293 \
294 SG_RUN_TOOL(bResult, LIBRARY, TOOL, CONDITION)\
295 \
296 if( !bResult )\
297 {\
298 return( false );\
299 }\
300 }
301
302 //---------------------------------------------------------
303 #define SG_RUN_TOOL_KEEP_PARMS(bRetVal, LIBRARY, TOOL, PARMS, CONDITION) {\
304 \
305 bRetVal = false;\
306 \
307 CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool(SG_T(LIBRARY), TOOL);\
308 \
309 if( pTool == NULL )\
310 {\
311 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s]", _TL("could not find tool"), SG_T(LIBRARY)));\
312 }\
313 else\
314 {\
315 SG_UI_Process_Set_Text(pTool->Get_Name());\
316 \
317 pTool->Settings_Push();\
318 \
319 if( !pTool->On_Before_Execution() || !(CONDITION) )\
320 {\
321 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not initialize tool"), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
322 }\
323 else if( !pTool->Execute(false) )\
324 {\
325 SG_UI_Msg_Add_Error(CSG_String::Format("%s [%s].[%s]", _TL("could not execute tool" ), SG_T(LIBRARY), pTool->Get_Name().c_str()));\
326 }\
327 else\
328 {\
329 bRetVal = true;\
330 \
331 PARMS.Set_Manager(NULL); PARMS.Assign_Parameters(pTool->Get_Parameters());\
332 }\
333 \
334 SG_Get_Tool_Library_Manager().Delete_Tool(pTool);\
335 }\
336 }
337
338 #define SG_RUN_TOOL_KEEP_PARMS_ExitOnError(LIBRARY, TOOL, PARMS, CONDITION) {\
339 \
340 bool bResult;\
341 \
342 SG_RUN_TOOL_KEEP_PARMS(bResult, LIBRARY, TOOL, PARMS, CONDITION)\
343 \
344 if( !bResult )\
345 {\
346 return( false );\
347 }\
348 }
349
350 //---------------------------------------------------------
351 #define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE) pTool->Get_Parameters()->Set_Parameter(IDENTIFIER, VALUE)
352
353 #define SG_TOOL_PARAMLIST_ADD(IDENTIFIER, VALUE) (\
354 pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)\
355 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
356 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Add_Item(VALUE)\
357 )
358
359 #define SG_TOOL_SET_DATAOBJECT_LIST(IDENTIFIER, VALUE) (\
360 pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)\
361 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()\
362 && pTool->Get_Parameters()->Get_Parameter(IDENTIFIER)->asList()->Assign(VALUE)\
363 )
364
365
367 // //
368 // //
369 // //
371
372 //---------------------------------------------------------
373 #endif // #ifndef HEADER_INCLUDED__SAGA_API__tool_library_H
CSG_Tool_Library_Interface
Definition: tool.h:635
TSG_Tool_Library_Type
TSG_Tool_Library_Type
Definition: tool_library.h:92
CSG_Tool_Library::Get_File_Name
virtual CSG_String Get_File_Name(int i) const
Definition: tool_library.h:145
CSG_Tool_Library_Manager::Get_Tool
CSG_Tool * Get_Tool(const CSG_String &Library, int Index) const
Definition: tool_library.cpp:661
TOOL_LIBRARY
@ TOOL_LIBRARY
Definition: tool_library.h:93
CSG_Tool_Library
Definition: tool_library.h:107
TLB_INFO_Version
@ TLB_INFO_Version
Definition: tool.h:618
CSG_Tool_Library::Get_Name
CSG_String Get_Name(void) const
Definition: tool_library.h:120
TLB_INFO_Category
@ TLB_INFO_Category
Definition: tool.h:620
CSG_Tool
Definition: tool.h:149
SG_Get_Tool_Library_Manager
SAGA_API_DLL_EXPORT CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
SG_SUMMARY_FMT_HTML
@ SG_SUMMARY_FMT_HTML
Definition: tool.h:94
TSG_Tool_Type
TSG_Tool_Type
Definition: tool.h:101
TLB_INFO_Name
@ TLB_INFO_Name
Definition: tool.h:615
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:726
tool.h
CSG_Tool_Library::Get_Version
CSG_String Get_Version(void) const
Definition: tool_library.h:123
CSG_Tool_Library_Manager::Get_Summary
CSG_String Get_Summary(int Format=SG_SUMMARY_FMT_HTML) const
Definition: tool_summary.cpp:794
TLB_INFO_Description
@ TLB_INFO_Description
Definition: tool.h:616
CSG_Tool_Library::Get_Author
CSG_String Get_Author(void) const
Definition: tool_library.h:122
CSG_Tool_Library::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool_library.h:116
CSG_Tool_Library_Manager::Get_Count
int Get_Count(void) const
Definition: tool_library.h:193
CSG_Tool_Library::Get_Count
virtual int Get_Count(void) const
Definition: tool_library.h:130
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false) const
Definition: tool_library.cpp:697
CSG_Tool_Library::Get_Description
CSG_String Get_Description(void) const
Definition: tool_library.h:121
CSG_Tool_Library::Get_Library_Name
const CSG_String & Get_Library_Name(void) const
Definition: tool_library.h:117
CSG_Tool_Library::m_Library_Name
CSG_String m_Library_Name
Definition: tool_library.h:161
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Tool_Library::Get_Menu
CSG_String Get_Menu(void) const
Definition: tool_library.h:124
CSG_Strings
Definition: api_core.h:693
TOOL_CHAINS
@ TOOL_CHAINS
Definition: tool_library.h:94
TLB_INFO_Author
@ TLB_INFO_Author
Definition: tool.h:617
CSG_Tool_Library::Get_Type
virtual TSG_Tool_Library_Type Get_Type(void) const
Definition: tool_library.h:112
CSG_Tool_Library::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool_library.h:151
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_String
Definition: api_core.h:557
CSG_Tool_Library::is_Valid
bool is_Valid(void) const
Definition: tool_library.h:114
TOOL_TYPE_Base
@ TOOL_TYPE_Base
Definition: tool.h:102
CSG_Tool_Library_Manager::Get_Library
CSG_Tool_Library * Get_Library(int i) const
Definition: tool_library.h:207
CSG_Tool_Library::Get_Category
CSG_String Get_Category(void) const
Definition: tool_library.h:125
CSG_Tool_Library_Manager
Definition: tool_library.h:186
TLB_INFO_Menu_Path
@ TLB_INFO_Menu_Path
Definition: tool.h:619
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library_interface.cpp File Reference

  • saga_core
  • saga_api
tool_library_interface.cpp File Reference
#include "saga_api.h"

Go to the source code of this file.

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_library_interface.cpp Source File

  • saga_core
  • saga_api
tool_library_interface.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_library_interface.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51
52 //---------------------------------------------------------
53 #include "saga_api.h"
54
55
57 // //
58 // //
59 // //
61
62 //---------------------------------------------------------
63 CSG_Tool_Library_Interface::CSG_Tool_Library_Interface(void)
64 {
65 m_Fnc_Create_Tool = NULL;
66 }
67
68 //---------------------------------------------------------
69 CSG_Tool_Library_Interface::~CSG_Tool_Library_Interface(void)
70 {
71 Destroy();
72 }
73
74
76 // //
78
79 //---------------------------------------------------------
80 bool CSG_Tool_Library_Interface::Create(const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool)
81 {
82 Destroy();
83
84 //-----------------------------------------------------
85 m_Info.Set_Count(TLB_INFO_Count);
86
87 for(int i=0; i<TLB_INFO_User; i++)
88 {
89 m_Info[i] = Fnc_Info(i);
90 }
91
92 CSG_String Library = SG_File_Get_Name(TLB_Path, false);
93
94 #if !defined(_SAGA_MSW)
95 if( Library.Find("lib") == 0 )
96 {
97 Library = Library.Right(Library.Length() - 3);
98 }
99 #endif
100
101 m_Info[TLB_INFO_Library ] = Library;
102 m_Info[TLB_INFO_SAGA_Version] = Version;
103 m_Info[TLB_INFO_File ] = SG_File_Get_Path_Absolute(TLB_Path);
104
105 if( Version.Cmp(SAGA_VERSION) )
106 {
107 SG_UI_Msg_Add_Error(CSG_String::Format("SAGA API %s: %s=%s, %s=%s", _TL("version mismatch"), _TL("current version"), SAGA_VERSION,
108 Library.c_str(), Version.c_str()
109 ));
110
111 return( false );
112 }
113
114 //-----------------------------------------------------
115 m_Fnc_Create_Tool = Fnc_Create_Tool;
116
117 CSG_Tool *pTool;
118
119 for(int ID=0; (pTool = m_Fnc_Create_Tool(ID)) != NULL; ID++)
120 {
121 if( pTool != TLB_INTERFACE_SKIP_TOOL )
122 {
123 pTool->m_ID.Printf("%d", ID);
124 pTool->m_Library = m_Info[TLB_INFO_Library ];
125 pTool->m_Library_Menu = m_Info[TLB_INFO_Menu_Path];
126 pTool->m_File_Name = m_Info[TLB_INFO_File ];
127
128 m_Tools.Add(pTool);
129 }
130 }
131
132 return( Get_Count() > 0 );
133 }
134
135 //---------------------------------------------------------
136 bool CSG_Tool_Library_Interface::Destroy(void)
137 {
138 Delete_Tools();
139
140 for(size_t i=0; i<m_Tools.Get_uSize(); i++)
141 {
142 delete((CSG_Tool *)m_Tools[i]);
143 }
144
145 m_Tools.Destroy();
146
147 return( true );
148 }
149
150
152 // //
154
155 //---------------------------------------------------------
156 const CSG_String & CSG_Tool_Library_Interface::Get_Info(int ID)
157 {
158 return( m_Info[ID] );
159 }
160
161
163 // //
165
166 //---------------------------------------------------------
167 int CSG_Tool_Library_Interface::Get_Count(void)
168 {
169 return( (int)m_Tools.Get_Size() );
170 }
171
172 //---------------------------------------------------------
173 CSG_Tool * CSG_Tool_Library_Interface::Get_Tool(int i)
174 {
175 if( i >= 0 && i < Get_Count() )
176 {
177 return( (CSG_Tool *)m_Tools[i] );
178 }
179
180 return( NULL );
181 }
182
183
185 // //
187
188 //---------------------------------------------------------
189 CSG_Tool * CSG_Tool_Library_Interface::Create_Tool(int ID, bool bWithGUI)
190 {
191 CSG_Tool *pTool = m_Fnc_Create_Tool ? m_Fnc_Create_Tool(ID) : NULL;
192
193 if( pTool && pTool != TLB_INTERFACE_SKIP_TOOL )
194 {
195 pTool->m_ID.Printf("%d", ID);
196 pTool->m_Library = m_Info[TLB_INFO_Library ];
197 pTool->m_Library_Menu = m_Info[TLB_INFO_Menu_Path];
198 pTool->m_File_Name = m_Info[TLB_INFO_File ];
199 pTool->m_bWithGUI = bWithGUI;
200
201 m_xTools.Add(pTool);
202
203 return( pTool );
204 }
205
206 return( NULL );
207 }
208
209 //---------------------------------------------------------
210 bool CSG_Tool_Library_Interface::Delete_Tool(CSG_Tool *pTool)
211 {
212 for(size_t i=0; i<m_xTools.Get_uSize(); i++)
213 {
214 if( pTool == m_xTools.Get(i) && m_xTools.Del(i) )
215 {
216 delete(pTool);
217
218 return( true );
219 }
220 }
221
222 return( false );
223 }
224
225 //---------------------------------------------------------
226 bool CSG_Tool_Library_Interface::Delete_Tools(void)
227 {
228 for(size_t i=0; i<m_xTools.Get_uSize(); i++)
229 {
230 delete((CSG_Tool *)m_xTools[i]);
231 }
232
233 m_xTools.Destroy();
234
235 return( true );
236 }
237
238
240 // //
241 // //
242 // //
244
245 //---------------------------------------------------------
CSG_Tool_Library_Interface::Get_Tool
CSG_Tool * Get_Tool(int i)
Definition: tool_library_interface.cpp:173
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
_TL
#define _TL(s)
Definition: api_core.h:1480
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
TLB_INFO_Library
@ TLB_INFO_Library
Definition: tool.h:623
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
TLB_INFO_SAGA_Version
@ TLB_INFO_SAGA_Version
Definition: tool.h:624
saga_api.h
CSG_Tool
Definition: tool.h:149
TLB_INFO_User
@ TLB_INFO_User
Definition: tool.h:621
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
TLB_INFO_Count
@ TLB_INFO_Count
Definition: tool.h:625
SG_File_Get_Name
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
Definition: api_file.cpp:862
TSG_PFNC_TLB_Get_Info
CSG_String(* TSG_PFNC_TLB_Get_Info)(int i)
Definition: tool.h:631
CSG_Tool_Library_Interface::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool)
Definition: tool_library_interface.cpp:210
CSG_Tool_Library_Interface::Create
bool Create(const CSG_String &Version, const CSG_String &TLB_Path, TSG_PFNC_TLB_Get_Info Fnc_Info, TSG_PFNC_TLB_Create_Tool Fnc_Create_Tool)
Definition: tool_library_interface.cpp:80
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
TLB_INTERFACE_SKIP_TOOL
#define TLB_INTERFACE_SKIP_TOOL
Definition: tool.h:674
TLB_INFO_File
@ TLB_INFO_File
Definition: tool.h:622
CSG_Array_Pointer::Get_uSize
size_t Get_uSize(void) const
Definition: api_core.h:382
CSG_Tool_Library_Interface::Get_Count
int Get_Count(void)
Definition: tool_library_interface.cpp:167
CSG_Strings::Set_Count
bool Set_Count(int Count)
Definition: api_core.h:704
CSG_Tool_Library_Interface::Delete_Tools
bool Delete_Tools(void)
Definition: tool_library_interface.cpp:226
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:616
SG_File_Get_Path_Absolute
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
Definition: api_file.cpp:883
CSG_Array_Pointer::Destroy
void Destroy(void)
Definition: api_core.h:376
CSG_String
Definition: api_core.h:557
CSG_Tool_Library_Interface::Get_Info
const CSG_String & Get_Info(int ID)
Definition: tool_library_interface.cpp:156
CSG_Tool_Library_Interface::~CSG_Tool_Library_Interface
virtual ~CSG_Tool_Library_Interface(void)
Definition: tool_library_interface.cpp:69
CSG_Array_Pointer::Add
bool Add(void *Value)
Definition: api_memory.cpp:485
TSG_PFNC_TLB_Create_Tool
CSG_Tool *(* TSG_PFNC_TLB_Create_Tool)(int i)
Definition: tool.h:630
CSG_Array_Pointer::Get
void *& Get(sLong Index)
Definition: api_core.h:394
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
SG_UI_Msg_Add_Error
void SG_UI_Msg_Add_Error(const char *Message)
Definition: api_callback.cpp:544
CSG_Tool_Library_Interface::Create_Tool
CSG_Tool * Create_Tool(int i, bool bWithGUI=false)
Definition: tool_library_interface.cpp:189
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:693
CSG_Tool_Library_Interface::Destroy
bool Destroy(void)
Definition: tool_library_interface.cpp:136
TLB_INFO_Menu_Path
@ TLB_INFO_Menu_Path
Definition: tool.h:619
CSG_Tool_Library_Interface::CSG_Tool_Library_Interface
CSG_Tool_Library_Interface(void)
Definition: tool_library_interface.cpp:63
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_summary.cpp File Reference

  • saga_core
  • saga_api
Macros | Functions
tool_summary.cpp File Reference
#include "saga_api.h"

Go to the source code of this file.

Macros

#define | SG_XML_SYSTEM SG_T("system")
#define | SG_XML_SYSTEM_VER SG_T("version")
#define | SG_XML_SYSTEM_MLP SG_T("library-path")
#define | SG_XML_LIBRARY SG_T("library")
#define | SG_XML_LIBRARY_PATH SG_T("path")
#define | SG_XML_LIBRARY_NAME SG_T("name")
#define | SG_XML_LIBRARY_CATEGORY SG_T("category")
#define | SG_XML_TOOL SG_T("module")
#define | SG_XML_TOOL_ATT_NAME SG_T("name")
#define | SG_XML_TOOL_ATT_ID SG_T("id")
#define | SG_XML_TOOL_ATT_VERSION SG_T("version")
#define | SG_XML_TOOL_ATT_AUTHOR SG_T("author")
#define | SG_XML_SPECIFICATION SG_T("specification")
#define | SG_XML_SPEC_ATT_GRID SG_T("grid")
#define | SG_XML_SPEC_ATT_INTERA SG_T("interactive")
#define | SG_XML_MENU SG_T("menu")
#define | SG_XML_DESCRIPTION SG_T("description")
#define | SG_XML_PARAM SG_T("parameter")
#define | SG_XML_PARAM_ATT_NAME SG_T("name")
#define | SG_XML_PARAM_ATT_CLASS SG_T("class")
#define | SG_XML_PARAM_MANDATORY SG_T("mandatory")
#define | SG_XML_PARAM_WITH_GUI SG_T("with_gui")
#define | SG_XML_PARAM_WITH_CMD SG_T("with_cmd")
#define | SG_XML_PARAM_TYPE SG_T("type")
#define | SG_XML_PARAM_IDENTIFIER SG_T("identifier")
#define | SG_XML_PARAM_PARENT SG_T("parent")
#define | SG_XML_PARAM_LIST SG_T("list")
#define | SG_XML_PARAM_ITEM SG_T("item")
#define | SG_XML_PARAM_TABLE SG_T("table")
#define | SG_XML_PARAM_FIELD SG_T("field")
#define | SG_XML_PARAM_FIELD_ATT_NAME SG_T("name")
#define | SG_XML_PARAM_FIELD_ATT_TYPE SG_T("type")
#define | SG_XML_PARAM_MIN SG_T("min")
#define | SG_XML_PARAM_MAX SG_T("max")
#define | SG_XML_PARAM_DEFAULT SG_T("default")
#define | SG_GET_XML_TAGGED_STR(value, tag) CSG_String::Format("<%s>%s</%s>", tag, value, tag)
#define | SG_GET_XML_TAGGED_INT(value, tag) CSG_String::Format("<%s>%d</%s>", tag, value, tag)
#define | SG_GET_XML_TAGGED_FLT(value, tag) CSG_String::Format("<%s>%f</%s>", tag, value, tag)
#define | SUMMARY_ADD_STR(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)
#define | SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)
#define | SUMMARY_ADD_STR(label, value) CSG_String::Format("%s:\t%s\n", label, value)
#define | SUMMARY_ADD_INT(label, value) CSG_String::Format("%s:\t%d\n", label, value)
#define | SUMMARY_ADD_STR(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)
#define | SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)
#define | SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)

Functions

void SG_XML_Add_Parameter (CSG_MetaData *pParent, CSG_Parameter *pParameter, CSG_String ID="")

Macro Definition Documentation

◆ SG_GET_XML_TAGGED_FLT

#define SG_GET_XML_TAGGED_FLT | ( | value,
 |  | tag
 | ) | CSG_String::Format("<%s>%f</%s>", tag, value, tag)

Definition at line 100 of file tool_summary.cpp.

◆ SG_GET_XML_TAGGED_INT

#define SG_GET_XML_TAGGED_INT | ( | value,
 |  | tag
 | ) | CSG_String::Format("<%s>%d</%s>", tag, value, tag)

Definition at line 99 of file tool_summary.cpp.

◆ SG_GET_XML_TAGGED_STR

#define SG_GET_XML_TAGGED_STR | ( | value,
 |  | tag
 | ) | CSG_String::Format("<%s>%s</%s>", tag, value, tag)

Definition at line 98 of file tool_summary.cpp.

◆ SG_XML_DESCRIPTION

#define SG_XML_DESCRIPTION SG_T("description")

Definition at line 77 of file tool_summary.cpp.

◆ SG_XML_LIBRARY

#define SG_XML_LIBRARY SG_T("library")

Definition at line 64 of file tool_summary.cpp.

◆ SG_XML_LIBRARY_CATEGORY

#define SG_XML_LIBRARY_CATEGORY SG_T("category")

Definition at line 67 of file tool_summary.cpp.

◆ SG_XML_LIBRARY_NAME

#define SG_XML_LIBRARY_NAME SG_T("name")

Definition at line 66 of file tool_summary.cpp.

◆ SG_XML_LIBRARY_PATH

#define SG_XML_LIBRARY_PATH SG_T("path")

Definition at line 65 of file tool_summary.cpp.

◆ SG_XML_MENU

#define SG_XML_MENU SG_T("menu")

Definition at line 76 of file tool_summary.cpp.

◆ SG_XML_PARAM

#define SG_XML_PARAM SG_T("parameter")

Definition at line 78 of file tool_summary.cpp.

◆ SG_XML_PARAM_ATT_CLASS

#define SG_XML_PARAM_ATT_CLASS SG_T("class")

Definition at line 80 of file tool_summary.cpp.

◆ SG_XML_PARAM_ATT_NAME

#define SG_XML_PARAM_ATT_NAME SG_T("name")

Definition at line 79 of file tool_summary.cpp.

◆ SG_XML_PARAM_DEFAULT

#define SG_XML_PARAM_DEFAULT SG_T("default")

Definition at line 95 of file tool_summary.cpp.

◆ SG_XML_PARAM_FIELD

#define SG_XML_PARAM_FIELD SG_T("field")

Definition at line 90 of file tool_summary.cpp.

◆ SG_XML_PARAM_FIELD_ATT_NAME

#define SG_XML_PARAM_FIELD_ATT_NAME SG_T("name")

Definition at line 91 of file tool_summary.cpp.

◆ SG_XML_PARAM_FIELD_ATT_TYPE

#define SG_XML_PARAM_FIELD_ATT_TYPE SG_T("type")

Definition at line 92 of file tool_summary.cpp.

◆ SG_XML_PARAM_IDENTIFIER

#define SG_XML_PARAM_IDENTIFIER SG_T("identifier")

Definition at line 85 of file tool_summary.cpp.

◆ SG_XML_PARAM_ITEM

#define SG_XML_PARAM_ITEM SG_T("item")

Definition at line 88 of file tool_summary.cpp.

◆ SG_XML_PARAM_LIST

#define SG_XML_PARAM_LIST SG_T("list")

Definition at line 87 of file tool_summary.cpp.

◆ SG_XML_PARAM_MANDATORY

#define SG_XML_PARAM_MANDATORY SG_T("mandatory")

Definition at line 81 of file tool_summary.cpp.

◆ SG_XML_PARAM_MAX

#define SG_XML_PARAM_MAX SG_T("max")

Definition at line 94 of file tool_summary.cpp.

◆ SG_XML_PARAM_MIN

#define SG_XML_PARAM_MIN SG_T("min")

Definition at line 93 of file tool_summary.cpp.

◆ SG_XML_PARAM_PARENT

#define SG_XML_PARAM_PARENT SG_T("parent")

Definition at line 86 of file tool_summary.cpp.

◆ SG_XML_PARAM_TABLE

#define SG_XML_PARAM_TABLE SG_T("table")

Definition at line 89 of file tool_summary.cpp.

◆ SG_XML_PARAM_TYPE

#define SG_XML_PARAM_TYPE SG_T("type")

Definition at line 84 of file tool_summary.cpp.

◆ SG_XML_PARAM_WITH_CMD

#define SG_XML_PARAM_WITH_CMD SG_T("with_cmd")

Definition at line 83 of file tool_summary.cpp.

◆ SG_XML_PARAM_WITH_GUI

#define SG_XML_PARAM_WITH_GUI SG_T("with_gui")

Definition at line 82 of file tool_summary.cpp.

◆ SG_XML_SPEC_ATT_GRID

#define SG_XML_SPEC_ATT_GRID SG_T("grid")

Definition at line 74 of file tool_summary.cpp.

◆ SG_XML_SPEC_ATT_INTERA

#define SG_XML_SPEC_ATT_INTERA SG_T("interactive")

Definition at line 75 of file tool_summary.cpp.

◆ SG_XML_SPECIFICATION

#define SG_XML_SPECIFICATION SG_T("specification")

Definition at line 73 of file tool_summary.cpp.

◆ SG_XML_SYSTEM

#define SG_XML_SYSTEM SG_T("system")

Definition at line 61 of file tool_summary.cpp.

◆ SG_XML_SYSTEM_MLP

#define SG_XML_SYSTEM_MLP SG_T("library-path")

Definition at line 63 of file tool_summary.cpp.

◆ SG_XML_SYSTEM_VER

#define SG_XML_SYSTEM_VER SG_T("version")

Definition at line 62 of file tool_summary.cpp.

◆ SG_XML_TOOL

#define SG_XML_TOOL SG_T("module")

Definition at line 68 of file tool_summary.cpp.

◆ SG_XML_TOOL_ATT_AUTHOR

#define SG_XML_TOOL_ATT_AUTHOR SG_T("author")

Definition at line 72 of file tool_summary.cpp.

◆ SG_XML_TOOL_ATT_ID

#define SG_XML_TOOL_ATT_ID SG_T("id")

Definition at line 70 of file tool_summary.cpp.

◆ SG_XML_TOOL_ATT_NAME

#define SG_XML_TOOL_ATT_NAME SG_T("name")

Definition at line 69 of file tool_summary.cpp.

◆ SG_XML_TOOL_ATT_VERSION

#define SG_XML_TOOL_ATT_VERSION SG_T("version")

Definition at line 71 of file tool_summary.cpp.

◆ SUMMARY_ADD_INT [1/4]

#define SUMMARY_ADD_INT | ( | label,
 |  | value
 | ) | CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)

◆ SUMMARY_ADD_INT [2/4]

#define SUMMARY_ADD_INT | ( | label,
 |  | value
 | ) | CSG_String::Format("%s:\t%d\n", label, value)

◆ SUMMARY_ADD_INT [3/4]

#define SUMMARY_ADD_INT | ( | label,
 |  | value
 | ) | CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)

◆ SUMMARY_ADD_INT [4/4]

#define SUMMARY_ADD_INT | ( | label,
 |  | value
 | ) | CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)

◆ SUMMARY_ADD_STR [1/3]

#define SUMMARY_ADD_STR | ( | label,
 |  | value
 | ) | CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)

◆ SUMMARY_ADD_STR [2/3]

#define SUMMARY_ADD_STR | ( | label,
 |  | value
 | ) | CSG_String::Format("%s:\t%s\n", label, value)

◆ SUMMARY_ADD_STR [3/3]

#define SUMMARY_ADD_STR | ( | label,
 |  | value
 | ) | CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)

Function Documentation

◆ SG_XML_Add_Parameter()

void SG_XML_Add_Parameter | ( | CSG_MetaData * | pParent,
 |  | CSG_Parameter * | pParameter,
 |  | CSG_String | ID = ""
 | ) |  |

Definition at line 110 of file tool_summary.cpp.

References CSG_MetaData::Add_Child(), CSG_MetaData::Add_Property(), CSG_Parameter::asBool(), CSG_Parameter::asChoice(), CSG_Parameter::asChoices(), CSG_Parameter::asParameters(), CSG_Parameter::asTable(), CSG_Parameter::asValue(), CSG_String::c_str(), CSG_Parameter::do_UseInCMD(), CSG_Parameter::do_UseInGUI(), CSG_String::Format(), CSG_Parameter::Get_DataObject_Type(), CSG_Parameter::Get_Default(), CSG_Parameter::Get_Description(), CSG_Table::Get_Field_Name(), CSG_Table::Get_Field_Type(), CSG_Parameter::Get_Identifier(), CSG_Parameter_Choices::Get_Item(), CSG_Parameter_Choice::Get_Item(), CSG_Parameter_Value::Get_Maximum(), CSG_Parameter_Value::Get_Minimum(), CSG_Parameter::Get_Name(), CSG_Parameters::Get_Parameter(), CSG_Parameter::Get_Parent(), CSG_Parameter::Get_Type(), CSG_Parameter::Get_Type_Name(), CSG_Parameter_Value::has_Maximum(), CSG_Parameter_Value::has_Minimum(), CSG_String::is_Empty(), CSG_Parameter::is_Input(), CSG_Parameter::is_Option(), CSG_Parameter::is_Optional(), CSG_Parameter::is_Output(), CSG_String::Make_Lower(), PARAMETER_TYPE_Bool, PARAMETER_TYPE_Choice, PARAMETER_TYPE_Choices, PARAMETER_TYPE_Color, PARAMETER_TYPE_Colors, PARAMETER_TYPE_Data_Type, PARAMETER_TYPE_DataObject_Output, PARAMETER_TYPE_Date, PARAMETER_TYPE_Degree, PARAMETER_TYPE_Double, PARAMETER_TYPE_FilePath, PARAMETER_TYPE_FixedTable, PARAMETER_TYPE_Font, PARAMETER_TYPE_Grid_System, PARAMETER_TYPE_Int, PARAMETER_TYPE_Parameters, PARAMETER_TYPE_Range, PARAMETER_TYPE_String, PARAMETER_TYPE_Table_Field, PARAMETER_TYPE_Table_Fields, PARAMETER_TYPE_Text, SG_Data_Type_Get_Name(), SG_Get_DataObject_Name(), SG_XML_DESCRIPTION, SG_XML_PARAM, SG_XML_PARAM_ATT_CLASS, SG_XML_PARAM_ATT_NAME, SG_XML_PARAM_DEFAULT, SG_XML_PARAM_FIELD, SG_XML_PARAM_FIELD_ATT_NAME, SG_XML_PARAM_FIELD_ATT_TYPE, SG_XML_PARAM_IDENTIFIER, SG_XML_PARAM_ITEM, SG_XML_PARAM_LIST, SG_XML_PARAM_MANDATORY, SG_XML_PARAM_MAX, SG_XML_PARAM_MIN, SG_XML_PARAM_PARENT, SG_XML_PARAM_TABLE, SG_XML_PARAM_TYPE, SG_XML_PARAM_WITH_CMD, and SG_XML_PARAM_WITH_GUI.

Referenced by CSG_Tool::Get_Summary().

Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: tool_summary.cpp Source File

  • saga_core
  • saga_api
tool_summary.cpp
Go to the documentation of this file.
1
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // tool_summary.cpp //
15 // //
16 // Copyright (C) 2018 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49
50 //---------------------------------------------------------
51 #include "saga_api.h"
52
53
55 // //
56 // XML tags for mark-up of tool synopsis //
57 // //
59
60 //---------------------------------------------------------
61 #define SG_XML_SYSTEM SG_T("system")
62 #define SG_XML_SYSTEM_VER SG_T("version")
63 #define SG_XML_SYSTEM_MLP SG_T("library-path")
64 #define SG_XML_LIBRARY SG_T("library")
65 #define SG_XML_LIBRARY_PATH SG_T("path")
66 #define SG_XML_LIBRARY_NAME SG_T("name")
67 #define SG_XML_LIBRARY_CATEGORY SG_T("category")
68 #define SG_XML_TOOL SG_T("module")
69 #define SG_XML_TOOL_ATT_NAME SG_T("name")
70 #define SG_XML_TOOL_ATT_ID SG_T("id")
71 #define SG_XML_TOOL_ATT_VERSION SG_T("version")
72 #define SG_XML_TOOL_ATT_AUTHOR SG_T("author")
73 #define SG_XML_SPECIFICATION SG_T("specification")
74 #define SG_XML_SPEC_ATT_GRID SG_T("grid")
75 #define SG_XML_SPEC_ATT_INTERA SG_T("interactive")
76 #define SG_XML_MENU SG_T("menu")
77 #define SG_XML_DESCRIPTION SG_T("description")
78 #define SG_XML_PARAM SG_T("parameter")
79 #define SG_XML_PARAM_ATT_NAME SG_T("name")
80 #define SG_XML_PARAM_ATT_CLASS SG_T("class")
81 #define SG_XML_PARAM_MANDATORY SG_T("mandatory")
82 #define SG_XML_PARAM_WITH_GUI SG_T("with_gui")
83 #define SG_XML_PARAM_WITH_CMD SG_T("with_cmd")
84 #define SG_XML_PARAM_TYPE SG_T("type")
85 #define SG_XML_PARAM_IDENTIFIER SG_T("identifier")
86 #define SG_XML_PARAM_PARENT SG_T("parent")
87 #define SG_XML_PARAM_LIST SG_T("list")
88 #define SG_XML_PARAM_ITEM SG_T("item")
89 #define SG_XML_PARAM_TABLE SG_T("table")
90 #define SG_XML_PARAM_FIELD SG_T("field")
91 #define SG_XML_PARAM_FIELD_ATT_NAME SG_T("name")
92 #define SG_XML_PARAM_FIELD_ATT_TYPE SG_T("type")
93 #define SG_XML_PARAM_MIN SG_T("min")
94 #define SG_XML_PARAM_MAX SG_T("max")
95 #define SG_XML_PARAM_DEFAULT SG_T("default")
96
97 //---------------------------------------------------------
98 #define SG_GET_XML_TAGGED_STR(value, tag) CSG_String::Format("<%s>%s</%s>", tag, value, tag)
99 #define SG_GET_XML_TAGGED_INT(value, tag) CSG_String::Format("<%s>%d</%s>", tag, value, tag)
100 #define SG_GET_XML_TAGGED_FLT(value, tag) CSG_String::Format("<%s>%f</%s>", tag, value, tag)
101
102
104 // //
105 // Tool //
106 // //
108
109 //---------------------------------------------------------
110 void SG_XML_Add_Parameter(CSG_MetaData *pParent, CSG_Parameter *pParameter, CSG_String ID = "")
111 {
112 if( !ID.is_Empty() ) ID += "_"; ID += pParameter->Get_Identifier();
113
114 CSG_MetaData *pItem = pParent->Add_Child(SG_XML_PARAM);
115
116 pItem->Add_Property(SG_XML_PARAM_ATT_NAME , pParameter->Get_Name());
117 pItem->Add_Property(SG_XML_PARAM_ATT_CLASS, pParameter->is_Input() ? "input" : pParameter->is_Output() ? "output" : "option");
118
119 pItem->Add_Child(SG_XML_PARAM_IDENTIFIER, ID);
120
121 if( pParameter->Get_Type() == PARAMETER_TYPE_DataObject_Output )
122 {
123 pItem->Add_Child(SG_XML_PARAM_TYPE , CSG_String::Format("%s %s",
124 pParameter->Get_Type_Name().Make_Lower().c_str(),
125 SG_Get_DataObject_Name(pParameter->Get_DataObject_Type()).Make_Lower().c_str()
126 ));
127 }
128 else
129 {
130 pItem->Add_Child(SG_XML_PARAM_TYPE , pParameter->Get_Type_Name().Make_Lower());
131 }
132
133 pItem->Add_Child(SG_XML_DESCRIPTION, pParameter->Get_Description());
134
135 if( !pParameter->is_Option() )
136 {
137 pItem->Add_Child(SG_XML_PARAM_MANDATORY, pParameter->is_Optional() ? "false" : "true");
138 }
139
140 if( !pParameter->do_UseInGUI() ) pItem->Add_Child(SG_XML_PARAM_WITH_GUI, "false");
141 if( !pParameter->do_UseInCMD() ) pItem->Add_Child(SG_XML_PARAM_WITH_CMD, "false");
142
143 switch( pParameter->Get_Type() )
144 {
145 //-----------------------------------------------------
146 case PARAMETER_TYPE_Bool:
147 pItem->Add_Child(SG_XML_PARAM_DEFAULT, pParameter->asBool());
148 break;
149
150 //-----------------------------------------------------
151 case PARAMETER_TYPE_Int:
152 case PARAMETER_TYPE_Double:
153 case PARAMETER_TYPE_Degree:
154 if( pParameter->asValue()->has_Minimum() ) pItem->Add_Child(SG_XML_PARAM_MIN , pParameter->asValue()->Get_Minimum());
155 if( pParameter->asValue()->has_Maximum() ) pItem->Add_Child(SG_XML_PARAM_MAX , pParameter->asValue()->Get_Maximum());
156 if( !pParameter->Get_Default().is_Empty() ) pItem->Add_Child(SG_XML_PARAM_DEFAULT, pParameter ->Get_Default());
157 break;
158
159 //-----------------------------------------------------
160 case PARAMETER_TYPE_Date:
161 break;
162
163 case PARAMETER_TYPE_Range:
164 break;
165
166 //-----------------------------------------------------
167 case PARAMETER_TYPE_Data_Type:
168 case PARAMETER_TYPE_Choice:
169 {
170 CSG_MetaData *pChild = pItem->Add_Child(SG_XML_PARAM_LIST);
171
172 for(int i=0; i<pParameter->asChoice()->Get_Count(); i++)
173 {
174 pChild->Add_Child(SG_XML_PARAM_ITEM, pParameter->asChoice()->Get_Item(i));
175 }
176
177 if( !pParameter->asChoice()->Get_Default().is_Empty() )
178 {
179 pItem->Add_Child(SG_XML_PARAM_DEFAULT, pParameter->asChoice()->Get_Default());
180 }
181 }
182 break;
183
184 //-----------------------------------------------------
185 case PARAMETER_TYPE_Choices:
186 {
187 CSG_MetaData *pChild = pItem->Add_Child(SG_XML_PARAM_LIST);
188
189 for(int i=0; i<pParameter->asChoices()->Get_Item_Count(); i++)
190 {
191 pChild->Add_Child(SG_XML_PARAM_ITEM, pParameter->asChoices()->Get_Item(i));
192 }
193
194 if( !pParameter->asChoices()->Get_Default().is_Empty() )
195 {
196 pItem->Add_Child(SG_XML_PARAM_DEFAULT, pParameter->asChoices()->Get_Default());
197 }
198 }
199 break;
200
201 //-----------------------------------------------------
202 case PARAMETER_TYPE_String:
203 case PARAMETER_TYPE_Text:
204 case PARAMETER_TYPE_FilePath:
205 break;
206
207 case PARAMETER_TYPE_Font:
208 break;
209
210 case PARAMETER_TYPE_Color:
211 case PARAMETER_TYPE_Colors:
212 break;
213
214 //-----------------------------------------------------
215 case PARAMETER_TYPE_FixedTable:
216 {
217 CSG_MetaData *pChild = pItem->Add_Child(SG_XML_PARAM_TABLE);
218
219 for(int i=0; i<pParameter->asTable()->Get_Field_Count(); i++)
220 {
221 CSG_MetaData *pField = pChild->Add_Child(SG_XML_PARAM_FIELD);
222
223 pField->Add_Property(SG_XML_PARAM_FIELD_ATT_NAME, pParameter->asTable()->Get_Field_Name(i));
224 pField->Add_Property(SG_XML_PARAM_FIELD_ATT_TYPE, SG_Data_Type_Get_Name(pParameter->asTable()->Get_Field_Type(i)));
225 }
226 }
227 break;
228
229 //-----------------------------------------------------
230 case PARAMETER_TYPE_Grid_System:
231 break;
232
233 //-----------------------------------------------------
234 case PARAMETER_TYPE_Table_Field:
235 case PARAMETER_TYPE_Table_Fields:
236 if( pParameter->Get_Parent() )
237 {
238 pItem->Add_Child(SG_XML_PARAM_PARENT, pParameter->Get_Parent()->Get_Identifier());
239 }
240 break;
241
242 //-----------------------------------------------------
243 case PARAMETER_TYPE_Parameters:
244 {
245 for(int i=0; i<pParameter->asParameters()->Get_Count(); i++)
246 {
247 SG_XML_Add_Parameter(pItem, pParameter->asParameters()->Get_Parameter(i), ID);
248 }
249 }
250
251 //-----------------------------------------------------
252 default:
253 break;
254 }
255 }
256
257 //---------------------------------------------------------
258 CSG_String CSG_Tool::Get_Summary(bool bParameters, const CSG_String &Menu, const CSG_String &Description, int Format)
259 {
260 CSG_String s;
261
262 //-----------------------------------------------------
263 switch( Format )
264 {
265 case SG_SUMMARY_FMT_XML:
266 {
267 CSG_MetaData m;
268
269 m.Set_Name (SG_XML_TOOL);
270 m.Add_Property(SG_XML_TOOL_ATT_NAME , Get_Name ());
271 m.Add_Property(SG_XML_TOOL_ATT_ID , Get_ID ());
272 m.Add_Property(SG_XML_TOOL_ATT_AUTHOR , Get_Author ());
273 m.Add_Property(SG_XML_TOOL_ATT_VERSION, Get_Version ());
274 m.Add_Child (SG_XML_DESCRIPTION , Get_Description());
275 m.Add_Child (SG_XML_MENU , Get_MenuPath ());
276 m.Add_Child (SG_XML_SPEC_ATT_GRID , is_Grid () ? "true" : "false");
277 m.Add_Child (SG_XML_SPEC_ATT_INTERA , is_Interactive () ? "true" : "false");
278
279 // CSG_MetaData *pChild = m.Add_Child(SG_XML_SPECIFICATION);
280 // pChild->Add_Property(SG_XML_SPEC_ATT_GRID , is_Grid () ? "true" : "false");
281 // pChild->Add_Property(SG_XML_SPEC_ATT_INTERA, is_Interactive () ? "true" : "false");
282
283 if( bParameters )
284 {
285 for(int i=0; i<Parameters.Get_Count(); i++)
286 {
287 if( Parameters(i)->is_Input() )
288 {
289 SG_XML_Add_Parameter(&m, Parameters(i));
290 }
291 }
292
293 for(int i=0; i<Parameters.Get_Count(); i++)
294 {
295 if( Parameters(i)->is_Output() )
296 {
297 SG_XML_Add_Parameter(&m, Parameters(i));
298 }
299 }
300
301 for(int i=0; i<Parameters.Get_Count(); i++)
302 {
303 if( Parameters(i)->is_Option()
304 && Parameters(i)->Get_Type() != PARAMETER_TYPE_Node
305 && Parameters(i)->Get_Type() != PARAMETER_TYPE_Grid_System )
306 {
307 SG_XML_Add_Parameter(&m, Parameters(i));
308 }
309 }
310 }
311
312 s = m.asText(1);
313 }
314 break;
315
316 //-----------------------------------------------------
317 case SG_SUMMARY_FMT_HTML:
318 {
319 #define SUMMARY_ADD_STR(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)
320 #define SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)
321
322 s += CSG_String::Format("<h4>%s</h4><table border=\"0\">", _TL("Tool"));
323
324 s += SUMMARY_ADD_STR(_TL("Name" ), Get_Name ().c_str());
325 s += SUMMARY_ADD_STR(_TL("Author" ), Get_Author ().c_str());
326 s += SUMMARY_ADD_STR(_TL("Version"), Get_Version().c_str());
327 s += SUMMARY_ADD_STR(_TL("Library"), Get_Library().c_str());
328 s += SUMMARY_ADD_STR(_TL("ID" ), Get_ID ().c_str());
329
330 if( is_Interactive() && is_Grid() )
331 {
332 s += SUMMARY_ADD_STR(_TL("Specification"), CSG_String::Format("%s, %s", _TL("grid"), _TL("interactive")).c_str() );
333 }
334 else if( is_Interactive() )
335 {
336 s += SUMMARY_ADD_STR(_TL("Specification"), _TL("interactive"));
337 }
338 else if( is_Grid() )
339 {
340 s += SUMMARY_ADD_STR(_TL("Specification"), _TL("grid"));
341 }
342
343 if( Get_Type() == TOOL_TYPE_Chain )
344 {
345 s += SUMMARY_ADD_STR(_TL("File"), Get_File_Name().c_str() );
346 }
347
348 if( Menu.Length() > 0 )
349 {
350 CSG_String sMenu(Menu);
351
352 sMenu.Replace("|", " <b>></b> ");
353
354 s += SUMMARY_ADD_STR(_TL("Menu" ), sMenu.c_str());
355 }
356
357 s += "</table>";
358
359 #undef SUMMARY_ADD_STR
360 #undef SUMMARY_ADD_INT
361
362 //---------------------------------------------
363 s += CSG_String::Format("<hr><h4>%s</h4>", _TL("Description"));
364
365 s += !Description.is_Empty() ? Description : Get_Description();
366
367 //---------------------------------------------
368 if( Description.is_Empty() && Get_References().Get_Count() > 0 )
369 {
370 s += CSG_String::Format("<hr><h4>%s</h4><ul>", _TL("References"));
371
372 for(int i=0; i<Get_References().Get_Count(); i++)
373 {
374 s += "<li>" + Get_References()[i] + "</li>";
375 }
376
377 s += "</ul>";
378 }
379
380 //---------------------------------------------
381 if( bParameters )
382 {
383 s += CSG_String::Format("<hr><h4>%s</h4>", _TL("Parameters"));
384 s += CSG_String::Format("<table border=\"1\" width=\"100%%\" valign=\"top\" cellpadding=\"5\" rules=\"all\"><tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n",
385 _TL("Name"), _TL("Type"), _TL("Identifier"), _TL("Description"), _TL("Constraints")
386 );
387
388 //-----------------------------------------
389 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
390 {
391 CSG_Parameter *pParameter = Parameters(i);
392
393 if( pParameter->is_Input() )
394 {
395 if( bFirst )
396 {
397 bFirst = 0; s += CSG_String::Format("<tr><th colspan=\"5\">%s</th></tr>", _TL("Input"));
398 }
399
400 s += CSG_String::Format("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
401 pParameter->Get_Name(),
402 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
403 pParameter->Get_Identifier (),
404 pParameter->Get_Description(),
405 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
406 );
407 }
408 }
409
410 //-----------------------------------------
411 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
412 {
413 CSG_Parameter *pParameter = Parameters(i);
414
415 if( pParameter->is_Output() )
416 {
417 if( bFirst )
418 {
419 bFirst = 0; s += CSG_String::Format("<tr><th colspan=\"5\">%s</th></tr>", _TL("Output"));
420 }
421
422 s += CSG_String::Format("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
423 pParameter->Get_Name(),
424 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
425 pParameter->Get_Identifier (),
426 pParameter->Get_Description(),
427 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
428 );
429 }
430 }
431
432 //-----------------------------------------
433 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
434 {
435 CSG_Parameter *pParameter = Parameters(i);
436
437 if( pParameter->is_Option() && pParameter->Get_Type() != PARAMETER_TYPE_Grid_System )
438 {
439 if( bFirst )
440 {
441 bFirst = 0; s += CSG_String::Format("<tr><th colspan=\"5\">%s</th></tr>", _TL("Options"));
442 }
443
444 s += CSG_String::Format("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
445 pParameter->Get_Name(),
446 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
447 pParameter->Get_Identifier (),
448 pParameter->Get_Description(),
449 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
450 );
451 }
452 }
453
454 //-----------------------------------------
455 s += "</table>";
456
457 s.Replace("\n", "<br>");
458 }
459 }
460 break;
461
462 //-----------------------------------------------------
463 case SG_SUMMARY_FMT_FLAT: default:
464 {
465 #define SUMMARY_ADD_STR(label, value) CSG_String::Format("%s:\t%s\n", label, value)
466 #define SUMMARY_ADD_INT(label, value) CSG_String::Format("%s:\t%d\n", label, value)
467
468 s += SUMMARY_ADD_STR(_TL("Name" ), Get_Name ().c_str());
469 s += SUMMARY_ADD_STR(_TL("ID" ), Get_ID ().c_str());
470 s += SUMMARY_ADD_STR(_TL("Author" ), Get_Author ().c_str());
471 s += SUMMARY_ADD_STR(_TL("Version"), Get_Version().c_str());
472
473 if( is_Interactive() && is_Grid() )
474 {
475 s += SUMMARY_ADD_STR(_TL("Specification"), CSG_String::Format("%s, %s", _TL("grid"), _TL("interactive")).c_str() );
476 }
477 else if( is_Interactive() )
478 {
479 s += SUMMARY_ADD_STR(_TL("Specification"), _TL("interactive"));
480 }
481 else if( is_Grid() )
482 {
483 s += SUMMARY_ADD_STR(_TL("Specification"), _TL("grid"));
484 }
485
486 if( Get_Type() == TOOL_TYPE_Chain )
487 {
488 s += SUMMARY_ADD_STR(_TL("File"), Get_File_Name().c_str() );
489 }
490
491 if( Menu.Length() > 0 )
492 {
493 CSG_String sMenu(Menu);
494
495 sMenu.Replace("|", " <b>></b> ");
496
497 s += SUMMARY_ADD_STR(_TL("Menu" ), sMenu.c_str());
498 }
499
500 #undef SUMMARY_ADD_STR
501 #undef SUMMARY_ADD_INT
502
503 //---------------------------------------------
504 s += "\n____________________________\n";
505
506 s += CSG_String::Format("%s:\n", _TL("Description"));
507
508 s += !Description.is_Empty() ? Description : Get_Description();
509
510 //---------------------------------------------
511 if( Description.is_Empty() && Get_References().Get_Count() > 0 )
512 {
513 s += "\n____________________________\n";
514
515 s += CSG_String::Format("\n%s:\n", _TL("References"));
516
517 for(int i=0; i<Get_References().Get_Count(); i++)
518 {
519 CSG_String Reference(Get_References()[i]);
520
521 Reference.Replace("<b>" , "");
522 Reference.Replace("</b>" , "");
523 Reference.Replace("<a href=\"", "");
524 Reference.Replace("\">" , " (");
525 Reference.Replace("</a>" , ")");
526
527 s += " - " + Reference + "\n";
528 }
529 }
530
531 //---------------------------------------------
532 if( bParameters )
533 {
534 s += "\n";
535
536 //-----------------------------------------
537 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
538 {
539 CSG_Parameter *pParameter = Parameters(i);
540
541 if( pParameter->is_Input() )
542 {
543 if( bFirst )
544 {
545 bFirst = 0;
546 s += "____________________________\n";
547 s += CSG_String::Format("%s:\n", _TL("Input"));
548 }
549
550 s += CSG_String::Format("_\n%s\n%s\n%s\n%s\n%s\n",
551 pParameter->Get_Name (),
552 pParameter->Get_Identifier (),
553 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
554 pParameter->Get_Description(),
555 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
556 );
557 }
558 }
559
560 //-----------------------------------------
561 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
562 {
563 CSG_Parameter *pParameter = Parameters(i);
564
565 if( pParameter->is_Output() )
566 {
567 if( bFirst )
568 {
569 bFirst = 0;
570 s += "____________________________\n";
571 s += CSG_String::Format("%s:\n", _TL("Output"));
572 }
573
574 s += CSG_String::Format("_\n%s\n%s\n%s\n%s\n%s\n",
575 pParameter->Get_Name (),
576 pParameter->Get_Identifier (),
577 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
578 pParameter->Get_Description(),
579 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
580 );
581 }
582 }
583
584 //-----------------------------------------
585 for(int i=0, bFirst=1; i<Parameters.Get_Count(); i++)
586 {
587 CSG_Parameter *pParameter = Parameters(i);
588
589 if( pParameter->is_Option() && pParameter->Get_Type() != PARAMETER_TYPE_Grid_System )
590 {
591 if( bFirst )
592 {
593 bFirst = 0;
594 s += "____________________________\n";
595 s += CSG_String::Format("%s:\n", _TL("Options"));
596 }
597
598 s += CSG_String::Format("_\n%s\n%s\n%s\n%s\n%s\n",
599 pParameter->Get_Name (),
600 pParameter->Get_Identifier (),
601 pParameter->Get_Description(PARAMETER_DESCRIPTION_TYPE ).c_str(),
602 pParameter->Get_Description(),
603 pParameter->Get_Description(PARAMETER_DESCRIPTION_PROPERTIES).c_str()
604 );
605 }
606 }
607 }
608 }
609 break;
610 }
611
612 //-----------------------------------------------------
613 return( s );
614 }
615
616
618 // //
619 // Tool Library //
620 // //
622
623 //---------------------------------------------------------
624 CSG_String CSG_Tool_Library::Get_Summary(int Format, bool bWithGUINeeded) const
625 {
626 bool bToolChains = Get_File_Name().is_Empty();
627
628 CSG_String s;
629
630 switch( Format )
631 {
632 //-----------------------------------------------------
633 case SG_SUMMARY_FMT_XML:
634
635 s += "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n";
636 s += CSG_String::Format("<%s>\n" , SG_XML_LIBRARY);
637 s += CSG_String::Format("\t<%s>%s</%s>\n", SG_XML_LIBRARY_PATH, Get_File_Name().c_str(), SG_XML_LIBRARY_PATH);
638 s += CSG_String::Format("\t<%s>%s</%s>\n", SG_XML_LIBRARY_NAME, Get_Info(TLB_INFO_Name).c_str(), SG_XML_LIBRARY_NAME);
639 s += CSG_String::Format("\t<%s>%s</%s>\n", SG_XML_LIBRARY_CATEGORY, Get_Info(TLB_INFO_Category).c_str(), SG_XML_LIBRARY_CATEGORY);
640
641 for(int i=0; i<Get_Count(); i++)
642 {
643 if( Get_Tool(i) && (bWithGUINeeded || !Get_Tool(i)->needs_GUI()) )
644 {
645 CSG_String Name(Get_Tool(i)->Get_Name());
646 Name.Replace("&", "&amp;");
647 s += CSG_String::Format("\t<%s %s=\"%s\" %s=\"%s\"/>\n", SG_XML_TOOL,
648 SG_XML_TOOL_ATT_ID , Get_Tool(i)->Get_ID().c_str(),
649 SG_XML_TOOL_ATT_NAME, Name.c_str()
650 );
651 }
652 }
653
654 s += CSG_String::Format("</%s>\n", SG_XML_LIBRARY);
655
656 break;
657
658 //-----------------------------------------------------
659 case SG_SUMMARY_FMT_HTML: default:
660
661 #define SUMMARY_ADD_STR(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%s</td></tr>", label, value)
662 #define SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)
663
664 s += CSG_String::Format("<h4>%s</h4>", _TL("Tool Library"));
665
666 s += "<table border=\"0\">";
667
668 s += SUMMARY_ADD_STR(_TL("Name" ), Get_Info(TLB_INFO_Name ).c_str());
669 s += SUMMARY_ADD_STR(_TL("Author"), Get_Info(TLB_INFO_Author ).c_str());
670 s += SUMMARY_ADD_STR(_TL("ID" ), Get_Library_Name ().c_str());
671 s += SUMMARY_ADD_STR(_TL("File" ), Get_File_Name ().c_str());
672
673 s += "</table>";
674
675 //-------------------------------------------------
676 s += CSG_String::Format("<hr><h4>%s</h4>", _TL("Description"));
677
678 s += Get_Info(TLB_INFO_Description);
679
680 if( Get_References().Get_Count() > 0 )
681 {
682 s += CSG_String::Format("<hr><h4>%s</h4><ul>", _TL("References"));
683
684 for(int i=0; i<Get_References().Get_Count(); i++)
685 {
686 s += "<li>" + Get_References()[i] + "</li>";
687 }
688
689 s += "</ul>";
690 }
691
692 //-------------------------------------------------
693 s += CSG_String::Format("<hr><h4>%s</h4>", _TL("Tools"));
694
695 s += "<table border=\"0\">";
696
697 s += CSG_String::Format("<tr align=\"left\"><th>%s</th><th>%s</th></tr>", _TL("ID"), _TL("Name"));
698
699 for(int i=0; i<Get_Count(); i++)
700 {
701 if( Get_Tool(i) && (bWithGUINeeded || !Get_Tool(i)->needs_GUI()) )
702 {
703 s += SUMMARY_ADD_STR(Get_Tool(i)->Get_ID().c_str(), Get_Tool(i)->Get_Name().c_str());
704 }
705 }
706
707 s += "</table>";
708
709 s.Replace("\n", "<br>");
710
711 #undef SUMMARY_ADD_STR
712 #undef SUMMARY_ADD_INT
713
714 break;
715
716 //-----------------------------------------------------
717 case SG_SUMMARY_FMT_FLAT:
718
719 if( !bToolChains )
720 {
721 s += CSG_String::Format("\n%s%s: ", _TL("Library"), SG_T(" ")) + Get_Info(TLB_INFO_Name );
722 s += CSG_String::Format("\n%s%s: ", _TL("Category"), SG_T(" ")) + Get_Info(TLB_INFO_Category);
723 s += CSG_String::Format("\n%s%s: ", _TL("File"), SG_T(" ")) + Get_File_Name();
724 }
725 else
726 {
727 s += CSG_String::Format("\n%s: ", _TL("Tool Chains")) + Get_Info(TLB_INFO_Name);
728 }
729
730 s += CSG_String::Format("\n%s: ", _TL("Description")) + Get_Info(TLB_INFO_Description);
731
732 if( Get_References().Get_Count() > 0 )
733 {
734 s += CSG_String::Format("\n%s:\n", _TL("References"));
735
736 for(int i=0; i<Get_References().Get_Count(); i++)
737 {
738 s += " - " + Get_References()[i] + "\n";
739 }
740 }
741
742 s += CSG_String::Format("\n\n%s:\n", _TL("Tools"));
743
744 for(int i=0; i<Get_Count(); i++)
745 {
746 if( Get_Tool(i) && (bWithGUINeeded || !Get_Tool(i)->needs_GUI()) )
747 {
748 s += " [" + Get_Tool(i)->Get_ID() + "]\t" + Get_Tool(i)->Get_Name() + "\n";
749 }
750 }
751
752 break;
753 }
754
755 return( s );
756 }
757
758
760 // //
762
763 //---------------------------------------------------------
764 // Store tool and tool library description to HTML files.
765 //---------------------------------------------------------
766 bool CSG_Tool_Library::Get_Summary(const CSG_String &Path) const
767 {
768 CSG_File f;
769
770 if( f.Open(SG_File_Make_Path(Path, Get_Library_Name(), "html"), SG_FILE_W) )
771 {
772 f.Write(Get_Summary());
773 }
774
775 for(int j=0; j<Get_Count(); j++)
776 {
777 if( Get_Tool(j) && f.Open(SG_File_Make_Path(Path, Get_Library_Name() + "_" + Get_Tool(j)->Get_ID(), "html"), SG_FILE_W) )
778 {
779 f.Write(Get_Tool(j)->Get_Summary());
780 }
781 }
782
783 return( true );
784 }
785
786
788 // //
789 // Tool Library Manager //
790 // //
792
793 //---------------------------------------------------------
794 CSG_String CSG_Tool_Library_Manager::Get_Summary(int Format) const
795 {
796 int nTools = 0; CSG_Table Libraries;
797
798 Libraries.Add_Field("LIB" , SG_DATATYPE_String);
799 Libraries.Add_Field("TOOLS", SG_DATATYPE_Int );
800 Libraries.Add_Field("NAME" , SG_DATATYPE_String);
801 Libraries.Add_Field("PATH" , SG_DATATYPE_String);
802 Libraries.Add_Field("CHAIN", SG_DATATYPE_Int );
803
804 for(int i=0; i<Get_Count(); i++)
805 {
806 if( Get_Library(i)->Get_Count() > 0 )
807 {
808 nTools += Get_Library(i)->Get_Count();
809
810 Libraries.Add_Record();
811
812 Libraries[i].Set_Value(0, Get_Library(i)->Get_Library_Name());
813 Libraries[i].Set_Value(1, Get_Library(i)->Get_Count());
814 Libraries[i].Set_Value(2, Get_Library(i)->Get_Name());
815 Libraries[i].Set_Value(3, SG_File_Get_Path(Get_Library(i)->Get_File_Name()));
816 Libraries[i].Set_Value(4, Get_Library(i)->Get_File_Name().is_Empty() ? 1 : 0);
817 }
818 }
819
820 Libraries.Set_Index(4, TABLE_INDEX_Ascending, 0, TABLE_INDEX_Ascending);
821
822 //-----------------------------------------------------
823 CSG_String s;
824
825 switch( Format )
826 {
827 //-----------------------------------------------------
828 case SG_SUMMARY_FMT_XML:
829
830 s += "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n";
831 s += CSG_String::Format("<%s>\n", SG_XML_SYSTEM);
832 s += CSG_String::Format("<%s>%s</%s>\n", SG_XML_SYSTEM_VER, SAGA_VERSION, SG_XML_SYSTEM_VER);
833
834 for(int i=0; i<Libraries.Get_Count(); i++)
835 {
836 s += CSG_String::Format("\t<%s %s=\"%s\"/>\n", SG_XML_LIBRARY, SG_XML_LIBRARY_NAME, Libraries[i].asString(0));
837 }
838
839 s += CSG_String::Format("</%s>\n", SG_XML_SYSTEM);
840
841 break;
842
843 //-----------------------------------------------------
844 case SG_SUMMARY_FMT_HTML: default:
845
846 #define SUMMARY_ADD_INT(label, value) CSG_String::Format("<tr><td valign=\"top\"><b>%s</b></td><td valign=\"top\">%d</td></tr>", label, value)
847
848 s += CSG_String::Format("<h4>%s</h4>", _TL("Tool Libraries"));
849
850 s += "<table border=\"0\">";
851
852 s += SUMMARY_ADD_INT(_TL("Libraries"), Libraries.Get_Count());
853 s += SUMMARY_ADD_INT(_TL("Tools" ), nTools);
854
855 s += "</table>";
856
857 s += CSG_String::Format("<hr><h4>%s</h4><table border=\"1\">", _TL("Libraries"));
858
859 s += CSG_String::Format("<tr align=\"left\"><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>",
860 _TL("Library" ),
861 _TL("Tools" ),
862 _TL("Name" ),
863 _TL("Location")
864 );
865
866 for(int i=0; i<Libraries.Get_Count(); i++)
867 {
868 s += CSG_String::Format("<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td></tr>",
869 Libraries[i].asString(0),
870 Libraries[i].asInt (1),
871 Libraries[i].asString(2),
872 Libraries[i].asString(3)
873 );
874 }
875
876 s += "</table>";
877
878 #undef SUMMARY_ADD_INT
879
880 break;
881
882 //-----------------------------------------------------
883 case SG_SUMMARY_FMT_FLAT:
884
885 s += CSG_String::Format("\n%d %s (%d %s):\n", Libraries.Get_Count(), _TL("loaded tool libraries"), nTools, _TL("tools"));
886
887 for(int i=0; i<Libraries.Get_Count(); i++)
888 {
889 if( Libraries[i].asInt(4) == 0 )
890 s += CSG_String::Format(" - %s\n" , Libraries[i].asString(0));
891 else
892 s += CSG_String::Format(" - %s *\n", Libraries[i].asString(0));
893 }
894
895 s += CSG_String::Format("\n\n*) %s\n", _TL("tool chain libraries"));
896
897 break;
898 }
899
900 //-----------------------------------------------------
901 return( s );
902 }
903
904
906 // //
908
909 //---------------------------------------------------------
910 // Store tool and tool library description to HTML files.
911 //---------------------------------------------------------
912 bool CSG_Tool_Library_Manager::Get_Summary(const CSG_String &Path) const
913 {
914 for(int i=0; i<Get_Count(); i++)
915 {
916 CSG_Tool_Library *pLibrary = Get_Library(i);
917
918 CSG_String Directory = SG_File_Make_Path(Path, pLibrary->Get_Library_Name());
919
920 if( SG_Dir_Create(Directory) )
921 {
922 pLibrary->Get_Summary(Directory);
923 }
924 }
925
926 return( true );
927 }
928
929
931 // //
932 // //
933 // //
935
936 //---------------------------------------------------------
SG_XML_SYSTEM
#define SG_XML_SYSTEM
Definition: tool_summary.cpp:61
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
SG_XML_SPEC_ATT_GRID
#define SG_XML_SPEC_ATT_GRID
Definition: tool_summary.cpp:74
CSG_File::Open
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition: api_file.cpp:111
PARAMETER_TYPE_Double
@ PARAMETER_TYPE_Double
Definition: parameters.h:127
CSG_Parameters::Get_Parameter
CSG_Parameter * Get_Parameter(int i) const
Definition: parameters.h:1708
PARAMETER_TYPE_FilePath
@ PARAMETER_TYPE_FilePath
Definition: parameters.h:136
SG_File_Get_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
Definition: api_file.cpp:875
PARAMETER_TYPE_Degree
@ PARAMETER_TYPE_Degree
Definition: parameters.h:128
CSG_Tool::Parameters
CSG_Parameters Parameters
Definition: tool.h:251
SG_T
#define SG_T(s)
Definition: api_core.h:531
SG_XML_PARAM_FIELD
#define SG_XML_PARAM_FIELD
Definition: tool_summary.cpp:90
TOOL_TYPE_Chain
@ TOOL_TYPE_Chain
Definition: tool.h:106
SG_DATATYPE_String
@ SG_DATATYPE_String
Definition: api_core.h:997
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
SG_XML_PARAM_ATT_NAME
#define SG_XML_PARAM_ATT_NAME
Definition: tool_summary.cpp:79
SAGA_VERSION
#define SAGA_VERSION
Definition: saga_api.h:90
PARAMETER_TYPE_Table_Fields
@ PARAMETER_TYPE_Table_Fields
Definition: parameters.h:145
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
SG_XML_PARAM_IDENTIFIER
#define SG_XML_PARAM_IDENTIFIER
Definition: tool_summary.cpp:85
SG_XML_PARAM_LIST
#define SG_XML_PARAM_LIST
Definition: tool_summary.cpp:87
CSG_Tool::Get_Summary
CSG_String Get_Summary(bool bParameters=true, const CSG_String &Menu="", const CSG_String &Description="", int Format=SG_SUMMARY_FMT_HTML)
Definition: tool_summary.cpp:258
CSG_Parameter::Get_Identifier
const SG_Char * Get_Identifier(void) const
Definition: parameter.cpp:546
PARAMETER_TYPE_Node
@ PARAMETER_TYPE_Node
Definition: parameters.h:123
CSG_Parameter::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: parameter.cpp:128
SG_XML_MENU
#define SG_XML_MENU
Definition: tool_summary.cpp:76
CSG_Parameter::asTable
CSG_Table * asTable(void) const
Definition: parameter.cpp:994
SG_XML_PARAM_PARENT
#define SG_XML_PARAM_PARENT
Definition: tool_summary.cpp:86
CSG_Tool_Library
Definition: tool_library.h:107
CSG_Parameter_Value::Get_Maximum
double Get_Maximum(void) const
Definition: parameters.h:444
CSG_Parameter_Value::has_Minimum
bool has_Minimum(void) const
Definition: parameters.h:441
PARAMETER_TYPE_String
@ PARAMETER_TYPE_String
Definition: parameters.h:134
SG_Get_DataObject_Name
CSG_String SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
Definition: dataobject.cpp:86
PARAMETER_TYPE_Int
@ PARAMETER_TYPE_Int
Definition: parameters.h:126
SG_XML_TOOL_ATT_VERSION
#define SG_XML_TOOL_ATT_VERSION
Definition: tool_summary.cpp:71
SG_XML_LIBRARY
#define SG_XML_LIBRARY
Definition: tool_summary.cpp:64
CSG_Tool::needs_GUI
virtual bool needs_GUI(void) const
Definition: tool.h:229
CSG_Parameter::is_Input
bool is_Input(void) const
Definition: parameters.h:231
SG_XML_TOOL
#define SG_XML_TOOL
Definition: tool_summary.cpp:68
CSG_Tool_Library::Get_Name
CSG_String Get_Name(void) const
Definition: tool_library.h:120
TLB_INFO_Category
@ TLB_INFO_Category
Definition: tool.h:620
SG_XML_PARAM_ATT_CLASS
#define SG_XML_PARAM_ATT_CLASS
Definition: tool_summary.cpp:80
SG_XML_PARAM_FIELD_ATT_NAME
#define SG_XML_PARAM_FIELD_ATT_NAME
Definition: tool_summary.cpp:91
saga_api.h
SG_XML_TOOL_ATT_NAME
#define SG_XML_TOOL_ATT_NAME
Definition: tool_summary.cpp:69
SG_XML_LIBRARY_CATEGORY
#define SG_XML_LIBRARY_CATEGORY
Definition: tool_summary.cpp:67
CSG_Parameter::Get_Description
const SG_Char * Get_Description(void) const
Definition: parameter.cpp:578
SG_SUMMARY_FMT_HTML
@ SG_SUMMARY_FMT_HTML
Definition: tool.h:94
CSG_Parameter::do_UseInCMD
bool do_UseInCMD(void) const
Definition: parameter.cpp:171
PARAMETER_TYPE_FixedTable
@ PARAMETER_TYPE_FixedTable
Definition: parameters.h:141
CSG_Tool::Get_Name
const CSG_String & Get_Name(void) const
Definition: tool.cpp:145
SG_SUMMARY_FMT_XML
@ SG_SUMMARY_FMT_XML
Definition: tool.h:95
TLB_INFO_Name
@ TLB_INFO_Name
Definition: tool.h:615
CSG_Tool::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool.cpp:194
CSG_Parameter::asValue
class CSG_Parameter_Value * asValue(void) const
Definition: parameter.cpp:1022
CSG_String::Replace
size_t Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_File
Definition: api_core.h:1116
SG_XML_SYSTEM_VER
#define SG_XML_SYSTEM_VER
Definition: tool_summary.cpp:62
CSG_Tool::Get_Version
const CSG_String & Get_Version(void) const
Definition: tool.cpp:167
CSG_Parameter::Get_Type
virtual TSG_Parameter_Type Get_Type(void) const =0
SG_XML_PARAM_TYPE
#define SG_XML_PARAM_TYPE
Definition: tool_summary.cpp:84
CSG_Tool_Library_Manager::Get_Summary
CSG_String Get_Summary(int Format=SG_SUMMARY_FMT_HTML) const
Definition: tool_summary.cpp:794
PARAMETER_TYPE_Choices
@ PARAMETER_TYPE_Choices
Definition: parameters.h:133
TLB_INFO_Description
@ TLB_INFO_Description
Definition: tool.h:616
SUMMARY_ADD_INT
#define SUMMARY_ADD_INT(label, value)
PARAMETER_TYPE_Data_Type
@ PARAMETER_TYPE_Data_Type
Definition: parameters.h:131
PARAMETER_TYPE_Colors
@ PARAMETER_TYPE_Colors
Definition: parameters.h:140
CSG_Parameter
Definition: parameters.h:207
CSG_Table::Get_Field_Name
const SG_Char * Get_Field_Name(int iField) const
Definition: table.h:356
SG_SUMMARY_FMT_FLAT
@ SG_SUMMARY_FMT_FLAT
Definition: tool.h:93
CSG_Tool_Library::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool_library.h:116
CSG_Tool_Library_Manager::Get_Count
int Get_Count(void) const
Definition: tool_library.h:193
PARAMETER_TYPE_Bool
@ PARAMETER_TYPE_Bool
Definition: parameters.h:125
SG_Dir_Create
SAGA_API_DLL_EXPORT bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath=false)
Definition: api_file.cpp:733
CSG_Parameters::Get_Count
int Get_Count(void) const
Definition: parameters.h:1681
CSG_Tool_Library::Get_Count
virtual int Get_Count(void) const
Definition: tool_library.h:130
PARAMETER_TYPE_Table_Field
@ PARAMETER_TYPE_Table_Field
Definition: parameters.h:144
PARAMETER_TYPE_Choice
@ PARAMETER_TYPE_Choice
Definition: parameters.h:132
CSG_Parameter::asParameters
class CSG_Parameters * asParameters(void) const
Definition: parameter.cpp:969
CSG_Tool::Get_MenuPath
virtual CSG_String Get_MenuPath(void)
Definition: tool.h:175
SG_XML_SPEC_ATT_INTERA
#define SG_XML_SPEC_ATT_INTERA
Definition: tool_summary.cpp:75
CSG_Tool::Get_Library
const CSG_String & Get_Library(void) const
Definition: tool.cpp:128
CSG_Tool_Library::Get_Library_Name
const CSG_String & Get_Library_Name(void) const
Definition: tool_library.h:117
CSG_MetaData::Add_Property
bool Add_Property(const CSG_String &Name, const CSG_String &Value)
Definition: metadata.cpp:544
CSG_Tool::is_Grid
virtual bool is_Grid(void) const
Definition: tool.h:232
PARAMETER_DESCRIPTION_TYPE
#define PARAMETER_DESCRIPTION_TYPE
Definition: parameters.h:107
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:385
SG_XML_DESCRIPTION
#define SG_XML_DESCRIPTION
Definition: tool_summary.cpp:77
PARAMETER_TYPE_Date
@ PARAMETER_TYPE_Date
Definition: parameters.h:129
CSG_Tool::Get_ID
const CSG_String & Get_ID(void) const
Definition: tool.h:163
SG_Data_Type_Get_Name
CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort)
Definition: api_core.cpp:122
CSG_Tool_Library::Get_Info
virtual CSG_String Get_Info(int Type) const
Definition: tool_library.cpp:133
CSG_Table::Set_Value
virtual bool Set_Value(sLong Index, int iField, const SG_Char *Value)
Definition: table.cpp:1135
SG_FILE_W
@ SG_FILE_W
Definition: api_core.h:1102
SG_XML_PARAM_MIN
#define SG_XML_PARAM_MIN
Definition: tool_summary.cpp:93
SG_XML_PARAM
#define SG_XML_PARAM
Definition: tool_summary.cpp:78
SG_XML_PARAM_FIELD_ATT_TYPE
#define SG_XML_PARAM_FIELD_ATT_TYPE
Definition: tool_summary.cpp:92
CSG_Parameter::is_Optional
bool is_Optional(void) const
Definition: parameters.h:233
CSG_Tool::Get_File_Name
const CSG_String & Get_File_Name(void) const
Definition: tool.cpp:134
CSG_Parameter::is_Output
bool is_Output(void) const
Definition: parameters.h:232
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
TLB_INFO_Author
@ TLB_INFO_Author
Definition: tool.h:617
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
CSG_Parameter_Value::has_Maximum
bool has_Maximum(void) const
Definition: parameters.h:445
CSG_Tool_Library::Get_References
const CSG_Strings & Get_References(void) const
Definition: tool_library.h:151
CSG_Parameter::Get_Default
const CSG_String & Get_Default(void) const
Definition: parameter.cpp:875
CSG_Parameter_Choice::Get_Item
const SG_Char * Get_Item(int Index) const
Definition: parameter_data.cpp:992
SG_XML_PARAM_DEFAULT
#define SG_XML_PARAM_DEFAULT
Definition: tool_summary.cpp:95
CSG_Parameter::Get_Parent
CSG_Parameter * Get_Parent(void) const
Definition: parameter.cpp:105
SG_XML_TOOL_ATT_ID
#define SG_XML_TOOL_ATT_ID
Definition: tool_summary.cpp:70
SG_XML_PARAM_TABLE
#define SG_XML_PARAM_TABLE
Definition: tool_summary.cpp:89
SUMMARY_ADD_STR
#define SUMMARY_ADD_STR(label, value)
CSG_String
Definition: api_core.h:557
CSG_Tool::Get_Author
const CSG_String & Get_Author(void) const
Definition: tool.cpp:156
CSG_Parameter::asChoice
class CSG_Parameter_Choice * asChoice(void) const
Definition: parameter.cpp:1038
SG_XML_PARAM_WITH_GUI
#define SG_XML_PARAM_WITH_GUI
Definition: tool_summary.cpp:82
CSG_Tool_Library::Get_Tool
virtual CSG_Tool * Get_Tool(int Index, TSG_Tool_Type Type=TOOL_TYPE_Base) const
Definition: tool_library.cpp:149
CSG_MetaData
Definition: metadata.h:88
SG_XML_PARAM_MAX
#define SG_XML_PARAM_MAX
Definition: tool_summary.cpp:94
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
PARAMETER_TYPE_Grid_System
@ PARAMETER_TYPE_Grid_System
Definition: parameters.h:143
CSG_Tool::Get_Description
const CSG_String & Get_Description(void) const
Definition: tool.cpp:178
CSG_Tool::is_Interactive
virtual bool is_Interactive(void) const
Definition: tool.h:233
SG_XML_PARAM_WITH_CMD
#define SG_XML_PARAM_WITH_CMD
Definition: tool_summary.cpp:83
SG_XML_LIBRARY_PATH
#define SG_XML_LIBRARY_PATH
Definition: tool_summary.cpp:65
CSG_Parameter_Value::Get_Minimum
double Get_Minimum(void) const
Definition: parameters.h:440
CSG_MetaData::Set_Name
void Set_Name(const CSG_String &Name)
Definition: metadata.h:133
SG_XML_Add_Parameter
void SG_XML_Add_Parameter(CSG_MetaData *pParent, CSG_Parameter *pParameter, CSG_String ID="")
Definition: tool_summary.cpp:110
CSG_Parameter::do_UseInGUI
bool do_UseInGUI(void) const
Definition: parameter.cpp:165
CSG_Tool_Library_Manager::Get_Library
CSG_Tool_Library * Get_Library(int i) const
Definition: tool_library.h:207
PARAMETER_TYPE_DataObject_Output
@ PARAMETER_TYPE_DataObject_Output
Definition: parameters.h:161
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
SG_XML_TOOL_ATT_AUTHOR
#define SG_XML_TOOL_ATT_AUTHOR
Definition: tool_summary.cpp:72
CSG_Parameter_Choices::Get_Item
const CSG_String & Get_Item(int i) const
Definition: parameters.h:759
PARAMETER_DESCRIPTION_PROPERTIES
#define PARAMETER_DESCRIPTION_PROPERTIES
Definition: parameters.h:109
SG_File_Make_Path
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
Definition: api_file.cpp:903
SG_XML_LIBRARY_NAME
#define SG_XML_LIBRARY_NAME
Definition: tool_summary.cpp:66
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_File::Write
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
Definition: api_file.cpp:354
SG_XML_PARAM_MANDATORY
#define SG_XML_PARAM_MANDATORY
Definition: tool_summary.cpp:81
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:706
CSG_Parameter::Get_DataObject_Type
TSG_Data_Object_Type Get_DataObject_Type(void) const
Definition: parameter.cpp:518
CSG_Table::Set_Index
bool Set_Index(CSG_Index &Index, int Field, bool bAscending=true) const
Definition: table.cpp:1430
CSG_MetaData::Add_Child
CSG_MetaData * Add_Child(void)
Definition: metadata.cpp:174
CSG_MetaData::asText
CSG_String asText(int Flags=0) const
Definition: metadata.cpp:700
CSG_Table::Get_Field_Type
TSG_Data_Type Get_Field_Type(int iField) const
Definition: table.h:357
CSG_Tool::Get_Type
virtual TSG_Tool_Type Get_Type(void) const
Definition: tool.h:161
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Parameter::Get_Name
const SG_Char * Get_Name(void) const
Definition: parameter.cpp:565
PARAMETER_TYPE_Range
@ PARAMETER_TYPE_Range
Definition: parameters.h:130
CSG_Parameter::is_Option
bool is_Option(void) const
Definition: parameter.cpp:238
PARAMETER_TYPE_Parameters
@ PARAMETER_TYPE_Parameters
Definition: parameters.h:163
PARAMETER_TYPE_Font
@ PARAMETER_TYPE_Font
Definition: parameters.h:138
PARAMETER_TYPE_Color
@ PARAMETER_TYPE_Color
Definition: parameters.h:139
SG_XML_PARAM_ITEM
#define SG_XML_PARAM_ITEM
Definition: tool_summary.cpp:88
CSG_Parameter::asChoices
class CSG_Parameter_Choices * asChoices(void) const
Definition: parameter.cpp:1040
CSG_Parameter::asBool
bool asBool(void) const
Definition: parameters.h:280
CSG_Tool_Library::Get_Summary
CSG_String Get_Summary(int Format=SG_SUMMARY_FMT_HTML, bool bInteractive=true) const
Definition: tool_summary.cpp:624
PARAMETER_TYPE_Text
@ PARAMETER_TYPE_Text
Definition: parameters.h:135
Generated on Thu Oct 5 2023 17:36:12 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- _ -

  • _SAGA_DLL_EXPORT : api_core.h
  • _SAGA_DLL_IMPORT : api_core.h
  • _SG_Polygon_Clip() : shapes_polygons.cpp
  • _TL : api_core.h
  • _TOOL_EXCEPTION : tool.cpp
  • _TW : api_core.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- a -

  • A : geo_functions.cpp
  • ADD_CELL : grid_system.cpp
  • ADD_MESSAGE_EXECUTION : tool_interactive_base.cpp , tool.cpp
  • ADD_MESSAGE_TIME : tool_interactive_base.cpp
  • ADD_TO_SPLINE : grids.cpp
  • ADD_TYPE : parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- b -

  • B : geo_functions.cpp
  • BiCubicSpline : grid.cpp
  • BILINEAR_ADD : grid.cpp
  • BILINEAR_ADD_BYTE : grid.cpp
  • BOOL3_FALSE : shape_polygon.cpp
  • BOOL3_NOTSET : shape_polygon.cpp
  • BOOL3_TRUE : shape_polygon.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- c -

  • C : geo_functions.cpp
  • CACHE_FILE_POS : grid_memory.cpp
  • CACHE_FILE_SEEK : grid_memory.cpp
  • CALLBACK_DATABASE_UPDATE : api_core.h
  • CALLBACK_DATAOBJECT_ADD : api_core.h
  • CALLBACK_DATAOBJECT_ASIMAGE : api_core.h
  • CALLBACK_DATAOBJECT_COLORS_GET : api_core.h
  • CALLBACK_DATAOBJECT_COLORS_SET : api_core.h
  • CALLBACK_DATAOBJECT_PARAMS_GET : api_core.h
  • CALLBACK_DATAOBJECT_PARAMS_SET : api_core.h
  • CALLBACK_DATAOBJECT_SHOW : api_core.h
  • CALLBACK_DATAOBJECT_UPDATE : api_core.h
  • CALLBACK_DIAGRAM_SHOW : api_core.h
  • CALLBACK_DLG_CONTINUE : api_core.h
  • CALLBACK_DLG_ERROR : api_core.h
  • CALLBACK_DLG_INFO : api_core.h
  • CALLBACK_DLG_MESSAGE : api_core.h
  • CALLBACK_DLG_PARAMETERS : api_core.h
  • CALLBACK_GET_APP_PATH : api_core.h
  • CALLBACK_GET_APP_WINDOW : api_core.h
  • CALLBACK_MESSAGE_ADD : api_core.h
  • CALLBACK_MESSAGE_ADD_ERROR : api_core.h
  • CALLBACK_MESSAGE_ADD_EXECUTION : api_core.h
  • CALLBACK_PROCESS_GET_OKAY : api_core.h
  • CALLBACK_PROCESS_SET_BUSY : api_core.h
  • CALLBACK_PROCESS_SET_OKAY : api_core.h
  • CALLBACK_PROCESS_SET_PROGRESS : api_core.h
  • CALLBACK_PROCESS_SET_READY : api_core.h
  • CALLBACK_PROCESS_SET_TEXT : api_core.h
  • CALLBACK_SET_MAP_EXTENT : api_core.h
  • CALLBACK_STOP_EXECUTION : api_core.h
  • CALLBACK_WINDOW_ARRANGE : api_core.h
  • COLORS_SERIAL_VERSION__ASCII : api_colors.cpp
  • COLORS_SERIAL_VERSION_BINARY : api_colors.cpp
  • COMPARE : api_translator.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- d -

  • DATAOBJECT_CREATE : dataobject.h
  • DATAOBJECT_NOTSET : dataobject.h
  • DBF_FT_CHARACTER : table_dbase.h
  • DBF_FT_DATE : table_dbase.h
  • DBF_FT_FLOAT : table_dbase.h
  • DBF_FT_LOGICAL : table_dbase.h
  • DBF_FT_MEMO : table_dbase.h
  • DBF_FT_NONE : table_dbase.h
  • DBF_FT_NUMERIC : table_dbase.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- e -

  • EPSILON : mat_formula.cpp , mat_trend.cpp
  • ESG_Classify_Supervised : mat_tools.h
  • ESG_Cluster_Analysis_Method : mat_tools.h
  • ESG_Colors : api_core.h
  • ESG_File_Flags_Open : api_core.h
  • ESG_File_Flags_Seek : api_core.h
  • ESG_Multiple_Regression_Info_Model : mat_regression_multiple.cpp
  • ESG_Multiple_Regression_Info_Steps : mat_regression_multiple.cpp
  • ESG_Multiple_Regression_Info_Vars : mat_tools.h
  • ESG_OGIS_ByteOrder : shapes.h
  • ESG_PROJ_FIELD_ID : projections.cpp
  • ESG_Trend_String : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- f -

  • f_and() : mat_formula.cpp
  • f_atan2() : mat_formula.cpp
  • f_eq() : mat_formula.cpp
  • f_fmod() : mat_formula.cpp
  • f_gt() : mat_formula.cpp
  • f_ifelse() : mat_formula.cpp
  • f_int() : mat_formula.cpp
  • f_lt() : mat_formula.cpp
  • f_max() : mat_formula.cpp
  • f_min() : mat_formula.cpp
  • f_or() : mat_formula.cpp
  • f_pi() : mat_formula.cpp
  • f_pow() : mat_formula.cpp
  • f_rand_g() : mat_formula.cpp
  • f_rand_u() : mat_formula.cpp
  • f_sqr() : mat_formula.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- g -

  • g_App_Initialize : api_core.cpp
  • g_Data_Manager : data_manager.cpp
  • g_History_Depth : dataobject.cpp
  • g_History_Ignore_Lists : dataobject.cpp
  • g_Tool_Library_Manager : tool_library.cpp
  • GET_DATUM : projections.cpp
  • GET_GROW_SIZE : table.cpp , shape_part.cpp
  • GET_ID1 : tool.cpp
  • GET_ID2 : tool.cpp
  • Get_List_Count : tool_chain.cpp
  • Get_List_Item : tool_chain.cpp
  • GET_RECORD : table.cpp
  • GET_VALUE_BUFSIZE : mat_formula.cpp
  • GET_XML_CONTENT : tool_chain.cpp
  • GRID_FILE_FORMAT_ASCII : grid.h
  • GRID_FILE_FORMAT_Binary : grid.h
  • GRID_FILE_FORMAT_Binary_old : grid.h
  • GRID_FILE_FORMAT_Compressed : grid.h
  • GRID_FILE_FORMAT_GeoTIFF : grid.h
  • GRID_FILE_FORMAT_Undefined : grid.h
  • GRID_FILE_KEY_BYTEORDER_BIG : grid.h
  • GRID_FILE_KEY_CELLCOUNT_X : grid.h
  • GRID_FILE_KEY_CELLCOUNT_Y : grid.h
  • GRID_FILE_KEY_CELLSIZE : grid.h
  • GRID_FILE_KEY_Count : grid.h
  • GRID_FILE_KEY_DATAFILE_NAME : grid.h
  • GRID_FILE_KEY_DATAFILE_OFFSET : grid.h
  • GRID_FILE_KEY_DATAFORMAT : grid.h
  • GRID_FILE_KEY_DESCRIPTION : grid.h
  • GRID_FILE_KEY_FALSE : grid.h
  • GRID_FILE_KEY_NAME : grid.h
  • GRID_FILE_KEY_NODATA_VALUE : grid.h
  • GRID_FILE_KEY_POSITION_XMIN : grid.h
  • GRID_FILE_KEY_POSITION_YMIN : grid.h
  • GRID_FILE_KEY_TOPTOBOTTOM : grid.h
  • GRID_FILE_KEY_TRUE : grid.h
  • GRID_FILE_KEY_UNITNAME : grid.h
  • GRID_FILE_KEY_Z_FACTOR : grid.h
  • GRID_FILE_KEY_Z_OFFSET : grid.h
  • GRID_FILE_PRINT : grid_io.cpp
  • GRID_OPERATION_Addition : grid.h
  • GRID_OPERATION_Division : grid.h
  • GRID_OPERATION_Multiplication : grid.h
  • GRID_OPERATION_Subtraction : grid.h
  • GRID_PYRAMID_Arithmetic : grid_pyramid.h
  • GRID_PYRAMID_Geometric : grid_pyramid.h
  • GRID_PYRAMID_Max : grid_pyramid.h
  • GRID_PYRAMID_MaxCount : grid_pyramid.h
  • GRID_PYRAMID_Mean : grid_pyramid.h
  • GRID_PYRAMID_Min : grid_pyramid.h
  • GRID_RESAMPLING_BicubicSpline : grid.h
  • GRID_RESAMPLING_Bilinear : grid.h
  • GRID_RESAMPLING_BSpline : grid.h
  • GRID_RESAMPLING_Majority : grid.h
  • GRID_RESAMPLING_Maximum : grid.h
  • GRID_RESAMPLING_Mean_Cells : grid.h
  • GRID_RESAMPLING_Mean_Nodes : grid.h
  • GRID_RESAMPLING_Minimum : grid.h
  • GRID_RESAMPLING_NearestNeighbour : grid.h
  • GRID_RESAMPLING_Undefined : grid.h
  • GRIDS_FILE_FORMAT_Compressed : grids.h
  • GRIDS_FILE_FORMAT_GeoTIFF : grids.h
  • GRIDS_FILE_FORMAT_Normal : grids.h
  • GRIDS_FILE_FORMAT_Undefined : grids.h
  • gSG_Data_Type_Identifier : api_core.h
  • gSG_DataObject_Max_Samples : dataobject.cpp
  • gSG_Functions : mat_formula.cpp
  • gSG_Grid_Cache_Directory : grid_memory.cpp
  • gSG_Grid_Cache_Mode : grid_memory.cpp
  • gSG_Grid_Cache_Threshold : grid_memory.cpp
  • gSG_Grid_File_Format_Default : grid_io.cpp
  • gSG_Grid_File_Key_Names : grid.h
  • gSG_Projections : projections.cpp
  • gSG_Shape_File_Format_Default : shapes.cpp
  • gSG_Translator : api_translator.cpp
  • gSG_UI_Callback : api_callback.cpp
  • gSG_UI_Console_bUTF8 : api_callback.cpp
  • gSG_UI_Msg_Lock : api_callback.cpp
  • gSG_UI_Progress_Lock : api_callback.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- i -

  • INTERSECTION_Contained : geo_tools.h
  • INTERSECTION_Contains : geo_tools.h
  • INTERSECTION_Identical : geo_tools.h
  • INTERSECTION_None : geo_tools.h
  • INTERSECTION_Overlaps : geo_tools.h
  • IS_IDENTICAL : tin_triangulation.cpp
  • IS_ONLINE : tin_elements.cpp
  • IS_TRUE_PROPERTY : tool_chain.cpp
  • IS_TRUE_STRING : tool_chain.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- m -

  • M_ALMOST_ZERO : mat_tools.h
  • M_DEG_TO_RAD : mat_tools.h
  • M_EULER : mat_tools.h
  • m_Field_Size : pointcloud.cpp
  • M_GET_LENGTH : mat_tools.h
  • M_GET_MAX : mat_tools.h
  • M_GET_MIN : mat_tools.h
  • M_PI : mat_tools.h
  • M_PI_045 : mat_tools.h
  • M_PI_090 : mat_tools.h
  • M_PI_135 : mat_tools.h
  • M_PI_180 : mat_tools.h
  • M_PI_225 : mat_tools.h
  • M_PI_270 : mat_tools.h
  • M_PI_315 : mat_tools.h
  • M_PI_360 : mat_tools.h
  • m_pStream_Base : api_file.cpp
  • m_pStream_I : api_file.cpp
  • m_pStream_IO : api_file.cpp
  • m_pStream_O : api_file.cpp
  • M_RAD_TO_DEG : mat_tools.h
  • M_SET_MINMAX : mat_tools.h
  • M_SET_SIGN : mat_tools.h
  • M_SQR : mat_tools.h
  • M_SQRT : mat_tools.h
  • M_TINY : mat_tools.h
  • MAX_CTABLE : mat_formula.cpp
  • MAX_PARMS : mat_formula.cpp
  • Min_Samples : dataobject.cpp
  • MLR_MODEL_CV_MSE : mat_regression_multiple.cpp
  • MLR_MODEL_CV_NRMSE : mat_regression_multiple.cpp
  • MLR_MODEL_CV_NSAMPLES : mat_regression_multiple.cpp
  • MLR_MODEL_CV_R2 : mat_regression_multiple.cpp
  • MLR_MODEL_CV_RMSE : mat_regression_multiple.cpp
  • MLR_MODEL_F : mat_regression_multiple.cpp
  • MLR_MODEL_MSE : mat_regression_multiple.cpp
  • MLR_MODEL_MSR : mat_regression_multiple.cpp
  • MLR_MODEL_NPREDICT : mat_regression_multiple.cpp
  • MLR_MODEL_NSAMPLES : mat_regression_multiple.cpp
  • MLR_MODEL_R2 : mat_regression_multiple.cpp
  • MLR_MODEL_R2_ADJ : mat_regression_multiple.cpp
  • MLR_MODEL_SE : mat_regression_multiple.cpp
  • MLR_MODEL_SIG : mat_regression_multiple.cpp
  • MLR_MODEL_SSE : mat_regression_multiple.cpp
  • MLR_MODEL_SSR : mat_regression_multiple.cpp
  • MLR_MODEL_SST : mat_regression_multiple.cpp
  • MLR_STEP_DF : mat_regression_multiple.cpp
  • MLR_STEP_DIR : mat_regression_multiple.cpp
  • MLR_STEP_F : mat_regression_multiple.cpp
  • MLR_STEP_MSE : mat_regression_multiple.cpp
  • MLR_STEP_MSR : mat_regression_multiple.cpp
  • MLR_STEP_NR : mat_regression_multiple.cpp
  • MLR_STEP_R : mat_regression_multiple.cpp
  • MLR_STEP_R2 : mat_regression_multiple.cpp
  • MLR_STEP_R2_ADJ : mat_regression_multiple.cpp
  • MLR_STEP_SE : mat_regression_multiple.cpp
  • MLR_STEP_SIG : mat_regression_multiple.cpp
  • MLR_STEP_SSE : mat_regression_multiple.cpp
  • MLR_STEP_SSR : mat_regression_multiple.cpp
  • MLR_STEP_VAR : mat_regression_multiple.cpp
  • MLR_STEP_VAR_F : mat_regression_multiple.cpp
  • MLR_STEP_VAR_SIG : mat_regression_multiple.cpp
  • MLR_VAR_ID : mat_tools.h
  • MLR_VAR_NAME : mat_tools.h
  • MLR_VAR_P : mat_tools.h
  • MLR_VAR_R : mat_tools.h
  • MLR_VAR_R2 : mat_tools.h
  • MLR_VAR_R2_ADJ : mat_tools.h
  • MLR_VAR_RCOEFF : mat_tools.h
  • MLR_VAR_SE : mat_tools.h
  • MLR_VAR_SIG : mat_tools.h
  • MLR_VAR_T : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- n -

  • N_MEGABYTE_BYTES : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- o -

  • operator*() : mat_matrix.cpp , mat_tools.h
  • operator+() : api_string.cpp , api_core.h , api_string.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- p -

  • PARAMETER_CHECK_ALL : parameters.h
  • PARAMETER_CHECK_ENABLE : parameters.h
  • PARAMETER_CHECK_VALUES : parameters.h
  • PARAMETER_DESCRIPTION_ALL : parameters.h
  • PARAMETER_DESCRIPTION_NAME : parameters.h
  • PARAMETER_DESCRIPTION_OPTIONAL : parameters.h
  • PARAMETER_DESCRIPTION_PROPERTIES : parameters.h
  • PARAMETER_DESCRIPTION_TEXT : parameters.h
  • PARAMETER_DESCRIPTION_TYPE : parameters.h
  • PARAMETER_IGNORE_PROJECTION : parameters.h
  • PARAMETER_INFORMATION : parameters.h
  • PARAMETER_INPUT : parameters.h
  • PARAMETER_INPUT_OPTIONAL : parameters.h
  • PARAMETER_NOT_FOR_CMD : parameters.h
  • PARAMETER_NOT_FOR_GUI : parameters.h
  • PARAMETER_OPTIONAL : parameters.h
  • PARAMETER_OUTPUT : parameters.h
  • PARAMETER_OUTPUT_OPTIONAL : parameters.h
  • PARAMETER_TYPE_Bool : parameters.h
  • PARAMETER_TYPE_Choice : parameters.h
  • PARAMETER_TYPE_Choices : parameters.h
  • PARAMETER_TYPE_Color : parameters.h
  • PARAMETER_TYPE_Colors : parameters.h
  • PARAMETER_TYPE_Data_Type : parameters.h
  • PARAMETER_TYPE_DataObject_Output : parameters.h
  • PARAMETER_TYPE_Date : parameters.h
  • PARAMETER_TYPE_Degree : parameters.h
  • PARAMETER_TYPE_Double : parameters.h
  • PARAMETER_TYPE_FilePath : parameters.h
  • PARAMETER_TYPE_FixedTable : parameters.h
  • PARAMETER_TYPE_Font : parameters.h
  • PARAMETER_TYPE_Grid : parameters.h
  • PARAMETER_TYPE_Grid_List : parameters.h
  • PARAMETER_TYPE_Grid_System : parameters.h
  • PARAMETER_TYPE_Grids : parameters.h
  • PARAMETER_TYPE_Grids_List : parameters.h
  • PARAMETER_TYPE_Int : parameters.h
  • PARAMETER_TYPE_Node : parameters.h
  • PARAMETER_TYPE_Parameters : parameters.h
  • PARAMETER_TYPE_PointCloud : parameters.h
  • PARAMETER_TYPE_PointCloud_List : parameters.h
  • PARAMETER_TYPE_Range : parameters.h
  • PARAMETER_TYPE_Shapes : parameters.h
  • PARAMETER_TYPE_Shapes_List : parameters.h
  • PARAMETER_TYPE_String : parameters.h
  • PARAMETER_TYPE_Table : parameters.h
  • PARAMETER_TYPE_Table_Field : parameters.h
  • PARAMETER_TYPE_Table_Fields : parameters.h
  • PARAMETER_TYPE_Table_List : parameters.h
  • PARAMETER_TYPE_Text : parameters.h
  • PARAMETER_TYPE_TIN : parameters.h
  • PARAMETER_TYPE_TIN_List : parameters.h
  • PARAMETER_TYPE_Undefined : parameters.h
  • PC_DAT_NBYTES : pointcloud.cpp
  • PC_FILE_VERSION : pointcloud.cpp
  • PC_GET_NBYTES : pointcloud.cpp
  • PC_STR_NBYTES : pointcloud.cpp
  • POINTCLOUD_FILE_FORMAT_Compressed : pointcloud.h
  • POINTCLOUD_FILE_FORMAT_Normal : pointcloud.h
  • POINTCLOUD_FILE_FORMAT_Undefined : pointcloud.h
  • PRJ_FIELD_AUTH_NAME : projections.cpp
  • PRJ_FIELD_AUTH_SRID : projections.cpp
  • PRJ_FIELD_PROJ4TEXT : projections.cpp
  • PRJ_FIELD_SRID : projections.cpp
  • PRJ_FIELD_SRTEXT : projections.cpp
  • PROJ4_GCS_WGS84 : projections.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- r -

  • REGRESSION_CORR_Claudy_3 : mat_tools.h
  • REGRESSION_CORR_None : mat_tools.h
  • REGRESSION_CORR_Olkin_Pratt : mat_tools.h
  • REGRESSION_CORR_Pratt : mat_tools.h
  • REGRESSION_CORR_Smith : mat_tools.h
  • REGRESSION_CORR_Wherry_1 : mat_tools.h
  • REGRESSION_CORR_Wherry_2 : mat_tools.h
  • REGRESSION_Exp : mat_tools.h
  • REGRESSION_Linear : mat_tools.h
  • REGRESSION_Log : mat_tools.h
  • REGRESSION_Pow : mat_tools.h
  • REGRESSION_Rez_X : mat_tools.h
  • REGRESSION_Rez_Y : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- s -

  • SAGA_API_DLL_EXPORT : api_core.h
  • SAGA_API_Get_Version() : saga_api.cpp , saga_api.h
  • SAGA_MAJOR_VERSION : saga_api.h
  • SAGA_MINOR_VERSION : saga_api.h
  • SAGA_RELEASE_NUMBER : saga_api.h
  • SAGA_VERSION : saga_api.h
  • SEPARATE : parameter.cpp
  • SERVER_TRIM : metadata.cpp
  • Set_Content_Length : shapes_io.cpp
  • SG_Add_Dll_Paths() : api_core.cpp
  • SG_Calloc() : api_core.h , api_memory.cpp
  • SG_Char : api_core.h
  • SG_CLASSIFY_SUPERVISED_BinaryEncoding : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_Mahalonobis : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_MaximumLikelihood : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_MinimumDistance : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_ParallelEpiped : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SAM : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SID : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SVM : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_WTA : mat_tools.h
  • SG_Clipper_Get_Version() : shapes.h , shapes_clipper.cpp , shapes_polygons.cpp
  • SG_CLUSTERANALYSIS_Combined : mat_tools.h
  • SG_CLUSTERANALYSIS_Hill_Climbing : mat_tools.h
  • SG_CLUSTERANALYSIS_Minimum_Distance : mat_tools.h
  • SG_COLOR_BLACK : api_core.h
  • SG_COLOR_BLUE : api_core.h
  • SG_COLOR_BLUE_DARK : api_core.h
  • SG_COLOR_BLUE_GREEN : api_core.h
  • SG_COLOR_BLUE_LIGHT : api_core.h
  • SG_Color_From_Text() : api_colors.cpp , api_core.h
  • SG_Color_Get_Random() : api_colors.cpp , api_core.h
  • SG_COLOR_GREEN : api_core.h
  • SG_COLOR_GREEN_DARK : api_core.h
  • SG_COLOR_GREEN_LIGHT : api_core.h
  • SG_COLOR_GREY : api_core.h
  • SG_COLOR_GREY_LIGHT : api_core.h
  • SG_COLOR_NONE : api_core.h
  • SG_COLOR_PINK : api_core.h
  • SG_COLOR_PURPLE : api_core.h
  • SG_COLOR_RANDOM : api_core.h
  • SG_COLOR_RED : api_core.h
  • SG_COLOR_RED_DARK : api_core.h
  • SG_Color_To_Text() : api_colors.cpp , api_core.h
  • SG_COLOR_WHITE : api_core.h
  • SG_COLOR_YELLOW : api_core.h
  • SG_COLOR_YELLOW_DARK : api_core.h
  • SG_COLORS_ASPECT_1 : api_core.h
  • SG_COLORS_ASPECT_2 : api_core.h
  • SG_COLORS_ASPECT_3 : api_core.h
  • SG_COLORS_BLACK_BLUE : api_core.h
  • SG_COLORS_BLACK_GREEN : api_core.h
  • SG_COLORS_BLACK_RED : api_core.h
  • SG_COLORS_BLACK_WHITE : api_core.h
  • SG_COLORS_COUNT : api_core.h
  • SG_COLORS_DEFAULT : api_core.h
  • SG_COLORS_DEFAULT_BRIGHT : api_core.h
  • SG_Colors_Get_Name() : api_colors.cpp , api_core.h
  • SG_COLORS_GREEN_BLUE : api_core.h
  • SG_COLORS_GREEN_GREY_BLUE : api_core.h
  • SG_COLORS_GREEN_RED : api_core.h
  • SG_COLORS_GREEN_RED_BLUE : api_core.h
  • SG_COLORS_NEON : api_core.h
  • SG_COLORS_PRECIPITATION : api_core.h
  • SG_COLORS_RAINBOW : api_core.h
  • SG_COLORS_RED_BLUE : api_core.h
  • SG_COLORS_RED_BLUE_GREEN : api_core.h
  • SG_COLORS_RED_GREEN : api_core.h
  • SG_COLORS_RED_GREEN_BLUE : api_core.h
  • SG_COLORS_RED_GREY_BLUE : api_core.h
  • SG_COLORS_RED_GREY_GREEN : api_core.h
  • SG_COLORS_TOPOGRAPHY : api_core.h
  • SG_COLORS_TOPOGRAPHY_2 : api_core.h
  • SG_COLORS_TOPOGRAPHY_3 : api_core.h
  • SG_COLORS_WHITE_BLUE : api_core.h
  • SG_COLORS_WHITE_GREEN : api_core.h
  • SG_COLORS_WHITE_RED : api_core.h
  • SG_COLORS_YELLOW_BLUE : api_core.h
  • SG_COLORS_YELLOW_GREEN : api_core.h
  • SG_COLORS_YELLOW_RED : api_core.h
  • SG_Compare_Char_Ptr() : mat_tools.cpp , mat_tools.h
  • SG_Compare_Double() : mat_tools.cpp , mat_tools.h
  • SG_Compare_Int() : mat_tools.cpp , mat_tools.h
  • SG_Compare_SAGA_Version() : saga_api.cpp , saga_api.h
  • SG_Compare_Version() : saga_api.cpp , saga_api.h
  • SG_Create_Grid() : grid.cpp , grid.h
  • SG_Create_Grids() : grids.h , grids.cpp
  • SG_Create_PointCloud() : pointcloud.cpp , pointcloud.h
  • SG_Create_Shapes() : shapes.cpp , shapes.h
  • SG_Create_Table() : table.cpp , table.h
  • SG_Create_TIN() : tin.cpp , tin.h
  • SG_Data_Type_Get_Flag() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Identifier() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Name() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Size() : api_core.h
  • SG_Data_Type_Get_Type() : api_core.cpp , api_core.h
  • SG_Data_Type_is_Numeric() : api_core.cpp , api_core.h
  • SG_Data_Type_Range_Check() : api_core.cpp , api_core.h
  • SG_DataObject_Get_Max_Samples() : dataobject.cpp , dataobject.h
  • SG_DataObject_Set_Max_Samples() : dataobject.cpp , dataobject.h
  • SG_DATAOBJECT_TYPE_Grid : dataobject.h
  • SG_DATAOBJECT_TYPE_Grids : dataobject.h
  • SG_DATAOBJECT_TYPE_PointCloud : dataobject.h
  • SG_DATAOBJECT_TYPE_Shapes : dataobject.h
  • SG_DATAOBJECT_TYPE_Table : dataobject.h
  • SG_DATAOBJECT_TYPE_TIN : dataobject.h
  • SG_DATAOBJECT_TYPE_Undefined : dataobject.h
  • SG_DATATYPE_Binary : api_core.h
  • SG_DATATYPE_Bit : api_core.h
  • SG_DATATYPE_Byte : api_core.h
  • SG_DATATYPE_Char : api_core.h
  • SG_DATATYPE_Color : api_core.h
  • SG_DATATYPE_Date : api_core.h
  • SG_DATATYPE_Double : api_core.h
  • SG_DATATYPE_DWord : api_core.h
  • SG_DATATYPE_Float : api_core.h
  • SG_DATATYPE_Int : api_core.h
  • SG_DATATYPE_Long : api_core.h
  • SG_DATATYPE_Short : api_core.h
  • SG_DATATYPE_String : api_core.h
  • SG_DATATYPE_ULong : api_core.h
  • SG_DATATYPE_Undefined : api_core.h
  • SG_DATATYPE_Word : api_core.h
  • SG_DATATYPES_Binary : api_core.h
  • SG_DATATYPES_Bit : api_core.h
  • SG_DATATYPES_Byte : api_core.h
  • SG_DATATYPES_Char : api_core.h
  • SG_DATATYPES_Color : api_core.h
  • SG_DATATYPES_Date : api_core.h
  • SG_DATATYPES_Double : api_core.h
  • SG_DATATYPES_DWord : api_core.h
  • SG_DATATYPES_Float : api_core.h
  • SG_DATATYPES_Int : api_core.h
  • SG_DATATYPES_Integer : api_core.h
  • SG_DATATYPES_Long : api_core.h
  • SG_DATATYPES_Numeric : api_core.h
  • SG_DATATYPES_Real : api_core.h
  • SG_DATATYPES_Short : api_core.h
  • SG_DATATYPES_SInteger : api_core.h
  • SG_DATATYPES_Standard : api_core.h
  • SG_DATATYPES_String : api_core.h
  • SG_DATATYPES_Table : api_core.h
  • SG_DATATYPES_UInteger : api_core.h
  • SG_DATATYPES_ULong : api_core.h
  • SG_DATATYPES_Undefined : api_core.h
  • SG_DATATYPES_Word : api_core.h
  • SG_Date_To_JulianDayNumber() : datetime.cpp , datetime.h
  • SG_Decimal_To_Degree() : mat_tools.cpp , mat_tools.h
  • SG_DEFAULT_DELIMITERS : api_core.h
  • SG_Degree_To_Decimal() : mat_tools.cpp , mat_tools.h
  • SG_Degree_To_Double() : api_core.h , api_string.cpp
  • SG_DELETE_ARRAY : api_core.h
  • SG_DELETE_SAFE : api_core.h
  • SG_Dir_Create() : api_core.h , api_file.cpp
  • SG_Dir_Delete() : api_core.h , api_file.cpp
  • SG_Dir_Exists() : api_core.h , api_file.cpp
  • SG_Dir_Get_Current() : api_core.h , api_file.cpp
  • SG_Dir_Get_Temp() : api_core.h , api_file.cpp
  • SG_Dir_List_Files() : api_core.h , api_file.cpp
  • SG_Dir_List_Subdirectories() : api_core.h , api_file.cpp
  • SG_DISTWGHT_EXP : geo_tools.h
  • SG_DISTWGHT_GAUSS : geo_tools.h
  • SG_DISTWGHT_IDW : geo_tools.h
  • SG_DISTWGHT_None : geo_tools.h
  • SG_Double_To_Degree() : api_core.h , api_string.cpp
  • SG_File_Cmp_Extension() : api_core.h , api_file.cpp
  • SG_FILE_CURRENT : api_core.h
  • SG_File_Delete() : api_core.h , api_file.cpp
  • SG_FILE_ENCODING_ANSI : api_core.h
  • SG_FILE_ENCODING_UNDEFINED : api_core.h
  • SG_FILE_ENCODING_UTF16BE : api_core.h
  • SG_FILE_ENCODING_UTF16LE : api_core.h
  • SG_FILE_ENCODING_UTF32BE : api_core.h
  • SG_FILE_ENCODING_UTF32LE : api_core.h
  • SG_FILE_ENCODING_UTF7 : api_core.h
  • SG_FILE_ENCODING_UTF8 : api_core.h
  • SG_FILE_END : api_core.h
  • SG_File_Exists() : api_core.h , api_file.cpp
  • SG_File_Get_Extension() : api_core.h , api_file.cpp
  • SG_File_Get_Name() : api_core.h , api_file.cpp
  • SG_File_Get_Name_Temp() : api_core.h , api_file.cpp
  • SG_File_Get_Path() : api_core.h , api_file.cpp
  • SG_File_Get_Path_Absolute() : api_core.h , api_file.cpp
  • SG_File_Get_Path_Relative() : api_core.h , api_file.cpp
  • SG_File_Make_Path() : api_core.h , api_file.cpp
  • SG_FILE_R : api_core.h
  • SG_FILE_RW : api_core.h
  • SG_File_Set_Extension() : api_core.h , api_file.cpp
  • SG_FILE_START : api_core.h
  • SG_FILE_TYPE_NORMAL : api_core.h
  • SG_FILE_TYPE_ZIP : api_core.h
  • SG_FILE_W : api_core.h
  • SG_Flip_Decimal_Separators() : api_core.h , api_string.cpp
  • SG_FPRINTF : api_core.h
  • SG_Free() : api_core.h , api_memory.cpp
  • SG_FREE_SAFE : api_core.h
  • SG_FTP_Download() : metadata.cpp , metadata.h
  • SG_GET_A : api_core.h
  • SG_Get_Angle_Difference() : geo_functions.cpp , geo_tools.h
  • SG_Get_Angle_Of_Direction() : geo_functions.cpp , geo_tools.h
  • SG_GET_B : api_core.h
  • SG_GET_BYTE_0 : api_core.h
  • SG_GET_BYTE_1 : api_core.h
  • SG_GET_BYTE_2 : api_core.h
  • SG_GET_BYTE_3 : api_core.h
  • SG_Get_Correlation_Matrix() : mat_tools.cpp , mat_tools.h
  • SG_Get_Create_Pointer() : dataobject.cpp , dataobject.h
  • SG_Get_Crossing() : geo_functions.cpp , geo_tools.h
  • SG_Get_Crossing_InRegion() : geo_functions.cpp , geo_tools.h
  • SG_Get_CurrentTimeStr() : api_core.h , api_string.cpp
  • SG_Get_Data_Manager() : data_manager.cpp , data_manager.h
  • SG_Get_DataObject_Class_Name() : dataobject.cpp , dataobject.h
  • SG_Get_DataObject_Identifier() : dataobject.cpp , dataobject.h
  • SG_Get_DataObject_Name() : dataobject.cpp , dataobject.h
  • SG_Get_Day_Length() : datetime.cpp , datetime.h
  • SG_Get_Day_MidOfMonth() : datetime.cpp , datetime.h
  • SG_Get_Digit_Count() : mat_tools.cpp , mat_tools.h
  • SG_Get_Distance() : geo_functions.cpp , geo_tools.h
  • SG_Get_Distance_Polar() : geo_functions.cpp , geo_tools.h
  • SG_Get_Distance_To_Line() : geo_functions.cpp , geo_tools.h
  • SG_Get_Double_asString() : mat_tools.cpp , mat_tools.h
  • SG_Get_Environment() : api_core.h , api_file.cpp
  • SG_GET_G : api_core.h
  • SG_Get_History_Depth() : dataobject.cpp , dataobject.h
  • SG_Get_History_Ignore_Lists() : dataobject.cpp , dataobject.h
  • SG_Get_Length() : geo_functions.cpp , geo_tools.h
  • SG_GET_LONG : api_core.h
  • SG_Get_Nearest_Point_On_Line() : geo_functions.cpp , geo_tools.h
  • SG_Get_Polygon_Area() : geo_functions.cpp , geo_tools.h
  • SG_Get_Projected() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type_Identifier() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type_Name() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_Identifier() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_Name() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_To_Meter() : geo_tools.h , projections.cpp
  • SG_Get_Projections() : geo_tools.h , projections.cpp
  • SG_GET_R : api_core.h
  • SG_GET_RGB : api_core.h
  • SG_GET_RGBA : api_core.h
  • SG_Get_Rounded() : mat_tools.cpp , mat_tools.h
  • SG_Get_Rounded_To_SignificantFigures() : mat_tools.cpp , mat_tools.h
  • SG_Get_ShapeType_Name() : shapes.cpp , shapes.h
  • SG_Get_Significant_Decimals() : api_core.h , api_string.cpp
  • SG_Get_Square() : mat_tools.cpp , mat_tools.h
  • SG_Get_String() : api_core.h , api_string.cpp
  • SG_Get_Sun_Position() : datetime.cpp , datetime.h
  • SG_Get_Tool_Library_Manager() : tool_library.cpp , tool_library.h
  • SG_Get_Translator() : api_core.h , api_translator.cpp
  • SG_Get_Triangle_CircumCircle() : geo_functions.cpp , geo_tools.h
  • SG_Get_UI_Callback() : api_callback.cpp , api_core.h
  • SG_GET_XML_TAGGED_FLT : tool_summary.cpp
  • SG_GET_XML_TAGGED_INT : tool_summary.cpp
  • SG_GET_XML_TAGGED_STR : tool_summary.cpp
  • SG_Grid_Cache_Get_Directory() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Mode() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Threshold() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Threshold_MB() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Directory() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Mode() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Threshold() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Threshold_MB() : grid.h , grid_memory.cpp
  • SG_Grid_Get_File_Extension_Default() : grid.h , grid_io.cpp
  • SG_Grid_Get_File_Format_Default() : grid.h , grid_io.cpp
  • SG_Grid_Get_Geographic_Coordinates() : geo_tools.h , projections.cpp
  • SG_GRID_HISTOGRAM_CLASSES_DEFAULT : grid.cpp , grids.cpp
  • SG_GRID_PTR_SAFE_SET_NODATA : grid.h
  • SG_GRID_PTR_SAFE_SET_VALUE : grid.h
  • SG_Grid_Set_File_Format_Default() : grid.h , grid_io.cpp
  • SG_GRIDCELLADDR_PARM_ANNULUS : grid.h
  • SG_GRIDCELLADDR_PARM_CIRCLE : grid.h
  • SG_GRIDCELLADDR_PARM_DEFAULT : grid.h
  • SG_GRIDCELLADDR_PARM_MAPUNIT : grid.h
  • SG_GRIDCELLADDR_PARM_SECTOR : grid.h
  • SG_GRIDCELLADDR_PARM_SIZEDBL : grid.h
  • SG_GRIDCELLADDR_PARM_SQUARE : grid.h
  • SG_GRIDCELLADDR_PARM_WEIGHTING : grid.h
  • SG_GRIDS_NAME_GRID : grids.h
  • SG_GRIDS_NAME_INDEX : grids.h
  • SG_GRIDS_NAME_OWNER : grids.h
  • SG_GRIDS_NAME_VALUE : grids.h
  • SG_GRIDS_PTR_SAFE_SET_NODATA : grids.h
  • SG_GRIDS_PTR_SAFE_SET_VALUE : grids.h
  • SG_Hex_to_Byte() : api_memory.cpp
  • SG_INDEX_SWAP : mat_indexing.cpp
  • SG_Initialize_Environment() : api_core.cpp , api_core.h
  • SG_is_Angle_Between() : geo_tools.h , geo_functions.cpp
  • SG_Is_Between() : geo_functions.cpp , geo_tools.h
  • SG_IS_BETWEEN : geo_tools.h
  • SG_Is_Between() : geo_tools.h
  • SG_is_Character_Numeric() : api_core.h , api_string.cpp
  • SG_Is_Equal() : geo_functions.cpp , geo_tools.h
  • SG_is_NaN : api_core.h
  • SG_Is_Point_On_Line() : geo_functions.cpp , geo_tools.h
  • SG_JulianDayNumber_To_Date() : datetime.cpp , datetime.h , datetime.cpp
  • SG_Malloc() : api_core.h , api_memory.cpp
  • SG_Matrix_Eigen_Reduction() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_Get_Rotation() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_LU_Decomposition() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_LU_Solve() : mat_tools.h , mat_matrix.cpp
  • SG_Matrix_Solve() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_Triangular_Decomposition() : mat_matrix.cpp
  • SG_Matrix_Tridiagonal_QL() : mat_matrix.cpp
  • SG_Mem_Get_Double() : api_core.h , api_memory.cpp
  • SG_Mem_Get_Int() : api_core.h , api_memory.cpp
  • SG_Mem_Set_Double() : api_core.h , api_memory.cpp
  • SG_Mem_Set_Int() : api_memory.cpp , api_core.h
  • SG_META_DATABASE : dataobject.h
  • SG_META_FILEPATH : dataobject.h
  • SG_META_HISTORY : dataobject.h
  • SG_META_PROJECTION : dataobject.h
  • SG_META_SOURCE : dataobject.h
  • SG_OGIS_BYTEORDER_NDR : shapes.h
  • SG_OGIS_BYTEORDER_XDR : shapes.h
  • SG_OGIS_TYPE_GeometryCollection : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionM : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionZ : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionZM : shapes.h
  • SG_OGIS_TYPE_LineString : shapes.h
  • SG_OGIS_TYPE_LineStringM : shapes.h
  • SG_OGIS_TYPE_LineStringZ : shapes.h
  • SG_OGIS_TYPE_LineStringZM : shapes.h
  • SG_OGIS_TYPE_MultiLineString : shapes.h
  • SG_OGIS_TYPE_MultiLineStringM : shapes.h
  • SG_OGIS_TYPE_MultiLineStringZ : shapes.h
  • SG_OGIS_TYPE_MultiLineStringZM : shapes.h
  • SG_OGIS_TYPE_MultiPoint : shapes.h
  • SG_OGIS_TYPE_MultiPointM : shapes.h
  • SG_OGIS_TYPE_MultiPointZ : shapes.h
  • SG_OGIS_TYPE_MultiPointZM : shapes.h
  • SG_OGIS_TYPE_MultiPolygon : shapes.h
  • SG_OGIS_TYPE_MultiPolygonM : shapes.h
  • SG_OGIS_TYPE_MultiPolygonZ : shapes.h
  • SG_OGIS_TYPE_MultiPolygonZM : shapes.h
  • SG_OGIS_TYPE_Point : shapes.h
  • SG_OGIS_TYPE_PointM : shapes.h
  • SG_OGIS_TYPE_PointZ : shapes.h
  • SG_OGIS_TYPE_PointZM : shapes.h
  • SG_OGIS_TYPE_Polygon : shapes.h
  • SG_OGIS_TYPE_PolygonM : shapes.h
  • SG_OGIS_TYPE_PolygonZ : shapes.h
  • SG_OGIS_TYPE_PolygonZM : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurface : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceM : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceZ : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceZM : shapes.h
  • SG_OGIS_TYPE_TIN : shapes.h
  • SG_OGIS_TYPE_TINM : shapes.h
  • SG_OGIS_TYPE_TINZ : shapes.h
  • SG_OGIS_TYPE_TINZM : shapes.h
  • SG_OGIS_TYPE_Triangle : shapes.h
  • SG_OGIS_TYPE_TriangleM : shapes.h
  • SG_OGIS_TYPE_TriangleZ : shapes.h
  • SG_OGIS_TYPE_TriangleZM : shapes.h
  • SG_OGIS_TYPE_Undefined : shapes.h
  • SG_OMP_Get_Max_Num_Procs() : api_core.cpp , api_core.h
  • SG_OMP_Get_Max_Num_Threads() : api_core.h , api_core.cpp
  • SG_OMP_Get_Thread_Num() : api_core.cpp , api_core.h
  • SG_OMP_Set_Max_Num_Threads() : api_core.h , api_core.cpp
  • SG_PARAMETER_DATA_SET_CHANGED : parameters.h
  • SG_PARAMETER_DATA_SET_FALSE : parameters.h
  • SG_PARAMETER_DATA_SET_TRUE : parameters.h
  • SG_Parameter_Type_Get_Identifier() : parameter_data.cpp , parameters.h
  • SG_Parameter_Type_Get_Name() : parameter_data.cpp , parameters.h
  • SG_Parameter_Type_Get_Type() : parameter_data.cpp , parameters.h
  • SG_POLYGON_POINT_Edge : shapes.h
  • SG_POLYGON_POINT_Interior : shapes.h
  • SG_POLYGON_POINT_Outside : shapes.h
  • SG_POLYGON_POINT_Vertex : shapes.h
  • SG_PRINTF : api_core.h
  • SG_PROJ_FMT_EPSG : geo_tools.h
  • SG_PROJ_FMT_Proj4 : geo_tools.h
  • SG_PROJ_FMT_Undefined : geo_tools.h
  • SG_PROJ_FMT_WKT : geo_tools.h
  • SG_PROJ_TYPE_CS_Geocentric : geo_tools.h
  • SG_PROJ_TYPE_CS_Geographic : geo_tools.h
  • SG_PROJ_TYPE_CS_Projected : geo_tools.h
  • SG_PROJ_TYPE_CS_Undefined : geo_tools.h
  • SG_PROJ_UNIT_Centimeter : geo_tools.h
  • SG_PROJ_UNIT_Decimeter : geo_tools.h
  • SG_PROJ_UNIT_Indian_Chain : geo_tools.h
  • SG_PROJ_UNIT_Indian_Foot : geo_tools.h
  • SG_PROJ_UNIT_Indian_Yard : geo_tools.h
  • SG_PROJ_UNIT_Int_Chain : geo_tools.h
  • SG_PROJ_UNIT_Int_Fathom : geo_tools.h
  • SG_PROJ_UNIT_Int_Foot : geo_tools.h
  • SG_PROJ_UNIT_Int_Inch : geo_tools.h
  • SG_PROJ_UNIT_Int_Link : geo_tools.h
  • SG_PROJ_UNIT_Int_Nautical_Mile : geo_tools.h
  • SG_PROJ_UNIT_Int_Statute_Mile : geo_tools.h
  • SG_PROJ_UNIT_Int_Yard : geo_tools.h
  • SG_PROJ_UNIT_Kilometer : geo_tools.h
  • SG_PROJ_UNIT_Meter : geo_tools.h
  • SG_PROJ_UNIT_Millimeter : geo_tools.h
  • SG_PROJ_UNIT_Undefined : geo_tools.h
  • SG_PROJ_UNIT_US_Chain : geo_tools.h
  • SG_PROJ_UNIT_US_Foot : geo_tools.h
  • SG_PROJ_UNIT_US_Inch : geo_tools.h
  • SG_PROJ_UNIT_US_Statute_Mile : geo_tools.h
  • SG_PROJ_UNIT_US_Yard : geo_tools.h
  • SG_Projection_Units : projections.cpp
  • SG_Realloc() : api_core.h , api_memory.cpp
  • SG_Regression_Get_Adjusted_R2() : mat_regression.cpp , mat_tools.h
  • SG_ROUND_TO_BYTE : mat_tools.h
  • SG_ROUND_TO_CHAR : mat_tools.h
  • SG_ROUND_TO_DWORD : mat_tools.h
  • SG_ROUND_TO_INT : mat_tools.h
  • SG_ROUND_TO_LONG : mat_tools.h
  • SG_ROUND_TO_SHORT : mat_tools.h
  • SG_ROUND_TO_SLONG : mat_tools.h
  • SG_ROUND_TO_ULONG : mat_tools.h
  • SG_ROUND_TO_WORD : mat_tools.h
  • SG_RUN_TOOL : tool_library.h
  • SG_RUN_TOOL_ExitOnError : tool_library.h
  • SG_RUN_TOOL_KEEP_PARMS : tool_library.h
  • SG_RUN_TOOL_KEEP_PARMS_ExitOnError : tool_library.h
  • SG_Set_Environment() : api_core.h , api_file.cpp
  • SG_Set_History_Depth() : dataobject.h , dataobject.cpp
  • SG_Set_History_Ignore_Lists() : dataobject.h , dataobject.cpp
  • SG_Set_Projection_Unit() : projections.cpp
  • SG_Set_UI_Callback() : api_callback.cpp , api_core.h
  • SG_Shape_Get_Difference() : shapes_clipper.cpp , shapes.h , shapes_polygons.cpp
  • SG_Shape_Get_Dissolve() : shapes_polygons.cpp , shapes_clipper.cpp , shapes.h
  • SG_Shape_Get_ExclusiveOr() : shapes.h , shapes_polygons.cpp , shapes_clipper.cpp
  • SG_Shape_Get_Intersection() : shapes.h , shapes_clipper.cpp , shapes_polygons.cpp
  • SG_Shape_Get_Offset() : shapes_polygons.cpp , shapes_clipper.cpp , shapes.h
  • SG_Shape_Get_Union() : shapes_polygons.cpp , shapes_clipper.cpp , shapes.h
  • SG_Shapes_Get_File_Extension_Default() : shapes.cpp , shapes.h
  • SG_Shapes_Get_File_Format_Default() : shapes.cpp , shapes.h
  • SG_Shapes_Set_File_Format_Default() : shapes.cpp , shapes.h
  • SG_SSCANF : api_core.h
  • SG_STR_CMP : api_core.h
  • SG_STR_CPY : api_core.h
  • SG_STR_LEN : api_core.h
  • SG_STR_MBTOSG : api_core.h
  • SG_STR_TOD : api_core.h
  • SG_String_Tokenize() : api_string.cpp , api_core.h
  • SG_SUMMARY_FMT_FLAT : tool.h
  • SG_SUMMARY_FMT_HTML : tool.h
  • SG_SUMMARY_FMT_XML : tool.h
  • SG_Swap_Bytes() : api_memory.cpp , api_core.h
  • SG_T : api_core.h
  • SG_TABLE_REC_FLAG_Modified : table.h
  • SG_TABLE_REC_FLAG_Selected : table.h
  • SG_TABLE_VALUE_TYPE_Binary : table_value.h
  • SG_TABLE_VALUE_TYPE_Date : table_value.h
  • SG_TABLE_VALUE_TYPE_Double : table_value.h
  • SG_TABLE_VALUE_TYPE_Int : table_value.h
  • SG_TABLE_VALUE_TYPE_Long : table_value.h
  • SG_TABLE_VALUE_TYPE_String : table_value.h
  • SG_TIN_Compare() : tin_triangulation.cpp
  • SG_TIN_Compare_Triangle_Center() : tin_elements.cpp
  • SG_TOKEN_DEFAULT : api_core.h
  • SG_TOKEN_INVALID : api_core.h
  • SG_TOKEN_RET_DELIMS : api_core.h
  • SG_TOKEN_RET_EMPTY : api_core.h
  • SG_TOKEN_RET_EMPTY_ALL : api_core.h
  • SG_TOKEN_STRTOK : api_core.h
  • SG_TOOL_PARAMETER_SET : tool_library.h
  • SG_TOOL_PARAMLIST_ADD : tool_library.h
  • SG_TOOL_SET_DATAOBJECT_LIST : tool_library.h
  • SG_Translate() : api_translator.cpp , api_core.h
  • SG_TREND_STRING_Compact : mat_tools.h
  • SG_TREND_STRING_Complete : mat_tools.h
  • SG_TREND_STRING_Formula : mat_tools.h
  • SG_TREND_STRING_Formula_Parameters : mat_tools.h
  • SG_TREND_STRING_Function : mat_tools.h
  • SG_UI_Console_Get_UTF8() : api_callback.cpp , api_core.h
  • SG_UI_Console_Print_StdErr() : api_callback.cpp , api_core.h , api_callback.cpp
  • SG_UI_Console_Print_StdOut() : api_callback.cpp , api_core.h , api_callback.cpp
  • SG_UI_Console_Set_UTF8() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_Add() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_asImage() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_Colors_Get() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Colors_Set() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Params_Get() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_Params_Set() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Show() : api_callback.cpp , api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_LAST : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_NEW : api_core.h
  • SG_UI_DataObject_Update() : api_core.h
  • SG_UI_DATAOBJECT_UPDATE : api_core.h
  • SG_UI_DataObject_Update() : api_callback.cpp
  • SG_UI_Diagram_Show() : api_callback.cpp , api_core.h
  • SG_UI_Dlg_Continue() : api_callback.cpp , api_core.h
  • SG_UI_Dlg_Error() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Info() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Message() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Parameters() : api_callback.cpp , api_core.h
  • SG_UI_Get_Application_Path() : api_core.h , api_callback.cpp
  • SG_UI_Get_Window_Main() : api_callback.cpp , api_core.h
  • SG_UI_MAP_ACTIVE : api_core.h
  • SG_UI_MAP_ALL : api_core.h
  • SG_UI_MAP_LAST : api_core.h
  • SG_UI_Msg_Add() : api_callback.cpp , api_core.h , api_callback.cpp , api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Msg_Add_Error() : api_core.h , api_callback.cpp
  • SG_UI_Msg_Add_Execution() : api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Msg_Flush() : api_callback.cpp , api_core.h
  • SG_UI_Msg_Lock() : api_callback.cpp , api_core.h
  • SG_UI_Msg_Reset() : api_core.h , api_callback.cpp
  • SG_UI_MSG_STYLE_01 : api_core.h
  • SG_UI_MSG_STYLE_02 : api_core.h
  • SG_UI_MSG_STYLE_03 : api_core.h
  • SG_UI_MSG_STYLE_BIG : api_core.h
  • SG_UI_MSG_STYLE_BOLD : api_core.h
  • SG_UI_MSG_STYLE_FAILURE : api_core.h
  • SG_UI_MSG_STYLE_ITALIC : api_core.h
  • SG_UI_MSG_STYLE_NORMAL : api_core.h
  • SG_UI_MSG_STYLE_SMALL : api_core.h
  • SG_UI_MSG_STYLE_SUCCESS : api_core.h
  • SG_UI_ODBC_Update() : api_callback.cpp , api_core.h
  • SG_UI_Process_Get_Okay() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Busy() : api_core.h , api_callback.cpp
  • SG_UI_Process_Set_Okay() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Progress() : api_core.h , api_callback.cpp , api_core.h , api_callback.cpp , api_core.h , api_callback.cpp
  • SG_UI_Process_Set_Ready() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Text() : api_core.h , api_callback.cpp
  • SG_UI_Progress_Lock() : api_core.h , api_callback.cpp
  • SG_UI_Progress_Reset() : api_core.h , api_callback.cpp
  • SG_UI_ProgressAndMsg_Lock() : api_core.h , api_callback.cpp
  • SG_UI_ProgressAndMsg_Reset() : api_core.h , api_callback.cpp
  • SG_UI_Set_Map_Extent() : api_callback.cpp , api_core.h
  • SG_UI_Stop_Execution() : api_callback.cpp , api_core.h
  • SG_UI_Window_Arrange() : api_callback.cpp , api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_CASCADE : api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR : api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_TILE_VER : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_TILE_VER : api_core.h
  • SG_Uninitialize_Environment() : api_core.h , api_core.cpp
  • SG_VectorR2_Rotate() : mat_matrix.cpp , mat_tools.h , mat_matrix.cpp , mat_tools.h , mat_matrix.cpp , mat_tools.h
  • SG_VectorR3_Rotate() : mat_matrix.cpp , mat_tools.h , mat_matrix.cpp
  • SG_VERTEX_TYPE_XY : shapes.h
  • SG_VERTEX_TYPE_XYZ : shapes.h
  • SG_VERTEX_TYPE_XYZM : shapes.h
  • SG_XML_Add_Parameter() : tool_summary.cpp
  • SG_XML_DESCRIPTION : tool_summary.cpp
  • SG_XML_LIBRARY : tool_summary.cpp
  • SG_XML_LIBRARY_CATEGORY : tool_summary.cpp
  • SG_XML_LIBRARY_NAME : tool_summary.cpp
  • SG_XML_LIBRARY_PATH : tool_summary.cpp
  • SG_XML_MENU : tool_summary.cpp
  • SG_XML_PARAM : tool_summary.cpp
  • SG_XML_PARAM_ATT_CLASS : tool_summary.cpp
  • SG_XML_PARAM_ATT_NAME : tool_summary.cpp
  • SG_XML_PARAM_DEFAULT : tool_summary.cpp
  • SG_XML_PARAM_FIELD : tool_summary.cpp
  • SG_XML_PARAM_FIELD_ATT_NAME : tool_summary.cpp
  • SG_XML_PARAM_FIELD_ATT_TYPE : tool_summary.cpp
  • SG_XML_PARAM_IDENTIFIER : tool_summary.cpp
  • SG_XML_PARAM_ITEM : tool_summary.cpp
  • SG_XML_PARAM_LIST : tool_summary.cpp
  • SG_XML_PARAM_MANDATORY : tool_summary.cpp
  • SG_XML_PARAM_MAX : tool_summary.cpp
  • SG_XML_PARAM_MIN : tool_summary.cpp
  • SG_XML_PARAM_PARENT : tool_summary.cpp
  • SG_XML_PARAM_TABLE : tool_summary.cpp
  • SG_XML_PARAM_TYPE : tool_summary.cpp
  • SG_XML_PARAM_WITH_CMD : tool_summary.cpp
  • SG_XML_PARAM_WITH_GUI : tool_summary.cpp
  • SG_XML_SPEC_ATT_GRID : tool_summary.cpp
  • SG_XML_SPEC_ATT_INTERA : tool_summary.cpp
  • SG_XML_SPECIFICATION : tool_summary.cpp
  • SG_XML_SYSTEM : tool_summary.cpp
  • SG_XML_SYSTEM_MLP : tool_summary.cpp
  • SG_XML_SYSTEM_VER : tool_summary.cpp
  • SG_XML_TOOL : tool_summary.cpp
  • SG_XML_TOOL_ATT_AUTHOR : tool_summary.cpp
  • SG_XML_TOOL_ATT_ID : tool_summary.cpp
  • SG_XML_TOOL_ATT_NAME : tool_summary.cpp
  • SG_XML_TOOL_ATT_VERSION : tool_summary.cpp
  • SHAPE_COPY : shapes.h
  • SHAPE_COPY_ATTR : shapes.h
  • SHAPE_COPY_GEOM : shapes.h
  • SHAPE_FILE_FORMAT_ESRI : shapes.h
  • SHAPE_FILE_FORMAT_GeoJSON : shapes.h
  • SHAPE_FILE_FORMAT_GeoPackage : shapes.h
  • SHAPE_FILE_FORMAT_Undefined : shapes.h
  • SHAPE_NO_COPY : shapes.h
  • SHAPE_TYPE_Line : shapes.h
  • SHAPE_TYPE_Point : shapes.h
  • SHAPE_TYPE_Points : shapes.h
  • SHAPE_TYPE_Polygon : shapes.h
  • SHAPE_TYPE_Undefined : shapes.h
  • SIZEOF_LONG : api_core.h
  • sLong : api_core.h
  • SORT_SWAP : grids.cpp , grid.cpp
  • STD_FNC_NUM : mat_formula.cpp
  • SUMMARY_ADD_INT : tool_summary.cpp
  • SUMMARY_ADD_STR : tool_summary.cpp
  • SWAP : mat_trend.cpp
  • SYMBOL_TLB_Finalize : tool.h
  • SYMBOL_TLB_Get_Interface : tool.h
  • SYMBOL_TLB_Initialize : tool.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- t -

  • TABLE_FILETYPE_DBase : table.h
  • TABLE_FILETYPE_Text : table.h
  • TABLE_FILETYPE_Text_NoHeadLine : table.h
  • TABLE_FILETYPE_Undefined : table.h
  • TABLE_INDEX_Ascending : table.h
  • TABLE_INDEX_Descending : table.h
  • TABLE_INDEX_None : table.h
  • TESTDIST_TYPE_Left : mat_tools.h
  • TESTDIST_TYPE_Middle : mat_tools.h
  • TESTDIST_TYPE_Right : mat_tools.h
  • TESTDIST_TYPE_TwoTail : mat_tools.h
  • TLB_INFO_Author : tool.h
  • TLB_INFO_Category : tool.h
  • TLB_INFO_Count : tool.h
  • TLB_INFO_Description : tool.h
  • TLB_INFO_File : tool.h
  • TLB_INFO_Library : tool.h
  • TLB_INFO_Menu_Path : tool.h
  • TLB_INFO_Name : tool.h
  • TLB_INFO_SAGA_Version : tool.h
  • TLB_INFO_User : tool.h
  • TLB_INFO_Version : tool.h
  • TLB_Interface : tool.h
  • TLB_INTERFACE : tool.h
  • TLB_INTERFACE_FINALIZE : tool.h
  • TLB_INTERFACE_INITIALIZE : tool.h
  • TLB_INTERFACE_SKIP_TOOL : tool.h
  • TOOL_CHAINS : tool_library.h
  • TOOL_ERROR_Calculation : tool.h
  • TOOL_ERROR_Unknown : tool.h
  • TOOL_INTERACTIVE_DRAG_BOX : tool.h
  • TOOL_INTERACTIVE_DRAG_CIRCLE : tool.h
  • TOOL_INTERACTIVE_DRAG_LINE : tool.h
  • TOOL_INTERACTIVE_DRAG_NONE : tool.h
  • TOOL_INTERACTIVE_KEY_ALT : tool.h
  • TOOL_INTERACTIVE_KEY_CTRL : tool.h
  • TOOL_INTERACTIVE_KEY_LEFT : tool.h
  • TOOL_INTERACTIVE_KEY_MIDDLE : tool.h
  • TOOL_INTERACTIVE_KEY_RIGHT : tool.h
  • TOOL_INTERACTIVE_KEY_SHIFT : tool.h
  • TOOL_INTERACTIVE_LDCLICK : tool.h
  • TOOL_INTERACTIVE_LDOWN : tool.h
  • TOOL_INTERACTIVE_LUP : tool.h
  • TOOL_INTERACTIVE_MDCLICK : tool.h
  • TOOL_INTERACTIVE_MDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE : tool.h
  • TOOL_INTERACTIVE_MOVE_LDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE_MDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE_RDOWN : tool.h
  • TOOL_INTERACTIVE_MUP : tool.h
  • TOOL_INTERACTIVE_RDCLICK : tool.h
  • TOOL_INTERACTIVE_RDOWN : tool.h
  • TOOL_INTERACTIVE_RUP : tool.h
  • TOOL_INTERACTIVE_UNDEFINED : tool.h
  • TOOL_LIBRARY : tool_library.h
  • TOOL_SCRIPT_CHAIN : tool.h
  • TOOL_SCRIPT_CMD_BATCH : tool.h
  • TOOL_SCRIPT_CMD_SHELL : tool.h
  • TOOL_SCRIPT_PYTHON : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_ID : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_ID_CALL : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_NAME : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL : tool.h
  • TOOL_TYPE_Base : tool.h
  • TOOL_TYPE_Chain : tool.h
  • TOOL_TYPE_Grid : tool.h
  • TOOL_TYPE_Grid_Interactive : tool.h
  • TOOL_TYPE_Interactive : tool.h
  • TSG_ADD_Shape_Copy_Mode : shapes.h
  • TSG_Array_Growth : api_core.h
  • TSG_Data_Object_Type : dataobject.h
  • TSG_Data_Type : api_core.h
  • TSG_Distance_Weighting : geo_tools.h
  • TSG_File_Flags_Encoding : api_core.h
  • TSG_File_Type : api_core.h
  • TSG_Formula_Function_0 : mat_tools.h
  • TSG_Formula_Function_1 : mat_tools.h
  • TSG_Formula_Function_2 : mat_tools.h
  • TSG_Formula_Function_3 : mat_tools.h
  • TSG_Grid_File_Format : grid.h
  • TSG_Grid_File_Key : grid.h
  • TSG_Grid_Operation : grid.h
  • TSG_Grid_Pyramid_Generalisation : grid_pyramid.h
  • TSG_Grid_Pyramid_Grow_Type : grid_pyramid.h
  • TSG_Grid_Resampling : grid.h
  • TSG_Grids_File_Format : grids.h
  • TSG_Intersection : geo_tools.h
  • TSG_OGIS_Type_Geometry : shapes.h
  • TSG_Parameter_Type : parameters.h
  • TSG_PFNC_Compare : mat_tools.h
  • TSG_PFNC_Parameter_Changed : parameters.h
  • TSG_PFNC_TLB_Create_Tool : tool.h
  • TSG_PFNC_TLB_Finalize : tool.h
  • TSG_PFNC_TLB_Get_Info : tool.h
  • TSG_PFNC_TLB_Get_Interface : tool.h
  • TSG_PFNC_TLB_Initialize : tool.h
  • TSG_PFNC_UI_Callback : api_core.h
  • TSG_Point : geo_tools.h
  • TSG_Point_3D : geo_tools.h
  • TSG_Point_4D : geo_tools.h
  • TSG_Point_Int : geo_tools.h
  • TSG_Point_Type : geo_tools.h
  • TSG_PointCloud_File_Type : pointcloud.h
  • TSG_Polygon_Point_Relation : shapes.h
  • TSG_Projection_Format : geo_tools.h
  • TSG_Projection_Type : geo_tools.h
  • TSG_Projection_Unit : geo_tools.h
  • TSG_Rect : geo_tools.h
  • TSG_Rect_Int : geo_tools.h
  • TSG_Regression_Correction : mat_tools.h
  • TSG_Regression_Type : mat_tools.h
  • TSG_Shape_File_Format : shapes.h
  • TSG_Shape_Type : shapes.h
  • TSG_String_Tokenizer_Mode : api_core.h
  • TSG_Summary_Format : tool.h
  • TSG_Table_File_Type : table.h
  • TSG_Table_Index_Order : table.h
  • TSG_Table_Value_Type : table_value.h
  • TSG_Test_Distribution_Type : mat_tools.h
  • TSG_TLB_Info : tool.h
  • TSG_Tool_Error : tool.h
  • TSG_Tool_Interactive_DragMode : tool.h
  • TSG_Tool_Interactive_Mode : tool.h
  • TSG_Tool_Library_Type : tool_library.h
  • TSG_Tool_Script_Type : tool.h
  • TSG_Tool_Type : tool.h
  • TSG_UI_Callback_ID : api_core.h
  • TSG_UI_DataObject_Update : api_core.h
  • TSG_UI_Maps : api_core.h
  • TSG_UI_MSG_STYLE : api_core.h
  • TSG_UI_Window_Arrange : api_core.h
  • TSG_Vertex_Type : shapes.h
  • TYPE_AS_WKB : shapes_ogis.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- u -

  • uLong : api_core.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

Here is a list of all file members with links to the files they belong to:

- w -

  • WKT_GCS_WGS84 : projections.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- _ -

  • _SG_Polygon_Clip() : shapes_polygons.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- f -

  • f_and() : mat_formula.cpp
  • f_atan2() : mat_formula.cpp
  • f_eq() : mat_formula.cpp
  • f_fmod() : mat_formula.cpp
  • f_gt() : mat_formula.cpp
  • f_ifelse() : mat_formula.cpp
  • f_int() : mat_formula.cpp
  • f_lt() : mat_formula.cpp
  • f_max() : mat_formula.cpp
  • f_min() : mat_formula.cpp
  • f_or() : mat_formula.cpp
  • f_pi() : mat_formula.cpp
  • f_pow() : mat_formula.cpp
  • f_rand_g() : mat_formula.cpp
  • f_rand_u() : mat_formula.cpp
  • f_sqr() : mat_formula.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- o -

  • operator*() : mat_matrix.cpp , mat_tools.h
  • operator+() : api_string.cpp , api_core.h , api_string.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- s -

  • SAGA_API_Get_Version() : saga_api.cpp , saga_api.h
  • SG_Add_Dll_Paths() : api_core.cpp
  • SG_Calloc() : api_core.h , api_memory.cpp
  • SG_Clipper_Get_Version() : shapes_polygons.cpp , shapes.h , shapes_clipper.cpp
  • SG_Color_From_Text() : api_colors.cpp , api_core.h
  • SG_Color_Get_Random() : api_colors.cpp , api_core.h
  • SG_Color_To_Text() : api_colors.cpp , api_core.h
  • SG_Colors_Get_Name() : api_core.h , api_colors.cpp
  • SG_Compare_Char_Ptr() : mat_tools.cpp , mat_tools.h
  • SG_Compare_Double() : mat_tools.cpp , mat_tools.h
  • SG_Compare_Int() : mat_tools.cpp , mat_tools.h
  • SG_Compare_SAGA_Version() : saga_api.cpp , saga_api.h
  • SG_Compare_Version() : saga_api.cpp , saga_api.h
  • SG_Create_Grid() : grid.cpp , grid.h , grid.cpp
  • SG_Create_Grids() : grids.h , grids.cpp , grids.h
  • SG_Create_PointCloud() : pointcloud.cpp , pointcloud.h
  • SG_Create_Shapes() : shapes.cpp , shapes.h
  • SG_Create_Table() : table.cpp , table.h
  • SG_Create_TIN() : tin.cpp , tin.h
  • SG_Data_Type_Get_Flag() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Identifier() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Name() : api_core.cpp , api_core.h
  • SG_Data_Type_Get_Size() : api_core.h
  • SG_Data_Type_Get_Type() : api_core.cpp , api_core.h
  • SG_Data_Type_is_Numeric() : api_core.cpp , api_core.h
  • SG_Data_Type_Range_Check() : api_core.cpp , api_core.h
  • SG_DataObject_Get_Max_Samples() : dataobject.cpp , dataobject.h
  • SG_DataObject_Set_Max_Samples() : dataobject.cpp , dataobject.h
  • SG_Date_To_JulianDayNumber() : datetime.cpp , datetime.h
  • SG_Decimal_To_Degree() : mat_tools.cpp , mat_tools.h
  • SG_Degree_To_Decimal() : mat_tools.cpp , mat_tools.h
  • SG_Degree_To_Double() : api_core.h , api_string.cpp
  • SG_Dir_Create() : api_core.h , api_file.cpp
  • SG_Dir_Delete() : api_core.h , api_file.cpp
  • SG_Dir_Exists() : api_core.h , api_file.cpp
  • SG_Dir_Get_Current() : api_core.h , api_file.cpp
  • SG_Dir_Get_Temp() : api_core.h , api_file.cpp
  • SG_Dir_List_Files() : api_core.h , api_file.cpp
  • SG_Dir_List_Subdirectories() : api_core.h , api_file.cpp
  • SG_Double_To_Degree() : api_core.h , api_string.cpp
  • SG_File_Cmp_Extension() : api_core.h , api_file.cpp
  • SG_File_Delete() : api_core.h , api_file.cpp
  • SG_File_Exists() : api_core.h , api_file.cpp
  • SG_File_Get_Extension() : api_core.h , api_file.cpp
  • SG_File_Get_Name() : api_core.h , api_file.cpp
  • SG_File_Get_Name_Temp() : api_core.h , api_file.cpp
  • SG_File_Get_Path() : api_core.h , api_file.cpp
  • SG_File_Get_Path_Absolute() : api_core.h , api_file.cpp
  • SG_File_Get_Path_Relative() : api_core.h , api_file.cpp
  • SG_File_Make_Path() : api_core.h , api_file.cpp
  • SG_File_Set_Extension() : api_core.h , api_file.cpp
  • SG_Flip_Decimal_Separators() : api_core.h , api_string.cpp
  • SG_Free() : api_core.h , api_memory.cpp
  • SG_FTP_Download() : metadata.cpp , metadata.h
  • SG_Get_Angle_Difference() : geo_functions.cpp , geo_tools.h
  • SG_Get_Angle_Of_Direction() : geo_functions.cpp , geo_tools.h
  • SG_Get_Correlation_Matrix() : mat_tools.cpp , mat_tools.h
  • SG_Get_Create_Pointer() : dataobject.cpp , dataobject.h
  • SG_Get_Crossing() : geo_functions.cpp , geo_tools.h
  • SG_Get_Crossing_InRegion() : geo_functions.cpp , geo_tools.h
  • SG_Get_CurrentTimeStr() : api_core.h , api_string.cpp
  • SG_Get_Data_Manager() : data_manager.cpp , data_manager.h
  • SG_Get_DataObject_Class_Name() : dataobject.cpp , dataobject.h
  • SG_Get_DataObject_Identifier() : dataobject.cpp , dataobject.h
  • SG_Get_DataObject_Name() : dataobject.cpp , dataobject.h
  • SG_Get_Day_Length() : datetime.cpp , datetime.h
  • SG_Get_Day_MidOfMonth() : datetime.cpp , datetime.h
  • SG_Get_Digit_Count() : mat_tools.cpp , mat_tools.h
  • SG_Get_Distance() : geo_functions.cpp , geo_tools.h
  • SG_Get_Distance_Polar() : geo_functions.cpp , geo_tools.h
  • SG_Get_Distance_To_Line() : geo_functions.cpp , geo_tools.h
  • SG_Get_Double_asString() : mat_tools.cpp , mat_tools.h
  • SG_Get_Environment() : api_core.h , api_file.cpp
  • SG_Get_History_Depth() : dataobject.cpp , dataobject.h
  • SG_Get_History_Ignore_Lists() : dataobject.cpp , dataobject.h
  • SG_Get_Length() : geo_functions.cpp , geo_tools.h
  • SG_Get_Nearest_Point_On_Line() : geo_functions.cpp , geo_tools.h
  • SG_Get_Polygon_Area() : geo_functions.cpp , geo_tools.h
  • SG_Get_Projected() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type_Identifier() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Type_Name() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_Identifier() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_Name() : geo_tools.h , projections.cpp
  • SG_Get_Projection_Unit_To_Meter() : geo_tools.h , projections.cpp
  • SG_Get_Projections() : geo_tools.h , projections.cpp
  • SG_Get_Rounded() : mat_tools.cpp , mat_tools.h
  • SG_Get_Rounded_To_SignificantFigures() : mat_tools.cpp , mat_tools.h
  • SG_Get_ShapeType_Name() : shapes.h , shapes.cpp
  • SG_Get_Significant_Decimals() : api_core.h , api_string.cpp
  • SG_Get_Square() : mat_tools.h , mat_tools.cpp
  • SG_Get_String() : api_string.cpp , api_core.h , api_string.cpp
  • SG_Get_Sun_Position() : datetime.h , datetime.cpp , datetime.h
  • SG_Get_Tool_Library_Manager() : tool_library.cpp , tool_library.h
  • SG_Get_Translator() : api_core.h , api_translator.cpp
  • SG_Get_Triangle_CircumCircle() : geo_functions.cpp , geo_tools.h
  • SG_Get_UI_Callback() : api_callback.cpp , api_core.h
  • SG_Grid_Cache_Get_Directory() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Mode() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Threshold() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Get_Threshold_MB() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Directory() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Mode() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Threshold() : grid.h , grid_memory.cpp
  • SG_Grid_Cache_Set_Threshold_MB() : grid.h , grid_memory.cpp
  • SG_Grid_Get_File_Extension_Default() : grid.h , grid_io.cpp
  • SG_Grid_Get_File_Format_Default() : grid.h , grid_io.cpp
  • SG_Grid_Get_Geographic_Coordinates() : geo_tools.h , projections.cpp
  • SG_Grid_Set_File_Format_Default() : grid.h , grid_io.cpp
  • SG_Hex_to_Byte() : api_memory.cpp
  • SG_Initialize_Environment() : api_core.cpp , api_core.h
  • SG_is_Angle_Between() : geo_tools.h , geo_functions.cpp
  • SG_Is_Between() : geo_functions.cpp , geo_tools.h
  • SG_is_Character_Numeric() : api_core.h , api_string.cpp
  • SG_Is_Equal() : geo_functions.cpp , geo_tools.h
  • SG_Is_Point_On_Line() : geo_tools.h , geo_functions.cpp
  • SG_JulianDayNumber_To_Date() : datetime.cpp , datetime.h , datetime.cpp
  • SG_Malloc() : api_memory.cpp , api_core.h
  • SG_Matrix_Eigen_Reduction() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_Get_Rotation() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_LU_Decomposition() : mat_tools.h , mat_matrix.cpp
  • SG_Matrix_LU_Solve() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_Solve() : mat_matrix.cpp , mat_tools.h
  • SG_Matrix_Triangular_Decomposition() : mat_matrix.cpp
  • SG_Matrix_Tridiagonal_QL() : mat_matrix.cpp
  • SG_Mem_Get_Double() : api_core.h , api_memory.cpp
  • SG_Mem_Get_Int() : api_core.h , api_memory.cpp
  • SG_Mem_Set_Double() : api_memory.cpp , api_core.h
  • SG_Mem_Set_Int() : api_memory.cpp , api_core.h
  • SG_OMP_Get_Max_Num_Procs() : api_core.h , api_core.cpp
  • SG_OMP_Get_Max_Num_Threads() : api_core.cpp , api_core.h
  • SG_OMP_Get_Thread_Num() : api_core.cpp , api_core.h
  • SG_OMP_Set_Max_Num_Threads() : api_core.cpp , api_core.h
  • SG_Parameter_Type_Get_Identifier() : parameters.h , parameter_data.cpp
  • SG_Parameter_Type_Get_Name() : parameters.h , parameter_data.cpp
  • SG_Parameter_Type_Get_Type() : parameters.h , parameter_data.cpp
  • SG_Realloc() : api_core.h , api_memory.cpp
  • SG_Regression_Get_Adjusted_R2() : mat_tools.h , mat_regression.cpp
  • SG_Set_Environment() : api_core.h , api_file.cpp
  • SG_Set_History_Depth() : dataobject.cpp , dataobject.h
  • SG_Set_History_Ignore_Lists() : dataobject.cpp , dataobject.h
  • SG_Set_Projection_Unit() : projections.cpp
  • SG_Set_UI_Callback() : api_callback.cpp , api_core.h
  • SG_Shape_Get_Difference() : shapes_clipper.cpp , shapes.h , shapes_polygons.cpp
  • SG_Shape_Get_Dissolve() : shapes_polygons.cpp , shapes.h , shapes_clipper.cpp
  • SG_Shape_Get_ExclusiveOr() : shapes_clipper.cpp , shapes.h , shapes_polygons.cpp
  • SG_Shape_Get_Intersection() : shapes.h , shapes_polygons.cpp , shapes_clipper.cpp
  • SG_Shape_Get_Offset() : shapes.h , shapes_clipper.cpp , shapes_polygons.cpp
  • SG_Shape_Get_Union() : shapes_polygons.cpp , shapes_clipper.cpp , shapes.h
  • SG_Shapes_Get_File_Extension_Default() : shapes.h , shapes.cpp
  • SG_Shapes_Get_File_Format_Default() : shapes.cpp , shapes.h
  • SG_Shapes_Set_File_Format_Default() : shapes.h , shapes.cpp
  • SG_String_Tokenize() : api_core.h , api_string.cpp
  • SG_Swap_Bytes() : api_core.h , api_memory.cpp
  • SG_TIN_Compare() : tin_triangulation.cpp
  • SG_TIN_Compare_Triangle_Center() : tin_elements.cpp
  • SG_Translate() : api_core.h , api_translator.cpp
  • SG_UI_Console_Get_UTF8() : api_callback.cpp , api_core.h
  • SG_UI_Console_Print_StdErr() : api_callback.cpp , api_core.h , api_callback.cpp
  • SG_UI_Console_Print_StdOut() : api_callback.cpp , api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Console_Set_UTF8() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Add() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_asImage() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Colors_Get() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_Colors_Set() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Params_Get() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Params_Set() : api_core.h , api_callback.cpp
  • SG_UI_DataObject_Show() : api_callback.cpp , api_core.h
  • SG_UI_DataObject_Update() : api_core.h , api_callback.cpp
  • SG_UI_Diagram_Show() : api_callback.cpp , api_core.h
  • SG_UI_Dlg_Continue() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Error() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Info() : api_core.h , api_callback.cpp
  • SG_UI_Dlg_Message() : api_callback.cpp , api_core.h
  • SG_UI_Dlg_Parameters() : api_callback.cpp , api_core.h
  • SG_UI_Get_Application_Path() : api_core.h , api_callback.cpp
  • SG_UI_Get_Window_Main() : api_core.h , api_callback.cpp
  • SG_UI_Msg_Add() : api_callback.cpp , api_core.h , api_callback.cpp
  • SG_UI_Msg_Add_Error() : api_core.h , api_callback.cpp , api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Msg_Add_Execution() : api_core.h , api_callback.cpp , api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Msg_Flush() : api_core.h , api_callback.cpp
  • SG_UI_Msg_Lock() : api_core.h , api_callback.cpp
  • SG_UI_Msg_Reset() : api_callback.cpp , api_core.h
  • SG_UI_ODBC_Update() : api_callback.cpp , api_core.h
  • SG_UI_Process_Get_Okay() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Busy() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Okay() : api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Progress() : api_core.h , api_callback.cpp , api_core.h , api_callback.cpp , api_core.h
  • SG_UI_Process_Set_Ready() : api_core.h , api_callback.cpp
  • SG_UI_Process_Set_Text() : api_callback.cpp , api_core.h
  • SG_UI_Progress_Lock() : api_core.h , api_callback.cpp
  • SG_UI_Progress_Reset() : api_callback.cpp , api_core.h
  • SG_UI_ProgressAndMsg_Lock() : api_core.h , api_callback.cpp
  • SG_UI_ProgressAndMsg_Reset() : api_core.h , api_callback.cpp
  • SG_UI_Set_Map_Extent() : api_callback.cpp , api_core.h
  • SG_UI_Stop_Execution() : api_core.h , api_callback.cpp
  • SG_UI_Window_Arrange() : api_callback.cpp , api_core.h
  • SG_Uninitialize_Environment() : api_core.cpp , api_core.h
  • SG_VectorR2_Rotate() : mat_tools.h , mat_matrix.cpp
  • SG_VectorR3_Rotate() : mat_tools.h , mat_matrix.cpp , mat_tools.h
  • SG_XML_Add_Parameter() : tool_summary.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

  • g_App_Initialize : api_core.cpp
  • g_Data_Manager : data_manager.cpp
  • g_History_Depth : dataobject.cpp
  • g_History_Ignore_Lists : dataobject.cpp
  • g_Tool_Library_Manager : tool_library.cpp
  • gSG_Data_Type_Identifier : api_core.h
  • gSG_DataObject_Max_Samples : dataobject.cpp
  • gSG_Functions : mat_formula.cpp
  • gSG_Grid_Cache_Directory : grid_memory.cpp
  • gSG_Grid_Cache_Mode : grid_memory.cpp
  • gSG_Grid_Cache_Threshold : grid_memory.cpp
  • gSG_Grid_File_Format_Default : grid_io.cpp
  • gSG_Grid_File_Key_Names : grid.h
  • gSG_Projections : projections.cpp
  • gSG_Shape_File_Format_Default : shapes.cpp
  • gSG_Translator : api_translator.cpp
  • gSG_UI_Callback : api_callback.cpp
  • gSG_UI_Console_bUTF8 : api_callback.cpp
  • gSG_UI_Msg_Lock : api_callback.cpp
  • gSG_UI_Progress_Lock : api_callback.cpp
  • SG_Projection_Units : projections.cpp
  • TLB_Interface : tool.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

  • sLong : api_core.h
  • TSG_Formula_Function_0 : mat_tools.h
  • TSG_Formula_Function_1 : mat_tools.h
  • TSG_Formula_Function_2 : mat_tools.h
  • TSG_Formula_Function_3 : mat_tools.h
  • TSG_PFNC_Compare : mat_tools.h
  • TSG_PFNC_Parameter_Changed : parameters.h
  • TSG_PFNC_TLB_Create_Tool : tool.h
  • TSG_PFNC_TLB_Finalize : tool.h
  • TSG_PFNC_TLB_Get_Info : tool.h
  • TSG_PFNC_TLB_Get_Interface : tool.h
  • TSG_PFNC_TLB_Initialize : tool.h
  • TSG_PFNC_UI_Callback : api_core.h
  • TSG_Point : geo_tools.h
  • TSG_Point_3D : geo_tools.h
  • TSG_Point_4D : geo_tools.h
  • TSG_Point_Int : geo_tools.h
  • TSG_Rect : geo_tools.h
  • TSG_Rect_Int : geo_tools.h
  • uLong : api_core.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- e -

  • ESG_Classify_Supervised : mat_tools.h
  • ESG_Cluster_Analysis_Method : mat_tools.h
  • ESG_Colors : api_core.h
  • ESG_File_Flags_Open : api_core.h
  • ESG_File_Flags_Seek : api_core.h
  • ESG_Multiple_Regression_Info_Model : mat_regression_multiple.cpp
  • ESG_Multiple_Regression_Info_Steps : mat_regression_multiple.cpp
  • ESG_Multiple_Regression_Info_Vars : mat_tools.h
  • ESG_OGIS_ByteOrder : shapes.h
  • ESG_PROJ_FIELD_ID : projections.cpp
  • ESG_Trend_String : mat_tools.h

- t -

  • TSG_ADD_Shape_Copy_Mode : shapes.h
  • TSG_Array_Growth : api_core.h
  • TSG_Data_Object_Type : dataobject.h
  • TSG_Data_Type : api_core.h
  • TSG_Distance_Weighting : geo_tools.h
  • TSG_File_Flags_Encoding : api_core.h
  • TSG_File_Type : api_core.h
  • TSG_Grid_File_Format : grid.h
  • TSG_Grid_File_Key : grid.h
  • TSG_Grid_Operation : grid.h
  • TSG_Grid_Pyramid_Generalisation : grid_pyramid.h
  • TSG_Grid_Pyramid_Grow_Type : grid_pyramid.h
  • TSG_Grid_Resampling : grid.h
  • TSG_Grids_File_Format : grids.h
  • TSG_Intersection : geo_tools.h
  • TSG_OGIS_Type_Geometry : shapes.h
  • TSG_Parameter_Type : parameters.h
  • TSG_Point_Type : geo_tools.h
  • TSG_PointCloud_File_Type : pointcloud.h
  • TSG_Polygon_Point_Relation : shapes.h
  • TSG_Projection_Format : geo_tools.h
  • TSG_Projection_Type : geo_tools.h
  • TSG_Projection_Unit : geo_tools.h
  • TSG_Regression_Correction : mat_tools.h
  • TSG_Regression_Type : mat_tools.h
  • TSG_Shape_File_Format : shapes.h
  • TSG_Shape_Type : shapes.h
  • TSG_String_Tokenizer_Mode : api_core.h
  • TSG_Summary_Format : tool.h
  • TSG_Table_File_Type : table.h
  • TSG_Table_Index_Order : table.h
  • TSG_Table_Value_Type : table_value.h
  • TSG_Test_Distribution_Type : mat_tools.h
  • TSG_TLB_Info : tool.h
  • TSG_Tool_Error : tool.h
  • TSG_Tool_Interactive_DragMode : tool.h
  • TSG_Tool_Interactive_Mode : tool.h
  • TSG_Tool_Library_Type : tool_library.h
  • TSG_Tool_Script_Type : tool.h
  • TSG_Tool_Type : tool.h
  • TSG_UI_Callback_ID : api_core.h
  • TSG_UI_DataObject_Update : api_core.h
  • TSG_UI_Maps : api_core.h
  • TSG_UI_MSG_STYLE : api_core.h
  • TSG_UI_Window_Arrange : api_core.h
  • TSG_Vertex_Type : shapes.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- c -

  • CALLBACK_DATABASE_UPDATE : api_core.h
  • CALLBACK_DATAOBJECT_ADD : api_core.h
  • CALLBACK_DATAOBJECT_ASIMAGE : api_core.h
  • CALLBACK_DATAOBJECT_COLORS_GET : api_core.h
  • CALLBACK_DATAOBJECT_COLORS_SET : api_core.h
  • CALLBACK_DATAOBJECT_PARAMS_GET : api_core.h
  • CALLBACK_DATAOBJECT_PARAMS_SET : api_core.h
  • CALLBACK_DATAOBJECT_SHOW : api_core.h
  • CALLBACK_DATAOBJECT_UPDATE : api_core.h
  • CALLBACK_DIAGRAM_SHOW : api_core.h
  • CALLBACK_DLG_CONTINUE : api_core.h
  • CALLBACK_DLG_ERROR : api_core.h
  • CALLBACK_DLG_INFO : api_core.h
  • CALLBACK_DLG_MESSAGE : api_core.h
  • CALLBACK_DLG_PARAMETERS : api_core.h
  • CALLBACK_GET_APP_PATH : api_core.h
  • CALLBACK_GET_APP_WINDOW : api_core.h
  • CALLBACK_MESSAGE_ADD : api_core.h
  • CALLBACK_MESSAGE_ADD_ERROR : api_core.h
  • CALLBACK_MESSAGE_ADD_EXECUTION : api_core.h
  • CALLBACK_PROCESS_GET_OKAY : api_core.h
  • CALLBACK_PROCESS_SET_BUSY : api_core.h
  • CALLBACK_PROCESS_SET_OKAY : api_core.h
  • CALLBACK_PROCESS_SET_PROGRESS : api_core.h
  • CALLBACK_PROCESS_SET_READY : api_core.h
  • CALLBACK_PROCESS_SET_TEXT : api_core.h
  • CALLBACK_SET_MAP_EXTENT : api_core.h
  • CALLBACK_STOP_EXECUTION : api_core.h
  • CALLBACK_WINDOW_ARRANGE : api_core.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- g -

  • GRID_FILE_FORMAT_ASCII : grid.h
  • GRID_FILE_FORMAT_Binary : grid.h
  • GRID_FILE_FORMAT_Binary_old : grid.h
  • GRID_FILE_FORMAT_Compressed : grid.h
  • GRID_FILE_FORMAT_GeoTIFF : grid.h
  • GRID_FILE_FORMAT_Undefined : grid.h
  • GRID_FILE_KEY_BYTEORDER_BIG : grid.h
  • GRID_FILE_KEY_CELLCOUNT_X : grid.h
  • GRID_FILE_KEY_CELLCOUNT_Y : grid.h
  • GRID_FILE_KEY_CELLSIZE : grid.h
  • GRID_FILE_KEY_Count : grid.h
  • GRID_FILE_KEY_DATAFILE_NAME : grid.h
  • GRID_FILE_KEY_DATAFILE_OFFSET : grid.h
  • GRID_FILE_KEY_DATAFORMAT : grid.h
  • GRID_FILE_KEY_DESCRIPTION : grid.h
  • GRID_FILE_KEY_NAME : grid.h
  • GRID_FILE_KEY_NODATA_VALUE : grid.h
  • GRID_FILE_KEY_POSITION_XMIN : grid.h
  • GRID_FILE_KEY_POSITION_YMIN : grid.h
  • GRID_FILE_KEY_TOPTOBOTTOM : grid.h
  • GRID_FILE_KEY_UNITNAME : grid.h
  • GRID_FILE_KEY_Z_FACTOR : grid.h
  • GRID_FILE_KEY_Z_OFFSET : grid.h
  • GRID_OPERATION_Addition : grid.h
  • GRID_OPERATION_Division : grid.h
  • GRID_OPERATION_Multiplication : grid.h
  • GRID_OPERATION_Subtraction : grid.h
  • GRID_PYRAMID_Arithmetic : grid_pyramid.h
  • GRID_PYRAMID_Geometric : grid_pyramid.h
  • GRID_PYRAMID_Max : grid_pyramid.h
  • GRID_PYRAMID_MaxCount : grid_pyramid.h
  • GRID_PYRAMID_Mean : grid_pyramid.h
  • GRID_PYRAMID_Min : grid_pyramid.h
  • GRID_RESAMPLING_BicubicSpline : grid.h
  • GRID_RESAMPLING_Bilinear : grid.h
  • GRID_RESAMPLING_BSpline : grid.h
  • GRID_RESAMPLING_Majority : grid.h
  • GRID_RESAMPLING_Maximum : grid.h
  • GRID_RESAMPLING_Mean_Cells : grid.h
  • GRID_RESAMPLING_Mean_Nodes : grid.h
  • GRID_RESAMPLING_Minimum : grid.h
  • GRID_RESAMPLING_NearestNeighbour : grid.h
  • GRID_RESAMPLING_Undefined : grid.h
  • GRIDS_FILE_FORMAT_Compressed : grids.h
  • GRIDS_FILE_FORMAT_GeoTIFF : grids.h
  • GRIDS_FILE_FORMAT_Normal : grids.h
  • GRIDS_FILE_FORMAT_Undefined : grids.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- i -

  • INTERSECTION_Contained : geo_tools.h
  • INTERSECTION_Contains : geo_tools.h
  • INTERSECTION_Identical : geo_tools.h
  • INTERSECTION_None : geo_tools.h
  • INTERSECTION_Overlaps : geo_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- m -

  • MLR_MODEL_CV_MSE : mat_regression_multiple.cpp
  • MLR_MODEL_CV_NRMSE : mat_regression_multiple.cpp
  • MLR_MODEL_CV_NSAMPLES : mat_regression_multiple.cpp
  • MLR_MODEL_CV_R2 : mat_regression_multiple.cpp
  • MLR_MODEL_CV_RMSE : mat_regression_multiple.cpp
  • MLR_MODEL_F : mat_regression_multiple.cpp
  • MLR_MODEL_MSE : mat_regression_multiple.cpp
  • MLR_MODEL_MSR : mat_regression_multiple.cpp
  • MLR_MODEL_NPREDICT : mat_regression_multiple.cpp
  • MLR_MODEL_NSAMPLES : mat_regression_multiple.cpp
  • MLR_MODEL_R2 : mat_regression_multiple.cpp
  • MLR_MODEL_R2_ADJ : mat_regression_multiple.cpp
  • MLR_MODEL_SE : mat_regression_multiple.cpp
  • MLR_MODEL_SIG : mat_regression_multiple.cpp
  • MLR_MODEL_SSE : mat_regression_multiple.cpp
  • MLR_MODEL_SSR : mat_regression_multiple.cpp
  • MLR_MODEL_SST : mat_regression_multiple.cpp
  • MLR_STEP_DF : mat_regression_multiple.cpp
  • MLR_STEP_DIR : mat_regression_multiple.cpp
  • MLR_STEP_F : mat_regression_multiple.cpp
  • MLR_STEP_MSE : mat_regression_multiple.cpp
  • MLR_STEP_MSR : mat_regression_multiple.cpp
  • MLR_STEP_NR : mat_regression_multiple.cpp
  • MLR_STEP_R : mat_regression_multiple.cpp
  • MLR_STEP_R2 : mat_regression_multiple.cpp
  • MLR_STEP_R2_ADJ : mat_regression_multiple.cpp
  • MLR_STEP_SE : mat_regression_multiple.cpp
  • MLR_STEP_SIG : mat_regression_multiple.cpp
  • MLR_STEP_SSE : mat_regression_multiple.cpp
  • MLR_STEP_SSR : mat_regression_multiple.cpp
  • MLR_STEP_VAR : mat_regression_multiple.cpp
  • MLR_STEP_VAR_F : mat_regression_multiple.cpp
  • MLR_STEP_VAR_SIG : mat_regression_multiple.cpp
  • MLR_VAR_ID : mat_tools.h
  • MLR_VAR_NAME : mat_tools.h
  • MLR_VAR_P : mat_tools.h
  • MLR_VAR_R : mat_tools.h
  • MLR_VAR_R2 : mat_tools.h
  • MLR_VAR_R2_ADJ : mat_tools.h
  • MLR_VAR_RCOEFF : mat_tools.h
  • MLR_VAR_SE : mat_tools.h
  • MLR_VAR_SIG : mat_tools.h
  • MLR_VAR_T : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- p -

  • PARAMETER_TYPE_Bool : parameters.h
  • PARAMETER_TYPE_Choice : parameters.h
  • PARAMETER_TYPE_Choices : parameters.h
  • PARAMETER_TYPE_Color : parameters.h
  • PARAMETER_TYPE_Colors : parameters.h
  • PARAMETER_TYPE_Data_Type : parameters.h
  • PARAMETER_TYPE_DataObject_Output : parameters.h
  • PARAMETER_TYPE_Date : parameters.h
  • PARAMETER_TYPE_Degree : parameters.h
  • PARAMETER_TYPE_Double : parameters.h
  • PARAMETER_TYPE_FilePath : parameters.h
  • PARAMETER_TYPE_FixedTable : parameters.h
  • PARAMETER_TYPE_Font : parameters.h
  • PARAMETER_TYPE_Grid : parameters.h
  • PARAMETER_TYPE_Grid_List : parameters.h
  • PARAMETER_TYPE_Grid_System : parameters.h
  • PARAMETER_TYPE_Grids : parameters.h
  • PARAMETER_TYPE_Grids_List : parameters.h
  • PARAMETER_TYPE_Int : parameters.h
  • PARAMETER_TYPE_Node : parameters.h
  • PARAMETER_TYPE_Parameters : parameters.h
  • PARAMETER_TYPE_PointCloud : parameters.h
  • PARAMETER_TYPE_PointCloud_List : parameters.h
  • PARAMETER_TYPE_Range : parameters.h
  • PARAMETER_TYPE_Shapes : parameters.h
  • PARAMETER_TYPE_Shapes_List : parameters.h
  • PARAMETER_TYPE_String : parameters.h
  • PARAMETER_TYPE_Table : parameters.h
  • PARAMETER_TYPE_Table_Field : parameters.h
  • PARAMETER_TYPE_Table_Fields : parameters.h
  • PARAMETER_TYPE_Table_List : parameters.h
  • PARAMETER_TYPE_Text : parameters.h
  • PARAMETER_TYPE_TIN : parameters.h
  • PARAMETER_TYPE_TIN_List : parameters.h
  • PARAMETER_TYPE_Undefined : parameters.h
  • POINTCLOUD_FILE_FORMAT_Compressed : pointcloud.h
  • POINTCLOUD_FILE_FORMAT_Normal : pointcloud.h
  • POINTCLOUD_FILE_FORMAT_Undefined : pointcloud.h
  • PRJ_FIELD_AUTH_NAME : projections.cpp
  • PRJ_FIELD_AUTH_SRID : projections.cpp
  • PRJ_FIELD_PROJ4TEXT : projections.cpp
  • PRJ_FIELD_SRID : projections.cpp
  • PRJ_FIELD_SRTEXT : projections.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- r -

  • REGRESSION_CORR_Claudy_3 : mat_tools.h
  • REGRESSION_CORR_None : mat_tools.h
  • REGRESSION_CORR_Olkin_Pratt : mat_tools.h
  • REGRESSION_CORR_Pratt : mat_tools.h
  • REGRESSION_CORR_Smith : mat_tools.h
  • REGRESSION_CORR_Wherry_1 : mat_tools.h
  • REGRESSION_CORR_Wherry_2 : mat_tools.h
  • REGRESSION_Exp : mat_tools.h
  • REGRESSION_Linear : mat_tools.h
  • REGRESSION_Log : mat_tools.h
  • REGRESSION_Pow : mat_tools.h
  • REGRESSION_Rez_X : mat_tools.h
  • REGRESSION_Rez_Y : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- s -

  • SG_CLASSIFY_SUPERVISED_BinaryEncoding : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_Mahalonobis : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_MaximumLikelihood : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_MinimumDistance : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_ParallelEpiped : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SAM : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SID : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_SVM : mat_tools.h
  • SG_CLASSIFY_SUPERVISED_WTA : mat_tools.h
  • SG_CLUSTERANALYSIS_Combined : mat_tools.h
  • SG_CLUSTERANALYSIS_Hill_Climbing : mat_tools.h
  • SG_CLUSTERANALYSIS_Minimum_Distance : mat_tools.h
  • SG_COLORS_ASPECT_1 : api_core.h
  • SG_COLORS_ASPECT_2 : api_core.h
  • SG_COLORS_ASPECT_3 : api_core.h
  • SG_COLORS_BLACK_BLUE : api_core.h
  • SG_COLORS_BLACK_GREEN : api_core.h
  • SG_COLORS_BLACK_RED : api_core.h
  • SG_COLORS_BLACK_WHITE : api_core.h
  • SG_COLORS_COUNT : api_core.h
  • SG_COLORS_DEFAULT : api_core.h
  • SG_COLORS_DEFAULT_BRIGHT : api_core.h
  • SG_COLORS_GREEN_BLUE : api_core.h
  • SG_COLORS_GREEN_GREY_BLUE : api_core.h
  • SG_COLORS_GREEN_RED : api_core.h
  • SG_COLORS_GREEN_RED_BLUE : api_core.h
  • SG_COLORS_NEON : api_core.h
  • SG_COLORS_PRECIPITATION : api_core.h
  • SG_COLORS_RAINBOW : api_core.h
  • SG_COLORS_RED_BLUE : api_core.h
  • SG_COLORS_RED_BLUE_GREEN : api_core.h
  • SG_COLORS_RED_GREEN : api_core.h
  • SG_COLORS_RED_GREEN_BLUE : api_core.h
  • SG_COLORS_RED_GREY_BLUE : api_core.h
  • SG_COLORS_RED_GREY_GREEN : api_core.h
  • SG_COLORS_TOPOGRAPHY : api_core.h
  • SG_COLORS_TOPOGRAPHY_2 : api_core.h
  • SG_COLORS_TOPOGRAPHY_3 : api_core.h
  • SG_COLORS_WHITE_BLUE : api_core.h
  • SG_COLORS_WHITE_GREEN : api_core.h
  • SG_COLORS_WHITE_RED : api_core.h
  • SG_COLORS_YELLOW_BLUE : api_core.h
  • SG_COLORS_YELLOW_GREEN : api_core.h
  • SG_COLORS_YELLOW_RED : api_core.h
  • SG_DATAOBJECT_TYPE_Grid : dataobject.h
  • SG_DATAOBJECT_TYPE_Grids : dataobject.h
  • SG_DATAOBJECT_TYPE_PointCloud : dataobject.h
  • SG_DATAOBJECT_TYPE_Shapes : dataobject.h
  • SG_DATAOBJECT_TYPE_Table : dataobject.h
  • SG_DATAOBJECT_TYPE_TIN : dataobject.h
  • SG_DATAOBJECT_TYPE_Undefined : dataobject.h
  • SG_DATATYPE_Binary : api_core.h
  • SG_DATATYPE_Bit : api_core.h
  • SG_DATATYPE_Byte : api_core.h
  • SG_DATATYPE_Char : api_core.h
  • SG_DATATYPE_Color : api_core.h
  • SG_DATATYPE_Date : api_core.h
  • SG_DATATYPE_Double : api_core.h
  • SG_DATATYPE_DWord : api_core.h
  • SG_DATATYPE_Float : api_core.h
  • SG_DATATYPE_Int : api_core.h
  • SG_DATATYPE_Long : api_core.h
  • SG_DATATYPE_Short : api_core.h
  • SG_DATATYPE_String : api_core.h
  • SG_DATATYPE_ULong : api_core.h
  • SG_DATATYPE_Undefined : api_core.h
  • SG_DATATYPE_Word : api_core.h
  • SG_DISTWGHT_EXP : geo_tools.h
  • SG_DISTWGHT_GAUSS : geo_tools.h
  • SG_DISTWGHT_IDW : geo_tools.h
  • SG_DISTWGHT_None : geo_tools.h
  • SG_FILE_CURRENT : api_core.h
  • SG_FILE_ENCODING_ANSI : api_core.h
  • SG_FILE_ENCODING_UNDEFINED : api_core.h
  • SG_FILE_ENCODING_UTF16BE : api_core.h
  • SG_FILE_ENCODING_UTF16LE : api_core.h
  • SG_FILE_ENCODING_UTF32BE : api_core.h
  • SG_FILE_ENCODING_UTF32LE : api_core.h
  • SG_FILE_ENCODING_UTF7 : api_core.h
  • SG_FILE_ENCODING_UTF8 : api_core.h
  • SG_FILE_END : api_core.h
  • SG_FILE_R : api_core.h
  • SG_FILE_RW : api_core.h
  • SG_FILE_START : api_core.h
  • SG_FILE_TYPE_NORMAL : api_core.h
  • SG_FILE_TYPE_ZIP : api_core.h
  • SG_FILE_W : api_core.h
  • SG_OGIS_BYTEORDER_NDR : shapes.h
  • SG_OGIS_BYTEORDER_XDR : shapes.h
  • SG_OGIS_TYPE_GeometryCollection : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionM : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionZ : shapes.h
  • SG_OGIS_TYPE_GeometryCollectionZM : shapes.h
  • SG_OGIS_TYPE_LineString : shapes.h
  • SG_OGIS_TYPE_LineStringM : shapes.h
  • SG_OGIS_TYPE_LineStringZ : shapes.h
  • SG_OGIS_TYPE_LineStringZM : shapes.h
  • SG_OGIS_TYPE_MultiLineString : shapes.h
  • SG_OGIS_TYPE_MultiLineStringM : shapes.h
  • SG_OGIS_TYPE_MultiLineStringZ : shapes.h
  • SG_OGIS_TYPE_MultiLineStringZM : shapes.h
  • SG_OGIS_TYPE_MultiPoint : shapes.h
  • SG_OGIS_TYPE_MultiPointM : shapes.h
  • SG_OGIS_TYPE_MultiPointZ : shapes.h
  • SG_OGIS_TYPE_MultiPointZM : shapes.h
  • SG_OGIS_TYPE_MultiPolygon : shapes.h
  • SG_OGIS_TYPE_MultiPolygonM : shapes.h
  • SG_OGIS_TYPE_MultiPolygonZ : shapes.h
  • SG_OGIS_TYPE_MultiPolygonZM : shapes.h
  • SG_OGIS_TYPE_Point : shapes.h
  • SG_OGIS_TYPE_PointM : shapes.h
  • SG_OGIS_TYPE_PointZ : shapes.h
  • SG_OGIS_TYPE_PointZM : shapes.h
  • SG_OGIS_TYPE_Polygon : shapes.h
  • SG_OGIS_TYPE_PolygonM : shapes.h
  • SG_OGIS_TYPE_PolygonZ : shapes.h
  • SG_OGIS_TYPE_PolygonZM : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurface : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceM : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceZ : shapes.h
  • SG_OGIS_TYPE_PolyhedralSurfaceZM : shapes.h
  • SG_OGIS_TYPE_TIN : shapes.h
  • SG_OGIS_TYPE_TINM : shapes.h
  • SG_OGIS_TYPE_TINZ : shapes.h
  • SG_OGIS_TYPE_TINZM : shapes.h
  • SG_OGIS_TYPE_Triangle : shapes.h
  • SG_OGIS_TYPE_TriangleM : shapes.h
  • SG_OGIS_TYPE_TriangleZ : shapes.h
  • SG_OGIS_TYPE_TriangleZM : shapes.h
  • SG_OGIS_TYPE_Undefined : shapes.h
  • SG_POLYGON_POINT_Edge : shapes.h
  • SG_POLYGON_POINT_Interior : shapes.h
  • SG_POLYGON_POINT_Outside : shapes.h
  • SG_POLYGON_POINT_Vertex : shapes.h
  • SG_PROJ_FMT_EPSG : geo_tools.h
  • SG_PROJ_FMT_Proj4 : geo_tools.h
  • SG_PROJ_FMT_Undefined : geo_tools.h
  • SG_PROJ_FMT_WKT : geo_tools.h
  • SG_PROJ_TYPE_CS_Geocentric : geo_tools.h
  • SG_PROJ_TYPE_CS_Geographic : geo_tools.h
  • SG_PROJ_TYPE_CS_Projected : geo_tools.h
  • SG_PROJ_TYPE_CS_Undefined : geo_tools.h
  • SG_PROJ_UNIT_Centimeter : geo_tools.h
  • SG_PROJ_UNIT_Decimeter : geo_tools.h
  • SG_PROJ_UNIT_Indian_Chain : geo_tools.h
  • SG_PROJ_UNIT_Indian_Foot : geo_tools.h
  • SG_PROJ_UNIT_Indian_Yard : geo_tools.h
  • SG_PROJ_UNIT_Int_Chain : geo_tools.h
  • SG_PROJ_UNIT_Int_Fathom : geo_tools.h
  • SG_PROJ_UNIT_Int_Foot : geo_tools.h
  • SG_PROJ_UNIT_Int_Inch : geo_tools.h
  • SG_PROJ_UNIT_Int_Link : geo_tools.h
  • SG_PROJ_UNIT_Int_Nautical_Mile : geo_tools.h
  • SG_PROJ_UNIT_Int_Statute_Mile : geo_tools.h
  • SG_PROJ_UNIT_Int_Yard : geo_tools.h
  • SG_PROJ_UNIT_Kilometer : geo_tools.h
  • SG_PROJ_UNIT_Meter : geo_tools.h
  • SG_PROJ_UNIT_Millimeter : geo_tools.h
  • SG_PROJ_UNIT_Undefined : geo_tools.h
  • SG_PROJ_UNIT_US_Chain : geo_tools.h
  • SG_PROJ_UNIT_US_Foot : geo_tools.h
  • SG_PROJ_UNIT_US_Inch : geo_tools.h
  • SG_PROJ_UNIT_US_Statute_Mile : geo_tools.h
  • SG_PROJ_UNIT_US_Yard : geo_tools.h
  • SG_SUMMARY_FMT_FLAT : tool.h
  • SG_SUMMARY_FMT_HTML : tool.h
  • SG_SUMMARY_FMT_XML : tool.h
  • SG_TABLE_VALUE_TYPE_Binary : table_value.h
  • SG_TABLE_VALUE_TYPE_Date : table_value.h
  • SG_TABLE_VALUE_TYPE_Double : table_value.h
  • SG_TABLE_VALUE_TYPE_Int : table_value.h
  • SG_TABLE_VALUE_TYPE_Long : table_value.h
  • SG_TABLE_VALUE_TYPE_String : table_value.h
  • SG_TOKEN_DEFAULT : api_core.h
  • SG_TOKEN_INVALID : api_core.h
  • SG_TOKEN_RET_DELIMS : api_core.h
  • SG_TOKEN_RET_EMPTY : api_core.h
  • SG_TOKEN_RET_EMPTY_ALL : api_core.h
  • SG_TOKEN_STRTOK : api_core.h
  • SG_TREND_STRING_Compact : mat_tools.h
  • SG_TREND_STRING_Complete : mat_tools.h
  • SG_TREND_STRING_Formula : mat_tools.h
  • SG_TREND_STRING_Formula_Parameters : mat_tools.h
  • SG_TREND_STRING_Function : mat_tools.h
  • SG_UI_DATAOBJECT_SHOW_MAP : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_LAST : api_core.h
  • SG_UI_DATAOBJECT_SHOW_MAP_NEW : api_core.h
  • SG_UI_DATAOBJECT_UPDATE : api_core.h
  • SG_UI_MAP_ACTIVE : api_core.h
  • SG_UI_MAP_ALL : api_core.h
  • SG_UI_MAP_LAST : api_core.h
  • SG_UI_MSG_STYLE_01 : api_core.h
  • SG_UI_MSG_STYLE_02 : api_core.h
  • SG_UI_MSG_STYLE_03 : api_core.h
  • SG_UI_MSG_STYLE_BIG : api_core.h
  • SG_UI_MSG_STYLE_BOLD : api_core.h
  • SG_UI_MSG_STYLE_FAILURE : api_core.h
  • SG_UI_MSG_STYLE_ITALIC : api_core.h
  • SG_UI_MSG_STYLE_NORMAL : api_core.h
  • SG_UI_MSG_STYLE_SMALL : api_core.h
  • SG_UI_MSG_STYLE_SUCCESS : api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_CASCADE : api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR : api_core.h
  • SG_UI_WINDOW_ARRANGE_MDI_TILE_VER : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR : api_core.h
  • SG_UI_WINDOW_ARRANGE_TDI_TILE_VER : api_core.h
  • SG_VERTEX_TYPE_XY : shapes.h
  • SG_VERTEX_TYPE_XYZ : shapes.h
  • SG_VERTEX_TYPE_XYZM : shapes.h
  • SHAPE_COPY : shapes.h
  • SHAPE_COPY_ATTR : shapes.h
  • SHAPE_COPY_GEOM : shapes.h
  • SHAPE_FILE_FORMAT_ESRI : shapes.h
  • SHAPE_FILE_FORMAT_GeoJSON : shapes.h
  • SHAPE_FILE_FORMAT_GeoPackage : shapes.h
  • SHAPE_FILE_FORMAT_Undefined : shapes.h
  • SHAPE_NO_COPY : shapes.h
  • SHAPE_TYPE_Line : shapes.h
  • SHAPE_TYPE_Point : shapes.h
  • SHAPE_TYPE_Points : shapes.h
  • SHAPE_TYPE_Polygon : shapes.h
  • SHAPE_TYPE_Undefined : shapes.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- t -

  • TABLE_FILETYPE_DBase : table.h
  • TABLE_FILETYPE_Text : table.h
  • TABLE_FILETYPE_Text_NoHeadLine : table.h
  • TABLE_FILETYPE_Undefined : table.h
  • TABLE_INDEX_Ascending : table.h
  • TABLE_INDEX_Descending : table.h
  • TABLE_INDEX_None : table.h
  • TESTDIST_TYPE_Left : mat_tools.h
  • TESTDIST_TYPE_Middle : mat_tools.h
  • TESTDIST_TYPE_Right : mat_tools.h
  • TESTDIST_TYPE_TwoTail : mat_tools.h
  • TLB_INFO_Author : tool.h
  • TLB_INFO_Category : tool.h
  • TLB_INFO_Count : tool.h
  • TLB_INFO_Description : tool.h
  • TLB_INFO_File : tool.h
  • TLB_INFO_Library : tool.h
  • TLB_INFO_Menu_Path : tool.h
  • TLB_INFO_Name : tool.h
  • TLB_INFO_SAGA_Version : tool.h
  • TLB_INFO_User : tool.h
  • TLB_INFO_Version : tool.h
  • TOOL_CHAINS : tool_library.h
  • TOOL_ERROR_Calculation : tool.h
  • TOOL_ERROR_Unknown : tool.h
  • TOOL_INTERACTIVE_DRAG_BOX : tool.h
  • TOOL_INTERACTIVE_DRAG_CIRCLE : tool.h
  • TOOL_INTERACTIVE_DRAG_LINE : tool.h
  • TOOL_INTERACTIVE_DRAG_NONE : tool.h
  • TOOL_INTERACTIVE_LDCLICK : tool.h
  • TOOL_INTERACTIVE_LDOWN : tool.h
  • TOOL_INTERACTIVE_LUP : tool.h
  • TOOL_INTERACTIVE_MDCLICK : tool.h
  • TOOL_INTERACTIVE_MDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE : tool.h
  • TOOL_INTERACTIVE_MOVE_LDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE_MDOWN : tool.h
  • TOOL_INTERACTIVE_MOVE_RDOWN : tool.h
  • TOOL_INTERACTIVE_MUP : tool.h
  • TOOL_INTERACTIVE_RDCLICK : tool.h
  • TOOL_INTERACTIVE_RDOWN : tool.h
  • TOOL_INTERACTIVE_RUP : tool.h
  • TOOL_INTERACTIVE_UNDEFINED : tool.h
  • TOOL_LIBRARY : tool_library.h
  • TOOL_SCRIPT_CHAIN : tool.h
  • TOOL_SCRIPT_CMD_BATCH : tool.h
  • TOOL_SCRIPT_CMD_SHELL : tool.h
  • TOOL_SCRIPT_PYTHON : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_ID : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_ID_CALL : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_NAME : tool.h
  • TOOL_SCRIPT_PYTHON_WRAP_NAME_CALL : tool.h
  • TOOL_TYPE_Base : tool.h
  • TOOL_TYPE_Chain : tool.h
  • TOOL_TYPE_Grid : tool.h
  • TOOL_TYPE_Grid_Interactive : tool.h
  • TOOL_TYPE_Interactive : tool.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- _ -

  • _SAGA_DLL_EXPORT : api_core.h
  • _SAGA_DLL_IMPORT : api_core.h
  • _TL : api_core.h
  • _TOOL_EXCEPTION : tool.cpp
  • _TW : api_core.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- a -

  • A : geo_functions.cpp
  • ADD_CELL : grid_system.cpp
  • ADD_MESSAGE_EXECUTION : tool_interactive_base.cpp , tool.cpp
  • ADD_MESSAGE_TIME : tool_interactive_base.cpp
  • ADD_TO_SPLINE : grids.cpp
  • ADD_TYPE : parameter_data.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- b -

  • B : geo_functions.cpp
  • BiCubicSpline : grid.cpp
  • BILINEAR_ADD : grid.cpp
  • BILINEAR_ADD_BYTE : grid.cpp
  • BOOL3_FALSE : shape_polygon.cpp
  • BOOL3_NOTSET : shape_polygon.cpp
  • BOOL3_TRUE : shape_polygon.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- c -

  • C : geo_functions.cpp
  • CACHE_FILE_POS : grid_memory.cpp
  • CACHE_FILE_SEEK : grid_memory.cpp
  • COLORS_SERIAL_VERSION__ASCII : api_colors.cpp
  • COLORS_SERIAL_VERSION_BINARY : api_colors.cpp
  • COMPARE : api_translator.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- d -

  • DATAOBJECT_CREATE : dataobject.h
  • DATAOBJECT_NOTSET : dataobject.h
  • DBF_FT_CHARACTER : table_dbase.h
  • DBF_FT_DATE : table_dbase.h
  • DBF_FT_FLOAT : table_dbase.h
  • DBF_FT_LOGICAL : table_dbase.h
  • DBF_FT_MEMO : table_dbase.h
  • DBF_FT_NONE : table_dbase.h
  • DBF_FT_NUMERIC : table_dbase.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- e -

  • EPSILON : mat_formula.cpp , mat_trend.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- g -

  • GET_DATUM : projections.cpp
  • GET_GROW_SIZE : shape_part.cpp , table.cpp
  • GET_ID1 : tool.cpp
  • GET_ID2 : tool.cpp
  • Get_List_Count : tool_chain.cpp
  • Get_List_Item : tool_chain.cpp
  • GET_RECORD : table.cpp
  • GET_VALUE_BUFSIZE : mat_formula.cpp
  • GET_XML_CONTENT : tool_chain.cpp
  • GRID_FILE_KEY_FALSE : grid.h
  • GRID_FILE_KEY_TRUE : grid.h
  • GRID_FILE_PRINT : grid_io.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- i -

  • IS_IDENTICAL : tin_triangulation.cpp
  • IS_ONLINE : tin_elements.cpp
  • IS_TRUE_PROPERTY : tool_chain.cpp
  • IS_TRUE_STRING : tool_chain.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- m -

  • M_ALMOST_ZERO : mat_tools.h
  • M_DEG_TO_RAD : mat_tools.h
  • M_EULER : mat_tools.h
  • m_Field_Size : pointcloud.cpp
  • M_GET_LENGTH : mat_tools.h
  • M_GET_MAX : mat_tools.h
  • M_GET_MIN : mat_tools.h
  • M_PI : mat_tools.h
  • M_PI_045 : mat_tools.h
  • M_PI_090 : mat_tools.h
  • M_PI_135 : mat_tools.h
  • M_PI_180 : mat_tools.h
  • M_PI_225 : mat_tools.h
  • M_PI_270 : mat_tools.h
  • M_PI_315 : mat_tools.h
  • M_PI_360 : mat_tools.h
  • m_pStream_Base : api_file.cpp
  • m_pStream_I : api_file.cpp
  • m_pStream_IO : api_file.cpp
  • m_pStream_O : api_file.cpp
  • M_RAD_TO_DEG : mat_tools.h
  • M_SET_MINMAX : mat_tools.h
  • M_SET_SIGN : mat_tools.h
  • M_SQR : mat_tools.h
  • M_SQRT : mat_tools.h
  • M_TINY : mat_tools.h
  • MAX_CTABLE : mat_formula.cpp
  • MAX_PARMS : mat_formula.cpp
  • Min_Samples : dataobject.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- n -

  • N_MEGABYTE_BYTES : mat_tools.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- p -

  • PARAMETER_CHECK_ALL : parameters.h
  • PARAMETER_CHECK_ENABLE : parameters.h
  • PARAMETER_CHECK_VALUES : parameters.h
  • PARAMETER_DESCRIPTION_ALL : parameters.h
  • PARAMETER_DESCRIPTION_NAME : parameters.h
  • PARAMETER_DESCRIPTION_OPTIONAL : parameters.h
  • PARAMETER_DESCRIPTION_PROPERTIES : parameters.h
  • PARAMETER_DESCRIPTION_TEXT : parameters.h
  • PARAMETER_DESCRIPTION_TYPE : parameters.h
  • PARAMETER_IGNORE_PROJECTION : parameters.h
  • PARAMETER_INFORMATION : parameters.h
  • PARAMETER_INPUT : parameters.h
  • PARAMETER_INPUT_OPTIONAL : parameters.h
  • PARAMETER_NOT_FOR_CMD : parameters.h
  • PARAMETER_NOT_FOR_GUI : parameters.h
  • PARAMETER_OPTIONAL : parameters.h
  • PARAMETER_OUTPUT : parameters.h
  • PARAMETER_OUTPUT_OPTIONAL : parameters.h
  • PC_DAT_NBYTES : pointcloud.cpp
  • PC_FILE_VERSION : pointcloud.cpp
  • PC_GET_NBYTES : pointcloud.cpp
  • PC_STR_NBYTES : pointcloud.cpp
  • PROJ4_GCS_WGS84 : projections.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- s -

  • SAGA_API_DLL_EXPORT : api_core.h
  • SAGA_MAJOR_VERSION : saga_api.h
  • SAGA_MINOR_VERSION : saga_api.h
  • SAGA_RELEASE_NUMBER : saga_api.h
  • SAGA_VERSION : saga_api.h
  • SEPARATE : parameter.cpp
  • SERVER_TRIM : metadata.cpp
  • Set_Content_Length : shapes_io.cpp
  • SG_Char : api_core.h
  • SG_COLOR_BLACK : api_core.h
  • SG_COLOR_BLUE : api_core.h
  • SG_COLOR_BLUE_DARK : api_core.h
  • SG_COLOR_BLUE_GREEN : api_core.h
  • SG_COLOR_BLUE_LIGHT : api_core.h
  • SG_COLOR_GREEN : api_core.h
  • SG_COLOR_GREEN_DARK : api_core.h
  • SG_COLOR_GREEN_LIGHT : api_core.h
  • SG_COLOR_GREY : api_core.h
  • SG_COLOR_GREY_LIGHT : api_core.h
  • SG_COLOR_NONE : api_core.h
  • SG_COLOR_PINK : api_core.h
  • SG_COLOR_PURPLE : api_core.h
  • SG_COLOR_RANDOM : api_core.h
  • SG_COLOR_RED : api_core.h
  • SG_COLOR_RED_DARK : api_core.h
  • SG_COLOR_WHITE : api_core.h
  • SG_COLOR_YELLOW : api_core.h
  • SG_COLOR_YELLOW_DARK : api_core.h
  • SG_DATATYPES_Binary : api_core.h
  • SG_DATATYPES_Bit : api_core.h
  • SG_DATATYPES_Byte : api_core.h
  • SG_DATATYPES_Char : api_core.h
  • SG_DATATYPES_Color : api_core.h
  • SG_DATATYPES_Date : api_core.h
  • SG_DATATYPES_Double : api_core.h
  • SG_DATATYPES_DWord : api_core.h
  • SG_DATATYPES_Float : api_core.h
  • SG_DATATYPES_Int : api_core.h
  • SG_DATATYPES_Integer : api_core.h
  • SG_DATATYPES_Long : api_core.h
  • SG_DATATYPES_Numeric : api_core.h
  • SG_DATATYPES_Real : api_core.h
  • SG_DATATYPES_Short : api_core.h
  • SG_DATATYPES_SInteger : api_core.h
  • SG_DATATYPES_Standard : api_core.h
  • SG_DATATYPES_String : api_core.h
  • SG_DATATYPES_Table : api_core.h
  • SG_DATATYPES_UInteger : api_core.h
  • SG_DATATYPES_ULong : api_core.h
  • SG_DATATYPES_Undefined : api_core.h
  • SG_DATATYPES_Word : api_core.h
  • SG_DEFAULT_DELIMITERS : api_core.h
  • SG_DELETE_ARRAY : api_core.h
  • SG_DELETE_SAFE : api_core.h
  • SG_FPRINTF : api_core.h
  • SG_FREE_SAFE : api_core.h
  • SG_GET_A : api_core.h
  • SG_GET_B : api_core.h
  • SG_GET_BYTE_0 : api_core.h
  • SG_GET_BYTE_1 : api_core.h
  • SG_GET_BYTE_2 : api_core.h
  • SG_GET_BYTE_3 : api_core.h
  • SG_GET_G : api_core.h
  • SG_GET_LONG : api_core.h
  • SG_GET_R : api_core.h
  • SG_GET_RGB : api_core.h
  • SG_GET_RGBA : api_core.h
  • SG_GET_XML_TAGGED_FLT : tool_summary.cpp
  • SG_GET_XML_TAGGED_INT : tool_summary.cpp
  • SG_GET_XML_TAGGED_STR : tool_summary.cpp
  • SG_GRID_HISTOGRAM_CLASSES_DEFAULT : grid.cpp , grids.cpp
  • SG_GRID_PTR_SAFE_SET_NODATA : grid.h
  • SG_GRID_PTR_SAFE_SET_VALUE : grid.h
  • SG_GRIDCELLADDR_PARM_ANNULUS : grid.h
  • SG_GRIDCELLADDR_PARM_CIRCLE : grid.h
  • SG_GRIDCELLADDR_PARM_DEFAULT : grid.h
  • SG_GRIDCELLADDR_PARM_MAPUNIT : grid.h
  • SG_GRIDCELLADDR_PARM_SECTOR : grid.h
  • SG_GRIDCELLADDR_PARM_SIZEDBL : grid.h
  • SG_GRIDCELLADDR_PARM_SQUARE : grid.h
  • SG_GRIDCELLADDR_PARM_WEIGHTING : grid.h
  • SG_GRIDS_NAME_GRID : grids.h
  • SG_GRIDS_NAME_INDEX : grids.h
  • SG_GRIDS_NAME_OWNER : grids.h
  • SG_GRIDS_NAME_VALUE : grids.h
  • SG_GRIDS_PTR_SAFE_SET_NODATA : grids.h
  • SG_GRIDS_PTR_SAFE_SET_VALUE : grids.h
  • SG_INDEX_SWAP : mat_indexing.cpp
  • SG_IS_BETWEEN : geo_tools.h
  • SG_is_NaN : api_core.h
  • SG_META_DATABASE : dataobject.h
  • SG_META_FILEPATH : dataobject.h
  • SG_META_HISTORY : dataobject.h
  • SG_META_PROJECTION : dataobject.h
  • SG_META_SOURCE : dataobject.h
  • SG_PARAMETER_DATA_SET_CHANGED : parameters.h
  • SG_PARAMETER_DATA_SET_FALSE : parameters.h
  • SG_PARAMETER_DATA_SET_TRUE : parameters.h
  • SG_PRINTF : api_core.h
  • SG_ROUND_TO_BYTE : mat_tools.h
  • SG_ROUND_TO_CHAR : mat_tools.h
  • SG_ROUND_TO_DWORD : mat_tools.h
  • SG_ROUND_TO_INT : mat_tools.h
  • SG_ROUND_TO_LONG : mat_tools.h
  • SG_ROUND_TO_SHORT : mat_tools.h
  • SG_ROUND_TO_SLONG : mat_tools.h
  • SG_ROUND_TO_ULONG : mat_tools.h
  • SG_ROUND_TO_WORD : mat_tools.h
  • SG_RUN_TOOL : tool_library.h
  • SG_RUN_TOOL_ExitOnError : tool_library.h
  • SG_RUN_TOOL_KEEP_PARMS : tool_library.h
  • SG_RUN_TOOL_KEEP_PARMS_ExitOnError : tool_library.h
  • SG_SSCANF : api_core.h
  • SG_STR_CMP : api_core.h
  • SG_STR_CPY : api_core.h
  • SG_STR_LEN : api_core.h
  • SG_STR_MBTOSG : api_core.h
  • SG_STR_TOD : api_core.h
  • SG_T : api_core.h
  • SG_TABLE_REC_FLAG_Modified : table.h
  • SG_TABLE_REC_FLAG_Selected : table.h
  • SG_TOOL_PARAMETER_SET : tool_library.h
  • SG_TOOL_PARAMLIST_ADD : tool_library.h
  • SG_TOOL_SET_DATAOBJECT_LIST : tool_library.h
  • SG_XML_DESCRIPTION : tool_summary.cpp
  • SG_XML_LIBRARY : tool_summary.cpp
  • SG_XML_LIBRARY_CATEGORY : tool_summary.cpp
  • SG_XML_LIBRARY_NAME : tool_summary.cpp
  • SG_XML_LIBRARY_PATH : tool_summary.cpp
  • SG_XML_MENU : tool_summary.cpp
  • SG_XML_PARAM : tool_summary.cpp
  • SG_XML_PARAM_ATT_CLASS : tool_summary.cpp
  • SG_XML_PARAM_ATT_NAME : tool_summary.cpp
  • SG_XML_PARAM_DEFAULT : tool_summary.cpp
  • SG_XML_PARAM_FIELD : tool_summary.cpp
  • SG_XML_PARAM_FIELD_ATT_NAME : tool_summary.cpp
  • SG_XML_PARAM_FIELD_ATT_TYPE : tool_summary.cpp
  • SG_XML_PARAM_IDENTIFIER : tool_summary.cpp
  • SG_XML_PARAM_ITEM : tool_summary.cpp
  • SG_XML_PARAM_LIST : tool_summary.cpp
  • SG_XML_PARAM_MANDATORY : tool_summary.cpp
  • SG_XML_PARAM_MAX : tool_summary.cpp
  • SG_XML_PARAM_MIN : tool_summary.cpp
  • SG_XML_PARAM_PARENT : tool_summary.cpp
  • SG_XML_PARAM_TABLE : tool_summary.cpp
  • SG_XML_PARAM_TYPE : tool_summary.cpp
  • SG_XML_PARAM_WITH_CMD : tool_summary.cpp
  • SG_XML_PARAM_WITH_GUI : tool_summary.cpp
  • SG_XML_SPEC_ATT_GRID : tool_summary.cpp
  • SG_XML_SPEC_ATT_INTERA : tool_summary.cpp
  • SG_XML_SPECIFICATION : tool_summary.cpp
  • SG_XML_SYSTEM : tool_summary.cpp
  • SG_XML_SYSTEM_MLP : tool_summary.cpp
  • SG_XML_SYSTEM_VER : tool_summary.cpp
  • SG_XML_TOOL : tool_summary.cpp
  • SG_XML_TOOL_ATT_AUTHOR : tool_summary.cpp
  • SG_XML_TOOL_ATT_ID : tool_summary.cpp
  • SG_XML_TOOL_ATT_NAME : tool_summary.cpp
  • SG_XML_TOOL_ATT_VERSION : tool_summary.cpp
  • SIZEOF_LONG : api_core.h
  • SORT_SWAP : grid.cpp , grids.cpp
  • STD_FNC_NUM : mat_formula.cpp
  • SUMMARY_ADD_INT : tool_summary.cpp
  • SUMMARY_ADD_STR : tool_summary.cpp
  • SWAP : mat_trend.cpp
  • SYMBOL_TLB_Finalize : tool.h
  • SYMBOL_TLB_Get_Interface : tool.h
  • SYMBOL_TLB_Initialize : tool.h
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- t -

  • TLB_INTERFACE : tool.h
  • TLB_INTERFACE_FINALIZE : tool.h
  • TLB_INTERFACE_INITIALIZE : tool.h
  • TLB_INTERFACE_SKIP_TOOL : tool.h
  • TOOL_INTERACTIVE_KEY_ALT : tool.h
  • TOOL_INTERACTIVE_KEY_CTRL : tool.h
  • TOOL_INTERACTIVE_KEY_LEFT : tool.h
  • TOOL_INTERACTIVE_KEY_MIDDLE : tool.h
  • TOOL_INTERACTIVE_KEY_RIGHT : tool.h
  • TOOL_INTERACTIVE_KEY_SHIFT : tool.h
  • TYPE_AS_WKB : shapes_ogis.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: File Members

- w -

  • WKT_GCS_WGS84 : projections.cpp
Generated on Thu Oct 5 2023 17:36:19 for SAGA API by doxygen 1.8.19


SAGA API: Class Index

Class Index
c | s | t
c
CSG_KDTree CSG_Parameter_Shapes_List CSG_Rects_Int CSG_TIN_Edge
CSG_KDTree_2D CSG_Parameter_String CSG_Regression CSG_TIN_Node
CSG_Array CSG_KDTree_3D CSG_Parameter_Table CSG_Regression_Multiple CSG_TIN_Triangle
CSG_Array_Int CSG_Lines CSG_Parameter_Table_Field CSG_Regression_Weighted CSG_Tool
CSG_Array_Pointer CSG_Matrix CSG_Parameter_Table_Fields CSG_Shape CSG_Tool_Chain
CSG_Array_sLong CSG_MetaData CSG_Parameter_Table_List CSG_Shape_Line CSG_Tool_Chains
CSG_Buffer CSG_Natural_Breaks CSG_Parameter_Text CSG_Shape_Part CSG_Tool_Grid
CSG_Bytes CSG_Parameter CSG_Parameter_TIN CSG_Shape_Point CSG_Tool_Grid_Interactive
CSG_Bytes_Array CSG_Parameter_Bool CSG_Parameter_TIN_List CSG_Shape_Point_Z CSG_Tool_Interactive
CSG_Category_Statistics CSG_Parameter_Choice CSG_Parameter_Value CSG_Shape_Point_ZM CSG_Tool_Interactive_Base
CSG_Classifier_Supervised CSG_Parameter_Choices CSG_Parameters CSG_Shape_Points CSG_Tool_Library
CSG_Cluster_Analysis CSG_Parameter_Color CSG_Parameters_Grid_Target CSG_Shape_Polygon CSG_Tool_Library_Interface
CSG_Colors CSG_Parameter_Colors CSG_Parameters_Point_Search CSG_Shape_Polygon_Part CSG_Tool_Library_Manager
CSG_Data_Collection CSG_Parameter_Data_Object CSG_Parameters_Point_Search_KDTree_2D CSG_Shapes CSG_Translator
CSG_Data_Manager CSG_Parameter_Data_Object_Output CSG_Point CSG_Shapes_OGIS_Converter CSG_Trend
CSG_Data_Object CSG_Parameter_Data_Type CSG_Point_3D CSG_Simple_Statistics CSG_Trend_Polynom
CSG_DateTime CSG_Parameter_Date CSG_Point_4D CSG_Spline CSG_UI_Parameter
CSG_Distance_Weighting CSG_Parameter_Degree CSG_PointCloud CSG_Stack CSG_Unique_Number_Statistics
CSG_File CSG_Parameter_Double CSG_Points CSG_String CSG_Unique_String_Statistics
CSG_File_Zip CSG_Parameter_File_Name CSG_Points_3D CSG_String_Tokenizer CSG_Unique_Value_Statistics
CSG_Formula CSG_Parameter_Fixed_Table CSG_Points_Int CSG_Strings CSG_Vector
CSG_Grid CSG_Parameter_Font CSG_PriorityQueue CSG_Table
s
CSG_Grid_Cell_Addressor CSG_Parameter_Grid CSG_PriorityQueue::CSG_PriorityQueueItem CSG_Table_DBase
CSG_Grid_Collection CSG_Parameter_Grid_List CSG_Projection CSG_Table_Record CSG_Formula::SSG_Function
CSG_Grid_File_Info CSG_Parameter_Grid_System CSG_Projections CSG_Table_Value SSG_Point
CSG_Grid_OGIS_Converter CSG_Parameter_Grids CSG_PRQuadTree CSG_Table_Value_Binary SSG_Point_3D
CSG_Grid_Pyramid CSG_Parameter_Grids_List CSG_PRQuadTree_Item CSG_Table_Value_Date SSG_Point_4D
CSG_Grid_Radius CSG_Parameter_Int CSG_PRQuadTree_Leaf CSG_Table_Value_Double SSG_Point_Int
CSG_Grid_Stack CSG_Parameter_List CSG_PRQuadTree_Leaf_List CSG_Table_Value_Int SSG_Rect
CSG_Grid_System CSG_Parameter_Node CSG_PRQuadTree_Node CSG_Table_Value_Long SSG_Rect_Int
CSG_Grids CSG_Parameter_Parameters CSG_PRQuadTree_Node_Statistics CSG_Table_Value_String
t
CSG_Histogram CSG_Parameter_PointCloud CSG_Random CSG_Test_Distribution
CSG_HTTP CSG_Parameter_PointCloud_List CSG_Rect CSG_Thin_Plate_Spline CSG_TIN::TTIN_Edge
CSG_Index CSG_Parameter_Range CSG_Rect_Int CSG_TimeSpan CSG_TIN::TTIN_Triangle
CSG_Index::CSG_Index_Compare CSG_Parameter_Shapes CSG_Rects CSG_TIN
c | s | t
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: saga_api Directory Reference

  • saga_core
  • saga_api
saga_api Directory Reference

Files

file | api_callback.cpp [code]
file | api_colors.cpp [code]
file | api_core.cpp [code]
file | api_core.h [code]
file | api_file.cpp [code]
file | api_memory.cpp [code]
file | api_string.cpp [code]
file | api_translator.cpp [code]
file | data_manager.cpp [code]
file | data_manager.h [code]
file | dataobject.cpp [code]
file | dataobject.h [code]
file | datetime.cpp [code]
file | datetime.h [code]
file | geo_classes.cpp [code]
file | geo_functions.cpp [code]
file | geo_tools.h [code]
file | grid.cpp [code]
file | grid.h [code]
file | grid_io.cpp [code]
file | grid_memory.cpp [code]
file | grid_operation.cpp [code]
file | grid_pyramid.cpp [code]
file | grid_pyramid.h [code]
file | grid_system.cpp [code]
file | grids.cpp [code]
file | grids.h [code]
file | kdtree.cpp [code]
file | mat_formula.cpp [code]
file | mat_grid_radius.cpp [code]
file | mat_indexing.cpp [code]
file | mat_matrix.cpp [code]
file | mat_mRMR.cpp [code]
file | mat_regression.cpp [code]
file | mat_regression_multiple.cpp [code]
file | mat_regression_weighted.cpp [code]
file | mat_spline.cpp [code]
file | mat_tools.cpp [code]
file | mat_tools.h [code]
file | mat_trend.cpp [code]
file | metadata.cpp [code]
file | metadata.h [code]
file | parameter.cpp [code]
file | parameter_data.cpp [code]
file | parameters.cpp [code]
file | parameters.h [code]
file | pointcloud.cpp [code]
file | pointcloud.h [code]
file | projections.cpp [code]
file | quadtree.cpp [code]
file | saga_api.cpp [code]
file | saga_api.h [code]
file | shape.cpp [code]
file | shape_line.cpp [code]
file | shape_part.cpp [code]
file | shape_point.cpp [code]
file | shape_points.cpp [code]
file | shape_polygon.cpp [code]
file | shapes.cpp [code]
file | shapes.h [code]
file | shapes_clipper.cpp [code]
file | shapes_io.cpp [code]
file | shapes_ogis.cpp [code]
file | shapes_polygons.cpp [code]
file | shapes_selection.cpp [code]
file | table.cpp [code]
file | table.h [code]
file | table_dbase.cpp [code]
file | table_dbase.h [code]
file | table_io.cpp [code]
file | table_record.cpp [code]
file | table_selection.cpp [code]
file | table_value.h [code]
file | tin.cpp [code]
file | tin.h [code]
file | tin_elements.cpp [code]
file | tin_triangulation.cpp [code]
file | tool.cpp [code]
file | tool.h [code]
file | tool_chain.cpp [code]
file | tool_chain.h [code]
file | tool_grid.cpp [code]
file | tool_grid_interactive.cpp [code]
file | tool_interactive.cpp [code]
file | tool_interactive_base.cpp [code]
file | tool_library.cpp [code]
file | tool_library.h [code]
file | tool_library_interface.cpp [code]
file | tool_summary.cpp [code]
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: saga_core Directory Reference

  • saga_core
saga_core Directory Reference

Directories

directory saga_api
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19


SAGA API: Main Page

SAGA API Documentation
Generated on Thu Oct 5 2023 17:36:18 for SAGA API by doxygen 1.8.19